/* Theme tokens (dark default, light on <html data-theme="light">) and the shared look of the shell. */
:root {
  --on-gold: #25190a;
  --glass: rgb(20 17 12 / 78%);
  --gold-grad: linear-gradient(180deg, #f3d58f, #d9a441 55%, #c48f2d);
  --card-shadow: 0 1px 0 rgb(255 255 255 / 4%) inset, 0 10px 28px rgb(0 0 0 / 28%);
  --page-bg:
    radial-gradient(900px 480px at 85% -8%, rgb(217 164 65 / 16%), transparent 60%),
    radial-gradient(700px 420px at 0% 12%, rgb(95 191 134 / 6%), transparent 60%),
    var(--ink);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink: #f5efe2;
  --ink-2: #fffdf8;
  --ink-3: #f0e8d6;
  --line: #e2d7bd;
  --paper: #2a2113;
  --muted: #7b6e55;
  --gold: #c28a22;
  --gold-hi: #8a5c0e;
  --gold-lo: #d3a448;
  --good: #17804a;
  --bad: #c23d33;
  --warn: #9a6200;
  --shadow: 0 12px 30px rgb(60 40 10 / 16%);
  --on-gold: #2a1a05;
  --glass: rgb(255 252 245 / 82%);
  --card-shadow: 0 1px 0 #fff inset, 0 8px 24px rgb(80 55 15 / 10%);
  --page-bg:
    radial-gradient(900px 480px at 85% -8%, rgb(217 164 65 / 24%), transparent 60%),
    radial-gradient(700px 420px at 0% 10%, rgb(95 191 134 / 10%), transparent 60%),
    var(--ink);
}

[hidden] { display: none !important; }
body { background: var(--page-bg) fixed; }
.small { font-size: .85rem; }
.icon { display: inline-grid; width: 1.3em; height: 1.3em; flex: none; }
.icon svg { width: 100%; height: 100%; }

/* surfaces and controls */
.card { box-shadow: var(--card-shadow); }
.card-gold { background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 12%, var(--ink-2)), var(--ink-2)); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.btn-gold { background: var(--gold-grad); color: var(--on-gold); box-shadow: 0 6px 16px rgb(217 164 65 / 25%); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 1.05rem; }
.btn-ghost:hover:not([disabled]) { background: var(--ink-3); }
.input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); }
.seg button[aria-pressed="true"] { color: var(--on-gold); background: var(--gold-grad); }
.icon-btn {
  width: 2.4rem; height: 2.4rem; display: inline-grid; place-items: center; border: 1px solid var(--line);
  border-radius: 50%; background: var(--ink-2); color: var(--gold-hi); cursor: pointer; transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.chip-btn {
  border: 1px solid var(--line); background: var(--ink-3); color: var(--paper); border-radius: 999px;
  padding: .25rem .8rem; font: inherit; font-size: .85rem; cursor: pointer;
}
.chip-btn:hover { border-color: var(--gold); color: var(--gold-hi); }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 3px 12px; border-radius: 999px; background: var(--ink-3); font-size: .8rem; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: pulse 1.8s infinite; }
.pill.is-closed .live-dot { background: var(--bad); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 100% { box-shadow: 0 0 0 9px transparent; } }

/* authenticated frame */
.app-header { position: sticky; top: 0; z-index: 30; background: var(--glass); backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.app-header-inner { max-width: 960px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.brand span { white-space: nowrap; }
.brand img { box-shadow: 0 4px 14px rgb(217 164 65 / 30%); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-text { display: grid; line-height: 1.4; min-width: 0; }
.who-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--gold-grad); color: var(--on-gold); font-weight: 800; }
.shell { padding-top: 16px; }
.app .shell { animation: view-in .28s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.tabbar { background: var(--glass); box-shadow: 0 -8px 30px rgb(0 0 0 / 14%); }
.tabbar a { flex-direction: column; gap: 2px; font-size: .72rem; min-height: 56px; }
.tabbar a .icon { width: 1.45rem; height: 1.45rem; }
.tabbar a[aria-current="page"] { color: var(--gold-hi); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.tabbar .dot { position: absolute; top: 8px; inset-inline-start: 38%; }
@media (min-width: 720px) { .tabbar { box-shadow: var(--shadow); } }
@media (max-width: 480px) { .btn-sm .icon + span { display: none; } .btn-sm { padding: 0 10px; } }

/* landing */
.hero { padding: 30px 0 8px; position: relative; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; width: fit-content; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--ink-2); color: var(--muted); font-size: .85rem; }
.hero-badge .icon { color: var(--good); }
.hero h1 { letter-spacing: -.01em; }
.accent { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .accent { background: linear-gradient(180deg, #b27a14, #8a5c0e); -webkit-background-clip: text; background-clip: text; }
.btn-lg { box-shadow: 0 10px 26px rgb(217 164 65 / 30%); }
.live-card .live-head, .live-card .live-row { display: grid; grid-template-columns: 1fr 6rem 1fr; gap: .5rem; align-items: center; text-align: center; }
.live-head { font-weight: 800; font-size: .85rem; }
.is-buy { color: var(--good); }
.is-sell { color: var(--bad); }
.live-row { padding: .55rem 0; border-top: 1px dashed var(--line); }
.live-name { display: grid; line-height: 1.4; }
.live-price { font-size: 1.15rem; font-weight: 800; }
.feature { display: grid; gap: 8px; align-content: start; transition: transform .2s, border-color .2s; }
.feature:hover { transform: translateY(-3px); border-color: var(--gold-lo); }
.feature-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold-hi); }
.feature-icon .icon { width: 24px; height: 24px; }
.steps li::before { background: var(--gold-grad); color: var(--on-gold); }

/* sign-in and account pages */
.auth { box-shadow: var(--card-shadow), 0 30px 60px rgb(0 0 0 / 12%); }
.topbar .header-actions { margin-inline-start: auto; }

.features { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* site logo */
.brand img { width: 42px; height: 42px; border-radius: 0; box-shadow: none; object-fit: contain; }

/* landing price fit */
.live-card .live-head, .live-card .live-row { grid-template-columns: minmax(0, 1fr) 5rem minmax(0, 1fr); }
.live-card .live-row > * { min-width: 0; }
.live-price { font-size: clamp(.8rem, 3.8vw, 1.15rem); font-weight: 800; white-space: nowrap; letter-spacing: -.02em; }
.live-name { font-size: .92rem; }

/* price notices */
.notice-box { padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 1rem; background: rgba(184, 134, 11, .08); font-size: .85rem; line-height: 1.9; }
.notice-box[hidden] { display: none; }
.notice-box h3 { display: flex; align-items: center; gap: .4rem; margin: 0 0 .35rem; font-size: .92rem; font-weight: 800; }
.notice-box ul { margin: 0; padding-inline-start: 1.1rem; }
.notice-box li + li { margin-top: .15rem; }
.value-day { color: #b8860b; font-weight: 700; font-size: .78rem; }

/* plain reasons */
.result-reason, .order-reason { white-space: pre-line; line-height: 1.9; }

/* login simplified */
.link-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1.25rem; }
.link-btn { background: none; border: 0; padding: .4rem .2rem; font: inherit; font-size: .88rem; font-weight: 700; color: #b8860b; cursor: pointer; text-decoration: underline; text-underline-offset: .25em; }
.channel-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.channel-row .btn { padding-inline: .25rem; }
.auth-sep { margin: 0; padding-top: .75rem; border-top: 1px dashed var(--line); }

/* account menu */
.acct { position: relative; }
.acct-btn { gap: .45rem; max-width: 12rem; }
.acct-btn .avatar { width: 1.6rem; height: 1.6rem; font-size: .8rem; flex: none; }
.acct-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-btn::after { content: ''; flex: none; width: .4rem; height: .4rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.acct-menu { position: absolute; top: calc(100% + .5rem); inset-inline-end: 0; z-index: 80; min-width: 15rem; padding: .5rem; display: grid; gap: .15rem; }
.acct-menu[hidden] { display: none; }
.acct-head { display: grid; padding: .35rem .75rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .25rem; }
.acct-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .65rem .75rem; border: 0; border-radius: .75rem; background: none; color: inherit; font: inherit; font-weight: 700; text-align: start; text-decoration: none; cursor: pointer; }
.acct-item:hover, .acct-item:focus-visible { background: rgba(184, 134, 11, .12); }
.acct-danger { color: var(--bad, #c0392b); }
@media (max-width: 480px) { .acct-btn { max-width: 8.5rem; } }
