.inbox-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 14px; }
.inbox-toolbar label { display: grid; gap: 6px; font-size: 13px; }
.inbox-toolbar select { min-height: 44px; padding: 8px 36px 8px 12px; max-width: 100%; }
.inbox-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: min(680px, 72vh); min-height: 430px; overflow: hidden; background: #fff; border: 1px solid #e1e5ea; border-radius: 20px; }
.inbox-sidebar { border-right: 1px solid #e1e5ea; overflow: auto; padding: 12px; }
.inbox-sidebar > input { width: 100%; padding: 12px; margin-bottom: 12px; }
button.inbox-dialog { display: block; width: 100%; text-align: left; padding: 16px 12px; border: 0; border-radius: 12px; background: transparent; }
button.inbox-dialog.is-selected { background: #edf3ff; }
.inbox-dialog-top { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.inbox-dialog-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-dialog time { font-size: 12px; color: #5c6673; flex-shrink: 0; }
.inbox-preview { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin: 6px 0; }
.inbox-meta { display: block; font-size: 12px; color: #596574; overflow-wrap: anywhere; }
.inbox-conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.inbox-thread-header { display: flex; gap: 14px; align-items: center; padding: 18px 24px; border-bottom: 1px solid #e1e5ea; }
.inbox-thread-header strong { overflow-wrap: anywhere; }
.inbox-timeline { flex: 1; overflow: auto; padding: 20px 28px; min-height: 0; }
.inbox-message { width: fit-content; max-width: 84%; padding: 12px 16px; margin-bottom: 14px; border-radius: 16px; background: #f2f4f6; }
.inbox-message.outgoing { margin-left: auto; background: #edf3ff; }
.inbox-message-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 6px; }
.inbox-composer { padding: 16px 24px; border-top: 1px solid #e1e5ea; font-size: 13px; }
.inbox-composer p { color: #596574; margin: 6px 0 0; }
.inbox-empty { color: #596574; padding: 28px 20px; line-height: 1.7; }
.inbox-history-note { text-align: center; color: #596574; font-size: 12px; margin: 0 0 20px; }
@media (max-width: 1100px) { .inbox-layout { grid-template-columns: 290px minmax(0, 1fr); } }
@media (max-width: 760px) {
  .inbox-toolbar label { width: 100%; }
  .inbox-layout { grid-template-columns: minmax(0, 1fr); }
  .inbox-conversation { display: none; }
  .inbox-thread-open .inbox-conversation { display: flex; }
  .inbox-thread-open .inbox-sidebar { display: none; }
  .inbox-timeline { padding: 16px; }
}
:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f8fa;
  --surface-hover: #f0f3f7;
  --glass: rgba(252, 253, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --line: rgba(38, 51, 67, 0.1);
  --line-strong: rgba(38, 51, 67, 0.18);
  --text: #17202b;
  --muted: #66717f;
  --accent: #2864dc;
  --accent-hover: #3974e6;
  --accent-soft: #eaf1ff;
  --green: #187654;
  --green-soft: #e8f6ef;
  --amber: #9a6200;
  --amber-soft: #fff3d6;
  --red: #b7353b;
  --red-soft: #ffecef;
  --shadow-soft: 0 18px 55px rgba(29, 43, 61, 0.08);
  --shadow-float: 0 24px 70px rgba(29, 43, 61, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid rgba(40, 100, 220, 0.34); outline-offset: 2px; }

button, .dialog-card button, .context-menu button { min-height: 42px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: 0 14px; transition: background 140ms ease, border-color 140ms ease, color 140ms ease, transform 100ms ease, box-shadow 140ms ease; }
button:hover { background: var(--surface-hover); border-color: rgba(38, 51, 67, 0.25); }
button:active { transform: scale(0.985); }
.primary-button { min-height: 42px; border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 650; box-shadow: 0 5px 14px rgba(40, 100, 220, 0.14); }
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; box-shadow: 0 6px 16px rgba(40, 100, 220, 0.17); }
.icon-button { width: 42px; min-width: 42px; height: 42px; padding: 0; display: grid; place-items: center; font-size: 18px; line-height: 0; }
input, textarea, select { color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
input:hover, textarea:hover, select:hover { border-color: rgba(38, 51, 67, 0.28); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: 0; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #f4f6f9; }
.auth-form { width: min(100%, 410px); display: grid; gap: 19px; padding: 34px; border: 1px solid rgba(255, 255, 255, 0.82); border-radius: var(--radius-lg); background: var(--glass-strong); box-shadow: var(--shadow-float); backdrop-filter: blur(24px) saturate(130%); -webkit-backdrop-filter: blur(24px) saturate(130%); }
.auth-brand { display: flex; align-items: center; gap: 13px; }
.auth-brand .brand-title { font-size: 20px; }
.auth-form h1 { margin: -3px 0 3px; font-size: 32px; letter-spacing: -0.035em; }
.auth-form label, .dialog-card label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
.auth-form input { width: 100%; min-height: 48px; padding: 0 14px; }
.auth-form button { min-height: 48px; }
#authError, #userError, #materialError { color: var(--red); margin: 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width, var(--sidebar)) minmax(0, 1fr); gap: 0; padding: 0; transition: grid-template-columns 180ms ease; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 14px 14px; overflow: hidden; border: 0; border-right: 1px solid rgba(38,51,67,.09); border-radius: 0; background: rgba(230,235,242,.74); box-shadow: 8px 0 32px rgba(29,43,61,.045); backdrop-filter: blur(26px) saturate(125%); -webkit-backdrop-filter: blur(26px) saturate(125%); }
.sidebar::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 46%; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,.5), transparent); }
.sidebar > * { position: relative; }
.brand { display: flex; align-items: center; gap: 12px; padding: 3px 8px 11px; }
.brand-logo { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; }
.brand-logo img { width: 110%; height: 110%; max-width: none; display: block; object-fit: contain; }
.brand-logo-large { width: 52px; height: 52px; }
.brand-title { font-size: 18px; font-weight: 800; letter-spacing: -0.025em; }
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 0 12px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--muted); text-align: left; font-weight: 570; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.52); border-color: rgba(255,255,255,.72); }
.nav-item.is-active { color: var(--text); background: rgba(255,255,255,.72); border-color: rgba(255,255,255,.92); box-shadow: 0 8px 20px rgba(29, 43, 61, 0.07), inset 0 1px 0 #fff; }
.nav-icon { width: 24px; height: 24px; flex: 0 0 24px; color: var(--muted); }
.nav-item.is-active .nav-icon { color: var(--accent); }
.sidebar-footer { display: grid; gap: 9px; margin-top: auto; }
.sidebar-note { display: flex; align-items: center; gap: 9px; padding: 0 10px; color: var(--muted); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.is-offline { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.account-block { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px; border: 1px solid rgba(255,255,255,.78); border-radius: 17px; background: rgba(255,255,255,.48); }
.account-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--surface); color: var(--accent); font-weight: 800; }
.account-copy { min-width: 0; display: grid; }
.account-copy strong, .account-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 13px; }
.account-copy span { color: var(--muted); font-size: 12px; }
.account-block button { min-width: 54px; min-height: 42px; padding: 0 8px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }

.app-shell.sidebar-collapsed { --sidebar-width: 76px; }
.sidebar-collapsed .sidebar { padding-inline: 10px; }
.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .brand-title, .sidebar-collapsed .nav-item span, .sidebar-collapsed .sidebar-note span:last-child, .sidebar-collapsed .account-block { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar-note { justify-content: center; padding: 0; }
.sidebar-resize-handle { position: absolute; z-index: 3; top: 0; right: -6px; width: 12px; height: 100%; cursor: col-resize; touch-action: none; }
.sidebar-resize-handle::after { content: ""; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; background: transparent; transition: background 140ms ease; }
.sidebar-resize-handle:hover::after, .sidebar-resize-handle:focus-visible::after, .app-shell.is-resizing .sidebar-resize-handle::after { background: rgba(40,100,220,.45); }
.app-shell.is-resizing { transition: none; }
.app-shell.is-resizing, .app-shell.is-resizing * { cursor: col-resize !important; user-select: none !important; }

.workspace { min-width: 0; padding: 18px clamp(22px, 3vw, 48px) 42px; }
.topbar { display: grid; grid-template-columns: minmax(250px, 1fr) minmax(420px, 640px); align-items: center; gap: 28px; margin: 4px auto 32px; max-width: 1600px; }
.topbar h1, .section-heading h2, .board-toolbar h2, .dialog-card h2 { margin: 0; color: var(--text); }
.topbar h1 { font-size: clamp(30px, 2.4vw, 36px); line-height: 1.08; letter-spacing: -0.04em; font-weight: 780; }
.topbar p, .board-toolbar p { margin: 7px 0 0; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.search-shell { width: 100%; height: 50px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 14px; border: 1px solid rgba(255,255,255,.92); border-radius: 17px; background: var(--glass-strong); box-shadow: 0 14px 38px rgba(29,43,61,.1), inset 0 1px 0 #fff; backdrop-filter: blur(22px) saturate(135%); -webkit-backdrop-filter: blur(22px) saturate(135%); transition: box-shadow 150ms ease, border-color 150ms ease; }
.search-shell:focus-within { border-color: rgba(40,100,220,.45); box-shadow: 0 14px 38px rgba(29,43,61,.1), 0 0 0 3px var(--accent-soft); }
.global-search-wrap { position: relative; width: 100%; }
.search-icon { width: 16px; height: 16px; flex: 0 0 16px; color: var(--muted); }
.search-shell input { width: 100%; height: 100%; min-width: 0; border: 0; outline: 0; background: transparent; box-shadow: none; }
.search-filter-button { width: 36px; min-width: 36px; height: 36px; min-height: 36px; border: 0; background: transparent; color: var(--muted); }
.search-filter-menu, .global-search-results { position: absolute; top: calc(100% + 7px); z-index: 40; border: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: var(--shadow-float); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.search-filter-menu { right: 0; width: 210px; display: grid; gap: 9px; padding: 14px; border-radius: 14px; }
.search-filter-menu label { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.search-filter-menu input { width: 17px; height: 17px; }
.global-search-results { left: 0; right: 0; max-height: min(560px,70vh); overflow-y: auto; padding: 7px; border-radius: 16px; }
.global-search-result { width: 100%; min-height: 58px; display: grid; gap: 2px; padding: 9px 11px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.global-search-result:hover { background: var(--surface-hover); }
.global-search-result small { color: var(--muted); }
.global-search-empty { padding: 20px; color: var(--muted); text-align: center; }
.topbar-create { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.view { display: none; max-width: 1600px; margin: 0 auto; }
.view.is-active { display: block; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 1px; margin-bottom: 34px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.metric-card { min-height: 96px; display: grid; align-content: center; gap: 4px; padding: 17px 20px; background: rgba(255,255,255,.72); }
.metric-card span { color: var(--muted); font-size: 13px; }
.metric-card strong { font-size: 29px; line-height: 1; letter-spacing: -0.035em; }
.content-grid { display: grid; gap: clamp(24px, 3vw, 46px); }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.client-layout { grid-template-columns: minmax(310px, 410px) minmax(0, 1fr); align-items: start; }
.section-heading, .board-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 13px; }
.section-heading h2, .board-toolbar h2 { font-size: 21px; letter-spacing: -0.025em; }
.secondary-heading { margin-top: 38px; }
.heading-actions { display: flex; align-items: center; gap: 8px; }
.muted, .fine-print, .card-meta { color: var(--muted); font-size: 13px; line-height: 1.45; }
.stack-list, .client-list, .result-list, .audit-list { display: grid; }
.audit-list { max-height: 430px; overflow-y: auto; padding-right: 8px; scrollbar-gutter: stable; }
.info-card, .client-card, .knowledge-card, .result-item { min-height: 0; padding: 15px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; overflow-wrap: anywhere; }
.client-card, .knowledge-card, .result-item { width: 100%; text-align: left; }
.client-card:hover, .knowledge-card:hover, .result-item:hover { background: rgba(255,255,255,.54); }
.client-card { padding-inline: 12px; border-radius: 14px; }
.client-card.is-selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.card-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.card-title strong { line-height: 1.3; }
.pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.pill { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 9px; border-radius: 9px; background: #edf0f4; color: #596574; font-size: 12px; }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.activity-strip { margin-top: 38px; padding-top: 22px; border-top: 1px solid var(--line); }
.audit-item { display: grid; grid-template-columns: 155px 1fr; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.audit-item:first-child { border-top: 0; }

.assistant-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); gap: 14px; min-height: calc(100vh - 158px); transition: grid-template-columns 260ms cubic-bezier(.2,.7,.2,1); }
.assistant-layout.sources-collapsed { grid-template-columns: minmax(0, 1fr) 58px; }
.assistant-chat { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius-lg); background: rgba(255,255,255,.62); border: 1px solid var(--line); }
.assistant-intro { display: flex; align-items: center; gap: 14px; padding: 22px 24px 16px; }
.assistant-intro h2, .assistant-intro p { margin: 0; }
.assistant-intro h2 { font-size: 21px; letter-spacing: -.02em; }
.assistant-intro p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.assistant-orb { width: 42px; height: 42px; }
.assistant-messages { flex: 1; min-height: 280px; max-height: calc(100vh - 450px); overflow-y: auto; display: flex; flex-direction: column; gap: 17px; padding: 20px clamp(22px,4vw,62px); scroll-behavior: smooth; }
.assistant-message { max-width: min(82%, 760px); line-height: 1.62; overflow-wrap: anywhere; }
.assistant-message.user { align-self: flex-end; padding: 11px 15px; border-radius: 17px 17px 5px 17px; color: #fff; background: var(--accent); }
.assistant-message.assistant { align-self: flex-start; padding: 5px 0; }
.assistant-message-role { margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.assistant-message.user .assistant-message-role { color: rgba(255,255,255,.72); }
.assistant-copy { min-height: 40px; margin-top: 9px; padding: 5px 11px; color: var(--muted); background: transparent; font-size: 13px; }
.assistant-copy:hover { color: var(--accent); background: var(--accent-soft); }
.source-reference { display: inline-flex; padding: 1px 7px; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 12px; white-space: nowrap; user-select: none; }
.is-thinking > div:last-child { display: flex; gap: 5px; padding: 7px 2px 3px; }
.is-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: assistant-pulse 1.1s ease-in-out infinite; }
.is-thinking span:nth-child(2) { animation-delay: 120ms; }
.is-thinking span:nth-child(3) { animation-delay: 240ms; }
@keyframes assistant-pulse { 0%,70%,100% { opacity:.28; transform:translateY(0); } 35% { opacity:1; transform:translateY(-3px); } }
.assistant-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 clamp(22px,4vw,62px) 14px; }
.assistant-suggestions button, .assistant-pane-heading button, .assistant-library-links button { min-height: 40px; padding: 6px 10px; border-radius: 11px; background: rgba(255,255,255,.7); font-size: 12px; }
.assistant-suggestions button:hover, .assistant-library-links button:hover { color: var(--accent); border-color: var(--accent); }
.assistant-composer { margin: 0 14px 14px; padding: 10px; border: 1px solid rgba(255,255,255,.9); border-radius: 20px; background: var(--glass-strong); box-shadow: var(--shadow-soft), inset 0 1px 0 #fff; backdrop-filter: blur(22px) saturate(135%); -webkit-backdrop-filter: blur(22px) saturate(135%); }
.assistant-scope { display: flex; gap: 5px; margin: 0 3px 7px; }
.assistant-scope label { cursor: pointer; }
.assistant-scope input { position: absolute; opacity: 0; pointer-events: none; }
.assistant-scope span { display: block; padding: 6px 10px; border-radius: 9px; color: var(--muted); font-size: 12px; }
.assistant-scope input:checked + span { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.assistant-scope input:focus-visible + span { outline: 3px solid rgba(40,100,220,.34); }
.assistant-input-row { display: flex; align-items: flex-end; gap: 9px; }
.assistant-input-row textarea { width: 100%; min-height: 44px; max-height: 130px; resize: vertical; padding: 11px; border: 0; outline: 0; background: transparent; box-shadow: none; }
.assistant-input-row button { flex: 0 0 auto; min-height: 42px; }
.assistant-round-button { width: 42px; min-width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
#assistantVoice.is-listening { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.assistant-footnote { margin: 7px 4px 1px; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.assistant-sources-pane { position: sticky; top: 18px; align-self: start; max-height: calc(100vh - 36px); overflow-y: auto; padding: 15px; border: 1px solid rgba(255,255,255,.88); border-radius: 22px; background: var(--glass); box-shadow: var(--shadow-soft), inset 0 1px 0 #fff; backdrop-filter: blur(22px) saturate(135%); -webkit-backdrop-filter: blur(22px) saturate(135%); transition: padding 260ms ease, border-radius 260ms ease; }
.assistant-pane-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.assistant-pane-actions { display: flex; gap: 5px; }
.assistant-pane-actions .icon-button { min-width: 40px; width: 40px; height: 40px; min-height: 40px; padding: 0; }
.assistant-layout.sources-collapsed .assistant-sources-pane { padding: 12px; overflow: hidden; }
.assistant-layout.sources-collapsed .assistant-pane-heading { border: 0; padding: 0; }
.assistant-pane-heading > div:first-child, #assistantClear, .assistant-sources, .assistant-library-links { transition: opacity 150ms ease, visibility 150ms ease; }
.assistant-layout.sources-collapsed .assistant-pane-heading > div:first-child, .assistant-layout.sources-collapsed #assistantClear, .assistant-layout.sources-collapsed .assistant-sources, .assistant-layout.sources-collapsed .assistant-library-links { position: absolute; opacity: 0; visibility: hidden; pointer-events: none; }
.assistant-sources { display: grid; gap: 9px; padding: 13px 0; }
.assistant-source { display: grid; grid-template-columns: 25px minmax(0,1fr); gap: 9px; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.55); overflow-wrap: anywhere; }
.assistant-source.contextual { cursor: pointer; }
.assistant-source.contextual:hover { background: #fff; }
.assistant-source-number { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: var(--accent-soft); font-size: 12px; font-weight: 800; }
.assistant-source p { display: -webkit-box; margin: 6px 0 0; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.assistant-source a { display: inline-block; margin-top: 6px; color: var(--accent); font-size: 12px; }
.assistant-empty-source { padding: 18px 6px; color: var(--muted); font-size: 13px; text-align: center; }
.assistant-library-links { display: grid; gap: 7px; padding-top: 11px; border-top: 1px solid var(--line); }
.assistant-library-links button { width: 100%; text-align: left; }

.search-page { display: grid; gap: 14px; }
.search-page input { width: 100%; height: 54px; padding: 0 16px; font-size: 16px; }
.client-toolbar { align-items: center; flex-wrap: wrap; gap: 10px; }
.people-switcher { width: fit-content; display: flex; gap: 4px; margin: -12px 0 22px; padding: 5px; border: 1px solid rgba(255,255,255,.9); border-radius: 16px; background: var(--glass); box-shadow: var(--shadow-soft), inset 0 1px 0 #fff; backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%); }
.people-switcher button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); }
.people-switcher button:hover { color: var(--text); background: rgba(255,255,255,.5); }
.people-switcher button.is-active { color: var(--accent); background: rgba(255,255,255,.82); box-shadow: 0 5px 14px rgba(29,43,61,.08); font-weight: 700; }
.client-toolbar input { flex: 1; min-width: 220px; }
.client-toolbar input, .client-toolbar select, .library-search input { min-height: 44px; padding: 0 13px; }
.client-list { max-height: 65vh; overflow-y: auto; padding-right: 4px; }
.details-pane { position: sticky; top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.72); }
.details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin: 18px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.details-grid.single-column { grid-template-columns: 1fr; }
.detail-cell { padding: 13px; background: var(--surface); }
.detail-cell span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.phone-copy { min-height: 32px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--accent); text-align: left; font: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(40,100,220,.35); text-underline-offset: 3px; }
.phone-copy:hover { background: transparent; text-decoration-color: currentColor; }
.person-data-section { padding: 15px 0; border-top: 1px solid var(--line); }
.person-data-section h3 { margin: 0 0 8px; font-size: 16px; }
.person-data-section ul { margin: 0; padding-left: 20px; }
.person-data-section li + li { margin-top: 5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.details-pane .info-card { padding-inline: 0; }

.task-date-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 16px; padding: 0; border: 0; }
.task-date-filters legend { float: left; margin-right: 4px; padding: 12px 0; color: var(--muted); font-size: 13px; font-weight: 650; }
.task-date-filters label { min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.72); color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; }
.task-date-filters label:has(input:checked) { border-color: rgba(45,108,223,.28); background: var(--accent-soft); color: var(--accent); }
.task-date-filters label:focus-within { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.task-date-filters input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.task-date-filters small { min-width: 20px; color: inherit; font-size: 11px; text-align: right; }
.task-board { display: grid; grid-template-columns: repeat(5,minmax(205px,1fr)); gap: 12px; }
.task-column { min-height: 440px; padding: 11px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.42); transition: background 150ms ease, border-color 150ms ease; }
.task-column header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 2px 4px 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.task-card { position: relative; margin-bottom: 9px; padding: 14px 42px 14px 14px; border: 1px solid rgba(255,255,255,.9); border-radius: 15px; background: rgba(255,255,255,.84); box-shadow: 0 8px 20px rgba(29,43,61,.05); }
.task-card strong { display: block; margin-bottom: 7px; line-height: 1.3; }
.task-client { margin-top: 5px; color: var(--text); font-size: 13px; font-weight: 650; line-height: 1.35; }
.task-more-button { position: absolute; top: 7px; right: 7px; width: 32px; min-width: 32px; height: 32px; min-height: 32px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; font-size: 20px; line-height: 1; }
.task-progress { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.schedule-more { margin-top: 6px; }
.schedule-more summary { min-height: 40px; display: flex; align-items: center; color: var(--accent); cursor: pointer; font-weight: 650; }
.highlight-flash, .is-highlighted { animation: highlight-flash 1.8s ease; }
@keyframes highlight-flash { 0%,100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px var(--accent-soft); } }
.task-card.dragging { opacity: .55; }
.task-column.is-over { border-color: var(--accent); background: var(--accent-soft); }

.library-search { display: grid; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 13px; font-weight: 600; }
.library-search input { width: 100%; }
.knowledge-filters { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0 20px; padding: 0; border: 0; }
.knowledge-filters legend { float: left; margin-right: 5px; padding: 7px 0; color: var(--muted); font-size: 13px; }
.knowledge-filters label { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 13px; }
.knowledge-filters input, #hideKnowledgeSearch { width: 17px; height: 17px; }
.knowledge-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.knowledge-card { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.66); }
.knowledge-card p { color: var(--muted); line-height: 1.5; }
.file-table { --file-color:#217347; --file-bg:#edf7f1; }
.file-image { --file-color:#7550a5; --file-bg:#f4eff9; }
.file-document { --file-color:#2866a8; --file-bg:#eef4fb; }
.file-pdf { --file-color:#b34246; --file-bg:#fbeff0; }
.file-slides { --file-color:#946514; --file-bg:#fbf5e8; }
.file-other { --file-color:#68717a; --file-bg:#f1f3f5; }
.knowledge-card[data-type="knowledge"] { box-shadow: inset 3px 0 0 var(--file-color); }
.file-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.file-tag { padding: 3px 7px; border-radius: 7px; color: var(--file-color); background: var(--file-bg); font-size: 12px; font-weight: 650; }
.material-file-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.material-file-top .check-label { flex-basis: 100%; }
.price-table { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.7); }
.price-row { min-width: 760px; display: grid; grid-template-columns: 1.2fr 1.1fr .9fr .8fr .8fr .9fr 1.4fr; gap: 8px; align-items: center; padding: 13px 15px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.price-row:first-child { border-top: 0; }
.price-row:not(.header):hover { background: rgba(255,255,255,.75); }
.price-row.header { position: sticky; top: 0; z-index: 1; background: #f4f6f8; color: var(--muted); font-size: 12px; font-weight: 700; }

.users-list { margin-bottom: 36px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 2px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.user-row > div { min-width: 0; }
.user-row button { flex-shrink: 0; }
#branchesList { line-height: 2; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(420px,calc(100vw - 48px)); padding: 12px 15px; border-radius: 14px; background: #17202b; color: #fff; box-shadow: var(--shadow-float); transform: translateY(16px); opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.context-menu { position: fixed; z-index: 30; display: none; min-width: 220px; padding: 7px; border: 1px solid rgba(255,255,255,.9); border-radius: 16px; background: var(--glass-strong); box-shadow: var(--shadow-float); backdrop-filter: blur(24px) saturate(135%); -webkit-backdrop-filter: blur(24px) saturate(135%); }
.context-menu.is-open { display: grid; gap: 3px; }
.context-menu button { min-height: 38px; border: 0; background: transparent; text-align: left; }
.context-menu button:hover { background: var(--surface-hover); }
.context-menu-group { position: relative; }
.context-submenu { display: none; position: absolute; top: -7px; left: calc(100% + 7px); min-width: 190px; padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass-strong); box-shadow: var(--shadow-float); }
.context-menu-group.is-open .context-submenu { display: grid; gap: 3px; }
.context-menu .danger-menu-item { color: var(--red); }
.danger-button { color: var(--red); border-color: rgba(183,53,59,.35); background: var(--red-soft); }
.danger-button:hover { color: #fff; border-color: var(--red); background: var(--red); }
dialog { width: min(540px,calc(100vw - 32px)); max-height: 90vh; padding: 0; overflow-y: auto; border: 1px solid rgba(255,255,255,.88); border-radius: 24px; background: var(--glass-strong); box-shadow: var(--shadow-float); backdrop-filter: blur(26px) saturate(130%); -webkit-backdrop-filter: blur(26px) saturate(130%); }
dialog::backdrop { background: rgba(23,32,43,.28); backdrop-filter: blur(3px); }
.dialog-card { display: grid; gap: 15px; padding: 22px; }
.dialog-card header, .dialog-card footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-card .icon-button { flex: 0 0 42px; padding: 0; display: grid; place-items: center; line-height: 0; }
.dialog-card .icon-button .ui-icon { margin: 0; transform: none; }
.dialog-card h2 { font-size: 22px; letter-spacing: -.025em; }
.dialog-card input, .dialog-card textarea, .dialog-card select { width: 100%; padding: 11px 13px; }
.dialog-card footer { justify-content: flex-end; padding-top: 3px; }
#materialDialog { width: min(780px,calc(100vw - 32px)); }
#materialFields { display: grid; gap: 15px; min-width: 0; }
#materialFields h3 { margin: 0 0 6px; color: var(--muted); font-size: 13px; }
.material-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
#userDialog { width: min(580px,calc(100vw - 32px)); }
#userForm fieldset { display: grid; gap: 11px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
#userForm .check-label, .check-label { display: flex; align-items: center; gap: 8px; }
#userForm input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }

.rack-heading { align-items: center; }
.rack-heading p { margin: 5px 0 0; }
.rack-archive-toggle { min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: var(--muted); font-size: 13px; }
.rack-archive-toggle input { width: 18px; height: 18px; }
.rack-board { position: relative; height: 650px; min-height: 650px; max-height: 1200px; overflow: hidden; border: 1px solid rgba(76,57,35,.13); border-radius: 22px; background-color: #e4d8c4; background-image: radial-gradient(rgba(83,62,39,.12) .7px, transparent .8px); background-size: 9px 9px; box-shadow: inset 0 1px 2px rgba(65,45,25,.12), 0 18px 50px rgba(48,38,28,.07); transition: height 180ms ease; }
.rack-board::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 55px rgba(91,64,34,.08), inset 0 0 0 9px rgba(255,255,255,.16); }
.rack-board-empty { position: absolute; inset: 0; display: grid; place-content: center; gap: 8px; padding: 30px; color: #6f6458; text-align: center; }
.rack-board-empty strong { color: #403a34; font-size: 18px; }
.rack-note { --note-bg: #fff2a8; position: absolute; left: calc(var(--x) * 1%); top: var(--note-top, calc(var(--y) * 1%)); z-index: 1; width: 240px; min-height: 176px; max-height: 620px; display: flex; flex-direction: column; overflow: hidden; padding: 28px 19px 14px; border: 1px solid rgba(79,65,35,.12); border-radius: 3px 3px 11px 4px; background: var(--note-bg); color: #29271f; box-shadow: 0 12px 24px rgba(62,48,29,.15), inset 0 1px rgba(255,255,255,.5); transform: rotate(calc(var(--rotation) * 1deg)); transform-origin: 50% 10%; touch-action: none; user-select: none; }
.rack-note.color-blue, .rack-color-swatch.color-blue { --note-bg: #dceeff; }
.rack-note.color-rose, .rack-color-swatch.color-rose { --note-bg: #ffe1e4; }
.rack-note.color-green, .rack-color-swatch.color-green { --note-bg: #def0d7; }
.rack-note.color-white, .rack-color-swatch.color-white { --note-bg: #fffdf6; }
.rack-note.color-yellow, .rack-color-swatch.color-yellow { --note-bg: #fff2a8; }
.rack-note::before { content: ""; position: absolute; top: 8px; left: 50%; z-index: 2; width: 13px; height: 13px; border-radius: 50%; background: #ba3b3e; box-shadow: 0 2px 3px rgba(54,22,22,.38), inset 0 2px 2px rgba(255,255,255,.38); transform: translateX(-50%); }
.rack-note.is-dragging { z-index: 8; cursor: grabbing; box-shadow: 0 20px 36px rgba(62,48,29,.22); transform: rotate(0deg) scale(1.015); }
.rack-note-drawing { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.rack-note-body, .rack-note-meta, .rack-note-actions { position: relative; z-index: 1; }
.rack-note-body { min-height: 0; flex: 1; margin: 2px -7px 16px 0; padding-right: 7px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.48; scrollbar-width: thin; user-select: text; }
.rack-note.is-crossed .rack-note-body { color: #645f51; text-decoration: line-through 2px rgba(96,49,49,.66); }
.rack-note-meta { display: flex; justify-content: space-between; gap: 8px; color: rgba(45,42,32,.62); font-size: 11px; }
.rack-note-actions { display: flex; gap: 4px; margin: 0 -6px -5px; padding-top: 8px; }
.rack-note-actions button { min-width: 38px; min-height: 38px; padding: 0 8px; border-color: transparent; background: transparent; color: rgba(42,39,29,.68); font-size: 12px; }
.rack-note-actions button:hover { border-color: rgba(45,39,27,.1); background: rgba(255,255,255,.3); color: #28251d; }
.rack-unpinned { margin-top: 30px; }
.rack-unpinned-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }
.rack-unpinned-item { min-height: 120px; display: grid; align-content: space-between; gap: 14px; padding: 17px; background: rgba(255,255,255,.76); }
.rack-unpinned-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.rack-unpinned-item.is-crossed p { text-decoration: line-through; }
.rack-unpinned-item footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rack-unpinned-item button { min-height: 38px; }
.rack-visibility, .rack-color-picker { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.rack-visibility { display: grid; gap: 10px; }
.rack-visibility > label, .rack-branch-choices label { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 9px; color: var(--text); font-weight: 500; }
.rack-visibility input, .rack-color-picker input { width: 18px; height: 18px; margin: 0; }
.rack-branch-choices { display: grid; gap: 9px; margin: 2px 0 0 27px; padding: 12px; border-radius: 11px; background: var(--surface-soft); }
.rack-color-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.rack-color-picker legend, .rack-visibility legend { color: var(--muted); font-size: 13px; font-weight: 600; }
.rack-color-picker label { position: relative; }
.rack-color-picker input { position: absolute; opacity: 0; }
.rack-color-swatch { --note-bg: #fff2a8; min-height: 38px; display: inline-flex; align-items: center; padding: 0 11px; border: 2px solid transparent; border-radius: 10px; background: var(--note-bg); color: #3f3b31; font-size: 12px; }
.rack-color-picker input:checked + .rack-color-swatch { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.rack-note-editor-field { display: grid; gap: 8px; }
.rack-note-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.rack-note-editor-heading button { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; }
.rack-note-editor-heading button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.rack-brush-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.58); }
.rack-brush-controls fieldset { display: flex; gap: 5px; margin: 0; padding: 0; border: 0; }
.rack-brush-controls legend { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.rack-brush-controls fieldset label { position: relative; display: block; }
.rack-brush-controls fieldset input { position: absolute; opacity: 0; }
.rack-ink-swatch { width: 32px; height: 32px; display: block; overflow: hidden; border: 2px solid transparent; border-radius: 10px; text-indent: -999px; background: #2b2b2b; }
.rack-ink-swatch.ink-red { background: #b7353b; }
.rack-ink-swatch.ink-blue { background: #2864dc; }
.rack-ink-swatch.ink-green { background: #187654; }
.rack-brush-controls input:checked + .rack-ink-swatch { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.rack-brush-width { min-width: 120px; gap: 4px !important; }
.rack-brush-width select { min-height: 36px; padding: 5px 30px 5px 9px; }
.rack-brush-controls > button { min-height: 36px; }
.rack-drawing-surface { --note-bg: #fff2a8; position: relative; min-height: 270px; overflow: hidden; border: 1px solid rgba(79,65,35,.15); border-radius: 7px; background: var(--note-bg); box-shadow: inset 0 1px rgba(255,255,255,.45); }
.rack-drawing-surface canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; touch-action: none; }
.rack-drawing-surface textarea { position: relative; z-index: 1; width: 100%; min-height: 270px; resize: vertical; padding: 24px; border: 0; border-radius: inherit; background: transparent; line-height: 1.55; box-shadow: none; }
.rack-drawing-surface textarea:focus { border: 0; box-shadow: inset 0 0 0 2px rgba(40,100,220,.32); }
.rack-drawing-surface.is-drawing canvas { pointer-events: auto; cursor: crosshair; }
.rack-drawing-surface.is-drawing textarea { pointer-events: none; caret-color: transparent; }
.rack-drawing-surface.color-blue { --note-bg: #dceeff; }
.rack-drawing-surface.color-rose { --note-bg: #ffe1e4; }
.rack-drawing-surface.color-green { --note-bg: #def0d7; }
.rack-drawing-surface.color-white { --note-bg: #fffdf6; }
#rackNoteError { min-height: 1.4em; margin: 0; color: var(--red); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.events-heading p { margin: 5px 0 0; }
.events-layout { display: grid; grid-template-columns: minmax(260px,320px) minmax(0,1fr); gap: 24px; align-items: start; }
.event-list { display: grid; gap: 7px; }
button.event-list-item { min-height: 92px; display: grid; align-content: center; gap: 4px; padding: 13px 15px; border-color: transparent; background: transparent; text-align: left; }
button.event-list-item:hover { border-color: var(--line); background: rgba(255,255,255,.64); }
button.event-list-item.is-selected { border-color: rgba(40,100,220,.16); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.event-list-item strong { font-size: 16px; line-height: 1.3; }
.event-list-item > span { color: var(--muted); font-size: 12px; }
.event-list-date { font-weight: 650; }
.events-empty, .event-details-empty { padding: 30px 18px; color: var(--muted); text-align: center; }
.events-empty strong, .event-details-empty strong { color: var(--text); font-size: 17px; }
.event-details { min-height: 420px; padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255,255,255,.68); }
.event-details-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.event-details-header h2 { margin: 3px 0 7px; font-size: 25px; letter-spacing: -.025em; }
.event-details-header p { max-width: 720px; margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.event-date-label { color: var(--accent); font-size: 13px; font-weight: 700; }
.event-details-header > button { flex-shrink: 0; }
.event-people-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; padding-top: 24px; }
.event-people-heading { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-people-heading h3 { display: inline; margin: 0 8px 0 0; font-size: 20px; }
.event-people-heading span { color: var(--muted); font-size: 12px; }
.event-people-heading button { min-height: 38px; }
.event-status-summary { display: flex; flex-wrap: wrap; gap: 13px; margin: 10px 0 8px; color: var(--muted); font-size: 12px; }
.event-status-summary span { display: inline-flex; align-items: center; gap: 6px; }
.event-status-summary i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.event-status-summary .status-yes { color: var(--green); }
.event-status-summary .status-maybe { color: var(--amber); }
.event-participant-list { display: grid; gap: 5px; }
.event-participant { position: relative; min-height: 68px; display: grid; grid-template-columns: 12px minmax(0,1fr) auto 38px; gap: 10px; align-items: center; padding: 9px 5px 9px 10px; border-radius: 14px; }
.event-participant:hover, .event-participant:focus-within { background: rgba(255,255,255,.8); }
.attendance-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.event-participant.status-maybe .attendance-dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.event-participant-copy { min-width: 0; }
.event-participant-copy strong { display: block; overflow-wrap: anywhere; line-height: 1.35; }
.event-participant-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.event-participant-copy p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.attendance-control select { min-height: 38px; max-width: 142px; padding: 7px 28px 7px 9px; border-color: transparent; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; }
.status-maybe .attendance-control select { background: var(--amber-soft); color: var(--amber); }
.participant-more-button { width: 38px; min-width: 38px; min-height: 38px; padding: 0; border-color: transparent; background: transparent; font-size: 18px; }
.event-empty-list { margin: 16px 0; color: var(--muted); font-size: 13px; }
.participant-type-picker, .participant-status-picker { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.participant-type-picker legend, .participant-status-picker legend { color: var(--muted); font-size: 13px; font-weight: 600; }
.participant-type-picker label { display: flex; align-items: center; gap: 7px; color: var(--text); font-weight: 500; }
.participant-type-picker input { width: 18px; height: 18px; margin: 0; }
.participant-choices { max-height: 300px; display: grid; gap: 4px; overflow-y: auto; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
button.participant-choice { min-height: 54px; display: grid; gap: 2px; padding: 9px 11px; border-color: transparent; background: transparent; text-align: left; }
button.participant-choice span { color: var(--muted); font-size: 12px; }
button.participant-choice.is-selected { border-color: rgba(40,100,220,.22); background: var(--accent-soft); }
.participant-choices > p { padding: 15px; color: var(--muted); text-align: center; }
.participant-status-picker label { position: relative; }
.participant-status-picker input { position: absolute; opacity: 0; }
.status-choice { min-height: 42px; display: inline-flex; align-items: center; padding: 0 12px; border: 2px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 700; }
.status-choice.status-yes { color: var(--green); background: var(--green-soft); }
.status-choice.status-maybe { color: var(--amber); background: var(--amber-soft); }
.participant-status-picker input:checked + .status-choice { border-color: currentColor; box-shadow: 0 0 0 2px rgba(40,100,220,.1); }
#eventFormError, #participantFormError, #participantNoteError { min-height: 1.4em; margin: 0; color: var(--red); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .search-shell, .assistant-composer, .assistant-sources-pane, .context-menu, dialog, .auth-form { background: rgba(255,255,255,.97); }
}
@media (max-width: 1240px) {
  :root { --sidebar: 218px; }
  .workspace { padding-inline: 22px; }
  .topbar { grid-template-columns: minmax(230px,1fr) minmax(390px,520px); }
  .task-board { grid-template-columns: repeat(2,minmax(240px,1fr)); }
  .knowledge-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rack-unpinned-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .event-people-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; gap: 18px; }
  .topbar-actions { justify-content: stretch; }
  .search-shell { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .two-columns, .client-layout { grid-template-columns: 1fr; }
  .details-pane { position: static; }
  .assistant-layout, .assistant-layout.sources-collapsed { grid-template-columns: 1fr; }
  .assistant-sources-pane { position: static; max-height: none; }
  .assistant-layout.sources-collapsed .assistant-sources-pane { display: none; }
  .events-layout { grid-template-columns: 240px minmax(0,1fr); gap: 16px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; padding: 0; }
  .sidebar { position: sticky; top: 0; z-index: 20; width: 100%; height: auto; display: block; padding: 8px; border: 0; border-bottom: 1px solid rgba(255,255,255,.9); border-radius: 0 0 20px 20px; }
  .sidebar-resize-handle { display: none; }
  .brand, .sidebar-footer, #settingsNav { display: none; }
  .nav-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(92px,1fr); gap: 3px; overflow-x: auto; }
  .nav-item { min-height: 48px; justify-content: center; gap: 5px; padding: 0 5px; font-size: 12px; }
  .people-switcher { width: 100%; overflow-x: auto; }
  .people-switcher button { flex: 1 0 auto; }
  .nav-icon { width: 22px; height: 22px; flex-basis: 22px; font-size: 16px; }
  .workspace { padding: 22px 16px 34px; }
  .topbar { margin-bottom: 24px; }
  .topbar h1 { font-size: 30px; }
  .topbar-actions { align-items: stretch; }
  .search-shell { min-width: 0; }
  .search-shell kbd, .topbar-create { display: none; }
  .metric-grid, .task-board, .knowledge-grid, .details-grid, .rack-unpinned-list { grid-template-columns: 1fr; }
  .metric-grid { gap: 0; }
  .metric-card { min-height: 72px; grid-template-columns: 1fr auto; align-items: center; }
  .two-columns { gap: 30px; }
  .assistant-layout { min-height: 0; }
  .assistant-messages { min-height: 260px; max-height: 52vh; padding: 16px; }
  .assistant-message { max-width: 94%; }
  .assistant-intro { padding: 16px; }
  .assistant-intro p { display: none; }
  .assistant-suggestions { padding: 0 16px 13px; }
  .assistant-composer { margin: 0 8px 8px; }
  .assistant-input-row { align-items: flex-end; flex-direction: row; }
  .assistant-input-row textarea { min-width: 0; }
  .sidebar-collapsed .nav-item span { display: inline; }
  .context-submenu { left: auto; right: calc(100% + 7px); }
  .section-heading, .board-toolbar { align-items: stretch; flex-direction: column; }
  .heading-actions { flex-wrap: wrap; }
  .heading-actions button { flex: 1; }
  .audit-item { grid-template-columns: 1fr; gap: 3px; }
  dialog { border-radius: 20px; }
  .rack-board { height: auto !important; min-height: auto; max-height: none; display: grid; gap: 12px; padding: 16px; overflow: visible; }
  .rack-board::before { display: none; }
  .rack-note { position: relative; left: auto; top: auto; width: 100%; min-height: 150px; max-height: 620px; transform: rotate(calc(var(--rotation) * .35deg)); }
  .events-layout { grid-template-columns: 1fr; }
  .event-list { grid-template-columns: repeat(2,minmax(180px,1fr)); overflow-x: auto; }
  .event-details { padding: 18px; }
  .event-details-header { flex-direction: column; }
  .event-participant { grid-template-columns: 12px minmax(0,1fr) 38px; }
  .attendance-control { grid-column: 2 / 4; }
  .attendance-control select { width: 100%; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Focused interface refinements */
.brand { gap: 9px; }
.brand-logo { width: 34px; height: 34px; }
.brand-logo img { width: 100%; height: 100%; }
.brand-logo-button { min-width: 34px; min-height: 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.brand-logo-button:hover { background: rgba(255,255,255,.58); }
.brand-logo-button.is-spinning img { animation: brand-spin 760ms cubic-bezier(.18,.78,.22,1); }
@keyframes brand-spin { 0% { transform: rotate(0deg); } 68% { transform: rotate(390deg); } 84% { transform: rotate(350deg); } 100% { transform: rotate(360deg); } }
.sidebar-search-button { width: 38px; min-width: 38px; min-height: 38px; margin-left: auto; border: 0; background: rgba(255,255,255,.44); color: var(--muted); }
.sidebar-search-button:hover { color: var(--accent); background: rgba(255,255,255,.8); }
.sidebar-collapsed .brand { display: grid; gap: 8px; }
.sidebar-collapsed .sidebar-search-button { margin: 0; }

.topbar { display: block; margin-bottom: 26px; }
.topbar h1.home-greeting { max-width: 980px; cursor: pointer; border-radius: 10px; }
.topbar h1.home-greeting:hover { color: var(--accent); }
.topbar h1.home-greeting:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 5px; }

.global-search-overlay { position: fixed; inset: 0; z-index: 80; display: grid; place-items: start center; padding: min(12vh,110px) 20px 30px; background: rgba(20,27,38,.2); opacity: 0; backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); transition: opacity 180ms ease; }
.global-search-overlay[hidden] { display: none; }
.global-search-overlay.is-open { opacity: 1; }
.global-search-panel { width: min(720px,100%); max-height: min(720px,78vh); display: grid; grid-template-rows: auto auto auto minmax(100px,1fr); gap: 12px; padding: 16px; overflow: hidden; border: 1px solid rgba(255,255,255,.9); border-radius: 24px; background: rgba(248,250,253,.94); box-shadow: 0 28px 90px rgba(23,34,49,.24), inset 0 1px #fff; transform: translateY(-12px) scale(.985); transition: transform 200ms cubic-bezier(.2,.75,.2,1); }
.global-search-overlay.is-open .global-search-panel { transform: none; }
.global-search-panel > header { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; }
.global-search-panel > header strong { font-size: 18px; }
.global-search-panel .search-shell { height: 54px; }
.search-section-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; border: 0; }
.search-section-filters legend { width: 100%; margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.search-section-filters label { min-height: 38px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.72); color: var(--muted); font-size: 12px; cursor: pointer; }
.search-section-filters input { width: 16px; height: 16px; }
.global-search-panel .global-search-results { position: static; max-height: none; min-height: 90px; overflow-y: auto; border: 0; border-radius: 14px; background: rgba(255,255,255,.58); box-shadow: none; }
.global-search-panel .global-search-results[hidden] { display: block; }
.global-search-panel .global-search-results:empty::before { content: "Начните вводить запрос — результаты появятся здесь"; display: block; padding: 28px 16px; color: var(--muted); text-align: center; }

.assistant-layout { display: block; min-height: calc(100vh - 134px); }
.assistant-chat { min-height: calc(100vh - 134px); }
.assistant-intro { justify-content: space-between; border-bottom: 1px solid var(--line); }
.assistant-header-actions { display: flex; align-items: center; gap: 7px; }
.assistant-header-actions button { min-height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 11px; background: rgba(255,255,255,.7); }
.assistant-header-actions #assistantSourcesToggle .fine-print { font-size: 11px; }
.assistant-header-actions #assistantSourcesToggle .ui-icon { width: 17px; transition: transform 180ms ease; }
.assistant-header-actions #assistantSourcesToggle.is-open .ui-icon { transform: rotate(180deg); }
.assistant-sources-panel { padding: 0 24px 16px; border-bottom: 1px solid var(--line); background: rgba(247,249,252,.7); }
.assistant-sources-panel[hidden] { display: none; }
.assistant-sources-panel .assistant-sources { grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); max-height: 260px; overflow-y: auto; }
.assistant-sources-panel .assistant-library-links { display: flex; flex-wrap: wrap; border: 0; padding-top: 2px; }
.assistant-sources-panel .assistant-library-links button { width: auto; }
.assistant-messages { max-height: calc(100vh - 390px); }

.rack-board { height: 650px; min-height: 650px; max-height: 1200px; }
.rack-add-button { position: absolute; right: 24px; bottom: 24px; z-index: 14; width: 58px; min-width: 58px; height: 58px; min-height: 58px; display: grid; place-items: center; padding: 0; border-radius: 50%; font-size: 0; line-height: 0; box-shadow: 0 14px 30px rgba(28,70,153,.28); }
.rack-add-button::before { content: "+"; display: block; font-size: 32px; font-weight: 400; line-height: 1; transform: translateY(-1px); }
.rack-note { cursor: grab; }
.rack-note-actions { display: none; }

.auth-screen { position: relative; overflow: hidden; isolation: isolate; }
.auth-form { position: relative; z-index: 1; transition: opacity 280ms ease, transform 420ms cubic-bezier(.4,0,.2,1), filter 350ms ease; }
.auth-screen.auth-exiting .auth-form { opacity: 0; transform: scale(.94); filter: blur(10px); }

@media (max-width: 760px) {
  .assistant-intro { align-items: flex-start; }
  .assistant-header-actions { margin-left: auto; }
  .assistant-header-actions button span:first-child, #assistantClear { font-size: 0; }
  #assistantClear::after { content: "+"; font-size: 22px; }
  .rack-add-button { position: sticky; left: 100%; bottom: 18px; }
}
