/* ANI OS HQ — design system. Slate Studio: IBM Plex Sans, slate ink, cool grays, green accent, red as punctuation only. Graphite dark mode. */
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: italic; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-sans-latin-500-italic.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }
:root {
  color-scheme: light;
  --bg: #F4F5F7; --surface: #FFFFFF; --surface-2: #EEF0F3; --surface-3: #E6E9EE; --hover: #F7F8FA; --line: #E2E5EA; --line-2: #D1D6DE;
  --ink: #0F172A; --ink-2: #3F4A5F; --ink-3: #7B8798; --ink-4: #AEB7C4; --ink-5: #D3D9E1;
  --accent: #2E9E6B; --accent-ink: #FFFFFF; --accent-soft: #E4F3EB; --accent-soft-2: #C9E8D7;
  --btn-bg: #0F172A; --btn-ink: #FFFFFF; --btn-hover: #1E293B;
  --red: #E02B1D; --red-soft: #FBE8E6; --blue: #2563EB; --blue-soft: #E5EDFF; --green: #10B981; --green-soft: #DFF6EC; --amber: #F59E0B; --amber-soft: #FEF3DC; --purple: #8B5CF6; --purple-soft: #EEE8FE; --teal: #0F766E;
  --overlay: rgba(15,23,42,.36); --pill-alpha: 14%;
  --radius: 8px; --radius-sm: 6px; --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow: 0 4px 16px rgba(15,23,42,.10), 0 1px 3px rgba(15,23,42,.06);
  --shadow-lg: 0 16px 48px rgba(15,23,42,.16), 0 2px 8px rgba(15,23,42,.08);
  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', 'SF Mono', Menlo, Consolas, monospace;
  --sidebar-w: 236px; --rail-w: 60px; --topbar-h: 46px; --fs: 12.5px; --row-h: 32px;
  --seal: url('/brand/ani-seal-black-128.png'); --seal-on-ink: url('/brand/ani-seal-white-128.png'); --icon-cut: #FFFFFF;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #15181F; --surface: #1B1F27; --surface-2: #232834; --surface-3: #2B3140; --hover: #20242E; --line: #2B3140; --line-2: #363D4E;
  --ink: #EAE7E0; --ink-2: #B9BDC7; --ink-3: #7F8695; --ink-4: #5A6170; --ink-5: #3E4553;
  --accent: #3DBF85; --accent-ink: #0F172A; --accent-soft: rgba(61,191,133,.16); --accent-soft-2: rgba(61,191,133,.3);
  --btn-bg: #EAE7E0; --btn-ink: #15181F; --btn-hover: #FFFFFF;
  --red: #F0473B; --red-soft: rgba(224,43,29,.2); --blue: #5B8DEF; --blue-soft: rgba(91,141,239,.2); --green: #2ECF95; --green-soft: rgba(16,185,129,.2); --amber: #F7B23B; --amber-soft: rgba(245,158,11,.2); --purple: #A585FA; --purple-soft: rgba(139,92,246,.22); --teal: #2AA79A;
  --overlay: rgba(0,0,0,.55); --pill-alpha: 22%; --seal: url('/brand/ani-seal-white-128.png'); --icon-cut: #1B1F27;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
} }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #15181F; --surface: #1B1F27; --surface-2: #232834; --surface-3: #2B3140; --hover: #20242E; --line: #2B3140; --line-2: #363D4E;
  --ink: #EAE7E0; --ink-2: #B9BDC7; --ink-3: #7F8695; --ink-4: #5A6170; --ink-5: #3E4553;
  --accent: #3DBF85; --accent-ink: #0F172A; --accent-soft: rgba(61,191,133,.16); --accent-soft-2: rgba(61,191,133,.3);
  --btn-bg: #EAE7E0; --btn-ink: #15181F; --btn-hover: #FFFFFF;
  --red: #F0473B; --red-soft: rgba(224,43,29,.2); --blue: #5B8DEF; --blue-soft: rgba(91,141,239,.2); --green: #2ECF95; --green-soft: rgba(16,185,129,.2); --amber: #F7B23B; --amber-soft: rgba(245,158,11,.2); --purple: #A585FA; --purple-soft: rgba(139,92,246,.22); --teal: #2AA79A;
  --overlay: rgba(0,0,0,.55); --pill-alpha: 22%; --seal: url('/brand/ani-seal-white-128.png'); --icon-cut: #1B1F27;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); font-size: var(--fs); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; line-height: 1.45; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
input, textarea, select { outline: none; }
::selection { background: var(--accent-soft-2); }
svg.ic { flex: none; vertical-align: middle; }
#app { height: 100%; }
[hidden] { display: none !important; }

/* typography */
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.h2 { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--ink-3); } .muted-2 { color: var(--ink-2); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.mono { font-family: var(--mono); font-size: 11.5px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; } .col { display: flex; flex-direction: column; min-width: 0; } .grow { flex: 1 1 auto; min-width: 0; } .wrap { flex-wrap: wrap; }
.gap-2 { gap: 4px; } .gap-3 { gap: 6px; } .gap-4 { gap: 8px; } .gap-6 { gap: 12px; } .gap-8 { gap: 16px; }
.mt-2 { margin-top: 4px; } .mt-3 { margin-top: 8px; } .mt-4 { margin-top: 12px; } .mt-6 { margin-top: 18px; } .mt-8 { margin-top: 24px; } .mb-3 { margin-bottom: 8px; } .mb-4 { margin-bottom: 12px; } .mb-6 { margin-bottom: 18px; }
.p-4 { padding: 12px; } .p-6 { padding: 18px; } .px-4 { padding-left: 12px; padding-right: 12px; }
.hide { display: none !important; }
.center { display: flex; align-items: center; justify-content: center; }
.right { margin-left: auto; }
.pointer { cursor: pointer; }
.red { color: var(--red); } .green { color: var(--green); } .blue { color: var(--blue); } .amber { color: var(--amber); }

/* layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: 100vh; height: 100vh; }
.app.collapsed { --sidebar-w: var(--rail-w); }
.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; background: var(--bg); }
.content { flex: 1; min-height: 0; overflow: auto; position: relative; }
.page { padding: 20px 28px 60px; max-width: 1400px; margin: 0 auto; }
.page.wide { max-width: none; }
.page.narrow { max-width: 880px; }
/* the sheet: Home sits centered like a page of paper, same width as a Space overview */
.page.sheet { max-width: 1000px; padding: 24px 20px 80px; }
.page.sheet .cardgroup.stack { max-width: none; }

/* sidebar (icon rail by default: hover to expand, pin to keep open) */
.sidebar { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; user-select: none; position: relative; z-index: 600; width: var(--sidebar-w); }
.app.collapsed .sidebar { width: var(--rail-w); transition: width .14s ease, box-shadow .14s ease; }
.app.collapsed .sidebar:hover, .app.collapsed .sidebar.peek { width: 236px; box-shadow: var(--shadow-lg); transition-delay: .1s; }
.sb-top { height: var(--topbar-h); display: flex; align-items: center; padding: 0 10px 0 12px; gap: 10px; border-bottom: 1px solid var(--line); }
.sb-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; cursor: pointer; }
.sb-logo { width: 30px; height: 30px; flex: none; background: var(--seal) center / contain no-repeat; font-size: 0; color: transparent; }
.sb-logo.on-ink { background-image: var(--seal-on-ink); }
.sb-logo.lg { width: 44px; height: 44px; }
.sb-logo.photo { background: var(--surface-3); border-radius: 50%; overflow: hidden; } .sb-logo.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* light icon style (default): thin outline icons, neutral active pill, no tint */
.icons-light .sb-item { color: var(--ink-2); } .icons-light .sb-item .ic { color: var(--ink-3); } .icons-light .sb-item:hover .ic { color: var(--ink-2); }
.icons-light .sb-item.active { background: var(--surface-3); color: var(--ink); font-weight: 500; } .icons-light .sb-item.active .ic { color: var(--ink); }
.icons-light .mtabs .mt.on { color: var(--ink); }
.sb-name { font-weight: 600; font-size: 13px; letter-spacing: -.01em; }
.sb-sub { font-size: 10px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.sb-scroll { flex: 1; overflow: auto; padding: 8px 8px 20px; overflow-x: hidden; }
.sb-section { margin-top: 14px; }
.sb-section-h { display: flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); cursor: pointer; border-radius: var(--radius-sm); white-space: nowrap; }
.sb-section-h:hover { color: var(--ink); background: var(--surface-2); }
.sb-section-h .ic { transition: transform .15s; } .sb-section-h.closed .ic.caret { transform: rotate(-90deg); }
.sb-item { display: flex; align-items: center; gap: 9px; height: 28px; padding: 0 8px; border-radius: var(--radius-sm); color: var(--ink-2); cursor: pointer; font-size: 12.5px; position: relative; white-space: nowrap; }
.sb-item:hover { background: var(--surface-2); color: var(--ink); }
.sb-item.active { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sb-item .ic { color: var(--ink-3); flex: none; } .sb-item.active .ic { color: var(--accent); } .sb-item .ic-filled { color: var(--ink-3); } .sb-item:hover .ic-filled { color: var(--ink-2); } .sb-item.active .ic-filled { color: var(--accent); }
.avatar.seal { background-image: var(--seal-on-ink); background-size: 78%; background-position: center; background-repeat: no-repeat; }
.sb-item .badge { margin-left: auto; }
.sb-item .actions { margin-left: auto; display: none; gap: 2px; } .sb-item:hover .actions { display: flex; }
.sb-item.lvl1 { padding-left: 22px; } .sb-item.lvl2 { padding-left: 36px; } .sb-item.lvl3 { padding-left: 50px; }
.sb-dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.sb-space-ic { width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; flex: none; }
.app.collapsed .sidebar:not(:hover):not(.peek) .sb-name, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-sub, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item span.lbl, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-section-h span, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item .actions, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-caret, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-pin, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-invite { display: none; }
.app.collapsed .sidebar:not(:hover):not(.peek) .sb-item { justify-content: center; padding: 0; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl1, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl2, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl3 { display: none; }
.app.collapsed .sidebar:not(:hover):not(.peek) .sb-top { padding: 0; justify-content: center; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-brand { flex: none; justify-content: center; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-brand .col { display: none; }
.app.collapsed .sidebar:not(:hover):not(.peek) .sb-item .badge { position: absolute; top: 2px; right: 6px; min-width: 14px; height: 14px; font-size: 9px; padding: 0 3px; }
.app.collapsed .sidebar:not(:hover):not(.peek) .sb-section-h { justify-content: center; padding: 4px 0; }
.sb-foot { border-top: 1px solid var(--line); padding: 8px; }
.sb-caret { color: var(--ink-4); transition: transform .15s; width: 14px; display: inline-flex; justify-content: center; } .sb-caret.open { transform: rotate(90deg); }
.sb-pin { color: var(--ink-4); } .sb-pin.on { color: var(--accent); }
.task-id { font-family: var(--mono); font-size: 11px; color: var(--ink-3); } .ids-hidden .task-id { display: none; }

/* topbar */
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 8px; padding: 0 16px 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex: none; }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; }
.crumbs .crumb { color: var(--ink-3); padding: 3px 6px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.crumbs .crumb:hover { background: var(--surface-2); color: var(--ink); }
.crumbs .crumb.cur { color: var(--ink); font-weight: 600; }
.crumbs .sep { color: var(--ink-5); }
.searchbtn { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink-3); width: 300px; cursor: text; }
.searchbtn:hover { border-color: var(--line-2); }
.searchbtn .kbd { margin-left: auto; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--surface-2); border-color: var(--ink-4); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); } .btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.danger { color: var(--red); border-color: var(--red-soft); background: var(--surface); } .btn.danger:hover { background: var(--red-soft); }
.btn.danger.solid { background: var(--red); color: #fff; border-color: var(--red); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); } .btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.soft { background: var(--accent-soft); border-color: transparent; } .btn.soft:hover { background: var(--accent-soft-2); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12px; } .btn.xs { height: 22px; padding: 0 6px; font-size: 11.5px; gap: 4px; } .btn.lg { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.active { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--radius-sm); color: var(--ink-3); flex: none; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn.sm { width: 22px; height: 22px; } .iconbtn.active { background: var(--accent-soft); color: var(--ink); }
.iconbtn.danger:hover { color: var(--red); background: var(--red-soft); }
.kbd { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); font-size: 10.5px; font-family: var(--font); font-weight: 500; }

/* inputs */
.input { height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); width: 100%; font-size: 13px; transition: border-color .12s, box-shadow .12s; }
.input:focus { border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 28px; font-size: 12.5px; } .input.lg { height: 40px; font-size: 14px; }
textarea.input { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237C8596' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.help { font-size: 12px; color: var(--ink-3); }
.inline-edit { border: 1px solid transparent; border-radius: var(--radius-sm); padding: 2px 6px; margin: -2px -6px; min-width: 40px; }
.inline-edit:hover { border-color: var(--line-2); background: var(--surface); } .inline-edit:focus { border-color: var(--ink-3); background: var(--surface); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle { position: relative; width: 34px; height: 20px; border-radius: 20px; background: var(--ink-5); transition: background .15s; flex: none; cursor: pointer; }
.toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.toggle.on { background: var(--accent); } .toggle.on::after { transform: translateX(14px); }
.toggle.sm { width: 28px; height: 16px; } .toggle.sm::after { width: 12px; height: 12px; } .toggle.sm.on::after { transform: translateX(12px); }
.checkbox { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--ink-4); display: inline-flex; align-items: center; justify-content: center; color: var(--btn-ink); flex: none; cursor: pointer; background: var(--surface); }
.checkbox:hover { border-color: var(--ink-2); } .checkbox.on { background: var(--ink); border-color: var(--ink); }
.checkbox.round { border-radius: 50%; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip .x { opacity: .6; cursor: pointer; } .chip .x:hover { opacity: 1; }
.chip.tag { background: var(--accent-soft); }
a.chip { color: var(--ink-2); text-decoration: none; cursor: pointer; } a.chip:hover { background: var(--surface-3); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.badge.red { background: var(--red); color: #fff; }
.badge.ink { background: var(--btn-bg); color: var(--btn-ink); }
.avatar { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 600; flex: none; letter-spacing: .02em; background: var(--ink-3); }
.avatar.sm { width: 20px; height: 20px; font-size: 8.5px; } .avatar.xs { width: 16px; height: 16px; font-size: 7px; } .avatar.lg { width: 32px; height: 32px; font-size: 12px; } .avatar.xl { width: 48px; height: 48px; font-size: 16px; }
.avatar.agent { border-radius: 6px; }
.avatar.empty { background: var(--surface); border: 1px dashed var(--ink-4); color: var(--ink-4); }
.avatars { display: inline-flex; } .avatars .avatar { margin-left: -6px; border: 2px solid var(--surface); } .avatars .avatar:first-child { margin-left: 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--line); margin: 8px 0; }
.vdivider { width: 1px; height: 18px; background: var(--line-2); }

/* cards + tables */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card.pad { padding: 16px 18px; }
.card-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-h .title { font-weight: 600; font-size: 13px; }
.stat { padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1; }
.stat .l { margin-top: 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.tbl tr:hover td { background: var(--surface-2); }

/* popovers & menus */
.pop { position: fixed; z-index: 1000; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 180px; max-width: 360px; max-height: 70vh; overflow: auto; padding: 4px; animation: popin .1s ease-out; }
@keyframes popin { from { opacity: 0; } to { opacity: 1; } }
.pop.wide { max-width: 520px; }
.menu-item { display: flex; align-items: center; gap: 9px; padding: 6px 9px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--ink); min-height: 30px; }
.menu-item:hover, .menu-item.hl { background: var(--surface-2); }
.menu-item .ic { color: var(--ink-3); } .menu-item.danger { color: var(--red); } .menu-item.danger .ic { color: var(--red); }
.menu-item .sub { margin-left: auto; color: var(--ink-3); font-size: 11.5px; }
.menu-item.disabled { opacity: .45; pointer-events: none; }
.menu-item.sel { background: var(--accent-soft); }
.menu-h { padding: 8px 9px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 0; }
.pop-search { display: flex; align-items: center; gap: 6px; padding: 4px 6px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.pop-search input { border: 0; background: transparent; flex: 1; font-size: 13px; padding: 4px 2px; }
.tooltip { position: fixed; z-index: 2000; background: var(--btn-bg); color: var(--btn-ink); font-size: 11.5px; padding: 4px 8px; border-radius: 5px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }

/* modal */
.overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 900; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 20px; animation: fade .12s; backdrop-filter: blur(1px); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 520px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; animation: rise .14s ease-out; }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
.modal.md { width: 680px; } .modal.lg { width: 900px; } .modal.xl { width: 1100px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-h .title { font-weight: 600; font-size: 14px; flex: 1; }
.modal-b { padding: 18px; overflow: auto; flex: 1; }
.modal-f { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); justify-content: flex-end; }

/* toasts */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 3000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--btn-bg); color: var(--btn-ink); padding: 9px 14px; border-radius: var(--radius); font-size: 12.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; animation: rise .15s; }
.toast.error { background: var(--red); color: #fff; } .toast.success { background: var(--green); color: #fff; }
.toast button { color: inherit; font-weight: 600; opacity: .9; }

/* empty state */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 48px 20px; color: var(--ink-3); gap: 8px; }
.empty-state .ic { color: var(--ink-4); } .empty-state .t { font-weight: 600; color: var(--ink-2); font-size: 14px; }

/* view bar */
.viewbar { display: flex; align-items: center; gap: 4px; padding: 0 16px; height: 42px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; }
.viewtab { display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 10px; color: var(--ink-3); font-weight: 500; font-size: 12.5px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.viewtab:hover { color: var(--ink); } .viewtab.active { color: var(--ink); border-bottom-color: var(--ink); }
.toolbar { display: flex; align-items: center; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; flex-wrap: wrap; }
.toolbar .btn.ghost { color: var(--ink-2); } .toolbar .btn.on { background: var(--accent-soft); color: var(--ink); }
.toolbar.slim { padding: 6px 16px; }
.toolbar.controls { padding: 0 16px 8px; margin-top: -2px; }
.tb-search { display: flex; align-items: center; gap: 8px; height: 28px; width: 200px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink-3); cursor: text; }
.tb-search:focus-within { border-color: var(--line-2); } .tb-search input { flex: 1; min-width: 0; color: var(--ink); }
.nowrap { white-space: nowrap; }
.viewhost { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.viewbody { flex: 1; min-height: 0; overflow: auto; position: relative; }
.pagehead { display: flex; align-items: center; gap: 10px; padding: 14px 20px 10px; }
.head-toggle { color: var(--ink-4); margin-right: 2px; } .head-toggle:hover { color: var(--ink-2); }
.pagehead .h1 { display: flex; align-items: center; gap: 10px; }
.pagehead .col { min-width: 0; } .pagehead .col > .row.small { flex-wrap: wrap; row-gap: 4px; } .pagehead .col > .row.small > span:first-child { white-space: nowrap; }
.filterchip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 6px; background: var(--accent-soft); font-size: 11.5px; font-weight: 500; }

/* list view */
.lv { padding: 8px 16px 80px; }
.lv-group { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lv-group-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface); border-bottom: 1px solid var(--line); cursor: pointer; }
.lv-group-h .name { font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.lv-group-h .cnt { color: var(--ink-3); font-weight: 500; font-size: 11.5px; }
.lv-head { display: grid; align-items: center; height: 30px; padding: 0 10px; color: var(--ink-3); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.lv-row { display: grid; align-items: center; min-height: var(--row-h); padding: 0 10px; border-bottom: 1px solid var(--line); position: relative; }
.lv-row:last-child { border-bottom: 0; }
.lv-row:hover { background: var(--hover); }
.lv-row.selected { background: var(--accent-soft); }
.lv-row.dragover { box-shadow: inset 0 2px 0 var(--ink); }
.lv-row .name { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; padding-right: 8px; }
.lv-row .name .txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-row .name .txt.done { color: var(--ink-3); text-decoration: line-through; }
.lv-row .hover-actions { display: none; gap: 2px; margin-left: 4px; } .lv-row:hover .hover-actions { display: inline-flex; }
.lv-row .cell { display: flex; align-items: center; min-width: 0; padding-right: 6px; font-size: 12.5px; color: var(--ink-2); }
.lv-row .cell.click { cursor: pointer; border-radius: 4px; padding: 3px 4px; margin-left: -4px; } .lv-row .cell.click:hover { background: var(--surface-3); }
.lv-row .sub-toggle { width: 16px; color: var(--ink-4); cursor: pointer; display: inline-flex; justify-content: center; }
.lv-row .sub-toggle:hover { color: var(--ink); }
.lv-row.sub .name { padding-left: 24px; } .lv-row.sub2 .name { padding-left: 44px; }
.lv-add { display: flex; align-items: center; gap: 8px; padding: 6px 10px; color: var(--ink-3); cursor: pointer; font-size: 12.5px; }
.lv-add:hover { color: var(--ink); background: var(--hover); }
.lv-add input { flex: 1; border: 0; background: transparent; font-size: 13px; padding: 2px 0; }
.status-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.status-btn { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--sc, var(--ink-2)); background: color-mix(in srgb, var(--sc, var(--ink-3)) var(--pill-alpha), transparent); cursor: pointer; white-space: nowrap; }
.status-btn.solid { color: #fff; background: var(--sc); }
.prio { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; cursor: pointer; }
.drag-handle { color: var(--ink-5); cursor: grab; width: 14px; opacity: 0; } .lv-row:hover .drag-handle { opacity: 1; }
.bulkbar { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 800; background: var(--btn-bg); color: var(--btn-ink); border-radius: 12px; padding: 8px 10px 8px 14px; display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow-lg); animation: rise .15s; }
.bulkbar .btn { background: rgba(127,127,127,.18); border-color: transparent; color: var(--btn-ink); } .bulkbar .btn:hover { background: rgba(127,127,127,.32); }

/* board */
.board { display: flex; gap: 12px; padding: 14px 16px 30px; height: 100%; overflow-x: auto; align-items: flex-start; }
.bcol { width: 272px; flex: none; background: var(--surface-2); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: 100%; border: 1px solid var(--line); }
.bcol.collapsed { width: 40px; }
.bcol-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.bcol-h .cnt { color: var(--ink-3); font-weight: 500; letter-spacing: 0; text-transform: none; }
.bcol-b { overflow: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 40px; flex: 1; }
.bcol.dragover .bcol-b { background: var(--accent-soft); border-radius: 8px; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 11px; cursor: pointer; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 7px; }
.bcard:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.bcard .t { font-size: 13px; font-weight: 500; line-height: 1.35; }
.bcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--ink-3); font-size: 11.5px; }
.bcard .cover { height: 4px; border-radius: 3px; margin: -4px -3px 2px; }
.bcard.dragging { opacity: .4; }
.bcol-add { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--ink-3); cursor: pointer; font-size: 12.5px; border-top: 1px solid var(--line); } .bcol-add:hover { color: var(--ink); }

/* calendar */
.cal { display: flex; flex-direction: column; height: 100%; }
.cal-h { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(110px, 1fr); border-left: 1px solid var(--line); overflow: auto; background: var(--surface); }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow div { padding: 6px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); border-right: 1px solid var(--line); }
.cal-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; min-width: 0; display: flex; flex-direction: column; gap: 3px; position: relative; }
.cal-cell.other { background: var(--bg); } .cal-cell.dragover { background: var(--accent-soft); }
.cal-cell .d { font-size: 12px; font-weight: 500; color: var(--ink-3); display: flex; align-items: center; justify-content: space-between; }
.cal-cell.today .d span { background: var(--btn-bg); color: var(--btn-ink); border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal-cell .add { opacity: 0; } .cal-cell:hover .add { opacity: 1; }
.cal-ev { font-size: 11.5px; padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--ink); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--ink-3); }
.cal-ev.done { opacity: .55; text-decoration: line-through; }
.cal-ev.overdue { border-left-color: var(--red); }
.cal-week { display: grid; grid-template-columns: 60px repeat(7, 1fr); flex: 1; overflow: auto; background: var(--surface); }
.cal-side { width: 260px; border-left: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 12px; }

/* gantt */
.gantt { display: flex; height: 100%; overflow: hidden; }
.gantt-left { width: 300px; flex: none; border-right: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.gantt-right { flex: 1; overflow: auto; position: relative; background: var(--surface); }
.gantt-hdr { height: 44px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.gantt-row { height: 34px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 10px; font-size: 12.5px; gap: 8px; white-space: nowrap; overflow: hidden; }
.gantt-bar { position: absolute; height: 22px; border-radius: 6px; background: var(--ink-3); color: #fff; font-size: 11px; display: flex; align-items: center; padding: 0 8px; cursor: grab; overflow: hidden; white-space: nowrap; user-select: none; }
.gantt-bar .rs { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; } .gantt-bar .rs.l { left: 0; } .gantt-bar .rs.r { right: 0; }
.gantt-bar.done { opacity: .5; }
.gantt-ms { position: absolute; width: 16px; height: 16px; transform: rotate(45deg); background: var(--ink); border-radius: 3px; cursor: pointer; }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); z-index: 1; opacity: .8; }
.gantt-col { position: absolute; top: 0; bottom: 0; border-right: 1px solid var(--line); }
.gantt-col.wknd { background: var(--bg); }
.gantt-day { position: absolute; top: 22px; height: 22px; font-size: 10.5px; color: var(--ink-3); display: flex; align-items: center; justify-content: center; }
.gantt-month { position: absolute; top: 0; height: 22px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding-left: 8px; display: flex; align-items: center; border-right: 1px solid var(--line-2); }

/* table view */
.tv { min-width: max-content; }
.tv-h { display: flex; position: sticky; top: 0; background: var(--surface-2); z-index: 2; border-bottom: 1px solid var(--line); }
.tv-h > div { padding: 7px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); border-right: 1px solid var(--line); position: relative; white-space: nowrap; }
.tv-r { display: flex; border-bottom: 1px solid var(--line); background: var(--surface); }
.tv-r:hover { background: var(--hover); }
.tv-r > div { padding: 0 10px; height: var(--row-h); display: flex; align-items: center; border-right: 1px solid var(--line); min-width: 0; font-size: 12.5px; }
.tv .rz { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; }

/* box + workload */
.boxes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; }
.wl { padding: 16px; }
.wl-row { display: grid; grid-template-columns: 200px 1fr; align-items: center; border-bottom: 1px solid var(--line); min-height: 52px; }
.wl-cells { display: grid; gap: 4px; }
.wl-cell { height: 40px; border-radius: 6px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.wl-cell.over { background: var(--red-soft); color: var(--red); } .wl-cell.warm { background: var(--amber-soft); color: var(--amber); } .wl-cell.ok { background: var(--green-soft); color: var(--green); }

/* task panel */
.tp-overlay { position: fixed; inset: 0; z-index: 850; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 24px; animation: fade .12s; }
.tp { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(1180px, 100%); height: 92vh; display: flex; flex-direction: column; overflow: hidden; animation: rise .16s ease-out; }
.tp.m-side { position: fixed; right: 0; top: 0; bottom: 0; width: min(720px, 100%); height: 100vh; border-radius: 0; }
.tp-overlay.m-side { justify-content: flex-end; padding: 0; background: transparent; pointer-events: none; } .tp-overlay.m-side .tp { pointer-events: auto; box-shadow: -8px 0 40px rgba(29,36,51,.18); border-left: 1px solid var(--line); }
.tp.m-full { width: 100%; height: 100%; border-radius: 0; }
.tp-overlay.m-full { padding: 0; }
.tp-top { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tp-body { flex: 1; display: grid; grid-template-columns: 1fr 380px; min-height: 0; }
.tp.m-side .tp-body, .tp.narrow .tp-body { grid-template-columns: 1fr; grid-template-rows: auto; overflow: auto; display: flex; flex-direction: column; }
.tp-main { overflow: auto; padding: 18px 28px 60px; container-type: inline-size; }
.tp-aside { border-left: 1px solid var(--line); background: var(--bg); display: flex; flex-direction: column; min-height: 0; }
.tp.m-side .tp-aside { border-left: 0; border-top: 1px solid var(--line); }
.tp-title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; margin: 0 -6px; width: calc(100% + 12px); resize: none; background: transparent; }
.tp-title:hover { border-color: var(--line); } .tp-title:focus { border-color: var(--ink-3); outline: 0; }
.tp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; margin-top: 16px; }
.tp-field { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; min-height: 30px; gap: 8px; }
.tp-field > .k { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tp-field > .v { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
/* one column of fields when the panel is narrow (side panel, small windows), so nothing wraps into its neighbour */
@container (max-width: 760px) { .tp-fields { grid-template-columns: 1fr; gap: 4px 0; } }
.fbtn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-size: 12.5px; color: var(--ink); max-width: 100%; white-space: nowrap; }
.fbtn:hover { background: var(--surface-2); border-color: var(--line); }
.fbtn.empty { color: var(--ink-3); }
.tp-section { margin-top: 26px; }
.tp-section-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tp-section-h .t { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.sub-row { display: flex; align-items: center; gap: 8px; height: var(--row-h); padding: 0 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sub-row:hover { background: var(--surface-2); }
.sub-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk-item { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 2px 4px; border-radius: 4px; } .chk-item:hover { background: var(--surface-2); }
.chk-item input { border: 0; background: transparent; flex: 1; font-size: 13px; } .chk-item.done input { color: var(--ink-3); text-decoration: line-through; }
.chk-item .del { opacity: 0; } .chk-item:hover .del { opacity: 1; }
.attach { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
a.attach { color: inherit; text-decoration: none; } a.attach:hover { border-color: var(--line-2); }
.msg-img { display: inline-block; max-width: 320px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); } .msg-img img { display: block; max-width: 100%; max-height: 260px; object-fit: cover; }
.attach .thumb { width: 40px; height: 40px; border-radius: 6px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--ink-3); overflow: hidden; } .attach .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 14px; text-align: center; color: var(--ink-3); font-size: 12.5px; cursor: pointer; } .dropzone:hover, .dropzone.over { border-color: var(--ink-3); background: var(--surface-2); }
.act-tabs { display: flex; gap: 2px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.act-tab { padding: 6px 10px; font-size: 12px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; } .act-tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.act-feed { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.act-item { display: flex; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.act-item .body { flex: 1; min-width: 0; } .act-item .who { font-weight: 600; color: var(--ink); } .act-item .when { color: var(--ink-4); font-size: 11px; margin-left: 6px; }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.comment.resolved { opacity: .6; }
.comment .txt { margin-top: 6px; font-size: 13px; line-height: 1.5; word-break: break-word; } .comment .txt p { margin: 0 0 6px; }
.comment .tools { display: flex; gap: 2px; margin-left: auto; opacity: 0; } .comment:hover .tools { opacity: 1; }
.reaction { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 11px; border: 1px solid var(--line-2); font-size: 12px; cursor: pointer; background: var(--surface); } .reaction.mine { border-color: var(--ink); background: var(--accent-soft); }
.composer { border-top: 1px solid var(--line); padding: 10px 14px 12px; background: var(--surface); }
.composer .box { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); }
.composer .box:focus-within { border-color: var(--ink-3); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer .ed { min-height: 60px; max-height: 240px; overflow: auto; padding: 8px 10px; outline: 0; font-size: 13px; line-height: 1.5; }
.composer .ed:empty::before { content: attr(data-placeholder); color: var(--ink-4); }
/* people: the conversation stream (chat, email, texts) */
.convo { max-height: 560px; min-height: 160px; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.convo-msg { display: flex; } .convo-msg.mine { justify-content: flex-end; } .convo-msg.wide .bubble { width: 100%; max-width: none; }
.bubble { max-width: min(78%, 620px); padding: 8px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; min-width: 0; }
.bubble .meta { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--ink-3); margin-bottom: 3px; letter-spacing: .02em; }
.bubble.chat { border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); }
.bubble.text { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.convo-msg.mine .bubble.text { background: color-mix(in srgb, var(--green) 14%, var(--surface)); }
.convo-msg.mine .bubble.chat { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); }
.bubble.failed { border-color: var(--red); }
.bubble.email { border-radius: 10px; }
.email-msg { border-top: 1px solid var(--line); padding: 10px 0 4px; margin-top: 8px; }
.composer.person { border-top: 1px solid var(--line); }
@media (max-width: 760px) { .bubble { max-width: 92%; } .convo { max-height: 60vh; } .home-card .hc-h { flex-wrap: wrap; row-gap: 6px; } .composer.person .seg button { padding: 0 7px; } }
.composer .bar { display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-top: 1px solid var(--line); }
.mention { color: var(--accent); font-weight: 500; background: var(--accent-soft); border-radius: 3px; padding: 0 3px; }
.mention-pop { position: fixed; z-index: 1100; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; padding: 4px; }

/* rich text */
.rt { font-size: 13.5px; line-height: 1.6; color: var(--ink); min-height: 40px; outline: 0; }
.rt:empty::before, .rt.placeholder::before { content: attr(data-placeholder); color: var(--ink-4); }
.rt p { margin: 0 0 8px; } .rt ul, .rt ol { margin: 0 0 8px; padding-left: 22px; } .rt li { margin: 2px 0; }
.rt h1 { font-size: 20px; margin: 14px 0 6px; letter-spacing: -.02em; } .rt h2 { font-size: 16px; margin: 12px 0 6px; } .rt h3 { font-size: 14px; margin: 10px 0 4px; }
.rt blockquote { border-left: 3px solid var(--line-2); margin: 8px 0; padding: 2px 12px; color: var(--ink-2); }
.rt pre, .rt code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border-radius: 4px; } .rt pre { padding: 10px 12px; overflow: auto; } .rt code { padding: 1px 4px; }
.rt a { color: var(--accent); text-decoration: underline; } .rt hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.rt table { border-collapse: collapse; margin: 8px 0; } .rt td, .rt th { border: 1px solid var(--line-2); padding: 4px 8px; }
.rt img { max-width: 100%; border-radius: 6px; }
.rt ul.checklist { list-style: none; padding-left: 4px; } .rt li.task { display: flex; gap: 6px; align-items: flex-start; }
.rt-toolbar { display: flex; align-items: center; gap: 1px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 6px; flex-wrap: wrap; }
.rt-wrap { border: 1px solid transparent; border-radius: var(--radius); padding: 6px 8px; margin: 0 -8px; } .rt-wrap:hover { border-color: var(--line); } .rt-wrap:focus-within { border-color: var(--ink-3); }

/* docs */
.docs { display: grid; grid-template-columns: 260px 1fr; height: 100%; }
.docs-side { border-right: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 10px; }
.doc-page { max-width: 820px; margin: 0 auto; padding: 40px 48px 120px; }
.doc-title { font-size: 34px; font-weight: 700; letter-spacing: -.03em; border: 0; width: 100%; background: transparent; outline: 0; margin: 8px 0 12px; line-height: 1.15; }
.doc-title::placeholder { color: var(--ink-4); }
.doc-body.rt { font-size: 15px; line-height: 1.7; }
.doc-body.rt h1 { font-size: 26px; } .doc-body.rt h2 { font-size: 20px; margin-top: 22px; } .doc-body.rt h3 { font-size: 16px; }

/* home */
.home-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; }
.home-grid.single { grid-template-columns: minmax(0, 820px); }
.agenda-ev { display: flex; align-items: center; gap: 10px; padding: 5px 8px; min-height: var(--row-h); border-radius: 6px; font-size: 12.5px; cursor: pointer; } .agenda-ev:hover { background: var(--surface-2); }
.agenda-ev .tm { width: 62px; flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 11.5px; } .agenda-ev .bar { width: 3px; height: 18px; border-radius: 2px; background: var(--blue); flex: none; } .agenda-ev .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .agenda-ev .g { font-size: 10.5px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }
.myday-chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11px; font-weight: 500; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.day-head { display: flex; align-items: center; gap: 8px; padding: 10px 8px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); } .day-head.today { color: var(--ink); }
.day-switch { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); margin-right: 4px; } .day-switch .chip { margin-left: 4px; }
.agenda-fold { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-top: 2px; border-radius: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; user-select: none; min-width: 0; } .agenda-fold:hover { background: var(--surface-2); } .agenda-fold .badge { letter-spacing: 0; } .agenda-fold .truncate { flex: 1; min-width: 0; }
.home-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.home-card .hc-h { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.home-card .hc-h .t { font-weight: 600; font-size: 13px; }
.home-card .hc-b { padding: 6px 8px; }
.mini-task { display: flex; align-items: center; gap: 10px; padding: 5px 8px; min-height: var(--row-h); border-radius: 6px; cursor: pointer; font-size: 13px; } .mini-task:hover { background: var(--surface-2); }
.mini-task .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mini-task .n.done { color: var(--ink-3); text-decoration: line-through; }
.mini-task .where { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
.mini-task .meta { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.due { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; } .due.overdue { color: var(--red); font-weight: 500; } .due.due-today { color: var(--amber); font-weight: 500; } .due.due-soon { color: var(--ink-2); }
.greet { font-size: 24px; font-weight: 600; letter-spacing: -.025em; }
.greet .accent { font-style: italic; font-weight: 500; color: var(--red); }
.bucket-h { display: flex; align-items: center; gap: 8px; padding: 10px 8px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
/* card groups: stacked (one column) or side by side, drag by the grip at the top */
.cardgroup { display: grid; gap: 14px; margin-top: 14px; }
.cardgroup.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cardgroup.stack { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
.ovw .cardgroup.stack { max-width: none; }
.cardgroup.grid > .cardwrap.wide { grid-column: 1 / -1; }
.cardwrap { position: relative; min-width: 0; border-radius: var(--radius-lg); }
.cardwrap > .home-card, .cardwrap > .card { height: 100%; }
.card-grip { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 44px; height: 14px; border-radius: 0 0 7px 7px; display: flex; align-items: center; justify-content: center; color: var(--ink-4); cursor: grab; opacity: 0; z-index: 2; transition: opacity .12s; }
.cardwrap:hover > .card-grip { opacity: 1; } .card-grip:hover { color: var(--ink-2); background: var(--surface-2); } .card-grip:active { cursor: grabbing; }
.cardwrap.dragging { opacity: .45; }
.cardwrap.drop-before::before { content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 3px; border-radius: 2px; background: var(--accent); }
.cardgroup.grid .cardwrap.drop-before::before { top: 0; bottom: 0; left: -9px; right: auto; width: 3px; height: auto; }
@media (max-width: 980px) { .cardgroup.grid { grid-template-columns: minmax(0, 1fr); } .card-grip { opacity: .6; } }
.customize-pop .seg { display: inline-flex; }
/* home: card layout (the default) vs focus layout (agenda first, one column) */
.home-card.compact .hc-b { max-height: 320px; overflow: auto; }
.space-tile { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; } .space-tile:hover { background: var(--surface-2); }
.space-tile .sb-space-ic { width: 26px; height: 26px; font-size: 11px; }
.space-tile .n { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.space-tile .progress { width: 70px; flex: none; height: 6px; }
.customize-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; font-size: 13px; }

/* space overview (client / project home) */
.ovw { max-width: 1000px; margin: 0 auto; padding: 14px 20px 80px; }
.hero { position: relative; min-height: 220px; border-radius: var(--radius-lg); background-size: cover; background-position: center; color: #fff; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; box-shadow: var(--shadow-sm); }
.hero-top { display: flex; align-items: center; gap: 8px; padding: 14px 16px; }
.hero-brand { display: flex; align-items: center; gap: 8px; } .hero-brand .sb-logo { width: 26px; height: 26px; }
.hero-body { padding: 8px 22px 20px; }
.hero-title { font-size: 30px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; text-wrap: balance; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.hero-sub { margin-top: 8px; font-size: 14px; color: rgba(255,255,255,.86); max-width: 62ch; display: flex; align-items: center; gap: 6px; }
.hero-edit { color: rgba(255,255,255,.7) !important; } .hero-edit:hover { color: #fff !important; background: rgba(255,255,255,.14) !important; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 500; color: #fff; background: rgba(255,255,255,.16); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); text-decoration: none; }
a.hero-chip:hover, .hero-chip.pointer:hover { background: rgba(255,255,255,.26); }
.hero .btn.ghost.hero-btn, .hero .hero-btn { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.2); } .hero .hero-btn:hover { background: rgba(255,255,255,.26); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.stat-row .stat { border-right: 1px solid var(--line); } .stat-row .stat:last-child { border-right: 0; }
.list-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; padding: 12px; }
.list-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; cursor: pointer; background: var(--surface); } .list-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.lc-name { font-weight: 600; font-size: 13px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-row .stat:nth-child(2n) { border-right: 0; } .stat-row .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); } .hero-title { font-size: 24px; } .hero { min-height: 180px; } .ovw { padding: 12px 12px 90px; } }

/* calls: the huddle dock */
.calldock { position: fixed; right: 16px; bottom: 16px; z-index: 860; width: 440px; height: 330px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.calldock.big { left: 5vw; right: 5vw; top: 5vh; bottom: 5vh; width: auto; height: auto; }
.calldock-h { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.calldock iframe { flex: 1; width: 100%; border: 0; background: #111; }
@media (max-width: 760px) { .calldock { left: 8px; right: 8px; bottom: 64px; width: auto; height: 60vh; } }

/* inbox */
.notif { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; background: var(--surface); }
.notif:hover { background: var(--hover); } .notif.unread { background: var(--surface); box-shadow: inset 3px 0 0 var(--ink); }
.notif .t { font-size: 13px; } .notif .m { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.notif .acts { display: flex; gap: 2px; opacity: 0; margin-left: auto; } .notif:hover .acts { opacity: 1; }

/* dashboards */
.dash-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 90px; gap: 14px; padding: 16px 20px 80px; }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; position: relative; min-width: 0; }
.dcard .dc-h { display: flex; align-items: center; gap: 6px; padding: 10px 14px 6px; font-weight: 600; font-size: 12.5px; }
.dcard .dc-h .tools { margin-left: auto; opacity: 0; display: flex; gap: 2px; } .dcard:hover .dc-h .tools { opacity: 1; }
.dcard .dc-b { flex: 1; min-height: 0; overflow: auto; padding: 0 14px 12px; }
.dcard .bignum { font-size: 40px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; font-size: 12px; margin: 5px 0; }
.bar-row .bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; } .bar-row .bar > div { height: 100%; border-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11.5px; color: var(--ink-2); }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.dcard.resizing, .dcard.moving { opacity: .7; }
.dc-resize { position: absolute; right: 4px; bottom: 4px; width: 12px; height: 12px; cursor: nwse-resize; border-right: 2px solid var(--ink-4); border-bottom: 2px solid var(--ink-4); border-radius: 0 0 3px 0; opacity: 0; } .dcard:hover .dc-resize { opacity: 1; }

/* goals */
.goal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; cursor: pointer; } .goal-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.progress { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; } .progress > div { height: 100%; border-radius: 4px; background: var(--accent); transition: width .2s; }
.progress.lg { height: 12px; }

/* whiteboard */
.wb { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--surface); background-image: radial-gradient(var(--line-2) 1px, transparent 1px); background-size: 24px 24px; cursor: default; user-select: none; }
.wb-tools { position: absolute; left: 16px; top: 14px; z-index: 5; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; box-shadow: var(--shadow); }
.wb-tools .iconbtn { width: 32px; height: 32px; }
.wb-el { position: absolute; border-radius: 6px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font-size: 13px; line-height: 1.35; cursor: move; box-shadow: var(--shadow-sm); word-break: break-word; }
.wb-el.sel { outline: 2px solid var(--blue); outline-offset: 2px; }
.wb-el .rz { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: var(--blue); border-radius: 2px; cursor: nwse-resize; }
.wb-el.text { background: transparent; box-shadow: none; justify-content: flex-start; text-align: left; font-size: 15px; }
.wb-el textarea { width: 100%; height: 100%; border: 0; background: transparent; resize: none; text-align: center; font: inherit; outline: 0; }

/* chat */
.chat { display: grid; grid-template-columns: 240px 1fr; height: 100%; }
.chat-side { border-right: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 10px; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.chat-msgs { flex: 1; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 6px 8px; border-radius: 8px; } .msg:hover { background: var(--surface-2); }
.msg .body { flex: 1; min-width: 0; } .msg .who { font-weight: 600; font-size: 13px; } .msg .when { color: var(--ink-4); font-size: 11px; margin-left: 6px; } .msg .txt { font-size: 13.5px; line-height: 1.5; margin-top: 2px; word-break: break-word; }
.msg .tools { opacity: 0; display: flex; gap: 2px; } .msg:hover .tools { opacity: 1; }
.day-sep { display: flex; align-items: center; gap: 10px; color: var(--ink-4); font-size: 11px; margin: 12px 0 6px; } .day-sep::before, .day-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* settings */
.settings { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
.settings-nav { border-right: 1px solid var(--line); background: var(--surface); padding: 14px 10px; overflow: auto; }
.settings-body { overflow: auto; padding: 28px 40px 80px; max-width: 900px; }
.setting-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setting-row .info { flex: 1; } .setting-row .info .t { font-weight: 600; font-size: 13.5px; } .setting-row .info .d { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.person-row { display: grid; grid-template-columns: 32px 1.4fr 1fr 120px 120px auto; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.status-edit { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; } .swatch { width: 22px; height: 22px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; } .swatch.on { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--surface); }

/* cmdk */
.cmdk { width: 640px; max-width: 100%; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: rise .14s ease-out; }
.cmdk .in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cmdk .in input { border: 0; background: transparent; flex: 1; font-size: 16px; }
.cmdk .res { max-height: 60vh; overflow: auto; padding: 6px; }
.cmdk .res .menu-item { min-height: 38px; }
.cmdk .res .menu-item .where { color: var(--ink-3); font-size: 11.5px; margin-left: auto; white-space: nowrap; }

/* brain panel */
.brain { position: fixed; right: 16px; bottom: 16px; width: 420px; height: min(640px, 80vh); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 860; display: flex; flex-direction: column; overflow: hidden; animation: rise .16s ease-out; }
.brain.docked { position: static; width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.brain-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.brain-msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.bmsg { max-width: 92%; font-size: 13px; line-height: 1.55; }
.bmsg.user { align-self: flex-end; background: var(--btn-bg); color: var(--btn-ink); padding: 8px 12px; border-radius: 12px 12px 3px 12px; }
.bmsg.ai { align-self: flex-start; background: var(--surface-2); padding: 9px 12px; border-radius: 12px 12px 12px 3px; }
.bmsg.ai p { margin: 0 0 6px; } .bmsg.ai ul, .bmsg.ai ol { margin: 4px 0 6px; padding-left: 18px; } .bmsg.ai h1, .bmsg.ai h2, .bmsg.ai h3 { font-size: 13px; margin: 8px 0 4px; }
.bmsg.tool { align-self: flex-start; font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; padding: 2px 4px; }
.brain-in { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 6px; align-items: flex-end; }
.brain-in textarea { flex: 1; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 10px; min-height: 38px; max-height: 120px; resize: none; font-size: 13px; }
.brain-in textarea:focus { border-color: var(--ink-3); }
.brain-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.brain-suggest .chip { cursor: pointer; } .brain-suggest .chip:hover { background: var(--accent-soft); }
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 855; height: 40px; padding: 0 14px 0 12px; border-radius: 20px; background: var(--btn-bg); color: var(--btn-ink); display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 12.5px; box-shadow: var(--shadow-lg); }
.fab:hover { background: var(--btn-hover); }
.fab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }

/* auth screens (minimal: one centered card) */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; background: var(--bg); }
.auth-wrap { width: 400px; max-width: 100%; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand .sb-logo { width: 30px; height: 30px; }
.auth-brand .n { font-weight: 600; font-size: 14px; letter-spacing: -.01em; } .auth-brand .s { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.auth-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 26px 24px; box-shadow: var(--shadow); }
.auth-box .input { height: 40px; font-size: 14px; }
.auth-foot { margin-top: 18px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-4); text-align: center; }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 42px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; font-size: 13.5px; color: var(--ink); cursor: pointer; width: 100%; text-decoration: none; }
.gbtn:hover { background: var(--surface-2); border-color: var(--ink-4); }
.gbtn .g { width: 18px; height: 18px; flex: none; }
.or { display: flex; align-items: center; gap: 10px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); } .or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.alert { padding: 10px 12px; border-radius: var(--radius); font-size: 12.5px; background: var(--red-soft); color: var(--red); }
.alert.info { background: var(--blue-soft); color: var(--blue); } .alert.ok { background: var(--green-soft); color: var(--green); }

/* misc */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 12px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; display: flex; align-items: center; gap: 6px; } .tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { height: 26px; padding: 0 9px; font-size: 12px; color: var(--ink-2); border-right: 1px solid var(--line-2); white-space: nowrap; } .seg button:last-child { border-right: 0; } .seg button.on { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.sync { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-3); }
.sync .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); } .sync.off .dot { background: var(--red); }
.code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 6px; word-break: break-all; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; } .tile:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.tile .t { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; } .tile .d { color: var(--ink-3); font-size: 12.5px; }
.ghost-input { border: 0; background: transparent; font-size: inherit; font-weight: inherit; width: 100%; padding: 0; }
.calendar-pick { width: 252px; padding: 6px; }
.calendar-pick .hd { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; font-weight: 600; font-size: 12.5px; }
.calendar-pick .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.calendar-pick .dn { font-size: 10px; font-weight: 600; color: var(--ink-3); text-align: center; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0 4px; }
.calendar-pick .dd { height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 12.5px; cursor: pointer; } .calendar-pick .dd:hover { background: var(--surface-2); } .calendar-pick .dd.other { color: var(--ink-4); } .calendar-pick .dd.today { font-weight: 700; } .calendar-pick .dd.sel { background: var(--btn-bg); color: var(--btn-ink); }
.calendar-pick .quick { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 2px 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.quick .btn.xs { font-weight: 500; }
.wrap-grid { max-width: 1200px; }
.mm-node { fill: var(--surface); stroke: var(--line-2); }
.mm-text { font-size: 12px; fill: var(--ink); font-family: var(--font); }
.mm-line { stroke: var(--line-2); fill: none; stroke-width: 1.5; }
.sortable-ghost { opacity: .4; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mtabs { display: none; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; --sidebar-w: 0px; } .app .sidebar { position: fixed; z-index: 700; left: 0; top: 0; bottom: 0; width: 280px !important; transform: translateX(-100%); transition: transform .18s; box-shadow: none; } .app.sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .app.collapsed .sidebar:not(:hover):not(.peek) .sb-name, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-sub, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-section-h span, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-pin, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-invite { display: block; }
  .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item span.lbl, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item .actions, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-caret { display: inline-flex; }
  .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl1, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl2, .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl3 { display: flex; }
  .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item { justify-content: flex-start; padding: 0 8px; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl1 { padding-left: 22px; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl2 { padding-left: 36px; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item.lvl3 { padding-left: 50px; }
  .app.collapsed .sidebar:not(:hover):not(.peek) .sb-top { padding: 0 10px 0 12px; justify-content: flex-start; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-brand { flex: 1; justify-content: flex-start; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-brand .col { display: flex; } .app.collapsed .sidebar:not(:hover):not(.peek) .sb-section-h { justify-content: flex-start; padding: 4px 8px; }
  .app.collapsed .sidebar:not(:hover):not(.peek) .sb-item .badge { position: static; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
  .sidebar .sb-pin { display: none; }
  .sb-backdrop { display: none; position: fixed; inset: 0; background: var(--overlay); z-index: 690; } .app.sb-open .sb-backdrop { display: block; }
  .main { height: 100vh; height: 100dvh; } .content { padding-bottom: 64px; }
  .page { padding: 14px 14px 80px; } .home-grid, .home-grid.single { grid-template-columns: 1fr; } .tp-body { grid-template-columns: 1fr; display: flex; flex-direction: column; overflow: auto; } .tp-overlay { padding: 0; } .tp { height: 100vh; height: 100dvh; border-radius: 0; width: 100%; }
  .tp-main { padding: 14px 16px 40px; } .tp-fields { grid-template-columns: 1fr; } .docs { grid-template-columns: 1fr; } .docs-side { display: none; } .settings { grid-template-columns: 1fr; } .settings-nav { display: none; } .settings-body { padding: 18px 16px 100px; } .chat { grid-template-columns: 1fr; } .chat-side { display: none; }
  .brain { right: 0; bottom: 0; width: 100%; height: 82vh; height: 82dvh; border-radius: 12px 12px 0 0; }
  .fab { display: none; } .bulkbar { bottom: 70px; } .toasts { bottom: 70px; }
  .topbar { padding: 0 10px; } .searchbtn { width: 34px; padding: 0; justify-content: center; border: 0; background: transparent; } .searchbtn span, .searchbtn .kbd { display: none; } .crumbs .crumb:not(.cur) { display: none; } .crumbs .sep { display: none; }
  .topbar .btn.primary span.lbl { display: none; }
  .mtabs { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 720; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mtabs .mt { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 500; color: var(--ink-3); padding: 4px 0; border-radius: 8px; position: relative; }
  .mtabs .mt.on { color: var(--accent); } .mtabs .mt .badge { position: absolute; top: 0; right: 18%; }
  .cal-grid { grid-auto-rows: minmax(70px, 1fr); } .cal-side { display: none; }
  /* phone: the tabs row scrolls sideways, the filters row is tight, search takes its own line */
  .viewbar { padding: 0 8px; overflow-x: auto; scrollbar-width: none; } .viewbar::-webkit-scrollbar { display: none; } .viewbar .grow { min-width: 8px; }
  .toolbar { padding: 6px 10px; } .toolbar .tb-search { flex: 1 1 100%; width: auto; order: 9; }
  .toolbar.controls { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 10px 8px; } .toolbar.controls::-webkit-scrollbar { display: none; } .toolbar.controls > * { flex: none; }
  /* phone: list rows stack name over details instead of squeezing columns */
  .lv { padding: 8px 10px 80px; } .lv-head { display: none; }
  .lv-row { display: flex !important; flex-wrap: wrap; align-items: center; padding: 8px 10px; row-gap: 4px; column-gap: 2px; }
  .lv-row > .row:first-child, .lv-row > .row:nth-child(2), .lv-row > .row:last-child { display: none; }
  .lv-row .name { flex: 1 1 100%; padding-right: 0; } .lv-row .name .txt { white-space: normal; }
  .lv-row .cell { flex: 0 0 auto; padding-right: 10px; font-size: 12px; min-height: 22px; } .lv-row.sub .name { padding-left: 14px; } .lv-row.sub2 .name { padding-left: 28px; }
  .home-card .hc-h > .seg { order: 9; flex: 1 1 100%; } .home-card .hc-h > .seg button { flex: 1; justify-content: center; }
  .space-tile .progress { display: none; }
  .mini-task { flex-wrap: wrap; row-gap: 4px; column-gap: 8px; } .mini-task .n { flex: 1 1 auto; min-width: 55%; } .mini-task .meta { padding-left: 22px; }
  .pagehead { padding: 12px 14px 8px; flex-wrap: wrap; row-gap: 8px; }
  /* phone: the Home greeting gets the full width, buttons drop to their own row */
  .home-head { flex-wrap: wrap; row-gap: 12px; } .home-head > .hh-text { flex: 1 1 100%; } .home-head > .grow { display: none; }
  .greet { font-size: 22px; line-height: 1.15; }
  .modal { max-height: 92vh; max-height: 92dvh; } .modal-f { flex-wrap: wrap; }
  .person-head { flex-wrap: wrap; row-gap: 10px; } .person-head > .ph-actions { flex: 1 1 100%; }
  .composer.person > .row:first-child { flex-wrap: wrap; row-gap: 6px; }
  .desktop-only { display: none !important; }
}
@media (min-width: 761px) { .mobile-only { display: none !important; } }
@media print { .sidebar, .topbar, .fab, .brain { display: none !important; } .app { grid-template-columns: 1fr; } }
