/* Biller — one stylesheet for every page. Teal = brand, orange = the one action per screen. */

:root {
  --brand: #12677E;
  --brand-strong: #0E5467;
  --brand-tint: #E7F1F3;
  --cta: #F04A2A;
  --cta-strong: #D93D1F;
  --bg: #F5F7F8;
  --surface: #FFFFFF;
  --surface-2: #F0F3F5;
  --text: #16232A;
  --muted: #5B6B73;
  --line: #DDE4E8;
  --focus: #1B8FAE;
  --success: #117A45;
  --success-bg: #E3F4EA;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --pending: #8A5A00;
  --pending-bg: #FFF4D6;
  --neutral: #4B5A62;
  --neutral-bg: #ECEFF1;
  --shadow: 0 1px 2px rgba(16, 35, 42, .06), 0 2px 8px rgba(16, 35, 42, .05);
  --on-brand: #FFFFFF;
  --on-cta: #FFFFFF;
  --radius: 14px;
  --radius-sm: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4FB3CC;
    --brand-strong: #7CC8DB;
    --brand-tint: #15323A;
    --cta: #FF6A4D;
    --cta-strong: #FF8469;
    --bg: #0F1619;
    --surface: #172126;
    --surface-2: #1E2A30;
    --text: #E6EEF1;
    --muted: #97A8B0;
    --line: #2A3840;
    --focus: #6FD0E8;
    --success: #5FD394;
    --success-bg: #16301F;
    --danger: #FF8A7F;
    --danger-bg: #3A1B18;
    --pending: #F2C35B;
    --pending-bg: #352A10;
    --neutral: #B5C3CA;
    --neutral-bg: #25323A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --on-brand: #0B1A1F;
    --on-cta: #1F0B06;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` must win over any display rule (.notice, .btn are flex). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }
a:hover { color: var(--brand-strong); }

h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0; }

.icon { width: 20px; height: 20px; flex: none; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }

.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.text-center { text-align: center; }
.m-0 { margin: 0 !important; }
.pt-0 { padding-top: 0 !important; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 880px; margin: 0 auto; padding: 0 16px;
  height: 60px; display: flex; align-items: center; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 750; font-size: 1.125rem; color: var(--text); text-decoration: none;
}
.brand-mark {
  width: 30px; height: 30px; padding: 6px; border-radius: 9px;
  background: var(--brand); color: #fff; fill: #fff; stroke: none;
}
.mainnav { display: flex; gap: 4px; margin-left: 8px; }
.mainnav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.is-active { background: var(--brand-tint); color: var(--brand); }

.account { margin-left: auto; position: relative; }
.account summary { list-style: none; cursor: pointer; border-radius: 50%; }
.account summary::-webkit-details-marker { display: none; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand); font-weight: 700;
}
.account-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: 6px; z-index: 30;
}
.account-who { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-who strong, .account-who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-who span { color: var(--muted); font-size: .875rem; }
.account-menu a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none;
}
.account-menu a:hover { background: var(--surface-2); }

/* Phones: the two destinations move to a thumb-reach tab bar. */
@media (max-width: 639px) {
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  }
  .mainnav a { flex-direction: column; gap: 2px; padding: 6px; font-size: .75rem; justify-content: center; }
  .mainnav a .icon { width: 22px; height: 22px; }
  body.app { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  html:has(body.app) { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ---------- Layout ---------- */

.page { max-width: 880px; margin: 0 auto; padding: 20px 16px 48px; }
.page-narrow { max-width: 560px; margin: 0 auto; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-header p { color: var(--muted); margin-top: 4px; }

.backlink {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  margin: 0 0 12px -4px; padding: 6px 8px 6px 4px; border-radius: 8px;
}
.backlink:hover { color: var(--text); background: var(--surface-2); }

.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head a { font-weight: 600; font-size: .95rem; text-decoration: none; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
@media (min-width: 640px) { .card-pad { padding: 28px; } }

/* ---------- Summary strip ---------- */

.summary {
  margin-bottom: 20px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.summary .card { padding: 16px; }
.summary-label { color: var(--muted); font-size: .875rem; }
.summary-value { font-size: clamp(1.125rem, 5.2vw, 1.5rem); font-weight: 750; margin-top: 2px; letter-spacing: -.01em; white-space: nowrap; }
.summary-sub { color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Lists (bills, payments) ---------- */

.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }

.row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 64px;
  color: inherit; text-decoration: none;
}
a.row:hover { background: var(--surface-2); }
.list > li:first-child .row { border-radius: var(--radius) var(--radius) 0 0; }
.list > li:last-child .row { border-radius: 0 0 var(--radius) var(--radius); }
.list > li:only-child .row { border-radius: var(--radius); }

.row-icon {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--brand-tint); color: var(--brand);
}
.row-main { flex: 1; min-width: 0; }
.row-title, .row-sub { display: block; }
.row-title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-chevron { color: var(--muted); }

.bill-row { display: flex; align-items: center; }
.bill-row .row { flex: 1; min-width: 0; padding-right: 8px; }
.bill-row .btn { margin-right: 16px; }
.bill-row .row-sub { white-space: normal; }
.bill-chevron { display: none; margin-right: 16px; }
/* On phones the whole row already opens the pay screen; give the text the room. */
@media (max-width: 479px) {
  .bill-row .btn { display: none; }
  .bill-chevron { display: block; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 12px;
  border: 1px solid transparent; font: inherit; font-weight: 650; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-cta { background: var(--cta); color: var(--on-cta); }
.btn-cta:hover { background: var(--cta-strong); color: var(--on-cta); }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-strong); color: var(--on-brand); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-tint); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: .9rem; border-radius: 10px; }
.btn-lg { min-height: 54px; font-size: 1.0625rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .7; cursor: progress; }

.btn .spinner { display: none; }
.btn.is-busy .spinner { display: inline-block; }
.btn.is-busy .icon { display: none; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions-stack { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.actions-stack .btn { white-space: normal; text-align: center; }

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 650; margin-bottom: 6px; }
.label .opt { font-weight: 400; color: var(--muted); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label-row a { font-weight: 600; text-decoration: none; }
.hint { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.field-error { color: var(--danger); font-size: .875rem; margin-top: 6px; }

.input {
  display: block; width: 100%; min-height: 50px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .75; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
textarea.input { min-height: 88px; resize: vertical; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-affix {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; display: grid; place-items: center;
  background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 10px;
}
.input-affix:hover { color: var(--text); }

.amount-wrap { position: relative; }
.amount-wrap .prefix {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 650;
}
.input-amount {
  padding-left: 58px; min-height: 60px; font-size: 1.5rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Segmented control built from radios */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); font-weight: 600; color: var(--muted);
}
.segmented input:checked + label { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }
.segmented input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Choice list (saved phones) */
.choices { display: grid; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface);
}
.choice label::before {
  content: ""; width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 2px solid var(--line); background: var(--surface);
}
.choice input:checked + label { border-color: var(--brand); background: var(--brand-tint); }
.choice input:checked + label::before { border-color: var(--brand); box-shadow: inset 0 0 0 4px var(--surface); background: var(--brand); }
.choice input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice .tag { margin-left: auto; font-size: .8125rem; color: var(--muted); }
.choice-extra { margin-top: 8px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  min-height: 38px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .9375rem; font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.is-on { border-color: var(--brand); background: var(--brand-tint); color: var(--brand); }

/* ---------- Pills & notices ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 650; white-space: nowrap;
}
.pill-success { background: var(--success-bg); color: var(--success); }
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-pending { background: var(--pending-bg); color: var(--pending); }
.pill-neutral { background: var(--neutral-bg); color: var(--neutral); }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-size: .95rem;
}
.notice .icon { margin-top: 1px; }
.notice-success { background: var(--success-bg); color: var(--success); }
.notice-error { background: var(--danger-bg); color: var(--danger); }
.notice-info { background: var(--brand-tint); color: var(--text); }
.notice-info .icon { color: var(--brand); }
.nudge span { flex: 1; }
.nudge-close { background: none; border: 0; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 6px; }
.nudge-close:hover { color: var(--text); }

/* ---------- Empty state ---------- */

.empty { text-align: center; padding: 36px 20px; }
.empty .row-icon { margin: 0 auto 12px; width: 52px; height: 52px; }
.empty h2 { margin-bottom: 4px; }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---------- Pay screen ---------- */

.payee {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.payee-name { font-weight: 700; font-size: 1.125rem; }
.payee-meta { color: var(--muted); font-size: .9rem; }
.payee-meta strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Status screen ---------- */

.status-hero { text-align: center; padding: 32px 20px 24px; }
.status-badge {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center;
}
.status-badge .icon { width: 36px; height: 36px; }
.status-hero[data-tone="success"] .status-badge { background: var(--success-bg); color: var(--success); }
.status-hero[data-tone="danger"] .status-badge { background: var(--danger-bg); color: var(--danger); }
.status-hero[data-tone="neutral"] .status-badge { background: var(--neutral-bg); color: var(--neutral); }
.status-hero[data-tone="pending"] .status-badge { background: var(--pending-bg); color: var(--pending); }
.status-hero .amount { font-size: 2.25rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.status-hero p { color: var(--muted); max-width: 40ch; margin: 0 auto; }

.pulse-ring { position: relative; }
.status-hero[data-tone="pending"] .status-badge::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid var(--pending); opacity: .5; animation: ring 1.6s ease-out infinite;
}
.status-badge { position: relative; }
@keyframes ring { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.25); opacity: 0; } }

.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps li::before {
  counter-increment: s; content: counter(s);
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: .8125rem; font-weight: 700;
  background: var(--brand-tint); color: var(--brand);
}

/* Key/value details */
.details { margin: 0; }
.details > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.details > div:first-child { border-top: 0; }
.details dt { color: var(--muted); white-space: nowrap; }
.details dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: .04em;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px;
  background: none; border: 0; padding: 4px 6px; border-radius: 6px;
  color: var(--brand); cursor: pointer; font: inherit; font-size: .8125rem; font-weight: 600;
  vertical-align: middle;
}
.copy-btn:hover { background: var(--brand-tint); }
.copy-btn .icon { width: 16px; height: 16px; }

/* ---------- Filters & pager ---------- */

.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
.tabs a {
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem;
}
.tabs a.is-active { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tabs .count { opacity: .75; font-weight: 500; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }

/* ---------- Progress ---------- */

.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress > span { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: var(--brand); }
.pot-row .progress { max-width: 260px; }
.pot-row .row-title, .pot-row .row-sub { white-space: normal; }

/* ---------- Goal / investment / loan card ---------- */

.pot-card {
  border-radius: 20px; padding: 22px 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #1B8FAE 0%, #12677E 45%, #0B3E4C 100%);
  box-shadow: 0 10px 30px rgba(11, 62, 76, .25);
}
.pot-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pot-card h1 { font-size: 1.15rem; letter-spacing: .02em; text-transform: uppercase; }
.pot-card p { color: rgba(255, 255, 255, .75); font-size: .875rem; margin-top: 4px; overflow-wrap: anywhere; }
.pot-edit { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .14); }
.pot-edit:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.pot-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.pot-label { font-size: .8125rem; color: rgba(255, 255, 255, .75); }
.pot-big { font-size: clamp(1.15rem, 5.4vw, 1.6rem); font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }
.pot-progress-row { display: flex; justify-content: space-between; margin-top: 16px; font-size: .9rem; color: rgba(255, 255, 255, .85); }
.pot-card .progress { background: rgba(255, 255, 255, .2); }
.pot-card .progress > span { background: #fff; }
.pot-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed rgba(255, 255, 255, .3); }
.pot-tile { background: rgba(0, 0, 0, .18); border-radius: 14px; padding: 12px; font-weight: 700; }
.pot-tile-wide { grid-column: 1 / -1; }
.pot-hint { font-weight: 400; font-size: .8125rem; color: rgba(255, 255, 255, .75); }
.entry-form > summary, .list-settings > summary { list-style: none; cursor: pointer; }
.entry-form > summary::-webkit-details-marker, .list-settings > summary::-webkit-details-marker { display: none; }
.entry-form > summary { width: 100%; }
.entry-form[open] > summary { display: none; }
.segmented-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.segmented-3 label { font-size: .875rem; padding: 8px 4px; text-align: center; gap: 6px; overflow-wrap: anywhere; }
@media (max-width: 359px) { .segmented-3 label .icon { display: none; } }
.entry-row { display: flex; align-items: center; }
.entry-row > .row { flex: 1; min-width: 0; }
.entry-del { margin-right: 8px; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 10px; cursor: pointer; }
.icon-btn:hover { color: var(--danger); background: var(--danger-bg); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.mb-12 { margin-bottom: 12px; }

/* ---------- Due soon ---------- */

.section-tight { margin-bottom: 20px; }
.summary-link { color: inherit; text-decoration: none; display: block; }
.summary-link:hover { border-color: var(--brand); color: inherit; }
.icon-sm { width: 14px; height: 14px; vertical-align: -2px; }
.row-sub.feeds { color: var(--brand); font-weight: 600; }
.feeds-banner { display: flex; gap: 10px; align-items: center; margin: 0; padding: 12px 20px; background: var(--brand-tint); color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.feeds-banner .icon { color: var(--brand); }
.feeds-banner .muted { display: block; font-size: .875rem; }
.feeds-done { border: 0; border-radius: 12px; margin-bottom: 12px; padding: 12px 14px; }
.feeds-done .icon { color: var(--success); }

.due-row .row-sub strong { color: var(--pending); }
.due-row.is-overdue .row-sub strong { color: var(--danger); }

/* ---------- Shopping list ---------- */

.add-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.add-grid .add-name { grid-column: 1 / -1; }
.add-grid .label { font-size: .875rem; }
.items { list-style: none; margin: 0; padding: 0; }
.items > li + li { border-top: 1px solid var(--line); }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; min-height: 60px; }
.item-main { flex: 1; min-width: 0; }
.item-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.item-sub { display: block; color: var(--muted); font-size: .875rem; }
.item-total { font-weight: 700; white-space: nowrap; }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; }
.tick .icon { width: 18px; height: 18px; }
.item.is-bought .tick { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.item.is-bought .item-name { text-decoration: line-through; color: var(--muted); }
.items-empty { padding: 18px; color: var(--muted); text-align: center; }
.list-settings > summary { display: flex; align-items: center; gap: 8px; font-weight: 650; }

/* ---------- Sign-in options ---------- */

.icon-google { width: 20px; height: 20px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--muted); font-size: .875rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.keylist { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.keyrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.keyrow .row-icon { width: 36px; height: 36px; border-radius: 10px; }
.keyrow .row-main { min-width: 0; flex: 1; }
.keyrow .row-title, .keyrow .row-sub { white-space: normal; }
.keyrow form { flex: none; }
.pw-details > summary { list-style: none; display: inline-flex; }
.pw-details > summary::-webkit-details-marker { display: none; }
.pw-details[open] > summary { display: none; }

/* ---------- Auth pages ---------- */

body.auth { min-height: 100vh; min-height: 100dvh; display: flex; }
.auth-page { width: 100%; max-width: 420px; margin: auto; padding: 32px 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 20px; }
.auth-brand .brand-mark { width: 40px; height: 40px; padding: 8px; border-radius: 12px; }
.auth-brand span { font-size: 1.5rem; font-weight: 800; }
.auth-title { text-align: center; margin-bottom: 20px; }
.auth-title p { color: var(--muted); margin-top: 4px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--muted); }
.auth-foot a { font-weight: 650; }

/* ---------- Receipt / print ---------- */

.receipt-head { text-align: center; padding: 24px 20px 8px; }
.receipt-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

@media print {
  .topbar, .mainnav, .backlink, .no-print, .skip { display: none !important; }
  body { background: #fff; color: #000; padding: 0 !important; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #bbb; }
  .pill { border: 1px solid currentColor; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
