/* WasteLoop — design tokens, layout, components */
:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --border: #e1e7e4;
  --text: #13201b;
  --muted: #5f6f68;
  --brand: #0f7a5a;
  --brand-600: #0b6148;
  --brand-soft: #e3f4ee;
  --accent: #6b4df0;
  --accent-soft: #eee9ff;
  --warn: #b7791f;
  --warn-soft: #fdf3dc;
  --danger: #c53030;
  --danger-soft: #fde8e8;
  --ok: #2f855a;
  --ok-soft: #e6f6ec;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,20,.06), 0 4px 16px rgba(16,24,20,.05);
  --shadow-lg: 0 20px 60px rgba(16,24,20,.22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1210;
  --surface: #121b18;
  --surface-2: #17231f;
  --border: #22322c;
  --text: #e7f0ec;
  --muted: #8aa39a;
  --brand: #2fbf8f;
  --brand-600: #27a77c;
  --brand-soft: #14302a;
  --accent: #9c86ff;
  --accent-soft: #21193f;
  --warn: #f2c063;
  --warn-soft: #33270f;
  --danger: #ff8080;
  --danger-soft: #3a1717;
  --ok: #6fd69a;
  --ok-soft: #123323;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.big { font-size: 1.25rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.center-head { text-align: center; margin: 0 auto 1.5rem; }
.mt { margin-top: 1.25rem; }
.mt-s { margin-top: .6rem; }
.prose { white-space: normal; max-width: 70ch; }
.eyebrow { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); font-weight: 650; margin-bottom: .4rem; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: .75rem; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--surface-2); color: var(--muted); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem;
  padding: 1.1rem .9rem; background: var(--surface); border-right: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 750; font-size: 1.1rem; color: var(--text); padding: .25rem .4rem; }
.brand:hover { text-decoration: none; }
.logo { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: 1rem; }
.logo.lg { width: 56px; height: 56px; font-size: 1.6rem; margin: 0 auto .8rem; border-radius: 16px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: .9rem .6rem .3rem; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .55rem .65rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; transition: background .15s; }
.nav a i { font-style: normal; width: 1.2rem; text-align: center; color: var(--muted); }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a.active i { color: var(--brand); }
.plan-card { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding: .9rem; border-radius: var(--radius); background: linear-gradient(160deg, var(--brand-soft), var(--accent-soft)); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.5rem; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.spacer { flex: 1; }
.cmdk-trigger {
  display: flex; align-items: center; gap: 1rem; min-width: 320px; padding: .5rem .8rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); cursor: pointer; font: inherit;
}
.cmdk-trigger:hover { border-color: var(--brand); }
.cmdk-trigger span { flex: 1; text-align: left; }
.user-chip { display: flex; align-items: center; gap: .6rem; }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.content { padding: 1.75rem 2rem 3rem; max-width: 1400px; width: 100%; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { margin: 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* ---------- Primitives ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.25rem; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; }
.card-head h2 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: .9rem; }
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.25rem; align-items: start; }
.split.wide-left { grid-template-columns: 1.8fr 1fr; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.block { display: flex; width: 100%; justify-content: center; }
.inline { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .9rem; }
.narrow { width: 110px; }
.empty { color: var(--muted); padding: 1.5rem; text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); }
.empty-state { text-align: center; padding: 4rem 1rem; }

label { display: flex; flex-direction: column; gap: .35rem; font-size: .86rem; font-weight: 550; color: var(--text); }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .6rem .75rem; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input[type="radio"], input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea { resize: vertical; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600;
  padding: .6rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s;
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 18px -8px var(--brand); }
.btn.primary:hover { background: var(--brand-600); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { padding: .42rem .7rem; font-size: .85rem; }
.btn.icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; }

.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 650; padding: .2rem .55rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); text-transform: capitalize; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.hz-none { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.hz-low { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.tag.hz-medium { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.hz-high { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag.s-pending { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.s-accepted, .tag.s-completed, .tag.s-active { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.tag.s-rejected, .tag.s-withdrawn, .tag.s-cancelled { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.tag.s-sold { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 550; border: 1px solid transparent; animation: rise .3s ease both; }
.alert.success { background: var(--ok-soft); color: var(--ok); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .8rem 0 1.1rem; }
.chip { font: inherit; font-size: .85rem; font-weight: 550; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.seg button { font: inherit; font-size: .85rem; font-weight: 550; border: 0; background: transparent; color: var(--muted); padding: .35rem .7rem; border-radius: 7px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.tab { font: inherit; font-weight: 600; background: none; border: 0; color: var(--muted); padding: .7rem .9rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--surface-2); font-size: .75rem; text-align: center; }

.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.table td { padding: .75rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table td .btn { margin-left: .3rem; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kpi { display: flex; align-items: center; gap: .9rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi::after { content: ""; position: absolute; inset: auto -30px -30px auto; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .06; }
.kpi strong { display: block; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; background: var(--surface-2); }
.tile-blue { color: #2563eb; } .tile-amber { color: var(--warn); } .tile-violet { color: var(--accent); }
.tile-green { color: var(--ok); } .tile-teal { color: #0d9488; } .tile-rose { color: #e11d48; }
.agent-teaser { background: linear-gradient(170deg, var(--surface), var(--accent-soft)); }
.suggest-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.suggest-list .chip { width: 100%; text-align: left; border-radius: var(--radius-sm); }

/* ---------- Marketplace ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.search-field { flex: 1 1 280px; display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 .75rem; }
.search-field input { border: 0; background: transparent; padding: .6rem 0; }
.search-field input:focus { box-shadow: none; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; transition: opacity .2s; }
.grid-cards.loading { opacity: .6; }
.listing-card {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  animation: rise .4s ease both;
}
.listing-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); text-decoration: none; }
.listing-card h3 { margin: .2rem 0 0; font-size: 1.02rem; }
.lc-top { display: flex; gap: .4rem; flex-wrap: wrap; }
.lc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; padding-top: .7rem; border-top: 1px dashed var(--border); }
.lc-foot strong { font-size: 1.15rem; }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.tall { height: 260px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Listing detail ---------- */
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem 1.5rem; }
.spec-grid > div { display: flex; flex-direction: column; gap: .2rem; }
.fee-preview { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: .8rem; }
.fee-preview div { display: flex; flex-direction: column; }
.fee-preview strong { font-size: 1.05rem; }
.agent-panel { background: linear-gradient(170deg, var(--surface), var(--accent-soft)); }
.agent-panel textarea { margin: .6rem 0 .8rem; }
.agent-status { margin-top: .8rem; font-size: .9rem; color: var(--muted); }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.plan { position: relative; display: flex; flex-direction: column; gap: .9rem; padding: 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); transition: transform .2s; }
.plan:hover { transform: translateY(-4px); }
.plan.featured { border-color: var(--accent); box-shadow: 0 20px 50px -20px var(--accent); }
.plan.current { outline: 2px solid var(--brand); outline-offset: 2px; }
.ribbon { position: absolute; top: -11px; right: 18px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; }
.price { display: flex; align-items: baseline; gap: .4rem; }
.price strong { font-size: 2rem; letter-spacing: -.02em; }
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.feature-list li::before { content: "✓"; color: var(--brand); font-weight: 800; margin-right: .5rem; }
.fee-table { display: grid; gap: .35rem; padding: .7rem; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; }
.fee-table div { display: flex; justify-content: space-between; }

/* ---------- Orders ---------- */
.order-actions { display: flex; gap: .4rem; justify-content: flex-end; }

/* ---------- Assistant ---------- */
.assistant { display: grid; grid-template-columns: 260px 1fr; gap: 1rem; height: calc(100vh - 150px); min-height: 520px; }
.convos { display: flex; flex-direction: column; gap: .8rem; overflow: hidden; }
.convo-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.convo-list li { padding: .55rem .65rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo-list li:hover { background: var(--surface-2); }
.convo-list li.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.chat-head h2 { margin: 0; }
.thread { flex: 1; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: .9rem; scroll-behavior: smooth; }
.msg { max-width: 78%; padding: .75rem .95rem; border-radius: 16px; line-height: 1.55; white-space: pre-wrap; animation: rise .25s ease both; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.error { align-self: center; background: var(--danger-soft); color: var(--danger); }
.trace { align-self: flex-start; display: flex; flex-wrap: wrap; gap: .35rem; font-size: .78rem; }
.trace span { padding: .2rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: ui-monospace, Menlo, monospace; }
.trace span.fail { background: var(--danger-soft); color: var(--danger); }
.typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: .8rem 1rem; background: var(--surface-2); border-radius: 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.welcome { margin: auto; text-align: center; max-width: 520px; padding: 2rem 0; }
.welcome-mark { font-size: 2.2rem; color: var(--accent); }
.composer { display: flex; gap: .6rem; padding: .9rem 1.1rem; border-top: 1px solid var(--border); align-items: flex-end; }
.composer textarea { min-height: 44px; max-height: 160px; }

/* ---------- Command palette / toasts ---------- */
.cmdk { position: fixed; inset: 0; z-index: 100; background: rgba(8,14,12,.45); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; animation: fade .15s ease both; }
.cmdk[hidden] { display: none; }
.cmdk-box { width: min(620px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-box input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 1rem 1.1rem; font-size: 1rem; background: transparent; }
.cmdk-box ul { list-style: none; margin: 0; padding: .4rem; max-height: 340px; overflow-y: auto; }
.cmdk-box li { display: flex; justify-content: space-between; padding: .65rem .8rem; border-radius: 10px; cursor: pointer; }
.cmdk-box li.sel, .cmdk-box li:hover { background: var(--brand-soft); color: var(--brand); }
.cmdk-foot { padding: .6rem 1rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--border); display: flex; gap: .4rem; align-items: center; }
@keyframes fade { from { opacity: 0; } }

.toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 200; display: flex; flex-direction: column; gap: .6rem; }
.toast { min-width: 240px; max-width: 380px; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); animation: slide .3s ease both; font-weight: 550; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--brand); color: #fff; }
.toast.leave { opacity: 0; transform: translateY(8px); transition: all .35s; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } }

/* ---------- Auth ---------- */
.guest-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--brand-soft), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow-lg); }
.auth-card.wide { width: min(640px, 100%); }
.auth-brand { text-align: center; margin-bottom: 1.4rem; }
.auth-brand p { margin: 0; }
.auth-card form { display: flex; flex-direction: column; gap: 1rem; }
.auth-card.wide form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.type-picker { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.type-picker legend { font-size: .86rem; font-weight: 550; margin-bottom: .4rem; }
.choice { flex-direction: row; align-items: flex-start; gap: .6rem; padding: .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-weight: 500; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice span { display: flex; flex-direction: column; }
.choice small { color: var(--muted); font-weight: 400; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split, .split.wide-left, .assistant { grid-template-columns: 1fr; }
  .assistant { height: auto; }
  .convos { max-height: 220px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 260px; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .cmdk-trigger { min-width: 0; flex: 1; }
  .content { padding: 1.25rem 1rem 2.5rem; }
  .user-meta, .topbar form { display: none; }
  .grid-2, .auth-card.wide form, .type-picker { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .msg { max-width: 92%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- v3: chart, spacing helpers ---------- */
.mb { margin-bottom: 1.25rem; }
.chart-card .chart { width: 100%; height: 200px; display: block; }
.chart .bar.sales { fill: var(--brand); }
.chart .bar.purchases { fill: var(--accent); opacity: .85; }
.chart .baseline { stroke: var(--border); stroke-width: 1; }
.chart .axis { font-size: 11px; fill: var(--muted); text-anchor: start; }
.legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.legend .sw.sales { background: var(--brand); }
.legend .sw.purchases { background: var(--accent); }
.auth-card.wide h3 { margin: .6rem 0 0; font-size: .95rem; }
