:root {
  --ink: #17211c;
  --muted: #68736c;
  --paper: #f4f0e7;
  --paper-deep: #eae4d8;
  --card: #fffdf8;
  --green: #2d5c4d;
  --green-dark: #193d33;
  --green-soft: #dbe7df;
  --orange: #dc6637;
  --yellow: #f3c968;
  --red: #a84132;
  --line: rgba(23, 33, 28, .13);
  --shadow: 0 18px 45px rgba(40, 50, 43, .09);
  --radius: 24px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 82% 0%, rgba(243, 201, 104, .24), transparent 26rem), var(--paper); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .58; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.loading-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; color: var(--green); }
.loading-screen .brand-seal { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .66; } }

.brand-seal { width: 44px; height: 44px; display: grid; place-items: center; flex: none; border-radius: 50% 50% 46% 54% / 52% 42% 58% 48%; color: #fff; background: var(--green); font: 700 23px Georgia, serif; box-shadow: inset 0 -5px 10px rgba(0,0,0,.13); transform: rotate(-4deg); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; }
.wordmark > span:last-child { display: grid; line-height: 1.05; }
.wordmark strong { font: 700 21px Georgia, serif; letter-spacing: -.02em; }
.wordmark small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.access-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .9fr) minmax(480px, 1.1fr); overflow: hidden; }
.access-art { position: relative; min-height: 100vh; overflow: hidden; background: var(--green); }
.access-art::before, .access-art::after { content: ""; position: absolute; border-radius: 50%; }
.access-art::before { width: 440px; height: 440px; left: -150px; top: -70px; background: var(--yellow); }
.access-art::after { width: 520px; height: 520px; left: 23%; bottom: -230px; background: var(--orange); }
.access-art span { position: absolute; z-index: 2; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; color: #fff; font: italic 700 22px Georgia, serif; transform: rotate(-8deg); }
.access-art span:nth-child(1) { width: 150px; height: 150px; top: 22%; left: 48%; }
.access-art span:nth-child(2) { width: 110px; height: 110px; top: 47%; left: 16%; transform: rotate(9deg); }
.access-art span:nth-child(3) { width: 190px; height: 190px; top: 58%; right: 8%; transform: rotate(4deg); }
.access-card { width: min(520px, calc(100% - 48px)); margin: auto; padding: 52px 0; }
.access-card .wordmark { margin-bottom: 76px; }
.eyebrow { margin: 0 0 12px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.access-card h1, .view-heading h1 { margin: 0; font: 700 clamp(38px, 5vw, 64px)/.94 Georgia, serif; letter-spacing: -.045em; }
.access-card h1 em, .view-heading h1 em { color: var(--green); font-weight: 400; }
.lede { max-width: 440px; margin: 24px 0 28px; color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; color: #39443e; font-size: 12px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; outline: none; background: rgba(255,255,255,.77); padding: 13px 14px; transition: border .2s, box-shadow .2s, background .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--green); background: #fff; box-shadow: 0 0 0 4px rgba(45,92,77,.11); }
textarea { resize: vertical; }
.check-row { grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-weight: 500; }
.check-row input { width: 18px; height: 18px; accent-color: var(--green); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; border: 1px solid transparent; border-radius: 999px; padding: 10px 18px; background: transparent; font-size: 13px; font-weight: 800; transition: transform .16s, background .16s, color .16s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--green); box-shadow: 0 8px 20px rgba(45,92,77,.18); }
.button.primary:hover { background: var(--green-dark); }
.button.quiet { border-color: var(--line); background: rgba(255,255,255,.54); }
.button.quiet:hover { background: #fff; }
.button.danger { color: var(--red); border-color: rgba(168,65,50,.23); background: rgba(168,65,50,.06); }
.wide { width: 100%; }
.text-button { margin-top: 18px; padding: 0; border: 0; color: var(--green); background: none; font-size: 13px; font-weight: 750; }
.form-error { margin: 0; color: var(--red); font-size: 12px; line-height: 1.45; }
.pending-icon { width: 58px; height: 58px; margin-bottom: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--green-soft); font-size: 24px; }
.pending-actions { display: flex; gap: 10px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 244px; display: flex; flex-direction: column; padding: 32px 24px; border-right: 1px solid var(--line); background: rgba(246,243,235,.89); backdrop-filter: blur(18px); }
.main-nav { display: grid; gap: 5px; margin-top: 56px; }
.nav-button { border: 0; border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 13px; color: var(--muted); background: transparent; font-weight: 720; text-align: left; }
.nav-button > span { width: 24px; display: inline-grid; place-items: center; font-size: 19px; }
.nav-button:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.nav-button.is-active { color: #fff; background: var(--green); box-shadow: 0 8px 21px rgba(45,92,77,.15); }
.sidebar-foot { margin-top: auto; padding: 14px 4px 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: #48a56f; box-shadow: 0 0 0 4px rgba(72,165,111,.12); }
.sync-dot.is-offline { background: var(--orange); }
.avatar-button { width: 38px; height: 38px; margin-left: auto; border: 0; border-radius: 50%; color: #fff; background: var(--orange); font-weight: 850; }
.workspace { min-height: 100vh; margin-left: 244px; padding: 54px clamp(28px, 5vw, 82px) 100px; }
.view { display: none; max-width: 1120px; margin: 0 auto; }
.view.is-active { display: block; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.view-heading { min-height: 100px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.view-heading h1 { font-size: clamp(38px, 4.8vw, 62px); }
.view-subtitle { margin: 12px 0 0; color: var(--muted); line-height: 1.5; }
.view-heading .button { margin-bottom: 4px; }
.mobile-header, .mobile-nav { display: none; }

.quick-add { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 22px; padding: 7px 8px 7px 17px; border: 1px solid rgba(45,92,77,.16); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
.quick-add > span { color: var(--orange); font-size: 23px; }
.quick-add input { border: 0; padding: 12px 4px; background: transparent; box-shadow: none; font-size: 16px; }
.quick-add button { border: 0; border-radius: 12px; padding: 11px 19px; color: #fff; background: var(--orange); font-weight: 800; }
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.segment { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.35); }
.segment button { border: 0; border-radius: 999px; padding: 8px 15px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 800; }
.segment button.is-active { color: var(--ink); background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.06); }
.search-box { width: min(260px, 40vw); grid-template-columns: auto 1fr; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.45); }
.search-box span { color: var(--muted); font-size: 20px; }
.search-box input { border: 0; padding: 9px 0; background: transparent; box-shadow: none; }
.item-list { display: grid; gap: 9px; }
.empty-card { padding: 64px 20px; border: 1px dashed rgba(45,92,77,.3); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty-card span { display: block; margin-bottom: 12px; font-size: 32px; }
.item-card { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 14px; min-height: 76px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.83); transition: border .16s, transform .16s, opacity .16s; }
.item-card:hover { transform: translateY(-1px); border-color: rgba(45,92,77,.28); }
.item-check { width: 42px; height: 42px; display: grid; place-items: center; border: 1.5px solid rgba(45,92,77,.32); border-radius: 50%; color: transparent; background: var(--paper); font-size: 20px; }
.item-check:hover { color: #fff; background: var(--green); }
.item-copy { min-width: 0; }
.item-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.item-meta { display: flex; flex-wrap: wrap; gap: 5px 11px; margin-top: 6px; color: var(--muted); font-size: 11px; }
.item-meta span { display: inline-flex; align-items: center; gap: 4px; }
.scope-badge, .priority-badge { padding: 4px 8px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.priority-badge { color: #99411f; background: #f7dfd1; }
.item-actions { display: flex; align-items: center; gap: 4px; }
.item-actions button { width: 35px; height: 35px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.item-actions button:hover { color: var(--ink); background: var(--paper-deep); }
.item-card.is-unavailable { opacity: .65; }
.item-card.is-complete { opacity: .62; }
.item-card.is-complete .item-check { color: #fff; border-color: var(--green); background: var(--green); }
.item-card.is-complete .item-copy strong { text-decoration: line-through; }

.shop-heading { align-items: center; }
.shop-count { min-width: 100px; display: grid; justify-items: end; }
.shop-count strong { font: 700 42px Georgia, serif; }
.shop-count span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.shop-toolbar { display: grid; grid-template-columns: minmax(180px,1fr) minmax(160px,.8fr) auto auto auto; gap: 9px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.55); }
.select-field { gap: 4px; }
.select-field span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.select-field select { padding: 10px 12px; background-color: #fff; }
.select-field.compact { grid-template-columns: auto minmax(120px,1fr); align-items: center; gap: 10px; }
.icon-button { width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 18px; }
.icon-button.is-active { color: #fff; background: var(--green); }
.shop-options { display: flex; align-items: center; gap: 20px; margin: 12px 2px 24px; }
.toggle { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.toggle input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.toggle > span { width: 36px; height: 20px; position: relative; border-radius: 99px; background: #b9c1bc; transition: background .2s; }
.toggle > span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(16px); }
.shop-list { display: grid; gap: 18px; padding-bottom: 76px; }
.aisle-group { display: grid; gap: 7px; }
.aisle-heading { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; padding: 9px 6px; color: var(--green); background: linear-gradient(var(--paper) 70%, transparent); font: 700 17px Georgia, serif; }
.aisle-heading span { color: var(--muted); font: 700 10px Inter, sans-serif; text-transform: uppercase; letter-spacing: .1em; }
.shop-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: center; min-height: 88px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: 0 6px 18px rgba(40,50,43,.05); }
.shop-aisle-label { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.shop-aisle-select { max-width: 190px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 24px 5px 9px; color: var(--ink); background: var(--paper); font: inherit; font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.shop-item strong { display: block; font-size: 17px; }
.shop-item p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.shop-item-actions { display: flex; gap: 7px; }
.shop-item-actions button { min-width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-size: 19px; }
.shop-item-actions .buy-button { color: #fff; border-color: var(--green); background: var(--green); }
.shop-item.is-trolley { border-color: rgba(220,102,55,.38); background: #fff7f1; }
.running-total { position: fixed; z-index: 10; right: clamp(28px,5vw,82px); bottom: 24px; display: flex; align-items: center; gap: 18px; padding: 12px 18px; border-radius: 999px; color: #fff; background: var(--green-dark); box-shadow: 0 10px 28px rgba(25,61,51,.28); }
.running-total span { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }

.activity-list { position: relative; max-width: 770px; display: grid; gap: 0; }
.activity-list::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 20px; width: 1px; background: var(--line); }
.activity-entry { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: start; padding: 13px 0; }
.activity-avatar { z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; border: 4px solid var(--paper); border-radius: 50%; color: #fff; background: var(--orange); font-size: 12px; font-weight: 850; }
.activity-entry p { margin: 3px 0; font-size: 14px; }
.activity-entry strong { font-weight: 800; }
.activity-entry small, .activity-time { color: var(--muted); font-size: 11px; }

.privacy-note { display: flex; gap: 14px; max-width: 760px; margin-bottom: 25px; padding: 15px 18px; border: 1px solid rgba(45,92,77,.16); border-radius: 18px; background: var(--green-soft); }
.privacy-note > span { font-size: 23px; }
.privacy-note p { margin: 0; color: #405047; font-size: 12px; line-height: 1.55; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px,1fr)); gap: 16px; }
.loyalty-card { position: relative; min-height: 185px; padding: 20px; overflow: hidden; border-radius: 23px; color: #fff; background: var(--green); box-shadow: var(--shadow); }
.loyalty-card:nth-child(3n+2) { background: var(--orange); }
.loyalty-card:nth-child(3n+3) { color: var(--ink); background: var(--yellow); }
.loyalty-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -75px; bottom: -90px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; }
.loyalty-card header { display: flex; justify-content: space-between; align-items: start; }
.loyalty-card header span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; opacity: .72; }
.loyalty-card h3 { margin: 28px 0 4px; font: 700 25px Georgia, serif; }
.loyalty-card p { margin: 0; font-size: 13px; opacity: .77; }
.loyalty-card footer { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 17px; display: flex; gap: 8px; }
.loyalty-card footer button { border: 1px solid rgba(255,255,255,.34); border-radius: 999px; padding: 8px 13px; color: inherit; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 800; }
.loyalty-card:nth-child(3n+3) footer button { border-color: rgba(23,33,28,.22); }

.receipt-flow { max-width: 530px; display: flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.receipt-flow i { height: 1px; flex: 1; background: var(--line); }
.receipt-list { display: grid; gap: 10px; }
.receipt-row { display: grid; grid-template-columns: auto minmax(0,1fr) auto auto; gap: 14px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.receipt-icon { width: 46px; height: 52px; display: grid; place-items: center; border-radius: 8px 8px 13px 13px; color: var(--green); background: var(--green-soft); font-size: 20px; }
.receipt-row strong { display: block; }
.receipt-row p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.status-badge { padding: 5px 9px; border-radius: 999px; color: #8a5318; background: #f7e7c2; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-badge.confirmed { color: var(--green); background: var(--green-soft); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,253,248,.82); }
.mobile-more-links { display: none; }
.mobile-more-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.settings-card.wide-card { grid-column: 1 / -1; }
.settings-card > header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.settings-card > header > div { display: flex; align-items: center; gap: 12px; }
.settings-card h2 { margin: 0; font: 700 19px Georgia, serif; }
.settings-card header p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.setting-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 18px; }
.store-config { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.store-config:first-child { border-top: 0; }
.store-config > header { display: flex; justify-content: space-between; align-items: center; }
.store-config strong { font-size: 14px; }
.store-config header button { border: 0; color: var(--green); background: none; font-size: 12px; font-weight: 800; }
.aisle-route { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.aisle-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 11px; cursor: grab; }
.aisle-chip span { color: var(--muted); }
.token-list { display: grid; gap: 8px; margin-top: 14px; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 11px; border-radius: 13px; background: var(--paper); }
.token-row strong { font-size: 12px; }
.token-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.token-row button { border: 0; color: var(--red); background: none; font-size: 11px; font-weight: 800; }
.settings-logout { margin-top: 9px; }

dialog { padding: 0; border: 0; color: var(--ink); background: transparent; }
dialog::backdrop { background: rgba(12,25,20,.48); backdrop-filter: blur(6px); }
.sheet-dialog { width: min(720px, calc(100vw - 28px)); max-height: min(90vh, 850px); overflow: auto; border-radius: 25px; }
.dialog-card { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 26px; background: var(--card); }
.dialog-card > header, .dialog-card > footer, .full { grid-column: 1 / -1; }
.dialog-card > header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 6px; }
.dialog-card h2 { margin: 0; font: 700 28px Georgia, serif; }
.dialog-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--paper-deep); font-size: 21px; }
.dialog-card > footer { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; }
.dialog-card details { border: 1px solid var(--line); border-radius: 15px; padding: 12px 14px; }
.dialog-card summary { cursor: pointer; color: var(--green); font-size: 12px; font-weight: 800; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 15px; }
.upload-field { padding: 17px; border: 1px dashed rgba(45,92,77,.35); border-radius: 15px; background: rgba(219,231,223,.28); }
.upload-field input { padding: 10px 0 0; border: 0; background: transparent; box-shadow: none; }
.upload-field em, .hint { color: var(--muted); font-size: 10px; font-style: normal; line-height: 1.5; }
.scope-list { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; border: 0; padding: 0; }
.scope-list legend { margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.scope-list label { grid-template-columns: auto 1fr; align-items: center; gap: 8px; padding: 9px; border-radius: 10px; background: var(--paper); font-weight: 600; }
.scope-list input { width: 17px; height: 17px; accent-color: var(--green); }
.compact-dialog { grid-template-columns: 1fr; }
.large-dialog { width: min(900px, calc(100vw - 28px)); }
.receipt-step { display: grid; gap: 15px; }
.receipt-step footer { display: flex; justify-content: flex-end; gap: 9px; }
.receipt-preview { min-height: 260px; max-height: 420px; display: grid; place-items: center; overflow: auto; border-radius: 15px; background: #e7e4dc; }
.receipt-preview img { max-width: 100%; max-height: 420px; object-fit: contain; }
.receipt-preview iframe { width: 100%; height: 420px; border: 0; }
.receipt-matches { display: grid; gap: 8px; }
.receipt-match { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(170px,.8fr); align-items: center; gap: 12px; padding: 11px; border-radius: 13px; background: var(--paper); }
.receipt-match > span { color: var(--muted); }

.reveal-dialog { width: min(520px, calc(100vw - 28px)); border-radius: 26px; }
.reveal-card { position: relative; padding: 29px; text-align: center; background: var(--card); }
.reveal-card .dialog-close { position: absolute; right: 16px; top: 16px; }
.reveal-card h2 { margin: 0 0 20px; font: 700 29px Georgia, serif; }
.barcode-stage { min-height: 310px; display: grid; place-items: center; padding: 18px; border-radius: 20px; background: #fff; }
.barcode-stage img { max-width: 100%; max-height: 360px; image-rendering: auto; }
.reveal-card > p:last-child { color: var(--muted); font-size: 11px; }
.token-secret-card { text-align: left; }
.secret-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: center; }
.secret-row code { max-height: 120px; overflow: auto; padding: 13px; border-radius: 12px; background: var(--paper); word-break: break-all; font-size: 11px; }

.toast-region { position: fixed; z-index: 100; right: 22px; bottom: calc(22px + var(--safe-bottom)); display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 340px; padding: 12px 16px; border-radius: 14px; color: #fff; background: var(--green-dark); box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.is-error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(9px); } }

@media (max-width: 900px) {
  .access-screen { grid-template-columns: 1fr; }
  .access-art { display: none; }
  .access-card { padding: 35px 0 60px; }
  .access-card .wordmark { margin-bottom: 68px; }
  .sidebar { display: none; }
  .workspace { margin-left: 0; padding: 95px 18px calc(105px + var(--safe-bottom)); }
  .mobile-header { position: fixed; inset: 0 0 auto; z-index: 20; height: 74px; display: flex; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line); background: rgba(246,243,235,.91); backdrop-filter: blur(18px); }
  .mobile-header .brand-seal { width: 38px; height: 38px; font-size: 20px; }
  .mobile-header .wordmark strong { font-size: 18px; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; height: calc(70px + var(--safe-bottom)); display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: start; padding: 7px 9px var(--safe-bottom); border-top: 1px solid var(--line); background: rgba(255,253,248,.94); backdrop-filter: blur(18px); }
  .mobile-nav .nav-button { height: 54px; justify-content: center; display: grid; justify-items: center; gap: 1px; padding: 4px; border-radius: 12px; font-size: 18px; }
  .mobile-nav .nav-button > span { width: auto; font-size: 19px; }
  .mobile-nav .nav-button small { font-size: 9px; font-weight: 800; }
  .mobile-nav .nav-button.is-active { color: var(--green); background: var(--green-soft); box-shadow: none; }
  .mobile-add { width: 56px; height: 56px; margin: -20px auto 0; border: 6px solid var(--card); border-radius: 50%; color: #fff; background: var(--orange); box-shadow: 0 8px 20px rgba(220,102,55,.25); font-size: 25px; }
  .view-heading { min-height: 0; margin-bottom: 25px; }
  .view-heading h1 { font-size: 42px; }
  .desktop-add { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
  .mobile-more-links { display: block; }
  .settings-card.wide-card { grid-column: auto; }
  .shop-toolbar { grid-template-columns: 1fr 1fr auto auto; }
  .shop-toolbar .button { grid-column: 1 / -1; }
  .running-total { right: 16px; bottom: calc(84px + var(--safe-bottom)); }
}

@media (max-width: 600px) {
  .workspace { padding-left: 12px; padding-right: 12px; }
  .view-heading { align-items: start; }
  .view-heading h1 { font-size: 37px; }
  .view-subtitle { font-size: 12px; }
  .quick-add { position: sticky; top: 79px; z-index: 8; }
  .filter-row { align-items: stretch; }
  .search-box { width: 44%; }
  .item-card { padding: 11px 12px; gap: 10px; }
  .item-check { width: 39px; height: 39px; }
  .item-actions button:not(.edit-item) { display: none; }
  .shop-heading .view-subtitle { display: none; }
  .shop-toolbar { grid-template-columns: 1fr 1fr auto; padding: 11px; }
  .shop-toolbar .icon-button:nth-of-type(2) { display: none; }
  .shop-options { flex-wrap: wrap; gap: 12px 17px; }
  .select-field.compact { width: 100%; }
  .shop-item { min-height: 96px; padding: 14px; }
  .shop-item-actions button { min-width: 50px; height: 50px; }
  .running-total span { display: none; }
  .running-total { position: static; width: max-content; margin: -55px 0 18px auto; }
  .dialog-card { grid-template-columns: 1fr; padding: 20px; }
  .dialog-card > *, .dialog-card > header, .dialog-card > footer, .full { grid-column: 1; }
  .details-grid { grid-template-columns: 1fr; }
  .details-grid > * { grid-column: 1; }
  .scope-list { grid-template-columns: 1fr; }
  .sheet-dialog { width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .sheet-dialog[open] { position: fixed; top: auto; bottom: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .receipt-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .receipt-row .button { grid-column: 2 / -1; }
  .receipt-match { grid-template-columns: 1fr auto; }
  .receipt-match select { grid-column: 1 / -1; }
  .secret-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
