/* Mcp Cloud — monochrome / glass dark design system.
   Color is reserved for state (success/warn/error). Zero external fonts/CDNs. */
:root {
  --bg: #000000;
  --bg-1: #0a0a0a;
  --bg-2: #111111;
  --panel: #0c0c0c;
  --panel-glass: rgba(14, 14, 14, 0.78);
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --surface-hover: rgba(255, 255, 255, 0.04);
  --fg: #ededed;
  --fg-dim: #a1a1a1;
  --fg-faint: #8a8a8a;
  --white: #ffffff;
  --ok: #38d888;
  --ok-bg: rgba(56, 216, 136, 0.10);
  --warn: #e3b341;
  --warn-bg: rgba(227, 179, 65, 0.10);
  --err: #ef5350;
  --err-bg: rgba(239, 83, 80, 0.10);
  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.12);
  --radius: 10px;
  --radius-lg: 16px;
  --maxw: 1180px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.18; margin: 0; }
p { margin: 0; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.mono { font-family: var(--mono); }
.dim { color: var(--fg-dim); }
.faint { color: var(--fg-faint); }
.hidden { display: none !important; }
.w-full { width: 100%; }
.mt-xs { margin-top: 6px; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mt-xl { margin-top: 34px; }
.mb-sm { margin-bottom: 10px; }
.mb-md { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.cluster { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.link { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--white); }

/* ---- header & mobile drawer ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(12px);
  background: rgba(0, 0, 0, 0.78);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; flex: none; }
.brand .logo { width: 24px; height: 24px; }
.brand-sm { font-size: 13px; }
.nav-links { display: flex; gap: 20px; margin-left: 6px; }
.nav-links a { color: var(--fg-dim); font-size: 14px; transition: color .15s; white-space: nowrap; }
.nav-links a:hover { color: var(--fg); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-auth { display: inline-flex; align-items: center; gap: 8px; }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.nav-drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.96);
  padding: 14px 24px 18px;
}
.nav-drawer.open { display: flex; flex-direction: column; gap: 10px; }
.nav-drawer a { padding: 8px 0; color: var(--fg-dim); font-size: 14px; border-bottom: 1px solid var(--line); }
.nav-drawer a:last-child { border-bottom: 0; }
.nav-drawer-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }

.bal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 216, 136, 0.35);
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--mono);
  white-space: nowrap;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.36); background: var(--surface-hover); }
.btn-primary { background: var(--white); color: #000; border-color: var(--white); font-weight: 600; }
.btn-primary:hover { background: #e2e2e2; border-color: #e2e2e2; }
.btn-ghost { border-color: transparent; color: var(--fg-dim); }
.btn-ghost:hover { color: var(--fg); border-color: var(--line); background: var(--surface-hover); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .48; cursor: not-allowed; }
.btn-danger { color: var(--err); border-color: rgba(239, 83, 80, 0.42); }
.btn-danger:hover { border-color: var(--err); background: var(--err-bg); }
.btn-ok { color: var(--ok); border-color: rgba(56, 216, 136, 0.42); }
.btn-ok:hover { border-color: var(--ok); background: var(--ok-bg); }

/* ---- lang toggle ---- */
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; flex: none; }
.lang button { background: transparent; color: var(--fg-faint); border: 0; height: 30px; padding: 0 10px; font-size: 12px; cursor: pointer; font-weight: 600; font-family: inherit; }
.lang button.active { background: var(--bg-2); color: var(--fg); }

/* ---- hero ---- */
.hero { position: relative; padding: 92px 0 74px; overflow: hidden; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% -10%, rgba(255, 255, 255, 0.11), transparent 70%),
    linear-gradient(transparent 0 39px, var(--line) 39px 40px) 0 0 / 40px 40px,
    linear-gradient(90deg, transparent 0 39px, var(--line) 39px 40px) 0 0 / 40px 40px;
  mask-image: radial-gradient(75% 65% at 50% 20%, #000 40%, transparent 88%);
  opacity: .52;
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 840px; margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-dim);
  border: 1px solid var(--line);
  background: rgba(12, 12, 12, 0.8);
  border-radius: 999px;
  padding: 5px 13px;
  margin-bottom: 24px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
h1.title { font-size: clamp(36px, 5.8vw, 64px); font-weight: 600; }
.hero p.sub { margin: 20px auto 0; max-width: 640px; font-size: 17.5px; color: var(--fg-dim); }
.hero-cta { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.metrics { display: flex; gap: 36px; justify-content: center; margin-top: 52px; flex-wrap: wrap; }
.metric .n { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.metric .n small { font-size: 15px; font-weight: 500; color: var(--fg-dim); margin-left: 2px; }
.metric .l { font-size: 13px; color: var(--fg-faint); margin-top: 4px; }

/* ---- showcase ---- */
.hero-preview {
  position: relative;
  z-index: 1;
  margin: 52px auto 0;
  max-width: 980px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--panel-glass);
  backdrop-filter: blur(12px);
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
}
.showcase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 18, 18, 0.85);
  flex-wrap: wrap;
}
.window-dots { display: inline-flex; gap: 6px; align-items: center; }
.window-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); display: inline-block; }
.showcase-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.showcase-tabs button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg-dim);
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.showcase-tabs button.active {
  background: var(--bg-2);
  border-color: var(--line-2);
  color: var(--fg);
}
.showcase-frame { position: relative; background: #050505; }
.showcase-frame img { display: block; width: 100%; height: auto; max-height: 540px; object-fit: cover; object-position: top; }
.showcase-caption {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--fg-dim);
  flex-wrap: wrap;
}

/* ---- sections ---- */
section.block { padding: 78px 0; border-top: 1px solid var(--line); }
.sec-head { max-width: 680px; margin-bottom: 40px; }
.sec-head .kicker { font-size: 12.5px; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .14em; font-weight: 600; }
.sec-head h2 { font-size: clamp(26px, 4vw, 38px); font-weight: 600; margin-top: 12px; }
.sec-head p { margin-top: 12px; color: var(--fg-dim); font-size: 16px; }

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid.grid-2 { gap: 1px; }
.cell { background: var(--bg); padding: 26px; }
.cell h3 { font-size: 16.5px; font-weight: 600; margin-bottom: 8px; }
.cell p { color: var(--fg-dim); font-size: 14.5px; }
.cell .ico { width: 22px; height: 22px; color: var(--fg); margin-bottom: 14px; opacity: .9; }

.spec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.spec-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spec-tag {
  align-self: flex-start;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid rgba(56, 216, 136, 0.25);
  border-radius: 999px;
  padding: 2px 9px;
}
.spec-card h3 { font-size: 16px; font-weight: 600; }
.spec-card p { font-size: 13.8px; color: var(--fg-dim); }

.fee-banner {
  margin-top: 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
  padding: 22px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.fee-banner h3 { font-size: 17px; font-weight: 600; }
.fee-banner p { font-size: 14px; color: var(--fg-dim); margin-top: 4px; max-width: 680px; }

/* ---- pricing ---- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; background: var(--panel); display: flex; flex-direction: column; }
.plan.highlight { border-color: var(--line-2); background: linear-gradient(180deg, #141414, #0a0a0a); }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.plan .pname { font-size: 16px; font-weight: 600; }
.plan .pdesc { font-size: 13.5px; color: var(--fg-dim); margin-top: 8px; min-height: 20px; }
.plan .price { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin: 14px 0 2px; }
.plan .price small { font-size: 13px; color: var(--fg-faint); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 10px; }
.plan li { font-size: 14px; color: var(--fg-dim); display: flex; gap: 9px; align-items: flex-start; }
.plan li svg { width: 15px; height: 15px; color: var(--ok); flex: none; margin-top: 3px; }
.plan-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.badge { font-size: 11px; font-weight: 600; color: #000; background: var(--white); border-radius: 999px; padding: 2px 9px; }

.cta-title { font-size: clamp(26px, 4vw, 40px); font-weight: 600; }
.cta-sub { margin-top: 14px; font-size: 17px; }

/* ---- footer ---- */
footer { border-top: 1px solid var(--line); padding: 38px 0; color: var(--fg-faint); font-size: 13.5px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--fg); }

/* ---- auth / app cards ---- */
.center-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 40px 20px; }
.card { width: 100%; max-width: 440px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); padding: 30px; }
.card-wide { max-width: none; }
.card h2 { font-size: 21px; font-weight: 600; }
.field { margin-top: 15px; }
.field label { display: block; font-size: 13px; color: var(--fg-dim); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: rgba(255, 255, 255, 0.42); }
.pw-wrap { position: relative; display: flex; align-items: center; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle {
  position: absolute;
  right: 8px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--fg-dim);
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
}
.pw-toggle:hover { color: var(--fg); border-color: var(--line-2); }
.form-msg { margin-top: 14px; font-size: 13.5px; min-height: 18px; }
.form-msg.err { color: var(--err); }
.form-msg.ok { color: var(--ok); }
.auth-foot { margin-top: 18px; font-size: 14px; }

/* ---- alerts / banners ---- */
.alert {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13.5px;
  background: var(--bg-2);
}
.alert.warn { border-color: rgba(227, 179, 65, 0.45); background: var(--warn-bg); color: #f6d580; }
.alert.err { border-color: rgba(239, 83, 80, 0.45); background: var(--err-bg); color: #fca5a5; }
.alert.ok { border-color: rgba(56, 216, 136, 0.4); background: var(--ok-bg); color: #86efac; }
.alert.info { border-color: rgba(96, 165, 250, 0.4); background: var(--info-bg); color: #bfdbfe; }

/* ---- dashboard / admin ---- */
.app-main { padding: 34px 0 80px; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 600; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--panel); }
.stat .l { font-size: 12.5px; color: var(--fg-faint); }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
.stat .sub { font-size: 12px; color: var(--fg-dim); margin-top: 6px; }
.kpi-delta { font-size: 12px; font-weight: 600; }
.kpi-delta.up { color: var(--ok); }
.kpi-delta.down { color: var(--err); }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-faint); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.02); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--fg-dim);
  white-space: nowrap;
}
.pill.ok { color: var(--ok); border-color: rgba(56, 216, 136, .4); background: var(--ok-bg); }
.pill.pending { color: var(--warn); border-color: rgba(227, 179, 65, .4); background: var(--warn-bg); }
.pill.revoked, .pill.err { color: var(--err); border-color: rgba(239, 83, 80, .4); background: var(--err-bg); }
.pill.info { color: var(--info); border-color: rgba(96, 165, 250, .4); background: var(--info-bg); }
.key { font-family: var(--mono); font-size: 12.5px; }

.subnav { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.subnav button {
  border: 0;
  background: none;
  color: var(--fg-dim);
  padding: 10px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.subnav button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--white); font-weight: 600; }
.subnav button:hover { color: var(--fg); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input { max-width: 260px; height: 36px; }
.toolbar select.input { width: auto; min-width: 150px; }
.section-title { font-size: 15px; color: var(--fg-dim); margin: 26px 0 12px; font-weight: 600; }
.nowrap { white-space: nowrap; }

.google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.google-btn svg { width: 18px; height: 18px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--fg-faint); font-size: 12px; margin-top: 18px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- wallet presets & tx badges ---- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.preset-chip {
  height: 42px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.preset-chip:hover { border-color: rgba(255, 255, 255, 0.45); background: var(--surface-hover); }
.preset-chip.active { background: var(--white); color: #000; border-color: var(--white); }

.tx-amt { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
.tx-amt.pos { color: var(--ok); }
.tx-amt.neg { color: var(--err); }

.radio-list { display: grid; gap: 8px; margin-top: 8px; }
.radio-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-1);
  cursor: pointer;
}
.radio-item:hover { border-color: var(--line-2); }
.radio-item input { margin-top: 3px; accent-color: #fff; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg-dim); cursor: pointer; }
.check-inline input { accent-color: #fff; }

.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); background: var(--bg-2); }
.avatar-fallback {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg-2);
  display: grid; place-items: center; font-weight: 600; font-size: 18px; color: var(--fg);
}

/* ---- charts ---- */
.chart-card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); padding: 18px; margin-bottom: 18px; }
.chart-card h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.chart-card .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--fg-dim); margin: 4px 0 10px; }
.chart-card .legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-card .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.chart-stage { position: relative; width: 100%; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .chart-grid { stroke: rgba(255, 255, 255, 0.08); stroke-width: 1; }
.chart .chart-axis-text { fill: #8a8a8a; font-size: 11px; font-family: var(--mono); }
.chart .chart-bar { transition: opacity .12s; }
.chart .chart-hit { fill: transparent; cursor: crosshair; outline: none; }
.chart .chart-hit:hover, .chart .chart-hit:focus { fill: rgba(255, 255, 255, 0.04); }
.chart-tooltip {
  position: absolute;
  top: 8px;
  right: 8px;
  pointer-events: none;
  background: rgba(12, 12, 12, 0.94);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--fg);
  z-index: 5;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.chart-tooltip .tt-title { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); margin-bottom: 4px; }
.chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 12px; }
.chart-empty { padding: 36px 12px; text-align: center; color: var(--fg-faint); font-size: 13px; border: 1px dashed var(--line); border-radius: 10px; }

.breakdown-list { display: grid; gap: 12px; }
.breakdown-item { display: grid; gap: 6px; }
.breakdown-head { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.breakdown-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.breakdown-fill { height: 100%; border-radius: 999px; }

/* ---- modal & toast ---- */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .74);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
  overflow: hidden;
}
.modal.modal-lg { max-width: 780px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
}
.modal-head h2 { font-size: 18px; font-weight: 600; }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.modal-close:hover { color: var(--fg); border-color: var(--line-2); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.qr { width: 196px; height: 196px; border-radius: 10px; background: #fff; display: block; margin: 0 auto; padding: 6px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--fg-faint); }

.toast-stack {
  position: fixed;
  top: 72px;
  right: 18px;
  z-index: 140;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  border: 1px solid var(--line-2);
  background: rgba(16, 16, 16, 0.96);
  color: var(--fg);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}
.toast.ok { border-color: rgba(56, 216, 136, 0.5); }
.toast.err { border-color: rgba(239, 83, 80, 0.55); color: #fca5a5; }
.toast.info { border-color: rgba(96, 165, 250, 0.5); }

/* ---- return page ---- */
.ret-icon { display: grid; place-items: center; margin-bottom: 12px; color: var(--fg-dim); }
.ret-headline { font-size: 20px; font-weight: 600; }
.ret-detail { margin-top: 10px; font-size: 14px; }
.ret-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- invoice ---- */
.inv {
  max-width: 780px;
  margin: 40px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 38px;
}
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.inv-brand { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.inv-title { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.stamp {
  display: inline-block;
  margin-top: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--ok);
  color: var(--ok);
}
.stamp.unpaid { border-color: var(--warn); color: var(--warn); }
.stamp.revoked { border-color: var(--err); color: var(--err); }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 30px 0; }
.parties h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-faint); margin-bottom: 8px; }
.parties p { font-size: 14px; line-height: 1.7; }
.inv table { margin-top: 8px; }
.inv .total-row td { font-size: 17px; font-weight: 600; border-top: 2px solid var(--line-2); border-bottom: 0; }
.lic-box {
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media print {
  .nav, .no-print, .toast-stack { display: none !important; }
  body { background: #fff; color: #000; }
  .inv { border: 0; background: #fff; color: #000; margin: 0; padding: 16px; }
  .inv table th, .inv table td { border-color: #ddd; color: #000; }
  .faint, .dim { color: #555; }
}

/* ---- reveal on scroll ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .grid-3, .spec-grid, .stat-row { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 580px) {
  .grid-3, .grid-2, .spec-grid, .stat-row, .parties { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 54px; }
  .container { padding: 0 16px; }
  .inv { padding: 22px; margin: 18px 12px; }
}
