/* HP Profiles Field CRM - styles from the HP Profiles design system ("Field CRM" design):
   LT Superior type, Dark Royal #003A70 with the clay accent #C25131, white cards with 1px steel
   borders, 12px controls / 16px cards / 24px sheets, low cool shadows.
   Light by default; a dark variant follows the phone's setting. */

@font-face { font-family: 'LT Superior'; font-weight: 400; font-style: normal; font-display: swap; src: url('/fonts/LTSuperior-Regular.woff2') format('woff2'); }
@font-face { font-family: 'LT Superior'; font-weight: 500; font-style: normal; font-display: swap; src: url('/fonts/LTSuperior-Medium.woff2') format('woff2'); }
@font-face { font-family: 'LT Superior'; font-weight: 600; font-style: normal; font-display: swap; src: url('/fonts/LTSuperior-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'LT Superior'; font-weight: 700; font-style: normal; font-display: swap; src: url('/fonts/LTSuperior-Bold.woff2') format('woff2'); }
@font-face { font-family: 'LT Superior'; font-weight: 800; font-style: normal; font-display: swap; src: url('/fonts/LTSuperior-ExtraBold.woff2') format('woff2'); }

:root {
  /* Brand palette (design system tokens/colors.css) */
  --royal-900: #001a33; --royal-800: #002b52; --royal-700: #003a70; --royal-400: #3f86c4; --royal-50: #f1f6fb;
  --grey-900: #1c1f22; --grey-700: #44494d; --grey-600: #5e646a; --grey-500: #7c8186; --grey-400: #a0a0a0;
  --grey-300: #c4c7c9; --grey-200: #dfe1e3; --grey-100: #eef0f1; --grey-50: #f6f7f8; --white: #ffffff;
  --blue-700: #0f6f9c; --blue-100: #e3f4fb;
  --clay-600: #a8452a; --clay-500: #c25131; --clay-100: #f7e6e0;
  --green-600: #2f8a4e; --green-100: #e3f2e8; --amber-600: #c98a16; --amber-100: #fbf0d6;
  --red-600: #c23a32; --red-100: #fbe5e3;

  /* Roles */
  --page: var(--grey-50); --card: var(--white); --sunken: var(--grey-100);
  --strong: var(--grey-900); --body: var(--grey-700); --muted: var(--grey-500); --chev: var(--grey-400);
  --border: var(--grey-200); --border-2: var(--grey-300);
  --brand: var(--royal-700); --brand-hover: var(--royal-800); --on-brand: var(--white); --brand-soft: var(--royal-50);
  --accent: var(--clay-500); --accent-2: var(--clay-600);
  --late-bg: var(--clay-100); --late-fg: var(--clay-600);
  --fresh-bg: var(--green-100); --fresh-fg: var(--green-600);
  --mid-bg: var(--royal-50); --mid-fg: var(--royal-700);
  --none-bg: var(--grey-100); --none-fg: var(--grey-600);
  --call-bg: var(--blue-100); --call-fg: var(--blue-700);
  --warn-bg: var(--amber-100); --warn-fg: #7a5000;
  --bad-bg: var(--red-100); --bad-fg: var(--red-600);
  --toast-bg: var(--grey-900); --toast-fg: var(--white);
  --scrim: rgba(0, 26, 51, .45);
  /* Chart series (validated: lightness band, chroma, CVD and contrast on white) */
  --viz-visit: #1665ab; --viz-call: #c25131; --viz-axis: var(--grey-300);
  --shadow-sm: 0 1px 3px rgba(0, 26, 51, .08), 0 1px 2px rgba(0, 26, 51, .04);
  --shadow-md: 0 4px 12px rgba(0, 26, 51, .10);
  --shadow-lg: 0 12px 32px rgba(0, 26, 51, .14);
  --focus: 0 0 0 3px rgba(63, 134, 196, .45);
  --font: 'LT Superior', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b141e; --card: #131f2c; --sunken: #1b2a3a;
    --strong: #eef2f6; --body: #c3ccd6; --muted: #8e9aa7; --chev: #5d6b7a;
    --border: #233446; --border-2: #304559;
    --brand: #3f86c4; --brand-hover: #5a9bd2; --on-brand: #ffffff; --brand-soft: #16304a;
    --accent: #e0805f; --accent-2: #e98f70;
    --late-bg: #3a1d14; --late-fg: #f2a184;
    --fresh-bg: #12301f; --fresh-fg: #7fd09a;
    --mid-bg: #16304a; --mid-fg: #a9cbee;
    --none-bg: #1f2c3a; --none-fg: #a3afbb;
    --call-bg: #0f3346; --call-fg: #8fd3f2;
    --warn-bg: #33270b; --warn-fg: #f2c766;
    --bad-bg: #3a1614; --bad-fg: #ff9d93;
    --toast-bg: #eef2f6; --toast-fg: #0b141e;
    --scrim: rgba(0, 0, 0, .55);
    --viz-visit: #3f86c4; --viz-call: #c25131; --viz-axis: #304559; /* validated on #131f2c */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 4px 12px rgba(0, 0, 0, .45); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--body); }
body { font-family: var(--font); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); }
:focus-visible { outline: none; box-shadow: var(--focus); }
[hidden] { display: none !important; }
h1, h2 { margin: 0; color: var(--strong); }
.ic { width: 20px; height: 20px; flex: none; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.center { text-align: center; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; }
@media (min-width: 520px) { .app { border-inline: 1px solid var(--border); } }
main { padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
.page { padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 8px; display: flex; flex-direction: column; gap: 16px; }

/* Title block */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-top: 8px; }
.head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.head h1, h1.title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
h1.title { font-size: 26px; line-height: 1.15; text-wrap: pretty; overflow-wrap: anywhere; }
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.logo img { display: block; height: 30px; width: auto; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hello { margin: -8px 0 0; font-size: 15px; color: var(--muted); }

.signal { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.signal .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fresh-fg); }
.signal.busy .dot { background: var(--brand); }
.signal.off { background: var(--warn-bg); border-color: transparent; color: var(--warn-fg); }
.signal.off .dot { background: var(--amber-600); }

.backbar { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.backlink { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 10px 0 0; border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--brand); }
.backlink .ic { width: 22px; height: 22px; }

/* Sections, lists and rows */
.section { display: flex; flex-direction: column; gap: 8px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label .count { letter-spacing: .04em; }
.list { background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.empty { margin: 0; padding: 22px 16px; text-align: center; font-size: 14px; color: var(--muted); }
.emptycard { background: var(--card); border: 1px dashed var(--border-2); border-radius: 16px; padding: 22px 18px; text-align: center; display: grid; gap: 6px; }
.emptycard p { margin: 0; color: var(--strong); font-weight: 600; }
.emptycard .hint { font-weight: 400; color: var(--muted); }

.crow, .arow, .prow { width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 0; border-top: 1px solid var(--border); background: transparent; text-align: left; color: inherit; text-decoration: none; }
.arow, .prow { gap: 12px; padding: 12px 14px; }
.list > :first-child { border-top: 0; }
.crow:active, .arow:active { background: var(--sunken); }
@media (hover: hover) { button.crow:hover, button.arow:hover { background: var(--grey-50); } }
@media (hover: hover) and (prefers-color-scheme: dark) { button.crow:hover, button.arow:hover { background: var(--sunken); } }
.arow.top { align-items: flex-start; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.crow .t { font-size: 16px; font-weight: 700; color: var(--strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arow .t, .prow .t { font-size: 15px; font-weight: 600; color: var(--strong); overflow-wrap: anywhere; }
.main .s { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.main .s.reason { color: var(--bad-fg); font-weight: 600; }
.crow .l { font-size: 13px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 18px; height: 18px; color: var(--chev); }

/* "Days since" badge */
.dtile { flex: none; width: 54px; height: 54px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; text-align: center; }
.dtile .n { font-size: 21px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.dtile .u { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.1; padding: 0 2px; }
.t-late { background: var(--late-bg); color: var(--late-fg); }
.t-fresh { background: var(--fresh-bg); color: var(--fresh-fg); }
.t-mid { background: var(--mid-bg); color: var(--mid-fg); }
.t-none { background: var(--none-bg); color: var(--none-fg); }

.flag { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent-2); }
.flag .ic { width: 16px; height: 16px; }

/* Search and chips */
.search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; background: var(--card); border: 1px solid var(--border-2); border-radius: 12px; }
.search .ic { width: 18px; height: 18px; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--strong); }
.search:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.spaced { margin-top: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--border-2); background: var(--card); color: var(--strong); font-size: 14px; font-weight: 600; }
.chip.sm { height: 34px; padding: 0 12px; font-size: 13px; border-width: 1px; }
.chip[aria-pressed="true"], .chip.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.datechip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--card); color: var(--strong); font-size: 15px; font-weight: 700; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
@media (hover: hover) { .btn.primary:hover { background: var(--brand-hover); } }
.btn.lg { min-height: 52px; font-size: 16px; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad-fg); }
.btn.primary.danger { color: var(--on-brand); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn .ic { width: 18px; height: 18px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand); font-size: inherit; font-weight: 600; }
.linkish.more { align-self: flex-start; font-size: 14px; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qbtn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 56px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-sm); color: var(--brand); font-size: 15px; font-weight: 700; }
.qbtn:first-child { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.qbtn:active { transform: translateY(1px); }

/* Banners and pills */
.banner { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--mid-bg); color: var(--mid-fg); text-align: left; font-size: 14px; font-weight: 600; }
.banner span:first-child { flex: 1; }
.banner.bad { background: var(--bad-bg); color: var(--bad-fg); }
.banner.warn { background: var(--warn-bg); color: var(--warn-fg); }
.pill { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
.p-fail { background: var(--bad-bg); color: var(--bad-fg); }
.p-send { background: var(--mid-bg); color: var(--mid-fg); }
.p-wait { background: var(--warn-bg); color: var(--warn-fg); }
.p-ok { background: var(--fresh-bg); color: var(--fresh-fg); }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.err { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--bad-fg); }

/* Customer */
.cust-head { display: flex; flex-direction: column; gap: 6px; }
.addr { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; }
.addr .ic { width: 16px; height: 16px; margin-top: 2px; color: var(--brand); }
.addr span { text-decoration: underline; text-decoration-color: var(--border-2); text-underline-offset: 3px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { padding: 14px; border-radius: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile.plain { background: var(--card); border: 1px solid var(--border); }
.tile .k { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tile.plain .k { color: var(--muted); }
.tile .big { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; overflow-wrap: anywhere; }
.tile.plain .big { color: var(--strong); }
.tile .big.mono { font-size: 24px; }
.tile .sub { font-size: 13px; font-weight: 500; }
.tile.plain .sub { color: var(--body); }
.avatar { flex: none; width: 38px; height: 38px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.avatar .ic { width: 17px; height: 17px; }
.callbtn { flex: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.callbtn .ic { width: 18px; height: 18px; }
.callbtn[disabled] { opacity: .4; }

/* Activity type dots and the history timeline */
.tdot { flex: none; width: 36px; height: 36px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--none-bg); color: var(--none-fg); }
.tdot .ic { width: 16px; height: 16px; }
.ty-visit, .ty-siteVisit { background: var(--brand); color: var(--on-brand); }
.ty-phoneCall { background: var(--call-bg); color: var(--call-fg); }
.ty-complaint { background: var(--late-bg); color: var(--late-fg); }
.ty-meeting, .ty-productDiscussion, .ty-training, .ty-salesQuote, .ty-priceEnquiry { background: var(--mid-bg); color: var(--mid-fg); }
.timeline { display: flex; flex-direction: column; }
.titem { display: flex; gap: 12px; }
.rail { flex: none; width: 36px; display: flex; flex-direction: column; align-items: center; }
.rail .line { flex: 1; width: 2px; background: var(--border); }
.titem.last .rail .line { opacity: 0; }
.tbody { flex: 1; min-width: 0; padding: 6px 0 18px; display: flex; flex-direction: column; gap: 3px; }
.trow { display: flex; justify-content: space-between; gap: 8px; }
.trow .t { font-size: 15px; font-weight: 700; color: var(--strong); }
.trow .when { font-size: 13px; color: var(--muted); white-space: nowrap; }
.tbody .s { font-size: 13.5px; color: var(--body); overflow-wrap: anywhere; }
.tstate { margin-top: 2px; }
.erow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); }
.erow .t { font-size: 15px; font-weight: 600; color: var(--strong); overflow-wrap: anywhere; }
.price { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.price .net { font-size: 16px; font-weight: 800; color: var(--strong); font-variant-numeric: tabular-nums; }
.price .disc { font-size: 12px; color: var(--muted); }
.price .quoted { margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--fresh-bg); color: var(--fresh-fg); font-size: 11px; font-weight: 700; }
.by { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin: 1px 0; padding: 2px 9px 2px 7px; border-radius: 999px; background: var(--late-bg); color: var(--late-fg); font-size: 12.5px; font-weight: 700; }
.by .ic { width: 13px; height: 13px; }
.by.me { background: var(--mid-bg); color: var(--mid-fg); }
.tsum { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--body); text-wrap: pretty; overflow-wrap: anywhere; }
.tnotes { margin-top: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.tnotes summary { list-style: none; cursor: pointer; padding: 8px 12px; font-size: 13px; font-weight: 600; color: var(--brand); }
.tnotes summary::-webkit-details-marker { display: none; }
.tnotes summary::after { content: ' +'; }
.tnotes[open] summary::after { content: ' −'; }
.tnote { padding: 0 12px 10px; }
.tnote .k { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tnote p { margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: var(--body); white-space: pre-line; overflow-wrap: anywhere; }

/* Log sheet */
body.sheet-open { background: var(--scrim); }
body.sheet-open .app { background: var(--scrim); }
.sheet { min-height: 100vh; margin-top: calc(18px + env(safe-area-inset-top, 0px)); background: var(--card); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); padding: 10px 20px calc(28px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 18px; animation: sheet-in 240ms cubic-bezier(.2, .8, .2, 1); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
body.sheet-open main { padding-bottom: 0; }
.grab { align-self: center; width: 40px; height: 5px; border-radius: 999px; background: var(--border-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.close { flex: none; width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--sunken); color: var(--body); display: flex; align-items: center; justify-content: center; }
.close .ic { width: 18px; height: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.flabel { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.flabel .opt { font-weight: 500; letter-spacing: 0; text-transform: none; }
.input, .select { width: 100%; height: 48px; padding: 0 12px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--card); font-size: 16px; color: var(--strong); }
.select { font-weight: 600; color: var(--muted); }
.select.on { border: 1.5px solid var(--brand); background: var(--brand); color: var(--on-brand); }
.input:focus, .select:focus, .note-box textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.pickbox { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 14px; border: 1px solid var(--border-2); border-radius: 12px; background: var(--card); text-align: left; }
.pickbox .t { font-size: 16px; font-weight: 700; color: var(--strong); }
.pickbox.empty { border-style: dashed; color: var(--brand); }
.pickbox.empty .t { color: var(--brand); }
.pickbox .change { font-size: 14px; font-weight: 600; color: var(--brand); }
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type { height: 64px; border-radius: 12px; border: 1.5px solid var(--border-2); background: var(--card); color: var(--strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 14px; font-weight: 700; }
.type[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.note-box { border: 1px solid var(--border-2); border-radius: 12px; overflow: hidden; background: var(--card); }
.note-box > button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 0; background: transparent; text-align: left; color: var(--strong); }
.note-box.open > button { background: var(--sunken); }
.note-box .ic { width: 18px; height: 18px; color: var(--muted); }
.note-box .brand { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.mic { font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.note-box textarea { display: block; width: 100%; min-height: 120px; padding: 12px 14px; border: 0; border-top: 1px solid var(--border); background: var(--card); font-size: 16px; color: var(--strong); resize: vertical; }
.fu-box { border-radius: 12px; background: var(--sunken); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.fu-date { font-size: 17px; font-weight: 800; color: var(--strong); }
.save-bar { position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 2; }
.save-bar .btn { box-shadow: var(--shadow-md); }
.confirm { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bad-bg); color: var(--bad-fg); font-size: 14px; font-weight: 600; margin-top: 6px; }
.confirm .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Analytics: week card on Today, Insights screen */
.weekcard { width: 100%; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); text-align: left; color: inherit; }
.wc-head { display: flex; align-items: center; justify-content: space-between; }
.wstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wstat { display: flex; flex-direction: column; gap: 1px; }
.wstat .v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--strong); font-variant-numeric: tabular-nums; }
.wstat .k { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wstat .d { font-size: 12.5px; color: var(--body); font-variant-numeric: tabular-nums; }
.chartcard { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.chartbox { position: relative; }
.wchart { display: block; width: 100%; height: auto; }
.wchart .axis { stroke: var(--viz-axis); stroke-width: 1; }
.bar-v { fill: var(--viz-visit); }
.bar-c { fill: var(--viz-call); }
.wchart .bar-v, .wchart .bar-c { opacity: .55; }
.wchart .on { opacity: 1; }
.wchart .lbl { font-size: 10px; fill: var(--muted); }
.wchart .lbl.on { fill: var(--strong); font-weight: 700; }
.wchart .val { font-size: 11px; font-weight: 700; fill: var(--strong); }
.hits { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); }
.hits button { border: 0; background: transparent; border-radius: 8px; }
.hits button:focus-visible { box-shadow: var(--focus); }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--body); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-v { background: var(--viz-visit); }
.sw-c { background: var(--viz-call); }
.reprow { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-top: 1px solid var(--border); background: transparent; text-align: left; color: inherit; }
.list > .reprow:first-child { border-top: 0; }
.reprow .t { font-size: 15px; font-weight: 700; color: var(--strong); }
.repbar { display: block; width: 100%; height: 8px; margin: 3px 0 2px; border-radius: 4px; background: var(--sunken); }

/* Sign-in */
.signin { min-height: 100vh; justify-content: center; gap: 14px; padding-bottom: 60px; }
.signin .logo img { height: 46px; margin-bottom: 12px; }
.signin h1 { font-size: 36px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.lead { margin: 0 0 8px; font-size: 16px; color: var(--body); }

/* Tab bar with the round log button */
nav.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(480px, 100%); z-index: 6; display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: center; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); background: var(--card); border-top: 1px solid var(--border); }
.tab { position: relative; height: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: transparent; color: var(--grey-500); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.tab .ic { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--brand); }
.fab { width: 60px; height: 60px; margin: -26px 8px 0; border-radius: 999px; border: 4px solid var(--card); background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); }
.fab .ic { width: 26px; height: 26px; }
.fab:active { transform: translateY(1px); }
@media (hover: hover) { .fab:hover { background: var(--brand-hover); } }
.badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--amber-600); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: 0; display: grid; place-items: center; }
.badge.bad { background: var(--clay-500); }

.toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(440px, calc(100% - 40px)); z-index: 9; display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--toast-bg); color: var(--toast-fg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toast-in 180ms var(--ease); }
.toast .ic { width: 18px; height: 18px; color: #7fd09a; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.noscript { padding: 16px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
