:root {
  --bg: #12121c;
  --card: #1e1e2f;
  --ink: #f7f7f8;
  --muted: #a3a3a3;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff6b35;
  --accent-hover: #ff8e53;
  --accent-dim: rgba(255, 107, 53, 0.12);
  --thomas: #0a7cff;
  --t4t: #369eff;
  --danger: #f87171;
  --pad: 16px;
  --top: 56px;
  --tabs: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --max: 960px;
  --font: "Roboto", "Segoe UI", system-ui, sans-serif;
  --display: "Manrope", "Roboto", "Segoe UI", sans-serif;
  --radius: 12px;
  --glass: 0 8px 24px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.5 var(--font);
  padding-bottom: calc(var(--tabs) + var(--safe-b));
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: none; }

.skip { position: absolute; left: -999px; top: 8px; }
.skip:focus { left: 8px; background: var(--card); padding: 8px 12px; z-index: 80; }

.top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px;
  min-height: var(--top);
  padding: 8px 12px;
  background: rgba(18, 18, 28, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: inline-flex; align-items: baseline; gap: 8px;
  color: var(--ink); white-space: nowrap; flex-shrink: 0;
}
.brand-neo {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.12em;
  font-size: 16px;
}
.brand-app { color: var(--muted); font-weight: 500; font-size: 14px; }
.search { flex: 1; min-width: 0; position: relative; }
.search input {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-drop {
  position: fixed; z-index: 80;
  min-width: 280px; max-width: min(520px, calc(100vw - 16px));
  max-height: min(420px, 70vh); overflow: auto;
  padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--glass);
}
.search-drop[hidden] { display: none !important; }
.search-drop a, .search-drop button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; color: var(--ink);
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  text-decoration: none;
}
.search-drop a:hover, .search-drop a.on,
.search-drop button:hover { background: var(--accent-dim); color: var(--ink); }
.search-drop .kind {
  display: inline-block; color: var(--accent); font-size: 11px;
  letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700;
  margin-bottom: 2px;
}
.search-drop b { display: block; font-weight: 600; }
.search-drop small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.search-drop .search-empty { padding: 12px; color: var(--muted); font-size: 13px; }
.icon-btn, .text-btn {
  background: transparent; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; color: var(--ink);
}
.icon-btn { width: 40px; height: 40px; flex-shrink: 0; }
.icon-btn:hover, .text-btn:hover { border-color: var(--accent); color: var(--accent); }
.text-btn {
  height: 40px; padding: 0 14px; font-weight: 500; flex-shrink: 0;
  display: inline-flex; align-items: center;
}

.dl { position: relative; flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; }
.dl-menu {
  position: fixed; z-index: 80;
  min-width: 280px; max-width: min(380px, calc(100vw - 16px));
  padding: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--glass);
}
.dl-menu[hidden] { display: none !important; }
.dl-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; color: var(--ink);
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  line-height: 1.25;
}
.dl-menu button:hover,
.dl-menu button:focus-visible { background: var(--accent-dim); color: var(--accent); outline: none; }
.dl-menu button.on { background: var(--accent-dim); }
.dl-menu .dl-label { display: block; font-weight: 500; }
.dl-menu small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; margin-bottom: 10px;
}
.page-head .crumbs { margin-bottom: 0; flex: 1; }
.guide {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin: 0 0 16px; color: #d4d4d8; font-size: 14px;
}
.how { padding-left: 20px; margin: 8px 0 22px; max-width: 40rem; }
.how li { margin: 8px 0; }
.pack-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.pack-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; color: var(--ink);
  box-shadow: var(--glass);
}
.pack-card:hover { border-color: var(--accent); color: var(--ink); }
.pack-card.start { border-color: rgba(10, 124, 255, 0.45); }
.pack-card .amt {
  font-family: var(--display); font-size: 28px; font-weight: 700;
  letter-spacing: -0.04em; margin: 8px 0 6px;
}
.pack-card.start .amt { color: var(--thomas); }
.pack-card.extra .amt { color: var(--accent); }

.shell { display: flex; min-height: calc(100dvh - var(--top) - var(--tabs)); }
.nav {
  width: 268px; flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: 12px 8px 40px;
  background: #161622;
  overflow: auto;
}
.nav a, .nav button.linkish {
  display: block; color: var(--ink); padding: 7px 10px; border-radius: 8px;
  text-decoration: none;
}
.nav a:hover, .nav a.on { background: var(--accent-dim); color: var(--accent-hover); }
.nav-label {
  margin: 16px 10px 4px; font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.nav-hint {
  margin: 0 10px 8px; font-size: 12px; color: var(--muted); line-height: 1.35;
}
.nav-more { margin: 4px 4px 8px; }
.nav-more summary {
  list-style: none; cursor: pointer; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); font-size: 14px;
}
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.nav .hrs { color: var(--muted); font-size: 12px; margin-left: auto; }
.nav .sub { padding: 6px 10px 6px 28px; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.nav .sub .hrs { flex-shrink: 0; }

.nav-phase { margin: 0 0 2px; }
.nav-phase summary {
  display: flex; align-items: center; gap: 8px;
  list-style: none; cursor: pointer;
  padding: 7px 8px 7px 10px; border-radius: 8px;
}
.nav-phase summary::-webkit-details-marker { display: none; }
.nav-phase summary::before {
  content: "";
  width: 6px; height: 6px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg); flex-shrink: 0;
}
.nav-phase[open] summary::before { transform: rotate(45deg); }
.nav-phase summary:hover { background: rgba(255, 255, 255, 0.04); }
.nav-phase a.phase {
  flex: 1; padding: 0; min-width: 0;
  font-weight: 500; color: var(--ink);
}
.nav-phase a.phase:hover { background: none; color: var(--accent); }

#main { flex: 1; min-width: 0; padding: 22px var(--pad) 48px; }
.page { max-width: var(--max); margin: 0 auto; }
.eyebrow {
  color: var(--accent); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; margin: 0 0 8px; font-weight: 700;
}
h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.03em;
}
h1 { font-size: 30px; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 20px; margin: 28px 0 10px; }
h3 { font-size: 17px; margin: 22px 0 8px; }
h4 { font-size: 15px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.lead { color: #d4d4d8; margin: 0 0 18px; max-width: 46rem; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--glass);
}
.stat b {
  display: block; font-family: var(--display); font-size: 28px; letter-spacing: -0.04em;
}
.stat span { color: var(--muted); font-size: 12px; }
.stat.thomas b { color: var(--thomas); }
.stat.t4t b { color: var(--accent); }
.stat.all b { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer;
  text-decoration: none; font-weight: 500;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); color: #fff; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; color: var(--ink);
  box-shadow: var(--glass);
}
.card:hover { border-color: var(--accent); color: var(--ink); }
.card .eyebrow { margin-bottom: 6px; }
.card small { display: block; color: var(--muted); margin-top: 6px; }
.card .amt {
  font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.03em;
  margin-top: 8px;
}

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; font-size: 13px; }
.crumbs a { color: var(--muted); }
.crumbs span { color: var(--muted); }

.md .table-wrap {
  overflow-x: auto; margin: 12px 0 18px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.md table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md th, .md td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md th {
  color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 500; background: rgba(0, 0, 0, 0.18); position: sticky; top: 0;
}
.md td:first-child { white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md tr:hover td { background: var(--accent-dim); }
.md blockquote {
  margin: 12px 0; padding: 8px 12px; border-left: 3px solid var(--accent);
  color: #e4e4e7; background: var(--card); border-radius: 0 10px 10px 0;
}
.md code {
  font-family: ui-monospace, Consolas, monospace; font-size: 0.9em;
  background: var(--card); padding: 1px 5px; border-radius: 4px;
}
.md pre {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; overflow-x: auto;
}
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 6px 0; }
.md p { margin: 0 0 12px; }

.chip {
  display: inline-flex; align-items: center;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid transparent; border-radius: 999px;
  padding: 0 8px; margin: 0 2px; font-size: 12px; font-weight: 700;
  cursor: pointer; line-height: 1.7;
}
.chip:hover { border-color: var(--accent); }
.chip.ref { background: rgba(10, 124, 255, 0.14); color: var(--t4t); }
.chip.lock { background: rgba(255, 107, 53, 0.1); color: var(--accent-hover); }

.quote-list { display: grid; gap: 10px; }
.quote-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; cursor: pointer; text-align: left; width: 100%;
}
.quote-card:hover { border-color: var(--accent); }
.quote-card .id { color: var(--accent); font-weight: 700; margin-right: 8px; }
.quote-card p { margin: 8px 0 0; color: #e4e4e7; }

.sheet-bg {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 50;
}
.nav[hidden],
.sheet[hidden],
.sheet-bg[hidden] {
  display: none !important;
}

.sheet {
  position: fixed; z-index: 60;
  right: 0; top: 0; bottom: 0; width: min(440px, 100%);
  background: #161622; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.sheet header {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 16px; border-bottom: 1px solid var(--line);
}
.sheet h2 { margin: 0; font-size: 20px; }
.sheet-body { overflow: auto; padding: 16px 16px 40px; }
.qblock {
  background: var(--card); border-radius: 12px; padding: 14px; margin: 0 0 12px;
}
.qblock p { margin: 0 0 8px; }
.qblock cite { color: var(--muted); font-style: normal; font-size: 12px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: flex; border-top: 1px solid var(--line);
  background: rgba(18, 18, 28, 0.96);
  padding-bottom: var(--safe-b);
}
.tabs a, .tabs button {
  flex: 1; background: none; border: 0; color: var(--muted);
  min-height: 48px; cursor: pointer; text-align: center; text-decoration: none;
  font-size: 12px; letter-spacing: 0.04em;
}
.tabs a.on, .tabs button.on { color: var(--accent); }

.hit { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.hit small { display: block; color: var(--muted); margin-top: 4px; }
.err { color: var(--danger); }

.prog {
  margin: 0 0 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.prog-meta {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; color: var(--muted); margin-bottom: 8px;
}
.prog-track {
  height: 8px; background: rgba(255, 255, 255, 0.08);
  border-radius: 999px; overflow: hidden;
}
.prog-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.prog-fill.wait { background: #eab308; }
.pack-card .prog, .card .prog { margin: 12px 0 0; padding: 0; background: none; border: 0; }
.checks { margin-top: 22px; }
.check-list { display: grid; gap: 10px; margin-top: 12px; }
.check-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px;
}
.check-card.done { border-color: rgba(52, 211, 153, 0.45); }
.check-card.wait { border-color: rgba(234, 179, 8, 0.45); }
.check-card b { display: block; margin: 4px 0 6px; }
.check-card label.tick {
  display: flex; gap: 8px; align-items: flex-start;
  color: var(--ink); margin-bottom: 6px;
}
.check-card input[type="text"],
.check-card textarea {
  width: 100%; background: #12121c; border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; margin-top: 6px; color: var(--ink);
}
.check-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.check-row input[type="text"] { flex: 1; min-width: 140px; margin-top: 0; }
.check-msg { color: var(--danger); font-size: 13px; margin: 8px 0 0; }

.hide-mobile { display: none; }

@media (min-width: 880px) {
  body { padding-bottom: 0; }
  .tabs { display: none; }
  .hide-mobile { display: inline-flex; }
  #menuBtn { display: none; }
  .nav { display: block !important; position: sticky; top: var(--top); height: calc(100dvh - var(--top)); }
  h1 { font-size: 34px; }
}

.nav-bg[hidden] { display: none !important; }
.nav-bg {
  display: none;
}

@media (max-width: 879px) {
  .nav {
    position: fixed; z-index: 45; inset: var(--top) auto 0 0;
    width: min(300px, 88vw);
    bottom: calc(var(--tabs) + var(--safe-b));
    height: auto; box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
  }
  .nav-bg {
    display: block;
    position: fixed; z-index: 44;
    inset: var(--top) 0 0 0;
    background: rgba(0, 0, 0, 0.55);
  }
  .top { gap: 6px; padding: 8px; }
  .search input { font-size: 16px; }
  .stats, .cards, .pack-row { grid-template-columns: 1fr; }
  .sheet {
    top: auto; left: 0; right: 0; width: 100%; height: min(86dvh, 720px);
    border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0;
  }
  .text-btn#quotesBtn { display: none; }
  .brand-app { display: none; }
  #dlGo { display: none; }
  .md td:first-child { white-space: normal; }
  .prog-meta { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  h1 { font-size: 24px; }
  .stat b { font-size: 22px; }
}
