/* GoldAI Partner panel (V202): dark, calm, phone first. Gold = the main action, white = selected. */
:root {
  --bg: #0a0a0b; --s1: #121215; --s2: #19191d; --s3: #222228; --line: #26262c; --line2: #33333a;
  --text: #f4f4f6; --text2: #d4d4da; --muted: #9a9aa3; --faint: #6c6c75;
  --gold: #f5b82e; --gold2: #ffd56b; --gold-bg: rgba(245, 184, 46, .12);
  --up: #34d399; --up-bg: rgba(52, 211, 153, .12); --down: #f87171; --down-bg: rgba(248, 113, 113, .12);
  --warn: #fbbf24; --warn-bg: rgba(251, 191, 36, .12); --blue: #60a5fa; --blue-bg: rgba(96, 165, 250, .12);
  --r: 12px; --r-lg: 16px; --gut: 16px; --top: 60px; --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .mono { font-family: var(--mono); }
.up { color: var(--up); } .down { color: var(--down); } .gold { color: var(--gold); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* brand + boot */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand img { border-radius: 9px; }
.brand b { color: var(--gold); font-weight: 600; }
.brand.big { font-size: 22px; justify-content: center; }
.boot { min-height: 100vh; display: grid; place-content: center; gap: 24px; justify-items: center; }
.spin { width: 26px; height: 26px; border: 2.5px solid var(--line2); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* sign in */
.auth { min-height: 100vh; display: grid; place-content: center; padding: 24px var(--gut); gap: 18px; }
.auth-card { width: min(380px, calc(100vw - 32px)); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 22px; display: grid; gap: 14px; text-align: center; }
.auth-card form { display: grid; gap: 12px; text-align: left; }
.auth .foot { text-align: center; font-size: 13px; }

/* fields + buttons */
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea, .inp { width: 100%; background: var(--s2); border: 1px solid var(--line2); border-radius: 10px; padding: 11px 12px; font-size: 16px; color: var(--text); outline: none; transition: border-color .15s; }
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus { border-color: var(--gold); }
.err { color: var(--down); font-size: 13px; min-height: 0; margin: 0; }
.err:empty { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--s2); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--s3); }
.btn:active { transform: scale(.97); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1a1405; }
.btn.gold:hover { background: var(--gold2); }
.btn.ghost { background: none; }
.btn.danger { color: var(--down); border-color: rgba(248, 113, 113, .35); background: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 14px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--s1); position: relative; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); font-weight: 600; }

/* shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 12px; background: var(--s1); }
.side .brand { padding: 4px 8px 18px; }
.side nav a, .more-list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; transition: background .15s, color .15s; }
.side nav a:hover { background: var(--s2); color: var(--text); }
.side nav a.on { background: var(--s3); color: var(--text); }
.side nav a .n, .tabbar a .n { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--gold); color: #1a1405; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side nav .grp { margin: 16px 12px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px; background: rgba(10, 10, 11, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-l .brand { display: none; }
.top h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-r { display: flex; align-items: center; gap: 8px; }
.view { padding: 22px 24px 48px; max-width: 980px; animation: rise .22s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.tabbar { display: none; }

/* building blocks */
.stack { display: grid; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; min-width: 0; }
.card h2 { font-size: 16px; margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 2px; }
.sec-h h2 { font-size: 16px; }
.tile { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.tile small { display: block; color: var(--muted); font-size: 12px; }
.tile b { display: block; font-size: 20px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile span { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.bal { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: linear-gradient(135deg, #1d1708, #121215 60%); border-color: rgba(245, 184, 46, .25); }
.bal small { color: var(--muted); font-size: 13px; }
.bal .amt { font-size: 36px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); font-size: 14px; color: var(--text2); }
.note.warn { background: var(--warn-bg); border-color: rgba(251, 191, 36, .3); }
.note.gold { background: var(--gold-bg); border-color: rgba(245, 184, 46, .3); }
.note.bad { background: var(--down-bg); border-color: rgba(248, 113, 113, .3); }
.note svg { margin-top: 1px; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--s3); color: var(--text2); white-space: nowrap; }
.pill.ok { background: var(--up-bg); color: var(--up); } .pill.bad { background: var(--down-bg); color: var(--down); }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.blue { background: var(--blue-bg); color: var(--blue); } .pill.gold { background: var(--gold-bg); color: var(--gold); }
.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-top: 1px solid var(--line); min-width: 0; }
.li:first-child { border-top: 0; }
.li .m { flex: 1; min-width: 0; }
.li .m b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.li .m span { display: block; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.li .e { text-align: right; flex: none; }
.ic { width: 36px; height: 36px; border-radius: 10px; background: var(--s3); display: grid; place-items: center; flex: none; color: var(--text2); }
.todo a { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-top: 1px solid var(--line); }
.todo a:first-child { border-top: 0; }
.todo a .m { flex: 1; } .todo a .m b { display: block; } .todo a .m span { color: var(--muted); font-size: 13px; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line2); background: none; color: var(--muted); font-weight: 500; font-size: 14px; cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chips button small { opacity: .7; margin-left: 4px; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.prog { height: 8px; border-radius: 99px; background: var(--s3); overflow: hidden; margin: 10px 0 6px; }
.prog i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.skel { background: linear-gradient(90deg, var(--s1), var(--s2), var(--s1)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--r); }
@keyframes sh { to { background-position: -200% 0; } }

/* make keys */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan { text-align: left; border: 1px solid var(--line2); background: var(--s1); border-radius: var(--r); padding: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.plan b { display: block; font-size: 16px; }
.plan span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.plan .c { color: var(--text); font-weight: 600; font-size: 18px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.plan[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-bg); }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line2); background: var(--s2); font-size: 20px; cursor: pointer; }
.qty input { width: 80px; text-align: center; font-size: 18px; font-weight: 600; }
.sum { display: grid; gap: 6px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; gap: 10px; }
.sum div b { font-variant-numeric: tabular-nums; }
.sum .tot { border-top: 1px solid var(--line); padding-top: 8px; font-size: 16px; }
.keybox { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--s2); }
.keybox code { flex: 1; font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: .03em; overflow-wrap: anywhere; }

/* chat */
.chat { display: grid; gap: 8px; max-height: 56vh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; background: var(--s2); font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { justify-self: end; background: var(--gold-bg); border: 1px solid rgba(245, 184, 46, .25); }
.msg small { display: block; color: var(--faint); font-size: 11px; margin-top: 4px; }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 140px; padding-top: 8px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bars i { display: block; width: 100%; max-width: 44px; background: var(--gold); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars small { font-size: 11px; color: var(--muted); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.t td { padding: 10px 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.t td.r, table.t th.r { text-align: right; }
.tw { overflow-x: auto; }

/* sheet (bottom sheet on phones, dialog on desktop) + toast */
.sheet { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .15s; }
.sheet-card { position: relative; width: min(520px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto; background: var(--s1); border: 1px solid var(--line2); border-radius: var(--r-lg); padding: 22px 20px; animation: rise .2s var(--ease); }
.sheet-card h2 { font-size: 18px; margin-bottom: 6px; padding-right: 30px; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--s2); color: var(--muted); font-size: 20px; cursor: pointer; }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: rise .2s var(--ease); }
.more-list { display: grid; gap: 2px; }
.more-list a { color: var(--text2); padding: 13px 10px; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 0 var(--gut); }
  .top-l .brand { display: flex; }
  .view { padding: 18px var(--gut) calc(96px + env(safe-area-inset-bottom)); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(18, 18, 21, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; font-size: 11px; font-weight: 600; color: var(--faint); border-radius: 10px; position: relative; }
  .tabbar a.on { color: var(--text); }
  .tabbar a.make { color: var(--gold); }
  .tabbar a .n { position: absolute; top: 2px; right: 22%; height: 17px; min-width: 17px; font-size: 10px; }
  .sheet { place-items: end center; }
  .sheet-card { width: 100vw; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) { .plans { grid-template-columns: 1fr 1fr; gap: 8px; } .plan { padding: 12px; } .bal .amt { font-size: 32px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
