/* Norand · Daily Visit Log
   The Norand ERP's own design: the :root tokens below are copied verbatim from
   norand-erp-dev/public/assets/norand/norand.css, and every component is
   modelled on the ERP rule for the same role (named above each block).
   No colour, radius or font size of its own: tokens only. */

:root {
  /* SURFACES — the Omne Gold look since 2026-11-04: a frosted silver floor,
     white paper, graphite ink, one gold (REQ-PLT-10 (q), rule 18) */
  --bg: #E9EDF1;
  --surface: #FFFFFF;
  --surface-2: #F4F6F8;
  --surface-3: #E9EDF1;
  --card: var(--surface);
  --card-inset: var(--surface-2);
  --bg-deep: var(--surface-2);
  --pill-bg: var(--surface-2);

  /* INK */
  --ink: #27313A;
  --ink-soft: #33414F;
  --ink-2: #56616A;
  --ink-mute: #7F8993;
  --ink-inverse: #FFFFFF;   /* text on a solid accent or flag fill */
  --ink-3: var(--ink-mute);
  --ink-4: #C9D1D8;

  /* HAIRLINE */
  --line: #EDF0F3;
  --line-strong: #DFE5EA;
  --line-soft: #F3F5F7;

  /* BRAND ACCENTS */
  --brand-dark: #3E342C;
  --brand-warm: #C9B8A3;
  --accent: #33414F;
  --accent-strong: #25313D;
  --accent-soft: rgba(51, 65, 79, 0.06);
  --accent-warm: var(--accent);
  --accent-flag: #9B625C;
  --accent-go: #527560;
  --accent-wait: #98782D;   /* in progress — the order's current step */

  /* GOLD — the one hue in the chrome: the primary button, the current page,
     the chosen chip. Never a large surface. */
  --tone: #EFD16B;
  --tone-hover: #EBCB5C;
  --tone-on: #332C17;       /* text on gold */
  --tone-soft: #FCF6DF;     /* a chosen chip, a focus ring */
  --tone-ink: #745A18;      /* gold-family text and the focused border */
  --tone-line: #E7CF7A;

  --shadow: 0 8px 26px rgba(77, 99, 116, 0.06);
  --shadow-frost: inset 0 1px 0 #FFFFFF, 0 14px 34px rgba(82, 103, 122, 0.08);
  --shadow-modal: 0 30px 80px rgba(28, 43, 61, 0.25);
  --frost: rgba(255, 255, 255, 0.72);
  --frost-2: rgba(255, 255, 255, 0.58);
  --frost-line: rgba(255, 255, 255, 0.86);
  --scrim: rgba(39, 49, 58, 0.28);
  /* the staff floor: white light top-left, cool blue top-right, a warm gold
     glow at the bottom, and a faint film grain over it */
  --floor: radial-gradient(ellipse at 8% 5%, #FFFFFF 0%, rgba(255, 255, 255, 0) 47%),
           radial-gradient(ellipse at 98% 18%, #E1E8EF 0%, rgba(225, 232, 239, 0) 48%),
           radial-gradient(ellipse at 45% 100%, rgba(255, 248, 220, 0.6) 0%, rgba(255, 248, 220, 0) 52%),
           linear-gradient(145deg, #EDF1F4, #E5EAF0 60%, #F5F6F7);
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");

  /* RADIUS */
  --r-xs: 5px;     /* badge */
  --r-sm: 7px;     /* input, chip */
  --r-md: 9px;     /* button */
  --r-lg: 11px;    /* card */
  --r-xl: 14px;    /* modal, kanban column */
  --r-kpi: 16px;   /* KPI tile */
  --r-pill: 999px;
  --radius-sm: var(--r-sm);
  --radius: var(--r-md);

  /* LAYOUT */
  --topbar-h: 56px;
  --sidebar-w: 240px;
  --bottomtabs-h: 64px;

  /* TYPE — two faces, one ladder. */
  --font-sans: 'Manrope', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', Arial, sans-serif;
  --font-mono: 'Manrope', 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', Arial, sans-serif;

  --t-3xs: 9px;    /* smallest tag */
  --t-2xs: 10px;   /* micro-label, meta */
  --t-xs: 11px;    /* secondary data, small control */
  --t-sm: 12px;    /* dense data */
  --t-md: 13px;    /* primary data, control */
  --t-base: 14px;  /* body */
  --t-lg: 16px;    /* heading */
  --t-xl: 19px;    /* page title */
  --t-2xl: 22px;   /* figure */
  --t-3xl: 28px;   /* large figure */
  --t-4xl: 38px;   /* shop-floor board */

  --ls-tighter: -0.03em;  /* large figures, totals */
  --ls-tight: -0.01em;    /* body, data */
  --ls-wide: 0.01em;      /* codes */
  --ls-wider: 0.08em;     /* label */
  --ls-widest: 0.09em;    /* micro-label, uppercase */
  --ls-mark: 0.32em;      /* the printed NORAND wordmark */
  --doc-tone: #A38B79;    /* a printed document's band: the selling company */
  --doc-tone-soft: #F6F1EC;
  /* status tints of the list pages: their go / wait / flag at low opacity (REQ-PLT-10 rule 17) */
  --ux-go-soft: #EAF3EE;
  --ux-wait-soft: #FFF7DC;
  --ux-flag-soft: #F8ECEB;
  --ux-info-soft: #E9EFF6;
  --ux-wait-ink: #98782D;
  --ux-row-h: 52px;

  /* the visit log's one layout length of its own: the 44px touch target */
  --touch: 44px;
}

/* ============ BASE (norand.css: * / html, body / button, input) ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.5;
  letter-spacing: var(--ls-tight);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
  min-height: 100vh;
}
/* OMNE GOLD: the frosted floor and its grain (body.is-manage) */
body.is-manage { background: var(--floor); background-attachment: fixed; isolation: isolate; }
body.is-manage::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.1; mix-blend-mode: multiply; background-image: var(--grain); }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }
/* clip, not hidden: hidden would make body a scroll container and the sticky save bar would
   never stick. A browser without clip falls back to visible, and html still hides the overflow. */
body { overflow-x: clip; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, textarea, select { font-family: inherit; color: inherit; outline: none; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: 400; }
:focus-visible { outline: 2px solid var(--tone-ink); outline-offset: 1px; }
[hidden] { display: none !important; }
.mono, .num { font-variant-numeric: tabular-nums; }
.num { font-weight: 500; }
.code { font-weight: 600; letter-spacing: var(--ls-wide); white-space: nowrap; }
.meta { font-size: var(--t-2xs); color: var(--ink-mute); }
.small { font-size: var(--t-sm); color: var(--ink-2); }
.mute { color: var(--ink-mute); }
.link { color: var(--tone-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.overdue { color: var(--accent-flag); font-weight: 600; }

/* ============ TOPBAR (norand.css .topbar / .brand-name / .brand-sub; OMNE GOLD frost) ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
  z-index: 50;
  background: var(--frost-2);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--frost-line);
  box-shadow: var(--shadow);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-name { font-size: var(--t-md); font-weight: 500; letter-spacing: var(--ls-widest); color: var(--ink); }
.brand-sub { color: var(--ink-mute); font-size: var(--t-2xs); padding-left: 12px; margin-left: 4px; border-left: 1px solid var(--line-strong); letter-spacing: var(--ls-wider); white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* .topbar-action: the bordered square beside the bar's right edge */
.topbar-action {
  min-height: 34px; padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); background: var(--frost);
  font-size: var(--t-sm); font-weight: 500;
  transition: all 160ms; white-space: nowrap; flex-shrink: 0;
}
.topbar-action:hover { color: var(--ink); border-color: var(--ink); }
.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; min-width: 0; }
.who b { font-size: var(--t-md); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.who button { font-size: var(--t-2xs); color: var(--ink-mute); text-decoration: underline; text-underline-offset: 2px; min-height: 20px; }
/* the page tabs on a laptop: the ERP's .nav-item, its current page in gold */
.navtabs { display: flex; gap: 4px; }
.nav-item { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-md); font-size: var(--t-md); color: var(--ink-2); font-weight: 500; }
.nav-item:hover { background: var(--frost); color: var(--ink); }
.nav-item.active { background: var(--tone); color: var(--tone-on); }
.nav-item svg, .tab-item svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* ============ BOTTOM TABS (norand.css .bottom-tabs / .tab-item) ============ */
.bottom-tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 60;
  display: none;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-tabs-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--bottomtabs-h); }
.tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 4px;
  font-size: var(--t-2xs);
  letter-spacing: var(--ls-tight);
  color: var(--ink-mute);
  position: relative; min-width: 0; text-align: center;
}
.tab-item.active { color: var(--accent); font-weight: 600; }
.tab-item.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 2px; border-radius: var(--r-pill); background: var(--tone); }

/* ============ CONTENT · PAGE HEAD (norand.css .content / .page-head) ============ */
.content { padding: calc(var(--topbar-h) + 28px) 32px 48px; max-width: 1180px; margin: 0 auto; }
.content.is-narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: var(--t-3xl); font-weight: 500; letter-spacing: var(--ls-tighter); line-height: 1.2; color: var(--ink); overflow-wrap: anywhere; }
.page-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.page-crumb { font-size: var(--t-sm); color: var(--ink-mute); margin-bottom: 4px; }
.page-crumb a:hover { color: var(--ink); }
.page-sub { margin-top: 4px; font-size: var(--t-md); color: var(--ink-2); }
.page-sub b { color: var(--ink); font-weight: 600; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============ BUTTONS (norand.css .btn / .btn.solid in gold / .ghost / .danger) ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 500;
  letter-spacing: var(--ls-tight);
  transition: all 160ms;
  white-space: nowrap;
  text-align: center;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn.solid { background: var(--tone); color: var(--tone-on); border-color: var(--tone); font-weight: 600; }
.btn.solid:hover { background: var(--tone-hover); border-color: var(--tone-hover); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-4); }
.btn.danger { color: var(--accent-flag); border-color: var(--ux-flag-soft); }
.btn.danger:hover { background: var(--ux-flag-soft); border-color: var(--accent-flag); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: var(--t-xs); }
.btn.lg { min-height: 52px; font-size: var(--t-base); padding: 12px 18px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.textbtn { color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; min-height: 30px; }
.textbtn:hover { color: var(--ink); }

/* ============ CHIPS (norand.css .chips / .chip, OMNE GOLD .chip.is-on in --tone-soft) ============ */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 12px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface);
  font-size: var(--t-md); color: var(--ink-2); text-decoration: none; text-align: left; max-width: 100%;
}
.chip:hover { color: var(--ink); border-color: var(--ink-4); }
.chip.is-on { background: var(--tone-soft); border-color: var(--tone-line); color: var(--tone-on); font-weight: 600; }
.chip-count { font-size: var(--t-xs); font-weight: 600; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.chip.is-on .chip-count { color: var(--tone-ink); }
.chip-sub { font-size: var(--t-2xs); color: var(--ink-mute); font-weight: 500; }
.chip.is-on .chip-sub { color: var(--tone-ink); }
.chip:disabled { background: var(--surface-2); color: var(--ink-mute); border-style: dashed; cursor: not-allowed; }
.chip .tick { width: 14px; height: 14px; border: 1px solid var(--ink-4); border-radius: var(--r-xs); display: inline-grid; place-items: center; flex: none; background: var(--surface); }
.chip.is-on .tick { border-color: var(--tone-ink); background: var(--tone); }
.chip.is-on .tick::after { content: ''; width: 7px; height: 4px; border-left: 2px solid var(--tone-on); border-bottom: 2px solid var(--tone-on); transform: rotate(-45deg) translate(1px, -1px); }

/* ============ FORMS (norand.css FORMS: .field / .field-label / .field-input / .field-help / .field-err) ============ */
.field { margin-bottom: 16px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: var(--t-sm); font-weight: 500; letter-spacing: var(--ls-tight); color: var(--ink); margin-bottom: 6px; }
.field-label.req::after { content: ' *'; color: var(--accent); }
.field-label.check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 0; min-height: var(--touch); font-weight: 500; }
.field-label.check input { width: 18px; height: 18px; accent-color: var(--tone-ink); flex: none; }
.field-input, .field-select, .field-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  min-height: 42px;
  font-size: var(--t-md);
  color: var(--ink);
  letter-spacing: var(--ls-tight);
  font-family: var(--font-sans);
}
.field-select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%237F8993' stroke-width='1.5'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; }
.field-select:invalid, .field-select.is-placeholder { color: var(--ink-mute); }
.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: var(--tone-ink); box-shadow: 0 0 0 3px var(--tone-soft); }
.field-textarea { resize: vertical; min-height: 92px; line-height: 1.5; }
.field-help { font-size: var(--t-xs); color: var(--ink-mute); margin-top: 6px; }
.field-help.is-warn { color: var(--accent-wait); }
input::placeholder, textarea::placeholder { font-size: var(--t-xs); color: var(--ink-mute); }
.field-input.is-error, .field-select.is-error, .field-textarea.is-error { border-color: var(--accent-flag); background: var(--ux-flag-soft); }
.field-err { font-size: var(--t-xs); color: var(--accent-flag); margin-top: 6px; display: none; font-weight: 500; }
.field-err.is-shown { display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > .field { margin-bottom: 16px; }
.phone-field { display: flex; gap: 6px; }
.phone-field .field-select { flex: 0 0 116px; padding-left: 12px; }
.phone-field .field-input { flex: 1 1 auto; min-width: 0; }
.form-errors:empty { display: none; }
.form-errors { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--ux-flag-soft); background: var(--ux-flag-soft); color: var(--accent-flag); font-size: var(--t-sm); font-weight: 500; }
details.more { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
details.more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: var(--touch); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: '+'; width: 20px; height: 20px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-xs); color: var(--ink-2); }
details.more[open] > summary::before { content: '–'; }
/* toggle switch (norand.css .tog) */
.tog { position: relative; display: inline-block; width: 34px; height: 19px; flex: 0 0 auto; cursor: pointer; }
.tog input { opacity: 0; width: 0; height: 0; position: absolute; }
.tog .tog-track { position: absolute; inset: 0; background: var(--line-strong); border-radius: var(--r-pill); transition: background 160ms; }
.tog .tog-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; background: var(--surface); border-radius: var(--r-pill); box-shadow: var(--shadow); transition: transform 160ms; }
.tog input:checked + .tog-track { background: var(--accent-go); }
.tog input:checked + .tog-track::after { transform: translateX(15px); }
.tog input:focus-visible + .tog-track { outline: 2px solid var(--tone-ink); outline-offset: 2px; }

/* ============ CARDS (norand.css .section.is-card + OMNE GOLD; numbered heads as Open Account's .account-sec) ============ */
.section { margin-bottom: 16px; }
.section.is-card { background: var(--surface); border: 1px solid var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.section-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.section-head h2 { font-size: var(--t-md); font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.section-head > :last-child:not(:first-child) { margin-left: auto; }
.sec-num { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--t-2xs); font-weight: 700; }
.section.has-error .sec-num { background: var(--ux-flag-soft); color: var(--accent-flag); }
.section-body { padding: 16px 18px; }
.section-body.flush { padding: 0; }
.notice { padding: 10px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); font-size: var(--t-sm); color: var(--ink-2); }
.notice b { color: var(--ink); font-weight: 600; }
.notice.is-tone { border-color: var(--tone-line); background: var(--tone-soft); color: var(--tone-ink); }
.notice.is-tone b { color: var(--tone-on); }
.notice + .notice, .notice + .field, .field + .notice { margin-top: 12px; }

/* ============ DETAIL BLOCKS (norand.css .detail-row / .detail-key / .detail-val) ============ */
.detail-grid { display: grid; gap: 10px; }
.detail-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: baseline; }
.detail-key { font-size: var(--t-xs); font-weight: 500; color: var(--ink-mute); }
.detail-val { font-size: var(--t-md); color: var(--ink); overflow-wrap: anywhere; }

/* ============ KPI TILES (norand.css .kpi-grid / .kpi / .kpi-label / .kpi-value / .kpi-sub, OMNE GOLD radius) ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { padding: 18px 20px; background: var(--surface); border: 1px solid var(--surface); border-radius: var(--r-kpi); box-shadow: var(--shadow); min-width: 0; text-align: left; }
button.kpi:hover { box-shadow: 0 0 0 3px var(--tone-soft); border-color: var(--tone-line); }
.kpi-label { font-size: var(--t-2xs); font-weight: 500; color: var(--ink-mute); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value { font-size: var(--t-2xl); font-weight: 600; letter-spacing: var(--ls-tighter); color: var(--ink); line-height: 1.05; margin-bottom: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: var(--t-xs); color: var(--ink-mute); letter-spacing: var(--ls-wide); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub.flag { color: var(--accent-flag); }

/* ============ LIST TABLES (norand.css .table, sentence-case column names) ============ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table thead th { text-align: left; padding: 10px 14px 10px 0; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tbody td { padding: 12px 14px 12px 0; font-size: var(--t-md); border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: top; }
.table th:first-child, .table td:first-child { padding-left: 18px; }
.table th:last-child, .table td:last-child { padding-right: 18px; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table tr.is-total td { font-weight: 600; background: var(--surface-2); }
.table .cell-sub { display: block; font-size: var(--t-xs); color: var(--ink-mute); }
.figure { min-width: 34px; min-height: 30px; padding: 2px 8px; border-radius: var(--r-sm); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.figure:hover { background: var(--tone-soft); color: var(--tone-on); }
.figure.is-zero { color: var(--ink-4); font-weight: 500; }

/* ============ TAGS · BADGES (norand.css .tag with .ok / .wait / .flag) ============ */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-xs); font-size: var(--t-2xs); font-weight: 600; color: var(--ink-2); background: var(--bg); white-space: nowrap; }
.tag.ok { color: var(--accent-go); border-color: var(--ux-go-soft); background: var(--ux-go-soft); }
.tag.wait { color: var(--ux-wait-ink); border-color: var(--ux-wait-soft); background: var(--ux-wait-soft); }
.tag.info { color: var(--ink-soft); border-color: var(--ux-info-soft); background: var(--ux-info-soft); }
.tag.tone { color: var(--tone-ink); border-color: var(--tone-line); background: var(--tone-soft); }
.tag.flag { color: var(--accent-flag); border-color: var(--ux-flag-soft); background: var(--ux-flag-soft); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ============ SEARCH (norand.css .searchbox / .lead-lookup) ============ */
.searchbox { position: relative; display: block; }
.searchbox input { width: 100%; min-height: 48px; padding: 0 14px 0 40px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); font-size: var(--t-base); color: var(--ink); }
.searchbox input:focus { border-color: var(--tone-ink); box-shadow: 0 0 0 3px var(--tone-soft); }
.searchbox > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--ink-mute); fill: none; stroke-width: 1.7; }
.results { margin-top: 10px; display: grid; gap: 8px; }
.result { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; min-height: 60px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.result:hover { border-color: var(--tone-line); background: var(--tone-soft); }
.result.is-colleague { background: var(--surface-2); }
.result-main { flex: 1; min-width: 0; }
.result-name { font-size: var(--t-base); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.result-sub { font-size: var(--t-xs); color: var(--ink-mute); margin-top: 2px; overflow-wrap: anywhere; }
.result-hint { font-size: var(--t-sm); color: var(--ink-2); margin-top: 2px; }
.result-hint b { color: var(--ink); font-weight: 600; }
.result .chev { width: 16px; height: 16px; stroke: var(--ink-4); fill: none; stroke-width: 1.7; flex: none; }
.results-head { font-size: var(--t-xs); font-weight: 600; color: var(--ink-mute); margin: 16px 0 2px; }

/* ============ LIST ROWS (My Companies, as the Lead Pool's list card rows) ============ */
.list-card { background: var(--surface); border: 1px solid var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.row { display: block; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-2); }
.row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.row-name { font-size: var(--t-base); font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.row-sub { font-size: var(--t-xs); color: var(--ink-mute); margin-top: 2px; }
.row-line { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: var(--t-sm); color: var(--ink-2); align-items: center; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.filter-pill, .toolbar .field-select, .toolbar .field-input { width: auto; min-height: 36px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background-color: transparent; font-size: var(--t-md); color: var(--ink-2); }
.toolbar .field-select { padding-right: 32px; }
.filter-pill { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.filter-pill input { accent-color: var(--tone-ink); width: 16px; height: 16px; }
.filter-pill:has(input:checked) { border-style: solid; color: var(--ink); background: var(--surface); }

/* ============ PEOPLE · PHONES ============ */
.person { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: none; }
.person-main { flex: 1; min-width: 0; }
.person-name { font-weight: 600; font-size: var(--t-base); }
.person-sub { font-size: var(--t-xs); color: var(--ink-mute); }
.phone-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.phone-links .phone { font-variant-numeric: tabular-nums; font-weight: 500; font-size: var(--t-md); margin-right: 2px; }
.pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; min-height: 56px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); margin-bottom: 8px; }
.pick.is-on { border-color: var(--tone-line); background: var(--tone-soft); }
.pick .tick { width: 20px; height: 20px; border: 1px solid var(--ink-4); border-radius: var(--r-xs); flex: none; display: grid; place-items: center; background: var(--surface); }
.pick.is-on .tick { background: var(--tone); border-color: var(--tone-ink); }
.pick.is-on .tick::after { content: ''; width: 9px; height: 5px; border-left: 2px solid var(--tone-on); border-bottom: 2px solid var(--tone-on); transform: rotate(-45deg) translate(1px, -1px); }
.subcard { border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 14px; margin-bottom: 10px; background: var(--surface-2); }
.subcard-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: var(--t-sm); font-weight: 600; }

/* ============ PHOTOS ============ */
.photo-btn { width: 100%; min-height: 72px; border: 1px dashed var(--ink-4); border-radius: var(--r-lg); background: var(--surface-2); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: var(--t-base); font-weight: 600; color: var(--ink); }
.photo-btn:hover { border-color: var(--tone-ink); background: var(--tone-soft); }
.photo-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: var(--r-pill); background: var(--frost); border: 1px solid var(--frost-line); color: var(--ink); display: grid; place-items: center; font-size: var(--t-lg); line-height: 1; }
.thumb-state { position: absolute; inset: auto 0 0 0; padding: 4px 6px; background: var(--frost); font-size: var(--t-2xs); font-weight: 600; color: var(--ink-2); text-align: center; }
.thumb-state.is-failed { color: var(--accent-flag); }
.thumb-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--tone); transition: width 160ms; }
.thumb-retry { position: absolute; inset: 0; display: grid; place-items: center; background: var(--frost); font-size: var(--t-sm); font-weight: 600; color: var(--accent-flag); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
/* a video: its poster (or a plain tile), the play mark and its size (owner, 22 Nov 2026, evening) */
.thumb-play { position: absolute; inset: 0; display: grid; place-items: center; background: none; }
.thumb-play svg { width: 34px; height: 34px; padding: 8px; border-radius: var(--r-pill); background: var(--frost); border: 1px solid var(--frost-line); fill: var(--ink); stroke: none; box-shadow: var(--shadow); }
.thumb-size { position: absolute; left: 4px; bottom: 4px; padding: 1px 6px; border-radius: var(--r-xs); background: var(--frost); font-size: var(--t-2xs); font-weight: 600; color: var(--ink); pointer-events: none; }
.thumb.is-video .thumb-state ~ .thumb-x, .thumb.is-video .thumb-retry ~ .thumb-x { z-index: 1; }
.thumb-note { position: absolute; inset: 0; padding: 8px; display: grid; place-items: center; text-align: center; font-size: var(--t-2xs); line-height: 1.3; color: var(--tone-ink); background: var(--tone-soft); }
.media-player { display: block; width: 100%; max-height: 70vh; border-radius: var(--r-md); background: var(--ink); }
.pcard-video { position: relative; aspect-ratio: 1; background: var(--surface-3); }
.pcard-video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-photos > :first-child:nth-last-child(1) { grid-column: span 3; aspect-ratio: 16 / 10; }

.pcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.pcard-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; background: var(--line); }
.pcard-photos a { aspect-ratio: 1; display: block; background: var(--surface-3); }
.pcard-photos a:first-child:nth-last-child(1) { grid-column: span 3; aspect-ratio: 16 / 10; }
.pcard-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard-body { padding: 14px 16px; display: grid; gap: 8px; flex: 1; }
.pcard-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; gap: 8px; flex-wrap: wrap; }
.handle { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); }
.handle a { color: var(--tone-ink); font-weight: 600; overflow-wrap: anywhere; }

/* ============ VISITS on the record ============ */
.visit { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.visit:last-child { border-bottom: none; }
.visit-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.visit-date { font-weight: 600; font-size: var(--t-base); }
.visit-notes { margin-top: 10px; font-size: var(--t-md); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.visit .thumbs { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }

/* ============ STICKY SAVE BAR (norand.css .slideover-foot / .modal-foot) ============ */
.savebar { position: sticky; bottom: 0; z-index: 40; margin: 8px -32px -48px; padding: 12px 32px; background: var(--surface-2); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.savebar .btn.solid { min-width: 220px; }
.savebar-note { flex: 1 1 260px; font-size: var(--t-sm); color: var(--ink-2); }

/* ============ MODAL (norand.css .modal-overlay / .modal / .modal-head / .modal-body / .modal-foot, OMNE GOLD) ============ */
.modal-overlay { position: fixed; inset: 0; background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 450; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--shadow-modal); width: 100%; max-width: 720px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.sm { max-width: 480px; }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { font-size: var(--t-xl); font-weight: 500; letter-spacing: var(--ls-tight); color: var(--ink); }
.modal-close { font-size: var(--t-sm); font-weight: 500; color: var(--ink-mute); padding: 4px 10px; min-height: 32px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); white-space: nowrap; }
.modal-close:hover { color: var(--ink); border-color: var(--ink); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); flex-wrap: wrap; }
.modal-list { display: grid; }
.modal-list a, .modal-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--t-md); }
.modal-list a:hover { color: var(--tone-ink); }
.modal-list .mute { text-align: right; }

/* ============ EMPTY · TOAST (norand.css .empty / .toast / .toast-mark) ============ */
.empty { text-align: center; padding: 40px 20px; color: var(--ink-mute); font-size: var(--t-sm); }
.empty b { display: block; color: var(--ink-2); font-size: var(--t-base); font-weight: 600; margin-bottom: 4px; }
#toast-stack { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-modal); border-radius: var(--r-md); padding: 12px 16px; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 380px; font-size: var(--t-md); color: var(--ink); animation: toastIn 240ms ease both; }
.toast-mark { width: 22px; height: 22px; border-radius: var(--r-pill); display: grid; place-items: center; font-size: var(--t-2xs); font-weight: 700; background: var(--ux-go-soft); color: var(--accent-go); flex-shrink: 0; }
.toast-mark.warn { background: var(--ux-flag-soft); color: var(--accent-flag); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ ENTER · WHO (the ERP's login card: .brand-name over a white card) ============ */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-frost); padding: 32px 28px; }
.gate-mark { font-size: var(--t-xl); font-weight: 800; letter-spacing: var(--ls-mark); color: var(--ink); }
.gate-sub { font-size: var(--t-sm); color: var(--ink-mute); margin: 6px 0 24px; letter-spacing: var(--ls-wider); }
.gate h1 { font-size: var(--t-2xl); font-weight: 500; letter-spacing: var(--ls-tighter); margin-bottom: 16px; }
.who-list { display: grid; gap: 10px; }
.who-list .btn { justify-content: flex-start; min-height: 56px; font-size: var(--t-base); }
/* Sign Out on Who are you?: a quiet way to another code */
.who-out { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.who-out .field-help { margin: 0; }

/* ============ DASHBOARD ============ */
.trend { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; align-items: end; padding: 16px 18px 4px; }
.trend-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.trend-bars { display: flex; gap: 3px; align-items: flex-end; height: 130px; }
.trend-bar { width: 12px; border-radius: var(--r-xs) var(--r-xs) 0 0; background: var(--accent); min-height: 2px; }
.trend-bar.is-acc { background: var(--tone); }
.trend-val { font-size: var(--t-2xs); color: var(--ink-2); font-weight: 600; }
.trend-label { font-size: var(--t-2xs); color: var(--ink-mute); white-space: nowrap; padding: 6px 0 12px; }
.legend { display: flex; gap: 14px; font-size: var(--t-xs); color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: var(--r-xs); background: var(--accent); margin-right: 6px; vertical-align: -1px; }
.legend i.is-acc { background: var(--tone); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: var(--ux-row-h); }
.settings-row:last-child { border-bottom: none; }
.settings-row .grow { flex: 1 1 160px; min-width: 0; }
.download-list { display: grid; gap: 8px; }
.download-list .btn { justify-content: flex-start; }

/* ============ RESPONSIVE (norand.css RESPONSIVE: 900px, 600px) ============ */
@media (max-width: 900px) {
  .topbar { padding: 0 16px; }
  .navtabs { display: none; }
  .bottom-tabs { display: block; }
  .content { padding: calc(var(--topbar-h) + 20px) 16px calc(var(--bottomtabs-h) + 24px + env(safe-area-inset-bottom)); }
  .savebar { margin: 8px -16px 0; padding: 12px 16px; bottom: calc(var(--bottomtabs-h) + env(safe-area-inset-bottom)); }
  .grid-2 { grid-template-columns: 1fr; }
  #toast-stack { left: 16px; right: 16px; bottom: calc(var(--bottomtabs-h) + 16px); max-width: none; }
  .toast { max-width: none; }
}
@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand { gap: 8px; }
  .page-head h1 { font-size: var(--t-2xl); }
  .page-head .page-actions { width: 100%; }
  .page-head .page-actions .btn.solid { flex: 1; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  /* touch targets: at least 44px on a phone */
  .btn, .chip, .filter-pill, .toolbar .field-select, .toolbar .field-input { min-height: var(--touch); }
  .btn.sm { min-height: 38px; }
  .field-input, .field-select, .field-textarea { min-height: var(--touch); font-size: var(--t-lg); }
  .section-body { padding: 14px; }
  .section-head { padding: 12px 14px; }
  .savebar .btn.solid { flex: 1 1 100%; min-width: 0; }
  .detail-row { grid-template-columns: 1fr; gap: 2px; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: 100%; max-height: 94vh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .modal-body { padding: 16px; }
  .modal-foot .btn { flex: 1; }
  .photo-grid { grid-template-columns: 1fr; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .who b { max-width: 110px; }
}
@media (max-width: 380px) {
  .brand-sub { display: none; }
}
#dash-table td { vertical-align: middle; }
