@font-face { font-family: "Big Hand"; src: url("/big-hand.ttf") format("truetype"); font-display: swap; }
/* Appearance is device-local. Both themes share the same semantic colour tokens. */
:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background-color: var(--canvas);
  --canvas: #f5faf5;
  --canvas-fade: #eef7ef;
  --top-glow: #c8edd5;
  --top-glow-x: 100%;
  --side-glow: #eef7ef;
  --brand: #eef7ef;
  --brand-backing: #163729;
  --brand-padding: .5rem;
  --header-text: #163729;
  --header-control: #e6f3e8;
  --header-hover: #d9edde;
  --surface: #fff;
  --card-bottom: #f8fcf8;
  --surface-shadow: #16372916;
  --divider: #d4e4d8;
  --ink: #163729;
  --muted: #496657;
  --readout: #176345;
  --soft: #e6f3e8;
  --control: #edf6ee;
  --field: #e6f3e8;
  --control-hover: #e1f1e5;
  --primary: #176345;
  --primary-text: #fff;
  --primary-hover: #105238;
  --focus: #225d41;
  --capture-top: #f5faf5;
  --capture-bottom: #edf6ee;
  --nav-surface: #e6f3e8;
  --nav-active: #d1ead8;
  --warn: #793c15;
  --warn-bg: #fff2e4;
  --close: #a92945;
  --close-hover: #f9dce3;
  --backdrop: #11263599;
  --radius: 20px;
}

:root[data-theme="blue-hour"] {
  color-scheme: dark;
  --canvas: #0b1520;
  --canvas-fade: #0b1520;
  --top-glow: #173e5b;
  --top-glow-x: 83%;
  --side-glow: #112c3b;
  --brand: #101f2f;
  --brand-backing: transparent;
  --brand-padding: 0px;
  --header-text: #d2ebf8;
  --header-control: #182d3e;
  --header-hover: #234055;
  --surface: #17283a;
  --card-bottom: #101d2b;
  --surface-shadow: #030b142b;
  --divider: #ccedff24;
  --ink: #f1f8ff;
  --muted: #b4c7d8;
  --readout: #b0eff5;
  --soft: #162e3d;
  --control: #223b50;
  --field: #223b50;
  --control-hover: #2a485f;
  --primary: #86e4ed;
  --primary-text: #0b222c;
  --primary-hover: #a0edf3;
  --focus: #a9f0f4;
  --capture-top: #182e40;
  --capture-bottom: #112538;
  --nav-surface: #162e3d;
  --nav-active: #22465a;
  --warn: #ffd19a;
  --warn-bg: #392b23;
  --close: #ff91a5;
  --close-hover: #462b41;
  --backdrop: #030b14b0;
  --radius: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-size: .9rem;
  background: radial-gradient(ellipse at var(--top-glow-x) 0%, var(--top-glow), transparent 54%),
              radial-gradient(ellipse at 0% 45%, var(--side-glow), transparent 48%),
              linear-gradient(145deg, var(--canvas), var(--canvas-fade));
}
button, input, textarea, select { font: inherit; }
a { color: var(--readout); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shell { max-width: 72rem; padding-inline: clamp(.875rem, 3vw, 2rem); margin-inline: auto; }
.site-header { background: var(--brand); color: var(--header-text); }
.masthead { display: flex; align-items: center; gap: clamp(.4rem, 2vw, .9rem); min-height: 64px; padding-block: .35rem; }
.brand { display: flex; align-items: center; min-height: 44px; flex: 0 0 auto; border-radius: 11px; background: transparent; }
.brand img { display: block; width: 44px; height: 44px; }
.brand-name { white-space: nowrap; }
.brand-name b { font: 1.14em/1 "Big Hand", cursive; }
.current-page { min-width: 0; color: var(--header-text); font-size: .9rem; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.current-page { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.list-name { display: inline-flex; min-height: 44px; padding: 0; background: transparent; color: var(--readout); font-size: 1rem; text-align: start; }
.list-name:hover { background: transparent; text-decoration: underline; }
.account { position: relative; margin-inline-start: auto; display: flex; gap: .45rem; align-items: center; flex: 0 0 auto; }
#navigation { position: absolute; z-index: 6; right: 0; top: calc(100% + .55rem); width: min(13rem, 85vw); padding: .4rem; display: grid; gap: .1rem; border-radius: 12px; box-shadow: 0 6px 20px #07131f50; background: var(--surface); }
#navigation a { display: flex; align-items: center; gap: .55rem; min-height: 44px; text-align: start; padding: .58rem .7rem; border-radius: 8px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .85rem; font-weight: 620; overflow-wrap: anywhere; }
#navigation svg { flex: 0 0 1.1rem; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#navigation :is(a, button):hover, #navigation a[aria-current="page"] { color: var(--readout); background: var(--soft); }
#navigation :focus-visible { outline-color: var(--focus); }
.button.button-header { min-height: 44px; background: var(--header-control); color: var(--header-text); }
.person-marker { display: inline-grid; place-items: center; border-radius: 50%; background: var(--muted); color: #fff; border: 0; font: 1rem/1 "Big Hand", system-ui, sans-serif; }
.person-marker.david { background: #bce9e3; border-color: #1d5d50; color: #174842; }
.person-marker.laura { background: #efcadf; border-color: #7e4261; color: #612c49; }
.profile { position: relative; width: 44px; height: 44px; padding: 0; border: 4px solid #546c7e; cursor: pointer; }
.profile::after { content: ""; position: absolute; pointer-events: none; }
.profile[data-connected="true"]::after { width: 5px; height: 5px; top: 1px; right: 2px; border-radius: 50%; background: #effff6; box-shadow: 0 0 4px #e0fff1; animation: profile-glint 3.6s ease-in-out infinite; }
.profile[data-connected="false"]::after { width: 47px; height: 3px; border-radius: 2px; background: #546c7e; transform: rotate(-45deg); }
.profile > span { position: relative; z-index: 1; }
.profile[data-connected="false"] > span { color: #a3242e; }
@keyframes profile-glint { 0%, 70%, 100% { opacity: .4; } 82% { opacity: 1; transform: scale(1.18); } }
.contributor { min-width: 1.25em; height: 1.25em; margin-inline-start: .4rem; vertical-align: .12em; padding-inline: .14em; border: 1px solid var(--muted); font-size: .72rem; }
.account-details { margin-bottom: .7rem; }
.connection-status { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .2rem .75rem; }
.list-collection .row { padding-block: .2rem; }
main { min-height: 59vh; padding-block: 1.35rem .9rem; }
.footer { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding-block: 1.35rem; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); line-height: 1.12; font-weight: 760; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 1.08rem; line-height: 1.2; letter-spacing: -.022em; }
h3 { font-size: .95rem; }
p { line-height: 1.5; }
.page-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin: .6rem 0 1.4rem; }
.subtitle { margin-top: .48rem; color: var(--muted); font-size: .89rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: .7rem; margin-bottom: .75rem; }
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; gap: .6875rem; }
.split.receipt-view { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.stack { display: grid; gap: .6875rem; min-width: 0; }
.card { border-radius: var(--radius); background: linear-gradient(148deg, var(--surface), var(--card-bottom)); box-shadow: 0 3px 12px var(--surface-shadow); padding: 1rem; min-width: 0; }
.sign-in { max-width: 27rem; margin-top: clamp(1.4rem, 8vh, 5rem); padding: 1.4rem; }
.sign-in h1 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin-bottom: 1.2rem; }
.actions { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; }
.entry-composer { display: grid; gap: .4rem; }
.composer { display: grid; gap: .55rem; min-width: 0; }
.composer-controls { display: flex; align-items: center; gap: .4rem; }
.composer .composer-button { flex: 0 0 auto; min-height: 44px; width: 44px; border-radius: 50%; padding: 0; }
.composer-button svg, .checkout-choice svg { width: 21px; height: 21px; flex-shrink: 0; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.composer .composer-button svg { width: 17px; height: 17px; }
.composer #composer-submit { padding: 0; width: 44px; height: 44px; background: #d5f1dc; color: #105f37; border: 1px solid #327b50; }
.composer #composer-submit:enabled:hover { background: #bce7c8; }
:root[data-theme="blue-hour"] .composer #composer-submit { background: #204634; color: #a8ebbf; border-color: #76c799; }
:root[data-theme="blue-hour"] .composer #composer-submit:enabled:hover { background: #285840; }
#composer-submit .go-wordmark { display: inline-flex; gap: .018em; font: 1.3rem/1 "Big Hand", cursive; }
.go-wordmark > :first-child { transform: rotate(-11deg); }
.go-wordmark > :last-child { transform: rotate(12deg); }
.composer #composer-submit .thinking-pie { width: 25px; height: 25px; stroke: none; fill: initial; }
.composer #manual-open, .composer #voice-cancel { margin-inline-end: auto; width: auto; min-width: min(33%, 12rem); max-width: calc(100% - 98px); padding: .42rem .7rem; gap: .38rem; border-radius: 999px; }
.composer #manual-open { background: #ffebd9; color: #884619; }
.composer #manual-open:hover { background: #ffdfc4; }
.composer-controls #voice-toggle, .composer-controls #voice-stop { margin-inline-start: auto; }
.composer #voice-toggle, .composer #voice-stop { background: #d4eedf; color: #105338; border: 1px solid #77a68a; }
.composer #voice-toggle svg, .composer #voice-stop svg { width: 25px; height: 25px; }
:root[data-theme="blue-hour"] .composer #voice-toggle, :root[data-theme="blue-hour"] .composer #voice-stop { background: #25435b; color: #ceecff; border-color: #6e94ae; }
.receipt-icon { position: relative; width: 44px; min-height: 44px; padding: 0; border-radius: .55rem; }
.receipt-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.receipt-icon:is(:hover, :focus-visible)::after {
  content: attr(data-label); position: absolute; z-index: 4; inset-block-start: calc(100% + .25rem); inset-inline-start: 0;
  width: max-content; max-width: 12rem; padding: .24rem .5rem; border-radius: .35rem;
  background: var(--brand); color: var(--header-text); font-size: .82rem; font-weight: 600; pointer-events: none;
}
.category-order { margin: 0; padding-inline-start: 1.75rem; }
.category-order li { padding-block: .15rem; }
.category-order .actions { display: inline-flex; margin-inline-start: .5rem; }
:root[data-theme="blue-hour"] .composer #manual-open { background: #3d2d24; color: #ffd5ab; }
.checkout-choices { display: grid; gap: .5rem; }
.checkout-choices .checkout-choice { justify-content: flex-start; gap: .7rem; }
.checkout-choices + input + input + .dialog-error:empty { display: none; }
#ai-draft { display: block; width: 100%; min-width: 0; min-height: 44px; max-height: 8.4em; padding: .58rem; resize: none; overflow-y: auto; color: #182b22; background: #fffdf4; caret-color: #17452d; border: 1px solid #84978a; }
#ai-draft::placeholder { color: #526259; }
#ai-draft:focus-visible { outline-color: var(--focus); outline-offset: 1px; }
#voice-wave { display: block; width: 100%; min-width: 0; height: 44px; color: #176345; background: #fffdf4; border: 1px solid #84978a; border-radius: 11px; }
.voice-feedback { font-size: .85rem; color: var(--readout); font-variant-numeric: tabular-nums; }
.manual-fieldset, .receipt-fields { padding: 0; border: 0; min-width: 0; margin: 0; display: grid; gap: .7rem; }
.manual-rows { display: grid; gap: .8rem; }
.manual-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(3.4rem, .32fr) auto; align-items: end; gap: .5rem; }
.manual-fieldset > .button { justify-self: end; }
.manual-fieldset .dialog-error:empty { display: none; }
.receipt-preview { display: flex; align-items: center; gap: 1rem; padding-block: .5rem; }
.receipt-preview img { width: auto; max-width: 50%; max-height: 10rem; object-fit: contain; }

.list { padding: 0; list-style: none; margin: 0; }
.list > li + li { border-top: 1px solid var(--divider); }
.row { display: flex; align-items: center; gap: .8rem; min-height: 46px; padding-block: .4rem; }
.row .row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 680; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .88rem; line-height: 1.4; margin-top: .23rem; overflow-wrap: anywhere; }
.row-actions { margin-left: auto; display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.receipt-view .row { flex-wrap: wrap; }
.receipt-view .row .row-main { flex-basis: 13rem; }
.receipt-view .row-actions { max-width: 100%; overflow-wrap: anywhere; }
.memory-row { align-items: flex-start; }
.memory-row-heading { display: flex; gap: .45rem; align-items: baseline; flex-wrap: wrap; }
.memory-text { white-space: pre-wrap; }
.memory-option { display: flex; align-items: center; gap: .55rem; min-height: 38px; }
.memory-option input { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; accent-color: var(--primary); }
#receipt-memory-import-status:empty { display: none; }
.empty { padding: 1rem .1rem; color: var(--muted); }
.compact { min-height: 0; }
.item-tick { width: 1.24rem; height: 1.24rem; cursor: pointer; accent-color: var(--primary); flex: 0 0 auto; }
.item-row { touch-action: pan-y; user-select: none; }
.to-buy-table .item-row, .list-head { display: grid; grid-template-columns: 1.3rem minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: .65rem; }
.to-buy-toolbar { display: flex; align-items: center; gap: .28rem; margin-bottom: .55rem; }
.to-buy-toolbar h2 { margin-inline-end: .25rem; }
.to-buy-toolbar .remove-selected { margin-inline-start: auto; }
.to-buy-toolbar .view-control { min-width: 44px; padding-inline: .38rem; color: var(--readout); }
.view-control[aria-pressed="true"] { background: var(--nav-active); box-shadow: inset 0 0 0 1px var(--readout); }
.view-control svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.shopping-group h3 { padding: .45rem .55rem; color: var(--readout); background: var(--soft); border-radius: .5rem; }
.shopping-group + .shopping-group { margin-top: .4rem; }
.category-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .3rem .65rem; border: 0; padding: 0; margin: 0; }
.category-options legend { padding: 0 0 .25rem; font-weight: 680; }
.list-head { color: var(--muted); font-size: .83rem; font-weight: 650; border-bottom: 1px solid var(--divider); }
.list-head > span:first-child { grid-column: 2; }
.item-note { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 46.25rem) {
  .to-buy-table .item-row { grid-template-columns: 1.3rem minmax(0, 1fr) auto; row-gap: 0; }
  .item-row .row-actions { grid-area: 1 / 3 / span 2; }
  .item-note { grid-area: 2 / 2; padding-bottom: .3rem; }
  .item-note:empty, .list-head { display: none; }
}
:root[data-theme="market-green"] .item-row:has(.item-tick:checked) { background: #e0f1e4; }
.checkout-actions { display: grid; grid-template-columns: 1fr; }
.checkout-actions .button { min-width: 0; text-align: center; overflow-wrap: anywhere; }
.checkout-bar { background: linear-gradient(145deg, var(--capture-top), var(--capture-bottom)); }
.checkout-bar .checkout-actions { padding-block: .7rem; }
.bottom-navigation { background: var(--nav-surface); }
.bottom-navigation-inner { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; padding-block: .42rem; }
.bottom-navigation a { display: grid; place-items: center; min-height: 46px; padding: .3rem .15rem; border-radius: 11px; color: var(--ink); text-decoration: none; font-size: .875rem; font-weight: 680; text-align: center; overflow-wrap: anywhere; }
.bottom-navigation a:hover { background: var(--control-hover); }
.bottom-navigation a[aria-current="page"] { background: var(--nav-active); color: var(--readout); }
.tag { border-radius: 99px; background: var(--soft); color: var(--readout); padding: .2rem .6rem; font-weight: 680; font-size: .83rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .46rem .72rem; border: 0; border-radius: 11px; background: var(--control); text-decoration: none; color: var(--ink); cursor: pointer; font-size: .83rem; font-weight: 670; touch-action: manipulation; }
.button:hover { background: var(--control-hover); }
.button.button-header:hover { background: var(--header-hover); }
.button-primary { min-height: 49px; background: var(--primary); color: var(--primary-text); }
.button-primary:hover { background: var(--primary-hover); }
.button-quiet { background: transparent; color: var(--readout); }
.button-danger { color: var(--warn); }
.button-danger:hover { background: var(--warn-bg); }
.icon-button { width: 44px; padding: 0; }
.entry-actions { font-size: 1.15rem; line-height: 1; }
.button:disabled { background: var(--soft); color: var(--muted); cursor: default; }
.form-grid { display: grid; gap: .55rem; }
.form-grid + .form-grid { margin-top: .9rem; }
.form-grid label, .field label { font-weight: 620; font-size: .83rem; }
.field { display: grid; gap: .32rem; min-width: 0; }
.fields { display: flex; gap: .7rem; align-items: flex-end; flex-wrap: wrap; }
.field-grow { flex: 1 1 12rem; }
input:not([type="checkbox"]), textarea, select { width: 100%; min-width: 0; min-height: 46px; padding: .62rem .7rem; border-radius: 11px; border: 0; background: var(--field); color: var(--ink); }
::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; line-height: 1.4; }
.notice { padding: .72rem .85rem; background: var(--soft); border-radius: 9px; margin-top: .5rem; margin-bottom: .7rem; }
.notice.error, .warn-box { color: var(--warn); background: var(--warn-bg); }
.notice p { display: inline; margin-right: .65rem; }
.notifications { position: fixed; z-index: 5; top: 4.7rem; right: max(.875rem, calc((100% - 68rem) / 2)); width: min(25rem, calc(100% - 1.75rem)); max-height: calc(100dvh - 5.6rem); display: grid; gap: .5rem; overflow: auto; pointer-events: none; }
.notification { position: relative; padding: .82rem 3rem .82rem .92rem; border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: 0 3px 12px #0b152035; touch-action: pan-y; pointer-events: auto; overflow-wrap: anywhere; }
.notification.error { background: var(--warn-bg); color: var(--warn); }
.notification-close { position: absolute; top: .23rem; right: .26rem; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--close); font-size: 1.45rem; line-height: 1; cursor: pointer; }
.notification-close:hover { background: var(--close-hover); }
.notification-close:focus-visible { outline-offset: -3px; }
.notification-actions { display: flex; flex-wrap: wrap; gap: .43rem; margin-top: .55rem; }
#header-activity { display: flex; align-items: center; flex: 0 0 24px; }
.pie-crust { fill: #d37710; }
:root[data-theme="blue-hour"] .pie-crust { fill: #f9a00c; }
.pie-hand { transform-box: view-box; transform-origin: 10.6px 13.4px; animation: pie-sweep 2.4s linear infinite; }
@keyframes pie-sweep { from { transform: rotate(40deg); } to { transform: rotate(400deg); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.shop-summary { display: block; padding-block: .8rem; color: var(--ink); text-decoration: none; }
.shop-summary:is(:hover, :focus-visible) .row-title { text-decoration: underline; }
.shop-detail-title { margin-bottom: .75rem; gap: .5rem 1rem; }
.shop-detail-location { flex: 1 1 13rem; min-width: 0; }
.shop-location-name { font-weight: 680; overflow-wrap: anywhere; }
.shop-total { margin-inline-start: auto; max-width: 100%; text-align: end; }
.shop-total > * { display: block; }
.shop-total > .meta { margin-top: 0; }
.shop-amount { font-weight: 680; font-variant-numeric: tabular-nums; white-space: nowrap; }
.purchase-group + .purchase-group { margin-top: .8rem; }
.purchase-group h3 { padding: .4rem 0 .3rem; border-bottom: 1px solid var(--divider); color: var(--readout); }
.purchase-row { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; padding: .32rem 0; }
.purchase-main { min-width: 0; }
.purchase-row .meta { margin-top: .08rem; font-size: .8rem; }
.purchase-plan { font-weight: 680; }
.purchase-amount { flex: 0 0 auto; margin-inline-start: auto; text-align: end; }
.purchase-review { display: block; margin-top: .2rem; color: var(--warn); font-size: .8rem; }
.purchase-review .button { min-height: 40px; padding: 0; }
.monthly-groups > details { border-top: 1px solid var(--divider); padding: .45rem 0; }
.monthly-groups summary { min-height: 40px; padding: .3rem .15rem; cursor: pointer; }
.monthly-groups summary .monthly-name { font-weight: 670; }
.monthly-groups summary .meta { display: inline-block; margin-inline-start: .65rem; }
.monthly-groups details .list { margin-inline-start: 1rem; }
.import-fields, .payment-fields { min-width: 0; margin: 0; }
.import-fields { padding: 0; border: 0; }
.payment-fields { border: 1px solid var(--divider); border-radius: 12px; padding: .7rem; }
.payment-fields legend { padding-inline: .3rem; }
.payment-fields > .button { justify-self: start; }
.prompt-entry { border-bottom: 1px solid var(--divider); }
.prompt-text { margin: 0; font: .83rem/1.45 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; white-space: pre-wrap; }
.dialog { border: 0; border-radius: var(--radius); background: linear-gradient(148deg, var(--surface), var(--card-bottom)); color: var(--ink); padding: 1.25rem; width: min(34rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); overflow: auto; }
.dialog::backdrop { background: var(--backdrop); }
.dialog h2 { margin-bottom: .82rem; }
.dialog .actions { margin-top: .88rem; }
.dialog-error { margin-top: .7rem; color: var(--warn); }
.dialog-photo { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; object-fit: contain; }
details { padding: .7rem 0; }
summary { margin-bottom: .65rem; color: var(--readout); cursor: pointer; font-weight: 650; }
.record + .record { margin-top: .65rem; }
.message-list { display: grid; gap: .55rem; list-style: none; padding: 0; margin: 0 0 .85rem; }
.message { background: var(--soft); padding: .62rem .72rem; border-radius: 10px; overflow-wrap: anywhere; }
.message.mine { margin-left: 1.2rem; background: var(--control-hover); }
.message p { white-space: pre-wrap; }
.back { margin-bottom: .65rem; }
.photo-controls { margin-bottom: .6rem; }
.chosen-photos:empty { display: none; }

@media (max-width: 740px) {
  .masthead { min-height: 62px; }
  .split, .split.receipt-view { grid-template-columns: 1fr; }
  main { padding-top: 1rem; }
  h1 { font-size: 1.55rem; }
  .page-title { margin-bottom: .85rem; }
  .row { gap: .55rem; }
  .memory-row { flex-direction: column; }
  .memory-row .row-actions { margin-left: 0; }
}

@media (max-width: 360px) {
  .shell { padding-inline: 14px; }
  .card { padding: 14px; }
  .masthead, .bottom-navigation-inner { padding-inline: 10px; gap: 6px; }
  .brand { padding-inline: min(4px, var(--brand-padding)); }
  .brand img { width: 40px; height: 40px; }
  .manual-fields { column-gap: .25rem; }
  .account { gap: 5px; }
  .current-page, .bottom-navigation a { font-size: .83rem; }
  .ai-actions, .checkout-actions { gap: 8px; }
  .ai-actions .button, .checkout-actions .button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .pie-hand { animation: none; transform: rotate(40deg); }
  .profile[data-connected="true"]::after { animation: none; }
}

.audit-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); gap: 1rem; align-items: start; }
.audit-columns .card { display: grid; gap: .7rem; min-width: 0; overflow-wrap: anywhere; }
.audit-photo { width: 100%; max-height: 15rem; object-fit: contain; }
.audit-facts { display: grid; grid-template-columns: minmax(5rem, 1fr) minmax(0, 2fr); gap: .3rem .65rem; margin: .3rem 0; }
.audit-facts dt { font-weight: 600; }
.audit-facts dd { margin: 0; overflow-wrap: anywhere; }
.audit-turn p { margin: .25rem 0; white-space: pre-wrap; }
#receipt-audit-content details > summary { cursor: pointer; padding-block: .45rem; }
