/* ==================================================================
   HM Bot Trader — "HMLINE" design system
   Sharp · editorial · flat · single cobalt accent
   ================================================================== */

@import url(assets/fonts/fonts.css);

/* ------------------------------------------------------------------
   Theme tokens — dark is the default; [data-theme="light"] overrides
   ------------------------------------------------------------------ */
:root {
  color-scheme: dark;

  --paper: #0e0f13;
  --card: #16181e;
  --ink: #eef0f4;
  --ink-2: #b9bdc8;
  --muted: #7d818d;
  --line: #252833;
  --line-2: #363a46;

  --accent: #5b66ff;
  --accent-ink: #4651e8;
  --accent-soft: rgba(91, 102, 255, 0.14);

  --up: #2fbf71;
  --up-soft: rgba(47, 191, 113, 0.14);
  --down: #ff5c61;
  --down-soft: rgba(255, 92, 97, 0.14);
  --warn: #ff9d3c;
  --gold: #e0a83c;
  --gold-soft: rgba(224, 168, 60, 0.16);

  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-grid-strong: rgba(255, 255, 255, 0.18);
  --chart-grid-label: #7d818d;
  --chart-crosshair: rgba(255, 255, 255, 0.35);
  --chart-band: rgba(91, 102, 255, 0.1);
  --chart-equity-fade: rgba(91, 102, 255, 0.3);
  --chart-equity-fade-low: rgba(91, 102, 255, 0.02);

  --solid: #0a0b0e;
  --solid-fg: #ffffff;

  --radius: 2px;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Code", Consolas, "Courier New", monospace;
  --shadow: none;
}

html[data-theme="light"] {
  color-scheme: light;

  --paper: #f6f6f2;
  --card: #ffffff;
  --ink: #111113;
  --ink-2: #3a3a40;
  --muted: #8a8a90;
  --line: #e6e5e0;
  --line-2: #d6d5d0;

  --accent: #2f3bff;
  --accent-ink: #2029d0;
  --accent-soft: #eef0ff;

  --up: #0a9e5c;
  --up-soft: #e6f6ee;
  --down: #e5484d;
  --down-soft: #fdeaeb;
  --warn: #c2410c;
  --gold: #b8860b;
  --gold-soft: #fdf4e1;

  --chart-grid: rgba(17, 17, 19, 0.07);
  --chart-grid-strong: rgba(17, 17, 19, 0.18);
  --chart-grid-label: #8a8a90;
  --chart-crosshair: rgba(17, 17, 19, 0.4);
  --chart-band: rgba(47, 59, 255, 0.06);
  --chart-equity-fade: rgba(47, 59, 255, 0.28);
  --chart-equity-fade-low: rgba(47, 59, 255, 0.02);

  --solid: #111113;
  --solid-fg: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--display);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border: 2px solid var(--paper);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.accent {
  color: var(--accent);
}

/* --- shell layout --------------------------------------------------- */
.shell {
  display: flex;
  height: 100vh;
}

/* --- icon rail ------------------------------------------------------ */
.rail {
  width: 56px;
  flex: 0 0 56px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--card);
  border-right: 1px solid var(--line);
}

.rail-logo {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-style: italic;
  font-size: 15px;
  letter-spacing: -0.5px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.rail-logo .c {
  color: var(--accent);
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.rail-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 6px 0;
  gap: 2px;
}

.rail-btn {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}

.rail-btn:hover {
  color: var(--ink);
}

.rail-btn.active {
  color: var(--solid-fg);
  background: var(--solid);
}

.rail-btn .tip {
  position: absolute;
  left: 58px;
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--solid);
  color: var(--solid-fg);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 50;
}

.rail-btn:hover .tip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.rail-btn .count {
  position: absolute;
  top: 7px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.rail-btn .count.show {
  display: inline-flex;
}

.rail-foot {
  border-top: 1px solid var(--line);
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rail-dot {
  width: 9px;
  height: 9px;
  background: var(--muted);
}

.rail-dot.ok {
  background: var(--up);
  animation: pulseDot 1.6s ease infinite;
}

.rail-dot.warn {
  background: var(--warn);
}

@keyframes pulseDot {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(10, 158, 92, 0.4);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(10, 158, 92, 0);
  }
}

/* --- main column ---------------------------------------------------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* --- topbar --------------------------------------------------------- */
.topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 17px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand .sub {
  font-style: normal;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--muted);
  margin-left: 10px;
  text-transform: uppercase;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clock {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  margin-left: 6px;
}

/* --- tags ----------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 9px;
  background: var(--card);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
}

.tag .dot {
  width: 6px;
  height: 6px;
  background: currentColor;
}

.tag.green {
  background: var(--up-soft);
  border-color: var(--up);
  color: var(--up);
}
.tag.red {
  background: var(--down-soft);
  border-color: var(--down);
  color: var(--down);
}
.tag.gold {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}
.tag.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tag.ink {
  background: var(--solid);
  border-color: var(--solid);
  color: var(--solid-fg);
}

/* --- statusline ----------------------------------------------------- */
.statusline {
  height: 28px;
  flex: 0 0 28px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.statusline .sl b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.statusline .sl.accent b {
  color: var(--accent);
}

.statusline .grow {
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- content -------------------------------------------------------- */
.content {
  flex: 1;
  overflow-y: auto;
  background: var(--paper);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: rise 0.18s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --- stats band ----------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.stats.auto {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.stat {
  padding: 14px 20px 13px;
  border-right: 1px solid var(--line);
  position: relative;
  min-width: 0;
}

.stat:last-child {
  border-right: none;
}

.stat .slabel {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.stat .slabel::before {
  content: "▪";
  color: var(--accent);
  margin-right: 6px;
  font-size: 9px;
}

.stat .svalue {
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.5px;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat .ssub {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--muted);
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat .ssub.warn {
  color: var(--warn);
}

.stat .ssub.good {
  color: var(--up);
}

.stat.up .svalue {
  color: var(--up);
}
.stat.down .svalue {
  color: var(--down);
}

/* --- buttons -------------------------------------------------------- */
.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.btn-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-2);
  background: var(--card);
  color: var(--ink);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: var(--solid);
  border-color: var(--solid);
  color: var(--solid-fg);
}

.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-ink);
  border-color: var(--accent-ink);
}

.btn.danger {
  color: var(--down);
  border-color: rgba(229, 72, 77, 0.5);
}

.btn.danger:hover:not(:disabled) {
  background: var(--down);
  border-color: var(--down);
  color: #fff;
}

.btn.ghost {
  border-color: transparent;
  color: var(--muted);
  background: none;
}

.btn.ghost:hover:not(:disabled) {
  background: none;
  color: var(--ink);
}

/* --- theme toggle -------------------------------------------------- */
.theme-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius);
}

.theme-toggle svg {
  display: block;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

/* --- main grid ------------------------------------------------------ */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  background: var(--card);
}

@media (max-width: 1000px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--card);
  min-width: 0;
}

.panel + .panel {
  border-left: 1px solid var(--line);
}

@media (max-width: 1000px) {
  .panel + .panel {
    border-left: none;
    border-top: 1px solid var(--line);
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-head h3::before {
  content: "▪ ";
  color: var(--accent);
}

.panel-head .live {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.panel-body {
  padding: 12px 16px;
}

.chart-box {
  position: relative;
  width: 100%;
  height: 340px;
}

.chart-box.small {
  height: 210px;
}

.chart-box canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: fixed;
  z-index: 99;
  display: none;
  min-width: 132px;
  background: var(--solid);
  color: var(--muted);
  border: none;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  pointer-events: none;
}

.chart-tooltip b {
  color: #fff;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.chart-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chart-tooltip i {
  font-style: normal;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* --- signal panel --------------------------------------------------- */
.signal-box {
  padding: 18px 16px 14px;
}

.signal-big {
  font-size: 34px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1px;
  line-height: 1;
}

.signal-big.buy {
  color: var(--up);
}
.signal-big.sell {
  color: var(--down);
}
.signal-big.hold {
  color: var(--muted);
}

.signal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.signal-reason {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 10px;
  min-height: 32px;
}

.gauge {
  margin-top: 14px;
}

.gauge-cap {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 5px;
}

.gauge-bar {
  height: 6px;
  background: var(--line);
  position: relative;
}

.gauge-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}

.kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.kv:last-child {
  border-bottom: none;
}

.kv .k {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.kv .v {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.kv .v.muted {
  color: var(--muted);
  font-weight: 400;
}

/* --- risk list ------------------------------------------------------ */
.risk-list {
  padding: 6px 0;
}

.risk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-left: 3px solid var(--up);
  color: var(--ink-2);
}

.risk-row.blocked {
  border-left-color: var(--warn);
}

.risk-row.halt {
  border-left-color: var(--down);
}

/* --- tables --------------------------------------------------------- */
.tbl-wrap {
  overflow: auto;
  max-height: 420px;
}

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: var(--card);
}

table.tbl th {
  text-align: left;
  padding: 8px 14px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  white-space: nowrap;
}

table.tbl td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.tbl tr:hover td {
  background: var(--accent-soft);
}

table.tbl tr:last-child td {
  border-bottom: none;
}

.mono {
  font-family: var(--mono);
}

.money-up {
  color: var(--up);
}
.money-down {
  color: var(--down);
}

/* --- tags in tables ------------------------------------------------- */
.tbadge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  padding: 2px 7px;
  border: 1px solid currentColor;
}

.tbadge.buy {
  color: var(--up);
  background: var(--up-soft);
}
.tbadge.sell {
  color: var(--down);
  background: var(--down-soft);
}
.tbadge.win {
  color: var(--up);
  background: var(--up-soft);
}
.tbadge.loss {
  color: var(--down);
  background: var(--down-soft);
}
.tbadge.hold {
  color: var(--muted);
  background: var(--paper);
}

/* --- empty states --------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 20px;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 22px 22px;
}

.empty h4 {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 6px;
}

.empty p {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 340px;
  font-family: var(--display);
}

/* --- logs ----------------------------------------------------------- */
.logs-box {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  height: 420px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.8;
}

.log-line {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 2px 0;
}

.log-line .log-time {
  color: var(--muted);
  flex: 0 0 auto;
}

.log-line .log-msg {
  color: var(--ink-2);
  word-break: break-word;
}

/* --- strategy page -------------------------------------------------- */
.strategy-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

@media (max-width: 900px) {
  .strategy-grid {
    grid-template-columns: 1fr;
  }
}

.rule-list {
  background: var(--card);
}

.rule-row {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.rule-row .num {
  font-size: 22px;
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  width: 38px;
  flex: 0 0 38px;
}

.rule-row h5 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.rule-row p {
  font-size: 12px;
  color: var(--muted);
  max-width: 420px;
}

/* --- settings ------------------------------------------------------- */
.settings-grid {
  background: var(--card);
}

.sgroup {
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.sgroup:last-child {
  border-bottom: none;
}

.sgroup-head {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.sgroup-head::before {
  content: "▪ ";
  color: var(--accent);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field select {
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.12s ease;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
}

.field input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.field.check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
}

.field.check label {
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-2);
}

.hint {
  font-size: 11px;
  color: var(--muted);
}

.settings-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

/* --- toast ---------------------------------------------------------- */
.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  max-width: 380px;
  background: var(--solid);
  color: var(--solid-fg);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  border-left-color: var(--down);
}
.toast.success {
  border-left-color: var(--up);
}

/* --- activation gate ------------------------------------------------ */
.license-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1px, var(--line-2) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  overflow-y: auto;
}

.license-overlay[hidden] {
  display: none;
}

.license-card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 36px 34px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.license-logo {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  font-size: 18px;
  margin-bottom: 20px;
}

.license-title {
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.license-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

.license-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.license-price .amount {
  font-size: 44px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.5px;
  color: var(--accent);
  line-height: 1;
}

.license-price .unit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}

.license-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 330px;
}

.license-pay {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 12px;
}

.license-pay.hidden,
.license-alternate.hidden {
  display: none;
}

.license-alternate {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 12px;
}

.license-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 22px 0 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.license-divider::before,
.license-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.license-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
}

.license-input-row input {
  flex: 1;
  min-width: 0;
  background: var(--paper);
  border: 1px solid var(--line-2);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.12s ease;
}

.license-input-row input:focus {
  border-color: var(--accent);
}

.license-input-row .btn {
  flex: 0 0 auto;
  padding: 11px 18px;
}

.license-error {
  width: 100%;
  min-height: 18px;
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--down);
  text-align: center;
}

.license-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 14px;
  max-width: 320px;
  line-height: 1.6;
}

/* --- crypto payment rows -------------------------------------------- */
.license-crypto {
  width: 100%;
  text-align: left;
}

.license-crypto[hidden] {
  display: none;
}

.license-crypto-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 14px;
}

.license-crypto-sub em {
  font-style: italic;
  color: var(--ink);
}

.crypto-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
}

.crypto-badge {
  flex: 0 0 auto;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  background: var(--accent-soft);
}

.crypto-badge small {
  font-size: 7.5px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.crypto-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.crypto-addr {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 11px 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.4px;
  color: var(--ink);
  line-height: 1.2;
}

.crypto-copy {
  flex: 0 0 auto;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0 12px;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.crypto-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.crypto-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.crypto-tools .btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  font-size: 11px;
}

.crypto-status {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3px;
  line-height: 1.5;
  color: var(--muted);
}

.crypto-status-ok {
  color: var(--up);
}

/* --- payment modal --------------------------------------------------- */
.payment-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1px, var(--line-2) 1px, transparent 1px),
    var(--paper);
  background-size: 22px 22px;
  overflow-y: auto;
}

.payment-modal[hidden] {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 430px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s ease;
}

.modal-close:hover {
  color: var(--ink);
}

.payment-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 36px 34px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.payment-logo {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  font-size: 18px;
  margin-bottom: 20px;
}

.payment-title {
  font-size: 26px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.payment-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
}

.payment-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.payment-price .amount {
  font-size: 44px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.5px;
  color: var(--accent);
  line-height: 1;
}

.payment-price .unit {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
}

.payment-desc {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 330px;
}

.payment-pay {
  width: 100%;
  justify-content: center;
  padding: 14px 18px;
  font-size: 12px;
}

.payment-pay.hidden,
.payment-alternate.hidden {
  display: none;
}

.payment-alternate {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 12px;
}

.payment-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 22px 0 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.payment-divider::before,
.payment-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.payment-crypto {
  width: 100%;
  text-align: left;
}

.payment-crypto[hidden] {
  display: none;
}

.crypto-sub {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 16px;
}

.crypto-sub em {
  font-style: italic;
  color: var(--ink);
}

/* --- text link ------------------------------------------------------ */
.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.12s ease;
  cursor: pointer;
}

.text-link:hover {
  opacity: 0.8;
}

.license-link-row {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 18px;
  margin-bottom: 8px;
}

/* --- misc ----------------------------------------------------------- */
.section-title {
  padding: 14px 20px 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.hidden {
  display: none !important;
}
