/* RanchHand design tokens: forest green brand, warm neutrals, dark sidebar. */
:root {
  --bg: #f4f5f2; --surface: #ffffff; --surface-2: #f8f9f7; --ink: #17201b; --ink-2: #3a453e; --muted: #687269; --line: #e2e6e1; --line-2: #d3d9d2;
  --brand: #2e6a45; --brand-hover: #255a3a; --brand-soft: #e6f0e9; --brand-ink: #ffffff;
  --green: #2c7a4b; --gold: #a46a10; --red: #b3392b; --blue: #2d6590;
  --side-bg: #13211a; --side-ink: #dbe6de; --side-muted: #87a090; --side-hover: #1c2f24; --side-on: #2a4a37; --side-line: #22382b;
  --radius: 10px; --shadow: 0 1px 2px rgba(16, 24, 19, .05); --shadow-lg: 0 12px 40px rgba(16, 24, 19, .18);
  --side-w: 248px; --topbar-h: 56px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1411; --surface: #151c18; --surface-2: #19211c; --ink: #e5ebe6; --ink-2: #c3ccc5; --muted: #919e95; --line: #242e28; --line-2: #2f3a33;
    --brand: #5aae7b; --brand-hover: #6cbd8b; --brand-soft: #1b2e23; --brand-ink: #0b130e;
    --green: #6cc08c; --gold: #e0ad4f; --red: #ec7b6b; --blue: #7db3d8;
    --side-bg: #0a110d; --side-hover: #142019; --side-on: #1f3829; --side-line: #18251d;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: 1.6rem; line-height: 1.2; } h2 { font-size: 1.02rem; margin: 26px 0 10px; } h3 { font-size: .95rem; margin-bottom: 8px; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .right { text-align: right; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }

/* ---------- app chrome: sidebar + content */
.shell { margin-left: var(--side-w); min-height: 100vh; }
#app { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; }
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg); color: var(--side-ink); display: flex; flex-direction: column; z-index: 30; border-right: 1px solid var(--side-line); }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--side-line); }
.side-brand img { border-radius: 8px; } .side-brand b { display: block; font-size: 1rem; color: #fff; letter-spacing: -.01em; }
.side-brand span { display: block; font-size: .78rem; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.side-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 12px; }
.side-group { margin-top: 12px; } .side-label { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: var(--side-muted); padding: 6px 10px; }
.side-link { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border-radius: 7px; color: var(--side-ink); font: 500 .9rem/1.2 var(--font); background: none; border: 0; min-height: 0; cursor: pointer; text-align: left; justify-content: flex-start; }
.side-link:hover { background: var(--side-hover); text-decoration: none; color: #fff; }
.side-link.on { background: var(--side-on); color: #fff; box-shadow: inset 3px 0 0 #7fcf9b; }
.side-link .ic { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-foot { border-top: 1px solid var(--side-line); padding: 12px 10px 16px; }
.side-user { padding: 4px 10px 8px; } .side-user b { display: block; font-size: .88rem; color: #fff; font-weight: 600; } .side-user span { font-size: .76rem; color: var(--side-muted); }
.topbar { display: none; }
.scrim { display: none; }
body.noside .side, body.noside .topbar { display: none; } body.noside .shell { margin-left: 0; }

@media (max-width: 899px) {
  .shell { margin-left: 0; }
  #app { padding: 18px 16px 48px; }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; height: var(--topbar-h); padding: 0 12px; background: var(--side-bg); color: #fff; }
  .tb-title { font-weight: 650; letter-spacing: -.01em; }
  .iconbtn { background: none; border: 0; color: #fff; padding: 8px; min-height: 0; border-radius: 8px; display: grid; place-items: center; }
  .side { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); width: min(84vw, 300px); }
  body.navopen .side { transform: none; }
  body.navopen .scrim { display: block; position: fixed; inset: 0; background: rgba(8, 14, 10, .5); z-index: 25; }
}

/* ---------- page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--muted); font-size: .78rem; font-weight: 500; margin-bottom: 4px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-actions:empty { display: none; }

/* ---------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(2, 1fr); } .g2d { grid-template-columns: 1fr; column-gap: 20px; }
.grid > * { min-width: 0; } /* let long single-line rows truncate instead of widening the page */
@media (min-width: 760px) { .g4 { grid-template-columns: repeat(4, 1fr); } .g2d { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .g3 { grid-template-columns: 1fr; } }
.stat { padding: 14px 16px; } .stat .l { color: var(--muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.stat .n { font-size: 1.65rem; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .s { font-size: .8rem; color: var(--muted); margin-top: 2px; } .stat .s:empty { display: none; }

/* list group: one card, rows divided */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list:empty { display: none; }
.list > .card { border: 0; box-shadow: none; border-radius: 0; }
.list > * + * { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); cursor: pointer; color: inherit; text-decoration: none; transition: background .12s; }
.row:hover { background: var(--surface-2); text-decoration: none; }
.row .main { flex: 1; min-width: 0; } .row .t { font-weight: 600; font-size: .93rem; } .row .t .chip { margin-left: 4px; vertical-align: 1px; }
.row .sub { color: var(--muted); font-size: .83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.row .end { text-align: right; font-variant-numeric: tabular-nums; font-size: .9rem; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.empty { text-align: center; color: var(--muted); padding: 30px 14px; font-size: .9rem; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.green { background: #e5f3ea; color: #1f6339; border-color: #cbe6d4; } .chip.gold { background: #fbf0d9; color: #7a4f06; border-color: #f0dcae; }
.chip.red { background: #fbe6e2; color: #8e2a1e; border-color: #f2cbc4; } .chip.blue { background: #e3eef6; color: #23577e; border-color: #c8dcec; }
@media (prefers-color-scheme: dark) {
  .chip.green { background: #173323; color: #9fdab5; border-color: #22442f; } .chip.gold { background: #3a2c10; color: #f1cf8b; border-color: #4d3a14; }
  .chip.red { background: #3d1c17; color: #f4b0a5; border-color: #522520; } .chip.blue { background: #15293a; color: #a8cde8; border-color: #1f3a52; }
}

/* ---------- controls */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .88rem/1 var(--font); border: 1px solid var(--brand); border-radius: 8px; padding: 0 14px;
  min-height: 38px; background: var(--brand); color: var(--brand-ink); cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s; }
button:hover, .btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }
button.ghost, .btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-2); border-color: var(--muted); }
button.danger { background: var(--red); border-color: var(--red); color: #fff; } button.small { min-height: 30px; padding: 0 10px; font-size: .8rem; }
button:disabled { opacity: .5; cursor: default; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.tabs { display: inline-flex; gap: 2px; margin: 0 0 16px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; overflow-x: auto; max-width: 100%; }
.tabs a { padding: 6px 14px; border-radius: 6px; color: var(--muted); white-space: nowrap; font-size: .86rem; font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; } .tabs a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }
input, select, textarea { font: inherit; font-size: .92rem; width: 100%; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); min-height: 38px; }
textarea { min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); border-color: var(--brand); }
.row select { width: auto; min-height: 32px; padding: 4px 8px; }
label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin: 12px 0 5px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
label.row { margin: 0; font-size: inherit; font-weight: inherit; color: inherit; }
.check { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; cursor: pointer; }
.hidden { display: none !important; }
.err { color: var(--red); font-size: .88rem; margin-top: 10px; }

/* ---------- data display */
.meter { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 7px; } .meter i { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.meter.warn i { background: var(--gold); } .meter.bad i { background: var(--red); }
td .meter { margin-top: 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; font-size: .9rem; margin: 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 0 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; } tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
.scroll-x { overflow-x: auto; }
.timeline { border-left: 2px solid var(--line); margin-left: 4px; padding-left: 18px; } .timeline .ev { padding-bottom: 14px; position: relative; } .timeline .ev:last-child { padding-bottom: 0; }
.timeline .ev::before { content: ""; position: absolute; left: -24px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.timeline .sub { color: var(--muted); font-size: .84rem; }
.pedigree { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .ped { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }

/* working cattle */
.dock { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 40vh; overflow-y: auto; }
.wcell { margin: 0; display: flex; flex-direction: column; gap: 3px; font-weight: 600; color: var(--ink); }

/* ---------- overlays */
dialog { width: min(580px, 100%); max-height: 92vh; border: 1px solid var(--line); border-radius: 14px 14px 0 0; padding: 22px 22px 24px; background: var(--surface); color: var(--ink); margin: auto auto 0; box-shadow: var(--shadow-lg); }
dialog.wide { width: min(920px, 100%); }
dialog h2 { margin: 0 0 4px; font-size: 1.15rem; }
@media (min-width: 700px) { dialog { border-radius: 14px; margin: auto; } }
dialog::backdrop { background: rgba(10, 16, 12, .5); backdrop-filter: blur(2px); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; background: #17201b; color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 50; font-size: .88rem; box-shadow: var(--shadow-lg); max-width: 90vw; }
.banner { padding: 9px 16px; font-size: .86rem; text-align: center; background: #fbf0d9; color: #5f3d05; border-bottom: 1px solid #f0dcae; }
.banner.red { background: var(--red); color: #fff; border: 0; } .banner.blue { background: var(--blue); color: #fff; border: 0; }

/* ---------- sign-in / onboarding */
.auth { max-width: 420px; margin: 9vh auto 0; } .auth h1 { font-size: 1.9rem; margin-bottom: 6px; }
.brandmark { font: 700 .76rem/1 var(--font); letter-spacing: .2em; color: var(--brand); text-transform: uppercase; margin-bottom: 10px; }

/* ---------- ranch map (Leaflet) */
.mapwrap { position: relative; isolation: isolate; z-index: 0; } /* keep Leaflet's z-indexes below the sidebar drawer */
.mapbox { height: calc(100vh - 250px); min-height: 420px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); }
.mapbox.drawing { cursor: crosshair; }
.mapbox.drawing .leaflet-interactive { pointer-events: none; } /* while drawing, taps on existing shapes go to the map */
.mapdock { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  padding: 8px 12px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: .86rem; max-width: calc(100% - 24px); }
.maplegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 2px 4px; font-size: .8rem; color: var(--muted); }
.maplegend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); vertical-align: -1px; }
.leaflet-tooltip.maplabel { background: transparent; border: 0; box-shadow: none; color: #fff; font: 600 12px/1.2 var(--font); text-shadow: 0 1px 3px #000, 0 0 2px #000; }
.leaflet-tooltip.maplabel::before { display: none; }
.leaflet-popup-content { font: 13px/1.45 var(--font); margin: 12px 14px; min-width: 180px; } .leaflet-popup-content .bar { margin: 8px 0 0; }
.leaflet-popup-content .btn, .leaflet-popup-content button { min-height: 28px; }
.leaflet-container a.btn { color: var(--brand-ink); } .leaflet-container a.btn.ghost { color: var(--ink); }

/* ---------- lodging calendar */
.cal { padding: 0; } .cal table { font-size: .8rem; border-collapse: separate; border-spacing: 0; }
.cal th, .cal td { padding: 0; height: 40px; min-width: 34px; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal th { font-size: .7rem; padding: 6px 2px; line-height: 1.2; } .cal th.wknd { background: var(--surface-2); } .cal th.today { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.cal .cal-unit { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 6px 12px; min-width: 130px; border-left: 0; }
.cal td.occ { background: #dcefe2; } .cal td.occ.pending { background: #fbf0d9; } .cal td.occ.completed { background: #e3eef6; }
@media (prefers-color-scheme: dark) { .cal td.occ { background: #1d3a29; } .cal td.occ.pending { background: #3a2c10; } .cal td.occ.completed { background: #15293a; } }
.cal td.occ a { display: block; height: 100%; line-height: 40px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: visible; text-align: left; padding-left: 4px; text-decoration: none; }

/* ---------- waiver text, signature certificate, printing */
.waiver { white-space: pre-wrap; font-size: .85rem; line-height: 1.55; max-height: 40vh; overflow-y: auto; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
@media print { /* an open dialog (signature certificate) prints alone; otherwise the page prints without the app's chrome */
  body:has(dialog[open]) > *:not(dialog) { display: none !important; }
  dialog { position: static; width: 100%; max-height: none; box-shadow: none; border: 0; margin: 0; padding: 0; }
  dialog::backdrop { display: none; } .noprint { display: none !important; } .waiver { max-height: none; overflow: visible; border: 0; background: none; padding: 0; }
  .side, .scrim, .topbar, #banners, .ph-actions, #app .bar { display: none !important; }
  body, .shell, #app { margin: 0 !important; padding: 0 !important; background: #fff !important; } .card { box-shadow: none !important; break-inside: avoid; }
}

/* ---------- public pages: guest trip page, booking request (standalone or embedded in a website builder) */
body.pubpage { background: var(--bg); }
.pub { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.pub-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.pub .inline-form { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.pack { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; } .pack li { margin: 3px 0; break-inside: avoid; }
@media (max-width: 520px) { .pack { columns: 1; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* spam honeypot */
body.embed { background: transparent; } body.embed .pub { padding: 4px 2px 8px; max-width: none; }
html.embed, html.embed body { background: transparent; }
@media (prefers-color-scheme: dark) { /* keep embedded forms light on light websites */
  html.embed.light { color-scheme: light; --bg: #f4f5f2; --surface: #ffffff; --surface-2: #f8f9f7; --ink: #17201b; --ink-2: #3a453e; --muted: #687269; --line: #e2e6e1; --line-2: #d3d9d2;
    --brand: #2e6a45; --brand-hover: #255a3a; --brand-ink: #ffffff; --red: #b3392b; --shadow: 0 1px 2px rgba(16, 24, 19, .05); }
}

/* ---------- invoices: the customer's copy (invoice.html) and the staff view */
.inv { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); }
.inv-top { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.inv-top h1 { margin: 0 0 4px; } .inv-addr { white-space: pre-line; color: var(--ink-2); font-size: .9rem; line-height: 1.45; }
.inv-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: .9rem; align-content: start; } .inv-meta dt { color: var(--muted); }
.inv table { width: 100%; } .inv td.num, .inv th.num { text-align: right; white-space: nowrap; }
.inv-tot { margin-left: auto; max-width: 360px; margin-top: 12px; } .inv-tot div { display: flex; justify-content: space-between; gap: 18px; padding: 4px 0; }
.inv-tot .due { border-top: 2px solid var(--ink); margin-top: 4px; padding-top: 8px; font-weight: 700; font-size: 1.1rem; }
.stamp { display: inline-block; border: 2px solid currentColor; border-radius: 6px; padding: 2px 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.lines-ed td { padding: 4px 3px; vertical-align: top; } .lines-ed input { min-height: 34px; padding: 4px 6px; font-size: .88rem; }
@media (max-width: 640px) { .lines-ed thead { display: none; } .lines-ed tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
  .lines-ed td:first-child { grid-column: 1 / -1; } .inv { padding: 18px; } }
@media print { body.pubpage .pub > *:not(.inv) { display: none !important; } .inv { border: 0; padding: 0; box-shadow: none; } }

/* ---------- money: Schedule F worksheet, account map */
.sched th { background: var(--surface-2); color: var(--ink); font-size: .78rem; padding: 8px 10px; }
.sched tr.zero td { color: var(--muted); }
.map-in { min-height: 32px; padding: 4px 8px; font-size: .85rem; }
.chk { font-size: .88rem; font-weight: 500; color: var(--ink); margin: 0 10px 0 0; }

/* ---------- dashboard: at-a-glance cards for Hunting, Lodging, Money */
a.glance { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
a.glance:hover { border-color: var(--brand); }
.glance h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; } .glance h3 .ic { width: 18px; height: 18px; color: var(--brand); }
.glance h3 .go { margin-left: auto; color: var(--muted); font-size: 1.2rem; }
.gl-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: .9rem; color: var(--ink-2); }
.gl-v { font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; } .gl-sub { font-size: .76rem; color: var(--muted); }
@media (min-width: 521px) and (max-width: 1180px) { .glance-grid.g3 { grid-template-columns: repeat(2, 1fr); } }
.glance-foot { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- receipts and budgets */
.rrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 6px; }
.rthumb { width: 84px; height: 84px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); overflow: hidden; cursor: zoom-in; flex: none; display: grid; place-items: center; }
.rthumb img { width: 100%; height: 100%; object-fit: cover; display: block; } .rpdf { font-weight: 700; font-size: .8rem; color: var(--red); }
.rcard { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; } .rcard .ractions { flex-basis: 100%; margin: 0; } .rcard .ractions button { white-space: nowrap; } .rcard .rthumb { width: 96px; height: 120px; } .rmeta { min-width: 0; flex: 1; font-size: .88rem; }
.ph-actions .ic, .btn .ic, button .ic { width: 16px; height: 16px; vertical-align: -3px; }
.chip .ic { width: 12px; height: 12px; vertical-align: -1px; margin-right: 2px; }
table.budget .meter { display: inline-block; width: calc(100% - 44px); vertical-align: middle; margin-right: 6px; } table.budget tr.tot td { border-top: 2px solid var(--line-2); }
table.budget tr.zero td { color: var(--muted); }
.scanbar { margin-bottom: 12px; }
.scanned { margin: 10px 0 0; padding: 10px 12px; border-left: 4px solid var(--green); }
.dashwx:empty { display: none; }
.dashwx { margin-top: 16px; }
.wxdash { display: block; color: inherit; text-decoration: none; }
.wxnow b { font-size: 1.4rem; }
.wxdays { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.wxalert { margin-bottom: 8px; border-left: 4px solid var(--gold); }
.wxalert.sev { border-left-color: var(--red); }
.wxalert summary { cursor: pointer; }
.side-home { margin-top: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--side-line, rgba(255,255,255,.1)); }
.camgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0; }
.camtile { position: relative; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--surface); min-height: 0; display: block; text-align: left; color: inherit; }
.camtile.on { border-color: var(--brand); }
.camtile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line); }
.camcap { display: flex; flex-direction: column; padding: 6px 8px; font-size: .78rem; } .camcap span { color: var(--muted); }
.camthumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; margin-right: 10px; background: var(--line); flex: none; }
.camfull { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 8px; background: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chipsel { position: relative; } .chipsel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chipsel span { display: inline-block; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .82rem; cursor: pointer; }
.chipsel input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); } .chipsel input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.hourchart { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 120px; align-items: end; }
.hcol { display: flex; flex-direction: column-reverse; height: 100%; } .hcol i { display: block; min-height: 0; }
.hourlbl { display: flex; justify-content: space-between; margin-top: 4px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }
table.epd td, table.epd th { white-space: nowrap; } table.epd tr.avg td { border-top: 2px solid var(--line); }
.epdgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.epdgrid > div { display: flex; flex-direction: column; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.plans .plan { cursor: pointer; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--line); }
.plans .plan.on { border-color: var(--brand); } .plans .plan input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-name { font-weight: 700; font-size: 1.05rem; } .plan-price b { font-size: 1.5rem; }
.banner a { color: inherit; font-weight: 600; text-decoration: underline; }
