:root {
  --bg: #121417;
  --card: #1e2228;
  --border: #2e343d;
  --accent: #e66000;
  --accent-hover: #ff7518;
  --green: #00e676;
  --text: #ffffff;
  --sub: #9aa4b2;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  margin: 0;
  padding: 0 12px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.site-header {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.brand-tag {
  font-size: 11px;
  color: var(--sub);
  display: block;
  font-weight: 500;
}
.header-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
}
.header-nav a {
  color: var(--sub);
  text-decoration: none;
  transition: color 0.15s;
}
.header-nav a:hover {
  color: var(--text);
}
.header-nav .nav-pill {
  background: rgba(230, 96, 0, 0.15);
  color: var(--accent);
  border: 1px solid rgba(230, 96, 0, 0.4);
  padding: 5px 10px;
  border-radius: 6px;
}
.lang-select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.container {
  max-width: 680px;
  width: 100%;
  flex: 1;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.card-highlight {
  border: 1px solid rgba(230, 96, 0, 0.55);
  background: linear-gradient(
    180deg,
    rgba(230, 96, 0, 0.08) 0%,
    var(--card) 100%
  );
}
.card-highlight.unlock-focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(230, 96, 0, 0.28),
    0 12px 30px rgba(0, 0, 0, 0.55);
}
h1 {
  margin: 0 0 6px 0;
  font-size: 19px;
  color: var(--accent);
  letter-spacing: -0.3px;
}
h2 {
  margin: 0 0 6px 0;
  font-size: 17px;
  color: var(--text);
}
p {
  margin: 0 0 14px 0;
  color: var(--sub);
  font-size: 13.5px;
  line-height: 1.5;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ftp-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sub);
}
input[type="number"],
input[type="text"] {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}
input[type="number"] {
  width: 88px;
}
.dropzone {
  border: 2px dashed #4a5361;
  border-radius: 12px;
  padding: 22px 14px;
  text-align: center;
  cursor: pointer;
  transition: 0.2s;
  background: rgba(255, 255, 255, 0.02);
}
.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(230, 96, 0, 0.08);
}
textarea {
  width: 100%;
  height: 92px;
  background: var(--bg);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  margin-top: 8px;
  resize: vertical;
}
.output-box {
  background: #0d0f12;
  border: 1px solid #00a64a;
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  color: var(--green);
  word-break: break-all;
  margin: 10px 0 16px;
  min-height: 22px;
  user-select: all;
}
button,
.cta-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover,
.cta-btn:hover {
  background: var(--accent-hover);
}
.secondary-btn {
  background: rgba(230, 96, 0, 0.14);
  color: var(--accent);
  border: 1px solid rgba(230, 96, 0, 0.4);
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 6px;
}
.secondary-btn:hover {
  background: rgba(230, 96, 0, 0.25);
  color: #fff;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: #2e343d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.chart-wrapper {
  position: relative;
  margin-top: 10px;
  background: #14171b;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 46px 10px 10px 10px;
  user-select: none;
  touch-action: pan-y;
}
.chart-tooltip {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  height: 30px;
  background: #1e232a;
  border: 1px solid #38414d;
  border-radius: 6px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #e2e8f0;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
}
.tooltip-step {
  font-weight: 700;
  color: var(--accent);
}
.tooltip-watts {
  font-weight: 700;
  color: #fff;
}
.preview-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 110px;
  width: 100%;
  position: relative;
}
.ftp-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: 2;
}
.bar {
  height: 20%;
  min-width: 2px;
  border-radius: 3px 3px 0 0;
  transition:
    opacity 0.1s,
    transform 0.1s;
  position: relative;
  cursor: crosshair;
}
.bar.active {
  outline: 2px solid #ffffff;
  z-index: 3;
  filter: brightness(1.25);
}
.end-marker {
  height: 100%;
  width: 18px;
  min-width: 18px;
  border-left: 2px dashed var(--accent);
  background: repeating-linear-gradient(
    45deg,
    rgba(230, 96, 0, 0.08),
    rgba(230, 96, 0, 0.08) 4px,
    rgba(255, 255, 255, 0.06) 4px,
    rgba(255, 255, 255, 0.06) 8px
  );
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 4px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  z-index: 3;
}
.end-marker.active {
  outline: 2px solid var(--accent);
  background: rgba(230, 96, 0, 0.25);
  color: #fff;
}
.end-marker span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 1px;
  font-size: 9px;
  margin-top: 2px;
}

.step-list {
  font-size: 12px;
  color: var(--sub);
  margin-top: 12px;
  max-height: 165px;
  overflow-y: auto;
  line-height: 1.7;
  padding-right: 4px;
}
.step-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.step-row.active {
  background: rgba(230, 96, 0, 0.2);
  color: #fff;
}
.step-row.end-row {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 6px;
  color: var(--accent);
  font-weight: 700;
}

.license-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.device-id-input {
  width: 175px !important;
  font-size: 14px !important;
  text-align: center;
  letter-spacing: 1px;
}
.error-msg {
  color: #ff5252;
  font-size: 12px;
  margin-top: 8px;
  display: none;
  font-weight: 600;
}
.spam-notice {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(230, 96, 0, 0.1);
  border: 1px solid rgba(230, 96, 0, 0.35);
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.45;
}
.waiver-notice {
  margin-top: 8px;
  color: var(--sub);
  font-size: 11px;
  line-height: 1.4;
}

/* Collapsible FAQ / Setup Guide */
.faq-item {
  background: #15181d;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item:last-child {
  margin-bottom: 0;
}
.faq-item summary {
  padding: 12px 14px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f1f5f9;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  margin-left: 10px;
}
.faq-item[open] summary::after {
  content: "−";
}
.faq-item summary:hover {
  background: rgba(255, 255, 255, 0.03);
}
.faq-body {
  padding: 2px 14px 14px;
  font-size: 13px;
  color: var(--sub);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.faq-body ol,
.faq-body ul {
  padding-left: 18px;
  margin: 8px 0 0;
}
.faq-body li {
  margin-bottom: 6px;
}

.store-card {
  text-align: center;
  padding: 18px;
}
.promo-banner {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 14px;
  display: block;
}

.site-footer {
  width: 100%;
  max-width: 680px;
  margin-top: 16px;
  text-align: center;
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 12px;
  color: var(--sub);
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.footer-links a {
  color: var(--sub);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--accent);
}

.legal-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 999;
  padding: 16px;
  overflow-y: auto;
  justify-content: center;
  align-items: center;
}
.legal-dialog {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  max-width: 580px;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}
.legal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.legal-tab {
  background: #14171b;
  color: var(--sub);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.legal-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.legal-body {
  overflow-y: auto;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.65;
  padding-right: 6px;
}
.legal-body h3 {
  color: #fff;
  font-size: 15px;
  margin: 12px 0 6px;
}
.legal-body ul {
  padding-left: 18px;
  margin: 6px 0 12px;
}

@media (max-width: 480px) {
  .card {
    padding: 16px;
  }
  .chart-tooltip {
    font-size: 11px;
  }
  .license-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .device-id-input {
    width: 100% !important;
  }
}
