/* Voltmech Sales CRM. Colours and sizes from docs/DESIGN.md. Prepared by Team ScalAct. */
:root {
  --bg: #FAF8F5; --card: #FFFFFF; --line: #E6E3DE; --line-strong: #DCD9D4;
  --ink: #1B1D20; --ink-2: #5E6166;
  --side: #2A2D31; --side-ink: #E6E3DE; --side-active: #3D4147;
  --orange: #F49A21; --orange-ink: #8F5306; --dark: #3D4147;
  --red-bg: #FDECEA; --red: #A32A1D; --amber-bg: #FFF3D6; --amber: #7A5200;
  --blue-bg: #E8F0FB; --blue: #1F4E8C; --green-bg: #E6F4EA; --green: #1E6B3A; --green-bar: #3E8E5A;
  --grey-bg: #EEECE8; --grey: #4A4D52;
  --next-bg: #FFFBF0; --next-line: #E3B04B;
  --chart: #2a78d6; --chart-track: #EEF1F5;
  --font: 'Libre Franklin', 'Noto Sans Devanagari', 'Noto Sans Gujarati', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}
html[lang="hi"] { --font: 'Noto Sans Devanagari', 'Libre Franklin', system-ui, sans-serif; }
html[lang="gu"] { --font: 'Noto Sans Gujarati', 'Libre Franklin', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.4; }
a { color: var(--blue); }
h1 { font-size: 30px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 20px; margin: 0 0 12px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.sub, .muted { color: var(--ink-2); font-size: 14px; }
.mono { font-family: var(--mono); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* Layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: 0 0 232px; background: var(--side); color: var(--side-ink); padding: 20px 12px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 700; letter-spacing: .08em; color: #fff; padding: 0 12px 2px; font-size: 18px; }
.brand-sub { color: var(--side-ink); font-size: 14px; padding: 0 12px 16px; opacity: .8; }
.side a { color: var(--side-ink); text-decoration: none; padding: 10px 12px; border-radius: 8px; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side a:hover { background: #34383d; }
.side a.active { background: var(--side-active); color: #fff; }
.side .count { background: var(--orange); color: #2A2D31; border-radius: 999px; font-size: 13px; padding: 0 8px; font-weight: 600; }
.main { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.topbar .who { color: var(--ink-2); font-size: 14px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.grid { display: grid; gap: 20px; align-items: start; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tile .k { color: var(--ink-2); font-size: 14px; }
.tile .v { font-size: 34px; font-weight: 600; line-height: 1.15; margin: 4px 0 2px; }
.tile .s { color: var(--ink-2); font-size: 14px; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }

/* Buttons & inputs */
button, .btn { font: inherit; font-size: 16px; min-height: 44px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .btn:hover { border-color: #b9b5ae; }
button:disabled { opacity: .5; cursor: not-allowed; }
.primary { background: var(--orange); border-color: var(--orange); color: #2A2D31; font-weight: 600; }
.dark-btn { background: var(--dark); border-color: var(--dark); color: #fff; }
.approve { background: var(--green); border-color: var(--green); color: #fff; }
.danger { background: var(--red-bg); border-color: #f3c3bd; color: var(--red); }
.link-btn { background: none; border: none; color: var(--blue); padding: 0 4px; min-height: 44px; text-decoration: underline; }
.small { min-height: 36px; padding: 4px 12px; font-size: 14px; }
label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #f7c37a; outline-offset: 1px; }
.field { margin-bottom: 12px; }
.fields { display: grid; gap: 0 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields .full { grid-column: 1 / -1; }
.req::after { content: ' *'; color: var(--red); }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 44px; color: var(--ink); font-size: 16px; margin: 0; cursor: pointer; }
.check:last-child { border-bottom: none; }
.check input { width: 22px; height: 22px; min-height: 22px; margin: 1px 0 0; flex: 0 0 22px; accent-color: var(--green); }
.check .by { color: var(--ink-2); font-size: 14px; display: block; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: none; border-radius: 0; min-height: 40px; }
.seg button.on { background: var(--dark); color: #fff; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; min-width: 150px; }
.filters .grow { flex: 1; min-width: 200px; }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 14px; white-space: nowrap; font-weight: 500; }
.p-red { background: var(--red-bg); color: var(--red); }
.p-amber { background: var(--amber-bg); color: var(--amber); }
.p-blue { background: var(--blue-bg); color: var(--blue); }
.p-green { background: var(--green-bg); color: var(--green); }
.p-grey { background: var(--grey-bg); color: var(--grey); }
.p-orange { background: #FDEBD2; color: var(--orange-ink); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.guide { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--ink-2); }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 14px; border-bottom: 1px solid var(--line-strong); padding: 8px 10px; white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 10px; vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #FBFAF8; }
td.r, th.r { text-align: right; }
td .muted { display: block; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--line); padding: 10px 0; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.list li:last-child { border-bottom: none; }
.list a { text-decoration: none; color: var(--ink); font-weight: 600; }
.list .meta { color: var(--ink-2); font-size: 14px; }

/* Insights */
.insights { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.insight { display: grid; grid-template-columns: 6px 1fr; gap: 12px; padding: 12px 14px 12px 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.insight .bar { border-radius: 10px 0 0 10px; }
.insight.red .bar { background: var(--red); } .insight.amber .bar { background: #C98A00; }
.insight.green .bar { background: var(--green-bar); } .insight.info .bar { background: #9AA0A8; }
.insight .say { font-weight: 600; }
.insight .do { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.insight .tag { margin-right: 6px; }

/* Bar charts: single series, one hue, thin bars, rounded data-end, value at the tip. */
.bars { display: grid; gap: 12px; }
.bars .b { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; font-size: 14px; }
.list .num { white-space: nowrap; }
.bars .b .name { overflow-wrap: anywhere; }
.bars .b .bh { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.bars .b .track { display: block; min-width: 0; }
.bars .b .fill { display: block; height: 14px; background: var(--chart); border-radius: 0 4px 4px 0; min-width: 2px; }
.bars .b .val { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.bars .b .val .muted { display: inline; font-size: 13px; font-weight: 400; }
.bars .b:hover .fill, .bars .b:focus .fill { background: #1c5cab; }
.bars .b:focus { outline: 3px solid #f7c37a; border-radius: 4px; }

/* SVG charts */
.chart { width: 100%; min-height: 40px; }
.chart svg { display: block; overflow: visible; }
.chart .mark { cursor: default; outline: none; }
.chart .mark .hair { opacity: 0; }
.chart .mark:hover .hair, .chart .mark:focus .hair { opacity: 1; }
.chart .mark:focus rect:first-child { stroke: #f7c37a; stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.legend i, .chart-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; }
.chart-tip { position: absolute; z-index: 60; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px;
  font-size: 14px; box-shadow: 0 2px 8px rgba(0,0,0,.08); pointer-events: none; display: grid; gap: 2px; max-width: 260px; }
.chart-table { margin-top: 6px; }
.meter { display: block; height: 10px; background: #DCE8F8; border-radius: 999px; overflow: hidden; flex: 1; min-width: 60px; }
.meter > span { display: block; height: 100%; background: var(--chart); border-radius: 999px; }
.meter.big { height: 12px; }
.meter-row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr 64px; gap: 10px; align-items: center; font-size: 14px; margin: 6px 0; }
.meter-row .mv { text-align: right; }
.live { display: inline-flex; align-items: center; gap: 6px; }
.live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green-bar); }

/* Pipeline board */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
.col { flex: 0 0 272px; background: #F3F1EE; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.col-head .t { font-weight: 600; }
.col-head .done { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.dcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-decoration: none; color: var(--ink); display: block; }
.dcard:hover { border-color: #c9c4bc; }
.dcard .client { font-weight: 600; margin: 6px 0 2px; }
.dcard .meta { color: var(--ink-2); font-size: 14px; }
.dcard .nx { font-size: 14px; margin-top: 6px; }

/* Deal page */
.progress { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.progress .s { height: 10px; border-radius: 3px; background: var(--grey-bg); }
.progress .s.done { background: var(--green-bar); }
.progress .s.now { background: var(--orange); }
.progress-labels { display: flex; justify-content: space-between; color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.nextbox { background: var(--next-bg); border: 2px solid var(--next-line); border-radius: 12px; padding: 16px 20px; }
.nextbox .t { font-size: 14px; color: var(--amber); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.banner { border-radius: 10px; padding: 12px 16px; }
.banner.red { background: var(--red-bg); color: var(--red); } .banner.amber { background: var(--amber-bg); color: var(--amber); }
.banner.green { background: var(--green-bg); color: var(--green); } .banner.grey { background: var(--grey-bg); color: var(--grey); }
.banner.blue { background: var(--blue-bg); color: var(--blue); }
.missing { margin: 8px 0 0; padding-left: 20px; color: var(--amber); font-size: 15px; }
.rev { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.rev + .rev { margin-top: 10px; }
.rev.superseded { opacity: .65; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: none; }
.timeline .when { color: var(--ink-2); font-size: 14px; }
.timeline .sys { color: var(--ink-2); }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--blue); }

/* Login */
.login { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.login .brand { color: var(--ink); padding: 0; font-size: 24px; }
.login .card { margin-top: 16px; }
.err { color: var(--red); font-size: 15px; min-height: 22px; margin: 4px 0 8px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); font-size: 15px; }
.toast.bad { background: var(--red); }

/* Bottom bar and "More" sheet (phones only) */
.bottom, .brand-mobile { display: none; }
.sheet { position: fixed; left: 0; right: 0; bottom: 64px; background: #fff; border-top: 1px solid var(--line-strong); padding: 16px; z-index: 40;
  box-shadow: 0 -4px 16px rgba(0,0,0,.08); max-height: 70vh; overflow-y: auto; }
.sheet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.sheet-grid a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.sheet-grid a.active { background: var(--side-active); color: #fff; }
.bell { position: relative; }
.bell .count, .bottom .count, .sheet-grid .count { background: var(--orange); color: #2A2D31; border-radius: 999px; font-size: 12px; padding: 0 7px; font-weight: 700; margin-left: 4px; }

/* Dialogs */
.dlg { border: 1px solid var(--line-strong); border-radius: 14px; padding: 20px; max-width: min(520px, calc(100vw - 32px)); width: 100%; }
.dlg::backdrop { background: rgba(27, 29, 32, .45); }
.dlg-actions { justify-content: flex-end; margin-top: 12px; }
.date-hint { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; margin-bottom: 16px; }
.tabs button { border: none; border-bottom: 3px solid transparent; border-radius: 0; background: none; white-space: nowrap; min-height: 44px; }
.tabs button.on { border-bottom-color: var(--orange); font-weight: 600; }
th.sort { cursor: pointer; user-select: none; }
th.sort::after { content: ' ↕'; color: #b5b1aa; }
th.sort.asc::after { content: ' ↑'; color: var(--ink); } th.sort.desc::after { content: ' ↓'; color: var(--ink); }
.cards { display: none; }
.dcard-list .dcard + .dcard { margin-top: 10px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a { display: block; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.week { width: 100%; }
.week td.missing { background: var(--red-bg); }
.print-only { display: none; }
@media print {
  .side, .bottom, .topbar, .no-print, .sheet { display: none !important; }
  .main { padding: 0; } body { background: #fff; } .card { break-inside: avoid; border-color: #ccc; }
  .print-only { display: block; }
}

/* Phone */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { display: none; }
  .brand-mobile { display: inline; font-weight: 700; letter-spacing: .08em; margin-right: 8px; color: var(--ink); }
  .who-name { display: none; }
  .desk-only { display: none !important; }
  .topbar { position: sticky; top: 0; background: var(--bg); z-index: 20; padding: 8px 0; margin-bottom: 8px; }
  .bottom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; height: 64px; background: var(--side); z-index: 41; }
  .bottom a, .bottom button { color: var(--side-ink); text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 14px;
    background: none; border: none; border-radius: 0; min-height: 64px; padding: 4px; text-align: center; }
  .bottom a.active { background: var(--side-active); color: #fff; }
  .main { padding: 8px 16px 96px; }
  .cards { display: block; }
  .table-only { display: none; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .score-grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 26px; }
  .tile .v { font-size: 28px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==== v0.3: conversations, My day agenda, tasks, timesheet, alerts ==================================== */
.narrow { max-width: 920px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h-small { font-size: 15px; font-weight: 600; color: var(--ink-2); text-transform: none; margin: 0 0 8px; }
.card.flat { padding: 16px 20px; }
.empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 28px 20px; text-align: center; color: var(--ink-2); background: transparent; }
.empty p { margin: 0; }
.stamp { color: var(--ink-2); font-size: 13px; }
.stamps { margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; }
.stamps .link-btn { min-height: 28px; font-size: 13px; }
.late { color: var(--red); font-weight: 500; }
.warn { color: var(--amber); font-weight: 600; }
.ghost { background: transparent; }
.danger-link { color: var(--red); }
.nowrap { flex-wrap: nowrap; }
.list.compact li { padding: 6px 0; }
.btn.small, button.small { gap: 4px; }
.seg button.small { min-height: 36px; }
.toolbar { gap: 8px; }

/* My day: today is the loud part, the next two days are quiet */
.today-page .section-head { margin-bottom: 4px; }
.agenda-now .ag-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.ag { display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ag:last-child { border-bottom: none; }
.ag-kind { align-self: stretch; border-radius: 3px; background: var(--chart); }
.ag-kind.task { background: var(--orange); }
.ag.is-late .ag-kind { background: var(--red); }
.ag-title { font-weight: 600; font-size: 17px; line-height: 1.3; }
.ag .meta { color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.ag .meta a { color: var(--ink-2); }
.ag-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.agenda-later { padding: 0 4px; }
.agenda-later h3 { font-size: 14px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; display: flex; gap: 8px; }
.agenda-later h3 span { font-weight: 400; }
.agenda-later ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.agenda-later li a { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; padding: 6px 12px; color: var(--ink-2); text-decoration: none; font-size: 15px; min-height: 36px; align-items: center; }
.agenda-later li a:hover { background: #F3F1ED; color: var(--ink); }
.agenda-later .t { font-variant-numeric: tabular-nums; }
.agenda-later .c { font-size: 13px; text-align: right; }
.agenda-later .quiet { margin: 0; padding: 4px 12px; color: var(--ink-2); font-size: 14px; border-left: 2px solid var(--line); }
.more-box { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 4px 16px; }
.more-box > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--ink-2); font-weight: 500; }
.more-group { padding: 8px 0 12px; border-top: 1px solid var(--line); }
.more-group h3 { font-size: 14px; color: var(--ink-2); margin: 4px 0; }

/* Tasks */
.list.tasks li.tk { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: start; }
.tk .tick input { width: 22px; height: 22px; min-height: 22px; margin-top: 2px; accent-color: var(--green); }
.tk-title { font-weight: 600; }
.tk.is-done .tk-title { text-decoration: line-through; color: var(--ink-2); font-weight: 500; }
.tk-actions { display: flex; gap: 4px; }
.tk-actions .link-btn { min-height: 32px; font-size: 14px; }

/* Conversations */
.timeline li.conv .when strong { color: var(--ink); font-weight: 600; }
.timeline .said, .last-note .said { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.timeline li.sysrow { padding: 6px 0; }
.timeline li.sysrow .sys { font-size: 14px; }

/* Notifications */
.list.notif li { justify-content: flex-start; }
.list.notif .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; background: transparent; }
.list.notif li.unread .dot { background: var(--orange); }
.list.notif li.unread a { font-weight: 600; }
.list.notif li:not(.unread) a { font-weight: 400; }
.list.notif-open > li.nt-group { display: block; }
.nt-group summary { cursor: pointer; padding: 8px 0 8px 16px; min-height: 44px; }
.nt-group > button.link-btn { margin-left: 16px; min-height: 44px; }

/* Timesheet: day */
.ts-head { display: grid; grid-template-columns: 1fr minmax(220px, 300px); gap: 16px; align-items: center; }
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav button { min-width: 40px; font-size: 20px; }
.date-pick { position: relative; display: flex; flex-direction: column; margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; cursor: pointer; padding: 0 6px; }
.date-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ts-progress .big { font-size: 28px; font-weight: 600; }
.ts-progress .big span { font-size: 16px; color: var(--ink-2); font-weight: 400; }
.ts-progress .bar { height: 8px; background: var(--chart-track); border-radius: 999px; overflow: hidden; margin: 6px 0 4px; }
.ts-progress .bar span { display: block; height: 100%; border-radius: 999px; background: var(--ink-2); }
.ts-progress.good .bar span { background: var(--green-bar); }
.ts-progress.mid .bar span { background: #D59B1E; }
.ts-progress.low .bar span { background: #C2412D; }
.ts-progress .state { font-size: 14px; color: var(--ink-2); }
.ts-progress.good .state { color: var(--green); }
.ts-progress.low .state { color: var(--red); }
.week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-strip .wd { flex-direction: column; gap: 0; padding: 6px 2px; min-height: 64px; border-radius: 10px; background: var(--card); line-height: 1.2; }
.week-strip .wd .w { font-size: 12px; color: var(--ink-2); }
.week-strip .wd .n { font-size: 17px; font-weight: 600; }
.week-strip .wd .h { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.week-strip .wd.on { border: 2px solid var(--ink); }
.week-strip .wd.b-good .h { color: var(--green); font-weight: 600; }
.week-strip .wd.b-mid .h { color: var(--amber); font-weight: 600; }
.week-strip .wd.b-low .h { color: var(--red); font-weight: 600; }
.week-strip .wd.st-not_filled { border-color: #E9B1A9; }
.week-strip .wd.st-not_filled .h { color: var(--red); font-weight: 700; }
.week-strip .wd.st-sunday, .week-strip .wd.st-holiday, .week-strip .wd.st-leave { background: var(--grey-bg); }
.ts-entries { list-style: none; margin: 0 0 8px; padding: 0; }
.ts-entries li { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.ts-entries li.fix { background: linear-gradient(90deg, var(--red-bg), transparent 40%); }
.ts-entries .tm { font-weight: 600; }
.ts-entries .tm span { display: block; color: var(--ink-2); font-weight: 400; font-size: 13px; }
.ts-entries .acts { display: flex; gap: 2px; }
.ts-entries .acts .link-btn { min-height: 32px; font-size: 14px; }
.ts-add { padding-top: 8px; }
.ts-add .fields { grid-template-columns: 110px 110px repeat(2, minmax(0, 1fr)); }
.ts-add .wide, .dlg .wide { grid-column: 1 / -1; }
.ts-foot .on { background: var(--dark); color: #fff; border-color: var(--dark); }

/* Timesheet: team */
.ts-people th[scope=row] { font-weight: 600; }
.ts-people td.todo { font-size: 14px; color: var(--ink); max-width: 320px; }
.ts-people td.todo.ok { color: var(--green); font-weight: 500; }
.ts-grid { border-collapse: separate; border-spacing: 2px; font-size: 13px; }
.ts-grid th, .ts-grid td { padding: 4px 2px; }
.ts-grid thead th.c { text-align: center; font-weight: 500; color: var(--ink-2); min-width: 40px; }
.ts-grid thead th.c span { display: block; font-size: 11px; }
.ts-grid thead th.hol { color: var(--blue); }
.ts-grid td.c { text-align: center; border-radius: 6px; font-variant-numeric: tabular-nums; min-width: 40px; height: 32px; }
.ts-grid td.c a { color: inherit; text-decoration: none; font-weight: 600; }
.ts-grid td.b-good, .sw.b-good { background: var(--green-bg); color: var(--green); }
.ts-grid td.b-mid, .sw.b-mid { background: var(--amber-bg); color: var(--amber); }
.ts-grid td.b-low, .sw.b-low { background: var(--red-bg); color: var(--red); }
.ts-grid td.st-not_filled, .sw.st-not_filled { background: #fff; color: var(--red); box-shadow: inset 0 0 0 1px #E9B1A9; font-weight: 700; }
.ts-grid td.st-leave, .ts-grid td.st-sunday, .ts-grid td.st-holiday { background: var(--grey-bg); color: var(--ink-2); }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 4px; }
table.custom tr.off input[name=name] { color: var(--ink-2); }

@media (max-width: 900px) {
  .ag { grid-template-columns: 5px 1fr; }
  .ag-actions { grid-column: 2; justify-content: flex-start; }
  .agenda-later li a { grid-template-columns: 56px 1fr; }
  .agenda-later .c { grid-column: 2; text-align: left; }
  .ts-head { grid-template-columns: 1fr; }
  .week-strip { gap: 4px; }
  .ts-entries li { grid-template-columns: 1fr; gap: 4px; }
  .ts-add .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list.tasks li.tk { grid-template-columns: 32px 1fr; }
  .tk-actions { grid-column: 2; }
}
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { min-height: 32px; padding: 2px 10px; font-size: 13px; border-radius: 999px; background: var(--card); color: var(--ink-2); }
.chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.agenda-later li a { grid-template-columns: 76px 1fr auto; }
.agenda-later .t { white-space: nowrap; }
.ts-add .half, .dlg .half { grid-column: span 2; }
@media (max-width: 900px) { .ts-add .half { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .ts-people .opt { display: none; }
  .date-nav button { min-height: 44px; min-width: 44px; }
  .ts-entries .acts .link-btn, .tk-actions .link-btn, .stamps .link-btn { min-height: 40px; }
  .agenda-later li a { min-height: 44px; }
}

/* ==== v0.4: grouped menu, photos, profile, check-in summary ==================================== */
.side { overflow-y: auto; position: sticky; top: 0; height: 100vh; gap: 2px; }
.me-chip { display: flex !important; align-items: center; justify-content: flex-start !important; gap: 10px; padding: 8px 10px !important; margin: 0 0 8px; border-radius: 10px; background: #34383d; }
.me-chip span { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.me-chip strong { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-chip small { color: var(--side-ink); opacity: .75; font-size: 12px; }
.ng { margin-top: 2px; }
.ng-h { width: 100%; background: none; border: none; color: #A9ADB3; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  min-height: 34px; padding: 6px 12px; justify-content: space-between; border-radius: 8px; }
html[lang="hi"] .ng-h, html[lang="gu"] .ng-h { text-transform: none; letter-spacing: 0; font-size: 13px; }
.ng-h:hover:not(:disabled) { background: #34383d; color: #fff; }
.ng-h .chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin-right: 4px; }
.ng.open .ng-h .chev { transform: rotate(45deg); }
.ng-b { display: none; flex-direction: column; gap: 2px; padding-bottom: 4px; }
.ng.open .ng-b { display: flex; }
.side .ng-b > a { min-height: 40px; padding: 8px 12px 8px 16px; }
.sheet-group h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 12px 0 6px; }
.sheet-group:first-child h3 { margin-top: 0; }
.av { border-radius: 50%; object-fit: cover; flex: 0 0 auto; display: inline-block; background: var(--grey-bg); }
.av-i { display: inline-flex; align-items: center; justify-content: center; background: #E7E1D7; color: #5A4A2E; font-weight: 600; }
.pf-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pf-photo { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pf-upload { cursor: pointer; }
.ci-list { list-style: none; margin: 8px 0; padding: 0; max-height: 50vh; overflow: auto; }
.ci-list li { display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ci-list li.late .num { color: var(--red); font-weight: 600; }
/* Dashboard: greeting, filters and tabs in one bar that stays at the top while scrolling */
.dash-bar { position: sticky; top: 0; z-index: 5; background: var(--bg); display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: end; padding-top: 4px; margin-top: -4px; }
.dash-bar .tabs { grid-column: 1 / -1; margin-bottom: 0; }
.dash-title h1 { margin: 0; }
.dash-title .sub { margin: 2px 0 0; }
.dash-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.dash-filters select { min-height: 36px; padding: 4px 10px; font-size: 14px; }
.tile-link { position: relative; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tile-link:hover { border-color: #C9C4BC; box-shadow: 0 2px 10px rgba(0,0,0,.06); transform: translateY(-1px); }
.tile-link .go { position: absolute; right: 14px; top: 14px; color: var(--ink-2); opacity: 0; transition: opacity .15s; }
.tile-link:hover .go, .tile-link:focus-visible .go { opacity: 1; }
.guide-toggle > summary { cursor: pointer; color: var(--ink-2); font-size: 14px; min-height: 36px; display: inline-flex; align-items: center; }
@media (max-width: 900px) { .dash-bar { grid-template-columns: 1fr; position: static; } .dash-filters { justify-content: flex-start; } }
@media (prefers-reduced-motion: reduce) { .tile-link, .tile-link .go { transition: none; } .tile-link:hover { transform: none; } }
/* Quick search */
.qs-btn { gap: 8px; color: var(--ink-2); min-width: 44px; }
.qs-btn kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; color: var(--ink-2); }
.qs-ico { width: 14px; height: 14px; border: 2px solid currentColor; border-radius: 50%; position: relative; display: inline-block; }
.qs-ico::after { content: ''; position: absolute; width: 2px; height: 7px; background: currentColor; right: -4px; bottom: -6px; transform: rotate(-45deg); }
dialog.qs { width: min(640px, calc(100vw - 32px)); padding: 0; margin-top: 10vh; border-radius: 14px; }
.qs-box { padding: 12px; }
.qs-box input { font-size: 18px; min-height: 52px; }
.qs-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 55vh; overflow: auto; }
.qs-list li { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.qs-list li.on, .qs-list li:hover { background: #F3F1ED; }
.qs-kind { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.qs-main { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qs-right { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.qs-empty { display: block !important; cursor: default; }
.qs-hint { margin: 8px 4px 0; }
@media (max-width: 900px) { .qs-list li { grid-template-columns: 1fr; gap: 2px; } .qs-right { justify-content: flex-start; } }

/* ==== v0.5 design refresh: denser, calmer, less empty space ======================================= */
:root { --bg: #F5F4F1; --card: #FFFFFF; --line: #ECE9E4; --line-strong: #DDD9D2; --ink: #1B1D20; --ink-2: #60646A;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 1px 3px rgba(20, 22, 26, .05); --radius: 12px; }
body { font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1 { font-size: 24px; letter-spacing: -.01em; margin: 0; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; }
.sub, .muted { font-size: 13.5px; }
.stack > * + * { margin-top: 14px; }

/* Shell: slim sticky top bar inside the main column, sidebar a touch narrower */
.side { width: 220px; flex-basis: 220px; padding: 16px 10px 12px; }
.brand { font-size: 16px; padding: 0 10px 0; }
.brand-sub { padding: 0 10px 12px; font-size: 12px; }
.side-foot { margin-top: auto; padding-top: 12px; }
.side-logout { width: 100%; background: transparent; border: 1px solid #464a50; color: var(--side-ink); min-height: 36px; font-size: 14px; }
.side-logout:hover { background: #34383d; color: #fff; }
.main { padding: 0 28px 40px; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(245, 244, 241, .92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  margin: 0 -28px 18px; padding: 10px 28px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; }
.search-field { flex: 1; max-width: 460px; justify-content: flex-start; gap: 10px; min-height: 38px; padding: 6px 12px; background: #fff; border: 1px solid var(--line-strong);
  border-radius: 10px; color: var(--ink-2); font-size: 14px; box-shadow: var(--shadow); }
.search-field:hover { border-color: #C8C3BB; }
.search-field .ph { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-field kbd { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 6px; }
.top-actions { gap: 8px; flex-wrap: nowrap; }
.top-actions .seg button { min-height: 34px; padding: 2px 10px; font-size: 13px; }
.top-actions .btn, .top-actions button { min-height: 38px; }
.btn.icon { padding: 0 10px; min-width: 40px; }
.bell .count { position: absolute; top: -4px; right: -4px; margin: 0; min-width: 18px; text-align: center; line-height: 18px; padding: 0 5px; }

/* Controls */
button, .btn { font-size: 14.5px; min-height: 40px; padding: 7px 14px; border-radius: 9px; }
.small { min-height: 34px; padding: 3px 11px; font-size: 13.5px; }
input, select, textarea { font-size: 15px; min-height: 40px; padding: 7px 11px; border-radius: 9px; }
.field { margin-bottom: 10px; }
label { font-size: 13px; margin-bottom: 3px; }
.primary { box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.primary:hover { background: #EE9012; border-color: #EE9012; }
.ghost { border-color: transparent; }
.ghost:hover { background: #ECE9E4; border-color: transparent; }
.filters { gap: 10px; margin-bottom: 4px; }
.filters .field { min-width: 140px; }

/* Cards, tiles, banners, tables, lists */
.card { border-color: var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.tile { border-color: var(--line); box-shadow: var(--shadow); padding: 12px 14px; }
.tile .k { font-size: 13px; }
.tile .v { font-size: 26px; margin: 2px 0 0; }
.tile .s { font-size: 12.5px; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.banner { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.banner.row { gap: 8px 12px; }
table { font-size: 14px; }
th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; background: #FAF9F7; }
td { padding: 8px 10px; }
tbody tr:hover td { background: #FBFAF8; }
.list li { padding: 8px 0; }
.pill { font-size: 12.5px; padding: 1px 9px; }
.tabs { margin-bottom: 12px; }
.tabs button { min-height: 40px; font-size: 14.5px; padding: 6px 12px; }
.section-head { margin-bottom: 10px; }
.kv { font-size: 14px; gap: 5px 14px; }
.timeline li { padding: 8px 0; }
.insight { padding: 9px 12px 9px 0; }
.empty { padding: 18px 16px; }

/* Page header: title + help on the left, actions on the right, one row */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.page-head .sub { margin: 3px 0 0; }
ol.sub { overflow-wrap: anywhere; } /* set-up steps hold long addresses */
.ph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* The tabs of a page (and the sub-tabs of a tab), drawn by the shell above the screen: see public/js/nav.js */
.pagetabs { display: flex; align-items: center; gap: 2px; padding: 3px; background: #EAE7E2; border-radius: 10px; margin: 0 0 14px; width: fit-content; max-width: 100%; flex-wrap: wrap; }
.pagetabs a { padding: 6px 14px; border-radius: 8px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500; min-height: 34px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pagetabs .pt-name { padding: 0 10px; font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.pagetabs.sub { background: transparent; margin-top: -6px; padding: 0; gap: 6px; }
.pagetabs.sub a { border: 1px solid var(--line-strong); border-radius: 999px; min-height: 32px; padding: 4px 12px; font-size: 13.5px; }
.pagetabs .count { background: #FBE7CC; color: var(--orange-ink); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 0 7px; }
.count[hidden] { display: none !important; }
.pagetabs a:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.pagetabs a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); font-weight: 600; }

/* Two columns on wide screens: the work on the left, a useful side panel on the right */
.narrow { max-width: none; }
.with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.rail { position: sticky; top: 76px; }
.rail-card { padding: 14px 16px; }
.rc-k { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; margin-bottom: 8px; }
.rc-v { font-size: 26px; font-weight: 600; line-height: 1.1; margin-bottom: 8px; }
.rc-v span { font-size: 14px; color: var(--ink-2); font-weight: 400; }
.link-card { display: block; text-decoration: none; color: inherit; }
.link-card:hover { border-color: #C9C4BC; }
.rail .more-group { padding: 6px 0 8px; }
.rail .more-group:first-of-type { border-top: none; padding-top: 0; }
.rail .more-group h3 { margin: 2px 0 2px; }
.rail .list.compact li { padding: 5px 0; font-size: 14px; }
.rail-link { font-size: 14px; padding-left: 4px; }
.later-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.later-grid .agenda-later + .agenda-later { margin-top: 0; }
.steps { padding-left: 18px; margin: 0 0 10px; }
.map-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; margin: 10px 0; }

/* Menu: calmer, two short sections */
.side a { min-height: 38px; padding: 8px 12px; font-size: 14.5px; }
.ng-h { min-height: 30px; }
.side .ng-b > a { padding-left: 12px; }

/* Import */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; padding: 28px 16px; border: 2px dashed var(--line-strong);
  border-radius: var(--radius); background: #fff; cursor: pointer; color: var(--ink); margin: 0; font-size: 15px; }
.dropzone:hover, .dropzone.over, .dropzone:focus-visible { border-color: var(--orange); background: #FFFBF3; }
.dz-ico { font-size: 22px; color: var(--orange); }
.im-counts { margin: 4px 0 10px; }
.im-table { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.im-table th { position: sticky; top: 0; z-index: 1; }
.im-table tr.ims-problem td, .im-table tr.ims-duplicate td { color: var(--ink-2); }
.im-msg { font-size: 13px; color: var(--ink-2); min-width: 180px; }
.im-go { margin-top: 12px; }

@media (max-width: 1200px) {
  .with-rail { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .map-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .main { padding: 0 14px 96px; }
  .topbar { margin: 0 -14px 12px; padding: 8px 14px; gap: 8px; }
  .search-field { min-width: 0; }
  .search-field .ph { font-size: 13px; }
  .later-grid { grid-template-columns: minmax(0, 1fr); }
  button, .btn, input, select { min-height: 44px; }
  .pagetabs { width: auto; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .pagetabs .pt-name { display: none; }
  .pagetabs a, .pagetabs.sub a { flex: 0 0 auto; min-height: 44px; }
  h1 { font-size: 21px; }
}

/* ── v0.6 polish (blast-test round) ───────────────────────── */
/* Board: empty stages fold to a strip so the busy stages get the room. */
.col.empty { flex: 0 0 44px; padding: 10px 0; align-items: center; gap: 8px; background: #F7F6F3; cursor: default; }
.col.empty .vt { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.col { flex-basis: 260px; }
/* Lists: stage on one line. */
.stage-cell { white-space: nowrap; }
.stage-cell b { font-variant-numeric: tabular-nums; margin-right: 2px; }
td.nowrap, th.nowrap { white-space: nowrap; }
/* Bar charts: a visible track so zero reads as an empty bar, not a stray tick. */
.bars .b .track { background: #EEECE8; border-radius: 4px; }
.bars .b .fill { min-width: 0; }
/* Dashboard tiles: rows of equal length (8 tiles = 4 + 4). */
.tiles.t8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1500px) { .tiles.t8 { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tiles.t8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Admin people table: selects wide enough to read. */
.users-table select { min-width: 104px; }
.users-table td { vertical-align: middle; }
/* My day: a free day lists deals that need a next step. */
.gap-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.gap-head + .ag-list { margin-top: 8px; }
/* Phones: search first and full width, the other filters two to a row, so the list starts on the first screen. */
@media (max-width: 700px) {
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  .filters .field, .filters .grow { min-width: 0; }
  .filters .grow { grid-column: 1 / -1; order: -1; }
  .filters .field label { font-size: 12.5px; margin-bottom: 2px; }
  .filters .check { grid-column: 1 / -1; min-width: 0 !important; min-height: 32px; }
  .page-head .ph-actions .btn.small { min-height: 36px; }
}
/* Dashboard filters stay visible under the top bar when scrolling (they hid behind it). */
.dash-bar { top: 59px; z-index: 20; }
@media (max-width: 900px) { .dash-bar { top: 60px; } }
/* Hindi and Gujarati: no capitals or letter-spacing (they break the joined letters and the top line). */
html[lang="hi"] :is(th, .rc-k, .nextbox .t, .sheet-group h3, .qs-kind), html[lang="gu"] :is(th, .rc-k, .nextbox .t, .sheet-group h3, .qs-kind) { letter-spacing: 0; text-transform: none; }
html[lang="hi"] body, html[lang="gu"] body { line-height: 1.6; }
/* Phones: every button, chip and small select is at least 44px tall, as the design rules ask. */
@media (max-width: 900px) {
  .small, .btn.small, button.small, .chip, .dash-filters select, .link-btn { min-height: 44px; }
  .toast { bottom: 84px; }
}
/* A button that is saving looks it. */
button[aria-busy="true"] { opacity: .6; cursor: progress; }
.money-hint { display: block; min-height: 1em; margin-top: 3px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* Phone top bar: search as a round icon button, so it never shrinks to "Ty…". */
@media (max-width: 600px) {
  .search-field { flex: 0 0 auto; width: 44px; min-width: 44px; padding: 0; justify-content: center; }
  .search-field .ph, .search-field kbd { display: none; }
  .topbar .top-actions { margin-left: auto; }
}
/* New lead: three fields to a row on wide screens, so the whole form fits on one screen. */
@media (min-width: 1100px) { .fields.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Deal header value: right-aligned beside the name; on phones it sits under it, left-aligned with its label. */
.deal-value { text-align: right; }
.deal-value .v { font-size: 34px; font-weight: 600; line-height: 1.1; }
@media (max-width: 700px) { .deal-value { text-align: left; margin-top: 8px; } .deal-value .v { font-size: 28px; } }

/* v0.7 orders */
/* ── v0.7 Orders (after a deal is won) ───────────────────────── */
/* Progress: a short bar and "5 of 9". */
.or-prog { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-size: 13.5px; color: var(--ink-2); }
.or-bar { display: inline-block; width: 64px; height: 6px; border-radius: 999px; background: #EEECE8; overflow: hidden; flex: 0 0 64px; }
.or-bar i { display: block; height: 100%; background: #3E8E5A; border-radius: 999px; }
.or-head .pills { margin-bottom: 10px; }
.or-head .or-links { margin: 10px 0 0; }
.or-tiles .tile .s .or-prog { margin-top: 4px; }
.or-pay { font-size: 20px; }
/* Step checklist: one tap on the box ticks the step; the whole box area is a 44px target. */
.list.or-steps li.or-step { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.or-step .tick { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; margin: -6px 0; cursor: pointer; }
.or-step .tick input { width: 22px; height: 22px; min-height: 22px; margin: 0; accent-color: var(--green); cursor: pointer; }
.or-step .tick input:disabled { cursor: default; }
.os-main { padding-top: 4px; min-width: 0; }
.os-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.os-n { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 500; }
.or-step.is-done .os-l, .or-step.is-skipped .os-l { color: var(--ink-2); font-weight: 500; }
.or-step.is-skipped .os-l { text-decoration: line-through; }
.os-actions { display: flex; flex-wrap: wrap; gap: 0 4px; justify-content: flex-end; }
.os-actions .link-btn { min-height: 32px; font-size: 14px; }
/* Upload row under the documents. */
.or-upload { gap: 8px; margin-top: 10px; }
.or-upload select { width: auto; }
.or-upload input[type="file"] { flex: 1; min-width: 180px; }
@media (max-width: 900px) {
  .list.or-steps li.or-step { grid-template-columns: 44px minmax(0, 1fr); }
  .os-actions { grid-column: 2; justify-content: flex-start; }
  .os-actions .link-btn { min-height: 44px; }
  .or-upload select, .or-upload input[type="file"], .or-upload button { width: 100%; }
}

/* v0.7 travel */
/* ── v0.7 travel claims (public/js/views/travel.js) ─────────────────────────── */
.tc-vehicle { padding: 10px 16px; }
.tc-vehicle form { gap: 8px 12px; align-items: center; flex-wrap: wrap; }
.tc-vehicle label { margin: 0; font-weight: 600; }
.tc-days td, .tc-overview td, .tc-overview th { vertical-align: middle; }
.tc-days tr.adj td { background: #FFFBF3; }
.tc-days tfoot th, .tc-days tfoot td { border-top: 1px solid var(--line-strong); background: #FAF9F7; }
.tc-reason { font-size: 12.5px; font-weight: 400; color: var(--ink-2); text-align: right; max-width: 260px; margin-left: auto; white-space: normal; }
.tc-extras li, .tc-queue li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; }
.tc-x-amt { font-weight: 600; white-space: nowrap; text-align: right; }
.tc-x-acts { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.tc-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 4px 0 8px; font-size: 14px; }
.tc-sum dt, .tc-sum dd { margin: 0; }
.tc-sum dd { text-align: right; font-variant-numeric: tabular-nums; }
.tc-sum dt:nth-last-of-type(1), .tc-sum dd:nth-last-of-type(1) { border-top: 1px solid var(--line); padding-top: 6px; }
.tc-submit { width: 100%; margin-top: 6px; }
.tc-decide { gap: 8px; margin-top: 8px; }
.tc-decide button { flex: 1; }
@media (max-width: 700px) {
  .tc-days .opt, .tc-overview .opt { display: none; }
  .tc-extras li, .tc-queue li { grid-template-columns: minmax(0, 1fr) auto; }
  .tc-x-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .tc-reason { max-width: 160px; }
}

/* v0.7 service */
/* ── v0.7 service calls ───────────────────────── */
.sc-bar { gap: 10px 14px; }
.seg .sc-count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: #EEECE8; color: #4A4D52; font-size: 12.5px; font-weight: 600; text-align: center; }
.seg button.on .sc-count { background: rgba(0, 0, 0, .22); color: #fff; }
.sc-mine { border: 0; padding: 0; min-height: 40px; align-items: center; font-size: 14.5px; }
.sc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sc-card { display: flex; flex-direction: column; gap: 6px; border-left: 4px solid transparent; }
.sc-card.is-late { border-left-color: #A32A1D; }
.sc-card.is-urgent:not(.is-late) { border-left-color: #E3B04B; }
.sc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px 12px; flex-wrap: wrap; }
.sc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; min-width: 0; }
.sc-title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.sc-due { white-space: nowrap; font-weight: 600; }
.sc-meta { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.sc-meta a { color: inherit; }
.sc-desc, .sc-res { margin: 0; font-size: 14.5px; white-space: pre-line; overflow-wrap: anywhere; }
.sc-res { padding: 6px 10px; border-radius: 8px; background: #E6F4EA; color: #1E6B3A; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sc-actions .btn, .sc-actions button { min-height: 44px; }
.sc-earlier { margin-top: 4px; }
.sc-visits { border: 0; padding: 0; margin: 0; }
.sc-visits legend { font-size: 13px; margin-bottom: 4px; color: var(--ink-2); }
.sc-plan-form { flex-wrap: nowrap; gap: 6px; }
.sc-plan-form input { width: 76px; min-width: 76px; }
.sc-plans .sub { margin: -4px 0 10px; }
@media (max-width: 700px) {
  .sc-actions .btn, .sc-actions button { flex: 1 1 calc(50% - 8px); }
  .sc-top .sc-due { order: -1; }
}

/* v0.7 reports */
/* ── Own reports (#/reports): results on the left, the builder in a wider side panel; on phones the builder comes first ── */
.rp-layout { grid-template-columns: minmax(0, 1fr) 360px; }
.rp-layout .rp-rail { position: static; display: flex; flex-direction: column; gap: 14px; }
.rp-result { min-height: 220px; }
.rp-head h2 { margin: 0; }
.rp-head .sub { margin: 2px 0 10px; }
.rp-result .banner { margin-bottom: 10px; }
.rp-result .chart { margin: 4px 0 12px; }
.rp-table td { white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.rp-table tfoot td { font-weight: 600; border-top: 2px solid var(--line-strong); background: #FAF9F7; }
.rp-start .rp-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }

/* Saved and ready-made reports */
.rp-list .rc-k + .rp-saved { margin-top: 0; }
.rp-saved { margin: 0 0 10px; max-height: 260px; overflow: auto; }
.rp-item { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rp-item .rp-open { text-align: left; padding: 0; min-height: 32px; text-decoration: none; color: var(--ink); font-size: 14px; }
.rp-item .rp-open:hover { text-decoration: underline; }
.rp-item.on .rp-open { font-weight: 600; color: var(--blue); }
.rp-item .rp-del { margin-left: auto; min-height: 32px; font-size: 13px; }

/* Builder */
.rp-builder .field { margin-bottom: 6px; }
.rp-builder fieldset.rp-sec { border: 0; border-top: 1px solid var(--line); margin: 10px 0 0; padding: 10px 0 0; min-width: 0; }
.rp-builder legend { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); font-weight: 600; padding: 0; margin-bottom: 6px; }
.rp-builder legend label { font: inherit; color: inherit; margin: 0; }
.rp-builder select, .rp-builder input[type="text"], .rp-builder input[type="number"], .rp-builder input[type="date"] { width: 100%; }
.rp-builder fieldset > select + select, .rp-builder fieldset > select + label { margin-top: 6px; }
.rp-then { display: block; margin-top: 8px; }
.rp-none { margin: 0 0 6px; font-size: 13.5px; }
.rp-filter, .rp-measure { display: grid; gap: 6px; padding: 8px; margin-bottom: 8px; background: #FAF9F7; border: 1px solid var(--line); border-radius: 10px; }
.rp-line { display: flex; gap: 6px; align-items: center; }
.rp-line > select, .rp-line > input { flex: 1 1 0; min-width: 0; }
.rp-line > .muted { flex: 0 0 auto; font-size: 13.5px; }
.rp-x { flex: 0 0 auto; min-width: 40px; padding: 0 8px; font-size: 18px; line-height: 1; }
.rp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 10px; }
.rp-cols label, .rp-in label { display: flex; align-items: center; gap: 6px; margin: 0; min-height: 32px; font-size: 14px; color: var(--ink); cursor: pointer; }
.rp-cols input, .rp-in input { width: auto; min-height: 0; margin: 0; flex: 0 0 auto; }
.rp-in { max-height: 190px; overflow: auto; padding: 2px 8px; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; }
.rp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.rp-actions .primary { flex: 1 1 auto; }
html[lang="hi"] .rp-builder legend, html[lang="gu"] .rp-builder legend { letter-spacing: 0; text-transform: none; }

@media (max-width: 1200px) {
  .rp-layout { grid-template-columns: minmax(0, 1fr); }
  .rp-layout .rp-rail { order: -1; }
}
/* Phones: every tap target at least 44px tall. */
@media (max-width: 900px) {
  .rp-cols label, .rp-in label, .rp-item .rp-open, .rp-item .rp-del, .rp-x, .rp-chips .chip { min-height: 44px; }
  .rp-cols { grid-template-columns: minmax(0, 1fr); }
  .rp-saved { max-height: none; }
}

/* v0.7 trips */
/* Trips and the "where they went" map */
.trip-card { border-left: 4px solid var(--line-strong); }
.trip-card.on { border-left-color: #1E6B3A; background: #F4FAF6; }
.trip-card h2 { margin: 0 0 4px; }
.trip-card p { margin: 2px 0; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #1E6B3A; margin-right: 4px; animation: vm-pulse 1.6s ease-out infinite; }
@keyframes vm-pulse { 0% { box-shadow: 0 0 0 0 rgba(30, 107, 58, .5); } 100% { box-shadow: 0 0 0 10px rgba(30, 107, 58, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.row.nowrap { flex-wrap: nowrap; align-items: center; }
.row.nowrap input[type="date"] { min-width: 0; }
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.day-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13.5px; cursor: pointer; min-height: 36px; }
.day-chip input { margin: 0; }
.wm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 8px; }
.wm-legend .lg { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.wm-legend .lg.start { background: #1E6B3A; }
.wm-legend .lg.end { background: #222; }
.wm-legend .lg.visit { background: #eb6834; }
.wm-legend .lg.gap { background: none; width: 18px; height: 0; border-radius: 0; border-top: 2px dashed #6b7280; vertical-align: 3px; }
@media (max-width: 700px) { .day-chip { font-size: 13px; } }

.wm-open { margin: 10px 0 0; }
#dayc .tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.day-chip input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: none; }
.day-chip { white-space: nowrap; }

/* v0.7 stops */
.wm-legend .lg.stop { background: #fff; border: 2px solid #6b7280; box-sizing: border-box; }

/* Drag a deal card to the next stage (v0.9) */
.dwrap { position: relative; cursor: grab; }
.dwrap:active { cursor: grabbing; }
.dwrap.dragging { opacity: .45; }
.dc-next { position: absolute; right: 8px; top: 8px; min-height: 0; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 16px; line-height: 1; background: #fff; opacity: 0; transition: opacity .15s; }
.dwrap:hover .dc-next, .dc-next:focus-visible { opacity: 1; }
@media (hover: none) { .dc-next { opacity: 1; } }
.col.drop-ok { outline: 2px dashed var(--orange); outline-offset: -3px; }
.col.drop-hover { background: var(--amber-bg); outline-style: solid; }
.col.drop-no { opacity: .55; }
.board.is-dragging .col.empty { flex-basis: 76px; }

/* ==== v0.9 soft theme: quiet colours, light sidebar, more air, one dark primary button ====================== */
:root {
  --bg: #F7F6F4; --card: #FFFFFF; --line: #EFEDE9; --line-strong: #E3E0DB;
  --ink: #24272C; --ink-2: #6B6F76;
  --side: #FBFAF8; --side-ink: #50545B; --side-active: #EFEDE8;
  --orange: #E9A04F; --orange-ink: #98590F; --dark: #2F3338;
  --red-bg: #FBECE9; --red: #B04A3F; --amber-bg: #FCF3DF; --amber: #8A6420;
  --blue-bg: #EBF1FA; --blue: #3E629E; --green-bg: #E9F4EE; --green: #2E7050; --green-bar: #74B08F;
  --grey-bg: #F2F1EE; --grey: #60646A;
  --next-bg: #FDF9F0; --next-line: #EBCF93;
  --chart: #7096CC; --chart-track: #EDF1F7;
  --shadow: 0 1px 2px rgba(36, 39, 44, .04), 0 8px 24px rgba(36, 39, 44, .05);
  --radius: 16px;
  --font: 'Inter', 'Libre Franklin', 'Noto Sans Devanagari', 'Noto Sans Gujarati', system-ui, sans-serif;
}
html[lang="hi"] { --font: 'Noto Sans Devanagari', 'Inter', system-ui, sans-serif; }
html[lang="gu"] { --font: 'Noto Sans Gujarati', 'Inter', system-ui, sans-serif; }
body { background: var(--bg); letter-spacing: -.003em; }
a { color: var(--blue); }
h1 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--ink); }

/* Sidebar: light, with a soft pill for the page you are on */
.side { background: var(--side); color: var(--side-ink); border-right: 1px solid var(--line); }
.brand { color: var(--ink); letter-spacing: .1em; font-size: 15px; }
.brand-sub { color: var(--ink-2); opacity: 1; }
.side a { color: var(--side-ink); border-radius: 10px; font-size: 14.5px; }
.side a:hover { background: #F3F1ED; color: var(--ink); }
.side a.active { background: var(--side-active); color: var(--ink); font-weight: 600; }
.side .count { background: #FBE7CC; color: var(--orange-ink); }
.side-logout { border-color: var(--line-strong); color: var(--ink-2); background: transparent; }
.side-logout:hover { background: #F3F1ED; color: var(--ink); }
.topbar { background: rgba(247, 246, 244, .86); border-bottom-color: transparent; }
.search-field { border-color: var(--line); box-shadow: none; background: #fff; border-radius: 12px; }
.search-field:hover { border-color: var(--line-strong); }

/* Cards and tiles: white, no hard border, a soft shadow */
.card, .tile, .rev, .insight, .more-box { border-color: var(--line); }
.card { padding: 20px 22px; border-radius: var(--radius); box-shadow: var(--shadow); }
.tile { border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile .v { font-size: 28px; letter-spacing: -.02em; }
.tile .k { color: var(--ink-2); }
.stack > * + * { margin-top: 18px; }

/* Buttons: quiet by default, one dark primary */
button, .btn { border-color: var(--line-strong); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 500; }
button:hover, .btn:hover { border-color: #D2CEC7; background: #FBFAF8; }
.primary { background: var(--dark); border-color: var(--dark); color: #fff; font-weight: 500; box-shadow: none; }
.primary:hover { background: #3B4047; border-color: #3B4047; }
.approve { background: var(--green); border-color: var(--green); color: #fff; }
.approve:hover { background: #3A7F5C; border-color: #3A7F5C; }
.danger { border-color: #F0CFCA; background: var(--red-bg); color: var(--red); }
.ghost:hover { background: #F1EFEB; }
.dark-btn { background: var(--dark); }
input, select, textarea { border-color: var(--line-strong); border-radius: 10px; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(233, 160, 79, .35); outline-offset: 1px; }
.seg { border-color: var(--line-strong); border-radius: 10px; }
.seg button.on { background: var(--dark); }
.pagetabs { background: #EFEDE8; }
.pagetabs.sub { background: transparent; }
.tabs { border-bottom-color: var(--line); }
.tabs button { color: var(--ink-2); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--orange); }

/* Tables and lists: airy, hairlines only */
th { background: transparent; color: var(--ink-2); font-weight: 500; border-bottom-color: var(--line); }
td { border-bottom-color: var(--line); padding: 11px 10px; }
tbody tr:hover td, tr.click:hover td { background: #FBFAF8; }
.list li { border-bottom-color: var(--line); }

/* Pills and banners: soft fills, never loud */
.pill { font-weight: 500; }
.p-orange { background: #FCEBD3; color: var(--orange-ink); }
.banner { border-radius: 12px; }
.nextbox { border-width: 1px; border-radius: 14px; background: var(--next-bg); }
.nextbox .t { color: var(--orange-ink); }
.insight { border-radius: 12px; }
.insight.amber .bar { background: #D9A441; }
.insight.info .bar { background: #B7BBC2; }
.insight.red .bar { background: #D07A70; }

/* Pipeline board and deal cards */
.col { background: #F2F1EE; border-radius: 16px; }
.col.empty { background: #F6F5F2; }
.dcard { border-color: var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(36, 39, 44, .04); transition: box-shadow .15s, border-color .15s; }
.dcard:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(36, 39, 44, .08); }
.progress .s.now { background: var(--orange); }
.col.drop-ok { outline-color: var(--orange); }
.col.drop-hover { background: var(--amber-bg); }

/* Charts: one soft blue, calm tracks */
.bars .b .fill { border-radius: 0 6px 6px 0; }
.bars .b:hover .fill, .bars .b:focus .fill { background: #5C84BF; }
.meter { background: var(--chart-track); }
.chart-tip { border-color: var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(36, 39, 44, .12); }
.toast { background: var(--dark); border-radius: 12px; }
dialog.dlg { border-radius: 18px; border: none; box-shadow: 0 24px 64px rgba(36, 39, 44, .22); }
dialog.dlg::backdrop { background: rgba(36, 39, 44, .35); }

/* Sidebar details for the light theme */
.me-chip { background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(36, 39, 44, .04); }
.me-chip strong { color: var(--ink); }
.me-chip small { color: var(--ink-2); opacity: 1; }
.ng-h { color: #8A8E95; }
.ng-h:hover:not(:disabled) { background: #F3F1ED; color: var(--ink); }
.av-i { background: #EFE8DC; color: #6B5A3A; }

/* ==== v0.9 dashboard: this-month card, change markers, funnel, mini stats ===================================== */
:root { --chart: #5E8FD0; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); font-weight: 600; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 24px 28px; }
.hero-num { font-size: 38px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin: 6px 0 14px; }
.hero-num span { font-size: 15px; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.goal { position: relative; height: 10px; border-radius: 999px; background: var(--chart-track); margin: 4px 0 12px; }
.goal-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--chart); min-width: 6px; }
.goal-fill.done { background: var(--green-bar); }
.goal-fill.behind { background: #D9A441; }
.goal-pace { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--ink); opacity: .55; border-radius: 2px; }
.hero-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; padding-left: 28px; border-left: 1px solid var(--line); }
.hero-side .hs:nth-child(3) { grid-column: 1 / -1; }
.hs .k { font-size: 12.5px; color: var(--ink-2); }
.hs .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 2px 0; }
.hs .v.warn, .fn-row .warn { color: var(--red); }
.hs .s { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.delta { font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.delta.good { color: var(--green); } .delta.bad { color: var(--red); } .delta.flat { color: var(--ink-2); }
.delta .muted { font-weight: 400; font-size: 12.5px; }
.tile-link { position: relative; text-decoration: none; color: inherit; display: block; }
.tile-link:hover { box-shadow: 0 6px 20px rgba(36, 39, 44, .09); }
.tile-link .go { position: absolute; right: 12px; top: 12px; color: var(--ink-2); opacity: 0; transition: opacity .15s; }
.tile-link:hover .go { opacity: 1; }
.funnel { display: grid; gap: 2px; margin-top: 10px; }
.fn-row { display: grid; grid-template-columns: 24px minmax(110px, 1.1fr) minmax(80px, 2fr) 64px 64px 64px 84px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.fn-row:last-child { border-bottom: none; }
.fn-head { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; padding: 0 0 6px; }
.fn-row .r { text-align: right; }
.fn-no { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fn-bar { display: block; height: 10px; background: var(--chart-track); border-radius: 999px; overflow: hidden; }
.fn-bar i { display: block; height: 100%; background: var(--chart); border-radius: 999px; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mini-stats .k { font-size: 12.5px; color: var(--ink-2); }
.mini-stats .v { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.mini-stats .s { font-size: 12.5px; color: var(--ink-2); }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 16px; padding: 18px; }
  .hero-side { padding-left: 0; border-left: none; border-top: 1px solid var(--line); padding-top: 14px; }
  .hero-num { font-size: 30px; }
  .fn-row { grid-template-columns: 22px minmax(90px, 1fr) 48px 52px 52px 60px; }
  .fn-bar { display: none; }
}
@media (max-width: 900px) { .fn-head span:nth-child(3) { display: none; } }
.tiles.t8 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .tiles.t8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) and (max-width: 1180px) { .tiles.t8 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.col-head .row.between { flex-wrap: nowrap; align-items: flex-start; }
.col-head .t { min-width: 0; }
h1 a { color: var(--ink); text-decoration: none; }
h1 a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.list.sys li { justify-content: flex-start; align-items: baseline; gap: 12px; }
.list.sys .pill { min-width: 62px; justify-content: center; }
@media (max-width: 900px) {
  .bottom { background: rgba(255, 255, 255, .94); border-top: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .bottom a, .bottom button { color: var(--ink-2); }
  .bottom a.active { background: transparent; color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 var(--orange); }
}
.bell .count, .bottom .count, .sheet-grid .count { background: #FBE7CC; color: var(--orange-ink); }

/* ==== Phones, Android and iOS alike: safe areas, no zoom on focus, no tap flash, stable height =============== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
.shell { min-height: 100dvh; }
@media (max-width: 900px) {
  input, select, textarea { font-size: 16px; } /* iOS zooms the page when a smaller text field gets focus */
  .main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .bottom { padding-bottom: env(safe-area-inset-bottom); height: calc(64px + env(safe-area-inset-bottom)); }
  .main { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .sheet { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
button, a, summary, label { touch-action: manipulation; }

/* ==== v1.0 artistic: the flow-line, depth, motion, dark theme, the tools directory ============================ */
:root {
  --flow: linear-gradient(90deg, #E9A04F 0%, #D9A06A 22%, #B8BEC8 55%, #7FB0DE 100%);   /* fire -> steel -> water */
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --ember-glow: radial-gradient(60% 50% at 85% 0%, rgba(233, 160, 79, .16), transparent 70%);
  --water-glow: radial-gradient(50% 45% at 0% 100%, rgba(127, 176, 222, .14), transparent 70%);
  --dots: radial-gradient(rgba(36, 39, 44, .075) 1px, transparent 1.2px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
body { background: var(--bg); background-image: var(--ember-glow), var(--water-glow), var(--dots); background-size: 100% 100%, 100% 100%, 22px 22px; background-attachment: fixed; font-feature-settings: 'cv11', 'ss01'; }
.num, .tile .v, .hero-num, .hs .v, .rc-v, .mini-stats .v { font-feature-settings: 'tnum', 'cv11'; font-variant-numeric: tabular-nums; }

/* The flow-line: a thin ember-to-steel-to-water stroke under page titles, on the goal bar and between sections */
.page-head h1::after, .dash-title h1::after, .tool-head h2::after { content: ''; display: block; width: 56px; height: 2px; border-radius: 2px; background: var(--flow); margin-top: 8px; }
.dash-title h1, .page-head h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; letter-spacing: -.01em; }
.goal-fill:not(.done):not(.behind) { background: var(--flow); }
.flow-rule { height: 2px; border: 0; background: var(--flow); border-radius: 2px; opacity: .8; margin: 18px 0; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { flex: 0 0 auto; filter: drop-shadow(0 2px 6px rgba(233, 160, 79, .35)); }

/* Depth and motion */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#page > .stack > *, #page > * > .card, .tool-group, .notes-grid > * { animation: rise .45s var(--ease) both; }
#page .stack > *:nth-child(2) { animation-delay: .04s; } #page .stack > *:nth-child(3) { animation-delay: .08s; } #page .stack > *:nth-child(4) { animation-delay: .12s; }
.card { transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.tile-link:hover, .tool-card:hover { transform: translateY(-2px); }
button:active, .btn:active, .tool-card:active, .tile-link:active { transform: scale(.985); }
.muted.loading, #page > p.muted { background: linear-gradient(90deg, transparent, rgba(127, 176, 222, .18), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; padding: 6px 10px; display: inline-block; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Sidebar: soft ember bar on the page you are on */
.side a.active { position: relative; }
.side a.active::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--flow); background-size: 100% 200%; }
.side-foot { display: grid; gap: 8px; }
.theme-btn { width: 100%; min-height: 36px; font-size: 13px; color: var(--ink-2); background: transparent; border-color: var(--line-strong); }

/* Hero card: a little glow and a hairline highlight */
.hero { background: linear-gradient(135deg, var(--card) 0%, var(--card) 55%, rgba(233, 160, 79, .07) 100%); position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7); }
.tile .v { background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 78%, transparent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* All tools: the directory */
.tools { max-width: 1280px; }
.tool-group { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px 22px; box-shadow: var(--shadow); --g: #E9A04F; --gt: #FCEBD3; }
.tool-group[data-g="daily"] { --g: #D9822B; --gt: #FCE9D2; } .tool-group[data-g="business"] { --g: #5E8FD0; --gt: #E6EEF9; } .tool-group[data-g="occasional"] { --g: #6B7280; --gt: #ECEEF1; }
.tool-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.tool-head h2 { font-size: 19px; margin: 0; } .tool-head h2::after { width: 36px; }
.tool-live { font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--grey-bg); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tool-card { position: relative; display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; min-height: 76px; }
.tool-card:hover { border-color: var(--g); box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--g) 55%, transparent); }
.tool-ico { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--gt); color: var(--g); }
.tool-txt { display: grid; gap: 2px; min-width: 0; } .tool-txt strong { font-size: 15px; font-weight: 600; }
.tool-txt span { color: var(--ink-2); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card .count { position: absolute; right: 12px; top: 12px; background: var(--gt); color: var(--ink); border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: 12px; }

/* Empty states and module helpers (notes, access, swatches) */
.empty-state { text-align: center; padding: 40px 16px; color: var(--ink-2); }
.empty-state .es-ico { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: var(--grey-bg); color: var(--ink-2); margin-bottom: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.note { border-radius: 18px; padding: 16px 18px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: transform .2s var(--ease); }
.note:hover { transform: translateY(-2px) rotate(-.2deg); }
.note h3 { margin: 0; font-size: 16px; } .note-body { margin: 0; color: var(--ink-2); font-size: 14px; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.note-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.note .pin { color: var(--orange); margin-right: 4px; vertical-align: -2px; }
.note.c-amber { background: #FDF6E6; } .note.c-green { background: #EAF5EE; } .note.c-blue { background: #EAF1FA; } .note.c-rose { background: #FBEDF0; }
.swatches { display: flex; gap: 8px; margin-bottom: 8px; } .sw { position: relative; width: 30px; height: 30px; margin: 0; cursor: pointer; }
.sw input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.sw::before { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; }
.sw-amber::before { background: #F4D58D; } .sw-green::before { background: #A9D8BC; } .sw-blue::before { background: #A9C7EC; } .sw-rose::before { background: #EFB6C2; }
.sw:has(input:checked)::before { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.access-grid th.c, .access-grid td.c { text-align: center; }
.access-grid .tog { width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 12px; font-weight: 700; color: #fff; background: var(--grey-bg); border-color: var(--line-strong); }
.access-grid .tog.on { background: var(--green); border-color: var(--green); }
.check.inline { display: inline-flex; margin: 0; padding: 0; border: 0; min-height: 0; }
.form-sec { font-size: 15px; margin: 18px 0 2px; } .more-fields { margin: 14px 0; } .more-fields > summary { color: var(--ink-2); }

/* Dark theme: the tokens switch; the markup does not. Follows the device unless the person chose Light or Dark. */
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] {
  --bg: #121418; --card: #1A1D22; --line: #262A31; --line-strong: #323741; --ink: #ECEDEF; --ink-2: #9CA2AB;
  --side: #15171B; --side-ink: #B8BDC5; --side-active: #22262D; --dark: #E9A04F;
  --red-bg: #3A2220; --red: #F0A59B; --amber-bg: #3A2F1A; --amber: #E9C77F; --blue-bg: #1F2C41; --blue: #A3C0EE; --green-bg: #1C3328; --green: #8FD2AB; --green-bar: #4F9A74;
  --grey-bg: #262A31; --grey: #B2B7BF; --next-bg: #2A2519; --next-line: #6B5A2E; --chart: #7FA5DA; --chart-track: #252A33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --dots: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1.2px);
}
html[data-theme="dark"] .primary { color: #1B1D20; } html[data-theme="dark"] .primary:hover { background: #F0B06A; border-color: #F0B06A; }
html[data-theme="dark"] button, html[data-theme="dark"] .btn, html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="dark"] .dcard, html[data-theme="dark"] .search-field, html[data-theme="dark"] .tool-card, html[data-theme="dark"] .more-box, html[data-theme="dark"] .insight,
html[data-theme="dark"] .me-chip, html[data-theme="dark"] .chart-tip, html[data-theme="dark"] .dc-next { background: var(--card); color: var(--ink); border-color: var(--line-strong); }
html[data-theme="dark"] .primary { background: var(--orange); border-color: var(--orange); }
html[data-theme="dark"] button:hover, html[data-theme="dark"] .btn:hover { background: #22262D; }
html[data-theme="dark"] .col { background: #15181C; } html[data-theme="dark"] .col.empty { background: #131619; }
html[data-theme="dark"] .pagetabs { background: #1F2329; } html[data-theme="dark"] .pagetabs.sub { background: transparent; } html[data-theme="dark"] .pagetabs a.on { background: var(--card); } html[data-theme="dark"] .pagetabs .count { color: #1B1D20; }
html[data-theme="dark"] .topbar { background: rgba(18, 20, 24, .85); } html[data-theme="dark"] .bottom { background: rgba(21, 23, 27, .94); }
html[data-theme="dark"] .side a:hover, html[data-theme="dark"] .ng-h:hover:not(:disabled) { background: #1F2329; color: var(--ink); }
html[data-theme="dark"] .note.c-amber { background: #2A2518; } html[data-theme="dark"] .note.c-green { background: #172A21; } html[data-theme="dark"] .note.c-blue { background: #182335; } html[data-theme="dark"] .note.c-rose { background: #2E1C21; }
html[data-theme="dark"] tbody tr:hover td, html[data-theme="dark"] tr.click:hover td { background: #1F2329; } html[data-theme="dark"] th { background: transparent; }
html[data-theme="dark"] dialog.dlg { background: var(--card); color: var(--ink); }
html[data-theme="dark"] body { background-image: var(--ember-glow), var(--water-glow), var(--dots); }
@media (prefers-color-scheme: dark) { html:not([data-theme]) { color-scheme: dark; } }

/* Sales scorecard cells */
.bad-cell { color: var(--red); font-weight: 600; } .good-cell { background: var(--green-bg); color: var(--green); } .mid-cell { background: var(--amber-bg); color: var(--amber); }

/* ==== v1.1 art direction: skins (background + side panel), organic shapes, drifting colour, grain, rings ========== */
/* Two typefaces only: Fraunces for titles, Inter for everything else (numbers, code and references use Inter with tabular figures). */
:root { --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif; --mono: var(--font); --shape: 30px 22px 32px 24px / 24px 30px 22px 32px; --shape-s: 20px 16px 22px 16px / 16px 20px 16px 22px; --pill: 999px; }
h1, h2 { font-family: var(--serif); font-optical-sizing: auto; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="gu"] h1, html[lang="gu"] h2 { font-family: var(--font); }
h1 { font-weight: 500; } h2 { font-weight: 500; font-size: 17px; }
h3, .eyebrow, th, label { font-family: var(--font); }
.mono, .hrd-ref, .hb-mono, kbd { font-family: var(--font); font-variant-numeric: tabular-nums; }
.dash-title h1, .page-head h1 { font-family: var(--serif); font-weight: 500; }
html[lang="hi"] .dash-title h1, html[lang="hi"] .page-head h1, html[lang="gu"] .dash-title h1, html[lang="gu"] .page-head h1 { font-family: var(--font); }
html[lang="hi"] body, html[lang="gu"] body { line-height: 1.6; }

/* Background skins: five soft palettes. Status colours never change. */

   /* the accent is light in dark mode: white on it was 1.8:1 */

/* Side panel skins. Glass lets the background colour show through. */

 

.side a, .ng-h { border-radius: 16px; }
.ni { display: inline-grid; place-items: center; width: 22px; flex: 0 0 22px; opacity: .85; } .nt { flex: 1; min-width: 0; text-align: left; }
.ng-h { display: flex; align-items: center; gap: 8px; justify-content: flex-start; text-transform: none; letter-spacing: 0; font-size: 14.5px; font-weight: 600; color: var(--sd-ink, var(--ink)); }
.ng-h .chev { margin-left: auto; }
.ng-b a { padding-left: 14px; font-size: 14px; } .tools-link { margin: 4px 0 6px; }
.ng-b { margin-left: 4px; }

/* Drifting colour behind everything: three soft blobs, transform only (cheap), plus a faint grain. Off in Calm mode. */

 html[data-calm="1"] #page > .stack > *, html[data-calm="1"] .tool-group { animation: none; }

/* Organic shapes: nothing is a plain rectangle */
.card, .tool-group, .hero { border-radius: var(--shape); border-color: transparent; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.tile { border-radius: var(--shape-s); border-color: transparent; background: color-mix(in srgb, var(--card) 86%, transparent); }
.tool-card, .note, .dcard, .insight, .banner, .rev, .nextbox { border-radius: var(--shape-s); }
button, .btn, input, select, textarea, .search-field { border-radius: 16px 18px 16px 18px / 18px 16px 18px 16px; }
.pill, .count, .seg, .pagetabs { border-radius: var(--pill); }
.seg button { border-radius: 0; } .small { border-radius: 14px; }
dialog.dlg { border-radius: 34px 26px 34px 28px / 28px 34px 26px 34px; }
.topbar { border-radius: 0 0 30px 30px; }
.col { border-radius: 30px 24px 30px 24px / 24px 30px 24px 30px; } .tool-ico { border-radius: 38% 62% 55% 45% / 52% 40% 60% 48%; }
.avatar, .av { border-radius: 50%; }
.page-head, .dash-title { position: relative; }
.wave { display: block; width: 100%; height: 22px; margin: 6px 0 2px; color: var(--sk-soft, #EFE2C9); opacity: .9; }

/* Pressure gauge (SVG): the year or month target as a dial */
.gauge { display: inline-block; flex: 0 0 auto; } .gauge svg { display: block; overflow: visible; }
.gauge .gt { stroke: var(--sk-soft, var(--chart-track)); } .gauge .gv { stroke: var(--sk-accent, var(--chart)); } .gauge .gn { stroke: var(--ink); } .gauge .gh { fill: var(--ink); } .gauge text { fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.hero-ring { display: grid; place-items: center; }
.tilt { transform-style: preserve-3d; transition: transform .25s var(--ease); will-change: transform; }

/* Look panel (Background, Side panel, Mode, Motion) */
.look-pop { position: fixed; z-index: 90; left: 16px; bottom: 76px; width: 292px; max-width: calc(100vw - 32px); padding: 16px; background: var(--card); border-radius: 28px 24px 28px 24px; box-shadow: 0 24px 60px -16px rgba(36, 39, 44, .35); animation: rise .25s var(--ease) both; color: var(--ink); }
.look-pop h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 10px 0 8px; } .look-pop h3:first-child { margin-top: 0; }

 
 
 
.look-seg { display: inline-flex; border-radius: 999px; background: var(--grey-bg); padding: 3px; gap: 2px; } .look-seg button { min-height: 32px; padding: 3px 12px; border: 0; background: transparent; border-radius: 999px; font-size: 13px; }
.look-seg button[aria-pressed="true"] { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
@media (max-width: 900px) { .look-pop { left: 12px; right: 12px; width: auto; bottom: calc(84px + env(safe-area-inset-bottom)); }  }

.hero { grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero-ring { justify-self: start; } }

/* v1.2 shell: a thin rail of icons (the collapse), business colours ("worlds"), pump-room pipework behind the page, a deal's stages as a pipe. */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding-right: 4px; }
.rail-btn { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; flex: 0 0 34px; background: transparent; color: inherit; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.rail-btn svg { transition: transform .25s var(--ease); } .rail-btn[aria-pressed="true"] svg { transform: rotate(180deg); }
.side .theme-btn, .side .side-logout { display: flex; align-items: center; gap: 8px; }
html[data-rail] .side { width: 76px; flex-basis: 76px; padding: 14px 8px; overflow-x: hidden; align-items: stretch; }
html[data-rail] .brand-row { flex-direction: column; gap: 10px; padding: 0; } html[data-rail] .brand { padding: 0; display: grid; place-items: center; }
html[data-rail] .side .brand span, html[data-rail] .brand-sub, html[data-rail] .side .nt, html[data-rail] .side .ng-h,
html[data-rail] .side .count, html[data-rail] .me-chip strong, html[data-rail] .me-chip small { display: none; }
html[data-rail] .side .ng-b { display: flex; margin-left: 0; }
html[data-rail] .side a, html[data-rail] .side .theme-btn, html[data-rail] .side .side-logout { justify-content: center; padding: 10px 0; }
html[data-rail] .me-chip { justify-content: center; padding: 8px 0; }
@media (max-width: 900px) { .rail-btn { display: none; } }

/* Business colours: Voltmech's three lines tint the whole screen (fire = ember, pumps = steel blue, water = teal). "Mixed" leaves the Background colours as chosen. */

 
 

/* Pump-room pipework: a faint red fire line, a blue water line and steel feeders run behind every page. */

/* The brand is a link home, wherever it is drawn. The side panel's link styles must not turn it into a menu row. */
.side a.brand, .side a.brand:hover { display: flex; justify-content: flex-start; background: none; min-height: 44px; padding: 0 10px; }
.side a.brand-sub, .side a.brand-sub:hover { display: block; flex: 0 0 auto; background: none; min-height: 0; padding: 0 10px 12px; font-size: 12px; }
html[data-rail] .side a.brand { justify-content: center; padding: 0; }
html[data-rail] .side a.brand-sub { display: none; }
a.brand-mobile { text-decoration: none; min-height: 44px; align-items: center; }
@media (max-width: 900px) { a.brand-mobile { display: inline-flex; } }
/* Menu rows with a waiting count. */
.side .ng-b a .count { background: var(--sk-soft, #FBE7CC); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 0 8px; }
/* A page with a tab bar leaves the full-height screens (chat, Volt) that much less room. */
#view.has-tabs .chat { height: calc(100vh - 190px); height: calc(100dvh - 190px); }
#view.has-tabs .volt { height: calc(100vh - 190px); height: calc(100dvh - 190px); }
@media (max-width: 900px) { #view.has-tabs .chat:not(.in-thread) { height: calc(100dvh - 214px); } #view.has-tabs .volt { height: calc(100dvh - 250px - env(safe-area-inset-bottom, 0px)); } }
/* The dashboard under My day on the home screen (its filter bar scrolls with the page: the day stays the main thing). */

/* Volt on every page: a round button and a chat panel (the chat itself is drawn by the Volt module). */
.volt-fab { position: fixed; z-index: 80; right: 20px; bottom: 20px; width: 56px; height: 56px; min-height: 0; padding: 0; border-radius: 50% 50% 50% 18%; background: var(--sk-accent, var(--orange)); border-color: transparent; color: #fff; box-shadow: 0 14px 30px -10px rgba(36, 39, 44, .45); transition: transform .2s var(--ease); }
.volt-fab[hidden] { display: none; } .volt-fab:hover { transform: translateY(-2px) scale(1.04); } html[data-theme="dark"] .volt-fab { color: #1B1D20; }
.volt-pop { position: fixed; z-index: 85; right: 20px; bottom: 88px; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-radius: 30px 30px 30px 10px; box-shadow: 0 30px 70px -20px rgba(36, 39, 44, .45); overflow: hidden; animation: rise .22s var(--ease) both; }
.volt-pop > header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); } .volt-pop > header .grow { flex: 1; }
.volt-pop > header strong { display: inline-flex; align-items: center; gap: 6px; font-family: Fraunces, serif; font-weight: 500; font-size: 17px; }
.volt-host { flex: 1; min-height: 0; overflow: auto; padding: 8px 10px 10px; }
@media (max-width: 900px) { .volt-fab { bottom: calc(84px + env(safe-area-inset-bottom)); right: 14px; } .volt-pop { right: 8px; left: 8px; width: auto; bottom: calc(150px + env(safe-area-inset-bottom)); height: min(560px, calc(100dvh - 230px)); } }
@media print { .volt-fab, .volt-pop { display: none; } }

/* The phone menu's current page: the old white-on-dark pair became unreadable once the panel colours turned light. */
.sheet-grid a.active { background: var(--sk-soft, #EEE9E0); color: var(--ink); font-weight: 600; }

/* Business-line icons (lineIcon in icons.js): fire red, pump steel, water teal; the name always sits beside them. */
.vl-row { display: inline-flex; align-items: center; gap: 6px; } .vl { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; flex: none; }
.vl-fire { color: #A53A24; background: #F8DDD5; } .vl-pump { color: #3E5C78; background: #DCE6F0; } .vl-water { color: #1F6F66; background: #D3ECE7; }
html[data-theme="dark"] .vl-fire { color: #F4B3A2; background: #4A2A22; } html[data-theme="dark"] .vl-pump { color: #B7D0E8; background: #26384A; } html[data-theme="dark"] .vl-water { color: #A5E0D6; background: #1F3E39; }

/* A deal's twelve stages as one pipe: filled up to the stage it is in, a valve marks where it is now. */
.progress { gap: 0; padding: 6px 0; } .progress .s { height: 12px; border-radius: 0; background: color-mix(in srgb, var(--ink) 10%, var(--card)); position: relative; }
.progress .pstep:first-child .s { border-radius: 999px 0 0 999px; } .progress .pstep:last-child .s { border-radius: 0 999px 999px 0; }
.progress .pstep { display: flex; flex-direction: column; justify-content: center; min-width: 0; min-height: 44px; } .progress { padding: 0; }
.progress .pstep .s { display: block; width: 100%; }
.progress .s.done { background: var(--sk-accent, var(--green-bar)); } .progress .s.now { background: var(--sk-accent, var(--orange)); }
.progress .s.now::after { content: ''; position: absolute; right: -9px; top: -5px; width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); z-index: 1; }

/* Phones: the last word on touch targets. Tab strips, view switches, small buttons and the board's move arrow are 44 px, as the design rules ask
   (earlier, more specific rules had left them at 34 to 40 px). */
@media (max-width: 900px) {
  .tabs button, .seg button, .seg button.small, .page-head .ph-actions .btn.small, .day-chip, .look-seg button, .theme-btn, .side-logout, .search-field { min-height: 44px; }
  .dc-next { width: 44px; height: 44px; }
  /* The More sheet sits above the Volt button (which covered its right-hand items) and clears the bar including the iPhone home-bar inset. */
  .sheet { z-index: 82; bottom: calc(64px + env(safe-area-inset-bottom)); padding-bottom: 16px; }
  .bottom { z-index: 83; }
  .look-pop { max-height: calc(100dvh - 110px - env(safe-area-inset-bottom)); overflow-y: auto; }
  .main { padding-bottom: calc(156px + env(safe-area-inset-bottom)); }   /* the Volt button floats 84 px above the screen edge and is 56 px tall: it must not cover the last button */
  .top-actions .btn, .top-actions button, .tk-actions .link-btn, .ts-entries .acts .link-btn, .stamps .link-btn { min-height: 44px; }
}
/* Dark mode: the accent turns light, so text on it is dark ink, and cards that were painted white follow the theme (the contrast sweep found these). */
html[data-theme="dark"] :is(.chip.on, .sk-b.on, .access-grid .tog.on, .dark-btn) { color: #fff; }
html[data-theme="dark"] :is(.bell, .bottom, .sheet-grid) .count { color: #1B1D20; }
html[data-theme="dark"] .tool-card .count { background: color-mix(in srgb, var(--g) 32%, var(--card)); }
html[data-theme="dark"] .dropzone { background: var(--card); }
html[data-theme="dark"] .dropzone:hover, html[data-theme="dark"] .dropzone.over, html[data-theme="dark"] .dropzone:focus-visible { background: color-mix(in srgb, var(--orange) 12%, var(--card)); }html[data-theme="dark"] :is(.bars .b .track, .ins .ins-track) { background: color-mix(in srgb, var(--ink) 14%, var(--card)); }   /* the bar tracks were a light grey slab on dark cards */
/* Map controls and credit stay dark on their light map in every theme (the accent link colour made the zoom buttons unreadable in dark mode). */
/* The round Volt button (56 px, 20 px from the corner) no longer covers the last row, pager or button of a page on a computer. */
@media screen and (min-width: 901px) { .main { padding-bottom: 96px; } }
/* Keyboard: the first Tab stop skips the whole menu (it appears only while focused). */
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 300; } .skip-link:focus { top: 8px; } #view:focus { outline: none; }
/* A long unbroken value in a list (the System page's record of what was done) wraps instead of widening the whole page. */
.list .mono { overflow-wrap: anywhere; }

/* v1.4 Period and person filter (Dashboard): one small chip showing the choice; it opens a popover on a computer and a sheet from the bottom on a phone. */
.pp-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: min(340px, 100%); padding: 6px 12px 6px 14px; border-radius: var(--pill, 999px); border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--card) 90%, transparent); color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer; }
.pp-chip .pp-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-chip .ic { flex: none; color: var(--ink-2); }
.pp-chip[aria-expanded="true"] { border-color: var(--sk-accent, var(--orange)); }
.pp-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--sk-accent, var(--orange)); }
.pp-caret { transition: transform .2s var(--ease); } [aria-expanded="true"] > .pp-caret { transform: rotate(180deg); }
.pp-scrim { position: fixed; inset: 0; z-index: 88; background: transparent; }
.pp { position: fixed; z-index: 90; width: 380px; max-width: calc(100vw - 16px); overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 16px; background: var(--card); color: var(--ink); color-scheme: light;
  border-radius: var(--shape-s, 20px); box-shadow: 0 24px 60px -18px rgba(36, 39, 44, .45), 0 0 0 1px var(--line); animation: rise .2s var(--ease) both; }
html[data-theme="dark"] .pp { color-scheme: dark; }
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pp-head h2 { margin: 0; font-size: 18px; }
.pp-x { width: 44px; height: 44px; padding: 0; border: none; background: transparent; color: var(--ink-2); font-size: 26px; line-height: 1; border-radius: 50%; }
.pp-label { display: block; margin: 12px 0 8px; font-family: var(--font); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pp-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--card); color: var(--ink); font-size: 14px; line-height: 1.2; text-align: center; }
.pp-opt small { font-size: 12px; color: var(--ink-2); }
.pp-opt.on { background: var(--dark); border-color: var(--dark); color: #fff; } .pp-opt.on small { color: inherit; opacity: .85; }
html[data-theme="dark"] :is(.pp-opt.on, .pp-apply) { background: var(--dark); border-color: var(--dark); color: #fff; }   /* the general dark-button rule is more specific than .pp-apply */
.pp-more-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin-top: 12px; padding: 0 2px; border: none; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-weight: 600; }
.pp-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pp-range label { display: grid; gap: 4px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.pp-range input, .pp select { min-width: 0; background: var(--card); color: var(--ink); }
.pp-apply { grid-column: 1 / -1; min-height: 44px; border-radius: 14px; border: 1px solid transparent; background: var(--dark); color: #fff; font-weight: 600; }
.pp-err { margin: 6px 0 0; font-size: 13px; color: var(--red); } .pp-err:empty { display: none; }
.pp-foot { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
html[data-calm] .pp, html[data-calm] .pp-caret { animation: none; transition: none; }
@keyframes ppsheet { from { transform: translateY(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 900px) {
  .pp-chip { min-height: 44px; }
  .pp-scrim { background: rgba(20, 22, 26, .42); }
  .pp { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 86vh; max-height: 86dvh; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; animation: ppsheet .25s var(--ease) both; }
  .pp::before { content: ''; display: block; width: 40px; height: 4px; margin: 0 auto 4px; border-radius: 4px; background: var(--line-strong); }
  .pp-grid { grid-template-columns: repeat(2, 1fr); }
}
/* UX hunt: the arrow on a board card sits over its top-right corner, so the first rows keep clear of it. */
.dwrap .dcard .pills, .dwrap .dcard .client { padding-right: 48px; }
/* UX hunt: the arrow-key hint under the search box means nothing on a touch screen. */
@media (hover: none) { .qs-hint { display: none; } }
@media (max-width: 900px) { .offline-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important; } }
.offline-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 84; padding: 6px 16px; background: #5B3A00; color: #FFF; font-size: 14px; line-height: 1.35; text-align: center; }

/* View as (lib/viewas.js): a calm bar on every page while looking at a team member's screen, read only; the write buttons are not drawn. */
.viewas-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 12px; margin: 0 0 8px; border-radius: 10px; background: var(--amber-bg); color: var(--amber); font-weight: 600; }
.viewas-bar button { min-height: 44px; min-width: 44px; padding: 0 16px; font: inherit; }
html[data-viewas] .topbar { top: 52px; }
html[data-viewas] .topbar a[href="#/new"], html[data-viewas] .volt-fab { display: none; }
.va-open { display: block; width: 100%; min-height: 44px; padding: 8px 12px; background: none; border: 0; text-align: left; font-size: 14px; color: inherit; opacity: .8; cursor: pointer; }
.va-open:hover, .va-open:focus-visible { opacity: 1; text-decoration: underline; }
.viewas-seen { margin: 0 0 12px; }

/* Trail sketch (public/js/trailsvg.js) and the day as a list (public/js/trail.js): drawn by the page itself, no map tiles. */
.day-sw { display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.sketch-box { min-width: 0; }
.sketch { display: block; width: 100%; height: auto; max-height: 560px; }
.sk-bg { fill: var(--bg); stroke: var(--line-strong); }
.sk-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.sk-tt, .sk-bt { font: 11px system-ui, sans-serif; fill: var(--ink-2); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.sk-bt { font-weight: 600; fill: var(--ink); }
.sk-town { fill: var(--ink-2); opacity: .6; }
.sk-line { fill: none; stroke-width: 3.5; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.sk-line.dash { stroke-width: 2; stroke-dasharray: 4 7; opacity: .7; }
.sk-mk circle { stroke: #fff; stroke-width: 2; }
.sk-mk text { fill: #fff; font: 700 11px system-ui, sans-serif; pointer-events: none; }
.sk-bubble { stroke: #fff; stroke-width: 2; }
.sk-link { cursor: pointer; } .sk-link:hover .sk-bubble, .sk-link:focus .sk-bubble { stroke: var(--ink); }
.sk-scale path { fill: none; stroke: var(--ink-2); stroke-width: 2; } .sk-scale text, .sk-north text { fill: var(--ink-2); font: 11px system-ui, sans-serif; }
.sk-north path { fill: var(--ink-2); } .sk-north text { font-weight: 700; }
.tl { list-style: none; margin: 0; padding: 0; }
.tl-stop, .tl-leg { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
.tl-stop { padding: 6px 0; }
.tl-dot { width: 26px; height: 26px; border-radius: 50%; background: #6b7280; color: #fff; display: flex; align-items: center; justify-content: center; font: 700 12px system-ui, sans-serif; }
.tl-stop.visit .tl-dot { background: #eb6834; }
.tl-stop.base .tl-dot { width: 12px; height: 12px; margin: 7px; background: var(--ink); }
.tl-leg { align-items: stretch; min-height: 30px; }
.tl-line { justify-self: center; border-left: 2px dashed var(--line-strong); }
.tl-leg .sub { align-self: center; }
.tl-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.tl-sub { color: var(--ink-2); font-size: 13.5px; }
.tl-links { display: inline-flex; gap: 14px; font-size: 13px; } .tl-links a { display: inline-block; padding: 8px 0; }
.visit-details summary { cursor: pointer; margin: 10px 0; min-height: 44px; display: flex; align-items: center; }
.loc-hint { margin-bottom: 12px; }
.wm-legend .lg-i { display: inline-flex; align-items: center; }
.wm-legend .lg.end { box-shadow: 0 0 0 1.5px var(--ink-2); }
@media print { .sketch { max-height: none; } .tl-links { display: none; } }
/* The Google map (public/js/gmaps.js) lies over the sketch; until it has really drawn it is invisible and untouchable, and the sketch
   (the backup when Google fails) is what shows. */
.sk-layer { position: relative; }
.gm-layer { position: absolute; top: 0; left: 0; right: 0; height: 360px; opacity: 0; pointer-events: none; border-radius: 10px; overflow: hidden; }
.gm-layer.on { opacity: 1; pointer-events: auto; }
.sketch-box { position: relative; }
.sketch-box.gm-on .sk-layer { min-height: 360px; visibility: hidden; }
@media print { .gm-layer { display: none; } .sketch-box.gm-on .sk-layer { visibility: visible; } }
/* Phone tracking: the code and the address to copy, and the steps. */
.ph-copy { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.ph-copy code { flex: 1; min-width: 200px; font-size: 16px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 8px; overflow-wrap: anywhere; user-select: all; }
.ph-steps li { margin-bottom: 8px; }

/* The demo copy: a small, always-visible note that the data is invented (never in the real CRM). */
.demo-ribbon { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; transform: translateX(-50%); z-index: 90; pointer-events: none; padding: 3px 12px; border-radius: 999px;
  background: #8a1f1f; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; box-shadow: 0 1px 4px rgba(0,0,0,.25); white-space: nowrap; }

/* Attendance and leave: the clock card, a person's month, the team grid, leave applications. */
.att-clock { display: flex; flex-direction: column; gap: 10px; }
.att-clock-times { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.att-clock-times .k { color: var(--ink-2); font-size: 14px; }
.att-clock .row { flex-wrap: wrap; align-items: center; }
.att-days { list-style: none; margin: 0; padding: 0; }
.att-day { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.att-day[hidden] { display: none; }
.att-day:last-child { border-bottom: none; }
.att-date .sub { display: block; }
.att-what { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.att-what > div { flex-basis: 100%; }
.att-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
button.att-tile { display: block; text-align: left; height: auto; }
button.att-tile[aria-pressed="true"] { border: 2px solid var(--ink); }
.att-dot { display: inline-block; min-width: 28px; padding: 3px 4px; border-radius: 6px; text-align: center; font-size: 12px; font-weight: 600; }
.att-grid td.c { padding: 1px; }
.att-week-list { list-style: none; margin: 0 0 10px; padding: 0; }
.att-week-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.att-week-list a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.att-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 6px; max-width: 460px; }
button.att-fix { flex-direction: column; gap: 3px; min-width: 0; min-height: 56px; padding: 4px 0; }
button.att-fix .sub { font-size: 11px; line-height: 1.2; }
button.att-fix .att-dot { min-width: 0; width: 100%; }
.att-msg { white-space: pre-wrap; margin: 4px 0; }
.att .list li { flex-wrap: wrap; }
.att .att-warn li { display: block; }
.att .grow { flex: 1 1 220px; min-width: 0; }
.lv-cost { min-height: 1.4em; margin: 6px 0 0; color: var(--ink-2); }
.lv-cost.bad { color: var(--amber); font-weight: 600; }
.lv-hol { list-style: none; margin: 0 0 8px; padding: 0; }
.lv-hol li { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lv-hd { flex: 0 0 120px; color: var(--ink-2); }
@media (max-width: 600px) {
  .att-day { grid-template-columns: minmax(0, 1fr); }
  .att-acts { justify-content: flex-start; }
  .lv-hd { flex-basis: 96px; }
}

/* ==== The lead as one workspace ======================================================================================
   Computer: next step, people, checklist and folds on the left; actions, coming up and history on the right.
   Phone: one column, and the actions are a bar above the menu (the assistant button makes way there). */
.lead-title { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 4px 16px; }
.lead-title h1 { margin: 0; overflow-wrap: anywhere; }
.lead-line { margin: 4px 0 8px; }
.lead-head .progress { margin-top: 8px; }
.lead-head .pills + .pills { margin-top: 10px; }
.lead-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 18px; align-items: start; }
.lead-left, .lead-right, .lead-folds { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.lead-folds { gap: 10px; }
.lead-cols :is(.card, .nextbox) { margin: 0; }
.lead-next h2.t { margin: 0 0 6px; font-size: 14px; font-weight: 600; }
.lead-next .na { font-size: 20px; font-weight: 600; margin-bottom: 4px; overflow-wrap: anywhere; }
.lead-people .person { flex-wrap: wrap; }
.lead-people .who { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.lead-people .who .meta { font-size: 14px; color: var(--ink-2); }
.lead-people .row { gap: 6px; }
.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-actions > * { flex: 1 1 110px; justify-content: center; text-align: center; min-height: 44px; display: inline-flex; align-items: center; }
.lead-history .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.lead-history .chip { min-height: 44px; padding: 2px 14px; }
html[data-theme] .lead-history button.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lead-history .thumbs { margin-top: 6px; }
.lead-history .timeline li { overflow-wrap: anywhere; }
.lead-approve { border-color: var(--next-line); }
.lead [hidden] { display: none !important; }
.lead-order .meter { margin-bottom: 12px; }
.fold > summary h2 { margin: 0; font-size: 16px; display: inline; }
.fold > summary { color: var(--ink); gap: 8px; }
.fold > summary::before { content: '\25B8'; color: var(--ink-2); }
.fold[open] > summary::before { content: '\25BE'; }
.fold-body { margin-top: 10px; }

/* Sheets: choices as chips, the last conversation on top. */
.dlg [hidden] { display: none !important; }
.picks { border: 0; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.picks legend { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.pick { position: relative; margin: 0; cursor: pointer; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.pick span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl, 999px); color: var(--ink); font-size: 15px; }
.pick input:checked + span { background: var(--accent, var(--dark)); border-color: var(--accent, var(--dark)); color: #fff; }
.pick input:focus-visible + span { outline: 3px solid var(--sky, var(--blue)); outline-offset: 2px; }
.last-note { border-left: 3px solid var(--line-strong); padding-left: 10px; margin-bottom: 12px; }
.last-note .said { max-height: 4.5em; overflow: auto; }
/* A long sheet keeps its Save button in reach. */
.dlg form:has(.picks) .dlg-actions { position: sticky; bottom: -20px; margin-bottom: -20px; padding: 10px 0 20px; background: var(--card); z-index: 2; }
.done-tasks { border: 0; padding: 0; margin: 10px 0 0; }

.log-offer { position: fixed; left: 12px; right: 12px; bottom: 20px; margin: 0 auto; max-width: 520px; z-index: 84; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--card); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 14px 30px -10px rgba(36, 39, 44, .45); }

@media (max-width: 900px) {
  /* No entrance movement on the columns: a transformed box would hold the fixed action bar inside itself. */
  #page > .lead > .lead-cols, .lead-cols { display: flex; flex-direction: column; align-items: stretch; gap: 14px; animation: none; transform: none; }
  .lead-left, .lead-right, .lead-folds { display: contents; }
  .lead-people { order: 1; } .lead-next { order: 2; } .lead-check { order: 3; } .lead-coming { order: 4; } .lead-history { order: 5; } .lead-folds > .fold { order: 6; }
  .lead-actions { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 39; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px;
    padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left)); background: var(--card); border-top: 1px solid var(--line-strong); }
  .lead-actions > * { padding-inline: 4px; min-width: 0; line-height: 1.15; }
  body:has(.lead-actions) .volt-fab { display: none; }
  body:has(.lead-actions) .main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
  body:has(.lead-actions) .toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
  .log-offer { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body:has(.lead-actions) .log-offer { bottom: calc(138px + env(safe-area-inset-bottom)); }
}
@media print { .lead-actions, .log-offer { display: none; } }

/* 26 Nov 2026: less typing and less scrolling. */
/* New lead: folded parts, and the office address that only opens when it differs. */
.more-fields > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.more-fields { margin: 4px 0; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
/* Lead Book table: sortable headings (two may share a cell) and cells that keep next step and status on the screen. */
th .sort { cursor: pointer; white-space: nowrap; display: inline-block; }
th .sort::after { content: ' ↕'; opacity: .5; }
th .sort.asc::after { content: ' ↑'; opacity: 1; } th .sort.desc::after { content: ' ↓'; opacity: 1; }
.lead-table td { vertical-align: top; }
.lead-table th, .lead-table td { padding-left: 6px; padding-right: 6px; }
.lead-table th .sort { display: block; }
.lead-table td:last-child { max-width: 170px; }
.lead-table td .pill { white-space: normal; }
.lead-table .next-cell { min-width: 140px; }
.lead-table td:has(> a) { min-width: 180px; }
.lead-card .lc-open { display: block; text-decoration: none; color: inherit; }
.lc-contact { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.lc-contact span { min-width: 0; overflow-wrap: anywhere; }
.filters .lf-toggle, .board-pick, .col-none { display: none; }
/* My day: old order steps in one line. */
.old-steps { margin-top: 8px; }
.old-steps > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--ink-2); }
@media (max-width: 700px) {
  .lead-book .page-head .sub { display: none; }
  .filters.lead-filters .lf-toggle { display: inline-flex; align-items: center; justify-content: center; align-self: end; min-height: 44px; }
  .filters.lead-filters:not(.open) { grid-template-columns: minmax(0, 1fr) auto; }
  .filters.lead-filters:not(.open) > :is(.field:not(.grow), .check) { display: none; }
  .filters.lead-filters:not(.open) > .grow { grid-column: 1; }
  .filters.lead-filters.open .lf-toggle { grid-column: 1 / -1; }
  /* Pipeline: one stage at a time, chosen from a list. */
  .board-pick { display: block; }
  .board { display: block; overflow: visible; }
  .board > .col:not(.picked) { display: none; }
  .board > .col.picked { width: auto; }
  .board > .col.empty.picked { align-items: stretch; padding: 12px; }
  .board > .col.empty.picked .vt { writing-mode: horizontal-tb; transform: none; white-space: normal; }
  .board > .col.empty.picked .pill { align-self: flex-start; }
  .board > .col.empty.picked .col-none { display: block; }
}

/* Facts for a decision, and a customer at a glance (public/js/decide.js, views/customers.js): label beside value, stacked on a phone. */
.decide-facts { margin: 8px 0; display: grid; gap: 6px; }
.decide-facts > div { display: grid; grid-template-columns: minmax(96px, 30%) minmax(0, 1fr); gap: 2px 12px; }
.decide-facts dt { color: var(--ink-2); font-size: 14px; }
.decide-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
