/* ============================================================
   Sage — the desk (/app). Same tokens and type as the landing page.
   ============================================================ */

.desk .logo-mark { width: 36px; height: 32px; }
.desk .nav { border-bottom: 1px solid var(--line); }
.desk .nav-row { gap: 20px; }
.desk .logo { margin-right: 0; }
.desk-tabs { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.desk-tabs[hidden] { display: none; }
.desk-tabs button { height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14px; color: var(--ink-soft); transition: background .2s, color .2s; }
.desk-tabs button:hover { background: var(--tone-1); color: var(--ink); }
.desk-tabs button[aria-selected="true"] { background: var(--tone-2); color: var(--ink); }
.wallet-btn { margin-left: auto; height: 40px; }
.desk-tabs:not([hidden]) + .wallet-btn { margin-left: 0; }

.desk-main { padding-top: 36px; padding-bottom: 80px; min-height: calc(100vh - var(--nav-h)); }
.desk-loading { color: var(--ink-soft); padding: 60px 0; }

/* ---------- cards ---------- */
.card { background: var(--white); border-radius: var(--radius); padding: 26px; box-shadow: 0 1px 2px rgba(30, 42, 33, .06), 0 18px 40px -30px rgba(30, 42, 33, .35); }
.card + .card { margin-top: 18px; }
.card h2 { font-size: clamp(28px, 3vw, 38px); line-height: 1.1; letter-spacing: -.02em; }
.card h3 { font-size: 15px; font-weight: 500; margin-bottom: 14px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.gate { max-width: 560px; margin: 40px auto 0; text-align: left; }
.gate p { margin-top: 12px; }
.gate .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 22px; }
.facts div { background: var(--tone-1); border-radius: 10px; padding: 12px 14px; }
.facts b { display: block; font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.02em; }
.facts span { font-size: 13px; color: var(--ink-soft); }
.note { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--accent); font-size: 13.5px; }
.note.quiet { background: var(--tone-1); }

.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; gap: 8px; }

/* ---------- layout ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-term { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.head-row { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.head-row .mark-dot { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--tone-1); display: grid; place-items: center; }
.head-row .mark-dot img { width: 26px; }
.head-row b { display: block; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.05; letter-spacing: -.02em; }
.head-row small { color: var(--ink-soft); font-size: 13px; }
.head-row .right { margin-left: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips span { background: var(--tone-1); border-radius: 6px; padding: 6px 10px; font-size: 13px; }
.chips span b { font-weight: 500; }
.bar-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.bar { height: 8px; border-radius: 8px; background: var(--tone-1); margin-bottom: 20px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 8px; transition: width .6s var(--ease); }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 400; color: var(--ink-soft); font-size: 12.5px; padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl-wrap { overflow-x: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone-4); }
.status.no::before { background: #C9B26A; }
.status.run::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-soft); }
.up { color: #3F5131; }
.down { color: #8A6F2A; }
.empty { color: var(--ink-soft); font-size: 13.5px; padding: 8px 0; }

/* ---------- terminal ---------- */
.search { position: relative; margin-bottom: 18px; }
.search input { width: 100%; height: 48px; border-radius: 10px; border: 1px solid rgba(30, 42, 33, .2); background: var(--white); padding: 0 16px; font: inherit; font-size: 15px; color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--tone-2); }
.results { position: absolute; left: 0; right: 0; top: 54px; z-index: 20; background: var(--white); border-radius: 10px; box-shadow: 0 18px 40px -16px rgba(30, 42, 33, .4), 0 0 0 1px var(--line); padding: 6px; max-height: 380px; overflow-y: auto; }
.results[hidden] { display: none; }
.results button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; font-size: 14px; }
.results button:hover, .results button:focus-visible { background: var(--tone-1); outline: none; }
.results small { color: var(--ink-soft); margin-left: auto; font-size: 12px; }
.tlogo { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--tone-1); object-fit: cover; }
.tlogo.big { width: 42px; height: 42px; }

.quote { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 4px 0 16px; font-size: 13px; color: var(--ink-soft); }
.quote b { color: var(--ink); font-weight: 500; }
.frames { display: flex; gap: 4px; margin-left: auto; }
.frames button { height: 28px; padding: 0 9px; border-radius: 6px; font-size: 12px; color: var(--ink-soft); }
.frames button[aria-pressed="true"] { background: var(--tone-2); color: var(--ink); }
.chart { width: 100%; height: 320px; display: block; }

.order label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.amount { display: flex; align-items: center; height: 48px; border-radius: 10px; border: 1px solid rgba(30, 42, 33, .2); padding: 0 14px; gap: 6px; background: var(--white); }
.amount:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--tone-2); }
.amount input { flex: 1; min-width: 0; border: 0; outline: none; font: inherit; font-size: 18px; color: var(--ink); background: none; }
.quick { display: flex; gap: 6px; margin: 10px 0 14px; }
.quick button { flex: 1; height: 32px; border-radius: 8px; background: var(--tone-1); font-size: 13px; }
.quick button:hover { background: var(--tone-2); }
.est { font-size: 13px; color: var(--ink-soft); display: grid; gap: 4px; margin-bottom: 14px; }
.est div { display: flex; justify-content: space-between; }
.est b { color: var(--ink); font-weight: 500; }
.order .btn { width: 100%; justify-content: center; }
.sell-row { display: flex; gap: 4px; justify-content: flex-end; }
.sell-row button { height: 28px; padding: 0 8px; border-radius: 6px; background: var(--tone-1); font-size: 12px; }
.sell-row button:hover { background: var(--tone-2); }

/* ---------- wallet picker + toast ---------- */
.wallet-pick { position: fixed; inset: 0; z-index: 100; background: rgba(30, 42, 33, .35); display: grid; place-items: center; padding: 16px; }
.wallet-pick-card { background: var(--paper); border-radius: var(--radius); padding: 22px; width: min(360px, 100%); display: grid; gap: 8px; }
.wallet-pick-card b { font-size: 26px; margin-bottom: 6px; }
.wallet-pick-card button { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 12px; border-radius: 10px; background: var(--white); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; }
.wallet-pick-card button:hover { background: var(--tone-1); }
.wallet-pick-card button img, .wallet-pick-card button i { width: 24px; height: 24px; border-radius: 6px; background: var(--tone-2); }
.wallet-pick-card .quiet { justify-content: center; box-shadow: none; background: transparent; color: var(--ink-soft); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: 10px; font-size: 14px; max-width: min(520px, calc(100vw - 32px)); box-shadow: 0 18px 40px -16px rgba(30, 42, 33, .6); }
.toast[hidden] { display: none; }
.toast a { text-decoration: underline; }

@media (max-width: 1100px) {
  .grid-2, .grid-term { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .desk-tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .desk .nav-row { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 10px; row-gap: 10px; }
  .wallet-btn { margin-left: auto; }
  .card { padding: 18px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .chart { height: 240px; }
  .head-row b { font-size: 25px; }
}

/* the trade record keeps one line per fill and scrolls sideways on a phone */
.tbl.hist td, .tbl.hist th { white-space: nowrap; }
@media (max-width: 760px) {
  .tbl.hist { min-width: 600px; }
}

/* search: coins too thin to trade are still listed, quieter */
.results button.thin { opacity: .6; }
.results .ver { color: #3F5131; font-size: 12px; font-weight: 600; }
.results .hint { margin: 4px 10px 6px; font-size: 12.5px; color: var(--ink-soft); }
