@font-face{font-family:Archivo;src:url('/fonts/Archivo-latin-400_800.woff2') format('woff2');font-style:normal;font-weight:400 800;font-display:swap}
@font-face{font-family:Archivo;src:url('/fonts/Archivo-latin-ext-400_800.woff2') format('woff2');font-style:normal;font-weight:400 800;font-display:swap;unicode-range:U+0100-02FF,U+0304,U+0308,U+0329,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0}
/* Design system of the v2 client. Deep blue, sober and dense; shadows only on floating layers. */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/InstrumentSans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/fonts/InstrumentSans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/PlusJakartaSans-latin-ext-400_800.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/fonts/PlusJakartaSans-latin-400_800.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/IBMPlexSans-latin-ext-400_600.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/IBMPlexSans-latin-400_600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Newsreader; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/Newsreader-latin-ext-400_600.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Newsreader; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(/fonts/Newsreader-latin-400_600.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/IBMPlexMono-latin-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/IBMPlexMono-latin-500.woff2) format('woff2'); }

:root {
  --brand: #0066ff; --brand-link: #0066ff; --brand-soft: #edf3ff; --selection-ink: var(--accent-text, var(--accent)); --accent: #0066ff; --accent-hover: #0052cc; --accent-soft: #edf3ff; --accent-ink: #ffffff;
  --ink: #17243f; --ink-2: #465775; --ink-3: #5d6d8b; --bg: #f8faff; --surface: #ffffff; --surface-2: #f4f7fd;
  --sidebar: #f4f7fd; --sidebar-hover: #e9effa; --border: #dce5f5; --border-strong: #bdcbe0;
  --success: #1E7F55; --success-soft: #E4F4EC; --warning: #9A5B00; --warning-soft: #FDF6E6; --danger: #B8322A; --danger-soft: #FDECEB;
  --focus: 0 0 0 3px rgba(10, 102, 255, .3); --shadow: 0 10px 30px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .06);
  --radius: 8px; --radius-lg: 12px; --radius-chip: 11px; --t-body: 14px; --row: 36px; --sidebar-w: 244px; --panel-w: 480px;
  --font: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-title: Archivo, 'Instrument Sans', sans-serif; --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand-link: #83b6ff; --brand-soft: rgba(0, 102, 255, .18); --selection-ink: var(--accent);
  --accent: #6fa3ff; --accent-hover: #8db6ff; --accent-soft: rgba(10, 102, 255, .18); --accent-ink: #0f1012;
  --ink: #f2f2f4; --ink-2: #a0a0a6; --ink-3: #85858c; --bg: #0f1012; --surface: #17181b; --surface-2: #141518;
  --sidebar: #141518; --sidebar-hover: #202126; --border: #26272b; --border-strong: #34353b;
  --success: #49C08A; --success-soft: #143024; --warning: #E3A24A; --warning-soft: #33260F; --danger: #F07A70; --danger-soft: #3A1A18;
  --focus: 0 0 0 3px rgba(111, 163, 255, .4); --shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4); color-scheme: dark;
} }
:root[data-theme="dark"] {
  --brand-link: #83b6ff; --brand-soft: rgba(0, 102, 255, .18); --selection-ink: var(--accent);
  --accent: #6fa3ff; --accent-hover: #8db6ff; --accent-soft: rgba(10, 102, 255, .18); --accent-ink: #0f1012;
  --ink: #f2f2f4; --ink-2: #a0a0a6; --ink-3: #85858c; --bg: #0f1012; --surface: #17181b; --surface-2: #141518;
  --sidebar: #141518; --sidebar-hover: #202126; --border: #26272b; --border-strong: #34353b;
  --success: #49C08A; --success-soft: #143024; --warning: #E3A24A; --warning-soft: #33260F; --danger: #F07A70; --danger-soft: #3A1A18;
  --focus: 0 0 0 3px rgba(111, 163, 255, .4); --shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--t-body)/1.45 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-title); letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 20px; font-weight: 700; } h2 { font-size: 16px; font-weight: 700; } h3 { font-size: 13px; font-weight: 700; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--ink-3); } .small { font-size: 12px; } .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; min-width: 0; } .row { display: flex; align-items: center; gap: 8px; } .stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: var(--sidebar-hover); }
.btn.danger { color: var(--danger); } .btn.danger.primary { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.icon { width: 30px; padding: 0; } .btn.sm { height: 26px; padding: 0 8px; font-size: 13px; } .btn.sm.icon { width: 26px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--selection-ink); }
.input, .select, .textarea { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: var(--focus); outline: none; }
.input.invalid { border-color: var(--danger); }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.field .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }
.kbd { font-family: var(--font-mono); font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--ink-3); }

/* Chips, tags and avatars */
.chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; height: 22px; padding: 0 8px; border-radius: var(--radius-chip); font-size: 12px; font-weight: 500;
  background: var(--c-bg, var(--accent-soft)); color: var(--c-fg, var(--accent)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip.record { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.chip.record:hover { border-color: var(--accent); }
.chip .x { cursor: pointer; opacity: .6; } .chip .x:hover { opacity: 1; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-fg, var(--ink-3)); flex: none; }
.avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; background: var(--accent); flex: none; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.c-gray { --c-bg: #EEF1F5; --c-fg: #4B5568; } .c-blue { --c-bg: #E3ECFC; --c-fg: #1F4AA8; } .c-green { --c-bg: #E1F3E9; --c-fg: #1B6E48; }
.c-yellow { --c-bg: #FCF3D6; --c-fg: #7A5A00; } .c-orange { --c-bg: #FDE9D9; --c-fg: #9A4A0C; } .c-red { --c-bg: #FBE3E1; --c-fg: #A42C24; }
.c-purple { --c-bg: #EEE6FB; --c-fg: #5B33A8; } .c-pink { --c-bg: #FBE4EF; --c-fg: #A02763; } .c-teal { --c-bg: #DDF3F2; --c-fg: #136B66; } .c-brown { --c-bg: #F1E8DF; --c-fg: #6E4B2A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  .c-gray { --c-bg: #262F3F; --c-fg: #C5CDDA; } .c-blue { --c-bg: #1D2D50; --c-fg: #9DB9F5; } .c-green { --c-bg: #15362A; --c-fg: #7FD3A8; }
  .c-yellow { --c-bg: #3A3113; --c-fg: #EDD37A; } .c-orange { --c-bg: #3E2A17; --c-fg: #F2B27A; } .c-red { --c-bg: #3F1E1C; --c-fg: #F49B93; }
  .c-purple { --c-bg: #2E2346; --c-fg: #C4AAF2; } .c-pink { --c-bg: #3D1E2D; --c-fg: #F0A2C6; } .c-teal { --c-bg: #13353A; --c-fg: #7FD6CF; } .c-brown { --c-bg: #352A20; --c-fg: #D9B996; }
} }

/* Application layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.app.with-panel { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--panel-w); }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.sidebar .top { padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.ws-switch { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 8px; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; text-align: left; }
.ws-switch:hover { background: var(--sidebar-hover); }
.ws-logo { width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; }
.sidebar .search { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--ink-3); cursor: pointer; width: 100%; }
.sidebar nav { overflow-y: auto; padding: 4px 10px 12px; flex: 1; }
.nav-section { margin-top: 14px; } .nav-section > .label { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.nav-item { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 8px; border-radius: var(--radius); color: var(--ink-2); cursor: pointer; text-decoration: none !important; font-weight: 500; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border); }
.nav-item svg { flex: none; color: var(--ink-3); } .nav-item.active svg { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.nav-item [data-unread] { min-width: 18px; padding: 1px 6px; border-radius: 9px; background: var(--accent); color: var(--accent-ink, #fff); font-weight: 600; text-align: center; }
.sidebar .bottom { border-top: 1px solid var(--border); padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.topbar .title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { display: none; }
.tabs { display: flex; align-items: flex-end; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 0; background: transparent; border-bottom: 2px solid transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap; font-weight: 500; }
.tab:hover { color: var(--ink); } .tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .search-box { width: 220px; height: 28px; }
.content { flex: 1; min-height: 0; overflow: auto; position: relative; }
.page { max-width: 980px; margin: 0 auto; padding: 28px 24px 60px; }
.panel { border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Table */
.grid-wrap { overflow: auto; height: 100%; }
table.grid { border-collapse: separate; border-spacing: 0; min-width: 100%; table-layout: fixed; }
.grid th, .grid td { height: var(--row); padding: 0 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); text-align: left; vertical-align: middle;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); }
.grid.compact { --row: 31px; }
.grid thead th { position: sticky; top: 0; z-index: 2; height: 34px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); user-select: none; }
.grid thead th .th { display: flex; align-items: center; gap: 6px; cursor: pointer; } .grid thead th .th svg { color: var(--ink-3); flex: none; }
.grid .resize { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 3; }
.grid th { position: sticky; } .grid th.dragging { opacity: .5; } .grid th.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.grid .sel { width: 40px; padding: 0; text-align: center; position: sticky; left: 0; z-index: 1; }
.grid thead .sel { z-index: 3; }
.grid .primary { position: sticky; left: 40px; z-index: 1; font-weight: 600; }
.grid thead .primary { z-index: 3; }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid tbody tr.selected td { background: var(--accent-soft); }
.grid td.focus { box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.editing { padding: 0; overflow: visible; box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.editing .input, .grid td.editing .select { height: calc(var(--row) - 2px); border: 0; border-radius: 0; box-shadow: none; }
.grid td.readonly { color: var(--ink-2); }
.grid .open { opacity: 0; margin-left: 6px; } .grid tr:hover .open { opacity: 1; }
.grid .add-col { width: 44px; text-align: center; color: var(--ink-3); cursor: pointer; }
.grid-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-3); }
.cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.empty-cell { color: var(--ink-3); }
.bulkbar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px;
  background: var(--ink); color: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); z-index: 20; }
.bulkbar .btn { background: transparent; color: inherit; border-color: rgba(255, 255, 255, .25); } .bulkbar .btn:hover { background: rgba(255, 255, 255, .12); }

/* Kanban and calendar */
.board { display: flex; gap: 12px; padding: 14px; height: 100%; overflow-x: auto; align-items: flex-start; }
.column { flex: 0 0 280px; display: flex; flex-direction: column; max-height: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.column .head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; }
.column .cards { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; overflow-y: auto; min-height: 40px; }
.column.drop { border-color: var(--accent); background: var(--accent-soft); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 11px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: var(--border-strong); } .card.dragging { opacity: .5; }
.card .t { font-weight: 600; } .card .f { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--ink-2); }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--border); border-top: 1px solid var(--border); margin: 14px; }
.calendar .dow { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.calendar .day { min-height: 104px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.calendar .day.out { background: var(--surface-2); color: var(--ink-3); } .calendar .day.today .n { background: var(--accent); color: var(--accent-ink); border-radius: 10px; padding: 0 6px; }
.calendar .n { font-size: 12px; font-weight: 600; align-self: flex-start; }
.calendar .ev { font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Record */
.record-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.record-head .t { font-family: var(--font-title); font-size: 18px; font-weight: 700; flex: 1; min-width: 0; }
.record-body { flex: 1; overflow-y: auto; }
.attrs { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; }
.attrs > .k { padding: 7px 16px; color: var(--ink-3); font-size: 13px; display: flex; align-items: center; gap: 6px; min-height: 34px; }
.attrs > .v { padding: 4px 10px; min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; border-radius: var(--radius); cursor: pointer; min-width: 0; }
.attrs > .v:hover { background: var(--surface-2); } .attrs > .v.readonly { cursor: default; } .attrs > .v.readonly:hover { background: transparent; }
.section { padding: 14px 16px; border-top: 1px solid var(--border); } .section > h3 { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 8px; padding: 8px 0; }
.tl .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-3); }
.tl .when { font-size: 12px; color: var(--ink-3); }
.note { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 12px; background: var(--surface); white-space: pre-wrap; }
.record-page { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); min-height: 100%; }
.record-page > aside { border-right: 1px solid var(--border); }

/* Floating layers */
.overlay { position: fixed; inset: 0; background: rgba(13, 20, 38, .4); display: grid; place-items: start center; padding-top: 10vh; z-index: 50; }
.dialog { width: min(560px, calc(100vw - 32px)); max-height: 80vh; overflow: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); border: 1px solid var(--border); }
.dialog.wide { width: min(820px, calc(100vw - 32px)); }
.dialog header { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.dialog .body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.popover { position: fixed; z-index: 60; min-width: 200px; max-width: min(720px, calc(100vw - 16px)); max-height: 70vh; overflow: auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 6px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; text-align: left; }
.menu-item:hover, .menu-item.hl { background: var(--sidebar-hover); } .menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; } .menu-label { padding: 6px 8px 2px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.filter-row { display: grid; grid-template-columns: 70px minmax(120px, 1fr) minmax(110px, 1fr) minmax(120px, 1.2fr) 30px; gap: 6px; align-items: center; margin-bottom: 6px; }
.filter-group { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 8px; margin: 4px 0 8px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 70; }
.toast { min-width: 260px; max-width: 420px; padding: 10px 14px; border-radius: var(--radius-lg); background: var(--ink); color: var(--surface); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.toast.error { background: var(--danger); color: #fff; }
.palette { width: min(640px, calc(100vw - 32px)); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.palette input { width: 100%; height: 48px; border: 0; border-bottom: 1px solid var(--border); padding: 0 16px; font-size: 16px; background: transparent; outline: none; }
.palette .results { max-height: 50vh; overflow: auto; padding: 6px; }

/* Auth and onboarding */
/* Sign-in pages, as on bondossier.com: white page, the logo, a large title, grey fields and round buttons. */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 40px 16px; background: var(--bg);
  --accent: var(--brand); --accent-hover: #0052cc; --accent-ink: #fff; --accent-soft: var(--brand-soft); --accent-text: var(--brand-link); }
.auth-card { width: min(460px, 100%); display: flex; flex-direction: column; gap: 18px; padding: 32px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.auth-card > .brand { margin-bottom: 12px; }
.auth-card > p { margin: 0; }
.auth-card a:not(.btn) { color: var(--brand-link); }
.auth-card a.brand { color: var(--ink); }
.auth-card > h1 + p { margin-top: -8px; }
.auth-card h1 { font-size: 26px; line-height: 1.18; letter-spacing: -.035em; font-weight: 700; }
.auth-card .input, .auth-card .select { height: 44px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 15px; }
.auth-card .textarea { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 15px; }
.auth-card .btn { height: 44px; font-size: 14px; font-weight: 600; }
.auth-card .btn:not(.primary):not(.ghost) { background: var(--surface); border-color: var(--border-strong); }
.auth-card .btn:not(.primary):not(.ghost):hover { background: var(--sidebar-hover); }
.brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-title); font-weight: 750; font-size: 23px; letter-spacing: -.055em; }
.mark { flex: none; }
.brand .mark { width: 28px; height: 35px; }
.auth-card details > summary { cursor: pointer; color: var(--ink-2); }
.auth-card details > .stack { margin-top: 16px; margin-bottom: 12px; }
.auth-card .input:focus, .auth-card .select:focus, .auth-card .textarea:focus { border-color: var(--accent); }
@media (max-width: 480px) { .auth { padding: 24px 16px; } .auth-card { padding: 26px 20px; } .auth-card h1 { font-size: 24px; } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.pick { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 12px; background: var(--surface); cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.pick:hover { border-color: var(--accent); } .pick.on { border-color: var(--accent); box-shadow: var(--focus); }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.notice { padding: 10px 12px; border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--ink); border: 1px solid var(--border); }
.notice.warn { background: var(--warning-soft); } .notice.error { background: var(--danger-soft); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 4px; height: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty svg { color: var(--ink-3); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.list-table { width: 100%; border-collapse: collapse; } .list-table th, .list-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.list-table th { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.saving { font-size: 12px; color: var(--ink-3); }

/* Phones and small tablets: drawer sidebar, panels full screen, no horizontal page scroll. */
/* On a phone, buttons of the top bar show their icon only; their text stays in what screen readers announce. */
@media (max-width: 600px) {
  .topbar .btn .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 900px) {
  .app, .app.with-panel { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--shadow); }
  .app.drawer .sidebar { transform: none; }
  .menu-toggle { display: inline-flex; }
  .panel { position: fixed; inset: 0; z-index: 45; border-left: 0; }
  .toolbar .search-box { width: 100%; order: 10; }
  .page { padding: 18px 16px 48px; }
  .record-page { grid-template-columns: minmax(0, 1fr); } .record-page > aside { border-right: 0; border-bottom: 1px solid var(--border); }
  .filter-row { grid-template-columns: 1fr 1fr; }
  .attrs { grid-template-columns: minmax(96px, 40%) 1fr; }
}

/* Reports. The eight categorical slots and the five-step funnel ramp were checked with the data-viz validator
   against this app's card surfaces (#FFFFFF light, #151D2C dark): lightness band, chroma, colour-blind separation
   of neighbours, contrast. Three light slots sit under 3:1, so every chart has a legend or labels and a table view.
   Text never wears a series colour. */
:root {
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --series-other: #9aa3b2; --ordinal-1: #86b6ef; --ordinal-2: #5598e7; --ordinal-3: #2a78d6; --ordinal-4: #1c5cab; --ordinal-5: #104281;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --series-other: #66728a; --ordinal-1: #184f95; --ordinal-2: #256abf; --ordinal-3: #3987e5; --ordinal-4: #6da7ec; --ordinal-5: #9ec5f4;
} }
:root[data-theme="dark"] {
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --series-other: #66728a; --ordinal-1: #184f95; --ordinal-2: #256abf; --ordinal-3: #3987e5; --ordinal-4: #6da7ec; --ordinal-5: #9ec5f4;
}
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--border); color: var(--ink-3); }
.dash-filters .select { width: auto; max-width: 220px; color: var(--ink); }
.dash-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 0; }
.dash-head h2 { font-size: 18px; }
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 12px 16px 48px; align-items: start; transition: opacity .15s; }
.dash-grid.loading { opacity: .55; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; grid-column: span 2; }
.widget[data-w="1"] { grid-column: span 1; } .widget[data-w="3"] { grid-column: span 3; } .widget[data-w="4"] { grid-column: 1 / -1; }
.widget-head { display: flex; align-items: flex-start; gap: 4px; }
.widget-head h3 { font-family: var(--font); font-size: 14px; font-weight: 600; letter-spacing: 0; }
.widget-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.widget-body { min-width: 0; }
.widget-note { font-size: 12px; color: var(--ink-3); margin: 0; }
.widget-empty { margin: 8px 0; }
.widget-error { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); padding: 6px 0; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-family: var(--font); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); flex-wrap: wrap; }
.stat-delta.good { color: var(--success); } .stat-delta.bad { color: var(--danger); }
.stat-lines { color: var(--ink-2); display: flex; flex-direction: column; gap: 2px; }
.chart { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.legend-key { width: 10px; height: 10px; border-radius: 2px; flex: none; } .legend-key.line { width: 14px; height: 2px; border-radius: 1px; }
.hbars { display: flex; flex-direction: column; gap: 2px; }
.hbar-row { display: grid; grid-template-columns: minmax(64px, 32%) minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 28px; padding: 0 4px; border-radius: 4px; outline: none; }
.hbar-row:hover { background: var(--surface-2); } .hbar-row:focus-visible { background: var(--surface-2); box-shadow: var(--focus); }
.hbar-label { font-size: 12px; color: var(--ink-2); }
.hbar-track { display: flex; align-items: center; min-width: 0; }
.hbar-fill { display: flex; gap: 2px; height: 14px; min-width: 0; }
.hbar-seg { height: 100%; min-width: 2px; } .hbar-fill .hbar-seg:last-child { border-radius: 0 4px 4px 0; }
.hbar-value { font-size: 12px; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-canvas { width: 100%; position: relative; }
.chart-canvas svg { display: block; overflow: visible; }
.chart-canvas .grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-canvas .axis { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-canvas .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-canvas .mark { outline: none; }
.chart-canvas .mark:hover path, .chart-canvas .mark:focus path { filter: brightness(1.12); }
.chart-canvas .mark:focus-visible rect.hit, .chart-canvas rect.mark:focus-visible { stroke: var(--accent); stroke-width: 2; }
.chart-canvas .crosshair { stroke: var(--ink-3); stroke-width: 1; shape-rendering: crispEdges; }
.chart-canvas .dot { stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px 10px; font-size: 12px; min-width: 120px; max-width: 300px; display: flex; flex-direction: column; gap: 3px; }
.chart-tip-head { color: var(--ink-2); }
.chart-tip-row { display: flex; align-items: center; gap: 8px; } .chart-tip-row strong { font-variant-numeric: tabular-nums; }
.chart-key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
.chart-table-wrap { overflow-x: auto; }
.chart-table th[scope="row"] { font-size: 13px; color: var(--ink); font-weight: 500; }
.chart-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dialog.xwide { width: min(1100px, calc(100vw - 32px)); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.editor-preview { position: sticky; top: 0; }
.editor-preview .widget { grid-column: auto; }
.editor-preview-body.loading { opacity: .55; }
@media (max-width: 1200px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .widget[data-w="3"] { grid-column: span 2; } }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 40px; } .widget, .widget[data-w] { grid-column: 1 / -1; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); } .editor-preview { position: static; }
  .dash-head { flex-wrap: wrap; } .hbar-row { grid-template-columns: minmax(56px, 38%) minmax(0, 1fr) auto; }
}

/* Calls and meetings */
.call-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--ink); cursor: pointer; text-align: left; }
.call-row:hover, .call-row:focus-visible { background: var(--surface-2); }
.call-view section h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; margin: 6px 0 2px; }
.transcript { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow: auto; }
.transcript li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; }
.linklike { border: 0; background: transparent; padding: 0; color: var(--accent); cursor: pointer; font: inherit; text-align: left; }
.linklike:hover { text-decoration: underline; }
@media (max-width: 900px) { .transcript li { grid-template-columns: auto 1fr; } .transcript li > span { grid-column: 1 / -1; } }

/* Enrichment beside a record */
.enrichment h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.enrich-rows { display: flex; flex-direction: column; gap: 2px; margin: 6px 0; }
.enrich-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 28px; }
.enrich-value { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.enrich-value a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-row { display: block; width: 100%; text-align: left; cursor: pointer; margin-bottom: 8px; color: var(--ink); font: inherit; }
.email-row:hover, .email-row:focus-visible { border-color: var(--border-strong); }
/* Automations: workflows, sequences and the outbox (tool "workflows"). Colours come from the tokens above only,
   so the light and dark themes both apply; below 900px everything stacks in one column without page scroll. */
.auto-page { max-width: 1240px; margin: 0 auto; padding: 18px 24px 64px; }
.auto-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; color: var(--ink-2); }
.auto-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.auto-title { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.auto-name { height: 38px; font-family: var(--font-title); font-size: 18px; font-weight: 700; border-color: transparent; background: transparent; padding: 0 8px; margin-left: -8px; }
.auto-name:hover { border-color: var(--border); }
.auto-name-static { font-size: 18px; }
.auto-main .textarea[data-k="description"] { min-height: 58px; }
.auto-actions { justify-content: flex-end; }
.save-state { color: var(--ink-3); } .save-state.dirty { color: var(--warning); font-weight: 600; }
.row.wrap { flex-wrap: wrap; }
.subtabs { display: flex; flex-wrap: wrap; gap: 4px; }
.subtabs .count { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.subtabs .btn.active .count { color: inherit; }
.auto-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 18px; align-items: start; }
.auto-main, .auto-side { min-width: 0; }
.auto-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.auto-card.has-issues, .step-card.has-issues { border-color: var(--danger); }
.auto-card:focus-visible { box-shadow: var(--focus); outline: none; }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.field-row > * { flex: 1 1 150px; min-width: 0; }
.select-auto { width: auto; max-width: 100%; }
.with-vars { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.with-vars > .input, .with-vars > .textarea, .with-vars > .select, .with-vars > .row, .with-vars > .field-row { flex: 1; min-width: 0; }
.var-btn { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); flex: none; }
.var-picker { padding: 4px; gap: 8px; }
.var-list { max-height: 300px; overflow-y: auto; }
.var-item code { max-width: 46%; font-size: 11px; }
.issue { display: flex; align-items: flex-start; gap: 6px; color: var(--danger); font-size: 12px; }
.issue svg { flex: none; margin-top: 2px; }
.issue-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; text-align: left; font: inherit; }
.link-btn:hover { text-decoration: underline; }
.strong-link { font-weight: 600; }
.chip-x { border: 0; background: none; color: inherit; padding: 0; margin-left: 2px; cursor: pointer; display: inline-flex; opacity: .7; }
.chip-x:hover { opacity: 1; }

/* Steps, nested in branches */
.step-root, .step-branch { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.step-branch { margin-left: 10px; padding-left: 12px; border-left: 2px solid var(--border-strong); }
.step-branches { display: flex; flex-direction: column; gap: 12px; padding: 0 12px 12px; min-width: 0; }
.branch-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.switch-case { display: flex; flex-direction: column; gap: 8px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 10px; min-width: 0; }
.step-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); min-width: 0; }
.step-head { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; min-width: 0; }
.step-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 6px; border: 0; background: transparent; border-radius: var(--radius); cursor: pointer; text-align: left; color: var(--ink); }
.step-toggle:hover { background: var(--surface-2); } .step-toggle.static { cursor: default; } .step-toggle.static:hover { background: transparent; }
.step-icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.step-summary { min-width: 0; }
.step-id { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.step-body { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 14px; min-width: 0; }
.step-more > summary { cursor: pointer; color: var(--ink-2); }
.step-more[open] > summary { margin-bottom: 8px; }
.step-add { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: transparent; color: var(--ink-2); cursor: pointer; align-self: flex-start; font-weight: 500; }
.step-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.cond-editor { gap: 8px; }
.cond-summary { color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.var-cond { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(120px, 1fr) minmax(120px, 1fr) 30px; gap: 6px; align-items: center; }
.values-editor { gap: 6px; }
.value-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 30px; gap: 8px; align-items: center; }
.value-label { color: var(--ink-2); font-weight: 600; overflow-wrap: anywhere; }
.kv-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr) 30px; gap: 6px; align-items: center; }
.grant-list { display: flex; flex-direction: column; gap: 4px; }
.grant-row { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* Lists, details, traces */
/* Positioned, so hidden labels in a wide table stay inside its scroll area instead of widening the page. */
.table-wrap { overflow-x: auto; max-width: 100%; position: relative; }
.table-wrap .list-table td { vertical-align: top; }
.code-block { font-family: var(--font-mono); font-size: 12px; line-height: 1.5; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; color: var(--ink); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.trace { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.trace-item { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick-list { border: 1px solid var(--border); border-radius: var(--radius-lg); max-height: 260px; overflow-y: auto; padding: 4px; }
.pick-item { gap: 8px; } .pick-item input { flex: none; } .pick-pad { width: 14px; flex: none; }
.email-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.cap-bar { height: 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.cap-bar > span { display: block; height: 100%; background: var(--accent); }
.cap-bar.full > span { background: var(--warning); }
.block-form { align-items: center; }

@media (max-width: 1000px) {
  .auto-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .auto-page { padding: 14px 16px 48px; }
  .auto-actions { justify-content: flex-start; }
  .var-cond { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .var-cond > :first-child { grid-column: 1 / -1; }
  .value-row, .kv-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .value-row > .value-label { grid-column: 1 / -1; }
  .kv-row > :first-child { grid-column: 1 / -1; }
  .step-branch { margin-left: 4px; padding-left: 8px; }
  .step-body { padding: 4px 10px 12px; }
  .step-branches { padding: 0 8px 10px; }
  .kv { grid-template-columns: minmax(0, 1fr); } .kv dt { margin-top: 4px; }
}

/* Connecting an AI assistant: three short cards, the connected assistants, technical details folded away. */
.assistant-address { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.assistant-address .input { flex: 1 1 260px; min-width: 0; }
.assistant-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.assistant-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.assistant-card h3 { font-size: 15px; } .assistant-card p { margin: 0; } .assistant-card > .btn { align-self: flex-start; }
.assistant-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.assistant-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.assistant-row .who { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
details.tech { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 0 14px; }
details.tech > summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details.tech[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
details.tech h4 { font-size: 13px; margin: 8px 0 0; } details.tech p { margin: 0; }
.code-block { display: flex; gap: 8px; align-items: flex-start; min-width: 0; }
.code-block pre { flex: 1; min-width: 0; margin: 0; padding: 8px 10px; overflow-x: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); font-family: var(--font-mono); font-size: 12px; white-space: pre; }
.connect-card { width: min(480px, 100%); }
.connect-choice { display: flex; flex-direction: column; gap: 8px; }
.connect-choice .pick input { width: 15px; height: 15px; accent-color: var(--accent); }
.connect-actions { display: flex; flex-wrap: wrap; gap: 8px; } .connect-actions .btn { flex: 1 1 140px; height: 36px; }
@media (max-width: 600px) { .code-block { flex-direction: column; align-items: stretch; } .code-block .btn { align-self: flex-end; } }
/* Settings on a phone: the menu becomes a strip that scrolls sideways above the section, which gets the full width. */
@media (max-width: 900px) {
  .settings-layout { flex-direction: column; align-items: stretch !important; gap: 14px !important; }
  .settings-layout > .settings-nav { min-width: 0 !important; flex-direction: row; overflow-x: auto; gap: 4px !important; padding-bottom: 4px; }
  .settings-layout > .settings-nav .nav-item { flex: none; white-space: nowrap; }
  .settings-layout > .grow { width: 100%; }
}

/* Add context: the drop zone, the sources and their state in words, the documents to sort. */
.ctx-card { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ctx-card-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.ctx-state { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.ctx-state .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--ink-3); }
.ctx-state.ok .dot { background: var(--success); } .ctx-state.warn .dot { background: var(--warning); } .ctx-state.warn { color: var(--warning); }
.ctx-state.busy .dot { background: var(--accent); animation: ctx-pulse 1.2s ease-in-out infinite; } .ctx-state.off { color: var(--ink-2); font-weight: 400; }
@keyframes ctx-pulse { 50% { opacity: .35; } }
.ctx-drop { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.ctx-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.ctx-result { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 2px; }
.ctx-doc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; color: inherit; }
.ctx-doc:hover { background: var(--surface-2); }
.ctx-doc-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-3); flex: none; }
.ctx-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ctx-items li { padding: 4px 0; border-bottom: 1px solid var(--border); }
.ctx-address { padding: 4px 8px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); overflow-wrap: anywhere; }
.ctx-text { max-height: 50vh; overflow: auto; font-size: 13px; }
@media (max-width: 600px) { .ctx-card { padding: 12px; } .ctx-page { padding-left: 16px; padding-right: 16px; } }

/* Agents: one card per agent, then the journal. */
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
/* A group of choices (check boxes, radio buttons) laid out like a labelled field. */
div.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }
div.field > span:first-child { font-weight: 600; }
div.field .hint { color: var(--ink-3); font-size: 12px; }
div.field label { color: var(--ink); }
.agent-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 180px; }
.agent-sweep { border-top: 1px solid var(--border); padding-top: 10px; }
.agent-sweep p { margin: 0; }
.agent-sweep .btn { align-self: flex-start; white-space: normal; text-align: left; }
.agent-sweep-facts { margin: 0; font-size: 12px; display: grid; gap: 4px; }
.agent-sweep-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.agent-sweep-facts dt { color: var(--ink-3); }
.agent-sweep-facts dd { margin: 0; text-align: right; font-weight: 600; }
.agent-sweep-tables { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.agent-sweep-tables legend { font-size: 12px; padding: 0 4px; }
.agent-sweep-tables label { overflow-wrap: anywhere; }

/* Records at a glance: a tile with initials before a name, addresses as pills, a colored tile for each table. */
.mark-tile { flex: none; width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
  background: var(--c-bg); color: var(--c-fg); }
.mark-tile.round { border-radius: 50%; }
.mark-tile.lg { width: 30px; height: 30px; border-radius: 8px; font-size: 12px; }
.mark-tile.lg.round { border-radius: 50%; }
.column, .column .card { min-width: 0; }
.pill { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 22px; line-height: 20px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--accent); font-size: 12.5px; text-decoration: none !important; }
.pill:hover { border-color: var(--accent); }
a.underlined { text-decoration: underline; text-underline-offset: 2px; color: var(--accent); }
.obj-tile { flex: none; width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; background: var(--c-bg); }
.nav-item .obj-tile svg, .nav-item.active .obj-tile svg { color: var(--c-fg); }

/* Account setup: one decision at a time, with clear controls on a white page. */

.onboarding-card {width:min(860px,100%);}
.onboarding-steps {display:flex;gap:12px;padding:0;margin:8px 0 20px;list-style:none;font-size:12px;color:var(--muted);}
.onboarding-steps li {flex:1;border-top:2px solid var(--line);padding-top:10px;}
.onboarding-steps li.active {border-color:#0a66ff;color:var(--ink);}
.onboarding-steps li>span {display:block;font:12px monospace;margin-bottom:6px;}
.onboarding-choices {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}
.onboarding-choices .pick {text-align:left;display:flex;flex-direction:column;gap:9px;}
.onboarding-choices label.pick {flex-direction:row;align-items:center;}
.onboarding-plans {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.onboarding-plans .pick {text-align:left;display:flex;flex-direction:column;gap:12px;padding:22px 18px;}
.pick.on {border-color:var(--accent);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent);}
.plan-price {font-size:28px;font-weight:650;letter-spacing:-.04em;}
.plan-price small {font-size:12px;font-weight:400;letter-spacing:0;}
.trial-pill {font-size:12px;color:var(--brand-link);font-weight:600;}
.onboarding-actions {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:20px;}
.auth-providers {display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.auth-divider {display:flex;align-items:center;gap:12px;color:var(--ink-3);font-size:12px;}
.auth-divider::before,.auth-divider::after {content:'';height:1px;background:var(--border);flex:1;}
@media(max-width:640px){.onboarding-plans{grid-template-columns:1fr;}.onboarding-steps{gap:8px;font-size:10px;}.onboarding-choices{grid-template-columns:1fr;}.onboarding-card{padding:24px 18px;}.onboarding-plans .pick{padding:18px;}}
.agent-map{display:grid;grid-template-columns:1fr 32px 1fr 32px 1fr;align-items:center;gap:12px;padding:24px;border:1px solid var(--line);border-radius:12px;background:var(--surface);}
.agent-map-sources,.agent-map-roles{display:grid;gap:8px;}.agent-map-sources>span,.agent-map-roles>span,.agent-map-center{padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--paper);font-size:13px;}.agent-map-center{text-align:center;border-color:#0a66ff;color:#0a66ff;}.agent-map-arrow{text-align:center;color:var(--muted);font-size:24px;}.agent-map-roles>.agent-role-builder{border-left:3px solid #7756c4;}.agent-map-roles>.agent-role-coordinator{border-left:3px solid #c97a27;}.agent-map-roles>.agent-role-sales{border-left:3px solid #2b9367;}
@media(max-width:640px){.agent-map{grid-template-columns:1fr;padding:16px;}.agent-map-arrow{transform:rotate(90deg);}.agent-map-sources,.agent-map-roles{grid-template-columns:repeat(3,minmax(0,1fr));}.agent-map-sources>span,.agent-map-roles>span{font-size:11px;padding:8px;}}
.with-demo-banner{padding-top:42px}.demo-banner{position:absolute;top:0;left:0;right:0;height:42px;background:#e9f1ff;color:#183b70;display:flex;align-items:center;justify-content:center;gap:20px;font-size:12px;padding:4px 12px;z-index:35}.demo-banner a{color:inherit;text-decoration:underline}.demo-banner .btn{background:white}@media(max-width:600px){.with-demo-banner{padding-top:64px}.demo-banner{height:64px;gap:6px 12px;flex-wrap:wrap}.demo-banner>span{width:100%;text-align:center}}
/* A recovery copy's banner says more (date and origin), so on a phone it takes one more line. */
@media(max-width:600px){.with-recovery-banner{padding-top:88px}.recovery-banner{height:88px}}
.agent-card.agent-color-builder{border-top:3px solid #0a66ff}.agent-card.agent-color-coordinator{border-top:3px solid #8b57cf}.agent-card.agent-color-sales{border-top:3px solid #d17b24}

/* Daily work takes priority; setup stays available without occupying the dashboard. */
.home-page{max-width:1250px;margin:auto;padding:36px 36px 64px}
.home-intro{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:26px}
.home-intro h2{font-size:30px;letter-spacing:-.035em}.home-date{font:11px var(--font-mono);color:var(--ink-3);margin:0 0 10px}.home-intro p.muted{margin:8px 0 0}
.home-start{border-block:1px solid var(--border);padding:14px 0;margin-bottom:28px}.home-start summary,.welcome-options summary{cursor:pointer;font-weight:500}.home-start>p{margin-bottom:0}
.home-shortcuts{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}.home-shortcut{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border:1px solid var(--border);border-radius:8px;color:var(--ink);font-size:12px}.home-shortcut:hover{background:var(--surface-2);text-decoration:none}
.home-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:28px 32px;align-items:start}
.home-section{min-width:0}.home-section>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--border)}.home-section h2{font-size:15px}.home-primary>header{border-bottom:2px solid var(--accent)}
.home-section-body{padding-top:4px}.home-empty{font-size:13px;color:var(--ink-3);padding:14px 0;margin:0}
.home-task{display:flex;align-items:center;gap:12px;padding:14px 0;border-bottom:1px solid var(--border)}.home-task strong{font-size:13px;font-weight:500}.home-task>span{flex-shrink:0;max-width:36%;text-align:right}.home-overdue{color:var(--danger)}
.home-record-link{border:0;background:none;padding:2px 0;color:var(--ink-3);text-align:left;cursor:pointer}.home-record-link:hover{color:var(--accent)}
.home-record-group{margin:8px 0 16px}.home-group-title{color:var(--ink);padding:8px 0;font-size:12px}.home-record-row{width:100%;display:flex;align-items:center;gap:8px;background:transparent;border:0;padding:10px 0;color:var(--ink);text-align:left;cursor:pointer;border-bottom:1px solid var(--border)}.home-record-row>.grow{font-size:13px}.home-record-row:hover{background:var(--surface-2)}.home-record-row .chip{max-width:35%;overflow:hidden;text-overflow:ellipsis}
.home-activity{display:flex;align-items:flex-start;gap:12px;padding:12px 0;border-bottom:1px solid var(--border);color:var(--ink);font-size:13px}.home-activity>svg{margin-top:3px;flex-shrink:0;color:var(--ink-3)}.home-activity strong{display:block;font-weight:500}.home-activity small{display:block;color:var(--ink-3);margin-top:4px}
.welcome-card{width:min(680px,100%)}.welcome-card .brand{margin-bottom:16px}.welcome-card h1{font-size:28px}.welcome-card>.muted{margin:8px 0 28px}.welcome-fields{display:grid;grid-template-columns:1fr 1.4fr;gap:16px}.welcome-card .input,.welcome-card .select{min-height:42px}.welcome-card .stack{gap:18px}.welcome-options{padding:12px 0;border-top:1px solid var(--border)}.welcome-options>div{margin-top:16px}.welcome-plan{background:var(--surface-2);padding:18px;border:1px solid var(--border);border-radius:12px}.welcome-plan-summary{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.welcome-plan-summary strong{margin-right:auto}.welcome-plan .welcome-options{padding-bottom:0}.welcome-card .onboarding-plans{grid-template-columns:1fr}.welcome-card .plan-pick{gap:8px;padding:12px;cursor:pointer}.welcome-create.btn{height:44px;width:100%;font-size:14px}
.mobile-nav,.drawer-shade{display:none}
@media(max-width:900px){
 .app{padding-bottom:calc(62px + env(safe-area-inset-bottom))}.home-page{padding:24px 18px 36px}.home-grid{gap:24px}.home-intro h2{font-size:25px}
 .mobile-nav{position:fixed;inset:auto 0 0;z-index:36;display:flex;justify-content:space-around;height:calc(62px + env(safe-area-inset-bottom));padding:5px 6px calc(5px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--border)}
 .mobile-nav>.nav-item,.mobile-nav>button{display:flex;flex:1;min-width:0;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:100%;padding:4px;border:0;border-radius:8px;background:transparent;color:var(--ink-3);font-size:10px;text-decoration:none;cursor:pointer}.mobile-nav .grow{flex:none}.mobile-nav>.active{background:var(--accent-soft);color:var(--selection-ink)}.mobile-nav svg{width:18px;height:18px}
 .sidebar{visibility:hidden}.app.drawer .sidebar{visibility:visible}.app.drawer .drawer-shade{display:block;position:fixed;inset:0;z-index:39;border:0;background:#0005}
 .app.with-panel .mobile-nav{display:none}.app.with-panel{padding-bottom:0}
 .home-intro{align-items:flex-start}.home-intro>.btn{flex-shrink:0}.home-task{min-height:52px}.home-record-row{min-height:48px}
}
@media(max-width:600px){.home-grid{grid-template-columns:1fr}.home-intro{flex-wrap:wrap}.home-shortcuts{display:grid;grid-template-columns:1fr}.home-shortcut>svg:last-child{margin-left:auto}.welcome-fields{grid-template-columns:1fr}.welcome-card{padding:24px 20px}.agent-cards{grid-template-columns:minmax(0,1fr)}}
.agent-intro{display:flex;align-items:center;gap:20px}.agent-intro>.btn{flex-shrink:0}.agent-card>.row:last-of-type{flex-wrap:wrap}.agent-card>.btn:last-child{align-self:flex-start}
@media(max-width:640px){.agent-intro{align-items:flex-start;flex-direction:column}.agent-map-sources,.agent-map-roles{gap:6px}.agent-card{padding:16px}}
.task-title{border:0;background:none;padding:0;color:var(--ink);text-align:left;cursor:pointer}.task-title:hover{color:var(--accent);text-decoration:underline}
@media(max-width:600px){.tasks-table,.tasks-table tbody{display:block}.tasks-table tr{display:grid;grid-template-columns:28px minmax(0,1fr) auto;gap:8px 10px;padding:14px 0;border-bottom:1px solid var(--border)}.tasks-table td{display:block;padding:0;border:0;min-width:0}.tasks-table td:first-child{grid-column:1;grid-row:1/4;align-self:start}.tasks-table td:nth-child(2){grid-column:2/4}.tasks-table td:nth-child(3){grid-column:2/4}.tasks-table td:nth-child(4){grid-column:2;color:var(--ink-3)}.tasks-table td:nth-child(5){grid-column:3;align-self:end;text-align:right}.tasks-table .task-title{min-height:28px}}

@media(max-width:600px){.desktop-label{display:none}}

/* The conversation stays usable without a desktop history column on a phone. */
.agent-workspace{display:flex;min-width:0;min-height:0}
.agent-history{gap:2px;width:280px;flex-shrink:0;border-right:1px solid var(--border);padding:12px;overflow-y:auto}
.agent-conversation{min-width:0;overflow-wrap:anywhere}
.agent-conversation .row{flex-wrap:wrap}
.agent-conversation select{max-width:100%}
@media(max-width:700px){.agent-workspace{flex-direction:column}.agent-history{width:100%;max-height:150px;border-right:0;border-bottom:1px solid var(--border)}.agent-history:has(>:only-child){max-height:65px}.agent-workspace>.agent-history+div{min-height:340px}.topbar [role=status]{max-width:52%;font-size:11px}}

.import-page{max-width:1050px}.import-page h2{font-size:19px}.import-page p{margin:0}.import-page form>.btn{align-self:flex-start}.import-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px}.import-mapping{border:1px solid var(--border);border-radius:10px;overflow:hidden}.import-mapping-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:12px;border-bottom:1px solid var(--border)}.import-mapping-row:last-child{border-bottom:0}.import-mapping-row>div{min-width:0;overflow-wrap:anywhere}.import-counts{flex-wrap:wrap}.import-preview{display:grid;gap:8px;max-height:400px;overflow:auto;overflow-wrap:anywhere}.import-page input[type=file]{width:100%;height:auto}.import-page .home-activity{overflow-wrap:anywhere}.agent-runtime{padding:10px 18px;border-bottom:1px solid var(--border);font-size:12px}.agent-runtime summary{display:flex;align-items:center;gap:12px;flex-wrap:wrap;cursor:pointer}.agent-runtime>div{padding-top:12px;gap:8px}.agent-runtime p{margin:0}.agent-runtime .btn{align-self:flex-start}@media(max-width:600px){.import-fields,.import-mapping-row{grid-template-columns:minmax(0,1fr)}.agent-runtime{padding:8px 12px}.agent-runtime summary{gap:6px}.agent-runtime .chip{font-size:11px}}

/* Field options and view controls remain operable on narrow screens. */
.attribute-option { display: grid; grid-template-columns: 110px minmax(100px, 1fr) 28px 28px; gap: 8px; align-items: center; }
.attribute-option.status { grid-template-columns: 110px minmax(100px, 1fr) 120px 78px 28px 28px; }
.attribute-option > * { min-width: 0; }
.sort-row > .select:first-child { min-width: 0; flex: 1; }
.sort-row > .select:nth-child(2) { flex: 0 0 120px; }
@media (max-width: 600px) {
  .settings-heading { flex-wrap: wrap; }
  .settings-heading > .grow { flex-basis: 100%; }
  .attribute-option, .attribute-option.status { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px 28px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
  .attribute-option > .input:nth-child(2) { grid-column: 2 / -1; }
  .attribute-option > .select, .attribute-option > .input { width: 100% !important; }
  .attribute-option:not(.status) > button:first-of-type { grid-column: 3; }
}

.agent-usage { border-top: 1px solid var(--border); padding: 8px 0; overflow-wrap: anywhere; }
.agent-usage > div { padding-top: 8px; gap: 6px; }
.agent-usage p { margin: 0; }

/* Projects and Inbox follow the record-oriented workspace and its configured accent. */
.project-page, .inbox-page { max-width: 1120px; }
.project-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 12px 0; }
.project-stat { display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.project-stat strong { font-size: 22px; font-weight: 500; }
.project-summary > small, .project-summary > .notice { flex-basis: 100%; }
.project-row { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(130px, .7fr) auto; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); }
.project-name, .project-facts, .project-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.project-name { align-content: start; }.project-name > a { flex-basis: 100%; overflow-wrap: anywhere; color: var(--ink); }
.project-actions { justify-content: flex-end; }
.project-filters, .inbox-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.project-filters > .input { flex: 1 1 220px; width: auto; }.project-filters > .select { flex: 0 1 220px; width: auto; }
.inbox-filters > .select { flex: 1 1 180px; width: auto; }
.project-page .feature-error > button, .inbox-page .feature-error > button { align-self: flex-start; }
.inbox-entry { padding: 18px 0; border-bottom: 1px solid var(--border); }.inbox-entry.unread { border-left: 3px solid var(--accent); padding-left: 14px; }
.inbox-entry-heading { display: flex; gap: 12px; align-items: start; justify-content: space-between; }.inbox-entry h2 { font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.inbox-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 12px; }.inbox-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.notification-preferences { max-width: 620px; }.notification-preferences .field { flex: 1 1 180px; min-width: 0; }
[data-home-section=projects] { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .project-row { grid-template-columns: 1fr; gap: 10px; }.project-actions { justify-content: flex-start; }
  .project-summary { gap: 12px 20px; }.project-stat { flex-direction: column; gap: 2px; }
  .inbox-entry-heading { flex-wrap: wrap; gap: 6px; }.inbox-page .tabs { overflow-x: auto; }
}

.nav-entity{display:flex;align-items:center;gap:2px;min-width:0}.nav-entity>.nav-item{flex:1;min-width:0}.nav-entity>.entity-more{flex:none;width:28px;height:28px;padding:4px;color:var(--muted)}.record-actions{flex:none}.grid .primary .record-actions{width:26px;padding:3px;margin-left:0}.card .record-actions{align-self:start}

/* Appearance: the mode of the person, the style and the colour of the workspace. Each card is drawn in its own style. */
.account-row { gap: 2px; } .account-row .nav-item { min-width: 0; }
.look-section { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; } .look-section p { margin: 0; }
.look-modes { display: inline-flex; flex-wrap: wrap; gap: 6px; } .look-modes .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--selection-ink); }
.look-accent { width: 64px; height: 34px; padding: 2px; cursor: pointer; }
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 12px; }
.style-card { display: flex; flex-direction: column; gap: 3px; padding: 8px 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; }
.style-card:hover { border-color: var(--accent); } .style-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--focus); }
.style-card small { color: var(--ink-3); font-size: 12px; line-height: 1.35; }
.style-shot { display: grid; grid-template-columns: 26% 1fr; gap: 6px; height: 92px; margin-bottom: 6px; padding: 8px; overflow: hidden; border: 1px solid var(--style-line); background: var(--style-ground); border-radius: var(--style-rl); font-family: var(--style-ui); color: var(--style-ink); }
.style-shot i { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: var(--style-muted); opacity: .7; }
.style-side { padding: 5px; background: var(--style-surface); border-radius: var(--style-rm); } .style-side i:first-child { margin-top: 0; background: var(--accent); opacity: 1; }
.style-page { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 8px; background: var(--style-paper); border: 1px solid var(--style-line); border-radius: var(--style-rm); font-size: 15px; line-height: 1; overflow: hidden; white-space: nowrap; }

/* A small laptop keeps every tool in view: the sidebar tightens before it scrolls. */
@media (min-width: 861px) and (max-height: 720px) { .sidebar .nav-item { height: 22px; font-size: 13px; } .sidebar .nav-section { margin-top: 5px; } .sidebar .nav-section > .label { padding-bottom: 1px; } }
@media (min-width: 861px) and (max-height: 820px) { .nav-item { height: 25px; } .nav-section { margin-top: 8px; } .sidebar .top { padding: 8px 10px; gap: 4px; } .sidebar nav { padding-bottom: 4px; } .sidebar .bottom { padding: 4px 10px; gap: 0; } }

/* Agents and notification channels */
.agent-card { min-height: 0; } .agent-card.off > :not(.row:first-child) { opacity: .62; }
.switch { appearance: none; position: relative; flex: none; width: 32px; height: 18px; margin: 0; border-radius: 9px; background: var(--border-strong); cursor: pointer; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch:checked { background: var(--accent); } .switch:checked::after { left: 16px; } .switch:disabled { cursor: not-allowed; opacity: .5; }
.channel-table th:not(:first-child), .channel-table td:not(:first-child) { width: 104px; text-align: center; } .channel-off { display: block; font-weight: 400; }
.channel-table td:first-child { min-width: 130px; }

/* What a view adds up to, and how much is behind a tab */
.grid tfoot td { position: sticky; bottom: 0; z-index: 1; height: 34px; padding: 0 10px; border-top: 1px solid var(--border-strong); border-right: 1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid tfoot .primary, .grid tfoot .sel { z-index: 2; } .grid tfoot .muted { font-weight: 400; }
.column-sum { min-height: 18px; padding: 0 12px 6px; color: var(--ink-2); font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.tab-count { margin-left: 6px; padding: 0 6px; border-radius: 9px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 600; }

.agent-outreach { border-top: 1px solid var(--border); padding-top: 12px; } .agent-outreach p { margin: 0; }

/* Choosing a style when a workspace is created: one row that scrolls */
.style-strip { display: flex; gap: 8px; width: 0; min-width: 100%; overflow-x: auto; padding: 3px 3px 8px; scroll-snap-type: x proximity; }
.style-strip .style-card { flex: 0 0 132px; scroll-snap-align: start; } .style-strip .style-shot { height: 68px; padding: 6px; } .style-strip .style-page { padding: 5px; font-size: 12px; } .style-strip strong { font-size: 12px; font-weight: 600; }

.channel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); } .channel-row .grow { min-width: 120px; }

/* What was read on a website and built from it */
img.ws-logo { object-fit: contain; background: var(--surface); }
.site-found { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.site-logo { width: 44px; height: 44px; flex: none; object-fit: contain; border-radius: var(--radius); }
img.logo-on-dark { background: #1c2230; }
img.logo-on-light { background: #fff; }
.built-table { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); overflow-wrap: anywhere; }
.welcome-waiting { padding: 28px 0; text-align: center; }
/* Messages page: the conversations on the left, the thread being read on the right; on a phone, one at a time. */
.messages-content { padding: 0; }
.messages-layout { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); min-height: calc(100vh - 56px); }
.messages-list { border-right: 1px solid var(--border); overflow-y: auto; min-width: 0; }
.message-rows { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }
.message-row { display: grid; gap: 3px; width: 100%; padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; min-width: 0; }
.message-row:hover, .message-row:focus-visible { background: var(--surface-2); }
.message-row.active { background: var(--surface-2); border-color: var(--border-strong); }
.message-row-top, .message-row-subject { display: flex; align-items: center; gap: 8px; min-width: 0; }
.message-row-subject { font-size: 13px; color: var(--ink-2); }
.message-row-subject .count { font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: var(--radius-chip); background: var(--surface-2); color: var(--ink-2); }
.message-row-text { display: block; min-width: 0; }
.message-row-records { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.message-row-records .chip { cursor: default; max-width: 160px; }
.message-when { white-space: nowrap; flex-shrink: 0; }
.messages-more { padding: 10px 12px 18px; text-align: center; }
.messages-state { padding: 20px; display: grid; gap: 8px; justify-items: start; }
.messages-thread { min-width: 0; padding: 20px 24px 32px; overflow-y: auto; outline: none; }
.messages-choose { display: grid; place-items: center; align-content: center; gap: 8px; min-height: 50vh; text-align: center; }
.messages-back { display: none; margin-bottom: 8px; }
.thread-head { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.thread-head h2 { margin: 0; font-size: 20px; line-height: 1.3; overflow-wrap: anywhere; }
.thread-records { display: flex; flex-wrap: wrap; gap: 6px; }
.thread-messages { display: grid; gap: 12px; }
.message { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: 14px 16px; min-width: 0; }
.message.outbound { border-left: 3px solid var(--accent); }
.message-head { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.message-meta { display: grid; justify-items: end; gap: 4px; white-space: nowrap; flex-shrink: 0; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 10px; line-height: 1.55; }
.message-private { margin: 10px 0 0; }
.message-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.message-files .chip { max-width: 100%; }
@media (max-width: 900px) {
  .messages-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .messages-list { border-right: 0; }
  .messages-thread { display: none; padding: 14px 16px 28px; }
  .messages-layout.reading .messages-list { display: none; }
  .messages-layout.reading .messages-thread { display: block; }
  .messages-back { display: inline-flex; }
  .message-head { flex-direction: column; gap: 6px; }
  .message-meta { justify-items: start; grid-auto-flow: column; align-items: center; }
}

/* AI credits: the workspace card in Billing, and the operator panel on /team. */
.ai-credits { margin-top: 24px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); display: flex; flex-direction: column; gap: 10px; max-width: 680px; }
.ai-credits-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ai-credits-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-credits-value { font-size: 22px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.ai-credits-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.ai-credits-fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.ai-credits-fill.full { background: var(--warning); }
.ai-credits-op { margin: 20px 0 8px; max-width: none; }
.ai-credits-op td .chip { white-space: nowrap; }
.ai-credits-op .ai-credits-stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
