:root {
  --bg: #f6f7f4; --surface: #ffffff; --ink: #1d2a2a; --muted: #5d6b6b;
  --line: #e1e6e3; --accent: #0f7b6c; --accent-ink: #ffffff; --accent-soft: #e2f3ef;
  --warn-soft: #fff4dc; --warn-ink: #7a5300; --pro: #1f7a3a; --con: #a33a2b;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111716; --surface: #19211f; --ink: #e6eeec; --muted: #9aaba8;
    --line: #2a3533; --accent: #3cc2a9; --accent-ink: #0b1513; --accent-soft: #17332d;
    --warn-soft: #3a2f14; --warn-ink: #f2cf7c; --pro: #6fd08c; --con: #f08b7a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111716; --surface: #19211f; --ink: #e6eeec; --muted: #9aaba8;
  --line: #2a3533; --accent: #3cc2a9; --accent-ink: #0b1513; --accent-soft: #17332d;
  --warn-soft: #3a2f14; --warn-ink: #f2cf7c; --pro: #6fd08c; --con: #f08b7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 760px; margin: 0 auto; padding-block: 24px 64px;
       padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2em 0 .4em; }
h3 { margin: 1.6em 0 .6em; font-size: 1.05rem; }
p { margin: .3em 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); } .small { font-size: .875rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); font-weight: 600; }
.section-title { font-size: 1rem; margin: 28px 0 10px; }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
       padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { background: none; border: 0; font-weight: 700; font-size: 1rem; padding: 0; }
.stats { display: flex; align-items: center; gap: 8px; }
.chip { background: var(--accent-soft); color: var(--ink); padding: 3px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.xpbar { width: 80px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.xpbar span, .progress span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.progress { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 14px 0 6px; }

.card, .goal-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.center { text-align: center; }
.quests { display: grid; gap: 10px; }
.quest { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-align: left;
         background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); transition: transform .1s, border-color .1s; }
.quest:hover { border-color: var(--accent); transform: translateY(-1px); }
.xp { background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

.primary { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 12px 18px; font-weight: 600; }
.primary:disabled { opacity: .4; cursor: not-allowed; }
.ghost { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 8px 0; margin: 12px 0; }
.ghost.small { margin: 0; padding: 4px 6px; font-size: 1.1rem; color: var(--muted); }
.danger.confirming { background: var(--con); color: var(--surface); }
.danger { background: none; border: 1px solid var(--con); color: var(--con); border-radius: 10px; padding: 11px 16px; font-weight: 600; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; align-items: center; }
.done-label { color: var(--pro); font-weight: 700; }

.onboard { max-width: 560px; padding-top: 48px; }
.dots { display: flex; gap: 6px; margin: 8px 0 20px; }
.dots span { flex: 1; height: 5px; border-radius: 99px; background: var(--line); }
.dots span.on { background: var(--accent); }
.options { display: grid; gap: 10px; margin: 20px 0; }
.option { text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.option:hover, .option.selected { border-color: var(--accent); background: var(--accent-soft); }

.step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.draft { background: var(--warn-soft); color: var(--warn-ink); padding: 8px 12px; border-radius: 8px; font-size: .85rem; margin: 6px 0 12px; }
.why { margin: 10px 0; }
.hint { background: var(--accent-soft); padding: 12px 14px; border-radius: 10px; margin-top: 16px; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.option-card { position: relative; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.option-card:hover { border-color: var(--accent); }
.option-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px var(--accent) inset; }
.badge { align-self: flex-start; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-bottom: 4px; }
.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badges:empty { display: none; }
.badge.faculty { background: var(--warn-soft); color: var(--warn-ink); }
.source { font-size: .85rem; font-weight: 600; color: var(--accent); margin: 6px 0 0; }
.links { display: flex; gap: 20px; flex-wrap: wrap; }
.pc ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: .82rem; }
.pros li::before { content: "+ "; color: var(--pro); font-weight: 700; }
.cons li::before { content: "– "; color: var(--con); font-weight: 700; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.checklist input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.checklist input:checked + span { text-decoration: line-through; color: var(--muted); }

.resources { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.resource { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.resource:hover { border-color: var(--accent); }
.tag { align-self: flex-start; font-size: .7rem; border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-top: 4px; color: var(--muted); }

.kpi { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.big { font-size: 2rem; font-weight: 800; margin: 0; }

.roadmap { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 14px; }
.roadmap > li { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.roadmap > li.locked { opacity: .55; }
.roadmap > li.current { border-color: var(--accent); }
.node { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-weight: 700; }
.roadmap li.done .node { background: var(--accent); color: var(--accent-ink); }
.mini { list-style: none; padding: 0; margin: 6px 0 0; font-size: .85rem; color: var(--muted); }
.mini .d { color: var(--pro); }

.profile dt { font-size: .85rem; color: var(--muted); margin-top: 10px; }
.profile dd { margin: 0; font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; z-index: 20; animation: pop .25s ease-out; }
.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; padding: 16px; z-index: 30; }
.modal { background: var(--surface); border-radius: 18px; padding: 28px; max-width: 420px; text-align: center; animation: pop .3s ease-out; }
.confetti { font-size: 3rem; }
@keyframes pop { from { transform: translateX(var(--tx, 0)) scale(.9); opacity: 0; } to { opacity: 1; } }
.toast { --tx: -50%; }
footer { text-align: center; font-size: .75rem; color: var(--muted); padding-block: 0 32px;
         padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.ghost.muted-link { color: var(--muted); }
.ghost.muted-link.confirming { color: var(--con); }

/* AI coach */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.coach { margin-top: 20px; display: grid; gap: 12px; }
.coach-head { display: flex; align-items: center; gap: 10px; }
.coach-head h3 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-q { background: var(--accent-soft); color: var(--ink); border: 1px solid transparent; border-radius: 99px; padding: 7px 12px; font-size: .875rem; text-align: left; }
.chip-q:hover:not(:disabled) { border-color: var(--accent); }
.chip-q:disabled { opacity: .5; cursor: not-allowed; }
.thread { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.thread:empty { display: none; }
.bubble { padding: 10px 14px; border-radius: 14px; max-width: 92%; min-width: 0; overflow-wrap: anywhere; }
.bubble p { margin: 0 0 .5em; } .bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: .2em 0 .6em; padding-left: 1.2em; }
.bubble.user { justify-self: end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.bubble.assistant { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.assistant a { color: var(--accent); }
.thinking { color: var(--muted); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.ask-form { display: grid; gap: 8px; }
.ask-form textarea, .auth-form input { font: inherit; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.ask-form textarea { resize: vertical; min-height: 3.2em; }
.ask-form textarea:focus, .auth-form input:focus { border-color: var(--accent); outline: none; }
.ask-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.ask-actions .ghost { margin: 0; }
.coach-error { color: var(--con); font-size: .9rem; margin: 0; }

/* sign in */
.auth-form { display: grid; gap: 14px; margin: 20px 0 8px; }
.field { display: grid; gap: 4px; }
.field label { font-weight: 600; }
.field p { margin: 0; }

/* Home dashboard */
:root { --font-display: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif; }
h1, h2, .brand, .big, .stat-num { font-family: var(--font-display); }
h1, h2 { text-wrap: balance; }
h2 { font-size: 1.15rem; line-height: 1.3; margin: 0; }
main.dash { max-width: 1080px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
        background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border: 1px solid var(--line);
        border-radius: 20px; padding: 24px 28px; box-shadow: var(--shadow); }
.hero-text { flex: 1 1 420px; min-width: 0; }
.hero h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); margin: .15em 0 .2em; }
.ring { width: 148px; height: 148px; flex: none; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 12; }
.ring-fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 64px 64px; transition: stroke-dashoffset .8s ease; }
.ring-num { fill: var(--ink); font: 800 28px var(--font-display); }
.ring-label { fill: var(--muted); font: 600 11px system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat-num { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-num small { font-size: .8rem; color: var(--muted); font-weight: 700; }
.stat-label { font-size: .78rem; color: var(--muted); }
.mini-bar { display: block; height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.mini-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.stat-btn { margin-top: 4px; align-self: flex-start; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 99px; padding: 3px 10px; font-size: .75rem; font-weight: 700; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.dash-col { display: grid; gap: 20px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.card-head .ghost { margin: 0; padding: 0; font-size: .875rem; }
.card > h2 { margin-bottom: 12px; }
.empty { margin: 0; }
.continue { border: 1.5px solid var(--accent); }
.continue h2 { font-size: 1.45rem; margin: 6px 0 4px; }
.continue-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.continue-row .primary { margin-left: auto; }
.up-next { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; display: grid; gap: 6px; }
.up-next .eyebrow { margin: 0 0 2px; }
.next-item { display: flex; justify-content: space-between; gap: 12px; text-align: left; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.next-item:hover, .decisions button:hover { border-color: var(--accent); }
.next-item span:first-child { font-weight: 600; min-width: 0; }
.next-item .muted { flex: none; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.journey li { display: grid; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.j-node { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-weight: 800; }
.j-title { font-size: .85rem; font-weight: 600; line-height: 1.25; }
.j-bar { height: 5px; background: var(--line); border-radius: 99px; overflow: hidden; }
.j-bar span { display: block; height: 100%; background: var(--accent); }
.j-count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.j-done .j-node { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.j-current { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.j-locked { opacity: .55; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pchip { background: var(--bg); border: 1px solid var(--line); border-radius: 99px; padding: 3px 10px; font-size: .8rem; font-weight: 600; }
.decisions { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.decisions button { width: 100%; display: grid; gap: 1px; text-align: left; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.activity li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-size: .9rem; }
.a-time { white-space: nowrap; }
.coach-card .chips { margin: 10px 0 2px; }
.coach-card .ghost { margin-bottom: 0; }
.dash-foot { justify-content: center; margin-top: 12px; }
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .hero { padding: 20px; }
  .ring { width: 112px; height: 112px; order: -1; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .continue-row .primary { margin-left: 0; width: 100%; }
  .journey { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .journey li { grid-template-columns: 32px minmax(0, 1fr) 70px auto; align-items: center; gap: 10px; padding: 8px 10px; }
}

/* Reviewing finished quests */
.mini { display: grid; gap: 4px; }
.mini-step { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; text-align: left;
             background: none; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; color: var(--muted); }
.mini-step:hover { border-color: var(--accent); background: var(--accent-soft); }
.mini-step.d { color: var(--pro); }
.mini-sum { font-size: .8rem; color: var(--muted); }
.journey li[role="button"] { cursor: pointer; transition: border-color .1s; }
.journey li[role="button"]:hover { border-color: var(--accent); }
.journey li[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.done-note { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: .9rem; font-weight: 600; }

/* Supply kit */
:root { --st-ordered: #2f6fb3; --st-low: #b06a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-ordered: #7fb2ec; --st-low: #f0b45c; } }
:root[data-theme="dark"] { --st-ordered: #7fb2ec; --st-low: #f0b45c; }
main.inv { max-width: 920px; }
.inv-bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.inv-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }
.supply-headline { margin: 0; }
.inv-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.ic { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.ic-have { color: var(--pro); } .ic-ordered { color: var(--st-ordered); } .ic-need { color: var(--ink); } .ic-low { color: var(--st-low); }
.supply-card .eyebrow { margin: 12px 0 6px; }
.pchip.more { color: var(--muted); }
.supply-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.supply-actions .ghost { margin: 0; }
.low-line { color: var(--st-low); font-weight: 600; margin: 6px 0 0; }
.inv-callout { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.inv-callout > div { flex: 1 1 220px; min-width: 0; }
.inv-hero h1 { margin: 0; }
.tabs { display: flex; gap: 6px; margin: 18px 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.inv-tools { display: grid; gap: 10px; margin-bottom: 14px; }
.chip-q[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
#inv-search, .inv-add input, .inv-add select, .inv-vendor { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px; width: 100%; }
.inv-cat { margin-bottom: 14px; padding: 16px; }
.inv-cat-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.inv-cat-head .ghost { margin: 0; padding: 0; font-size: .875rem; text-decoration: none; }
.inv-list { list-style: none; margin: 0; padding: 0; display: grid; }
.inv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0 10px 12px; border-top: 1px solid var(--line); border-left: 3px solid transparent; }
.inv-row:first-child { border-top: 0; }
.inv-row.st-have { border-left-color: var(--pro); } .inv-row.st-ordered { border-left-color: var(--st-ordered); }
.inv-row.st-low { border-left-color: var(--st-low); } .inv-row.st-skip { opacity: .55; }
.inv-row.st-have .inv-name > span:first-child { color: var(--muted); }
.inv-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; flex: 1 1 260px; min-width: 0; font-weight: 600; }
.ess { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; color: var(--con); font-size: .8rem; text-decoration: underline; }
.inv-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-vendor { width: auto; max-width: 190px; padding: 6px 8px; font-size: .85rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: var(--surface); border: 0; border-left: 1px solid var(--line); padding: 6px 9px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"].seg-need { background: var(--accent-soft); color: var(--ink); }
.seg button[aria-pressed="true"].seg-ordered { background: var(--st-ordered); color: var(--surface); }
.seg button[aria-pressed="true"].seg-have { background: var(--pro); color: var(--surface); }
.seg button[aria-pressed="true"].seg-low { background: var(--st-low); color: var(--surface); }
.seg button[aria-pressed="true"].seg-skip { background: var(--muted); color: var(--surface); }
.inv-add { margin-top: 6px; }
.inv-add h2 { margin-bottom: 10px; }
.inv-add-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 8px; }
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.shop-head .ghost { margin: 0; }
.copy-fallback { width: 100%; font: .85rem/1.4 ui-monospace, monospace; margin: 8px 0; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.shop-group { margin: 12px 0; }
.shop-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; }
.shop-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.shop-list li > span:first-child { min-width: 0; font-weight: 600; }
.shop-btns { display: flex; gap: 6px; }
.shop-btns .chip-q { padding: 4px 10px; font-size: .8rem; }
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.vendor { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
.vendor.is-main { border: 1.5px solid var(--accent); }
.vendor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vendor-head .badge { margin: 0; white-space: nowrap; }
.vendor ul { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.vendor-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.vendor-actions .ghost { margin: 0; text-decoration: none; }
@media (max-width: 560px) {
  .inv-controls { width: 100%; }
  .seg { flex: 1 1 100%; }
  .seg button { flex: 1; padding: 8px 4px; }
  .inv-vendor { max-width: none; width: 100%; }
  .inv-add-row { grid-template-columns: minmax(0, 1fr); }
}

/* sign-in links */
.auth-links { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.auth-links .ghost { margin: 6px 0; }

/* Footer and legal pages */
.site-footer { display: grid; gap: 4px; }
.site-footer nav { font-size: .8rem; }
.site-footer a, .agree a, .legal a { color: var(--accent); }
.site-footer p { margin: 0; }
.agree { margin: 0; }
a.brand { color: var(--ink); text-decoration: none; }
main.legal { max-width: 720px; padding-block: 32px 64px; line-height: 1.65; }
main.legal h1 { font-size: 2rem; margin-bottom: 4px; }
main.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
main.legal ul { padding-left: 1.3em; display: grid; gap: 6px; }
main.legal mark { background: var(--warn-soft); color: var(--warn-ink); padding: 0 3px; border-radius: 4px; }
.legal-back { margin-top: 36px; }
