/* ============================================================
   FIDUCIARY JOURNAL™ v3.0 — Record & Remedy™
   Design System: Crimson & Gold / Warm Ivory
   ============================================================ */
:root {
  /* Core palette */
  --paper: #F4F1EA;
  --paper-deep: #EAE5DB;
  --card: #FCFBF7;
  --ink: #1E1A18;
  --ink-soft: #4A4A4A;
  --muted: #857E72;
  --line: #E3DED2;
  --line-soft: #EDE9DF;

  /* Brand */
  --crimson: #8B1E2D;
  --crimson-deep: #6E1623;
  --crimson-wash: #F7EEF0;
  --brass: #C9A227;
  --brass-soft: #DCBC4E;
  --brass-wash: #F5ECCF;

  /* Status */
  --danger: #9B3B2E;
  --ok: #3C6B4F;
  --warn: #8A5A1F;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(30,26,24,.06), 0 4px 12px rgba(30,26,24,.08);
  --shadow: 0 1px 2px rgba(30,26,24,.06), 0 8px 24px rgba(30,26,24,.12);
  --shadow-lg: 0 4px 8px rgba(30,26,24,.06), 0 20px 48px rgba(30,26,24,.16);

  /* Shape */
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--paper-deep);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
a { color: var(--crimson); }
.mono { font-family: 'IBM Plex Mono', monospace; }
.serif { font-family: 'Fraunces', Georgia, serif; }

/* ---- App shell ---- */
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--paper);
  position: relative; display: flex; flex-direction: column;
  box-shadow: 0 0 80px rgba(30,26,24,.14);
}
@media(min-width: 520px) { body { padding: 0; } #app { min-height: 100vh; } }

.screen { flex: 1; padding: 0 16px 120px; animation: screenIn .2s ease; }
@keyframes screenIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---- Running head ---- */
.runhead {
  position: sticky; top: 0; z-index: 30;
  background: var(--crimson); color: #F4F0E7;
  padding: 13px 16px 11px;
  border-bottom: 2px solid var(--brass);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.runhead-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.runhead-seal {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid rgba(201,162,39,.7);
  display: grid; place-items: center; flex: none;
  font-family: 'Fraunces', serif; font-weight: 600; font-size: 16px;
  color: var(--brass-soft); letter-spacing: .5px;
  background: rgba(0,0,0,.15);
}
.runhead-brand { min-width: 0; }
.runhead-brand h1 {
  font-family: 'Fraunces', serif; font-weight: 500; font-size: 17px; margin: 0;
  letter-spacing: .15px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.runhead-brand .dateline {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(220,188,78,.85); font-weight: 600; margin-top: 1px;
}
.runhead-actions { display: flex; gap: 4px; flex: none; }
.runhead-actions button {
  color: var(--brass-soft); width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  transition: background .15s;
}
.runhead-actions button:hover { background: rgba(255,255,255,.1); }
.runhead-actions button svg { width: 19px; height: 19px; }

/* ---- Typography ---- */
.eyebrow { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass); font-weight: 700; margin: 20px 0 6px; }
.screen-title { font-family: 'Fraunces', serif; font-weight: 500; font-size: 24px; margin: 2px 0 14px; letter-spacing: .2px; }
.rule { height: 1px; background: var(--line); margin: 14px 0; }
.rule.brass { background: linear-gradient(90deg, var(--brass) 0%, transparent 80%); height: 1.5px; }
.kicker { font-size: 12px; color: var(--muted); text-align: center; padding: 12px; line-height: 1.55; }

/* ---- Stat cards ---- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brass-soft); opacity: .5; }
.stat .v { font-family: 'IBM Plex Mono', monospace; font-size: 21px; font-weight: 600; color: var(--crimson); line-height: 1; }
.stat .v.warn { color: var(--brass); }
.stat .v.alert { color: var(--danger); }
.stat .v.ok { color: var(--ok); }
.stat .l { font-size: 10.5px; color: var(--muted); margin-top: 5px; letter-spacing: .02em; font-weight: 500; }

/* ---- Quick capture tiles ---- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 4px; }
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 13px 12px;
  text-align: left; transition: transform .08s ease, box-shadow .15s ease;
  position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 90px;
}
.tile:active { transform: scale(.975); box-shadow: var(--shadow-sm); }
.tile .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.tile .ic svg { width: 17px; height: 17px; }
.tile .tname { font-weight: 600; font-size: 14px; line-height: 1.15; color: var(--ink); }
.tile .tsub { font-size: 11px; color: var(--muted); margin-top: -2px; }
.tile .arrow { position: absolute; right: 11px; bottom: 11px; color: var(--line); font-size: 15px; }

/* ---- Activity list rows ---- */
.list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.row {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
  transition: transform .08s ease;
}
.row:active { transform: scale(.99); }
.row .chip-ic { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; }
.row .chip-ic svg { width: 14px; height: 14px; }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.row .amt { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 13px; color: var(--crimson); flex: none; }
.row .id { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--brass); }
.pill { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; letter-spacing: .02em; white-space: nowrap; }
.pill.need { background: #F3E6D6; color: #8A5A1F; }
.pill.rev { background: #E2EFE6; color: var(--ok); }
.pill.appr { background: #E2EFE6; color: var(--ok); }
.pill.urgent { background: #F2DAD4; color: var(--danger); }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* ---- Empty states ---- */
.empty { text-align: center; color: var(--muted); padding: 48px 20px; font-size: 14px; }
.empty .serif { font-size: 18px; color: var(--ink-soft); display: block; margin-bottom: 8px; }
.empty .empty-action { margin-top: 16px; }

/* ---- Segmented filter ---- */
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; -webkit-overflow-scrolling: touch; }
.seg::-webkit-scrollbar { display: none; }
.seg button {
  white-space: nowrap; font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); flex: none;
  transition: background .15s, color .15s;
}
.seg button.on { background: var(--crimson); color: #F4F0E7; border-color: var(--crimson); }

/* ---- Bottom nav ---- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 100%; max-width: 480px; z-index: 40;
  background: rgba(244,240,231,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 5px 2px calc(5px + env(safe-area-inset-bottom));
}
.nav button {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 2px; border-radius: 10px; color: var(--muted);
  transition: color .15s;
}
.nav button svg { width: 21px; height: 21px; }
.nav button .nl { font-size: 9.5px; font-weight: 600; letter-spacing: .02em; }
.nav button.on { color: var(--crimson); }
.nav button.on .nl { color: var(--crimson); }

/* ---- Bottom sheet ---- */
.scrim { position: fixed; inset: 0; background: rgba(22,22,20,.5); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; transform: translateX(-50%) translateY(100%);
  bottom: 0; width: 100%; max-width: 480px; z-index: 51;
  background: var(--paper); border-radius: 22px 22px 0 0;
  max-height: 94vh; display: flex; flex-direction: column;
  transition: transform .32s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -8px 40px rgba(22,22,20,.28);
}
.sheet.show { transform: translateX(-50%) translateY(0); }
.grab { width: 40px; height: 4px; border-radius: 3px; background: var(--line); margin: 10px auto 0; }
.sheet-head {
  padding: 14px 16px 12px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 11px;
  position: sticky; top: 0; background: var(--paper); border-radius: 22px 22px 0 0;
}
.sheet-head .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.sheet-head .ic svg { width: 16px; height: 16px; }
.sheet-head h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 19px; margin: 0; flex: 1; }
.sheet-head .x { font-size: 22px; color: var(--muted); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; }
.sheet-body { overflow-y: auto; padding: 14px 16px 28px; flex: 1; -webkit-overflow-scrolling: touch; }

/* ---- Forms ---- */
.field { margin-bottom: 13px; }
.field.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; letter-spacing: .01em; text-transform: uppercase; }
label .req { color: var(--brass); margin-left: 2px; }
.inp, select.inp, textarea.inp {
  width: 100%; padding: 11px 12px; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15.5px; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
select.inp {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7461' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
textarea.inp { resize: vertical; min-height: 68px; line-height: 1.45; }
.inp:focus, select.inp:focus, textarea.inp:focus {
  outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-wash);
}
.computed {
  background: var(--brass-wash); border: 1px dashed var(--brass-soft);
  border-radius: 10px; padding: 10px 12px;
  font-family: 'IBM Plex Mono', monospace; font-weight: 600; color: var(--crimson); font-size: 15px;
}
.hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* yes/no segmented */
.ynseg { display: flex; gap: 6px; }
.ynseg button {
  flex: 1; padding: 10px; border-radius: 9px;
  border: 1.5px solid var(--line); background: var(--card);
  font-size: 13px; font-weight: 600; color: var(--ink-soft); transition: background .15s, color .15s;
}
.ynseg button.on { background: var(--crimson); color: #F4F0E7; border-color: var(--crimson); }

/* receipt capture */
.receipt-box { display: flex; gap: 8px; }
.receipt-box .rbtn {
  flex: 1; padding: 13px 8px; border: 1.5px dashed var(--line); border-radius: 11px; background: var(--card);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.receipt-box .rbtn svg { width: 20px; height: 20px; color: var(--brass); }
.receipt-preview { margin-top: 10px; position: relative; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); }
.receipt-preview img { width: 100%; display: block; max-height: 240px; object-fit: cover; }
.receipt-preview .rm {
  position: absolute; top: 8px; right: 8px; background: rgba(22,22,20,.7);
  color: #fff; border-radius: 50%; width: 28px; height: 28px; font-size: 16px; display: grid; place-items: center;
}
.linkrow { margin-top: 9px; }

/* save bar */
.save-bar {
  position: sticky; bottom: 0;
  background: linear-gradient(180deg, transparent, var(--paper) 22%);
  padding: 14px 0 6px; margin-top: 6px;
}
.btn-primary {
  width: 100%; padding: 15px; background: var(--crimson); color: #F4F0E7;
  border-radius: 12px; font-weight: 700; font-size: 15.5px;
  letter-spacing: .01em; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, background .15s; box-shadow: 0 4px 16px rgba(139,30,45,.25);
}
.btn-primary:active { transform: scale(.99); background: var(--crimson-deep); }
.btn-primary svg { width: 17px; height: 17px; }
.btn-ghost {
  width: 100%; padding: 13px; border: 1.5px solid var(--line);
  border-radius: 11px; font-weight: 600; color: var(--ink-soft); background: var(--card);
  transition: border-color .15s;
}
.btn-ghost:hover { border-color: var(--muted); }
.btn-brass {
  width: 100%; padding: 14px; border-radius: 12px; background: var(--brass);
  color: #211a10; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 14px rgba(201,162,39,.28);
}
.btn-danger { color: var(--danger); border-color: #E4CCC5; background: #FAEEEB; }
.btn-row { display: flex; gap: 8px; }
.btn-row > * { flex: 1; }

/* detail view */
.detail-field { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.detail-field .dl { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.detail-field .dv { font-size: 15px; color: var(--ink); margin-top: 3px; word-wrap: break-word; }
.detail-field .dv.mono { font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; }
.detail-photo { margin: 10px 0; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); }
.detail-photo img { width: 100%; display: block; }

/* review cards */
.rev-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 10px; overflow: hidden; position: relative;
}
.rev-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--crimson), var(--brass)); }
.rev-card .rt { font-family: 'Fraunces', serif; font-size: 17px; font-weight: 500; margin-bottom: 2px; }
.rev-card .rsub { font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 700; margin-bottom: 12px; }
.rev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rev-grid .rg .rv { font-family: 'IBM Plex Mono', monospace; font-size: 19px; font-weight: 600; color: var(--crimson); }
.rev-grid .rg .rl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* export rows */
.exp-row {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px;
  display: flex; align-items: center; gap: 11px; margin-bottom: 7px; text-align: left; width: 100%;
  transition: background .12s;
}
.exp-row:active { background: var(--paper-deep); }
.exp-row .en { flex: 1; }
.exp-row .et { font-weight: 600; font-size: 14px; }
.exp-row .ec { font-size: 11px; color: var(--muted); font-family: 'IBM Plex Mono', monospace; margin-top: 1px; }
.exp-row .cnt { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: var(--brass); font-size: 13px; }
.exp-row .cnt.synced { color: var(--ok); }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 96px;
  transform: translateX(-50%) translateY(20px); z-index: 80;
  background: var(--crimson); color: #F4F0E7; padding: 11px 18px; border-radius: 24px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: all .3s;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--brass); max-width: 88%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 15px; height: 15px; color: var(--brass-soft); flex: none; }

/* menu items */
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 4px;
  border-bottom: 1px solid var(--line-soft); font-size: 15px; font-weight: 500;
  width: 100%; text-align: left; color: var(--ink); transition: color .12s;
}
.menu-item svg { width: 19px; height: 19px; color: var(--brass); flex: none; }
.menu-item .ml { flex: 1; }
.menu-item .mc { font-size: 12px; color: var(--muted); }

/* info box */
.info-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px; margin: 10px 0; font-size: 13px; line-height: 1.5; color: var(--ink-soft);
}
.info-box.gold { background: #fff7dd; border-color: #e4c567; color: #302714; }
.info-box.crimson { background: var(--crimson-wash); border-color: rgba(139,30,45,.2); color: #4A1520; }
.info-box b { display: block; margin-bottom: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); }
.url-status { font-size: 12px; margin-top: 6px; font-weight: 700; }
.url-status.good { color: var(--ok); }
.url-status.bad { color: var(--danger); }

/* ---- Dashboard hero ---- */
.dash-hero {
  background: linear-gradient(140deg, #1a0508 0%, #6E1623 50%, #8B1E2D 100%);
  color: #F4F0E7; border-radius: var(--radius-xl); padding: 22px 20px 20px;
  margin-top: 14px; box-shadow: 0 12px 36px rgba(110,22,35,.3);
  position: relative; overflow: hidden;
}
.dash-hero::before {
  content: ""; position: absolute; right: -20px; top: -20px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,162,39,.18) 0%, transparent 70%);
}
.dash-hero .hero-greeting { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(220,188,78,.8); font-weight: 700; margin-bottom: 6px; }
.dash-hero h2 { font-family: 'Fraunces', serif; font-size: 26px; margin: 0 0 6px; font-weight: 500; }
.dash-hero p { margin: 0; font-size: 13px; opacity: .8; line-height: 1.5; }
.sync-chip {
  display: inline-flex; gap: 7px; align-items: center; border-radius: 20px;
  padding: 7px 12px; font-size: 12px; font-weight: 700; margin-top: 14px; letter-spacing: .01em;
}
.sync-chip.ok { background: rgba(60,107,79,.3); color: #a0d4b4; border: 1px solid rgba(60,107,79,.3); }
.sync-chip.no { background: rgba(201,162,39,.2); color: #e4c870; border: 1px solid rgba(201,162,39,.2); }
.sync-chip .dot-pulse { width: 7px; height: 7px; border-radius: 50%; }
.sync-chip.ok .dot-pulse { background: #6ecf9b; box-shadow: 0 0 0 0 rgba(110,207,155,.4); animation: pulse 2s infinite; }
.sync-chip.no .dot-pulse { background: #e4c870; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(110,207,155,.4); } 50% { box-shadow: 0 0 0 5px rgba(110,207,155,0); } }

/* ---- Progress bar (onboarding) ---- */
.progress-wrap { margin: 16px 0 4px; }
.progress-track { height: 7px; background: var(--line); border-radius: 50px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--crimson), var(--brass)); border-radius: 50px; transition: width .35s ease; }
.progress-text { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-top: 6px; }

/* ---- Setup / onboarding ---- */
.setup-wrap { padding: 16px 0 20px; }
.setup-hero { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 20px 18px; margin-bottom: 16px; }
.setup-hero .sh-seal {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(145deg, var(--crimson), #1a0508);
  border: 1.5px solid rgba(201,162,39,.4);
  display: grid; place-items: center; margin-bottom: 14px;
  color: var(--brass-soft); font-family: 'Fraunces', serif; font-weight: 600; font-size: 20px;
}
.setup-hero h2 { font-family: 'Fraunces', serif; font-size: 26px; line-height: 1.05; margin: 0 0 8px; font-weight: 500; }
.setup-hero p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.setup-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.setup-step-num {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.setup-step-num .num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--crimson);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.setup-step-num .num.done { background: var(--ok); }
.setup-step-num .label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.setup-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.setup-card p { margin: 0 0 12px; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }
.mini-shot { background: #1e1a18; border-radius: 14px; padding: 14px; margin: 12px 0; color: #fff; }
.mini-toolbar { display: flex; gap: 7px; margin-bottom: 11px; }
.mini-pill { background: #f7f3ea; color: #36291f; border-radius: 7px; padding: 6px 10px; font-weight: 700; font-size: 12px; }
.mini-pill.hot { outline: 2.5px solid var(--brass); background: #fff; }
.mini-body { background: #fff; color: #2c2723; border-radius: 10px; padding: 12px; font-size: 13px; }
.mini-click { display: inline-block; background: var(--crimson); color: #fff; border-radius: 9px; padding: 8px 12px; font-weight: 700; margin: 3px; font-size: 12.5px; }
.urlbox {
  width: 100%; min-height: 88px; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 12px; font-size: 14px; background: var(--card); line-height: 1.4;
  resize: none; font-family: 'IBM Plex Mono', monospace; color: var(--ink);
}
.urlbox:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-wash); }
.setup-dots { display: flex; gap: 7px; margin: 14px 0 4px; }
.setup-dots span { height: 8px; flex: 1; border-radius: 999px; background: var(--line); transition: background .3s; }
.setup-dots span.on { background: linear-gradient(90deg, var(--crimson), var(--brass)); }
.setup-meta { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 16px; }
.help-fab {
  position: fixed; right: 16px; bottom: 86px; z-index: 35;
  background: var(--card); border: 1px solid var(--line); color: var(--crimson);
  border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 13px;
  box-shadow: var(--shadow);
}
.welcome-complete { text-align: center; padding: 16px 0 8px; }
.welcome-complete .check-circle {
  width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--ok), #5a9e72);
  display: grid; place-items: center; margin: 0 auto 18px; box-shadow: 0 8px 24px rgba(60,107,79,.3);
}
.welcome-complete .check-circle svg { width: 36px; height: 36px; color: #fff; }
.welcome-complete h3 { font-family: 'Fraunces', serif; font-size: 26px; margin: 0 0 8px; font-weight: 500; }
.welcome-complete p { color: var(--ink-soft); font-size: 14px; line-height: 1.55; margin: 0 0 20px; }
.setup-complete-banner {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: center; margin-top: 12px;
}
.setup-complete-banner .sc-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--ok); display: grid; place-items: center; color: #fff; flex: none; }
.setup-complete-banner .sc-ic svg { width: 17px; height: 17px; }
.setup-complete-banner .sc-body { flex: 1; font-size: 13.5px; }
.setup-complete-banner .sc-body b { display: block; font-size: 14px; margin-bottom: 2px; }

/* ---- Settings screen ---- */
.settings-section { margin-bottom: 20px; }
.settings-section .ss-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--brass); font-weight: 700; padding: 0 2px; margin-bottom: 8px; }
.settings-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.settings-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft); text-align: left; width: 100%; color: var(--ink);
  transition: background .12s;
}
.settings-row:last-child { border-bottom: none; }
.settings-row:active { background: var(--paper-deep); }
.settings-row .sr-ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.settings-row .sr-ic svg { width: 16px; height: 16px; }
.settings-row .sr-body { flex: 1; min-width: 0; }
.settings-row .sr-title { font-size: 15px; font-weight: 500; }
.settings-row .sr-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.settings-row .sr-caret { color: var(--line); font-size: 18px; flex: none; }
.settings-row.danger .sr-title { color: var(--danger); }
.settings-row.danger .sr-ic { background: #F2DAD4; }
.settings-row.danger .sr-ic svg { color: var(--danger); }

/* ---- FAQ ---- */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; }
.faq summary { font-weight: 700; color: var(--ink); cursor: pointer; font-size: 14px; line-height: 1.4; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.faq summary::after { content: "+"; color: var(--brass); font-size: 18px; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--ink-soft); font-size: 13px; margin: 10px 0 0; line-height: 1.55; }

/* ---- Version badge ---- */
.version-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 4px 10px 4px 8px; font-size: 11px; font-weight: 700; color: var(--muted);
}
.version-badge .vb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ---- Pending setup banner ---- */
.pending-setup {
  background: var(--brass-wash); border: 1px solid rgba(201,162,39,.35); border-radius: 14px;
  padding: 14px 16px; margin-top: 14px; display: flex; gap: 12px; align-items: flex-start;
}
.pending-setup .ps-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--brass); display: grid; place-items: center; color: #211a10; flex: none; }
.pending-setup .ps-ic svg { width: 15px; height: 15px; }
.pending-setup .ps-body { flex: 1; font-size: 13px; color: #4a3b15; }
.pending-setup .ps-body b { display: block; margin-bottom: 3px; font-size: 13.5px; }
.pending-setup .ps-cta { margin-top: 10px; }

/* ---- Apps Script launch button (setup step 3) ---- */
.btn-open-appsscript {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 18px 20px; margin: 14px 0 0;
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  color: #fff; border: none; border-radius: 14px; cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800; font-size: 18px; letter-spacing: .01em;
  box-shadow: 0 6px 20px rgba(26,115,232,.35);
  transition: transform .1s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 64px;
}
.btn-open-appsscript:active {
  transform: scale(.975);
  box-shadow: 0 2px 8px rgba(26,115,232,.25);
}
.boas-rocket { font-size: 24px; line-height: 1; flex: none; }
.boas-label  { flex: 1; text-align: left; }
.boas-ext    { width: 18px; height: 18px; flex: none; opacity: .8; }
.boas-note {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  margin: 8px 0 14px; padding: 10px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.boas-note strong { color: var(--ink-soft); }
.boas-fallback {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; overflow: hidden; margin-bottom: 4px;
}
.boas-fallback > summary {
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  cursor: pointer; padding: 11px 14px; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.boas-fallback > summary::-webkit-details-marker { display: none; }
.boas-fallback > summary::after { content: "+"; color: var(--brass); font-size: 16px; flex: none; }
.boas-fallback[open] > summary::after { content: "−"; }
.boas-fallback-body { padding: 0 14px 14px; }
.boas-fallback-body p { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.5; }

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

/* Tablet / large screen */
@media(min-width: 520px) {
  .dash-hero { padding: 26px 24px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Mobile setup tips card (step 2 inline, conditionally shown) ---- */
.mobile-tips-card {
  background: #fff7dd; border: 1.5px solid #e4c567; border-radius: 14px;
  padding: 15px 16px; margin-top: 12px; display: none;
}
.mobile-tips-card.show { display: block; }
.troubleshoot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.troubleshoot-list li { font-size: 13px; color: var(--ink-soft); line-height: 1.45; padding-left: 16px; position: relative; }
.troubleshoot-list li::before { content: "•"; position: absolute; left: 0; color: var(--brass); font-weight: 800; }
.mobile-tips-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.mobile-tips-header .mt-bulb {
  font-size: 22px; line-height: 1; flex: none;
}
.mobile-tips-header .mt-title {
  font-weight: 800; font-size: 14.5px; color: #302714; letter-spacing: .01em;
}
.mobile-tips-steps {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 7px;
}
.mobile-tips-steps li {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13.5px; color: #4a3b15; line-height: 1.4;
}
.mobile-tips-steps li .ms-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brass); color: #211a10;
  font-size: 11px; font-weight: 800; flex: none;
  display: grid; place-items: center; margin-top: 1px;
}
.mobile-tips-steps li .ms-text { flex: 1; }
.mobile-tips-steps strong { color: #302714; }

/* ---- Show Mobile Setup Tips toggle button (always visible on setup) ---- */
.btn-mobile-tips {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px; margin-top: 10px;
  background: var(--brass-wash); border: 1.5px solid #e4c567;
  border-radius: 11px; font-weight: 700; font-size: 13.5px;
  color: #302714; cursor: pointer; transition: background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-mobile-tips:active { background: #eddb8a33; }
.btn-mobile-tips .bmt-icon { font-size: 16px; flex: none; }

/* ---- Step 3 phone reminder strip ---- */
.phone-reminder {
  background: var(--brass-wash); border: 1px solid #e4c567;
  border-radius: 10px; padding: 9px 12px; margin-bottom: 12px;
  font-size: 12.5px; color: #4a3b15; font-weight: 600;
  display: flex; align-items: center; gap: 8px; line-height: 1.4;
}
.phone-reminder .pr-icon { font-size: 15px; flex: none; }

/* ---- Celebration banner on success screen ---- */
.celebration-note {
  background: #f0faf3; border: 1px solid #b6dfc2;
  border-radius: 12px; padding: 11px 14px; margin: 14px 0 0;
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; color: #2a5c3a; font-weight: 500; line-height: 1.4;
}
.celebration-note .cn-emoji { font-size: 20px; flex: none; }
.hero-status{
display:grid;
grid-template-columns:repeat(3,1fr);
gap:12px;
margin-top:18px;
}

.status-card{
background:#fff;
border-radius:18px;
padding:14px;
text-align:center;
box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.status-number{
font-size:1.6rem;
font-weight:700;
color:#4b1d1d;
}

.status-label{
font-size:.82rem;
color:#777;
margin-top:4px;
}

/* Dashboard metrics retain their original appearance while
   becoming actionable when attention is required. */
.dashboard-stat-action {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.dashboard-stat-action:focus-visible {
  outline: 2px solid var(--crimson);
  outline-offset: 3px;
}

.dashboard-stat-action:active {
  transform: translateY(1px);
}


.recent-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.pill.sync-pending {
  background: #F3E6D6;
  color: #8A5A1F;
}
