/* Vault (/) and Admin (/admin) pages. Tokens: /tokens.css. Components: /ui.css. */
main { width: min(1120px, calc(100% - 48px)); margin: 0 auto; padding: 32px 0 80px; }
h1 { font-size: 36px; line-height: 40px; letter-spacing: -0.01em; }

/* Vault */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.stat { padding: 16px; background: var(--surface2); border-radius: var(--r20); }
.k { font-size: 14px; line-height: 18px; color: var(--neutral2); }
.num { margin-top: 8px; font-size: 36px; line-height: 40px; letter-spacing: -0.01em; }
.num small { margin-left: 4px; font-size: 18px; color: var(--neutral2); }

#position { margin-top: 16px; padding: 24px; }
.pos-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pos-head h2 { font-size: 24px; line-height: 28px; }
.pos-head .mid { flex: 1; min-width: 200px; color: var(--neutral2); font-size: 14px; line-height: 20px; }
.pos-head .btn { margin-left: auto; }
#position-detail:empty { display: none; }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0 0; padding: 0; list-style: none; }
.steps li { display: grid; gap: 14px; padding: 16px; border-radius: var(--r20); background: var(--surface2); font-size: 16px; line-height: 20px; color: var(--neutral2); }
.steps li span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: var(--medium); background: var(--surface3); color: var(--neutral2); }
.steps li.now { background: var(--accent2); color: var(--neutral1); box-shadow: inset 0 0 0 1px var(--accent2-hover); }
.steps li.now span { background: var(--accent1); color: #fff; }

.split-title { margin-top: 28px; font-size: 14px; line-height: 22px; color: var(--neutral2); }
.meter { display: flex; height: 10px; margin-top: 10px; gap: 3px; }
.meter span { display: block; height: 100%; border-radius: var(--rfull); }
.m75 { flex: 75; background: var(--accent1); }
.m5 { flex: 5; background: #fc72ff; }
.m20 { flex: 20; background: var(--neutral3); }
.m20.last { background: var(--surface3-solid); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 14px; font-size: 14px; line-height: 18px; color: var(--neutral2); }
.legend p { display: flex; align-items: center; gap: 8px; }
.legend i { width: 8px; height: 8px; border-radius: 50%; }
.legend b { color: var(--neutral1); font-weight: var(--medium); }
.d75 { background: var(--accent1); } .d5 { background: #fc72ff; } .d20 { background: var(--neutral3); } .d20.last { background: var(--surface3-solid); }
#position .error { margin-top: 12px; }

#position.flash { animation: flash 0.6s ease 2; }
@keyframes flash { from { background: var(--accent2-hover); } to { background: var(--surface1); } }

/* Admin */
.lede { margin-top: 8px; color: var(--neutral2); }
.grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; margin-top: 24px; }
.box { padding: 20px; }
.box.full { grid-column: 1 / -1; }
.box h2 { font-size: 16px; line-height: 20px; font-weight: var(--book); color: var(--neutral2); }
.box h2.strong { color: var(--neutral1); }
.figure { margin-top: 8px; font-size: 36px; line-height: 40px; letter-spacing: -0.01em; }
.figure.price { font-size: 36px; line-height: 40px; }
.figure .unit { margin-left: 6px; font-size: 18px; color: var(--neutral2); letter-spacing: 0; }
#wallet { margin-top: 8px; }
#rent-note { margin-top: 12px; }
.split { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stats > div { padding: 12px; border-radius: var(--r16); background: var(--surface2); }
.stats > div.wide { grid-column: 1 / -1; }
.stats .k { font-size: 12px; line-height: 16px; }
.stats p:last-child { margin-top: 4px; font-size: 16px; line-height: 22px; }
.row { display: flex; align-items: center; gap: 16px; }
.copy { width: 220px; flex-shrink: 0; display: grid; justify-items: start; gap: 6px; }
.copy h2 { justify-self: stretch; }
.mid { flex: 1; color: var(--neutral2); font-size: 14px; line-height: 20px; }
.mid.mono { font-size: 14px; }
.checked { flex-shrink: 0; }
#position-box > .fine { margin-top: 4px; }
.inline { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.inline .panel { flex: 1; padding: 10px 14px; }
.inline .panel-label { font-size: 12px; line-height: 22px; }
.inline .field { margin-top: 0; font-size: 16px; line-height: 24px; }
#position-error { margin-top: 12px; }

@media (max-width: 800px) {
  main { width: calc(100% - 32px); padding-top: 20px; }
  .top { flex-direction: column; align-items: stretch; }
  .top .btn { width: 100%; }
  .board, .steps { grid-template-columns: 1fr 1fr; gap: 8px; }
  .num { font-size: 28px; line-height: 32px; }
  #position { padding: 16px; }
  .pos-head h2 { font-size: 20px; }
  .pos-head .btn { width: 100%; margin-left: 0; }
  .steps li { gap: 10px; padding: 12px; font-size: 14px; line-height: 18px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > * { min-width: 0; }
  .split, .row, .inline { flex-direction: column; align-items: stretch; }
  .copy { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
}
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .top-actions { flex-direction: column; } }

/* Admin: coins stuck on one graduation step for more than 5 minutes. */
.grad-banner { margin-top: 20px; padding: 16px 20px; border-radius: var(--r16, 16px); background: var(--critical2); border: 1px solid var(--critical); }
.grad-banner h2 { font-size: 16px; line-height: 22px; color: var(--critical); }
.grad-banner ul { margin: 10px 0 8px; padding-left: 18px; display: grid; gap: 8px; }
.grad-banner li { color: var(--neutral1); font-size: 14px; line-height: 20px; }
.grad-banner .err { display: block; color: var(--neutral2); font-size: 13px; word-break: break-word; }

/* Long chip text wraps on phones instead of widening the card. */
#platform-rate { max-width: 100%; padding: 5px 12px; border-radius: var(--r16); }
.box { overflow-wrap: anywhere; }

/* Admin sign-in */
.login { display: grid; place-items: center; min-height: calc(100vh - var(--nav-h) - 80px); }
.login-card { width: min(440px, 100%); padding: 24px; display: grid; gap: 16px; }
.login-card h1 { font-size: 28px; line-height: 32px; }

/* Admin tabs */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-tabs { flex-wrap: wrap; }
.pane { margin-top: 20px; }
.pane > .grid:first-child { margin-top: 0; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { background: var(--surface2); border-radius: var(--r20); padding: 4px; }
.mono-chip { font-family: var(--mono); font-size: 13px; }
.top8 { margin-top: 8px; } .top12 { margin-top: 12px; } .top16 { margin-top: 16px; }
.board.three { grid-template-columns: repeat(3, 1fr); }
.board .wide2 { grid-column: span 2; }
.num.sm { font-size: 28px; line-height: 36px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip.warn { background: var(--warning2); color: var(--warning); }

/* Tables */
.table-wrap { margin-top: 12px; overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 18px; }
.tbl th { text-align: left; font-weight: var(--book); color: var(--neutral2); padding: 8px 10px; border-bottom: 1px solid var(--surface3); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid var(--surface3); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl .sub { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; color: var(--neutral2); }
.tbl b { font-weight: var(--medium); }
.tbl a { color: var(--accent1); }
.tbl .up { color: var(--success); } .tbl .down { color: var(--critical); }
.notes { margin: 16px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 18px; color: var(--neutral2); }

/* Squads export */
.b58-row { display: grid; gap: 8px; padding: 12px; border-radius: var(--r16); background: var(--surface2); }
.b58-row p { font-size: 14px; line-height: 18px; color: var(--neutral2); }
.b58-row b { color: var(--neutral1); font-weight: var(--medium); }
.b58-row .btn { justify-self: start; }
.b58 { width: 100%; font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--neutral1); background: var(--surface1); border: 1px solid var(--surface3); border-radius: var(--r12); padding: 8px; resize: vertical; word-break: break-all; }

/* Chart */
.chart { margin-top: 12px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--accent1); opacity: 0.85; }
.chart .line { fill: none; stroke: var(--neutral1); stroke-width: 2; stroke-linejoin: round; }
.chart .axis { stroke: var(--surface3); }
.chart .tick { fill: var(--neutral2); font-size: 11px; font-family: var(--font); }
.dline { background: var(--neutral1); border-radius: 2px !important; height: 2px !important; width: 12px !important; }

/* Smart liquidity feed */
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--neutral2); cursor: pointer; }
.feed { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.feed li { padding: 12px 14px; border-radius: var(--r16); background: var(--surface2); }
.feed li.quiet { background: transparent; border: 1px dashed var(--surface3); }
.feed-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feed-top .link { margin-left: auto; color: var(--accent1); }
.feed-reason { margin-top: 8px; font-size: 15px; line-height: 21px; }
.feed li.quiet .feed-reason { color: var(--neutral2); font-size: 14px; }

@media (max-width: 800px) {
  .admin-head { flex-direction: column; align-items: stretch; flex-wrap: nowrap; }
  .admin-head > * { min-width: 0; }
  .admin-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .admin-tabs .tab { white-space: nowrap; }
  .board.three { grid-template-columns: 1fr 1fr; }
  .board .wide2 { grid-column: 1 / -1; }
  .num.sm { font-size: 22px; line-height: 28px; }
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 10px 6px; }
  .feed-top .link { margin-left: 0; }
  .nav-right .mono-chip { display: none; }
}
/* Phones: each table row becomes a small card of label / value lines. */
@media (max-width: 640px) {
  .tbl thead { display: none; }
  .tbl tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--surface3); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; border: 0; text-align: right; }
  .tbl td:first-child { display: block; text-align: left; padding-bottom: 6px; }
  .tbl td[data-label]::before { content: attr(data-label); color: var(--neutral2); text-align: left; }
  .tbl td.n { flex-wrap: wrap; }
  .tbl td.n .sub { flex-basis: 100%; }
  .tbl td[colspan] { display: block; text-align: left; }
}

/* Admin growth tab */
.gr-settings { display: grid; gap: 16px; }
.gr-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: stretch; }
.gr-group h3 { grid-column: 1 / -1; font-size: 15px; font-weight: var(--medium); color: var(--neutral1); margin-top: 6px; }
.gr-group .panel { padding: 10px 14px; }
.gr-group .panel-label { font-size: 13px; line-height: 18px; }
.gr-group .field { font-size: 18px; line-height: 26px; margin-top: 2px; }
.gr-group .since { grid-column: 1 / -1; font-size: 12px; color: var(--neutral2); }
.gr-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.gr-toggle input { width: 18px; height: 18px; accent-color: var(--accent1); }
.gr-msg { width: 100%; min-height: 96px; padding: 10px; border-radius: var(--r12); background: var(--surface2); border: 1px solid var(--surface3); color: var(--neutral1); resize: vertical; }
