:root,
[data-theme="night"] {
  --bg: #0c0d10;
  --surface: #16181e;
  --sunken: #1e2128;
  --elevated: #23262f;
  --fg: #f3eee4;
  --muted: #a8a49a;
  --border: #2c2f38;
  --primary: #c9a45c;
  --primary-fg: #1a1408;
  --gold: #d4b06a;
  --silver: #c8ccd4;
  --ok: #9db8a0;
  --warn: #b8892a;
  --danger: #c97a72;
  --chrome: rgb(12 13 16 / 0.97);
  --wash: rgb(201 164 92 / 0.08);
  --shadow: 0 10px 30px -12px rgb(0 0 0 / 0.55), 0 1px 0 rgb(255 255 255 / 0.04) inset;
}
[data-theme="day"] {
  --bg: #f3eee4;
  --surface: #fffcf7;
  --sunken: #ebe4d6;
  --elevated: #ffffff;
  --fg: #1c1914;
  --muted: #6b6458;
  --border: #d9d0c2;
  --primary: #8d6b2c;
  --primary-fg: #1a1408;
  --gold: #8a6420;
  --silver: #5c616b;
  --ok: #1f6b45;
  --warn: #8a6420;
  --danger: #9b2c2c;
  --chrome: rgb(255 252 247 / 0.97);
  --wash: rgb(141 107 44 / 0.08);
  --shadow: 0 10px 24px -14px rgb(80 60 20 / 0.28), 0 1px 0 rgb(255 255 255 / 0.8) inset;
}
:root {
  --radius: 0.9rem;
  --gold-fill: linear-gradient(135deg, #8d6b2c 0%, #e8d5a3 42%, #f7f3ea 52%, #c5c9d2 78%, #8b909a 100%);
  --metal-line: linear-gradient(90deg, #8a6a32 0%, #e8d5a3 38%, #f4f1ea 50%, #c8ccd4 68%, #6d727c 100%);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 500px at 10% -10%, var(--wash), transparent 50%),
    var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, [role="button"], a.btn { cursor: pointer; }
a { color: var(--gold); }
.metal { height: 2px; background: var(--metal-line); }
/* env(safe-area-inset-top) is not reliably 0 in an ordinary Safari tab on
   iPhone, so applying it unconditionally pushed the bar down everywhere,
   not just where it was actually needed. display-mode: standalone only
   ever matches the installed, home-screen PWA (viewport-fit=cover draws
   the page edge-to-edge under the status bar there) -- a plain browser
   tab, whatever env() reports, never matches this media query at all. */
@media (display-mode: standalone) {
  .metal {
    /* Pinned and out of document flow, instead of a plain block sitting
       in front of the sticky header: a margin-based version only ever
       painted correctly at rest, since it depended on the sticky header's
       own scroll-triggered stick/unstick timing lining up with it -- on
       the little rubber-band bounce at the very top of an overscroll,
       Safari doesn't always keep that in sync, so the line would flicker
       or barely show while scrolling back up. Fixed position removes the
       scroll timing from the equation entirely: it's always painted at
       the same spot regardless of scroll direction or gesture.
       padding-top:env(...) reserves the status-bar strip as empty
       (transparent) space above the line, and background-origin/clip
       keep the gradient itself confined to the 2px content box below
       that -- not painted into the status-bar strip. */
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 2px;
    padding-top: env(safe-area-inset-top);
    background-origin: content-box;
    background-clip: content-box;
    z-index: 41;
  }
}
.top {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start;
  gap: 0.4rem; background: var(--chrome);
  padding: max(0.6rem, env(safe-area-inset-top)) 0.6rem 0.6rem;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
}
.brand { display: flex; gap: 0.45rem; align-items: center; text-decoration: none; color: inherit; min-width: 0; flex: 1 1 auto; }
.brand small { display: block; color: var(--silver); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.brand-logo {
  height: 44px; width: auto; max-width: 148px; flex: 0 0 auto; display: block; object-fit: contain;
  background: #fff; border-radius: 10px; padding: 4px 8px;
  border: 1px solid rgb(201 164 92 / 0.35);
  box-shadow: var(--shadow), 0 0 0 1px rgb(201 164 92 / 0.12);
}
.header-actions { display: flex; align-items: center; gap: 0.3rem; flex: 0 0 auto; margin-left: auto; }
.login-logo {
  height: 72px; width: auto; max-width: 220px; display: block; object-fit: contain;
  margin: 0 auto 1.1rem; background: #fff; border-radius: 14px; padding: 10px 20px;
  border: 1px solid rgb(201 164 92 / 0.35);
  box-shadow: var(--shadow), 0 0 0 1px rgb(201 164 92 / 0.12);
}
.desk-nav { display: none; flex-wrap: wrap; gap: 0.15rem; align-items: center; }
.nav-link {
  display: flex; align-items: center; min-height: 44px; padding: 0 0.7rem;
  color: var(--muted); text-decoration: none; border-radius: 8px; font-size: 14px;
}
.nav-link.on, .nav-link:hover { color: var(--gold); background: var(--sunken); }
.who { color: var(--muted); font-size: 13px; padding: 0 0.5rem; }
.menu-btn, .theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.65rem 0.85rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--sunken); color: var(--gold); font: inherit; font-weight: 700;
  line-height: 1.1; text-align: center;
}
.theme-switch {
  display: inline-flex; border: 1px solid var(--border); border-radius: 999px;
  overflow: hidden; background: var(--sunken);
}
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; min-height: 40px; padding: 0; border: 0; background: transparent;
  color: var(--muted);
}
.theme-switch button svg { width: 20px; height: 20px; display: block; }
.theme-switch button.on {
  background: var(--gold-fill); color: var(--primary-fg); font-weight: 600;
}
.icon-hit {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; min-width: 42px; height: 42px; padding: 0;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--sunken); color: var(--gold); text-decoration: none;
}
.icon-hit svg { width: 22px; height: 22px; display: block; }
.icon-hit.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.drawer-bg {
  position: fixed; inset: 0; background: rgb(0 0 0 / 0);
  z-index: 60; transition: background 0.2s ease;
}
.drawer-bg.in { background: rgb(0 0 0 / 0.45); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); z-index: 70;
  background: var(--surface); border-left: 1px solid var(--border);
  padding: 1.25rem 0.75rem 5rem; overflow: auto;
  box-shadow: -14px 0 40px -18px rgb(0 0 0 / 0.55);
  transform: translateX(100%); transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
}
.drawer.in { transform: translateX(0); }
.drawer[hidden], .drawer-bg[hidden] { display: none !important; }
.drawer-title {
  font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.35rem;
  margin: 0 0.75rem 0.75rem; color: var(--gold);
}
.drawer .nav-link { width: 100%; }
.menu-section {
  margin: 0 0 0.6rem; border: 1px solid var(--border); border-radius: 14px;
  background: var(--sunken); overflow: hidden;
}
.menu-section-title {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 0.9rem; margin: 0; cursor: pointer; list-style: none;
  font-size: 12px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold);
}
.menu-section-title::-webkit-details-marker { display: none; }
.menu-section-title::marker { content: ""; }
.menu-section[open] .menu-section-title { border-bottom: 1px solid var(--border); }
.menu-section[open] .nav-chevron { transform: rotate(180deg); }
.menu-grid { display: grid; gap: 0.5rem; padding: 0.6rem; }
.menu-item {
  position: relative; display: flex; align-items: center; gap: 0.7rem;
  min-height: 56px; padding: 0.55rem 0.85rem; border-radius: 14px;
  background: var(--surface); text-decoration: none; color: var(--fg);
  border: 1px solid transparent;
  background-image: linear-gradient(var(--surface), var(--surface)), var(--gold-fill);
  background-origin: border-box; background-clip: padding-box, border-box;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.menu-item:active { transform: scale(0.98); }
.menu-item.on {
  background-image: linear-gradient(var(--sunken), var(--sunken)), var(--gold-fill);
  box-shadow: 0 10px 26px -12px rgb(201 164 92 / 0.5), var(--shadow);
}
.menu-item.on .menu-label { color: var(--gold); font-weight: 700; }
.menu-ic {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; background: var(--gold-fill); color: var(--primary-fg);
  box-shadow: 0 6px 16px -8px rgb(201 164 92 / 0.55);
}
.menu-ic svg { width: 19px; height: 19px; }
.menu-label { font-size: 15px; font-weight: 600; }
.nav-ic { display: inline-flex; width: 16px; height: 16px; margin-right: 0.35rem; opacity: 0.85; }
.nav-ic svg { width: 100%; height: 100%; }
.nav-link.on .nav-ic, .nav-link:hover .nav-ic { opacity: 1; }
.nav-dd { position: relative; }
.nav-dd summary {
  display: flex; align-items: center; gap: 0.3rem; min-height: 44px; padding: 0 0.8rem;
  border-radius: 10px; color: var(--fg); font-size: 14px; font-weight: 700; cursor: pointer;
  list-style: none;
}
.nav-dd summary::-webkit-details-marker { display: none; }
.nav-dd summary::marker { content: ""; }
.nav-dd[open] summary, .nav-dd summary:hover, .nav-dd.now > summary { color: var(--gold); background: var(--sunken); }
.nav-chevron { font-size: 10px; transition: transform 0.15s ease; opacity: 0.7; }
.nav-dd[open] .nav-chevron { transform: rotate(180deg); }
.nav-dd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 210px; z-index: 45;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.4rem; box-shadow: var(--shadow);
  display: grid; gap: 0.15rem;
}
.nav-dd-panel .nav-link { width: 100%; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem calc(64px + env(safe-area-inset-bottom) + 1.25rem); }
.file-desk { display: block; }
.desk-col, .pane { min-width: 0; }
@media (min-width: 900px) {
  .wrap { max-width: 1600px; width: 100%; padding: 1.15rem 1.5rem 3rem; }
  .file-desk {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.1rem;
    width: 100%;
  }
  .desk-col {
    flex: 1 1 0;
    min-width: 0;
  }
  .file-desk .pane,
  .file-desk .soc,
  .file-desk .card,
  .file-desk details {
    width: 100%;
    max-width: none;
  }
  .file-desk .pane > h2 { margin-top: 1.15rem; }
  .desk-col > .pane:first-child > h2 { margin-top: 0.15rem; }
}
.card, .stat, .soc, .list, form.card, .report {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow);
}
.soc {
  position: relative;
  display: block;
  padding: 0.9rem 4.8rem 0.95rem 1rem;
  margin: 0 0 0.8rem;
  min-height: 0;
  color: inherit;
  text-decoration: none;
}
.soc .icon-bar {
  top: 0.7rem;
  right: 0.65rem;
  transform: none;
}
.soc h1 { margin: 0 0 0.35rem; font-size: 1.45rem; line-height: 1.3; padding-right: 0; }
.soc > .muted, .soc > p { margin: 0.2rem 0 0; }
.soc .row { margin-top: 0.65rem; padding-bottom: 0.1rem; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1.1rem; }
@media (min-width: 720px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
}
.stat { padding: 0.85rem; }
.stat b { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.6rem; color: var(--gold); }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2 { font-family: Palatino, "Palatino Linotype", Georgia, serif; font-weight: 600; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
h1 { font-size: 1.7rem; line-height: 1.25; }
h2 { font-size: 1.28rem; margin: 2.15rem 0 0.7rem; }
.wrap > h2:first-child { margin-top: 0.2rem; }
h2 + .muted { margin: -0.35rem 0 0.85rem; }
.soc + h2, details + h2, .card + h2 { margin-top: 2.15rem; }
label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0.5rem 0 0.2rem; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 0.5rem 0.7rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--sunken); color: var(--fg); font: inherit;
}
textarea { min-height: 88px; }
/* Date and time fields. iPhone Safari sizes these to their own content (a
   calendar-and-clock field with its own internal spacing), so they could spill
   past the edge of their form and come out taller than the other fields. Let them
   shrink to the width of their column, drop the native styling, and keep the same
   44px height as the rest. Narrower filter rows keep their own sizes, because
   their rules come later in this file and win. */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0.5rem 0.7rem;
  line-height: 1.2;
  text-align: left;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: left;
}
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
  padding: 0;
}
/* THE one button formula for the entire site. Every button anywhere —
   primary, "ghost", WhatsApp, Done/Edit/Open, Call, Search, Add — is this
   exact size (36px tall), radius, color and shadow. Nothing below this rule may change
   size or color again; a page that needs buttons side by side changes
   layout (gap, flex-basis), never re-defines the button itself. The Reminders
   page draws its own softer pills (.rem-btn, see below) at this same height. */
.btn, button.btn, a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 0.3rem 0.95rem;
  border: 0;
  border-radius: 14px;
  text-decoration: none;
  text-align: center;
  line-height: 1.1;
  background: var(--gold-fill);
  color: var(--primary-fg);
  font: inherit;
  font-weight: 700;
  box-shadow: 0 8px 24px -10px rgb(201 164 92 / 0.45);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.1s ease;
}
.btn.ghost, .btn.wa, .btn.mini { background: var(--gold-fill); color: var(--primary-fg); border: 0; box-shadow: 0 8px 24px -10px rgb(201 164 92 / 0.45); }
.btn:active { transform: translateY(1px); }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.list a {
  display: block; padding: 0.95rem 1rem; border-bottom: 1px solid var(--border); text-decoration: none; color: inherit;
  min-height: 56px;
}
.list a:last-child { border-bottom: 0; }
/* A plain .btn used inside a .list row (e.g. the Open/Edit actions on a
   Prospects row) is a button, not a row-link -- it must keep the .btn
   rule's own height/padding, not inherit .list a's taller row styling. */
.list a.btn {
  display: inline-flex;
  padding: 0.3rem 0.95rem;
  border-bottom: 0;
  min-height: 36px;
}
.soc small, .muted { color: var(--muted); }
.soc span { display: block; margin: 0.2rem 0; }
.soc svg { width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.soc .icon-btn svg { width: 18px; height: 18px; }
.phone {
  display: block;
  margin: 0.35rem 0 0.15rem;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  text-decoration: none;
}
a.phone { color: var(--gold); }
.joint { color: var(--gold); font-weight: 600; }
.ok { color: var(--ok); } .warn { color: var(--gold); } .danger { color: var(--danger); }
.flash { background: rgb(157 184 160 / 0.12); border: 1px solid rgb(157 184 160 / 0.35); padding: 0.6rem 0.8rem; border-radius: 10px; color: var(--ok); }
.flash a { color: inherit; font-weight: 800; text-decoration: underline; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.tabs a, .tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  text-align: center;
  line-height: 1.1;
  font: inherit;
  font-weight: 700;
  -webkit-appearance: none;
  appearance: none;
}
.tabs .on { background: var(--gold-fill); color: var(--primary-fg); border-color: transparent; box-shadow: 0 8px 24px -10px rgb(201 164 92 / 0.45); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login .card { width: 100%; max-width: 380px; }
.pick { position: relative; }
.pick-list {
  position: absolute; left: 0; right: 0; z-index: 20; margin: 4px 0 0;
  max-height: 40vh; overflow: auto; list-style: none; padding: 0.25rem 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow);
}
.pick-list[hidden] { display: none !important; }
.pick-list li button {
  display: block; width: 100%; text-align: left; min-height: 44px;
  padding: 0.65rem 0.85rem; border: 0; background: transparent; color: var(--fg); font: inherit;
}
.pick-list li button:hover { background: var(--sunken); color: var(--gold); }
.reports { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; margin-bottom: 1.25rem; }
.report { text-decoration: none; color: inherit; }
.report b { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.45rem; color: var(--gold); }
.report span { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
a.stat, a.report { text-decoration: none; color: inherit; }
.type-bars a {
  display: grid; grid-template-columns: 7rem 1fr 2.5rem; gap: 0.5rem; align-items: center;
  color: inherit; text-decoration: none; min-height: 44px;
}
.type-bars .bar { height: 8px; background: var(--sunken); border-radius: 99px; overflow: hidden; }
.type-bars .bar i { display: block; height: 100%; background: var(--gold-fill); }
.stage-list { padding-left: 1.2rem; }
.stage-list li { margin: 0.4rem 0; }
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; border-top: 1px solid var(--border);
  background: var(--chrome); padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(12px);
}
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 64px; padding: 0.65rem 0.85rem;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--sunken); color: var(--gold); text-decoration: none;
  font-weight: 700; line-height: 1.1; text-align: center;
}
.top-nav { display: flex; flex-wrap: nowrap; gap: 0.4rem; align-items: center; }
.home-btn { min-width: 58px; }
.back-btn.on, .home-btn.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.bottom a {
  flex: 1;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.45rem 0.15rem 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
}
.bottom a svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.4;
  display: block;
}
.bottom a.on { color: var(--gold); }
.bottom a.on span { font-weight: 800; }
.bottom .voice-btn {
  flex: 1;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.45rem 0.15rem 0.4rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.1;
  cursor: pointer;
}
.bottom .voice-btn svg { width: 22px; height: 22px; stroke-width: 2.4; display: block; }
.bottom .voice-btn.recording { color: #e5484d; }
/* The Voice button beside Save in a popup form (added by assets/voice.js). */
.btn.voice-inline svg { width: 18px; height: 18px; stroke-width: 2.4; vertical-align: -3px; margin-right: 0.3rem; }
.btn.voice-inline.recording { background: #e5484d; color: #fff; box-shadow: none; }
@media (min-width: 860px) {
  .desk-nav { display: none; }
  .menu-btn, .icon-hit#menuOpen { display: inline-flex; }
  .bottom { display: flex; }
  .bottom a { min-height: 64px; font-size: 13px; }
  .wrap { padding-bottom: calc(64px + env(safe-area-inset-bottom) + 1.25rem); }
  .reports { grid-template-columns: repeat(4, 1fr); }
}
.install-bar {
  position: fixed; left: 0.7rem; right: 0.7rem;
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 55;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
}
.install-bar p { margin: 0; font-size: 14px; }
.install-bar [hidden] { display: none !important; }
.install-steps { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 14px; line-height: 1.4; }
.install-steps li { margin: 0.28rem 0; }
@media (display-mode: standalone) {
  .install-bar { display: none !important; }
}
@media (min-width: 860px) {
  .install-bar { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.list .soc {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0.75rem 5rem 0.75rem 0.2rem;
  margin: 0;
  border-bottom: 1px solid var(--border);
}
.list .soc .icon-bar {
  top: 50%;
  right: 0.2rem;
  transform: translateY(-50%);
}
.icon-bar {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.28rem;
  margin: 0;
  width: auto;
  align-items: center;
  justify-content: flex-end;
  z-index: 2;
}
.icon-bar form {
  margin: 0;
  display: flex;
  width: auto;
}
.tools {
  position: static;
  transform: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
  padding: 0.55rem 0 0.1rem;
  border-top: 1px solid var(--border);
  width: 100%;
  justify-content: flex-start;
}
/* Prospects' Open/Edit/Drop and Edit/Close/Convert rows: equal-width
   buttons regardless of label length, laid out via the container
   (per the .btn rule above, never by resizing .btn itself). */
.tools.even { flex-wrap: wrap; }
.tools.even > .btn, .tools.even > form { flex: 1 1 0; min-width: 140px; }
.tools.even > form > .btn { width: 100%; }
/* Reminders' Find/From/To search bar: stacked fields on a phone (the
   .field divs are plain blocks, so they fall back to the site's normal
   label-over-input stacking with zero extra CSS below 860px), one tidy
   row on a desk screen. .field-spacer is an invisible label the same
   height as a real one, so the button row's top lines up with the
   inputs' baseline instead of sitting a label-height too high. */
.pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem 0.6rem; }
.pay-form label { margin: 0; }
.pay-form .full { grid-column: 1 / -1; }
.pay-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pay-table th, .pay-table td { text-align: left; padding: 0.45rem 0.3rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pay-table th { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.pay-table td.amt { font-weight: 800; color: var(--gold); white-space: nowrap; }
.pay-table .icon-btn { width: 32px; height: 32px; min-width: 32px; }
.list .soc.stack {
  padding-right: 0.2rem;
}
.list .soc.stack .tools { position: static; transform: none; top: auto; right: auto; }
.icon-btn,
.list a.icon-btn,
.icon-bar a.icon-btn,
.icon-bar button.icon-btn {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--sunken);
  color: var(--fg);
  text-decoration: none;
  box-shadow: none;
  font: inherit;
  line-height: 1;
}
.list a.soc-open {
  display: block;
  padding: 0;
  min-height: 0;
  border: 0;
  text-decoration: none;
  color: inherit;
}
.list .c-who, .list .c-city { display: block; color: var(--muted); font-size: 13px; margin-top: 0.15rem; }
.locker {
  display: inline-flex !important;
  align-items: center;
  align-self: flex-start;
  width: auto;
  max-width: max-content;
  gap: 0.35rem;
  margin: 0.3rem 0 0.1rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.locker svg { width: 16px; height: 16px; flex: none; }
.locker.danger { color: var(--danger); }
/* Builder-bids list: a compact table-like row per builder/society, name
   left and status pushed right by the name's own flex-grow -- not the
   tall, one-thing-per-line .soc card used everywhere else, since the
   point here is fitting a dozen rows on one screen. flex-wrap lets a
   narrow phone screen drop the status+remove group to its own line
   under a long name instead of squeezing everything onto one row. */
.bid-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 0.8rem; }
.bid-row {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.bid-list .bid-row:last-child { border-bottom: 0; }
.bid-serial { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.bid-name {
  flex: 1 1 160px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 650;
}
.bid-status-form, .bid-remove-form { margin: 0; flex: 0 0 auto; }
.bid-status {
  width: auto; min-width: 150px; min-height: 36px;
  padding: 0.3rem 0.55rem; font-size: 0.88rem;
}
.bid-meta {
  flex: 1 1 100%; order: 3;
  font-size: 0.8rem; color: var(--muted);
}
.bid-meta summary { cursor: pointer; }
.pane-knowledge h3 { margin: 1.15rem 0 0.55rem; }
.store-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.95rem 1.05rem;
  margin: 0 0 0.75rem;
  min-width: 0;
}
.store-card strong { display: block; font-size: 1.02rem; line-height: 1.3; }
.store-card .store-title span,
.store-card .store-title small { display: block; margin-top: 0.22rem; }
.store-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}
.store-title { min-width: 0; flex: 1; }
.store-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.28rem;
}
.store-actions form { margin: 0 !important; display: flex; }
.store-links {
  margin: 0.65rem 0 0;
  padding: 0.1rem 0 0;
  border-top: 1px solid var(--border);
}
.store-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid var(--border);
}
.store-link:last-child { border-bottom: 0; }
.list .store-link a,
.store-card .store-link a,
.store-link a {
  flex: 1 1 auto;
  min-width: 0;
  display: block !important;
  margin: 0 !important;
  padding: 0.1rem 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  color: inherit;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
}
.store-link a:hover { color: var(--gold); }
.store-link form {
  margin: 0 !important;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.store-link .icon-btn,
.list .store-link .icon-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
}
.store-link-add {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.7rem 0 0;
}
.store-link-add select { flex: 1; min-width: 0; margin: 0; }
.store-link-add .btn { flex: 0 0 auto; align-self: flex-end; }
.store-card details { margin-top: 0.55rem; }
.store-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 860px) {
  .store-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-card { margin: 0; }
}
@media (min-width: 1100px) {
  .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1480px) {
  .store-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.store-form {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.15rem 0 0.9rem;
}
.store-form select { width: 100%; }
.store-form p { margin: 0.15rem 0 0; }
.list .phone.empty { font-weight: 600; color: var(--muted); font-size: 14px; }
@media (min-width: 860px) {
  .card.list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .list .soc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1rem 3.5rem 1rem 1.05rem;
    margin: 0;
  }
  .list .soc-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
  }
  .list .c-who, .list .c-city { margin: 0; }
  .list .soc-open .phone {
    margin: 0.3rem 0 0.1rem;
    font-size: 1.2rem;
    line-height: 1.2;
  }
}
@media (min-width: 1100px) {
  .card.list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1480px) {
  .card.list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.file-thumb {
  display: block;
  max-width: 100%;
  max-height: 160px;
  width: auto;
  height: auto;
  border-radius: 8px;
  margin: 0 0 0.5rem;
  object-fit: cover;
}
.file-row .row { margin-bottom: 0.25rem; }
.icon-btn svg { width: 18px; height: 18px; }
details.add-box {
  padding: 0;
  margin: 0 0 0.9rem;
  overflow: hidden;
}
details.add-box > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  margin: 0;
  padding: 0.75rem 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
  background: var(--gold-fill);
  color: var(--primary-fg);
  border-radius: var(--radius);
}
details.add-box > summary::-webkit-details-marker { display: none; }
details.add-box > summary::marker { content: ""; }
details.add-box[open] > summary {
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--sunken);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
details.add-box > form,
details.add-box > .add-body { padding: 0.15rem 1rem 1rem; }
details.add-box > form .btn { margin-top: 0.35rem; }
@media (min-width: 760px) {
  details.add-box.add-fit { max-width: 420px; }
}
.reminder-target-row {
  padding: 0.6rem 0.6rem 0.2rem;
  margin: 0 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--sunken);
}
.reminder-target-row:first-child { margin-top: 0.2rem; }
.reminder-target-row .btn.ghost { margin: 0.4rem 0 0.6rem; }
.icon-btn.danger { color: var(--danger); }
.icon-btn:disabled { opacity: 0.3; }
button[disabled] { opacity: 0.35; }

.queue-page h1 { font-size: 2.1rem; margin: 0 0 0.25rem; }
.q-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
/* Add bulk contacts: a card per row on phones, a table-like grid on wide screens. */
.bulk-head { display: none; }
.bulk-row {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.7rem 0.85rem 0.85rem; margin: 0 0 0.6rem;
}
.bulk-num { position: absolute; top: 0.55rem; right: 0.85rem; font-size: 12px; color: var(--muted); }
.bulk-cell input { width: 100%; margin: 0; }
.bulk-label { margin: 0.45rem 0 0.15rem; }
.bulk-cell:nth-of-type(1) .bulk-label { margin-top: 0; }
.bulk-inherit .pick-q::placeholder { color: var(--gold); opacity: 1; }
.bulk-cell input.bulk-warn { border-color: #c9862b; box-shadow: 0 0 0 2px rgba(201, 134, 43, 0.25); }
.bulk-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin: 0.8rem 0 1.4rem; }
.bulk-result ul { margin: 0.3rem 0 0.6rem; padding-left: 1.1rem; }
.bulk-warnings li, .bulk-rejected li { margin: 0.2rem 0; }
@media (min-width: 860px) {
  .bulk-head, .bulk-row {
    display: grid; gap: 0.5rem; align-items: center;
    grid-template-columns: 2rem minmax(0, 2.1fr) minmax(0, 1.5fr) minmax(0, 1.1fr) minmax(0, 1.2fr);
  }
  .bulk-head { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0 0.5rem 0.35rem; }
  .bulk-row { margin: 0 0 0.35rem; padding: 0.35rem 0.5rem; border-radius: 10px; }
  .bulk-num { position: static; text-align: right; }
  .bulk-label { display: none; }
}
/* Work log: copy button row and the read-only text box. */
.worklog-bar { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 0.75rem; }
.worklog-text {
  display: block; width: 100%; min-height: 65vh; padding: 0.9rem 1rem;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap; resize: vertical;
}
/* Clients page "Sort by": label and dropdown on one line. */
.sort-row { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 1rem; }
.sort-row label { margin: 0; white-space: nowrap; }
.sort-row select { flex: 1 1 auto; width: auto; min-width: 0; max-width: 22rem; margin: 0; }
.q-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0 0.9rem;
  margin: 0 -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
.q-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--sunken);
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}
.q-chip.on { background: var(--gold-fill); color: var(--primary-fg); border-color: transparent; box-shadow: 0 8px 24px -10px rgb(201 164 92 / 0.45); }
a.q-chip { text-decoration: none; display: inline-flex; align-items: center; }
.q-board { display: flex; flex-direction: column; gap: 0.75rem; }
.qcard[hidden] { display: none !important; }
.qcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 1rem 1.15rem;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  min-height: 0;
}
.qcard.priority {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}
.qcard.priority::before { background: var(--danger); }
.qcard::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: var(--gold-fill);
}
.q-why {
  display: inline-block;
  align-self: flex-start;
  margin: 0 0 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  width: auto;
  max-width: max-content;
}
.q-why.q-late { background: var(--danger); color: #fff; }
.soc.priority {
  border-color: var(--danger);
  box-shadow: 0 0 0 1px var(--danger);
}
.priority-flag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.25rem;
  margin: 0 0 0.4rem;
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.priority-flag svg { width: 10px !important; height: 10px !important; flex: none; }
/* A reminder shown in a date-range search that's already been marked
   Done -- same pill shape as .priority-flag, but it replaces the
   Done/Edit/Open action row entirely rather than sitting above it, since
   there's nothing left to do on a finished reminder. */
.completed-flag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.4rem 0 0;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--ok);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.completed-flag svg { width: 12px !important; height: 12px !important; flex: none; }
.dbg-timing { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; margin: 1.5rem 0 0.5rem; padding: 0.55rem 0.8rem; border: 1px dashed var(--border); border-radius: 10px; font-size: 12px; color: var(--muted); }
.dbg-timing b { color: var(--fg); font-weight: 700; }
.dbg-timing details { flex: 1 1 100%; }
.dbg-timing summary { cursor: pointer; }
.dbg-timing ol { margin: 0.4rem 0 0; padding-left: 1.2rem; }
.dbg-timing li { margin: 0.25rem 0; }
.dbg-timing code { font-size: 11px; white-space: pre-wrap; word-break: break-all; }
.q-name { display: block; font-size: 1.12rem; line-height: 1.3; margin: 0 0 0.15rem; }
.qcard .phone { margin: 0.35rem 0 0.55rem; }
.q-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: auto; padding-top: 0.7rem; }
.q-actions .btn, .q-actions form { flex: 1 1 90px; }
.q-actions .btn { width: 100%; }
.q-done { margin: 0; }
.q-done .btn { width: 100%; }
.q-empty { text-align: center; padding: 1.6rem 1rem; }
.q-empty::before { display: none; }
@media (min-width: 720px) {
  .q-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; align-items: stretch; }
}
@media (min-width: 1100px) {
  .q-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.05rem; }
  .qcard {
    padding: 1.05rem 1.15rem 1rem 1.25rem;
    border-radius: 16px;
    min-height: 268px;
    box-shadow: 0 10px 28px -18px rgb(28 22 12 / 0.45);
  }
  .q-empty { grid-column: 1 / -1; min-height: 120px; }
}
.sheet[hidden], .sheet-bg[hidden] { display: none !important; }
.sheet-bg {
  position: fixed; inset: 0; z-index: 80;
  background: rgb(0 0 0 / 0);
  transition: background 0.2s ease;
}
.sheet-bg.in { background: rgb(0 0 0 / 0.45); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 0.35rem 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px -20px rgb(0 0 0 / 0.55);
  transform: translateY(110%);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
  max-height: 88vh;
  overflow: auto;
}
.sheet.in { transform: translateY(0); }
.sheet-handle {
  width: 42px; height: 5px; border-radius: 99px;
  background: var(--border); margin: 0.45rem auto 0.7rem;
}
.sheet h2 { margin: 0 0 0.75rem; font-size: 1.35rem; }
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-bottom: 0.4rem; }
.q-grid[hidden] { display: none; }
.q-out { min-height: 36px; border-radius: 14px; font-weight: 800; }
.q-out.on, button.q-out.on { box-shadow: 0 0 0 2px var(--gold); }
.q-actions button.q-wa { appearance: none; -webkit-appearance: none; cursor: pointer; }
.wa-open { margin: 0 0 0.85rem; }
.wa-open .btn { min-height: 36px; padding-left: 1rem; padding-right: 1rem; }



/* Reminders page. Its buttons are smaller pills (.rem-btn) so a day's list
   fits a phone screen without big blocks of colour. The site-wide .btn
   formula above is the same height, so every button on the site matches. */
.rem-page [hidden] { display: none !important; }
.rem-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; margin: 0.1rem 0 0.7rem; }
.rem-head h1 { margin: 0; }
.rem-head-acts, .rem-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.rem-toolbar { justify-content: space-between; margin: 0 0 0.6rem; }
.rem-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem;
  min-height: 36px; padding: 0.3rem 0.9rem;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.1;
  text-decoration: none; white-space: nowrap; cursor: pointer; list-style: none;
}
.rem-btn svg { width: 14px; height: 14px; flex: none; }
.rem-btn.primary { background: rgb(201 164 92 / 0.16); color: var(--gold); border-color: rgb(201 164 92 / 0.55); box-shadow: none; }
.rem-btn.quiet { background: none; border-color: transparent; color: var(--muted); padding-left: 0.5rem; padding-right: 0.5rem; }
.rem-btn.small { min-height: 32px; padding: 0.2rem 0.7rem; font-size: 13px; }
.rem-btn:active { transform: translateY(1px); }
.rem-page summary { cursor: pointer; }
.rem-page summary::-webkit-details-marker { display: none; }
.rem-page label { text-transform: none; letter-spacing: normal; font-weight: 600; }
.rem-page .locker { font-size: 12px; padding: 0.12rem 0.5rem; gap: 0.25rem; }
.rem-page .locker svg { width: 12px; height: 12px; }
.rem-client a, .rem-kv a, .rem-meta a, .rem-contact a { text-decoration: none; }
.rem-client a:hover, .rem-kv a:hover, .rem-meta a:hover { text-decoration: underline; }

.rem-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0 0 0.6rem; }
.rem-tile {
  display: block; padding: 0.5rem 0.4rem 0.55rem; text-align: center; text-decoration: none; color: inherit;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  box-shadow: 0 6px 18px -16px rgb(0 0 0 / 0.4);
}
.rem-tile b { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.4rem; font-weight: 600; line-height: 1.1; color: var(--gold); }
.rem-tile span { display: block; margin-top: 0.1rem; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rem-tile.late b { color: var(--danger); }
.rem-tile.on { background: var(--wash); border-color: rgb(201 164 92 / 0.55); }
.rem-late {
  display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
  min-height: 36px; padding: 0.25rem 0.9rem; margin: 0 0 0.6rem;
  border: 1px solid rgb(201 122 114 / 0.45); border-radius: 999px; background: rgb(201 122 114 / 0.12);
  color: var(--danger); font-size: 14px; font-weight: 600; text-decoration: none;
}
.rem-late b { font-weight: 700; margin-right: 0.25rem; }

.rem-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--sunken); }
.rem-seg a { padding: 0.25rem 0.9rem; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.rem-seg a.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 4px rgb(0 0 0 / 0.18); }
.rem-chips { display: flex; gap: 0.35rem; overflow-x: auto; margin: 0 0 0.6rem; padding: 0.1rem 0 0.3rem; scrollbar-width: none; }
.rem-chips a {
  flex: 0 0 auto; padding: 0.25rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--fg);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.rem-chips a.on { background: var(--wash); border-color: rgb(201 164 92 / 0.6); color: var(--gold); }
.rem-chips em { font-style: normal; color: var(--muted); margin-left: 0.2rem; }

.rem-find { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: 0 0 0.5rem; }
.rem-find input[type="search"] { flex: 1 1 180px; min-width: 0; min-height: 40px; padding: 0.3rem 0.95rem; border-radius: 999px; }
.rem-find .rem-dates { flex: 1 0 100%; }
.rem-dates summary { display: inline-block; padding: 0.2rem 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.rem-dates-in { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-top: 0.3rem; }
.rem-dates-in label { display: flex; align-items: center; gap: 0.3rem; margin: 0; font-size: 13px; color: var(--muted); }
.rem-dates-in input { width: auto; min-height: 36px; }
.rem-sortline { margin: 0 0 0.6rem; }
.rem-sortline label { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; font-size: 13px; color: var(--muted); }
.rem-sortline select { width: auto; min-height: 36px; }

.rem-group { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 0.8rem; margin: 0.5rem 0 0.45rem; }
.rem-group h2 { margin: 0; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rem-selall { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 13px; color: var(--muted); }
.rem-selall input, .rem-pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

.rem-cards { display: grid; gap: 0.55rem; }
.rem-card {
  position: relative; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 0.3rem 0.75rem;
  min-width: 0; padding: 0.7rem 0.75rem 0.6rem;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface);
  box-shadow: 0 6px 18px -16px rgb(0 0 0 / 0.4);
}
.rem-card.is-priority { border-color: rgb(201 164 92 / 0.5); background: linear-gradient(var(--wash), var(--wash)), var(--surface); }
.rem-card.is-done { opacity: 0.7; }
.rem-pick { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 2; margin: 0; }
.rem-when { align-self: start; text-align: center; padding: 0.35rem 0.2rem; border-radius: 14px; background: var(--sunken); }
.rem-when b { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.3rem; font-weight: 600; line-height: 1.05; color: var(--gold); }
.rem-when small { display: block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rem-when em { display: block; margin-top: 0.15rem; font-style: normal; font-size: 11px; color: var(--muted); }
.rem-when.late { background: rgb(201 122 114 / 0.14); }
.rem-when.late b { color: var(--danger); }
.rem-body { min-width: 0; padding-right: 1.6rem; }
.rem-client { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.rem-client a, .rem-who a { color: inherit; }
.rem-client .locker { display: inline-flex; width: auto; margin-left: 0.25rem; }
.rem-what { margin: 0.1rem 0; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.rem-who { font-size: 13.5px; }
.rem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.3rem; font-size: 12.5px; color: var(--muted); }
.rem-tag { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.05rem 0.5rem; border: 1px solid var(--border); border-radius: 999px; }
.rem-tag svg { width: 10px; height: 10px; flex: none; }
.rem-tag.mine { color: var(--gold); border-color: rgb(201 164 92 / 0.5); background: var(--wash); }
.rem-tag.flag { color: var(--danger); border-color: rgb(201 122 114 / 0.5); }
.rem-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.4rem; margin-top: 0.3rem; }
.rem-acts details[open], .rem-panel-acts details[open] { flex-basis: 100%; }
.rem-hit { display: none; }

.rem-done, .rem-move { min-width: 0; }
.rem-sub { display: grid; gap: 0.4rem; margin-top: 0.4rem; padding: 0.7rem; border: 1px solid var(--border); border-radius: 14px; background: var(--sunken); }
.rem-sub label { display: block; margin: 0; font-size: 13px; color: var(--fg); }
.rem-sub textarea { min-height: 64px; }
.rem-sub .rem-btn { justify-self: start; }
.rem-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.4rem; margin-top: 0.4rem; padding: 0.6rem; border: 1px solid var(--border); border-radius: 14px; background: var(--sunken); }
.rem-menu form { display: contents; }
.rem-opt {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.1rem; min-height: 44px; padding: 0.4rem 0.7rem;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
}
.rem-opt small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rem-pickline { order: 1; grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.25rem; margin: 0; font-size: 13px; color: var(--muted); }
.rem-pickline input { width: 100%; min-height: 36px; }
.rem-menu .rem-btn { grid-column: 1 / -1; justify-self: start; }
.rem-menu-custom { order: 2; }
.rem-move.up { position: relative; }
.rem-move.up .rem-menu { position: absolute; right: 0; bottom: calc(100% + 0.5rem); z-index: 5; width: min(300px, 82vw); margin: 0; background: var(--elevated); box-shadow: 0 14px 30px -16px rgb(0 0 0 / 0.5); }

.rem-pager { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin: 0.8rem 0 0; font-size: 14px; }

.rem-bulkform { display: none; }
.rem-bulk {
  position: fixed; left: 0.6rem; right: 0.6rem; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 240;
  display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem 0.4rem 0.9rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--elevated);
  box-shadow: 0 12px 28px -16px rgb(0 0 0 / 0.55);
}
.rem-bulk > b { margin-right: auto; font-size: 14px; font-weight: 600; }
.rem-bulk[hidden] { display: none !important; }

.rem-undo {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin: 0 0 0.6rem;
  padding: 0.3rem 0.4rem 0.3rem 0.9rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--sunken); font-size: 14px;
}
.rem-undo form { margin: 0; }

.rem-form label { font-size: 13px; color: var(--muted); }
.rem-pickrow { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.2rem 0 0.5rem; }
.rem-pickchip { position: relative; display: inline-flex; margin: 0; }
.rem-pickchip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.rem-pickchip span {
  display: inline-flex; align-items: center; gap: 0.35rem; min-height: 34px; padding: 0.2rem 0.8rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--sunken);
  color: var(--fg); font-size: 14px; font-weight: 600; cursor: pointer;
}
.rem-pickchip span small { font-size: 12px; font-weight: 500; color: var(--muted); }
.rem-pickchip input:checked + span { background: var(--wash); border-color: rgb(201 164 92 / 0.7); color: var(--gold); }
.rem-pickchip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.rem-more { margin: 0.3rem 0 0.5rem; }
.rem-more summary { font-size: 13px; font-weight: 600; color: var(--muted); }
.rem-check { display: flex; align-items: center; gap: 0.45rem; margin: 0.4rem 0; font-size: 14px; color: var(--fg); }
.rem-check input { width: 18px; height: 18px; margin: 0; }

.rem-panel { display: none; }
.rem-kv { padding: 0.6rem 0; border-top: 1px solid var(--border); }
.rem-kv:first-of-type { padding-top: 0; border-top: 0; }
.rem-lbl { display: block; margin-bottom: 0.2rem; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.rem-phone { margin-top: 0.15rem; font-size: 1.05rem; }
.rem-contact { margin: 0.25rem 0; font-size: 13.5px; }
.rem-contact b { font-weight: 600; color: var(--muted); }
.rem-panel-acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.4rem; margin-top: 0.5rem; }

@media (min-width: 1000px) {
  .rem-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.85fr); gap: 1rem; align-items: start; }
  .rem-cards { gap: 0.4rem; }
  .rem-card { align-items: center; padding: 0.55rem 0.8rem 0.55rem 2.2rem; }
  .rem-card:hover { border-color: rgb(201 164 92 / 0.5); }
  .rem-card.is-sel { border-color: rgb(201 164 92 / 0.75); background: var(--wash); }
  .rem-pick { top: 50%; right: auto; left: 0.75rem; transform: translateY(-50%); }
  .rem-body { padding-right: 0; }
  .rem-acts { display: none; }
  .rem-hit { display: block; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
  .rem-client a, .rem-who a { position: relative; z-index: 2; }
  .rem-panel {
    display: block; position: sticky; top: 1rem; padding: 1rem 1.1rem;
    border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
    box-shadow: 0 10px 28px -22px rgb(0 0 0 / 0.45);
  }
  .rem-panel h2 { margin: 0.2rem 0 0.4rem; font-size: 1.3rem; line-height: 1.25; }
}

.red-stars {
  display: inline !important;
  width: auto !important;
  margin: 0 0 0 0.35rem;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: #b42318;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  line-height: 1;
  vertical-align: 1px;
}
.c-name .red-stars, h1 .red-stars, .soc span.red-stars, .list .red-stars {
  display: inline !important;
  width: auto !important;
}

/* Edit popup: any "edit this row" form with several fields opens centered
   over the page instead of stretching the row inline. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgb(10 8 4 / 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 6vh 1rem 2rem;
}
/* The Call/WhatsApp/Visit/Note popup is always in the DOM (its JS-driven
   open path needs it there) and toggled with the hidden attribute, unlike
   every other .modal-backdrop, which PHP only ever renders when shown. The
   browser's default [hidden]{display:none} loses to this class's own
   display:flex above (author styles always beat that default), so without
   this override the popup would show permanently and never close. */
.modal-backdrop[hidden] {
  display: none;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  max-width: 480px;
  width: 100%;
  position: relative;
  margin: auto 0;
}
.modal-card h2 {
  margin: 0 0 0.6rem;
  padding-right: 2rem;
}
.modal-close {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-size: 1.3rem;
  line-height: 1;
}
.modal-close:hover { background: rgb(128 128 128 / 0.15); }
body.modal-lock { overflow: hidden; }

/* "Family" grouping on the client page's Storage & knowledge pane: a
   colored left stripe plus a small pill label ties a set of sections
   together as one kind of thing (e.g. Physical storage + Digital links +
   Workplace files all answer "where do this client's papers live"),
   visually distinct from a different family (Area knowledge + Process
   know-how, reference material rather than a location). */
.fam {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 0.2rem;
  margin: 0.9rem 0 1.4rem;
}
.fam h3:first-of-type { margin-top: 0; }
.fam-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.fam-storage { border-left-color: var(--gold); }
.fam-storage .fam-tag { background: rgb(212 176 106 / 0.18); color: var(--gold); }
.fam-know { border-left-color: var(--muted); }
.fam-know .fam-tag { background: rgb(168 164 154 / 0.18); color: var(--muted); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0;
}

.file-board { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 0.85rem; }
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem 0.9rem 0.85rem;
  box-shadow: var(--shadow);
  min-width: 0;
}
.file-top { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.file-top small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.file-ext {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.file-name {
  display: block;
  margin: 0.4rem 0 0.2rem;
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.file-meta { margin: 0 0 0.55rem; font-size: 13px; color: var(--muted); }
.file-meta a { color: var(--gold); font-weight: 700; text-decoration: none; }
.file-meta .locker { display: inline-flex !important; width: auto !important; margin: 0 0.35rem; vertical-align: -2px; }
@media (min-width: 760px) {
  .file-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
}
@media (min-width: 1180px) {
  .file-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Client page (society.php): a fixed top -- name card, the four contact
   buttons and an "at a glance" box -- then one section at a time behind a
   row of tabs. Without JS every section shows, one after another. */
.cx-head { margin-bottom: 0.65rem; }
.cx-head > p:last-child { margin-bottom: 0; }
.cx-acts { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 0.65rem; }
.cx-acts .btn { flex: 1 1 auto; }
.cx-glance { display: grid; grid-template-columns: 1fr 1fr; padding: 0; margin: 0 0 0.4rem; }
.cx-glance > a { display: block; min-width: 0; padding: 0.65rem 0.85rem; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border); }
.cx-glance > a:nth-child(odd) { border-right: 1px solid var(--border); }
.cx-glance > a:nth-last-child(-n+2) { border-bottom: 0; }
.cx-glance span { display: block; font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.cx-glance b { display: block; font-size: 14px; line-height: 1.3; margin-top: 0.1rem; }
.cx-glance small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-tabs {
  position: sticky;
  top: var(--cx-top, 64px);
  z-index: 30;
  align-items: center;
  margin-bottom: 0.2rem;
  padding-top: 0.55rem;
  padding-bottom: 0.6rem;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.cx-tabs .q-chip { gap: 0.35rem; }
.cx-tabs .q-chip em { font-style: normal; font-size: 11px; opacity: 0.75; }
.cx-mini { display: none; flex: 0 0 auto; max-width: 44vw; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-stuck .cx-mini { display: block; }
.cx-on .cx-panel:not(.on) { display: none; }
.cx-on .cx-panel-title { display: none; }
.cx-on .cx-panel-title + .muted { margin-top: 0.9rem; }
.cx-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin: 1rem 0 0.45rem; }
.cx-sec h3 { margin: 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.cx-sec a { font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cx-empty { margin: 0.3rem 0 0.6rem; }
.cx-list { padding: 0; margin: 0; }
.cx-row { display: flex; align-items: center; gap: 0.6rem; min-height: 56px; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); color: var(--fg); }
.cx-row:last-child { border-bottom: 0; }
.cx-row[hidden] { display: none; }
a.cx-row { text-decoration: none; }
.cx-row .t { flex: 1 1 auto; min-width: 0; }
.cx-row .t > b { display: block; font-size: 15px; line-height: 1.3; }
.cx-row .t > small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.cx-row .t > small.warn { color: var(--gold); }
.cx-row .t > small.cx-note { color: var(--fg); font-size: 13.5px; margin-top: 0.15rem; }
.cx-row .x { display: flex; align-items: center; gap: 0.35rem; flex: 0 0 auto; }
.cx-row .x form { margin: 0; }
.cx-row .icon-btn.go { background: var(--gold-fill); color: var(--primary-fg); border: 0; }
.cx-edit { display: block; }
.cx-when { flex: 0 0 auto; width: 46px; padding: 0.2rem 0; border-radius: 10px; background: var(--sunken); text-align: center; line-height: 1.1; }
.cx-when b { display: block; font-size: 16px; color: var(--gold); }
.cx-when small { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.cx-when.late b { color: var(--danger); }
.cx-pill { display: inline-block; vertical-align: 1px; padding: 0.05rem 0.45rem; border: 1px solid var(--border); border-radius: 999px; background: var(--sunken); color: var(--gold); font-size: 11px; font-weight: 800; }
.cx-kind { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.cx-who { color: var(--fg); letter-spacing: 0; text-transform: none; font-size: 12.5px; font-weight: 700; }
.cx-body { margin-top: 0.15rem; font-size: 14.5px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.cx-body.clamp { cursor: pointer; }
.cx-body.clamp:not(.open) { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cx-menu { position: relative; }
.cx-menu > summary { list-style: none; cursor: pointer; }
.cx-menu > summary::-webkit-details-marker { display: none; }
.cx-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  min-width: 150px;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--elevated);
  box-shadow: var(--shadow);
}
.cx-pop form { margin: 0; }
.cx-pop a, .cx-pop button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.8rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--fg);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.cx-pop a:hover, .cx-pop button:hover { background: var(--sunken); }
.cx-pop .danger { color: var(--danger); }
.cx-more-btn { display: block; width: 100%; min-height: 36px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--gold); font: inherit; font-weight: 800; cursor: pointer; }
.cx-more-btn[hidden] { display: none; }
.cx-filter { padding-top: 0.1rem; padding-bottom: 0.45rem; }
.cx-filter .q-chip { min-height: 32px; padding: 0.25rem 0.75rem; font-size: 12.5px; }
.cx-add { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 0; }
.cx-add .btn { flex: 1 1 0; }
.cx-panel details.add-box { margin-top: 0.75rem; }
.cx-about { display: inline-flex; margin-top: 0.35rem; padding: 0.1rem 0.55rem; border: 1px solid var(--border); border-radius: 999px; background: var(--wash); color: var(--gold); font-size: 12px; font-weight: 700; text-decoration: none; }
.cx-hint { margin: 0.3rem 0 0; font-size: 12.5px; }
.cx-linkrow { align-items: flex-start; }
.cx-linkrow .t > b a { text-decoration: none; }
.cx-linkrow.closed .t > b a { color: var(--muted); }
.cx-linkrow .bid-meta { margin-top: 0.35rem; font-size: 12.5px; color: var(--muted); }
.cx-status { margin: 0.45rem 0 0; }
.cx-status select { width: auto; min-width: 150px; min-height: 40px; padding: 0.3rem 0.6rem; font-size: 14px; }
.cx-pill.done { color: var(--muted); }
@media (max-width: 899px) {
  .cx-desk-only { display: none; }
}
@media (min-width: 900px) {
  .cx { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
  .cx-side { position: sticky; top: calc(var(--cx-top, 64px) + 1rem); }
  .cx-main .q-chips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .cx-tabs .cx-phone-only, .cx-stuck .cx-mini { display: none; }
  .cx-tabs { padding-top: 0.35rem; }
}
@media (min-width: 900px) and (max-height: 720px) {
  .cx-side { position: static; }
}

/* Dashboard (index.php). Tiles, cards and bars use the app's own colour tokens. */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 0.4rem 1rem; margin: 0.2rem 0 0.6rem; }
.dash-head h1 { margin: 0; }
.dash-meta { font-size: 13px; color: var(--muted); }
.dash-meta b { color: var(--fg); font-weight: 600; }
.dash-period { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin: 0 0 0.4rem; }
.dash-period select, .dash-period input { width: auto; min-height: 36px; }
.dash-period label { display: inline-flex; align-items: center; gap: 0.35rem; margin: 0; font-size: 13px; color: var(--muted); text-transform: none; letter-spacing: normal; }
@media (max-width: 480px) {
  .dash-period label { flex: 1 1 100%; }
  .dash-period select, .dash-period input { width: 100%; max-width: 100%; min-width: 0; }
}
.dash-tabs { overflow-x: auto; margin: 0.4rem -1rem 1rem; padding: 0 1rem 0.2rem; scrollbar-width: none; }
.dash-tabs::-webkit-scrollbar { display: none; }
.dash-tabs .rem-seg { display: inline-flex; flex-wrap: nowrap; }
.dash-tabs .rem-seg a { white-space: nowrap; }
.dash-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0 0 1rem; }
@media (min-width: 900px) { .dash-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dash-tile { display: block; min-width: 0; padding: 0.8rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
a.dash-tile:hover { border-color: rgb(201 164 92 / 0.55); }
.dash-tile.fail { border-style: dashed; }
.dash-label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dash-value { display: block; margin-top: 0.25rem; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.55rem; line-height: 1.1; color: var(--gold); }
.dash-delta { display: block; margin-top: 0.2rem; font-size: 13px; color: var(--muted); }
.dash-delta.up { color: var(--ok); }
.dash-delta.down { color: var(--danger); }
.dash-sub { display: block; margin-top: 0.2rem; font-size: 12.5px; color: var(--muted); }
.dash-card { min-width: 0; margin: 0 0 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.dash-card h2 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.dash-grid { display: grid; grid-template-columns: 1fr; gap: 0.9rem; align-items: start; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: 1.6fr 1fr; }
  .dash-grid .tall { grid-row: span 2; }
  .dash-grid .dash-full { grid-column: 1 / -1; }
}
.dash-note { margin: 0.4rem 0 0; font-size: 13px; color: var(--muted); }
.dash-note b { color: var(--fg); }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; padding: 0.55rem 0; border-top: 1px solid var(--border); font-size: 15px; }
.dash-list li:first-child { border-top: 0; padding-top: 0; }
.dash-list li > span { min-width: 0; }
.dash-list b { flex: 0 0 auto; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.1rem; color: var(--gold); white-space: nowrap; }
.dash-bar-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; margin: 0.5rem 0; font-size: 14px; }
.dash-bar-row.narrow { grid-template-columns: 6.5rem minmax(0, 1fr) 2.5rem; }
.dash-track { display: block; height: 12px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.dash-track i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.dash-track i.over { background: var(--danger); }
.dash-val { font-weight: 700; text-align: right; white-space: nowrap; }
.dash-val em { font-style: normal; font-weight: 400; color: var(--muted); margin-left: 0.35rem; font-size: 13px; }
.dash-val.over { color: var(--danger); }
.dash-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.6rem 0; }
.dash-trio b { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.5rem; line-height: 1.1; color: var(--gold); }
.dash-trio span { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.dash-table-wrap { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dash-table th, .dash-table td { padding: 0.45rem 0.4rem; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.dash-table th { border-top: 0; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.dash-table .num { text-align: right; white-space: nowrap; }
.dash-targets input { width: 9rem; }
.dash-targets label { display: inline-flex; flex-direction: column; gap: 0.2rem; margin: 0 1rem 0.6rem 0; }
.dash-review-title { margin: 0; }
@media print {
  .top, .dash-period, .dash-tabs, .no-print, .menu-btn, .metal { display: none !important; }
  body { background: #fff; color: #000; }
  .dash-card, .dash-tile { box-shadow: none; }
}

/* Roles & Rights: the "Who can see payments" box. */
.perm-tick { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 15px; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--fg); cursor: pointer; }
.perm-tick input[type="checkbox"] { width: 18px; min-height: 18px; height: 18px; margin: 0; accent-color: var(--primary); }


/* Today: one list per kind of work, filter tiles, and at most three actions a row. */
.t-summary { margin: 0 0 .6rem; font-weight: 800; }
.t-who { margin: 0 0 .7rem; }
.t-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: 0 0 .5rem; }
@media (min-width: 720px) { .t-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.t-tile { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .55rem .65rem; color: var(--fg); font: inherit; cursor: pointer; }
.t-tile b { display: block; font-family: Palatino, "Palatino Linotype", Georgia, serif; font-size: 1.55rem; line-height: 1.1; color: var(--gold); }
.t-tile span { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.t-tile.late b { color: var(--danger); }
.t-tile.on { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.t-showall { margin: 0 0 .6rem; font-size: 14px; }
.t-undo { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: 0 0 .7rem; padding: .55rem .8rem; border-radius: 14px; background: var(--sunken); border: 1px solid var(--border); }
.t-inline { display: inline; margin: 0; }
.t-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0 0 .75rem; }
.t-filters form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.t-filters label { font-size: 13px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.t-filters input[type=number] { width: 6rem; }
.t-filters select { min-width: 12rem; }
.st-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media print { .st-scroll { overflow: visible; } }
.money-table th, .money-table td { vertical-align: top; }
.money-table .nowrap { white-space: nowrap; }
.money-table .row-actions { white-space: nowrap; }
.money-table .row-actions .btn { margin: 0 .25rem .25rem 0; }
.money-table .row-actions form { display: inline; margin: 0; }
.money-table tr.focus td { background: rgb(184 137 58 / 0.14); }
.make-dialog { width: min(92vw, 440px); border: 1px solid var(--border); border-radius: 16px; padding: 1rem 1.1rem; background: var(--surface); color: var(--fg); }
.make-dialog::backdrop { background: rgb(0 0 0 / 0.35); }
.make-dialog label { display: block; margin: .55rem 0; font-size: 13px; color: var(--muted); }
.make-dialog input, .make-dialog select { display: block; width: 100%; margin-top: .25rem; }
.t-sec { margin: 1.1rem 0 .5rem; }
.t-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-bottom: 1px solid var(--border); padding-bottom: .3rem; margin-bottom: .5rem; }
.t-sec-head h2 { margin: 0; font-size: 1.05rem; }
.t-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.t-sec-off { display: none; }
.t-note, .t-none, .t-fail { margin: .2rem 0 .5rem; font-size: 14px; color: var(--muted); }
.t-fail { color: var(--danger); }
.t-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .7rem .8rem; margin: 0 0 .5rem; box-shadow: var(--shadow); }
.t-row[hidden] { display: none; }
.t-row.priority { border-color: var(--gold); }
@media (min-width: 560px) { .t-row { grid-template-columns: 110px minmax(0, 1fr); } .t-row .t-acts { grid-column: 2; } }
.t-tag { display: block; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.t-tag.late { color: var(--danger); }
.t-main { min-width: 0; display: grid; gap: .1rem; }
.t-main strong { font-size: 15.5px; line-height: 1.3; }
.t-sub, .t-contact { font-size: 13.5px; color: var(--muted); }
.t-acts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.t-move { position: relative; }
.t-move[open] { flex: 1 1 100%; }
.t-move > summary { list-style: none; cursor: pointer; }
.t-move > summary::-webkit-details-marker { display: none; }
.t-move-menu { display: grid; gap: .4rem; margin: .4rem 0 0; padding: .6rem; border-radius: 12px; background: var(--sunken); border: 1px solid var(--border); }
.t-move-menu { grid-template-columns: minmax(0, 1fr); }
.t-move-menu .btn { height: 36px; white-space: nowrap; justify-content: flex-start; }
.t-move-menu small { color: var(--muted); font-weight: 700; }
.t-custom { display: grid; gap: .25rem; font-size: 13px; color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; color: var(--gold); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }

/* Storage register and My workplace: the shared bar, summary, link disclosure and card footer. */
.store-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; margin: .1rem 0 .8rem; }
.store-meta p { margin: 0; }
.store-findbar { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: 0 0 .9rem; }
.store-find { flex: 1 1 14rem; min-width: 0; }
.store-findbar .btn { margin: 0; }
.store-shown { font-size: 13px; white-space: nowrap; }
.store-more { margin-top: .6rem; }
.store-more > summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.store-more > summary:hover { color: var(--gold); }
.store-more[open] > summary { margin-bottom: .45rem; }
.store-link-add { display: flex; flex-direction: column; align-items: stretch; gap: .45rem; margin: 0; }
.store-link-add .btn { align-self: flex-end; min-height: 40px; padding: .45rem .85rem; }
.store-link-add .link-pick { width: 100%; }
.link-pick .pick-list { position: fixed; z-index: 80; max-height: 46vh; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.store-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.store-foot form { margin: 0; display: flex; }
.store-foot .btn { min-height: 36px; margin: 0; }
.store-foot .icon-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; }
.store-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.store-actions-grid form { margin: 0; }
.store-actions-grid .btn { width: 100%; margin: 0; }
