/* WindDash mockups. Style: framed sheet (tasteskill app sheet, seed 831732642).
   Face: the frame takes a cool grey from the product's name; the one hue (teal) sits on the main data. */
:root {
  --ground: #f2f5f6; --surface: #ffffff; --raised: #f4f6f8; --active: #e6eaec;
  --border: #e8eaec; --rule: #f0f1f2; --control: #cdced1;
  --text: #131416; --muted: #5d5f60; --faint: #63676a;
  --accent: #1b6c80; --positive: #1e7b4f; --negative: #c4242a; --warning: #92400e;
  --chart-1: #1b6c80; --chart-2: #2f70bb; --chart-3: #a86f0c; --chart-muted: #cfd5d8;
  --pill-neutral-bg: #ebedee; --pill-neutral-ink: #353736;
  --grid: #e9ecee;
  --radius-card: 8px; --radius-control: 6px; --radius-sheet: 16px; --sheet-inset: 8px;
  --row-height: 48px; --sidebar-width: 228px; --gap: 24px; --pad: 24px; --card-pad: 20px; --control-height: 32px;
  --fs-title: 22px; --fs-section: 16px; --fs-kpi: 24px; --fs-body: 14px; --fs-small: 12px;
  --font: "IBM Plex Sans", Inter, system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
}
body { min-height: 100svh; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ----- shell: tinted L-frame, white sheet inset 8px ----- */
.app { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { background: var(--ground); padding: 12px; }
.brand { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; font-weight: 600; font-size: 15px; }
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.scope { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; margin: 10px 0 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; cursor: pointer; }
.scope span { flex: 1; min-width: 0; line-height: 16px; }
.scope small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.scope span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scope svg { width: 14px; height: 14px; color: var(--muted); }
.nav-item .count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--negative); color: #fff; font-size: 12px; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-item.soon { color: var(--faint); }
.nav-item.soon em { margin-left: auto; font-style: normal; font-size: 12px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px; }
.user-row div { line-height: 16px; min-width: 0; }
.user-row small { display: block; color: var(--muted); font-size: 12px; }
.main { min-width: 0; display: flex; flex-direction: column; min-height: 100svh; }
.topbar { height: 48px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px 0 0; }
.search { display: flex; align-items: center; gap: 8px; width: 480px; max-width: 100%; height: 32px; margin: 0 auto; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--faint); }
.search svg { width: 14px; height: 14px; }
.search kbd { margin-left: auto; font: 12px var(--font); padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }
.topbar .m-only { display: none; }
.sheet { flex: 1; min-width: 0; margin: 0 var(--sheet-inset) var(--sheet-inset) 0; padding: var(--pad); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sheet); }
.title-row { align-items: flex-start; }
.title-row .sub b { color: var(--text); font-weight: 500; }
.title-row .actions { display: flex; gap: 8px; flex: none; }
.btn svg { width: 14px; height: 14px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.panel > header { margin-bottom: 12px; }
.panel h2 small { margin-left: 8px; font-size: 12px; font-weight: 400; color: var(--muted); }
.stack { display: grid; gap: var(--gap); }

.avatar { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 500; background: hsl(var(--h, 200) 45% 90%); color: hsl(var(--h, 200) 45% 22%); }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.none { background: var(--raised); color: var(--muted); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--negative); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); font-size: 12px; white-space: nowrap; flex: none; }

/* ----- overview ----- */
.kpis { grid-auto-flow: unset; grid-template-columns: 1.35fr repeat(4, minmax(0, 1fr)); }
.kpi.lead .kpi-value { font-size: 32px; }
.kpi-value { font-weight: 400; }
.kpi-label { font-weight: 500; }
.funnel { display: grid; gap: 2px; }
.funnel .f-row { display: grid; grid-template-columns: 148px minmax(0, 1fr) 44px 92px; align-items: center; gap: 12px; height: 35px; }
.funnel .f-bar { height: 18px; border-radius: 2px; background: var(--chart-1); }
.funnel .f-row:last-child .f-name { font-weight: 500; }
.funnel .f-n { text-align: right; font-variant-numeric: tabular-nums; }
.funnel .f-step { text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.funnel .f-step.low { color: var(--negative); }
table.tight th, table.tight td { padding-left: 0; padding-right: 16px; }
table.tight th:last-child, table.tight td:last-child { padding-right: 0; }
tfoot td { border-top: 1px solid var(--border); border-bottom: 0; font-weight: 500; }
td.bad { color: var(--negative); }
.wait-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; }
.wait-row + .wait-row { border-top: 1px solid var(--rule); }
.wait-row .who { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wait-row .who span { font-weight: 400; color: var(--muted); }
.wait-row .said { grid-column: 1; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wait-row .t { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.wait-row .t.late { color: var(--negative); font-weight: 500; }
.wait-row .act { grid-column: 2; grid-row: 2; text-align: right; font-size: 13px; font-weight: 500; }

/* ----- leads board ----- */
.filters .input { height: 32px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(204px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col > header { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 8px; margin-bottom: 8px; border-bottom: 2px solid var(--border); }
.col > header h2 { font-size: 14px; font-weight: 600; white-space: nowrap; }
.col > header .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.col > header .late { margin-left: auto; font-size: 12px; color: var(--negative); white-space: nowrap; }
.card { display: block; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.card:hover { border-color: var(--control); }
.card .name { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.card .name b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .line { margin-top: 2px; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.card .foot .age { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .foot .age.late { color: var(--negative); font-weight: 500; }
.card .foot .age.slow, .lead-row .age.slow { color: var(--text); font-weight: 500; }
.m-filters { display: none; }
.col .more { display: block; padding: 6px 2px; font-size: 13px; font-weight: 500; }
.stage-chips, .lead-list { display: none; }

/* ----- inbox: three panes ----- */
.sheet.panes { padding: 0; display: grid; grid-template-columns: 320px minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr); height: calc(100svh - 48px - var(--sheet-inset)); overflow: hidden; }
.sheet.panes { flex: none; }
td .sub { white-space: nowrap; }
.pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.pane + .pane { border-left: 1px solid var(--border); }
.pane-head { flex: none; padding: 20px 20px 12px; }
.pane-head h1 { font-size: var(--fs-title); font-weight: 600; line-height: 1.2; }
.pane-head .sub { margin-top: 4px; color: var(--muted); }
.pane-head .segmented { margin-top: 12px; }
.pane-body { flex: 1; min-height: 0; overflow: auto; }
.conv { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 20px; border-top: 1px solid var(--rule); }
.conv[aria-current="true"] { background: var(--active); }
.conv .avatar { grid-row: span 2; margin-top: 2px; }
.conv .who { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.conv .t.late { color: var(--negative); font-weight: 500; }
.conv .said { grid-column: 2 / 4; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.thread-head h2 { font-size: 16px; font-weight: 600; }
.thread-head .meta { color: var(--muted); font-size: 13px; }
.thread-head .actions { margin-left: auto; display: flex; gap: 8px; }
.back { display: none; }
.thread { padding: 16px 20px; display: grid; gap: 10px; align-content: start; }
.day { justify-self: center; font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.event { justify-self: center; max-width: 100%; display: flex; align-items: flex-start; text-align: left; gap: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.event svg { width: 14px; height: 14px; flex: none; margin-top: 3px; }
.msg { max-width: min(76%, 460px); padding: 9px 12px; border-radius: 12px; background: var(--raised); justify-self: start; }
.msg.out { justify-self: end; background: #e3eff2; }
.msg .by { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.msg time { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.file { display: flex; align-items: center; gap: 10px; }
.file .thumb { width: 36px; height: 44px; flex: none; border: 1px solid var(--control); border-radius: 3px; background: var(--surface); display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--muted); }
.file small { display: block; color: var(--muted); font-size: 12px; }
.composer { flex: none; margin: 0 20px 20px; border: 1px solid var(--control); border-radius: 8px; }
.composer .notice { padding: 8px 12px; background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: 13px; border-bottom: 1px solid #fde68a; border-radius: 8px 8px 0 0; }
.composer .draft { padding: 10px 12px; min-height: 64px; }
.composer .draft small { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.composer .bar { display: flex; align-items: center; gap: 8px; padding: 8px; border-top: 1px solid var(--rule); }
.composer .bar .btn.primary { margin-left: auto; }
.profile { padding: 20px; display: grid; gap: 20px; align-content: start; }
.profile h3 { font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.profile h3 small { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }
.profile h3 { white-space: nowrap; }
.doc svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.doc span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile h3 .btn { margin-left: auto; align-self: center; }
.id-row { display: flex; align-items: center; gap: 12px; }
.id-row strong { display: block; font-size: 16px; font-weight: 600; }
.id-row span { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.well { background: var(--raised); border-radius: 8px; padding: 4px 12px; }
.ai-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; align-items: center; padding: 8px 0; font-size: 13px; }
.ai-row + .ai-row { border-top: 1px solid var(--border); }
.ai-row dt { color: var(--muted); font-size: 12px; }
.ai-row dd { grid-column: 1; }
.ai-row .ok { grid-row: span 2; grid-column: 2; font-weight: 500; font-size: 13px; }
.ai-row .low { color: var(--warning); font-size: 12px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.doc + .doc { border-top: 1px solid var(--rule); }
.doc .tag { margin-left: auto; }
.stage-steps { display: flex; gap: 3px; margin-top: 10px; }
.stage-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--chart-muted); }
.stage-steps i.done { background: var(--chart-1); }
.pane-tabs { display: none; }

/* ----- data sources ----- */
.src-name { font-weight: 500; }
.master { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.switch:checked { background: var(--accent); }
.switch:disabled { opacity: 0.55; cursor: not-allowed; }
.err-line { display: block; margin-top: 4px; font-size: 12px; color: var(--pill-negative-ink); white-space: normal; }
.err-line a { font-weight: 500; text-decoration: underline; }
.prog { padding: 10px 0; }
.prog + .prog { border-top: 1px solid var(--rule); }
.prog .top { display: flex; justify-content: space-between; gap: 12px; }
.prog .top span { color: var(--muted); font-variant-numeric: tabular-nums; }
.prog .track { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--chart-muted); overflow: hidden; }
.prog .track i { display: block; height: 100%; background: var(--chart-1); }
.note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.m-rows { display: none; }

/* ----- tablet and phone: the frame disappears, the sheet becomes the screen ----- */
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; background: var(--surface); transform: translateX(-100%); visibility: hidden; }
  .sidebar.open { transform: none; visibility: visible; }
  .topbar { padding: 0 12px; gap: 8px; position: sticky; top: 0; z-index: 10; background: var(--ground); }
  .topbar .m-only { display: inline-flex; }
  .topbar .d-only { display: none; }
  .topbar .brand { padding: 0; flex: 1; }
  .icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; border-radius: 8px; cursor: pointer; position: relative; }
  .icon-btn svg { width: 20px; height: 20px; }
  .icon-btn .count { position: absolute; top: 4px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--negative); color: #fff; font-size: 11px; line-height: 16px; }
  .sheet { margin: 0; border-radius: 0; border-width: 1px 0 0; }
  .grid > * { grid-column: 1 / -1 !important; }
  .sheet.panes { grid-template-columns: 300px minmax(0, 1fr); height: calc(100svh - 48px); }
  .sheet.panes .pane.side { display: none; }
}
@media (max-width: 860px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis .kpi { border-left: 0 !important; border-top: 1px solid var(--border) !important; grid-column: auto !important; }
  .kpis .kpi.lead { grid-column: 1 / -1 !important; border-top: 0 !important; }
  .kpis .kpi:nth-child(2n + 1):not(.lead) { border-left: 1px solid var(--border) !important; }
}
@media (max-width: 640px) {
  :root { --gap: 16px; --card-pad: 16px; }
  .sheet { padding: 16px; }
  .title-row { margin-bottom: 16px; }
  .title-row .actions { width: 100%; }
  .title-row .actions .btn { flex: 1; height: 44px; }
  .title-row .actions .btn.range { flex: none; }
  .funnel .f-row { grid-template-columns: 136px minmax(0, 1fr) 36px 0; gap: 8px; }
  .panel > header .meta, .panel h2 small { display: none; }
  .thread-head > div { min-width: 0; }
  .thread-head .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thread-head .btn { white-space: nowrap; flex: none; }
  .funnel .f-step { display: none; }
  .funnel .f-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .src-table .hide-s { display: none; }
  /* leads: the board becomes stage chips over one list */
  .board, .filters .hide-s { display: none; }
  .filters .input { flex: 1; min-width: 0; height: 44px; }
  .filters .btn { height: 44px; }
  .stage-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 8px; padding: 0 0 4px; scrollbar-width: none; }
  .m-filters { display: inline-flex; }
  .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--control); border-radius: 18px; background: var(--surface); white-space: nowrap; }
  .chip span { color: var(--muted); font-variant-numeric: tabular-nums; }
  .chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
  .chip[aria-pressed="true"] span { color: #d7dadc; }
  .lead-list { display: block; }
  .lead-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 0 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--rule); }
  .lead-row .avatar { width: 32px; height: 32px; grid-row: span 2; }
  .lead-row b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .lead-row .age { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
  .lead-row .age.late { color: var(--negative); font-weight: 500; }
  .lead-row .line { grid-column: 2 / 4; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* inbox: one region at a time */
  .sheet.panes { display: block; height: auto; overflow: visible; }
  .sheet.panes .pane { border: 0; }
  .sheet.panes .pane.mid, .sheet.panes .pane.side { display: none; }
  .pane-head, .conv { padding-left: 16px; padding-right: 16px; }
  .conv { grid-template-columns: 32px minmax(0, 1fr) auto; padding-top: 12px; padding-bottom: 12px; }
  .conv .avatar { width: 32px; height: 32px; }
  .conv[aria-current="true"] { background: none; }
  body.view-thread .sheet.panes .pane.list { display: none; }
  body.view-thread .sheet.panes .pane.mid { display: flex; min-height: calc(100svh - 49px); }
  body.view-thread .thread-head { padding: 10px 12px; gap: 8px; }
  body.view-thread .thread-head .actions .btn:not(.primary) { display: none; }
  .back { display: inline-grid; }
  .pane-tabs { display: flex; gap: 20px; padding: 0 16px; border-bottom: 1px solid var(--border); }
  .pane-tabs a { position: relative; padding: 10px 0; color: var(--muted); }
  .pane-tabs a[aria-selected="true"] { color: var(--text); font-weight: 500; }
  .pane-tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--text); }
  .pane-tabs a span { color: var(--warning); }
  .thread { padding: 12px 16px; }
  .msg { max-width: 86%; }
  .composer { margin: 0 12px 12px; }
  .composer .bar .btn { height: 40px; }
  /* sources: the table becomes two-line rows */
  .src-wrap { display: none; }
  .m-rows { display: block; }
  .m-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); }
  .m-row b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-row .line { grid-column: 1; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-row .switch { grid-column: 2; grid-row: 1 / 3; width: 44px; height: 26px; }
  .m-row .switch::after { width: 22px; height: 22px; }
  .m-row .switch:checked::after { transform: translateX(18px); }
  .m-row .err-line { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  body.view-thread .thread-head { padding-right: 16px; }
  .thread-head .btn { padding: 0 10px; font-size: 13px; }
  .composer .bar .btn { white-space: nowrap; padding: 0 9px; font-size: 13px; }
}
