:root {
  /* Brand: Oak Creek logo navy #102638 and red rock #AE3414 */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --text: #15202b;
  --muted: #5d6976;
  --border: #dde2e8;
  --brand: #102638;
  --brand-2: #1e3d5c;
  --brand-ink: #ffffff;
  --accent: #ae3414;
  --link: #1d5584;
  --budget: #c7d1dc;
  --spent: #102638;
  --ok: #2e7a4d;
  --over: #c62828;
  --warn: #c62828;
  --attn: #966510;
  --focus: #2f7bd0;
  --shadow: 0 1px 2px rgba(16, 38, 56, .06), 0 4px 16px rgba(16, 38, 56, .05);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1620; --surface: #15202b; --surface-2: #1b2834; --text: #e6ebf0; --muted: #96a4b2; --border: #26333f;
    --brand: #3a6791; --brand-2: #4a7aa6; --brand-ink: #ffffff; --accent: #d4582f; --link: #8fbbe6;
    --budget: #2b3a49; --spent: #8fbbe6; --ok: #6cc28f; --over: #ef6b5b; --warn: #ef6b5b; --attn: #dcaa4c;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1620; --surface: #15202b; --surface-2: #1b2834; --text: #e6ebf0; --muted: #96a4b2; --border: #26333f;
  --brand: #3a6791; --brand-2: #4a7aa6; --brand-ink: #ffffff; --accent: #d4582f; --link: #8fbbe6;
  --budget: #2b3a49; --spent: #8fbbe6; --ok: #6cc28f; --over: #ef6b5b; --warn: #ef6b5b; --attn: #dcaa4c;
  --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .25rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; }
p { margin: .25rem 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.warn-text { color: var(--warn); font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 38px; padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-2); }
.btn.danger { color: var(--over); border-color: color-mix(in srgb, var(--over) 40%, var(--border)); }
.btn.lg { min-height: 46px; padding: .6rem 1.6rem; font-size: 1.05rem; }
.btn.small { min-height: 32px; padding: .25rem .7rem; font-size: .9rem; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1rem; cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.file-btn { position: relative; }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; min-height: 40px; }
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--text); opacity: 1; }
label { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; font-weight: 550; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); }
label.check input { width: 18px; height: 18px; min-height: 0; }
.label { font-size: .88rem; font-weight: 550; color: var(--muted); margin-bottom: .3rem; }
.money-in { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding-left: .6rem; }
.money-in span { color: var(--muted); }
.money-in input { border: 0; background: transparent; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.grid2 .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* Top bar & layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem; height: 60px; padding: 0 16px; background: var(--surface); color: var(--text); border-bottom: 3px solid var(--accent); }
.topbar a { color: inherit; }
.brand { display: flex; align-items: center; flex: none; text-decoration: none !important; }
.brand-logo { display: block; height: 42px; width: auto; border-radius: 4px; }
.crumb { color: var(--muted); }
.crumb-project { font-weight: 650; color: var(--brand) !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: 44px; min-width: 220px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .75rem; display: flex; flex-direction: column; gap: .5rem; }
.usermenu .menu a, .usermenu .menu button { color: var(--text); background: none; border: 0; text-align: left; font: inherit; padding: .3rem 0; cursor: pointer; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .7rem; vertical-align: middle; margin-right: .3rem; }
.pill { display: inline-block; align-self: flex-start; padding: .05rem .5rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); font-size: .75rem; }
@media (max-width: 640px) { .uname { display: none; } .brand-logo { height: 32px; } }

.layout { max-width: 1400px; margin: 0 auto; }
.layout.with-nav { display: grid; grid-template-columns: 220px 1fr; }
main { padding: 24px 28px 64px; min-width: 0; }
.sidenav { position: sticky; top: 63px; height: calc(100vh - 63px); overflow-y: auto; padding: 16px 10px; border-right: 1px solid var(--border); }
.sidenav a { display: flex; align-items: center; gap: .6rem; padding: .45rem .7rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.sidenav a:hover { background: var(--surface); }
.sidenav a.active { background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--accent), var(--shadow); font-weight: 650; }
.sidenav a.active svg { color: var(--accent); }
.navgroup { margin: 1rem .7rem .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
@media (max-width: 900px) {
  .layout.with-nav { display: block; }
  .sidenav { position: sticky; top: 63px; z-index: 10; height: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--border); background: var(--bg); }
  .navscroll { display: flex; overflow-x: auto; padding: 8px 12px; gap: 4px; scrollbar-width: none; }
  .navgroup { display: none; }
  .sidenav a { white-space: nowrap; padding: .4rem .7rem; }
  main { padding: 16px 16px 64px; }
}

/* Page */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.quick { display: flex; flex-wrap: wrap; gap: .5rem; }
.project-desc { max-width: 900px; }
.loading { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 4rem 1rem; color: var(--muted); }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 3rem 1rem; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }
.small-empty { padding: 2rem 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.card.help { margin-top: 1.25rem; }
.card.help ul { margin: .5rem 0; padding-left: 1.2rem; }
.alert { background: color-mix(in srgb, var(--over) 12%, var(--surface)); color: var(--over); padding: .6rem .8rem; border-radius: 8px; }

/* Landing */
.landing { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, color-mix(in srgb, var(--accent) 14%, var(--bg)), var(--bg) 60%); }
.landing-card { max-width: 560px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent); border-radius: 16px; padding: 40px 28px; box-shadow: var(--shadow); }
.landing-logo { margin: 0 0 1.5rem; }
.landing-logo picture { display: block; }
.landing-logo img { display: block; width: 100%; max-width: 440px; height: auto; margin: 0 auto; }
.lead { font-size: 1.05rem; color: var(--muted); margin: .5rem 0 1.5rem; }

/* Projects */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: .2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow); transition: transform .1s, border-color .1s; }
.project-card:hover { transform: translateY(-2px); border-color: var(--brand-2); }
.pc-top { display: flex; justify-content: space-between; margin-bottom: .4rem; }
.project-card .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { margin-top: auto; padding-top: .5rem; }

/* Status pills */
.status { display: inline-block; padding: .05rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.s-paid, .s-done, .s-received, .s-approved, .s-installed, .s-active, .s-complete, .s-delivered { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); border-color: color-mix(in srgb, var(--ok) 35%, var(--surface)); color: var(--ok); }
.s-due, .s-waiting, .s-expected, .s-submitted, .s-awaiting-approval, .s-ordered, .s-on-hold, .s-in-progress, .s-planning { background: color-mix(in srgb, var(--attn) 14%, var(--surface)); border-color: color-mix(in srgb, var(--attn) 35%, var(--surface)); color: var(--attn); }
.s-disputed, .s-rejected { background: color-mix(in srgb, var(--over) 12%, var(--surface)); border-color: color-mix(in srgb, var(--over) 35%, var(--surface)); color: var(--over); }

/* Overview */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 1rem 0 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .15rem 0; }
.tile-sub { font-size: .8rem; color: var(--muted); }
.tile.warn .tile-value { color: var(--warn); }
.tile.attn .tile-value { color: var(--attn); }
.meter { height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; margin: .3rem 0; }
.meter span { display: block; height: 100%; background: var(--spent); }
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ov-grid .span2 { grid-column: span 2; }
@media (max-width: 1100px) { .ov-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .ov-grid { grid-template-columns: 1fr; } .ov-grid .span2 { grid-column: auto; } }
.legend { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-left: .5rem; }
.swatch.budget { background: var(--budget); } .swatch.spent { background: var(--spent); }
.barchart { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 170px) 1fr auto; gap: .75rem; align-items: center; font-size: .85rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: flex; flex-direction: column; gap: 3px; }
.bar { height: 8px; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar.budget { background: var(--budget); }
.bar.spent { background: var(--spent); }
.bar.spent.over { background: var(--over); }
.bar-val { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 1fr auto; } .bars { grid-column: 1 / -1; grid-row: 2; } }
.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; font-size: .9rem; }
.feed { list-style: none; padding: 0; margin: 0; }
.feed li a { display: flex; gap: .6rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .88rem; }
.feed li:last-child a { border-bottom: 0; }
.feed .when { margin-left: auto; white-space: nowrap; padding-left: .5rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; transform: translateY(-1px); }
.dot.t-expense, .dot.t-funding { background: var(--accent); }
.dot.t-file { background: var(--link); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }

/* Tables */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.toolbar input[type=search] { flex: 1 1 220px; max-width: 360px; }
.toolbar select { width: auto; flex: 0 1 200px; }
.summary { font-size: .88rem; color: var(--muted); margin-bottom: .5rem; }
.summary strong { color: var(--text); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); padding: .6rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data td { padding: .6rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data tbody tr[data-act] { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tfoot td { background: var(--surface-2); border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .clip { max-width: 360px; }
table.data .att { color: var(--muted); white-space: nowrap; }
table.data tr.group td { background: var(--surface-2); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.docs .docname { display: flex; gap: .6rem; align-items: center; color: var(--text); }
table.docs .docname img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
table.docs .actions { text-align: right; }
.fileicon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; background: var(--surface-2); color: var(--muted); flex: none; }
.fileicon.big { width: 100%; height: 100%; flex-direction: column; gap: .3rem; padding: .5rem; word-break: break-all; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 99px; padding: .3rem .8rem; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }

/* Photos */
.day { margin: 1.25rem 0 .5rem; font-size: .95rem; color: var(--muted); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.photo { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); cursor: pointer; color: var(--text); font: inherit; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo:hover img { transform: scale(1.03); }
.photo .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.2rem .5rem .4rem; font-size: .75rem; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.7)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) { .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; } }
.lightbox { background: #111; border-radius: 8px; margin-bottom: 1rem; display: flex; justify-content: center; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 62vh; display: block; }

/* Modal */
dialog#modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog#modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20, 25, 20, .45); }
.modal-inner { display: flex; flex-direction: column; max-height: calc(100vh - 26px); }
.modal-inner > header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-inner > footer { display: flex; gap: .5rem; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.meta { margin-top: 1rem; }
.att-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .5rem; }
.att { display: flex; align-items: center; gap: .6rem; padding: .35rem; border: 1px solid var(--border); border-radius: 8px; }
.att img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.att-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.progress { margin-top: 1rem; }

/* Settings */
.settings { display: flex; flex-direction: column; gap: 1rem; max-width: 900px; }
.actions-row { display: flex; justify-content: flex-end; }

/* Toasts */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow); font-size: .92rem; animation: pop .2s ease-out; }
.toast.err { background: var(--over); color: #fff; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Quick capture (phone-first) ---------- */
.fab { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 30;
  display: inline-flex; align-items: center; gap: .45rem; height: 56px; padding: 0 20px 0 16px; border: 0; border-radius: 28px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.fab svg { width: 24px; height: 24px; }
.fab:active { transform: scale(.97); }
main { padding-bottom: 96px; }
.cap-list { display: flex; flex-direction: column; gap: 12px; }
.cap-tile { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.cap-tile strong { display: inline-flex; align-items: center; gap: .45rem; font-size: 1.02rem; }
.cap-tile strong svg { color: var(--accent); }
.cap-btns { display: flex; flex-wrap: wrap; gap: .5rem; }
.up-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; margin-bottom: 1rem; align-items: center; }
.up-previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.att-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.att-actions svg { width: 16px; height: 16px; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  /* 16px stops iOS Safari zooming into fields on focus */
  input, select, textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 44px; }
  .btn.small { min-height: 40px; }
  .icon-btn { width: 40px; height: 40px; }
  h1 { font-size: 1.35rem; }
  .page-head { align-items: stretch; }
  .page-head .quick { width: 100%; }
  .page-head .quick .btn { flex: 1 1 auto; }
  .toolbar input[type=search], .toolbar select { max-width: none; flex: 1 1 100%; }
  /* Pop-ups become bottom sheets */
  dialog#modal, dialog#modal.wide { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; border-bottom: 0; }
  .modal-inner { max-height: 92vh; }
  .modal-inner > footer { border-radius: 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-inner > footer .btn { flex: 1 1 auto; }
  .modal-inner > footer .spacer { display: none; }
  .cap-btns, .cap-btns .btn { width: 100%; }
  .cap-btns .btn { flex: 1 1 0; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { padding: 10px 12px; }
  .tile-value { font-size: 1.2rem; }
  table.data { font-size: .88rem; }
  table.data th, table.data td { padding: .55rem .6rem; }
}

/* ---------- Sign-in (in the landing card) ---------- */
.auth-form { display: flex; flex-direction: column; gap: .9rem; max-width: 360px; margin: 0 auto; text-align: left; }
.auth-form h2 { text-align: center; font-size: 1.15rem; margin: 0; }
.auth-form > p.muted { text-align: center; margin: 0; }
.auth-form .btn.lg { width: 100%; }
.auth-form .alert { margin: 0; }
.alert.ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.auth-links:has(> :only-child) { justify-content: center; }
.linkish { border: 0; background: none; padding: .25rem 0; font: inherit; font-size: .9rem; color: var(--link); cursor: pointer; }
.linkish:hover { text-decoration: underline; }
#auth-box > p.muted { margin-top: 1rem; }

/* Fields filled in by the receipt scanner, until the person edits them */
.scanned { background: color-mix(in srgb, #f5c84b 22%, var(--surface)) !important; border-color: #d8a92a !important; }
.money-in:has(.scanned) { background: color-mix(in srgb, #f5c84b 22%, var(--surface)); border-color: #d8a92a; }
.money-in .scanned { background: transparent !important; }
