@layer legacy, ui;
/* Golos Text (ParaType, SIL Open Font License 1.1 — web/fonts/GolosText-LICENSE.txt), kept on our server: the face of Arx (the owner, 29.10.2026) */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 900; font-display: swap; src: url('/static/fonts/GolosText.ttf') format('truetype'); }
@layer legacy {
/* Text one step lighter (the owner, 04.11.2026): every weight of the interface is 100 below its old value (600 -> 500, 700 -> 600, 800 -> 700),
   the bold of the browser for headings and <strong> is 600; the wordmarks «Arx» keep 900. */
:where(h1, h2, h3, h4, h5, h6, strong, b, th, dt, legend) { font-weight: 600; }
#view-messages { max-width: none; margin: 0; }
.inbox-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.inbox-toolbar label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
.inbox-toolbar select { min-height: 44px; min-width: 190px; padding: 8px 36px 8px 12px; max-width: 100%; }
.inbox-toolbar #inboxRefresh { min-height: 44px; }
#inboxStatus { min-height: 20px; margin: 0 0 10px; }
.inbox-layout { display: grid; grid-template-columns: clamp(330px, 28vw, 440px) minmax(0, 1fr); height: calc(100dvh - 238px); min-height: 470px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 20px; }
.inbox-sidebar { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); padding: 14px 10px 8px; }
.inbox-sidebar > input { width: 100%; min-height: 46px; padding: 12px 14px; margin-bottom: 13px; }
.inbox-list-heading { display: flex; justify-content: space-between; align-items: center; padding: 0 12px 7px; font-size: 13px; color: var(--muted); }
.inbox-list-heading strong { font-weight: 550; }
#inboxDialogs { overflow-y: auto; min-height: 0; flex: 1; padding-right: 2px; }
button.inbox-dialog { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; min-height: 86px; text-align: left; padding: 10px 12px; border: 0; border-radius: 13px; background: transparent; }
button.inbox-dialog:hover { background: #f4f6f9; }
button.inbox-dialog.is-selected { background: #eaf1ff; }
.inbox-avatar { position: relative; width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #e9edf2; color: #344354; font-weight: 600; font-size: 18px; }
.inbox-avatar-image { position:absolute; inset:0; width:100%; height:100%; border-radius:inherit; object-fit:cover; background:var(--surface-soft,#e9edf2); }
.inbox-avatar .inbox-source-icon { position: absolute; width: 23px; height: 23px; right: -4px; bottom: -5px; border: 2px solid #fff; }
.inbox-dialog-body { display: block; min-width: 0; }
.inbox-dialog-top { display: flex; align-items: baseline; gap: 8px; justify-content: space-between; }
.inbox-unread-count { flex:0 0 auto; min-width:20px; padding:2px 6px; border-radius:12px; color:#fff; background:var(--accent,#2563eb); font-size:12px; text-align:center; }
.inbox-dialog-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.inbox-dialog time { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.inbox-preview { display: block; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin: 3px 0; color: #445264; font-size: 13px; }
.inbox-meta { display: block; font-size: 12px; color: #596574; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-source-icon { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #eef1f4; color: #515e6b; }
.inbox-source-icon svg { width: 65%; height: 65%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.source-telegram_bot, .source-max_bot { background: #eaedf0; color: #4d5864; }
.source-max { background: #eee8f9; color: #6941a5; }
.source-telegram { background: #e3f2fc; color: #086aab; }
.source-vk { background: #fff0de; color: #aa5c00; }
.source-vk_personal { background: #e6efff; color: #315dac; }
.source-whatsapp { background: #e5f5ea; color: #147348; }
.source-yandex_mail { background: #fbece9; color: #ac3b31; }
.source-rambler_mail { background: #e7effb; color: #285c9d; }
.inbox-mail-subject { color: #445264; font-size: 13px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.inbox-thread-header { display: flex; gap: 13px; align-items: center; min-height: 72px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.inbox-thread-header strong { overflow-wrap: anywhere; font-size: 16px; }
.inbox-thread-header > div { min-width: 0; }
.inbox-thread-header > div { flex:1; }
.inbox-thread-header #inboxMarkRead { min-height:44px; flex:0 0 auto; padding:8px 12px; }
.inbox-timeline { flex: 1; overflow: auto; padding: 24px clamp(24px, 5vw, 76px); min-height: 0; }
.inbox-message { width: fit-content; max-width: min(75%, 700px); padding: 12px 16px; margin-bottom: 13px; border-radius: 16px; background: #f2f4f6; }
.inbox-message.outgoing { margin-left: auto; background: #eaf1ff; }
.inbox-message:has(.inbox-message-text) { min-width:0; }
.inbox-message:has(.inbox-message-text) .inbox-message-text { line-height:1.5; }
.inbox-message:has(.inbox-attachment) { min-width:min(300px,100%); }
.inbox-message.inbox-mail { width:min(100%,780px); max-width:100%; background:var(--surface,#fff); border:1px solid var(--line); }
.inbox-message.inbox-mail.outgoing { background:var(--accent-soft,#eaf1ff); }
.inbox-message.inbox-mail .inbox-message-text { white-space:pre-wrap; line-height:1.6; }
.inbox-message-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 6px; }
.inbox-composer { padding: 15px 24px; border-top: 1px solid var(--line); font-size: 13px; }
.inbox-composer p { color: #596574; margin: 5px 0 0; }
.inbox-later { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:8px; }
.inbox-later button, .inbox-later input { min-height:44px; padding:0 14px; border:1px solid var(--line); border-radius:10px; background:transparent; color:inherit; font:inherit; }
.inbox-later button { cursor:pointer; font-weight:500; }
.inbox-later button:disabled { opacity:.6; cursor:wait; }
.inbox-later [role=status] { color:#596574; }
.inbox-later-list { flex-basis:100%; list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.inbox-later-list button { min-height:36px; padding:0 10px; margin-left:6px; }
.inbox-send-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; align-items: end; }
.inbox-send-form textarea { width: 100%; min-height: 48px; max-height: 160px; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; color: inherit; background: var(--surface, #fff); }
.inbox-send-form button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--primary, #2563eb); color: #fff; font: inherit; font-weight: 500; cursor: pointer; }
.inbox-send-form button:disabled { opacity: .6; cursor: wait; }
.inbox-send-form :focus-visible { outline: 3px solid #7aa7ff; outline-offset: 2px; }
.inbox-send-form [role=status] { grid-column: 1 / -1; color: #596574; min-height: 1.25em; }
@media (max-width: 640px) { .inbox-send-form { grid-template-columns: 1fr; } }

.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; }
.inbox-channel-control { position: relative; display: grid; gap: 5px; font-size: 13px; font-weight: 500; }
.inbox-channel-control summary { display: flex; align-items: center; min-width: 190px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--glass-strong); cursor: pointer; list-style: none; }
.inbox-channel-control summary::-webkit-details-marker { display: none; }
.inbox-channel-control summary::after { content: ''; display: inline-block; flex: 0 0 auto; margin-left: auto; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--ic-down) center / contain no-repeat; mask: var(--ic-down) center / contain no-repeat; }
.inbox-channel-control summary:focus-visible, .inbox-channel-options input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.inbox-channel-options { position: absolute; top: calc(100% + 5px); left: 0; z-index: 30; display: grid; min-width: 250px; max-height: min(55vh, 420px); overflow: auto; padding: 8px; border: 1px solid var(--line-strong); border-radius: 15px; background: var(--glass-strong); box-shadow: var(--shadow-float); backdrop-filter: blur(20px); }
.inbox-channel-options label { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 4px 8px; cursor: pointer; }
.inbox-channel-options input { width: 18px; height: 18px; }
.workspace.is-messages .topbar { max-width: none; margin-left: 0; margin-right: 0; }
@media (max-width: 1100px) { .inbox-layout { grid-template-columns: 310px 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: "Golos Text", -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: 550; 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-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: 500; }
.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-title { font-size: 18px; font-weight: 700; letter-spacing: -0.025em; }
.brand-beta { display: block; margin-top: 1px; color: var(--muted); font-size: 10.5px; font-weight: 550; letter-spacing: .05em; line-height: 1.2; text-transform: uppercase; }
.nav-more-note { margin: 2px 0 6px 13px; padding: 0 4px 0 9px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.nav-more-note[hidden] { display: none; }
.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: 470; }
.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-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: 680; }
.topbar p, .board-toolbar p { margin: 7px 0 0; color: var(--muted); }
.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); }
.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; }
.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); }
.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; }
.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); }
.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); color: var(--text); }
.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); }
.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; }

.dashboard-main-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; align-items:start; margin-bottom:28px; }
.dashboard-calendar-section,.dashboard-attention-section { min-width:0; }
#userWorkdayHours { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
#userWorkdayHours legend,#userWorkdayHours p { grid-column:1/-1; }
#userWorkdayHours label { display:grid; gap:6px; }
.dashboard-calendar-heading { align-items:center; margin-bottom:12px; }
.dashboard-calendar-controls { display:flex; align-items:center; gap:9px; }
.dashboard-calendar-controls strong { min-width:145px; text-align:center; text-transform:capitalize; font-size:16px; }
.dashboard-calendar-controls button { width:34px; height:34px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); color:var(--text); font-size:21px; line-height:1; cursor:pointer; }
.dashboard-calendar-weekdays,.dashboard-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.dashboard-calendar-weekdays { margin-bottom:5px; color:var(--muted); text-align:center; font-size:14px; font-weight:550; }
.dashboard-calendar-grid { border:1px solid var(--line); border-radius:14px; background:var(--surface); }
.dashboard-calendar-day { position:relative; min-width:0; min-height:124px; padding:7px 6px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); color:var(--text); }
.dashboard-calendar-day:nth-child(7n) { border-right:0; }
.dashboard-calendar-day:nth-last-child(-n+7) { border-bottom:0; }
.dashboard-calendar-day:hover { background:var(--surface-hover); }
.dashboard-calendar-day > span { display:grid; place-items:center; width:30px; height:30px; border-radius:50%; font-size:15px; font-weight:550; }
.dashboard-calendar-day.is-outside-month { color:var(--muted); background:var(--surface-soft); }
.dashboard-calendar-day.is-today > span { color:var(--accent-contrast,#fff); background:var(--accent); font-weight:600; }
.dashboard-calendar-events { display:grid; gap:2px; margin-top:5px; }
.dashboard-calendar-event { width:100%; min-width:0; padding:3px 5px; border:0; border-radius:5px; background:var(--accent-soft); color:var(--text); text-align:left; font-size:13px; line-height:1.2; overflow:hidden; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:4; cursor:pointer; }
.dashboard-calendar-event:hover { background:var(--accent-soft); outline:1px solid var(--accent); }
.dashboard-calendar-more { color:var(--muted); font-size:12px; }
.dashboard-calendar-tasks { position:relative; margin-top:4px; font-size:12px; }
.dashboard-calendar-tasks summary { width:max-content; max-width:100%; padding:2px 5px; border-radius:6px; color:var(--accent); cursor:pointer; list-style:none; }
.dashboard-calendar-tasks summary::-webkit-details-marker { display:none; }
.dashboard-calendar-task-list { position:absolute; z-index:8; top:100%; left:0; width:max(190px,100%); max-width:min(280px,80vw); display:grid; gap:3px; padding:7px; border:1px solid var(--line); border-radius:9px; background:var(--surface); box-shadow:var(--shadow-float); }
.dashboard-calendar-task-list button { width:100%; padding:6px; text-align:left; overflow-wrap:anywhere; }
.dashboard-attention-section .stack-list { max-height:800px; overflow:auto; }
.dashboard-debtor { position:relative; padding-right:42px; cursor:context-menu; }
.dashboard-debtor .card-meta { margin-top:7px; }
.dashboard-secondary-grid { padding-top:23px; border-top:1px solid var(--line); }

.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-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-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: 600; 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; }
.assistant-thinking-line { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.assistant-thinking-dots { display:inline-flex; gap:4px; }
.assistant-thinking-dots i { width:5px; height:5px; border-radius:50%; background:currentColor; animation:assistant-pulse 1.1s ease-in-out infinite; }
.assistant-thinking-dots i:nth-child(2) { animation-delay:120ms; }
.assistant-thinking-dots i:nth-child(3) { animation-delay:240ms; }
.assistant-thinking-line time { font-variant-numeric:tabular-nums; color:var(--muted); }
.loading-surface { display:block; border-radius:10px; background:var(--surface-secondary, #e9edf2); opacity:.8; animation:loading-breathe 1.6s ease-in-out infinite; }
.crm-loading-tab { width:140px; height:44px; }
.crm-loading-column header .loading-surface { width:65%; height:20px; }
.crm-loading-column > div { display:grid; gap:12px; }
.crm-loading-column > div .loading-surface { height:84px; }
.schedule-loading { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; min-height:360px; padding:16px; }
.schedule-loading .loading-surface { min-height:300px; }
@keyframes loading-breathe { 50% { opacity:.42; } }
@media (prefers-reduced-motion:reduce) { .loading-surface,.assistant-thinking-dots i { animation:none; } }
@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-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-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-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; }
#assistantClear, .assistant-sources, .assistant-library-links { transition: opacity 150ms ease, visibility 150ms ease; }
.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: 700; }
.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; }
.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: 600; 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-board { display: grid; grid-template-columns: repeat(5,minmax(168px,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: 600; }
.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: 550; 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: 550; }
.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: 500; }
.library-search input { width: 100%; }
#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"] { border-color: color-mix(in srgb, var(--file-color) 26%, var(--line)); }
.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: 550; }
.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: 600; }

.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; }
.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-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 { 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-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: 500; }
.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: 500; }
.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; }
#planningTab.is-active,#calendarTab.is-active { border-color:var(--line-strong); background-color:var(--surface-hover); color:var(--text); }
.plans-panel[hidden] { display:none; }
.plans-calendar-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(230px,280px); gap:24px; align-items:start; }
.plans-calendar { min-width:0; }
.plans-calendar-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 15px; }
.plans-calendar-toolbar h2 { margin:0; font-size:22px; text-transform:capitalize; }
.plans-calendar-controls { display:flex; gap:8px; }
.plans-calendar-controls button { width:44px; min-height:44px; padding:0; font-size:24px; line-height:1; }
.plans-calendar-weekdays,.plans-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.plans-calendar-weekdays { margin-bottom:7px; color:var(--muted); font-size:12px; font-weight:550; text-align:center; }
.plans-calendar-weekdays span { padding:8px 2px; }
.plans-calendar-grid { overflow:hidden; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.plans-calendar-day { min-width:0; min-height:86px; padding:7px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.plans-calendar-day:nth-child(7n) { border-right:0; }
.plans-calendar-day:nth-last-child(-n+7) { border-bottom:0; }
.plans-calendar-day.is-outside-month { background:color-mix(in srgb,var(--surface) 75%,var(--line)); color:var(--muted); }
.plans-calendar-day-number { display:block; margin-bottom:6px; font-size:13px; font-weight:550; }
.plans-calendar-day-events { display:grid; gap:3px; }
.plans-calendar-event { display:block; width:100%; min-width:0; min-height:26px; overflow:hidden; padding:3px 6px; border-color:transparent; background:var(--accent-soft); color:var(--text); text-align:left; text-overflow:ellipsis; white-space:nowrap; font-size:11px; }
.plans-calendar-event:hover { border-color:var(--accent); }
.plans-calendar-more { color:var(--muted); font-size:11px; }
.plans-month-list { display:grid; gap:8px; }
.plans-month-list h2 { margin:0 0 5px; font-size:18px; }
#plansMonthList { display:grid; align-content:start; gap:5px; }
.plans-month-event { display:grid; gap:4px; min-height:68px; padding:10px 11px; border-color:transparent; background:transparent; text-align:left; }
.plans-month-event:hover { border-color:var(--line); background:var(--surface-hover); }
.plans-month-event span,.plans-month-event small { color:var(--muted); font-size:12px; }
.plans-month-event strong { font-size:14px; }
.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); }
.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: 550; }
.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: 600; }
.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: 600; }
.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: 500; }
.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: 600; }
.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)); }
    .event-people-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; gap: 18px; }
    .search-shell { flex: 1; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .client-layout { grid-template-columns: 1fr; }
  .details-pane { position: static; }
  .assistant-layout { grid-template-columns: 1fr; }
  .assistant-sources-pane { position: static; max-height: 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; }
  .sidebar-footer, #settingsNav { display: none; }
  .brand { display: flex; align-items: center; gap: 9px; margin: 0 4px 8px; }
  .brand-title { display: block; font-size: 17px; }
  .mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-left: 0; }
  #openGlobalSearch { display: inline-flex; margin-left: auto; }
  .nav-list { display: none; grid-auto-flow: row; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .nav-list.is-mobile-open { display: grid; }
  .nav-list { gap: 3px; }
  .nav-item { min-height: 48px; justify-content: center; gap: 5px; padding: 0 5px; font-size: 12px; }
  .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; }
    .search-shell { min-width: 0; }
  .search-shell kbd { display: none; }
  .metric-grid, .task-board, .knowledge-grid, .details-grid { grid-template-columns: 1fr; }
  .metric-grid { gap: 0; }
  .metric-card { min-height: 72px; grid-template-columns: 1fr auto; align-items: center; }
    .dashboard-main-grid { grid-template-columns:1fr; }
  .dashboard-calendar-day { min-height:85px; padding:5px 3px; }
  .dashboard-calendar-day > span { width:27px; height:27px; }
  .dashboard-calendar-event { font-size:11px; }
  .dashboard-secondary-grid { gap:26px; }
  .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; }
  #leadQuery { width: 100%; min-width: 260px; }
  #scheduleDate { min-width: 150px; font-size: 14px; }
  .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; }
  .plans-calendar-layout { grid-template-columns:1fr; gap:22px; }
  .plans-calendar-day { min-height:72px; padding:5px 4px; }
  .plans-calendar-day-number { font-size:12px; }
  .plans-calendar-event { min-height:24px; padding:3px 4px; font-size:10px; }
  .plans-calendar-weekdays { font-size:11px; }
  .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; }

.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; }
.global-search-result.is-archive strong { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.button-like { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 13px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 550; }
.button-like:hover { background: var(--surface-hover); }
.button-like:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.event-date-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.event-date-fields label { display: grid; gap: 6px; }
@media (max-width: 760px) { .event-date-fields { grid-template-columns: 1fr; } }
.event-reminder-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 12px; }
.event-reminder-fields label { display:grid; gap:6px; }
.event-reminder-fields .fine-print { grid-column:1/-1; margin:0; }
.event-responsibles { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:5px 12px; }
.event-responsibles legend,.event-responsibles > p { grid-column:1/-1; }
.event-responsibles label { min-width:0; }
.lead-pipelines { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.lead-pipelines button { min-height: 46px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); white-space: nowrap; text-align: left; }
.lead-pipelines button.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.lead-pipelines small { display: block; color: var(--muted); font-size: 11px; }
.lead-board { display: flex; gap: 14px; align-items: start; overflow-x: auto; min-height: 330px; padding-bottom: 18px; }
.lead-column { flex: 0 0 clamp(255px, 25vw, 340px); max-height: min(72vh, 850px); overflow-y: auto; padding: 10px; border-radius: 15px; background: var(--surface-soft); }
.lead-column > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 5px 10px; }
.lead-column h3 { margin: 0; font-size: 15px; }
.lead-column > header span { color: var(--muted); }
.lead-card { padding: 13px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow-wrap: anywhere; }
.lead-card-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lead-card-title a { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; font-size: 20px; text-decoration: none; }
.lead-card small, .lead-card time { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.lead-card p { margin: 9px 0 0; white-space: pre-wrap; font-size: 13px; }
.schedule-day { width: 100%; overflow: visible; }
.schedule-grid { width:100%; min-width:0; display: grid; grid-template-columns: 64px repeat(var(--schedule-rooms), minmax(0, 1fr)); border-top: 1px solid var(--line); }
.schedule-axis { position: relative; min-height: calc(var(--schedule-height) + 40px); color: var(--muted); font-size: 12px; }
.schedule-axis span { position: absolute; right: 8px; transform: translateY(-50%); }
.schedule-room { min-width: 0; border-left: 1px solid var(--line); }
.schedule-room h3 { position: sticky; top: 0; z-index: 2; min-height: 40px; margin: 0; padding: 10px; background: var(--room-header, var(--surface-soft)); color: var(--room-ink, var(--text)); font-size: 13px; }
.schedule-room-track { position: relative; height: var(--schedule-height); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--schedule-hour-size) - 1px), var(--line) calc(var(--schedule-hour-size) - 1px), var(--line) var(--schedule-hour-size)); }
.schedule-grid-lesson { position: absolute; box-sizing:border-box; top: var(--lesson-top); left: 5px; right: 5px; height: var(--lesson-height); display: flex; flex-direction: column; gap: 4px; overflow: hidden; padding: 8px; border: 1px solid var(--room-border, #c9d5e5); border-radius: 9px; background: var(--room-card, var(--surface)); font-size: 12px; z-index: 1; overflow-wrap:anywhere; }
.schedule-grid-lesson small { color: var(--muted); }
.schedule-grid-lesson.is-canceled { color: var(--muted); text-decoration: line-through; background: var(--surface-soft); border-color: var(--line-strong); border-style: dashed; }
.schedule-grid-lesson.is-completed { border-color: color-mix(in srgb, var(--green) 55%, var(--room-border, var(--line))); }
.schedule-grid-lesson.is-trial { border-color: color-mix(in srgb, var(--amber) 70%, var(--room-border, var(--line))); border-style: dashed; }
.schedule-analysis-status { margin: 0 0 10px; padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--r-surface, 8px); color: var(--muted); background: var(--surface-soft); font-size: 13px; }
.schedule-grid-lesson.health-risk { border-color: color-mix(in srgb, var(--red) 60%, var(--room-border, var(--line))); }
.schedule-grid-lesson.health-shortage { border-color: color-mix(in srgb, var(--amber) 60%, var(--room-border, var(--line))); }
.schedule-grid-lesson.health-healthy { border-color: color-mix(in srgb, var(--green) 55%, var(--room-border, var(--line))); }
.schedule-grid-lesson.health-unknown, .schedule-grid-lesson.health-pair { border-color: var(--line-strong); }
.schedule-health { align-self: flex-start; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 5px; border-radius: 5px; font-size: 11px; font-weight: 600; background: var(--surface); color: var(--muted); }
.schedule-health-risk { background: var(--red-soft); color: var(--red); }
.schedule-health-shortage { background: var(--amber-soft); color: var(--amber); }
.schedule-health-healthy { background: var(--green-soft); color: var(--green); }
#scheduleAnalysisToggle.is-selected, #scheduleFreeToggle.is-selected { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.schedule-free-window { position: absolute; box-sizing: border-box; top: var(--lesson-top); left: 5px; right: 5px; height: var(--lesson-height); display: flex; align-items: flex-start; padding: 6px 8px; border: 1.5px dashed var(--green); border-radius: 9px; font-size: 12px; font-weight: 600; color: var(--green); background: repeating-linear-gradient(135deg, transparent 0 8px, var(--green-soft) 8px 16px); z-index: 0; }
.schedule-free-window { flex-direction: column; gap: 3px; overflow: hidden; }
.schedule-free-window small { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; font-weight: 500; color: var(--text); }
.schedule-free-window:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.schedule-room.room-tone-1 { --room-header:#dbeafe; --room-card:#f1f7ff; --room-border:#a9c8f4; --room-accent:#2864dc; --room-ink:#174889; }
.schedule-room.room-tone-2 { --room-header:#e5f4e8; --room-card:#f4fbf5; --room-border:#afd9b8; --room-accent:#268056; --room-ink:#1b6744; }
.schedule-room.room-tone-3 { --room-header:#f3e9fa; --room-card:#fbf6fd; --room-border:#d6b9eb; --room-accent:#8a4ab0; --room-ink:#713a94; }
.schedule-room.room-tone-4 { --room-header:#fff0d9; --room-card:#fffaf1; --room-border:#e9cc98; --room-accent:#a9680c; --room-ink:#885109; }
.schedule-room.room-tone-5 { --room-header:#dff3f4; --room-card:#f2fbfb; --room-border:#a8d6d9; --room-accent:#237d84; --room-ink:#1b656b; }
.schedule-room.room-tone-6 { --room-header:#fce9e7; --room-card:#fff7f6; --room-border:#eabbb6; --room-accent:#b25b55; --room-ink:#8d433e; }
.schedule-room.room-tone-7 { --room-header:#e9ecfb; --room-card:#f6f7fe; --room-border:#c0c7ec; --room-accent:#6064b1; --room-ink:#494d92; }
.schedule-room.room-tone-8 { --room-header:#eef1dc; --room-card:#fafbf2; --room-border:#cbd6a4; --room-accent:#71852c; --room-ink:#596c1d; }
html[data-theme="dark"] .schedule-room.room-tone-1 { --room-header:#253b5a; --room-card:#202f46; --room-border:#45658d; --room-accent:#86b5ff; --room-ink:#d5e5ff; }
html[data-theme="dark"] .schedule-room.room-tone-2 { --room-header:#214536; --room-card:#1e382e; --room-border:#42725b; --room-accent:#72d5a2; --room-ink:#d1f4df; }
html[data-theme="dark"] .schedule-room.room-tone-3 { --room-header:#423052; --room-card:#34283e; --room-border:#705283; --room-accent:#d09deb; --room-ink:#f0dafb; }
html[data-theme="dark"] .schedule-room.room-tone-4 { --room-header:#50402a; --room-card:#3d3327; --room-border:#846740; --room-accent:#f4c46d; --room-ink:#ffebc5; }
html[data-theme="dark"] .schedule-room.room-tone-5 { --room-header:#22464b; --room-card:#1e383c; --room-border:#47777c; --room-accent:#7bd3d9; --room-ink:#d2f4f4; }
html[data-theme="dark"] .schedule-room.room-tone-6 { --room-header:#4c3036; --room-card:#3b292f; --room-border:#81555e; --room-accent:#f1a4ac; --room-ink:#ffe1e4; }
html[data-theme="dark"] .schedule-room.room-tone-7 { --room-header:#313957; --room-card:#282e43; --room-border:#555e89; --room-accent:#aebdff; --room-ink:#e0e6ff; }
html[data-theme="dark"] .schedule-room.room-tone-8 { --room-header:#3c472c; --room-card:#303827; --room-border:#68764c; --room-accent:#c7dc86; --room-ink:#edf6d0; }
.lead-board { cursor: grab; user-select: none; }
.lead-board:active { cursor: grabbing; }
.schedule-lesson { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.schedule-lesson details { margin-top: 8px; font-size: 13px; }
.schedule-lesson details p { white-space: pre-wrap; }
.task-client-link { display: block; padding: 3px 0; border: 0; background: transparent; color: var(--accent); text-align: left; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.task-client-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.client-note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.event-responsibles { display: grid; gap: 5px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; }
.event-responsibles legend { padding: 0 4px; font-weight: 550; }
.event-responsibles label { display: flex; align-items: center; gap: 7px; min-height: 38px; }
.event-responsibles input { width: 18px; height: 18px; }
.feedback-admin-section { margin-top: 30px; }
.feedback-entries { max-width: 920px; margin-top: 14px; }
.feedback-entry { border-bottom: 1px solid var(--line); }
.feedback-entry summary { min-height: 48px; display: list-item; padding: 13px 8px; cursor: pointer; font-weight: 500; }
.feedback-entry summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.feedback-entry > div { padding: 0 8px 18px; }
.feedback-body { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 760px) { .schedule-lesson { grid-template-columns: 65px minmax(0,1fr); gap: 10px; } }

.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-note { cursor: grab; }

.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; }
}

.mobile-menu-toggle { display: none; min-height: 38px; min-width: 42px; padding: 4px 10px; }
.topbar { align-items: baseline; }
.topbar-meta { margin-left: 12px; color: var(--muted); font-size: 12px; }
@media (max-width:760px) { .topbar { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px; } .topbar-meta { margin-left:0; flex-basis:100%; } }

#leadQuery { flex: 1 1 420px; min-width: min(320px,100%); }
#scheduleDate { min-width: 170px; width: min(240px, 100%); }
@media (max-width:760px) { #leadQuery { min-width: 0; width: 100%; } #scheduleDate { min-width: 170px; } }

.inbox-attachment-list { display:grid; gap:7px; margin:2px 0 7px; }
.inbox-attachment { min-width:150px; display:grid; grid-template-columns:26px minmax(0,1fr); align-items:center; column-gap:8px; padding:9px 11px; border:1px solid rgba(100,116,139,.18); border-radius:10px; background:rgba(255,255,255,.68); }
.inbox-attachment > span { grid-row:span 2; display:grid; place-items:center; width:26px; height:26px; border-radius:8px; color:var(--accent); background:var(--accent-soft); font-size:17px; }
.inbox-attachment strong { font-size:13px; }
.inbox-attachment small { color:var(--muted); }

.inbox-dialog-menu { position:fixed; z-index:100; width:min(240px,calc(100vw - 20px)); display:grid; gap:3px; padding:6px; border:1px solid rgba(255,255,255,.9); border-radius:13px; background:rgba(250,251,253,.97); box-shadow:0 12px 32px rgba(23,34,49,.18); backdrop-filter:blur(18px); }
.inbox-dialog-menu button { min-height:42px; padding:8px 11px; border:0; background:transparent; text-align:left; }
.inbox-dialog-menu button:hover, .inbox-dialog-menu button:focus-visible { background:var(--accent-soft); }

.nav-unread-badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; margin-left: auto; padding: 0 5px; border-radius: 999px; background: #d92d35; color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.nav-unread-badge[hidden] { display: none; }
/* Annotation refinements */
@media (max-width:760px) { .mobile-menu-toggle { display:inline-flex !important; align-items:center; justify-content:center; min-width:44px; min-height:44px; } }
@media (min-width:761px) { .mobile-menu-toggle { display:none !important; } }
.topbar { display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.topbar-meta { margin:0; }
.lead-toolbar { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,340px) auto; gap:12px; align-items:end; margin-bottom:14px; }
.lead-toolbar label { min-width:0; }
.lead-pipelines button { display:flex; flex-direction:column; gap:3px; min-width:150px; }
.lead-pipelines button strong { order:2; }
.lead-pipelines button small { order:1; }
.schedule-toolbar { display:flex; align-items:end; gap:16px; margin-bottom:14px; flex-wrap:wrap; }
.schedule-date-picker { display:flex; align-items:center; gap:6px; }
.schedule-date-picker button { min-width:42px; min-height:42px; font-size:22px; }
#scheduleDate { min-width:155px; width:180px; padding:10px 14px; }
.schedule-day { cursor:default; }
.schedule-grid-lesson { left:var(--lane-left, 0%); width:calc(var(--lane-width, 100%) - 6px); right:auto; cursor:pointer; }
.schedule-grid-lesson.is-selected { outline:3px solid var(--accent); outline-offset:1px; z-index:3; }
.schedule-lesson-details { position:fixed; z-index:30; right:20px; bottom:20px; width:min(380px,calc(100vw - 32px)); max-height:70vh; overflow:auto; padding:22px; border:1px solid var(--line); border-radius:20px; background:var(--surface); box-shadow:0 16px 44px rgba(23,34,49,.22); }
.task-actions-row { justify-content:flex-end; width:100%; }
.appearance-settings,.assistant-admin-settings { margin:22px 0; padding-top:16px; border-top:1px solid var(--line); }
.theme-picker { display:grid; gap:7px; width:min(270px,100%); margin-top:12px; font-weight:500; }
.theme-picker select { min-height:44px; padding:8px 12px; }
.assistant-admin-settings textarea { width:100%; }
#userNotifications { display:grid; gap:10px; }
.nav-task-badge { margin-left:auto; min-width:20px; height:20px; display:inline-grid; place-items:center; padding:0 5px; border-radius:999px; color:#684a00; background:#f4cf66; font-size:11px; font-weight:700; }
#taskOverdueBadge { color:#fff; background:#c93e45; }
.inbox-dialog.has-unanswered { animation: inbox-unanswered-pulse 3.8s ease-in-out infinite; box-shadow:inset 0 0 0 1px rgba(44,115,226,.5); }
@keyframes inbox-unanswered-pulse { 0%,100% { box-shadow:inset 0 0 0 1px rgba(44,115,226,.3); } 50% { box-shadow:inset 0 0 0 2px rgba(44,115,226,.78); } }
/* Dark surfaces must change with the text tokens. Keep the room palette on lesson cards. */
html[data-theme="dark"] { color-scheme:dark; --bg:#171a20; --surface:#222730; --surface-soft:#292f39; --surface-hover:#343c48; --line:#414a58; --line-strong:#566273; --text:#edf1f6; --muted:#b4bfce; --glass:rgba(34,39,48,.88); --glass-strong:rgba(34,39,48,.96); --accent:#86b5ff; --accent-hover:#a3c6ff; --accent-soft:#253e68; --green:#70d8aa; --green-soft:#173d32; --amber:#f4c46d; --amber-soft:#493719; --red:#ff9aa2; --red-soft:#4a262f; --shadow-float:0 24px 70px rgba(0,0,0,.35); }
html[data-theme="dark"] body, html[data-theme="dark"] .app-shell { background:var(--bg); color:var(--text); }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea, html[data-theme="dark"] dialog, html[data-theme="dark"] .lead-card, html[data-theme="dark"] .inbox-attachment { background:var(--surface); color:var(--text); border-color:var(--line); }
html[data-theme="dark"] .primary-button, html[data-theme="dark"] .inbox-send-form button { background:#2864dc; border-color:#2864dc; color:#fff; }
html[data-theme="dark"] .primary-button:hover, html[data-theme="dark"] .inbox-send-form button:hover { background:#3974e6; border-color:#3974e6; }
html[data-theme="dark"] .sidebar { background:rgba(32,38,48,.94); border-right-color:var(--line); box-shadow:8px 0 32px rgba(0,0,0,.14); }
html[data-theme="dark"] .sidebar::before { background:linear-gradient(180deg,rgba(255,255,255,.035),transparent); }
html[data-theme="dark"] .nav-item:hover, html[data-theme="dark"] .sidebar-search-button:hover { background:var(--surface-hover); border-color:var(--line); }
html[data-theme="dark"] .nav-item.is-active { background:#334356; border-color:#52657e; box-shadow:inset 0 1px 0 rgba(255,255,255,.09); }
html[data-theme="dark"] .nav-item.is-active .nav-icon { color:var(--accent); }
html[data-theme="dark"] .account-block, html[data-theme="dark"] .sidebar-search-button { background:var(--surface-soft); border-color:var(--line); }
html[data-theme="dark"] .account-block button { color:var(--muted); }
html[data-theme="dark"] .metric-card, html[data-theme="dark"] .details-pane, html[data-theme="dark"] .event-details, html[data-theme="dark"] .assistant-chat, html[data-theme="dark"] .price-table { background:var(--surface); }
html[data-theme="dark"] .task-column, html[data-theme="dark"] .task-card, html[data-theme="dark"] .knowledge-card { background:var(--surface-soft); border-color:var(--line); }
html[data-theme="dark"] .task-card { background:var(--surface); }
html[data-theme="dark"] .pill { background:var(--surface-hover); color:var(--muted); }
html[data-theme="dark"] .pill.red { background:var(--red-soft); color:var(--red); }
html[data-theme="dark"] .pill.green { background:var(--green-soft); color:var(--green); }
html[data-theme="dark"] .pill.amber { background:var(--amber-soft); color:var(--amber); }
html[data-theme="dark"] .event-list-item:hover, html[data-theme="dark"] .event-participant:hover, html[data-theme="dark"] .event-participant:focus-within, html[data-theme="dark"] .client-card:hover, html[data-theme="dark"] .knowledge-card:hover, html[data-theme="dark"] .result-item:hover { background:var(--surface-hover); }
html[data-theme="dark"] .attendance-control select { background:var(--green-soft); color:var(--green); }
html[data-theme="dark"] .status-maybe .attendance-control select { background:var(--amber-soft); color:var(--amber); }
html[data-theme="dark"] .assistant-composer, html[data-theme="dark"] .assistant-sources-pane, html[data-theme="dark"] .search-shell, html[data-theme="dark"] dialog, html[data-theme="dark"] .context-menu { border-color:var(--line-strong); box-shadow:var(--shadow-soft); }
html[data-theme="dark"] .assistant-header-actions button, html[data-theme="dark"] .assistant-suggestions button, html[data-theme="dark"] .assistant-library-links button, html[data-theme="dark"] .assistant-source { background:var(--surface-soft); color:var(--text); }
html[data-theme="dark"] .assistant-source.contextual:hover, html[data-theme="dark"] .assistant-suggestions button:hover { background:var(--surface-hover); }
html[data-theme="dark"] .assistant-sources-panel { background:var(--surface-soft); }
html[data-theme="dark"] .inbox-layout, html[data-theme="dark"] .inbox-conversation { background:var(--surface); }
html[data-theme="dark"] button.inbox-dialog { color:var(--text); }
html[data-theme="dark"] button.inbox-dialog:hover { background:var(--surface-hover); }
html[data-theme="dark"] button.inbox-dialog.is-selected { background:var(--accent-soft); }
html[data-theme="dark"] .inbox-avatar, html[data-theme="dark"] .inbox-source-icon { background:var(--surface-hover); color:var(--text); }
html[data-theme="dark"] .inbox-avatar .inbox-source-icon { border-color:var(--surface); }
html[data-theme="dark"] .inbox-preview, html[data-theme="dark"] .inbox-meta, html[data-theme="dark"] .inbox-mail-subject, html[data-theme="dark"] .inbox-composer p, html[data-theme="dark"] .inbox-empty, html[data-theme="dark"] .inbox-history-note, html[data-theme="dark"] .inbox-send-form [role=status] { color:var(--muted); }
html[data-theme="dark"] .inbox-message { background:var(--surface-hover); }
html[data-theme="dark"] .inbox-message.outgoing { background:var(--accent-soft); }
html[data-theme="dark"] .inbox-dialog-menu, html[data-theme="dark"] .global-search-panel, html[data-theme="dark"] .global-search-results { background:var(--surface); border-color:var(--line); }
html[data-theme="dark"] .global-search-panel .global-search-results, html[data-theme="dark"] .search-section-filters label { background:var(--surface-soft); }
html[data-theme="dark"] .price-row.header { background:var(--surface-soft); }
html[data-theme="dark"] .price-row:not(.header):hover { background:var(--surface-hover); }
html[data-theme="dark"] .rack-brush-controls { background:var(--surface-soft); }
html[data-theme="dark"] .rack-note, html[data-theme="dark"] .rack-color-swatch, html[data-theme="dark"] .rack-drawing-surface { color:#29271f; }
html[data-theme="dark"] .rack-drawing-surface textarea { background:transparent; color:#29271f; }

/* Picnic uses the reference palette as a quiet, warm light theme. */
html[data-theme="picnic"] { color-scheme:light; --bg:#f5f0e5; --surface:#fffaf1; --surface-soft:#eee7d8; --surface-hover:#e6ddcb; --glass:rgba(249,243,230,.84); --glass-strong:rgba(255,250,241,.94); --line:rgba(51,67,43,.16); --line-strong:rgba(51,67,43,.27); --text:#20280b; --muted:#4d5941; --accent:#33432b; --accent-hover:#20280b; --accent-soft:#dfe8d2; --primary:#33432b; --green:#286246; --green-soft:#e0eee0; --amber:#865615; --amber-soft:#f8e8c7; --red:#a1463e; --red-soft:#f9e5df; --shadow-soft:0 18px 55px rgba(51,67,43,.09); --shadow-float:0 24px 70px rgba(32,40,11,.15); }
html[data-theme="picnic"] body, html[data-theme="picnic"] .app-shell, html[data-theme="picnic"] .auth-screen { background:var(--bg); color:var(--text); }
html[data-theme="picnic"] .sidebar { background:rgba(51,67,43,.96); border-right-color:#20280b; box-shadow:8px 0 32px rgba(32,40,11,.12); color:#f8f1e4; }
html[data-theme="picnic"] .sidebar::before { background:linear-gradient(180deg,rgba(222,197,158,.09),transparent); }
html[data-theme="picnic"] .brand-title, html[data-theme="picnic"] .nav-item, html[data-theme="picnic"] .nav-icon, html[data-theme="picnic"] .sidebar-note, html[data-theme="picnic"] .account-copy span, html[data-theme="picnic"] .account-block button { color:#e8e8d6; }
html[data-theme="picnic"] .brand-beta { color:rgba(248,241,228,.72); }
html[data-theme="picnic"] .nav-item:hover { color:#fffaf1; background:rgba(222,197,158,.17); border-color:rgba(222,197,158,.23); }
html[data-theme="picnic"] .nav-item.is-active { color:#20280b; background:#dec59e; border-color:#f1dfbf; box-shadow:0 8px 20px rgba(32,40,11,.18),inset 0 1px 0 rgba(255,255,255,.55); }
html[data-theme="picnic"] .nav-item.is-active .nav-icon { color:#33432b; }
html[data-theme="picnic"] .sidebar-search-button, html[data-theme="picnic"] .account-block { background:rgba(255,250,241,.13); border-color:rgba(222,197,158,.3); color:#fffaf1; }
html[data-theme="picnic"] .sidebar-search-button:hover { background:rgba(255,250,241,.22); color:#fffaf1; }
html[data-theme="picnic"] .account-copy strong { color:#fffaf1; }
html[data-theme="picnic"] .status-dot { box-shadow:0 0 0 3px rgba(224,238,224,.4); }
html[data-theme="picnic"] .status-dot.is-offline { box-shadow:0 0 0 3px rgba(249,229,223,.4); }
html[data-theme="picnic"] .primary-button, html[data-theme="picnic"] .inbox-send-form button { background:#33432b; border-color:#33432b; color:#fffaf1; box-shadow:0 5px 14px rgba(32,40,11,.15); }
html[data-theme="picnic"] .primary-button:hover, html[data-theme="picnic"] .inbox-send-form button:hover { background:#20280b; border-color:#20280b; color:#fffaf1; }
html[data-theme="picnic"] .metric-card, html[data-theme="picnic"] .details-pane, html[data-theme="picnic"] .event-details, html[data-theme="picnic"] .assistant-chat, html[data-theme="picnic"] .price-table, html[data-theme="picnic"] .lead-card, html[data-theme="picnic"] .knowledge-card { background:var(--surface); }
html[data-theme="picnic"] .task-column, html[data-theme="picnic"] .lead-column { background:var(--surface-soft); }
html[data-theme="picnic"] .task-card { background:var(--surface); border-color:var(--line); }
html[data-theme="picnic"] .pill { background:#e9e4d8; color:#4d5941; }
html[data-theme="picnic"] .search-shell, html[data-theme="picnic"] .assistant-composer, html[data-theme="picnic"] .assistant-sources-pane, html[data-theme="picnic"] dialog, html[data-theme="picnic"] .context-menu { border-color:var(--line-strong); box-shadow:var(--shadow-soft); }
html[data-theme="picnic"] .assistant-header-actions button, html[data-theme="picnic"] .assistant-suggestions button, html[data-theme="picnic"] .assistant-library-links button, html[data-theme="picnic"] .assistant-source { background:var(--surface-soft); }
html[data-theme="picnic"] .assistant-sources-panel { background:var(--surface-soft); }
html[data-theme="picnic"] .assistant-source.contextual:hover { background:var(--surface); }
html[data-theme="picnic"] .event-list-item:hover, html[data-theme="picnic"] .event-participant:hover, html[data-theme="picnic"] .event-participant:focus-within, html[data-theme="picnic"] .client-card:hover, html[data-theme="picnic"] .knowledge-card:hover, html[data-theme="picnic"] .result-item:hover { background:var(--surface-hover); }
html[data-theme="picnic"] .inbox-layout, html[data-theme="picnic"] .inbox-conversation, html[data-theme="picnic"] .global-search-panel, html[data-theme="picnic"] .global-search-results, html[data-theme="picnic"] .inbox-dialog-menu { background:var(--surface); }
html[data-theme="picnic"] button.inbox-dialog:hover { background:var(--surface-hover); }
html[data-theme="picnic"] button.inbox-dialog.is-selected { background:var(--accent-soft); }
html[data-theme="picnic"] .inbox-avatar, html[data-theme="picnic"] .inbox-source-icon { background:var(--surface-soft); color:var(--accent); }
html[data-theme="picnic"] .inbox-message { background:var(--surface-soft); }
html[data-theme="picnic"] .inbox-message.outgoing { background:var(--accent-soft); }
html[data-theme="picnic"] .inbox-preview, html[data-theme="picnic"] .inbox-meta, html[data-theme="picnic"] .inbox-mail-subject, html[data-theme="picnic"] .inbox-empty, html[data-theme="picnic"] .inbox-history-note { color:var(--muted); }
html[data-theme="picnic"] .price-row.header, html[data-theme="picnic"] .global-search-panel .global-search-results, html[data-theme="picnic"] .search-section-filters label { background:var(--surface-soft); }
html[data-theme="picnic"] .price-row:not(.header):hover { background:var(--surface-hover); }
html[data-theme="picnic"] .rack-brush-controls { background:var(--surface-soft); }
html[data-theme="picnic"] .schedule-room.room-tone-1 { --room-header:#d9e4cd; --room-card:#f0f6e9; --room-border:#a7bc92; --room-accent:#49623a; --room-ink:#273c1a; }
html[data-theme="picnic"] .schedule-room.room-tone-2 { --room-header:#efd8cb; --room-card:#fff1e9; --room-border:#d3a994; --room-accent:#9f614b; --room-ink:#633c2c; }
html[data-theme="picnic"] .schedule-room.room-tone-3 { --room-header:#ead9bc; --room-card:#fff5e5; --room-border:#c9ac7e; --room-accent:#82643c; --room-ink:#523a1c; }
html[data-theme="picnic"] .schedule-room.room-tone-4 { --room-header:#d6ddc7; --room-card:#f0f3e8; --room-border:#a7b58b; --room-accent:#5c7242; --room-ink:#304721; }
html[data-theme="picnic"] .schedule-room.room-tone-5 { --room-header:#e8d2c2; --room-card:#fbefe5; --room-border:#c9a48d; --room-accent:#91654c; --room-ink:#593b29; }
html[data-theme="picnic"] .schedule-room.room-tone-6 { --room-header:#d5dfce; --room-card:#eff5eb; --room-border:#a4b99a; --room-accent:#4d7655; --room-ink:#2a4a32; }
html[data-theme="picnic"] .schedule-room.room-tone-7 { --room-header:#e2d9c3; --room-card:#f8f4e9; --room-border:#bdb092; --room-accent:#776840; --room-ink:#483d22; }
html[data-theme="picnic"] .schedule-room.room-tone-8 { --room-header:#dce3c6; --room-card:#f2f6e6; --room-border:#afbd85; --room-accent:#637a39; --room-ink:#37491f; }
@media (prefers-reduced-motion:reduce) { .inbox-dialog.has-unanswered { animation:none; outline:2px solid rgba(44,115,226,.65); } }
@media (max-width:760px) { .lead-toolbar { grid-template-columns:1fr auto; } .lead-toolbar .lead-pipelines { grid-column:1/-1; } .lead-toolbar label { grid-column:1; } .schedule-toolbar { align-items:stretch; } .schedule-toolbar .branch-checkboxes { flex-basis:100%; } }

.inbox-attachment-preview { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; margin:6px 0; padding:8px; }
.inbox-attachment-preview img { display:block; max-width:min(360px,100%); max-height:320px; object-fit:contain; border-radius:8px; }
.inbox-attachment-preview figcaption { color:var(--muted); font-size:12px; }
.inbox-attachment a { grid-column:2; color:var(--accent); overflow-wrap:anywhere; }
.inbox-attachment { min-width:0; }
.inbox-attachment strong { overflow-wrap:anywhere; }
.inbox-audio, .inbox-video { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
.inbox-audio audio, .inbox-video video { width:min(100%,420px); }
.inbox-audio a, .inbox-video a { grid-column:1; }
.inbox-attachment-preview figcaption a { margin-left:8px; }
.inbox-reactions { display:flex; flex-wrap:wrap; align-items:center; gap:5px; margin-top:8px; }
.inbox-reactions:empty { display:none; }
.inbox-reaction { display:inline-flex; align-items:center; gap:5px; min-height:28px; padding:3px 8px; border:1px solid var(--line); border-radius:10px; background:var(--surface,#fff); font-size:13px; }
.inbox-reaction.is-mine { border-color:var(--accent,#2563eb); }
.inbox-reaction img, .inbox-reaction-picker img { width:20px; height:20px; object-fit:contain; }
.inbox-reaction-picker { position:relative; }
.inbox-reaction-picker summary { list-style:none; cursor:pointer; border:1px solid var(--line); border-radius:10px; padding:5px 8px; font-size:12px; min-height:28px; }
.inbox-reaction-picker summary::-webkit-details-marker { display:none; }
.inbox-reaction-picker > div { position:absolute; z-index:10; bottom:calc(100% + 4px); left:0; display:flex; gap:4px; padding:6px; border:1px solid var(--line); border-radius:12px; background:var(--surface,#fff); box-shadow:var(--shadow-float); }
.inbox-reaction-picker button { display:grid; place-items:center; min-width:36px; min-height:36px; border:0; border-radius:8px; background:transparent; cursor:pointer; }
.inbox-reaction-picker button:hover { background:var(--surface-hover,#f2f4f6); }
.inbox-reaction-picker button:focus-visible, #inboxReadAll:focus-visible, #inboxMarkRead:focus-visible { outline:3px solid var(--accent,#2563eb); outline-offset:2px; }
#inboxReadAll { min-height:44px; }
#inboxReadAll:disabled { opacity:.5; }
@media (max-width:760px) { .inbox-thread-header { flex-wrap:wrap; } .inbox-thread-header #inboxMarkRead { margin-left:auto; } }

.nav-task-badge[hidden] { display:none; }

/* Sidebar navigation order and compact counters. */
.nav-item[hidden], .nav-more[hidden], .nav-more-items[hidden] { display: none !important; }
.nav-badges { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; margin-left: auto; flex: 0 0 auto; }
.nav-badges [hidden] { display: none !important; }
.nav-badges .nav-task-badge, .nav-badges .nav-unread-badge { margin-left: 0; }
.nav-more { min-width: 0; }
.nav-more-toggle { width: 100%; }
.nav-more-chevron { width: 16px; height: 16px; margin-left: auto; transition: transform 160ms ease; }
.nav-more.is-open .nav-more-chevron { transform: rotate(180deg); }
.nav-more-toggle.has-active { color: var(--text); background: var(--accent-soft); }
.nav-more-items { display: grid; gap: 3px; margin: 2px 0 5px 8px; padding: 4px; border-radius: 14px; background: color-mix(in srgb, currentColor 4%, transparent); }
.nav-more-items .nav-item { min-height: 42px; }
.analytics-nav-item { min-height:55px; }
.analytics-nav-copy { display:grid; gap:1px; line-height:1.15; }
.analytics-nav-copy > span { font-weight:550; }
.analytics-nav-copy small { color:var(--muted); font-size:11px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.analytics-nav-item.is-active .analytics-nav-copy small { color:var(--text); opacity:.72; }
.nav-list .nav-item[draggable="true"] { cursor: grab; }
.nav-list .is-nav-dragging { opacity: .5; cursor: grabbing; }
.nav-list .nav-drop-before { box-shadow: inset 0 3px var(--accent); }
.nav-list .nav-drop-after { box-shadow: inset 0 -3px var(--accent); }
.nav-list .nav-drop-target { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-more.is-drop-placeholder .nav-more-toggle { border: 1px dashed var(--muted); color: var(--muted); }
.sidebar-search-button { display: grid; place-items: center; padding: 0; }
.sidebar-search-button .ui-icon { margin: 0; }
.sidebar-collapsed .nav-badges, .sidebar-collapsed .nav-more-chevron { display: none; }
html[data-theme="picnic"] .nav-more-toggle.has-active { color: #fffaf1; background: rgba(222,197,158,.16); }
html[data-theme="picnic"] .nav-more.is-drop-placeholder .nav-more-toggle { color: #e8e8d6; border-color: rgba(222,197,158,.68); }
html[data-theme="dark"] .nav-more-toggle.has-active { color: var(--text); background: var(--accent-soft); }

@media (max-width: 760px) {
  .brand { gap: 7px; }
  #openGlobalSearch, #mobileMenuToggle { width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; display: grid !important; place-items: center; border-radius: 13px; }
  #openGlobalSearch { margin-left: auto; }
  #mobileMenuToggle { margin-left: 0; background: rgba(255,255,255,.44); color: var(--muted); }
  html[data-theme="dark"] #mobileMenuToggle { background: var(--surface-soft); color: var(--text); }
  html[data-theme="picnic"] #mobileMenuToggle { background: rgba(255,250,241,.13); color: #fffaf1; border-color: rgba(222,197,158,.3); }
  .nav-list.is-mobile-open { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; max-height: calc(100dvh - 80px); overflow-y: auto; padding-top: 4px; }
  .nav-list .nav-item { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; column-gap: 6px; min-height: 48px; padding: 0 9px; text-align: left; }
  .nav-list .nav-item > span:not(.nav-badges) { min-width: 0; }
  .nav-list .nav-badges { gap: 4px; }
  .sidebar-collapsed .nav-item .nav-badges { display: inline-flex; }
  .nav-list .nav-task-badge, .nav-list .nav-unread-badge { min-width: 19px; height: 19px; padding-inline: 4px; }
  .nav-more { grid-column: 1 / -1; }
  .nav-more-items { grid-template-columns: repeat(2,minmax(0,1fr)); margin: 2px 0 0; padding: 0; border: 0; background: none; }
  .nav-more-items .nav-item { min-height: 48px; }
  .nav-list.is-mobile-open + #settingsNav:not([hidden]) { display: flex; align-items: center; justify-content: flex-start; min-height: 48px; margin-top: 5px; }
  .nav-list.is-mobile-open + #settingsNav .nav-icon { width: 22px; height: 22px; flex-basis: 22px; }
}

/* Management analytics preview: warm content with glass reserved for controls. */
#view-analytics { max-width:none; }
.analytics-page { --analytics-ink:#202936; --analytics-muted:#667081; --analytics-line:#e8e4dc; --analytics-accent:#7166ca; min-width:0; padding:30px clamp(20px,3vw,42px) 36px; border:1px solid #ece7de; border-radius:28px; background:#f9f7f1; color:var(--analytics-ink); box-shadow:0 20px 48px rgba(35,39,52,.045); }
.analytics-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:22px; }
.analytics-eyebrow,.analytics-section-kicker { margin:0 0 7px; color:var(--analytics-muted); font-size:11px; font-weight:680; letter-spacing:.14em; }
.analytics-intro h2 { margin:0; font-size:clamp(28px,3vw,39px); letter-spacing:-.045em; line-height:1.05; }
.analytics-intro p:last-child { margin:9px 0 0; color:var(--analytics-muted); font-size:14px; }
.analytics-source-note { flex:0 0 auto; padding:9px 13px; border:1px solid #cfbddb; border-radius:999px; background:#f3eaf6; color:#674b73; font-size:12px; font-weight:630; white-space:nowrap; }
.analytics-toolbar { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-bottom:18px; padding:9px 12px; border:1px solid rgba(255,255,255,.9); border-radius:18px; background:rgba(255,255,255,.61); box-shadow:0 8px 30px rgba(49,56,76,.045),inset 0 1px rgba(255,255,255,.9); backdrop-filter:blur(20px) saturate(1.08); -webkit-backdrop-filter:blur(20px) saturate(1.08); }
.analytics-toolbar p { margin:0; color:var(--analytics-muted); font-size:12px; }
.analytics-period { display:flex; gap:3px; padding:3px; border-radius:13px; background:rgba(238,236,233,.76); }
.analytics-period button { min-height:36px; padding:6px 14px; border:0; border-radius:10px; background:transparent; color:var(--analytics-muted); font-size:13px; font-weight:550; cursor:pointer; transition:background 150ms ease,box-shadow 150ms ease,color 150ms ease; }
.analytics-period button:hover { color:var(--analytics-ink); }
.analytics-period button.is-active { background:#fff; color:var(--analytics-ink); box-shadow:0 2px 8px rgba(39,43,59,.1); }
.analytics-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:14px; }
.analytics-metric { position:relative; min-width:0; min-height:170px; display:flex; flex-direction:column; overflow:hidden; padding:19px 19px 14px; border-radius:22px; }
.analytics-metric > span { position:relative; z-index:1; font-size:13px; font-weight:580; }
.analytics-metric > strong { position:relative; z-index:1; margin-top:22px; font-size:clamp(27px,2.5vw,37px); letter-spacing:-.045em; line-height:1; white-space:nowrap; }
.analytics-metric > small { position:relative; z-index:1; margin-top:8px; color:#4d5662; font-size:12px; }
.analytics-metric > small b { color:#235c42; }
.analytics-metric.is-revenue { background:#f6df83; }
.analytics-metric.is-plan { background:#efd1e0; }
.analytics-metric.is-clients { background:#dce6bb; }
.analytics-metric.is-renewals { background:#cfdff0; }
.analytics-metric.is-revenue > small { margin-bottom:24px; }
.analytics-mini-progress { height:7px; margin-top:auto; border-radius:999px; background:rgba(107,58,89,.16); }
.analytics-mini-progress span { display:block; height:100%; border-radius:inherit; background:#aa6092; }
.analytics-feature-grid,.analytics-detail-grid,.analytics-bottom-grid { display:grid; gap:14px; margin-bottom:14px; }
.analytics-feature-grid { grid-template-columns:minmax(0,1.75fr) minmax(265px,.85fr); }
.analytics-detail-grid { grid-template-columns:minmax(0,1.25fr) minmax(300px,1fr); }
.analytics-bottom-grid { grid-template-columns:1fr 1fr; }
.analytics-feature-grid > section,.analytics-detail-grid > section,.analytics-bottom-grid > section { min-width:0; border-radius:23px; padding:22px 24px; }
.analytics-chart-section { background:#fff; }
.analytics-plan-section { background:#eee0ef; }
.analytics-calendar-section { background:#fff; }
.analytics-trends-section { background:#e5eaf4; }
.analytics-section-heading { display:flex; justify-content:space-between; align-items:start; gap:12px; margin-bottom:14px; }
.analytics-section-heading h3 { margin:0; font-size:22px; letter-spacing:-.025em; line-height:1.1; }
.analytics-section-note,.analytics-chart-unit { color:var(--analytics-muted); font-size:12px; white-space:nowrap; }
.analytics-section-description { margin:-3px 0 18px; color:var(--analytics-muted); font-size:13px; line-height:1.5; }
.analytics-chart-wrap svg { display:block; width:100%; height:auto; overflow:visible; }
.analytics-chart-grid { stroke:#e8e5ec; stroke-width:1; stroke-dasharray:4 5; }
.analytics-chart-axis { fill:#9298a4; font-size:10px; }
.analytics-chart-dot { fill:#fff; stroke:#7166ca; stroke-width:3; }
.analytics-chart-labels { display:flex; justify-content:space-between; margin:2px 2.1% 0 5.7%; color:var(--analytics-muted); font-size:11px; }
.analytics-chart-legend { display:flex; justify-content:center; gap:20px; margin-top:19px; color:var(--analytics-muted); font-size:12px; }
.analytics-chart-legend span { display:flex; align-items:center; gap:6px; }
.analytics-chart-legend i { width:18px; height:3px; border-radius:3px; }
.analytics-chart-legend .is-actual { background:#7166ca; }.analytics-chart-legend .is-plan { background:#d1b4c6; }
.analytics-ring { width:156px; height:156px; display:grid; place-items:center; margin:20px auto 15px; border-radius:50%; background:conic-gradient(#9b77bd var(--analytics-ring),rgba(255,255,255,.65) var(--analytics-ring)); }
.analytics-ring > span { width:122px; height:122px; display:flex; align-items:center; justify-content:center; flex-direction:column; border-radius:50%; background:#eee0ef; }
.analytics-ring strong { font-size:38px; letter-spacing:-.05em; }.analytics-ring small { color:#6d6175; font-size:12px; }
.analytics-plan-section > p { max-width:290px; margin:0 auto; color:#655b6d; font-size:13px; line-height:1.45; text-align:center; }
.analytics-calendar-controls { display:flex; align-items:center; gap:4px; }
.analytics-calendar-controls strong { min-width:116px; text-align:center; text-transform:capitalize; font-size:12px; }
.analytics-calendar-controls button { width:32px; height:32px; display:grid; place-items:center; border:1px solid var(--analytics-line); border-radius:10px; background:rgba(255,255,255,.75); color:var(--analytics-ink); font-size:21px; cursor:pointer; }
.analytics-calendar-weekdays,.analytics-calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.analytics-calendar-weekdays { margin-bottom:4px; color:var(--analytics-muted); font-size:11px; font-weight:600; text-align:center; }
.analytics-calendar-weekdays span { padding:4px 0; }
.analytics-calendar-grid { border-top:1px solid var(--analytics-line); border-left:1px solid var(--analytics-line); }
.analytics-calendar-grid > * { aspect-ratio:1.18; border:0; border-right:1px solid var(--analytics-line); border-bottom:1px solid var(--analytics-line); }
.analytics-calendar-day { position:relative; display:grid; place-items:center; background:transparent; color:var(--analytics-ink); font-size:13px; cursor:pointer; }
.analytics-calendar-day:hover { background:#f4f0f7; }.analytics-calendar-day.is-today:not(.is-selected) { background:#f2f0f9; }
.analytics-calendar-day.is-selected { background:#eed7ea; font-weight:680; }
.analytics-calendar-day > i { position:absolute; bottom:3px; width:4px; height:4px; border-radius:50%; background:#aa6b9c; }
.analytics-calendar-outside { background:#f7f7f4; }
.analytics-calendar-detail { display:grid; gap:8px; margin-top:12px; color:var(--analytics-muted); font-size:12px; }
.analytics-calendar-detail > strong { color:var(--analytics-ink); font-size:13px; }
.analytics-calendar-detail > p { margin:0; }
.analytics-trends-list { display:grid; }
.analytics-trend-row { display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:10px; padding:12px 0; border-top:1px solid rgba(83,103,138,.15); }
.analytics-trend-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:10px; background:#d2dcf0; color:#44688d; font-size:21px; }
.analytics-trend-row > span:nth-child(2) { display:grid; gap:2px; }.analytics-trend-row strong { font-size:13px; }.analytics-trend-row small { color:var(--analytics-muted); font-size:11px; }
.analytics-trend-row b { color:#28654b; font-size:15px; }.analytics-trend-row b.is-down { color:#a34e5e; }
.analytics-disclaimer { margin:20px 0 0; color:var(--analytics-muted); font-size:12px; text-align:center; }
.analytics-page button:focus-visible { outline:3px solid #7166ca; outline-offset:2px; }
html[data-theme="dark"] .analytics-page { --analytics-ink:#f0f1f5; --analytics-muted:#b4bac8; --analytics-line:#454a56; background:#262b34; border-color:#3b424e; }
html[data-theme="dark"] .analytics-toolbar, html[data-theme="dark"] .analytics-chart-section, html[data-theme="dark"] .analytics-calendar-section { background:#313844; border-color:#424b59; }
html[data-theme="dark"] .analytics-period { background:#252c36; }html[data-theme="dark"] .analytics-period button.is-active { background:#495366; color:#fff; }
html[data-theme="dark"] .analytics-metric.is-revenue { background:#675726; }html[data-theme="dark"] .analytics-metric.is-plan { background:#65485d; }html[data-theme="dark"] .analytics-metric.is-clients { background:#45563d; }html[data-theme="dark"] .analytics-metric.is-renewals { background:#3e5268; }
html[data-theme="dark"] .analytics-metric > small,html[data-theme="dark"] .analytics-metric > small b { color:#eff0e9; }
html[data-theme="dark"] .analytics-plan-section { background:#4b3d54; }html[data-theme="dark"] .analytics-trends-section { background:#37465a; }
html[data-theme="dark"] .analytics-ring > span { background:#4b3d54; }html[data-theme="dark"] .analytics-plan-section > p, html[data-theme="dark"] .analytics-ring small { color:#d1c9d4; }
html[data-theme="dark"] .analytics-calendar-day { color:var(--analytics-ink); }html[data-theme="dark"] .analytics-calendar-day:hover,html[data-theme="dark"] .analytics-calendar-day.is-today:not(.is-selected) { background:#46465e; }html[data-theme="dark"] .analytics-calendar-day.is-selected { background:#68516b; }html[data-theme="dark"] .analytics-calendar-outside { background:#2b323e; }
html[data-theme="dark"] .analytics-calendar-controls button { background:#3d4654; color:var(--analytics-ink); }
@media (max-width:1250px) { .analytics-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }.analytics-feature-grid { grid-template-columns:minmax(0,1.4fr) minmax(240px,1fr); } }
@media (max-width:1060px) { .analytics-feature-grid,.analytics-detail-grid,.analytics-bottom-grid { grid-template-columns:1fr; } }
@media (max-width:760px) { .analytics-page { padding:20px 14px 26px; border-radius:20px; }.analytics-intro { align-items:start; flex-direction:column; gap:12px; }.analytics-toolbar { align-items:start; flex-direction:column; }.analytics-feature-grid > section,.analytics-detail-grid > section,.analytics-bottom-grid > section { padding:19px; }.analytics-metric { min-height:155px; }.analytics-nav-copy small { display:none; } }
@media (max-width:530px) { .analytics-metrics { grid-template-columns:1fr 1fr; gap:8px; }.analytics-metric { min-height:145px; padding:14px; }.analytics-metric > strong { font-size:25px; white-space:normal; }.analytics-metric > small { font-size:11px; }.analytics-calendar-controls strong { min-width:95px; }.analytics-section-heading h3 { font-size:19px; } }
@media (prefers-reduced-motion:reduce) { .analytics-page * { transition:none !important; animation:none !important; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-toolbar { background:#fff; } }

/* Live management view: the glass layer stays on controls, the numbers stay on calm surfaces. */
.analytics-source-note { border-color:#bfd5c6; background:#e7f2e9; color:#285946; }
.analytics-toolbar > span { color:var(--analytics-muted); font-size:12px; white-space:nowrap; }
.analytics-branch-switch { display:flex; flex-wrap:wrap; gap:3px; padding:3px; border-radius:14px; background:rgba(234,232,228,.72); }
.analytics-branch-switch button { min-height:38px; padding:8px 13px; border:0; border-radius:11px; background:transparent; color:#515b69; font:inherit; font-size:13px; font-weight:570; cursor:pointer; transition:background 150ms ease,color 150ms ease,box-shadow 150ms ease; }
.analytics-branch-switch button:hover { color:var(--analytics-ink); background:rgba(255,255,255,.53); }
.analytics-branch-switch button.is-active { background:#fff; color:var(--analytics-ink); box-shadow:0 2px 8px rgba(39,43,59,.1); }
.analytics-context { display:flex; justify-content:space-between; align-items:end; gap:16px; margin:0 0 15px; }
.analytics-context h2 { margin:0; font-size:24px; letter-spacing:-.035em; text-transform:capitalize; }
.analytics-context > p { margin:0; color:var(--analytics-muted); font-size:12px; }
.analytics-feature-grid { grid-template-columns:minmax(0,1.7fr) minmax(265px,.8fr); }
.analytics-detail-grid { grid-template-columns:minmax(0,1.6fr) minmax(300px,.75fr); }
.analytics-plan-facts { display:grid; gap:9px; margin-top:16px; border-top:1px solid rgba(122,97,133,.18); padding-top:14px; }
.analytics-plan-facts > div { display:flex; justify-content:space-between; gap:10px; font-size:13px; }
.analytics-plan-facts span { color:#655b6d; }.analytics-plan-facts strong { font-weight:650; }
.analytics-caution { margin:12px 0 0; color:#84521d; font-size:12px; line-height:1.45; }
.analytics-settings-hint { margin:1px 0 15px; color:var(--analytics-muted); font-size:12px; }
.analytics-settings { margin:0 0 14px; padding:0 18px; border:1px solid #dfd9e6; border-radius:18px; background:rgba(255,255,255,.68); }
.analytics-settings summary { padding:14px 0; color:var(--analytics-ink); font-size:14px; font-weight:650; cursor:pointer; }
.analytics-settings form { display:flex; align-items:end; flex-wrap:wrap; gap:12px; padding:2px 0 14px; }
.analytics-settings label,.analytics-month-dialog label { display:grid; gap:6px; color:var(--analytics-muted); font-size:12px; font-weight:550; }
.analytics-settings input,.analytics-month-dialog input { width:140px; min-height:40px; padding:8px 10px; border:1px solid #d6d8e0; border-radius:11px; background:#fff; color:var(--analytics-ink); font:inherit; font-size:14px; }
.analytics-settings button,.analytics-month-dialog button[type="submit"] { min-height:40px; padding:8px 15px; border:0; border-radius:11px; background:#6f64c2; color:#fff; font:inherit; font-size:13px; font-weight:650; cursor:pointer; }
.analytics-settings > p { margin:0 0 14px; color:var(--analytics-muted); font-size:12px; line-height:1.45; }
.analytics-table-section,.analytics-expenses-section { background:#fff; }
.analytics-table-scroll { overflow-x:auto; border:1px solid #ece9e6; border-radius:14px; }
.analytics-table-section table { width:100%; min-width:675px; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.analytics-table-section th,.analytics-table-section td { padding:10px 9px; border-bottom:1px solid #eeecea; text-align:right; white-space:nowrap; font-size:12px; }
.analytics-table-section th:first-child,.analytics-table-section td:first-child { text-align:left; }
.analytics-table-section thead th { background:#f6f5f4; color:#67717e; font-size:11px; font-weight:620; }
.analytics-table-section tbody tr:last-child > * { border-bottom:0; }
.analytics-table-section tbody tr.is-selected { background:#f2effb; }
.analytics-table-section tbody th button { padding:4px 5px; border:0; border-radius:7px; background:transparent; color:#494174; font:inherit; font-weight:660; cursor:pointer; }
.analytics-table-section tbody th button:hover { text-decoration:underline; }
.analytics-edit-month { min-height:30px; padding:4px 7px; border:1px solid #d6d0e4; border-radius:8px; background:#fff; color:#5c4e8e; font:inherit; font-size:11px; font-weight:600; cursor:pointer; }
.analytics-calendar-controls button:disabled { opacity:.35; cursor:default; }
.analytics-expense-list { display:grid; }
.analytics-expense-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px 0; border-top:1px solid #ece9e6; font-size:13px; }
.analytics-expense-row > span { display:grid; gap:3px; }.analytics-expense-row small { color:var(--analytics-muted); font-size:11px; }
.analytics-expense-row strong { white-space:nowrap; font-variant-numeric:tabular-nums; }
.analytics-expense-note { margin:13px 0 0; padding-top:12px; border-top:1px solid #ece9e6; color:var(--analytics-muted); font-size:12px; }
.analytics-empty { color:var(--analytics-muted); font-size:13px; }
.analytics-loading,.analytics-save-error { padding:30px; border-radius:18px; background:#fff; color:var(--analytics-muted); font-size:14px; }
.analytics-save-error { margin:0 0 12px; padding:12px 16px; background:#fff0ed; color:#8f3535; }
.analytics-month-dialog { width:min(420px,calc(100vw - 30px)); padding:24px; border:1px solid #ded9e7; border-radius:22px; background:#faf9f7; color:#202936; box-shadow:0 25px 70px rgba(26,30,43,.2); }
.analytics-month-dialog::backdrop { background:rgba(28,30,41,.38); backdrop-filter:blur(4px); }
.analytics-month-dialog form { display:grid; gap:14px; }.analytics-month-dialog h3,.analytics-month-dialog p { margin:0; }
.analytics-month-dialog h3 { font-size:22px; }.analytics-month-dialog p { color:#667081; font-size:13px; line-height:1.45; }
.analytics-month-dialog input { width:100%; }.analytics-month-dialog form > div { display:flex; justify-content:flex-end; gap:8px; }
.analytics-month-dialog button[type="button"] { min-height:40px; padding:8px 15px; border:1px solid #d6d8e0; border-radius:11px; background:#fff; color:#404956; font:inherit; cursor:pointer; }
.analytics-page button:focus-visible,.analytics-page input:focus-visible,.analytics-page summary:focus-visible { outline:3px solid #7166ca; outline-offset:2px; }
html[data-theme="dark"] .analytics-table-section,html[data-theme="dark"] .analytics-expenses-section,html[data-theme="dark"] .analytics-settings { background:#313844; border-color:#424b59; }
html[data-theme="dark"] .analytics-branch-switch { background:#252c36; }html[data-theme="dark"] .analytics-branch-switch button { color:#c2c6d0; }html[data-theme="dark"] .analytics-branch-switch button.is-active { background:#495366; color:#fff; }
html[data-theme="dark"] .analytics-table-section thead th { background:#3b4350; color:#d1d6dd; }html[data-theme="dark"] .analytics-table-section th,html[data-theme="dark"] .analytics-table-section td,html[data-theme="dark"] .analytics-expense-row { border-color:#454e5a; }
html[data-theme="dark"] .analytics-table-section tbody tr.is-selected { background:#48445d; }html[data-theme="dark"] .analytics-table-section tbody th button { color:#ddd2ff; }
html[data-theme="dark"] .analytics-plan-facts span { color:#e1d6e3; }html[data-theme="dark"] .analytics-caution { color:#ffd69b; }
@media(max-width:1100px) { .analytics-detail-grid { grid-template-columns:1fr; } }
@media(max-width:1060px) { .analytics-feature-grid { grid-template-columns:1fr; } }
@media(max-width:760px) { .analytics-toolbar { align-items:stretch; flex-direction:column; }.analytics-toolbar > span { white-space:normal; }.analytics-branch-switch { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }.analytics-branch-switch button { min-height:43px; }.analytics-context { align-items:start; flex-direction:column; gap:5px; } }
@media(max-width:530px) { .analytics-context h2 { font-size:21px; }.analytics-metric > strong { font-size:22px; }.analytics-settings input { width:100%; }.analytics-settings label { flex:1 1 130px; }.analytics-settings form button { width:100%; } }
@media(max-width:530px) { .analytics-chart-wrap { overflow-x:auto; }.analytics-chart-wrap svg,.analytics-chart-labels { min-width:560px; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-settings,.analytics-toolbar { background:#fff; } }

/* Main numbers and collapsible levels: the page opens on a few tiles, everything else is one click away. */
.analytics-main { min-width:0; margin-bottom:16px; }
.analytics-main-head { display:flex; align-items:flex-end; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; margin:0 2px 14px; }
.analytics-main-head h3 { margin:0; font-size:28px; letter-spacing:-.04em; line-height:1.1; }
.analytics-kpis { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.analytics-kpi-tile { position:relative; min-width:0; min-height:206px; display:flex; flex-direction:column; overflow:hidden; padding:18px 18px 16px; border-radius:22px; color:#202936; }
.analytics-kpi-tile.is-yellow { --tile-bg:#f6df83; --deco:#c9a21f; background:var(--tile-bg); }
.analytics-kpi-tile.is-green { --tile-bg:#dce6bb; --deco:#7ea35e; background:var(--tile-bg); }
.analytics-kpi-tile.is-blue { --tile-bg:#cfdff0; --deco:#628ab9; background:var(--tile-bg); }
.analytics-kpi-tile.is-pink { --tile-bg:#efd1e0; --deco:#c5789f; background:var(--tile-bg); }
.analytics-kpi-tile.is-lilac { --tile-bg:#e1d9f1; --deco:#8d7cc4; background:var(--tile-bg); }
.analytics-kpi-tile .analytics-student-decor { width:104px; height:104px; }
.analytics-kpi-label { position:relative; z-index:1; max-width:calc(100% - 64px); font-size:13px; font-weight:600; }
.analytics-kpi-tile strong { position:relative; z-index:1; margin-top:auto; font-size:clamp(28px,2.5vw,40px); font-weight:700; letter-spacing:-.045em; line-height:1; font-variant-numeric:tabular-nums; white-space:nowrap; }
.analytics-kpi-tile small { position:relative; z-index:1; display:block; margin-top:7px; color:rgba(32,41,54,.78); font-size:12px; line-height:1.4; }
.analytics-kpi-tile strong + small { margin-top:9px; }
.analytics-spark { position:absolute; z-index:1; top:48px; right:14px; width:88px; height:30px; color:var(--deco); overflow:visible; }
.analytics-delta { font-weight:660; }
.analytics-delta.is-up { color:#1f6a3a; }
.analytics-delta.is-down { color:#a02f26; }
.analytics-estimate { margin-left:4px; padding:1px 7px; border-radius:99px; background:rgba(255,255,255,.6); font-size:10.5px; font-style:normal; font-weight:620; white-space:nowrap; }
.analytics-signals { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 0; }
.analytics-signal { display:inline-flex; align-items:center; gap:9px; min-height:44px; padding:8px 17px; border:1px solid var(--analytics-line); border-radius:15px; background:rgba(255,255,255,.72); color:var(--analytics-ink); font:inherit; font-size:13.5px; font-weight:560; cursor:pointer; transition:background 150ms ease,border-color 150ms ease; }
.analytics-signal:hover { background:#fff; border-color:#d7d2e6; }
.analytics-signal i { width:9px; height:9px; flex:0 0 auto; border-radius:50%; background:#d9a21b; }
.analytics-signal.is-ok i { background:#4f9a62; }
.analytics-signal.is-alert i { background:#d0493e; }
.analytics-level { margin:0 0 10px; }
.analytics-level > summary { display:flex; align-items:center; gap:14px; min-height:64px; padding:14px 22px; border:1px solid var(--analytics-line); border-radius:20px; background:#fff; cursor:pointer; list-style:none; transition:border-color 150ms ease,background 150ms ease; }
.analytics-level > summary::-webkit-details-marker { display:none; }
.analytics-level > summary:hover { border-color:#d7d2e6; }
.analytics-level > summary::after { content:''; display:inline-block; flex:0 0 auto; width: 20px; height: 20px; background: var(--analytics-muted); -webkit-mask: var(--ic-down) center / contain no-repeat; mask: var(--ic-down) center / contain no-repeat; transition:transform 150ms ease; }
.analytics-level[open] > summary::after { transform:rotate(180deg); }
.analytics-level-title { font-size:17px; font-weight:680; letter-spacing:-.02em; }
.analytics-level-summary { min-width:0; margin-left:auto; color:var(--analytics-muted); font-size:13.5px; text-align:right; }
.analytics-level-body { margin-top:12px; }
.analytics-level-body > :last-child { margin-bottom:0; }
html[data-theme="dark"] .analytics-kpi-tile { color:#f0f1f5; }
html[data-theme="dark"] .analytics-kpi-tile small { color:rgba(240,241,245,.8); }
html[data-theme="dark"] .analytics-kpi-tile.is-yellow { --tile-bg:#675726; --deco:#e3c04e; }
html[data-theme="dark"] .analytics-kpi-tile.is-green { --tile-bg:#45563d; --deco:#a3c985; }
html[data-theme="dark"] .analytics-kpi-tile.is-blue { --tile-bg:#3e5268; --deco:#8fb5e3; }
html[data-theme="dark"] .analytics-kpi-tile.is-pink { --tile-bg:#65485d; --deco:#e39bc3; }
html[data-theme="dark"] .analytics-kpi-tile.is-lilac { --tile-bg:#4b4468; --deco:#b3a4e6; }
html[data-theme="dark"] .analytics-delta.is-up { color:#a9dcb0; }
html[data-theme="dark"] .analytics-delta.is-down { color:#ffb4aa; }
html[data-theme="dark"] .analytics-estimate { background:rgba(255,255,255,.14); }
html[data-theme="dark"] .analytics-signal { background:#313844; }
html[data-theme="dark"] .analytics-signal:hover { background:#3b4350; border-color:#566075; }
html[data-theme="dark"] .analytics-level > summary { background:#313844; }
@media(max-width:1280px) { .analytics-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:900px) { .analytics-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:560px) { .analytics-kpis { grid-template-columns:1fr; }.analytics-kpi-tile { min-height:172px; }.analytics-level > summary { flex-wrap:wrap; gap:4px 12px; padding:14px 16px; }.analytics-level-summary { order:3; flex:1 0 100%; margin-left:0; text-align:left; } }

/* Attendance, funnel and churn insights: small vector bars, calm surfaces. */
.analytics-attendance,.analytics-funnel { min-width:0; margin-bottom:14px; padding:22px 24px; border-radius:23px; background:#fff; }
.analytics-att-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:6px 28px; }
.analytics-att-col { min-width:0; padding-top:14px; border-top:1px solid #efece8; }
.analytics-att-col h4 { margin:0 0 6px; font-size:16px; letter-spacing:-.01em; }
.analytics-att-value { display:flex; align-items:baseline; gap:8px; margin:0; color:var(--analytics-muted); font-size:13px; }
.analytics-att-value strong { color:var(--analytics-ink); font-size:30px; font-weight:700; letter-spacing:-.04em; line-height:1; font-variant-numeric:tabular-nums; }
.analytics-att-col small { display:block; margin-top:5px; color:var(--analytics-muted); font-size:12px; }
.analytics-chat-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:22px 32px; }
.analytics-chat-col { min-width:0; padding-top:14px; border-top:1px solid #efece8; }
.analytics-chat-col h4 { margin:0 0 10px; font-size:16px; letter-spacing:-.01em; }
.analytics-chat-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 18px; }
.analytics-chat-stat span { display:block; color:var(--analytics-muted); font-size:12px; }
.analytics-chat-stat strong { color:var(--analytics-ink); font-size:24px; font-weight:700; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.analytics-chat-stat small { display:block; margin-top:2px; color:var(--analytics-muted); font-size:12px; }
.analytics-chat-waiting h5 { margin:16px 0 4px; font-size:14px; }
.analytics-chat-waiting ul { margin:0; padding-left:18px; display:grid; gap:3px; font-size:13px; }
.analytics-chat-ok, .analytics-chat-weeks { margin:14px 0 0; color:var(--analytics-muted); font-size:13px; }
.analytics-chat-col .analytics-recon-table { margin-top:14px; }
.analytics-chat-periods { display:flex; gap:6px; }
.analytics-chat-periods button { min-height:32px; padding:0 12px; font-size:13px; }
.analytics-chat-periods button.is-active { background:var(--analytics-ink); color:#fff; border-color:var(--analytics-ink); }
.analytics-att-bars { display:flex; align-items:flex-end; gap:4px; height:54px; margin-top:12px; }
.analytics-att-bars span { flex:1; min-width:0; border-radius:5px 5px 2px 2px; background:#d8d1ee; }
.analytics-att-bars span.is-now { background:#7166ca; }
.analytics-att-bars span.is-empty { background:#efecf6; }
.analytics-funnel-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.analytics-funnel-col { min-width:0; padding:16px 18px; border-radius:18px; background:#f6f4ef; }
.analytics-funnel-col h4 { margin:0 0 12px; font-size:13px; font-weight:640; color:var(--analytics-muted); }
.analytics-funnel-row { margin-bottom:11px; }
.analytics-funnel-row:last-of-type { margin-bottom:0; }
.analytics-funnel-row > span { display:flex; justify-content:space-between; gap:10px; font-size:12.5px; color:var(--analytics-muted); }
.analytics-funnel-row b { color:var(--analytics-ink); font-size:16px; font-variant-numeric:tabular-nums; }
.analytics-bar { display:block; height:8px; margin-top:5px; border-radius:99px; background:rgba(113,102,202,.14); overflow:hidden; }
.analytics-bar i { display:block; height:100%; border-radius:inherit; background:#7166ca; }
.analytics-funnel-row.is-second .analytics-bar i { background:#5aa27a; }
.analytics-funnel-row.is-third .analytics-bar i { background:#d9a21b; }
.analytics-funnel-rate.is-wait { background:#ebeaf3; color:#4b4690; }
.analytics-funnel-rate { display:inline-block; margin-top:12px; padding:3px 11px; border-radius:99px; background:#e3f0e6; color:#2f6a3d; font-size:12px; font-weight:640; }
.analytics-insights { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 32px; margin:16px 0 4px; padding:16px 0 4px; border-top:1px solid #efece8; }
.analytics-insights h4 { margin:0 0 10px; color:var(--analytics-muted); font-size:11px; font-weight:680; letter-spacing:.12em; text-transform:uppercase; }
.analytics-insights ul { margin:0; padding:0; list-style:none; }
.analytics-insights li { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(50px,1fr) auto; align-items:center; gap:2px 12px; padding:6px 0; font-size:13.5px; }
.analytics-insights li small { grid-column:1 / -1; margin:0 0 4px; color:var(--analytics-muted); font-size:12px; }
.analytics-insights li b { font-variant-numeric:tabular-nums; }
.analytics-insights .analytics-bar { margin-top:0; }
.analytics-insights section:last-child .analytics-bar i { background:#c5789f; }
html[data-theme="dark"] .analytics-attendance,html[data-theme="dark"] .analytics-funnel { background:#313844; }
html[data-theme="dark"] .analytics-att-col,html[data-theme="dark"] .analytics-insights { border-color:#454e5a; }
html[data-theme="dark"] .analytics-att-bars span { background:#4a4a6e; }
html[data-theme="dark"] .analytics-att-bars span.is-now { background:#9a8fe6; }
html[data-theme="dark"] .analytics-att-bars span.is-empty { background:#3b4350; }
html[data-theme="dark"] .analytics-funnel-col { background:#2c333d; }
html[data-theme="dark"] .analytics-funnel-rate { background:#3b5a3f; color:#cdeccf; }
html[data-theme="dark"] .analytics-bar { background:rgba(255,255,255,.12); }
@media(max-width:900px) { .analytics-funnel-grid,.analytics-insights { grid-template-columns:1fr; } }
@media(max-width:760px) { .analytics-attendance,.analytics-funnel { padding:18px 14px; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-attendance,.analytics-funnel { background:#fff; } }

/* Reconciliation: a plain table for checking figures against AlfaCRM; colour only marks how a line is treated. */
.analytics-recon { min-width:0; margin-bottom:14px; padding:22px 24px; border-radius:23px; background:#fff; }
.analytics-recon-table { width:100%; border-collapse:collapse; font-variant-numeric:tabular-nums; font-size:13.5px; }
.analytics-recon-table th,.analytics-recon-table td { padding:11px 8px; border-top:1px solid #efece8; text-align:right; vertical-align:top; }
.analytics-recon-table thead th { border-top:0; color:var(--analytics-muted); font-size:11px; font-weight:640; letter-spacing:.06em; text-transform:uppercase; }
.analytics-recon-table th:first-child,.analytics-recon-table td:first-child { text-align:left; }
.analytics-recon-table td:first-child small { display:block; max-width:520px; margin-top:3px; color:var(--analytics-muted); font-size:12px; line-height:1.4; }
.analytics-recon-table .is-skip td { color:var(--analytics-muted); }
.analytics-recon-tag { display:inline-block; padding:3px 10px; border-radius:99px; font-size:12px; font-weight:640; white-space:nowrap; }
.analytics-recon-tag.is-in { background:#dce9cf; color:#2f6a3d; }
.analytics-recon-tag.is-out { background:#f7e2de; color:#9a3329; }
.analytics-recon-tag.is-skip { background:#ebeaf3; color:#4b4690; }
.analytics-recon-tag.is-review { background:#fdf0d0; color:#7d5200; }
.analytics-recon-totals { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-top:16px; }
.analytics-recon-total { padding:14px 16px; border-radius:16px; background:#f6f4ef; }
.analytics-recon-total span { display:block; color:var(--analytics-muted); font-size:12px; }
.analytics-recon-total strong { display:block; margin:3px 0 6px; font-size:22px; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.analytics-recon-state { display:inline-block; font-size:12px; font-weight:600; }
.analytics-recon-state.is-ok { color:#2f6a3d; }
.analytics-recon-state.is-diff { color:#9a3329; }
.analytics-recon-scroll { overflow-x:auto; }
/* A long list of branches in a section heading must wrap instead of widening the page. */
.analytics-section-heading { flex-wrap:wrap; }
.analytics-section-note { min-width:0; }
@media(max-width:760px) { .analytics-section-note { white-space:normal; } }
html[data-theme="dark"] .analytics-recon { background:#313844; }
html[data-theme="dark"] .analytics-recon-table th,html[data-theme="dark"] .analytics-recon-table td { border-color:#454e5a; }
html[data-theme="dark"] .analytics-recon-total { background:#2c333d; }
html[data-theme="dark"] .analytics-recon-tag.is-in { background:#3b5a3f; color:#cdeccf; }
html[data-theme="dark"] .analytics-recon-tag.is-out { background:#5e3a37; color:#ffd6d0; }
html[data-theme="dark"] .analytics-recon-tag.is-skip { background:#413e63; color:#d9d5ff; }
html[data-theme="dark"] .analytics-recon-tag.is-review { background:#5b4a22; color:#ffe4a8; }
html[data-theme="dark"] .analytics-recon-state.is-ok { color:#a9dcb0; }
html[data-theme="dark"] .analytics-recon-state.is-diff { color:#ffb4aa; }
@media(max-width:760px) { .analytics-recon { padding:18px 14px; }.analytics-recon-totals { grid-template-columns:1fr; } }

/* Student counts: pastel tiles with simple vector shapes; the numbers stay large and plain. */
.analytics-students { min-width:0; margin-bottom:14px; padding:22px 24px; border-radius:23px; background:#fff; }
.analytics-students-top { display:grid; grid-template-columns:minmax(0,1.35fr) repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:10px; }
.analytics-students-audiences { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
.analytics-student-tile { position:relative; min-width:0; min-height:126px; display:flex; flex-direction:column; overflow:hidden; padding:16px 18px; border-radius:18px; color:#202936; }
.analytics-student-tile.is-hero { min-height:158px; }
.analytics-student-tile.is-yellow { --tile-bg:#f6df83; --deco:#c9a21f; background:var(--tile-bg); }
.analytics-student-tile.is-pink { --tile-bg:#efd1e0; --deco:#c5789f; background:var(--tile-bg); }
.analytics-student-tile.is-green { --tile-bg:#dce6bb; --deco:#7ea35e; background:var(--tile-bg); }
.analytics-student-tile.is-blue { --tile-bg:#cfdff0; --deco:#628ab9; background:var(--tile-bg); }
.analytics-student-label { position:relative; z-index:1; max-width:calc(100% - 70px); font-size:13px; font-weight:600; }
.analytics-student-tile strong { position:relative; z-index:1; margin-top:auto; font-size:clamp(34px,3.4vw,54px); font-weight:700; letter-spacing:-.05em; line-height:1; font-variant-numeric:tabular-nums; }
.analytics-student-tile.is-hero strong { font-size:clamp(44px,4.6vw,64px); }
.analytics-student-tile.is-hero small { max-width:calc(100% - 96px); }
.analytics-student-prior { position:relative; z-index:1; display:flex; align-items:baseline; flex-wrap:wrap; gap:3px 8px; margin-top:8px; font-size:12px; line-height:1.25; color:rgba(32,41,54,.76); }
.analytics-student-prior b { font-size:17px; line-height:1; color:#202936; font-variant-numeric:tabular-nums; }
.analytics-student-prior span:last-child { font-size:11px; }
.analytics-student-tile small { position:relative; z-index:1; margin-top:9px; color:rgba(32,41,54,.74); font-size:12px; line-height:1.4; }
.analytics-student-decor { position:absolute; top:-10px; right:-10px; width:112px; height:112px; color:var(--deco); fill:currentColor; stroke:none; opacity:.34; pointer-events:none; }
.analytics-student-tile.is-hero .analytics-student-decor { width:150px; height:150px; }
.analytics-student-decor .hole { fill:var(--tile-bg); }
.analytics-student-bars { position:absolute; right:22px; bottom:20px; height:74px; display:flex; align-items:flex-end; gap:8px; }
.analytics-student-bars span { width:13px; border-radius:7px 7px 3px 3px; background:var(--deco); opacity:.6; }
.analytics-students-note { margin:16px 0 0; color:var(--analytics-muted); font-size:12px; line-height:1.5; }
.analytics-inactive { margin-top:14px; border:1px solid var(--analytics-line); border-radius:16px; background:rgba(250,248,244,.7); }
.analytics-inactive summary { display:flex; align-items:center; gap:10px; min-height:46px; padding:10px 16px; border-radius:16px; color:var(--analytics-ink); font-size:14px; font-weight:600; cursor:pointer; list-style:none; }
.analytics-inactive summary::-webkit-details-marker { display:none; }
.analytics-inactive summary::after { content:''; display:inline-block; flex:0 0 auto; margin-left:auto; width: 18px; height: 18px; background: var(--analytics-muted); -webkit-mask: var(--ic-down) center / contain no-repeat; mask: var(--ic-down) center / contain no-repeat; transition:transform 150ms ease; }
.analytics-inactive[open] summary::after { transform:rotate(180deg); }
.analytics-inactive summary span { padding:2px 10px; border-radius:99px; background:#f0eef4; color:#4b4690; font-size:12px; font-weight:660; }
.analytics-inactive-body { padding:0 16px 12px; }
.analytics-inactive-body > p { margin:0 0 6px; color:var(--analytics-muted); font-size:12px; }
.analytics-inactive-body ul { max-height:360px; margin:0; padding:0; overflow-y:auto; list-style:none; }
.analytics-inactive-row { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) minmax(0,1.2fr); align-items:center; gap:12px; padding:10px 0; border-top:1px solid #efece8; font-size:13.5px; line-height:1.35; }
.analytics-inactive-row strong { font-size:14px; overflow-wrap:anywhere; }
.analytics-inactive-row span { color:var(--analytics-muted); }
.analytics-inactive-row em { color:#9a3329; font-style:normal; font-weight:580; }
.analytics-students .analytics-empty button { margin-left:6px; padding:5px 11px; border:1px solid #d6d0e4; border-radius:9px; background:#fff; color:#5c4e8e; font:inherit; font-size:13px; cursor:pointer; }
html[data-theme="dark"] .analytics-students { background:#313844; }
html[data-theme="dark"] .analytics-student-tile { color:#f0f1f5; }
html[data-theme="dark"] .analytics-student-tile small, html[data-theme="dark"] .analytics-student-prior { color:rgba(240,241,245,.76); }
html[data-theme="dark"] .analytics-student-prior b { color:#f0f1f5; }
html[data-theme="dark"] .analytics-student-tile.is-yellow { --tile-bg:#675726; --deco:#e3c04e; }
html[data-theme="dark"] .analytics-student-tile.is-pink { --tile-bg:#65485d; --deco:#e39bc3; }
html[data-theme="dark"] .analytics-student-tile.is-green { --tile-bg:#45563d; --deco:#a3c985; }
html[data-theme="dark"] .analytics-student-tile.is-blue { --tile-bg:#3e5268; --deco:#8fb5e3; }
html[data-theme="dark"] .analytics-inactive { background:#2c333d; }
html[data-theme="dark"] .analytics-inactive summary span { background:#45406a; color:#ddd7ff; }
html[data-theme="dark"] .analytics-inactive-row { border-color:#454e5a; }
html[data-theme="dark"] .analytics-inactive-row em { color:#ffb4aa; }
@media(max-width:1100px) { .analytics-students-top { grid-template-columns:repeat(2,minmax(0,1fr)); }.analytics-student-tile.is-hero { grid-column:1 / -1; } }
@media(max-width:760px) { .analytics-students { padding:18px 14px; }.analytics-students-top { grid-template-columns:1fr; }.analytics-inactive-row { grid-template-columns:1fr; gap:2px; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-students { background:#fff; } }

/* Group state: one column per audience on a single surface; colour only marks the group size. */
.analytics-groups { min-width:0; margin-bottom:14px; padding:22px 24px; border-radius:23px; background:#fff; }
.analytics-groups-lead { margin:0 0 14px; color:var(--analytics-ink); font-size:15px; line-height:1.45; }
.analytics-groups-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:6px 30px; }
.analytics-audience { min-width:0; padding-top:14px; border-top:1px solid #efece8; }
.analytics-audience h4 { margin:0 0 6px; font-size:16px; letter-spacing:-.01em; }
.analytics-audience-avg { margin:0 0 10px; color:var(--analytics-muted); font-size:13px; }
.analytics-audience-avg b { color:var(--analytics-ink); font-size:15px; font-weight:680; }
.analytics-audience-count { display:flex; align-items:baseline; gap:8px; margin:0; color:var(--analytics-muted); font-size:13px; }
.analytics-audience-count strong { color:var(--analytics-ink); font-size:30px; font-weight:700; letter-spacing:-.04em; line-height:1; }
.analytics-audience header small { display:block; margin-top:5px; color:var(--analytics-muted); font-size:12px; }
.analytics-audience ul { margin:10px 0 0; padding:0; list-style:none; }
.analytics-audience .analytics-empty { margin:12px 0 0; }
.analytics-group-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-top:1px solid #f3f0ec; }
.analytics-group-row:first-child { border-top:0; }
.analytics-group-row > div { min-width:0; }
.analytics-group-row strong { display:block; font-size:13.5px; line-height:1.3; overflow-wrap:anywhere; }
.analytics-group-row small { color:var(--analytics-muted); font-size:12px; }
.analytics-group-size { flex:0 0 auto; padding:4px 11px; border-radius:99px; background:#fdf0d0; color:#7d5200; font-size:12px; font-weight:640; white-space:nowrap; }
.analytics-group-size b { font-size:14px; }
.analytics-group-size.is-empty { background:#fbe6e2; color:#9a3329; }
.analytics-groups .analytics-empty button { margin-left:6px; padding:5px 11px; border:1px solid #d6d0e4; border-radius:9px; background:#fff; color:#5c4e8e; font:inherit; font-size:13px; cursor:pointer; }
html[data-theme="dark"] .analytics-groups { background:#313844; }
html[data-theme="dark"] .analytics-audience,html[data-theme="dark"] .analytics-group-row { border-color:#454e5a; }
html[data-theme="dark"] .analytics-group-size { background:#5b4a22; color:#ffe4a8; }
html[data-theme="dark"] .analytics-group-size.is-empty { background:#5e3a37; color:#ffd6d0; }
html[data-theme="dark"] .analytics-groups .analytics-empty button { background:#3d4654; border-color:#4d5666; color:#ddd2ff; }
@media(max-width:760px) { .analytics-groups { padding:18px 14px; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-groups { background:#fff; } }

/* Cancelled lessons: counts per branch in one table, then the lost lessons as a quiet list. */
.analytics-cancellations { min-width:0; margin-bottom:14px; padding:22px 24px; border-radius:23px; background:#fff; }
.analytics-cancel-lead { margin:0 0 14px; color:var(--analytics-ink); font-size:15px; line-height:1.45; }
.analytics-cancellations .analytics-churn-filters { margin-bottom:12px; }
.analytics-cancellations .analytics-calendar-controls strong { min-width:150px; font-size:13px; text-transform:none; }
.analytics-churn .analytics-section-heading,.analytics-cancellations .analytics-section-heading { flex-wrap:wrap; }
.analytics-cancel-table { width:100%; min-width:660px; border-collapse:collapse; font-variant-numeric:tabular-nums; }
.analytics-cancel-table th,.analytics-cancel-table td { padding:12px 10px; border-bottom:1px solid #efece8; text-align:right; font-size:13.5px; white-space:nowrap; }
.analytics-cancel-table thead th { color:var(--analytics-muted); font-size:11px; font-weight:640; letter-spacing:.04em; }
.analytics-cancel-table th:first-child,.analytics-cancel-table td:first-child { text-align:left; }
.analytics-cancel-table tbody th { font-weight:600; }
.analytics-cancel-table td.is-lost { color:#9a3329; font-weight:680; }
.analytics-cancel-table td.is-lost small { margin-left:6px; color:var(--analytics-muted); font-size:11px; font-weight:500; }
.analytics-cancel-table tr.is-total > * { border-top:1px solid #d9d4cb; border-bottom:0; font-weight:700; }
.analytics-cancel-share { width:150px; }
.analytics-cancel-bar { display:flex; height:8px; min-width:120px; overflow:hidden; border-radius:99px; background:#f0eef4; }
.analytics-cancel-bar i { display:block; height:100%; }
.analytics-cancel-bar i.is-made { background:#7ca473; }
.analytics-cancel-bar i.is-moved { background:#7a9fd0; }
.analytics-cancel-bar i.is-lost { background:#d98a80; }
.analytics-cancel-bar i.is-wait { background:#cfcfd6; }
.analytics-cancel-late { margin:12px 0 0; color:var(--analytics-muted); font-size:13px; line-height:1.45; }
.analytics-cancel-subtitle { margin:26px 0 0; font-size:16px; letter-spacing:-.01em; }
.analytics-lost-row { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(0,1.2fr) minmax(0,1fr) minmax(0,.9fr); align-items:center; gap:14px; padding:12px 2px; border-top:1px solid #efece8; font-size:13.5px; line-height:1.35; }
.analytics-lost-row:first-child { border-top:0; }
.analytics-lost-person { display:grid; gap:2px; min-width:0; }
.analytics-lost-person strong { font-size:14px; overflow-wrap:anywhere; }
.analytics-lost-person small { color:var(--analytics-muted); font-size:12px; }
.analytics-lost-what,.analytics-lost-teacher { min-width:0; overflow-wrap:anywhere; }
.analytics-lost-teacher em { color:var(--analytics-muted); font-style:normal; }
.analytics-lost-notice { justify-self:end; }
html[data-theme="dark"] .analytics-cancellations { background:#313844; }
html[data-theme="dark"] .analytics-cancel-table th,html[data-theme="dark"] .analytics-cancel-table td,html[data-theme="dark"] .analytics-lost-row { border-color:#454e5a; }
html[data-theme="dark"] .analytics-cancel-table tr.is-total > * { border-top-color:#5a6472; }
html[data-theme="dark"] .analytics-cancel-table td.is-lost { color:#ffb4aa; }
html[data-theme="dark"] .analytics-cancel-bar { background:#3b4350; }
@media(max-width:1100px) { .analytics-lost-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }.analytics-lost-notice { justify-self:start; } }
@media(max-width:760px) { .analytics-cancellations { padding:18px 14px; }.analytics-lost-row { grid-template-columns:minmax(0,1fr); gap:4px; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-cancellations { background:#fff; } }

.analytics-demand-people { margin-top: 10px; }
.analytics-demand-people summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-size: 13px; font-weight: 550; color: var(--analytics-ink); }
.analytics-demand-note { display: block; margin-top: 2px; white-space: pre-line; }
.schedule-free-demand { display: block; font-weight: 550; }
.schedule-free-window[role="button"] { cursor: pointer; }
.schedule-free-panel { margin: 10px 0; padding: 12px 14px; border: 1px solid rgba(128, 128, 128, 0.35); border-radius: 10px; }
.schedule-free-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.schedule-free-panel h3 { margin: 0; font-size: 15px; }
.schedule-free-direction { margin-top: 14px; padding-top: 10px; border-top: 2px solid rgba(128, 128, 128, 0.3); }
.schedule-free-direction:first-of-type { border-top: 0; padding-top: 0; }
.schedule-free-panel h4 { margin: 0 0 2px; font-size: 14px; }
.schedule-free-panel h5 { margin: 10px 0 2px; font-size: 12px; opacity: 0.75; }
.schedule-free-teachers, .schedule-free-why { margin: 2px 0; font-size: 12px; }
.schedule-free-why { opacity: 0.75; }
.schedule-free-panel details summary { cursor: pointer; padding: 6px 0; font-size: 12px; font-weight: 550; }
.schedule-free-panel ul { margin: 0; padding: 0; list-style: none; }
.schedule-free-person { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid rgba(128, 128, 128, 0.2); }
.schedule-free-person small { display: block; font-size: 12px; opacity: 0.8; }
.schedule-free-person.is-offered { opacity: 0.6; }
.schedule-free-error:empty { display: none; }
.analytics-demand-people ul { margin: 4px 0 0; padding: 0; list-style: none; }

.analytics-profit-lead { margin: 0 0 10px; font-size: 15px; font-weight: 550; }
.analytics-profit-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.analytics-profit-table th, .analytics-profit-table td { padding: 8px 10px; text-align: right; border-top: 1px solid rgba(128, 128, 128, 0.2); font-variant-numeric: tabular-nums; }
.analytics-profit-table thead th { border-top: 0; font-size: 12px; font-weight: 500; opacity: 0.75; }
.analytics-profit-table thead th:first-child { text-align: left; }
.analytics-profit-sort { all: unset; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.analytics-profit-sort:hover { opacity: 0.8; }
.analytics-profit-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.analytics-profit-sort span { display: inline-block; min-width: 10px; font-size: 9px; }
.analytics-profit-table thead th[aria-sort="ascending"], .analytics-profit-table thead th[aria-sort="descending"] { opacity: 1; }
.analytics-profit-table tbody th { text-align: left; font-weight: 500; }
.analytics-profit-table small { display: block; font-size: 12px; font-weight: 400; opacity: 0.7; }
.analytics-profit-toggle { all: unset; display: inline-flex; flex-direction: column; align-items: flex-start; cursor: pointer; }
.analytics-profit-toggle::before { content: ''; position: absolute; margin-left: -14px; margin-top: 3px; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--ic-right) center / contain no-repeat; mask: var(--ic-right) center / contain no-repeat; }
.analytics-profit-toggle[aria-expanded="true"]::before { -webkit-mask-image: var(--ic-down); mask-image: var(--ic-down); }
.analytics-profit-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.analytics-profit-teacher th, .analytics-profit-teacher td { background: rgba(128, 128, 128, 0.06); font-size: 13px; }
.analytics-profit-teacher th { padding-left: 26px; font-weight: 400; }
.analytics-profit-table .is-plus { color: #1a7f37; font-weight: 600; }
.analytics-profit-table .is-minus { color: #b42318; font-weight: 600; }
.analytics-profit-total th, .analytics-profit-total td { border-top: 2px solid rgba(128, 128, 128, 0.4); font-weight: 600; }
.analytics-profit-note { margin: 8px 0 0; font-size: 12px; opacity: 0.8; }
.analytics-profit-split { display: flex; height: 12px; margin: 4px 0 6px; overflow: hidden; border-radius: 6px; background: rgba(128, 128, 128, 0.15); }
.analytics-profit-split i { display: block; height: 100%; }
.analytics-profit-split .is-pay, .analytics-profit-legend .is-pay::before { background: #d97706; }
.analytics-profit-split .is-plus, .analytics-profit-legend .is-plus::before { background: #1a7f37; }
.analytics-profit-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 12px; font-size: 12px; opacity: 0.85; }
.analytics-profit-legend .is-pay::before, .analytics-profit-legend .is-plus::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 2px; }
.analytics-profit-margin { min-width: 110px; }
.analytics-profit-bar { display: inline-block; width: 56px; height: 6px; margin-right: 8px; overflow: hidden; vertical-align: middle; border-radius: 3px; background: rgba(128, 128, 128, 0.18); }
.analytics-profit-bar i { display: block; height: 100%; }
.analytics-profit-bar .is-plus { background: #1a7f37; }
.analytics-profit-bar .is-minus { background: #b42318; }

/* Churn journal: a calm list on one white surface; colour only marks the outcome. */
.analytics-churn { min-width:0; margin-bottom:14px; padding:22px 24px; border-radius:23px; background:#fff; }
.analytics-churn-controls { display:flex; align-items:center; flex-wrap:wrap; justify-content:flex-end; gap:10px 16px; }
.analytics-churn .analytics-calendar-controls strong { min-width:150px; font-size:13px; text-transform:none; }
.analytics-churn-summary { margin:0 0 14px; color:var(--analytics-ink); font-size:15px; line-height:1.45; }
.analytics-churn-summary button { margin-left:6px; padding:5px 11px; border:1px solid #d6d0e4; border-radius:9px; background:#fff; color:#5c4e8e; font:inherit; font-size:13px; cursor:pointer; }
.analytics-churn-filters { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.analytics-churn-filters button { min-height:40px; padding:7px 15px; border:1px solid var(--analytics-line); border-radius:12px; background:transparent; color:#515b69; font:inherit; font-size:13px; font-weight:550; cursor:pointer; transition:background 150ms ease,color 150ms ease,border-color 150ms ease; }
.analytics-churn-filters button:hover { background:#f4f1f7; color:var(--analytics-ink); }
.analytics-churn-filters button.is-active { border-color:#cfc8ec; background:#f0edfb; color:#3f3680; }
.analytics-churn-day { margin-top:22px; }
.analytics-churn-day h4 { display:flex; align-items:center; gap:9px; margin:0 0 4px; color:var(--analytics-muted); font-size:11px; font-weight:680; letter-spacing:.12em; text-transform:uppercase; }
.analytics-churn-day h4 span { padding:1px 8px; border-radius:99px; background:#f0eef4; font-size:11px; letter-spacing:0; }
.analytics-churn-day ul { margin:0; padding:0; list-style:none; }
.analytics-churn-row { display:grid; grid-template-columns:36px minmax(150px,1.05fr) minmax(0,1.3fr) minmax(0,1fr) minmax(0,1.25fr); align-items:center; gap:14px; padding:13px 2px; border-top:1px solid #efece8; font-size:13.5px; line-height:1.35; }
.analytics-churn-row:first-child { border-top:0; }
.analytics-churn-avatar { width:36px; height:36px; display:grid; place-items:center; border-radius:11px; background:#e9e5f6; color:#5a4fa3; font-size:15px; font-weight:700; }
.analytics-churn-person { display:grid; gap:2px; min-width:0; }
.analytics-churn-person strong { font-size:14px; overflow-wrap:anywhere; }
.analytics-churn-person small,.analytics-churn-what small { color:var(--analytics-muted); font-size:12px; }
.analytics-churn-group,.analytics-churn-teacher { min-width:0; overflow-wrap:anywhere; }
.analytics-churn-group em,.analytics-churn-teacher em { color:var(--analytics-muted); font-style:normal; }
.analytics-churn-caption { display:none; margin-bottom:1px; color:var(--analytics-muted); font-size:11px; font-weight:600; }
.analytics-churn-what { display:grid; justify-items:start; gap:4px; min-width:0; }
.analytics-churn-what small { line-height:1.4; }
.analytics-churn-badge { display:inline-block; padding:4px 11px; border-radius:99px; font-size:12px; font-weight:640; white-space:nowrap; }
.analytics-churn-badge.is-center { background:#fbe6e2; color:#9a3329; }
.analytics-churn-badge.is-group { background:#fdf0d0; color:#7d5200; }
.analytics-churn-badge.is-transfer { background:#ebeaf3; color:#4b4690; }
.analytics-churn-empty { margin:22px 0 6px; padding:26px 0; text-align:center; font-size:14px; }
.analytics-churn-note { margin:20px 0 0; padding-top:14px; border-top:1px solid #efece8; color:var(--analytics-muted); font-size:12px; line-height:1.5; }
html[data-theme="dark"] .analytics-churn { background:#313844; }
html[data-theme="dark"] .analytics-churn-summary button { background:#3d4654; border-color:#4d5666; color:#ddd2ff; }
html[data-theme="dark"] .analytics-churn-filters button { color:#c2c6d0; }
html[data-theme="dark"] .analytics-churn-filters button:hover { background:#3b4350; color:#fff; }
html[data-theme="dark"] .analytics-churn-filters button.is-active { border-color:#6a62a8; background:#45406a; color:#fff; }
html[data-theme="dark"] .analytics-churn-day h4 span { background:#3b4350; }
html[data-theme="dark"] .analytics-churn-row,html[data-theme="dark"] .analytics-churn-note { border-color:#454e5a; }
html[data-theme="dark"] .analytics-churn-avatar { background:#45406a; color:#ddd7ff; }
html[data-theme="dark"] .analytics-churn-badge.is-center { background:#5e3a37; color:#ffd6d0; }
html[data-theme="dark"] .analytics-churn-badge.is-group { background:#5b4a22; color:#ffe4a8; }
html[data-theme="dark"] .analytics-churn-badge.is-transfer { background:#413e63; color:#d9d5ff; }
@media(max-width:1100px) { .analytics-churn-row { grid-template-columns:36px minmax(0,1fr) minmax(0,1fr); }.analytics-churn-what { grid-column:2 / -1; }.analytics-churn-caption { display:block; } }
@media(max-width:760px) { .analytics-churn { padding:18px 14px; }.analytics-churn-controls { justify-content:flex-start; }.analytics-churn-row { grid-template-columns:36px minmax(0,1fr); gap:6px 12px; }.analytics-churn-row > div:not(.analytics-churn-person) { grid-column:2; } }
@supports not (backdrop-filter:blur(1px)) { .analytics-churn { background:#fff; } }

/* Interface audit: popover that stays on screen, comfortable tap targets, one accent colour for native controls. */
.dashboard-calendar-day:nth-child(7n+4) .dashboard-calendar-task-list,
.dashboard-calendar-day:nth-child(7n+5) .dashboard-calendar-task-list,
.dashboard-calendar-day:nth-child(7n+6) .dashboard-calendar-task-list,
.dashboard-calendar-day:nth-child(7n) .dashboard-calendar-task-list { left:auto; right:0; }
.dashboard-calendar-tasks summary { display:inline-flex; align-items:center; min-height:30px; padding:2px 7px; }
.schedule-toolbar #scheduleRefresh { min-height:42px; align-self:flex-end; }
input[type="checkbox"], input[type="radio"] { accent-color:var(--accent); }
@media (max-width:760px) { .schedule-toolbar #scheduleRefresh { width:100%; align-self:stretch; } }

/* Interface audit, round 3: an odd last field fills its row; the home branch filter matches the task filters. */
.details-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Interface audit, round 4: library tabs and a width cap for the analytics page on very wide screens. */
@media (max-width:760px) { .library-tabs { width:100%; } .library-tab { flex:1; } }
#view-analytics { max-width:1680px; }

/* Interface audit, round 5: on phones, form fields use 16px so iOS does not zoom the page on focus,
   and small controls get a finger-sized hit area. */
@media (max-width:760px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]), select, textarea { font-size:16px !important; }
  #homeCalendarPrevious, #homeCalendarNext, .task-more-button { min-width:44px; min-height:44px; }
  .dashboard-calendar-tasks summary { position:relative; }
  .dashboard-calendar-tasks summary::after { content:""; position:absolute; inset:-6px -4px; }
  .phone-copy { min-height:44px; }
  #view-analytics button { min-width:40px; min-height:40px; }
  #feedbackAdminSection .section-heading a { display:inline-block; padding:11px 0; }
}

/* "Мой день" and "Входящие": rows and one working surface, no cards inside cards. */
.ws-day { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(300px,1fr); gap:34px; align-items:start; margin-top:20px; }
.ws-col { display:flex; flex-direction:column; gap:30px; min-width:0; }
.ws-head { margin-bottom:6px; }
.ws-head h2 { margin:0; }
.ws-routine { border-top:1px solid var(--line); }
.ws-routine:last-child { border-bottom:1px solid var(--line); }
.ws-routine summary { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:54px; cursor:pointer; font-weight:600; list-style:none; }
.ws-routine summary::-webkit-details-marker { display:none; }
.ws-routine summary > span:first-child::before { content:"›"; display:inline-block; width:18px; color:var(--muted); transition:transform .15s; }
.ws-routine[open] summary > span:first-child::before { transform:rotate(90deg); }
.ws-meter { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; font-weight:500; white-space:nowrap; }
.ws-bar { width:96px; height:8px; border-radius:5px; background:var(--surface-hover); overflow:hidden; }
.ws-bar i { display:block; height:100%; border-radius:5px; background:var(--green); transition:width .2s; }
.ws-list { display:flex; flex-direction:column; }
.ws-row { display:flex; align-items:center; gap:14px; min-height:56px; padding:8px 4px; border-top:1px solid var(--line); }
label.ws-row { cursor:pointer; }
.ws-row input[type=checkbox] { width:22px; height:22px; flex:none; }
.ws-check { display:grid; place-items:center; flex:none; width:44px; height:44px; margin:-8px -8px -8px -12px; cursor:pointer; }
.section-heading.ws-head { align-items:center; }
@media (max-width:760px) { .section-heading.ws-head { flex-direction:row; justify-content:space-between; } }
.ws-row-text { min-width:0; flex:1; display:flex; flex-direction:column; gap:1px; text-align:left; }
.ws-row.is-done .ws-title { color:var(--muted); text-decoration:line-through; font-weight:500; }
.ws-title { font-weight:500; overflow-wrap:anywhere; }
.ws-meta { color:var(--muted); font-size:13px; }
.ws-meta.is-late { color:var(--red); font-weight:500; }
.ws-link { min-height:44px; justify-content:center; padding:0; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.ws-link:hover .ws-title { color:var(--accent); }
.ws-tag { display:inline-flex; align-items:center; min-height:24px; padding:0 9px; border-radius:8px; background:var(--surface-soft); color:var(--muted); font-size:12px; font-weight:550; white-space:nowrap; }
.ws-tag.red { background:var(--red-soft); color:var(--red); }
.ws-tag.amber { background:var(--amber-soft); color:var(--amber); }
.ws-tag.green { background:var(--green-soft); color:var(--green); }
.ws-tag.blue { background:var(--accent-soft); color:var(--accent); }
.ws-btn { min-height:44px; padding:0 16px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface); color:var(--text); font-weight:550; cursor:pointer; }
.ws-btn:hover { background:var(--surface-hover); }
.ws-btn.primary { border-color:transparent; background:var(--accent); color:#fff; }
.ws-btn.primary:hover { background:var(--accent-hover); }
.ws-btn.quiet { border-color:transparent; background:transparent; color:var(--muted); }
.ws-btn.quiet:hover { color:var(--text); background:var(--surface-hover); }
.ws-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.ws-peeks { border-top:1px solid var(--line); }
.ws-peek { padding:13px 4px; border-bottom:1px solid var(--line); }
.ws-peek-head { display:flex; align-items:center; gap:10px; margin-bottom:4px; }
.ws-empty { padding:24px 6px; color:var(--muted); }
.ws-clean { text-align:center; padding:60px 20px; }
.ws-clean strong { display:block; color:var(--text); font-size:20px; margin-bottom:6px; }
.ws-label { margin-bottom:6px; color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; }
#inboxFilters { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 16px; }
.ws-split { display:grid; grid-template-columns:minmax(300px,420px) minmax(0,1fr); gap:30px; align-items:start; }
.ws-items { display:flex; flex-direction:column; border-top:1px solid var(--line); }
.ws-item { display:flex; flex-direction:column; align-items:stretch; gap:3px; width:100%; padding:13px 12px; border:0; border-bottom:1px solid var(--line); background:transparent; color:inherit; text-align:left; font:inherit; cursor:pointer; }
.ws-item:hover { background:var(--surface-hover); }
.ws-item[aria-current="true"] { background:var(--accent-soft); }
.ws-item .ws-peek-head { justify-content:space-between; margin-bottom:0; }
.ws-pane { position:sticky; top:18px; max-height:calc(100vh - 36px); overflow-y:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:20px; padding:24px; border:1px solid var(--line); border-radius:24px; background:var(--surface); box-shadow:var(--shadow-soft); min-width:0; }
.ws-pane h2 { margin:6px 0 0; font-size:22px; overflow-wrap:anywhere; }
.ws-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px 22px; margin:0; }
.ws-facts dt { color:var(--muted); font-size:12px; font-weight:550; letter-spacing:.04em; text-transform:uppercase; }
.ws-facts dd { margin:2px 0 0; font-weight:500; overflow-wrap:anywhere; }
.ws-thread { display:flex; flex-direction:column; gap:8px; }
.ws-msg { display:flex; flex-direction:column; gap:1px; padding:9px 12px; border-radius:14px; background:var(--surface-soft); max-width:92%; overflow-wrap:anywhere; }
.ws-msg.out { align-self:flex-end; background:var(--accent-soft); }
.ws-attach { display:inline-flex; align-self:flex-start; align-items:center; min-height:24px; margin-top:2px; padding:0 9px; border-radius:8px; background:var(--surface); color:var(--muted); font-size:12px; font-weight:550; }
.ws-note { padding:12px 14px; border-radius:14px; background:var(--surface-soft); white-space:pre-wrap; overflow-wrap:anywhere; }
.ws-steps { margin:0; padding-left:20px; display:flex; flex-direction:column; gap:6px; }
#routineItems { min-height:260px; }
@media (max-width:1100px) { .ws-day, .ws-split { grid-template-columns:1fr; } .ws-pane { position:static; max-height:none; overflow-y:visible; } }
@media (max-width:760px) { .ws-pane { padding:18px; } .ws-bar { width:64px; } .ws-actions .ws-btn { flex:1 1 auto; } }

/* Projects: tasks and links inside a project, the Gantt chart, task list views. */
.task-view-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-right:auto; }
.gantt-season select { min-height:44px; padding:0 12px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface); color:var(--text); }
.pill.green { background:var(--green-soft); color:var(--green); }
.project-block { margin-top:24px; }
.project-block-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:6px; }
.project-block h3 { margin:0; font-size:17px; }
.project-add { min-height:44px; padding:0 15px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface); color:var(--text); font-weight:550; cursor:pointer; }
.project-add:hover { background:var(--surface-hover); }
.project-rows { display:flex; flex-direction:column; border-top:1px solid var(--line); }
.project-row { display:flex; align-items:center; gap:12px; width:100%; min-height:52px; padding:6px 4px; border:0; border-bottom:1px solid var(--line); background:transparent; color:inherit; font:inherit; text-align:left; }
button.project-row { cursor:pointer; }
button.project-row:hover { background:var(--surface-hover); }
.project-row-title { flex:1; min-width:0; font-weight:500; overflow-wrap:anywhere; }
a.project-row-title { color:var(--accent); text-decoration:none; }
a.project-row-title:hover { text-decoration:underline; }
.project-row-meta { color:var(--muted); font-size:13px; }
.project-row.is-done .project-row-title { color:var(--muted); text-decoration:line-through; font-weight:500; }
.project-stream { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:12px; padding:11px 4px; border-bottom:1px solid var(--line); }
.project-stream > div:first-child { display:flex; flex-direction:column; gap:3px; min-width:0; }
.project-stream details[open] { grid-column:1 / -1; }
.project-stream-result { display:flex; flex-direction:column; text-align:right; color:var(--accent); }
.project-stream-result span { color:var(--muted); font-size:12px; }
.project-stream details summary,.project-stream-new summary { cursor:pointer; color:var(--accent); font-weight:550; }
.project-stream-form { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; align-items:end; padding:12px 0; }
.project-stream-form label { display:flex; flex-direction:column; gap:4px; color:var(--muted); font-size:13px; font-weight:500; }
.project-stream-form input,.project-stream-form select { min-height:44px; }
.project-stream-form .form-error { grid-column:1 / -1; margin:0; }
.project-stream-new { margin-top:12px; }
@media (max-width:760px) { .project-stream { grid-template-columns:minmax(0,1fr) auto; } .project-stream details { grid-column:1 / -1; } .project-stream-form { grid-template-columns:1fr; } }
.project-form { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.4fr) 150px auto; gap:10px; align-items:end; margin-top:14px; }
.project-form label { display:flex; flex-direction:column; gap:4px; color:var(--muted); font-size:13px; font-weight:500; }
.project-form input { min-height:44px; }
.project-form .form-error { grid-column:1 / -1; margin:0; }
.tb-group { margin-bottom:26px; }
.tl-wrap { overflow-x:auto; border-top:1px solid var(--line); }
.tl { width:100%; min-width:780px; border-collapse:collapse; }
.tl th { padding:10px 12px; border-bottom:1px solid var(--line); color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.05em; text-align:left; text-transform:uppercase; }
.tl td { padding:12px; border-bottom:1px solid var(--line); vertical-align:middle; }
.tl tbody tr { cursor:pointer; }
.tl tbody tr:hover td { background:var(--surface-hover); }
.tl .tl-title { font-weight:500; }
.tl .is-late { color:var(--red); font-weight:500; }
.gantt-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin-bottom:14px; }
.gantt-nav { display:inline-flex; gap:4px; }
.gantt-nav button { min-width:44px; min-height:44px; padding:0 14px; border:1px solid var(--line-strong); border-radius:12px; background:var(--surface); color:var(--text); font-weight:550; cursor:pointer; }
.gantt-scroll { overflow-x:auto; border:1px solid var(--line); border-radius:18px; background:var(--surface); }
.gantt { --label:260px; position:relative; width:calc(var(--label) + var(--days) * var(--px)); }
.gantt-head { position:sticky; top:0; z-index:4; display:flex; border-bottom:1px solid var(--line); background:var(--surface); }
.gantt-label { position:sticky; left:0; z-index:3; flex:none; display:flex; align-items:center; gap:2px; width:var(--label); min-width:0; padding:0 8px 0 4px; border-right:1px solid var(--line); background:var(--surface); }
.gantt-corner { min-height:56px; padding-left:14px; color:var(--muted); font-size:13px; font-weight:550; }
.gantt-axis { position:relative; flex:none; width:calc(var(--days) * var(--px)); height:56px; }
.gantt-months, .gantt-days { position:absolute; left:0; right:0; height:28px; }
.gantt-months { top:0; }
.gantt-days { top:28px; }
.gantt-month { position:absolute; top:0; height:28px; padding:6px 8px; overflow:hidden; border-left:1px solid var(--line-strong); color:var(--muted); font-size:12px; font-weight:600; letter-spacing:.05em; text-transform:uppercase; white-space:nowrap; }
.gantt-day { position:absolute; top:0; height:28px; display:grid; place-items:center; color:var(--muted); font-size:11px; }
.gantt-day.is-weekend { background:var(--surface-soft); }
.gantt-day.is-today { border-radius:8px; background:var(--accent); color:#fff; font-weight:600; }
.gantt-body { position:relative; }
.gantt-lines { position:absolute; top:0; bottom:0; left:var(--label); width:calc(var(--days) * var(--px)); pointer-events:none; }
.gantt-line { position:absolute; top:0; bottom:0; width:1px; background:var(--line); }
.gantt-line.month { background:var(--line-strong); }
.gantt-weekend { position:absolute; top:0; bottom:0; background:var(--surface-soft); opacity:.75; }
.gantt-today { position:absolute; top:0; bottom:0; width:2px; background:var(--accent); opacity:.75; }
.gantt-row { position:relative; display:flex; min-height:50px; border-bottom:1px solid var(--line); }
.gantt-row.task { min-height:44px; }
.gantt-toggle { flex:none; width:30px; height:44px; border:0; background:transparent; color:var(--muted); font-size:14px; cursor:pointer; }
.gantt-toggle:disabled { cursor:default; }
.gantt-name { flex:1; min-width:0; min-height:44px; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:4px; border:0; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.gantt-name strong { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
.gantt-row.task .gantt-name strong { font-weight:500; }
.gantt-name small { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:12px; }
.gantt-name:hover strong { color:var(--accent); }
.gantt-track { position:relative; z-index:1; flex:none; width:calc(var(--days) * var(--px)); }
.gantt-bar { position:absolute; top:10px; height:30px; min-width:8px; padding:0 8px; display:flex; align-items:center; overflow:hidden; border:0; border-radius:9px; background:#2864dc; color:#fff; font:inherit; font-size:12px; font-weight:550; text-align:left; white-space:nowrap; cursor:pointer; }
.gantt-bar span { overflow:hidden; text-overflow:ellipsis; }
.gantt-bar.task { top:12px; height:20px; border-radius:7px; font-size:11px; }
.gantt-bar.plain { background:#6b7889; }
.gantt-bar.active { background:#2864dc; }
.gantt-bar.done { background:#187654; }
.gantt-bar.late { background:#b7353b; }
.gantt-bar:hover { filter:brightness(1.1); }
.gantt-after { position:absolute; top:10px; line-height:30px; color:var(--text); font-size:12px; font-weight:550; white-space:nowrap; pointer-events:none; }
.gantt-after.task { top:12px; line-height:20px; font-size:11px; font-weight:500; }
@media (max-width:900px) { .project-form { grid-template-columns:1fr; } }
@media (max-width:760px) { .gantt { --label:150px; } .gantt-name small { display:none; } .task-view-controls { width:100%; } .view-tabs { max-width:100%; overflow-x:auto; } }

/* Inbox: importance and the client behind a card. */
.ws-client { display:flex; flex-direction:column; gap:12px; padding:16px 18px; border-radius:18px; background:var(--surface-soft); }
.ws-client .ws-label { margin:0; }
.ws-client-name { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.ws-client-name strong { font-size:17px; }
.ws-client .ws-facts { grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); }
.ws-bad { color:var(--red); }
.ws-good { color:var(--green); }
.ws-warn { color:var(--amber); }
.ws-quiet { margin-top:12px; border-top:1px solid var(--line); }
.ws-quiet > summary { display:flex; align-items:center; min-height:48px; padding:0 12px; color:var(--muted); font-weight:550; cursor:pointer; list-style:none; }
.ws-quiet > summary::-webkit-details-marker { display:none; }
.ws-quiet > summary::before { content:"›"; width:18px; transition:transform .15s; }
.ws-quiet[open] > summary::before { transform:rotate(90deg); }
.ws-quiet-tools { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 12px; padding:0 8px 8px 12px; }
.ws-quiet-note { margin:10px 4px 0; }
.ws-tags { display:inline-flex; align-items:center; gap:8px; }

/* Reply assistant. */
.ws-assist { display:flex; flex-direction:column; gap:12px; padding:16px 18px; border-radius:18px; border:1px dashed var(--line-strong); }
.ws-assist .ws-label { margin:0; display:flex; align-items:center; gap:8px; }
.ws-assist textarea { width:100%; min-height:120px; padding:12px 14px; border:1px solid var(--line-strong); border-radius:14px; background:var(--surface); color:var(--text); font:inherit; line-height:1.5; resize:vertical; }
.ws-draft-label { font-weight:550; }
.ws-sent { display:inline-flex; align-items:center; min-height:44px; font-weight:600; }
.ws-client-name .ws-btn { align-self:flex-start; margin-top:6px; }
.ws-later input[type=datetime-local], .ws-rule-form input { width:100%; min-height:44px; padding:10px 14px; border:1px solid var(--line-strong); border-radius:14px; background:var(--surface); color:var(--text); font:inherit; }
.ws-later textarea, .ws-rule-form textarea { width:100%; padding:12px 14px; border:1px solid var(--line-strong); border-radius:14px; background:var(--surface); color:var(--text); font:inherit; line-height:1.5; resize:vertical; }
.ws-later { display:flex; flex-direction:column; gap:12px; padding:16px 18px; border-radius:18px; border:1px dashed var(--line-strong); }
.ws-later .ws-label { margin:0; }
.ws-later-list { margin:0; }
.ws-auto { margin:0 0 20px; padding:16px 20px; border:1px solid var(--line); border-radius:20px; background:var(--surface); }
.ws-auto summary { cursor:pointer; font-weight:550; min-height:44px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ws-auto-body { display:flex; flex-direction:column; gap:14px; padding-top:8px; }
.ws-rules { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.ws-rule { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; padding:12px 14px; border-radius:14px; background:var(--surface-soft); }
.ws-rule.is-off { opacity:.6; }
.ws-rule-form { display:flex; flex-direction:column; gap:10px; }
.ws-assist-off { margin:0; padding:12px 14px; border-radius:14px; background:var(--surface-soft); }
}

/* Project history and scope tabs. */
.project-history > summary { display:flex; align-items:center; min-height:44px; cursor:pointer; font-size:17px; font-weight:600; list-style:none; }
.project-history > summary::-webkit-details-marker { display:none; }
.project-history > summary::before { content:"›"; display:inline-block; width:18px; color:var(--muted); transition:transform .15s; }
.project-history[open] > summary::before { transform:rotate(90deg); }
.project-log-row { display:flex; flex-direction:column; gap:2px; padding:10px 4px; border-top:1px solid var(--line); }
.project-log-head { color:var(--muted); font-size:12px; }
.project-log-text { color:var(--text); font-size:14px; overflow-wrap:anywhere; }
.plans-tab[hidden] { display:none; }

/* ---- Аналитика: страница из окон ------------------------------------------------------------------------------------------------ */
.analytics-page { --aw-surface:#fff; --aw-line:#e6e2da; --aw-soft:#f6f4ef; --aw-focus:#7166ca; }
html[data-theme="dark"] .analytics-page { --aw-surface:#313844; --aw-line:#454e5a; --aw-soft:#2c333d; --aw-focus:#9a8fe6; }

.aw-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px 18px; margin:0 0 16px; }
.aw-bar-period { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; min-width:0; }
.aw-bar-actions { display:flex; align-items:center; gap:8px; margin-left:auto; }
.aw-bar .analytics-period { flex-wrap:wrap; }
.aw-bar .analytics-period > button, .aw-bar .aw-custom-wrap > button { white-space:nowrap; }
.aw-bar .aw-custom-wrap > button { min-height:36px; padding:6px 14px; border:0; border-radius:10px; background:transparent; color:var(--analytics-muted); font:inherit; font-size:13px; font-weight:550; cursor:pointer; }
.aw-bar .aw-custom-wrap > button:hover { color:var(--analytics-ink); }
.aw-bar .aw-custom-wrap > button.is-active { background:#fff; color:var(--analytics-ink); box-shadow:0 2px 8px rgba(39,43,59,.1); }
.aw-period-nav strong { min-width:190px; font-size:13px; text-transform:none; }
.aw-menu-wrap, .aw-custom-wrap { position:relative; display:inline-block; }

.aw-add { display:inline-flex; align-items:center; gap:7px; min-height:42px; padding:8px 18px; border:1px solid var(--aw-focus); border-radius:13px; background:var(--aw-focus); color:#fff; font:inherit; font-size:14px; font-weight:600; cursor:pointer; transition:filter 140ms ease; }
.aw-add:hover { filter:brightness(1.08); }
.aw-more { width:40px; height:40px; display:inline-grid; place-items:center; padding:0; border:1px solid var(--analytics-line); border-radius:12px; background:transparent; color:var(--analytics-muted); cursor:pointer; }
.aw-more:hover, .aw-more[aria-expanded="true"] { background:rgba(113,102,202,.1); color:var(--analytics-ink); }
.aw-more svg, .aw-grip svg { fill:currentColor; }

.aw-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:14px; align-items:stretch; margin-bottom:24px; }
.aw { position:relative; min-width:0; display:flex; flex-direction:column; border-radius:23px; background:var(--aw-surface); box-shadow:0 1px 2px rgba(39,43,59,.04); }
.aw-third { grid-column:span 2; }
.aw-half { grid-column:span 3; }
.aw-twothirds { grid-column:span 4; }
.aw-full { grid-column:span 6; }
.aw-head { display:flex; align-items:center; gap:10px; min-height:58px; padding:12px 14px 4px 10px; }
.aw-title { flex:0 1 auto; min-width:0; margin:0; overflow:hidden; font-size:17px; font-weight:660; letter-spacing:-.02em; text-overflow:ellipsis; white-space:nowrap; }
.aw-scope { flex:1 1 auto; min-width:0; overflow:hidden; color:var(--analytics-muted); font-size:12.5px; text-overflow:ellipsis; white-space:nowrap; }
.aw-head .aw-menu-wrap { margin-left:auto; }
.aw-grip { width:34px; height:36px; display:inline-grid; place-items:center; flex:0 0 auto; padding:0; border:0; border-radius:10px; background:transparent; color:var(--analytics-muted); cursor:grab; opacity:.7; touch-action:none; }
.aw-grip:hover, .aw-grip:focus-visible { background:rgba(113,102,202,.1); color:var(--analytics-ink); opacity:1; }
.aw-grip:active { cursor:grabbing; }
.aw .aw-more { width:36px; height:36px; border-color:transparent; }
.aw-body { min-width:0; flex:1; padding:6px 22px 20px; }
.aw-body > section, .aw-body > div > section { margin:0; padding:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.aw-body .analytics-section-heading h3, .aw-body .analytics-section-heading .analytics-section-kicker { display:none; }
.aw-body .analytics-section-heading { margin-bottom:8px; }
.aw-body .analytics-plan-section, .aw-body .analytics-table-section, .aw-body .analytics-calendar-section { padding:0; border:0; background:transparent; box-shadow:none; }
.aw-body .analytics-metrics { margin-bottom:0; }
.aw-body .analytics-settings { margin:0; }
.aw-unit { display:block; margin:0 0 6px; text-align:right; }

/* the main numbers keep their coloured tiles: the window is the tile */
.aw.is-tile { background:transparent; box-shadow:none; }
.aw.is-tile .aw-body { padding:0; }
.aw.is-tile .analytics-kpi-tile { height:100%; min-height:206px; }
.aw-mini { position:absolute; z-index:3; top:8px; right:8px; display:flex; align-items:center; gap:2px; }
.aw-mini .aw-grip, .aw-mini .aw-more { width:32px; height:32px; background:rgba(255,255,255,.55); }
.aw-mini .aw-grip:hover, .aw-mini .aw-more:hover { background:rgba(255,255,255,.9); }
html[data-theme="dark"] .aw-mini .aw-grip, html[data-theme="dark"] .aw-mini .aw-more { background:rgba(0,0,0,.22); color:#e8eaf0; }
.aw.is-tile .analytics-kpi-label { max-width:calc(100% - 96px); }
.aw-kpi > .analytics-empty { padding:18px; border-radius:22px; background:var(--aw-surface); }
.aw-signals { margin:0; }

/* figures and charts of the period */
.aw-figures { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px 22px; margin-bottom:14px; }
.aw-figure { display:grid; gap:3px; min-width:0; }
.aw-figure > span { color:var(--analytics-muted); font-size:13px; }
.aw-figure > strong { font-size:clamp(20px,1.9vw,27px); font-weight:700; letter-spacing:-.035em; font-variant-numeric:tabular-nums; white-space:nowrap; }
.aw-figure > small { color:var(--analytics-muted); font-size:12px; line-height:1.4; }
.aw-line svg { display:block; width:100%; height:auto; overflow:visible; }
.aw-note { margin-top:10px; }
.aw .analytics-chart-legend { justify-content:flex-start; flex-wrap:wrap; margin-top:12px; }
.aw .analytics-chart-legend b { color:var(--analytics-ink); font-variant-numeric:tabular-nums; }

/* menus */
.aw-menu { position:absolute; z-index:30; top:calc(100% + 6px); right:0; width:min(320px,86vw); display:grid; gap:2px; padding:10px; border:1px solid var(--aw-line); border-radius:18px; background:var(--aw-surface); box-shadow:0 18px 44px rgba(31,36,48,.2); }
.aw-add-menu { width:min(420px,92vw); max-height:min(70vh,560px); overflow-y:auto; }
.aw-menu > button, .aw-add-group > button { display:grid; gap:2px; width:100%; min-height:42px; padding:9px 12px; border:0; border-radius:11px; background:transparent; color:var(--analytics-ink); font:inherit; font-size:14px; font-weight:500; text-align:left; cursor:pointer; }
.aw-menu > button:hover:not(:disabled), .aw-add-group > button:hover { background:rgba(113,102,202,.12); }
.aw-menu > button:disabled { color:var(--analytics-muted); cursor:default; opacity:.55; }
.aw-add-group > button span { color:var(--analytics-muted); font-size:12.5px; font-weight:400; line-height:1.35; }
.aw-add-group { display:grid; gap:2px; }
.aw-menu-label { margin:6px 8px 4px; color:var(--analytics-muted); font-size:11.5px; font-weight:640; letter-spacing:.06em; text-transform:uppercase; }
.aw-menu-hint { margin:6px 8px 2px; color:var(--analytics-muted); font-size:12px; line-height:1.4; }
.aw-sizes { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; margin:0 0 6px; }
.aw-sizes button { min-height:40px; padding:6px 4px; border:1px solid var(--aw-line); border-radius:11px; background:transparent; color:var(--analytics-ink); font:inherit; font-size:12.5px; font-weight:550; cursor:pointer; }
.aw-sizes button.is-active { border-color:var(--aw-focus); background:rgba(113,102,202,.14); }
.aw-menu .aw-danger { color:#a02f26; }
html[data-theme="dark"] .aw-menu .aw-danger { color:#ffb4aa; }
.aw-custom { position:absolute; z-index:30; top:calc(100% + 6px); left:0; width:min(300px,86vw); display:grid; gap:10px; padding:14px; border:1px solid var(--aw-line); border-radius:18px; background:var(--aw-surface); box-shadow:0 18px 44px rgba(31,36,48,.2); }
.aw-custom label { display:grid; gap:4px; color:var(--analytics-muted); font-size:12px; font-weight:550; }
.aw-custom input { min-height:42px; padding:0 10px; border:1px solid var(--aw-line); border-radius:11px; background:transparent; color:var(--analytics-ink); font:inherit; font-size:14px; }
.aw-custom button { min-height:42px; border:0; border-radius:12px; background:var(--aw-focus); color:#fff; font:inherit; font-size:14px; font-weight:600; cursor:pointer; }
.aw-custom-error { margin:0; color:#a02f26; font-size:12.5px; }

/* arranging */
.aw.is-dragging { opacity:.45; }
.aw-ghost { position:fixed; z-index:80; max-width:min(320px,70vw); padding:10px 16px; border:1px solid var(--aw-focus); border-radius:14px; background:var(--aw-surface); box-shadow:0 14px 34px rgba(31,36,48,.28); color:var(--analytics-ink); font-size:14px; font-weight:600; overflow:hidden; pointer-events:none; text-overflow:ellipsis; transform:translate(14px,14px); white-space:nowrap; }
body.aw-dragging { cursor:grabbing; user-select:none; -webkit-user-select:none; }
body.aw-dragging * { cursor:grabbing !important; }
.aw-grip { user-select:none; -webkit-user-select:none; }
.aw.is-drop-before::before, .aw.is-drop-after::after { content:""; position:absolute; z-index:5; border-radius:3px; background:var(--aw-focus); }
.aw.is-drop-before::before { top:-8px; bottom:-8px; left:-8px; width:4px; }
.aw.is-drop-after::after { top:-8px; bottom:-8px; right:-8px; width:4px; }
.aw-full.is-drop-before::before, .aw-full.is-drop-after::after { left:-8px; right:-8px; width:auto; height:4px; }
.aw-full.is-drop-before::before { top:-8px; bottom:auto; }
.aw-full.is-drop-after::after { top:auto; bottom:-8px; }
.aw.is-new { animation:aw-new 1.6s ease-out 1; }
@keyframes aw-new { 0% { box-shadow:0 0 0 3px var(--aw-focus); } 100% { box-shadow:0 0 0 0 rgba(113,102,202,0); } }
.aw-empty { grid-column:1 / -1; padding:48px 20px; border-radius:23px; background:var(--aw-surface); color:var(--analytics-muted); text-align:center; }
.aw-empty p { margin:4px 0; }
.analytics-att-bars span.is-period { outline:2px solid var(--aw-focus); outline-offset:1px; }
.aw button:focus-visible, .aw-bar button:focus-visible, .aw-menu button:focus-visible, .aw-custom input:focus-visible { outline:3px solid var(--aw-focus); outline-offset:2px; }

@media (max-width:1100px) {
  .aw-third { grid-column:span 3; }
  .aw-half, .aw-twothirds { grid-column:span 6; }
}
@media (max-width:700px) {
  .aw-third, .aw-half, .aw-twothirds, .aw-full { grid-column:span 6; }
  .aw-body { padding:4px 16px 16px; }
  .aw-period-nav strong { min-width:0; flex:1; }
  .aw-bar-actions { width:100%; justify-content:space-between; }
  .aw-menu { right:auto; left:0; }
}
@media (prefers-reduced-motion:reduce) { .aw.is-new { animation:none; box-shadow:0 0 0 3px var(--aw-focus); } .aw-add { transition:none; } }

/* The branch and the period stay at the top while the board is scrolled. */
.analytics-sticky { position: sticky; top: 8px; z-index: 30; flex-wrap: wrap; row-gap: 8px; background: rgba(255, 255, 255, 0.92); }
.analytics-sticky .aw-bar { flex: 1 1 auto; margin: 0; }
.analytics-sticky .analytics-branch-switch button { min-height: 34px; }
@media (max-width: 760px) { .analytics-sticky { position: static; } }
/* "How it is counted" and long lists are folded. */
.analytics-howto { margin: 10px 0 0; }
.analytics-howto summary, .analytics-list-toggle summary { cursor: pointer; }
.analytics-howto summary { display: inline-block; font-size: 12px; font-weight: 550; color: var(--analytics-muted); }
.analytics-howto p { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--analytics-muted); }
.analytics-list-toggle { margin: 10px 0 0; }
.analytics-list-toggle > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--aw-line, rgba(128, 128, 128, 0.35)); border-radius: 10px; font-size: 13px; font-weight: 550; list-style: none; }
.analytics-list-toggle > summary::-webkit-details-marker { display: none; }
.analytics-list-toggle > summary::before { content: ''; display: inline-block; vertical-align: -1px; margin-right: 2px; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--ic-right) center / contain no-repeat; mask: var(--ic-right) center / contain no-repeat; }
.analytics-list-toggle[open] > summary::before { -webkit-mask-image: var(--ic-down); mask-image: var(--ic-down); }
.analytics-list-toggle > summary span { padding: 1px 8px; border-radius: 999px; background: rgba(128, 128, 128, 0.18); font-size: 12px; }
.analytics-list-body { margin-top: 8px; }
.analytics-more { margin: 10px 0 0; min-height: 36px; padding: 6px 14px; border: 1px solid var(--aw-line, rgba(128, 128, 128, 0.35)); border-radius: 10px; background: transparent; font: inherit; font-size: 13px; font-weight: 550; color: inherit; cursor: pointer; }

/* The header: one row, plain vector icons, the surface of the windows in every theme. */
.analytics-toolbar.analytics-sticky, html[data-theme="dark"] .analytics-toolbar.analytics-sticky { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 7px 10px; border: 1px solid var(--aw-line); border-radius: 16px; background: var(--aw-surface); box-shadow: 0 6px 20px rgba(31, 36, 48, 0.08); backdrop-filter: none; -webkit-backdrop-filter: none; }
.analytics-sticky .analytics-branch-switch button { min-height: 30px; padding: 4px 12px; display: inline-flex; align-items: center; }
.analytics-sticky .aw-bar { flex: 1 1 auto; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 12px; margin: 0; }
.analytics-sticky .analytics-period button { min-height: 30px; padding: 4px 12px; display: inline-flex; align-items: center; }
.aw-period-nav { display: inline-flex; align-items: center; gap: 2px; }
.aw-bar-actions { display: inline-flex; align-items: center; gap: 4px; margin-left: 0; }
.aw-bar .aw-icon { width: 30px; height: 30px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--analytics-muted); cursor: pointer; }
.aw-bar .aw-icon:hover:not(:disabled), .aw-bar .aw-icon[aria-expanded="true"] { background: rgba(113, 102, 202, 0.16); color: var(--analytics-ink); }
.aw-bar .aw-icon:disabled { opacity: 0.35; cursor: default; }
.aw-bar .aw-icon svg, .aw-bar .aw-range svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aw-bar .aw-custom-wrap > button.aw-range { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--analytics-ink); font: inherit; font-size: 13px; font-weight: 550; line-height: 1; white-space: nowrap; cursor: pointer; box-shadow: none; }
.aw-bar .aw-custom-wrap > button.aw-range:hover, .aw-bar .aw-custom-wrap > button.aw-range.is-active { background: rgba(113, 102, 202, 0.16); color: var(--analytics-ink); box-shadow: none; }
.aw-bar .aw-icon.aw-add { background: var(--aw-focus); color: #fff; }
.aw-bar .aw-icon.aw-add:hover:not(:disabled) { background: var(--aw-focus); color: #fff; filter: brightness(1.1); }
.aw-bar .aw-icon.aw-board-more { width: 22px; opacity: 0.75; }
.aw-bar .aw-icon.aw-board-more:hover { opacity: 1; }
@media (max-width: 760px) { .analytics-sticky .aw-bar { justify-content: space-between; } }

/* Vector icons: the glyphs of web/icons.js inline in text, and the shapes behind the pseudo-element chevrons. */
svg.glyph { width: 1em; height: 1em; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; }
.inbox-status svg.glyph { width: 14px; height: 14px; vertical-align: -2px; }
:root {
  --ic-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%27M6 9l6 6l6 -6%27/%3E%3C/svg%3E");
  --ic-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%27M9 6l6 6l-6 6%27/%3E%3C/svg%3E");
  --ic-reply: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%27M9 14l-4 -4l4 -4%27/%3E%3Cpath d=%27M5 10h11a4 4 0 1 1 0 8h-1%27/%3E%3C/svg%3E");
  --ic-check-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d=%27M5 12l5 5l10 -10%27/%3E%3C/svg%3E");
}

/* The card of the user: positions and rights */
.user-positions .check-label { display: inline-flex; margin-right: 14px; }
.access-summary { display: grid; gap: 8px; margin: 8px 0; }
.access-summary h3 { margin: 6px 0 2px; font-size: 14px; }
.access-summary h4 { margin: 14px 0 2px; font-size: 12px; opacity: 0.75; }
.access-summary dl { margin: 0; display: grid; gap: 6px; }
.access-summary dt { font-weight: 550; font-size: 13px; }
.access-summary dd { margin: 0; font-size: 13px; line-height: 1.4; }
.access-summary summary { cursor: pointer; padding: 6px 0; font-size: 13px; font-weight: 550; }
.access-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; align-items: center; gap: 8px; padding: 6px 4px; border-top: 1px solid rgba(128, 128, 128, 0.2); font-size: 13px; }
.access-row.is-manual { background: rgba(214, 160, 0, 0.12); border-radius: 6px; }
.access-row select { width: 100%; }
.access-badge { font-size: 11px; font-weight: 550; margin-left: 6px; }
.access-journal { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }
.access-note { margin: 0; }
@media (max-width: 640px) { .access-row { grid-template-columns: 1fr; } }
.settings-readonly-note { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: rgba(214, 160, 0, 0.14); font-weight: 550; }
.access-acts { color: #1f6a3a; }

/* "View as an employee": a small bar at the bottom, over everything, not in the layout */
.view-as-bar { position: fixed; z-index: 100000; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 24px);
  padding: 10px 16px; border-radius: 12px; background: #7a3e00; color: #fff; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3); font-size: 14px; }
.view-as-bar .ws-btn { background: #fff; color: #7a3e00; border-color: #fff; }
@media (max-width: 640px) { .view-as-bar { flex-direction: column; align-items: stretch; text-align: center; } }
#dashboardBranches[hidden], .analytics-branch-switch[hidden] { display: none; }

/* users list: compact rows, search, one "add" button with two ways */
.users-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.users-searchbar { display: flex; align-items: center; gap: 14px; margin: 0 0 8px; }
.users-searchbar input[type=search] { flex: 0 1 420px; min-height: 40px; }
.users-add { position: relative; }
#userAddMenuButton::after { content: ""; display: inline-block; margin-left: 9px; border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; vertical-align: 2px; }
.users-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; min-width: 230px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); box-shadow: 0 14px 34px rgba(25, 38, 55, 0.16); }
.users-menu[hidden] { display: none; }
.users-menu button { justify-content: flex-start; min-height: 40px; border: 0; background: transparent; text-align: left; box-shadow: none; font-weight: 450; }
.users-menu button:hover, .users-menu button:focus-visible { background: var(--accent-soft); }
.users-count { margin: 0; white-space: nowrap; }
.users-list .user-row { gap: 12px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.users-list .user-row:hover { background: rgba(40, 100, 220, 0.045); }
.users-list .user-row.is-off { opacity: 0.62; }
.user-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.user-main { flex: 1 1 auto; min-width: 0; }
.user-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; line-height: 1.3; }
.user-head strong { margin-right: 4px; }
.user-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 500; white-space: nowrap; }
.user-chip.is-plain { background: rgba(38, 51, 67, 0.07); color: var(--muted); }
.user-chip.is-off { background: rgba(190, 60, 60, 0.12); color: #a63c3c; }
.user-sub { margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.users-list .user-row > button { min-height: 34px; padding: 4px 12px; }
@media (max-width: 760px) { .users-tools { justify-content: stretch; } .users-add { flex: 1 1 100%; } #userAddMenuButton { width: 100%; } .users-menu { left: 0; right: 0; } .users-searchbar { flex-wrap: wrap; } .users-searchbar input[type=search] { flex: 1 1 100%; } }

/* dialogs never scroll sideways: long names and lists wrap inside the card (a fieldset by default is as wide as its longest word) */
dialog { overflow-x: hidden; }
.dialog-card, .dialog-card fieldset, .dialog-card label { min-width: 0; max-width: 100%; }
.dialog-card .check-label { overflow-wrap: anywhere; }
.dialog-card fieldset { box-sizing: border-box; }
.dialog-card { grid-template-columns: minmax(0, 1fr); /* dialog-fit */ }

/* rules of the automation */
.rules-layout { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 18px; align-items: start; }
.rules-list { display: grid; gap: 8px; }
.rules-item { display: grid; gap: 4px; justify-items: start; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rules-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.rules-item small { color: var(--muted); }
.rules-editor { display: grid; gap: 12px; min-width: 0; }
.rules-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; justify-content: space-between; }
.rules-bar label { display: grid; gap: 4px; flex: 1 1 240px; }
.rules-lang { display: flex; gap: 6px; }
.rules-text { width: 100%; min-height: 220px; box-sizing: border-box; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; font: 14px/1.5 ui-monospace, Consolas, monospace; resize: vertical; white-space: pre; overflow: auto; }
.rules-error { color: #a63c3c; }
.rules-ok { color: var(--green); margin: 0; }
.rules-day { display: inline-flex; align-items: center; gap: 8px; }
.rules-mode { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.rules-versions { display: grid; gap: 4px; }
.rules-versions > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rules-template { display: grid; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rules-template-form { display: grid; gap: 10px; margin-top: 10px; }
.rules-template-form textarea { width: 100%; box-sizing: border-box; }
.rules-help { margin: 16px 0; }
.rules-help table { border-collapse: collapse; width: 100%; font-size: 13px; }
.rules-help td, .rules-help th { padding: 4px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
@media (max-width: 760px) { .rules-layout { grid-template-columns: 1fr; } }

/* Аналитика: единый формат окон (28.10.2026). Доска — ряды одной высоты (ряд = высота KPI-плитки); окно занимает 1, 2 или 3 ряда,
   соседи в ряду одной высоты, а содержимое, которое не помещается, прокручивается внутри окна. На телефоне окна идут одной колонкой
   по высоте содержимого: соседей нет, а прокрутка внутри прокрутки на телефоне мешает. */
.aw-grid { --aw-row: 214px; grid-auto-rows: var(--aw-row); }
.aw-grid > .aw-r1 { grid-row: span 1; }
.aw-grid > .aw-r2 { grid-row: span 2; }
.aw-grid > .aw-r3 { grid-row: span 3; }
.aw-grid > .aw { min-height: 0; }
.aw-grid > .aw > .aw-body { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.aw-grid > .aw.is-tile > .aw-body { overflow: hidden; }
.aw-grid > .aw.is-tile .analytics-kpi-tile { height: 100%; min-height: 0; }
.aw-grid > .aw.is-tile .aw-kpi { height: 100%; }
.aw-heights { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analytics-chat-grid { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.aw-figure > strong { font-size: clamp(19px, 1.7vw, 26px); }

/* имя в списке открывает карточку в «Людях» */
.aw-person { display: inline; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 30%, transparent); text-underline-offset: 3px; }
.aw-person:hover { color: var(--aw-focus); text-decoration-color: currentColor; }
.aw-person:focus-visible { outline: 2px solid var(--aw-focus); outline-offset: 2px; border-radius: 4px; }

/* «Показатели» | «План развития» */
.analytics-sections { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--aw-soft); }
.analytics-sections button { min-height: 30px; padding: 4px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--analytics-muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.analytics-sections button.is-active { background: var(--aw-surface); color: var(--analytics-ink); box-shadow: 0 1px 4px rgba(39, 43, 59, .14); }
.analytics-sections button:focus-visible { outline: 3px solid var(--aw-focus); outline-offset: 1px; }
.analytics-devplan-open { margin-top: 10px; }
.analytics-sections-row { display: flex; margin: 0 0 10px; }

/* «План развития» */
.dp { display: grid; gap: 14px; margin: 14px 0 24px; min-width: 0; }
.dp-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.dp-year { display: inline-flex; align-items: center; gap: 8px; }
.dp-year strong { font-size: 15px; }
.dp-year .aw-icon { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--aw-line); border-radius: 9px; background: var(--aw-surface); color: var(--analytics-ink); cursor: pointer; }
.dp-year .aw-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dp-year .aw-icon:disabled { opacity: .35; cursor: default; }
.dp-message { margin: 0; color: var(--analytics-muted); font-size: 13px; }
.dp-opened { margin: 0; color: var(--analytics-muted); font-size: 13px; line-height: 1.45; }
.dp-metrics { display: flex; flex-wrap: wrap; gap: 8px; }
.dp-metrics button { display: grid; gap: 2px; min-width: 132px; padding: 9px 14px; border: 1px solid var(--aw-line); border-radius: 12px; background: var(--aw-surface); color: var(--analytics-ink); font: inherit; text-align: left; cursor: pointer; }
.dp-metrics button span { font-size: 14px; font-weight: 600; }
.dp-metrics button small { color: var(--analytics-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dp-metrics button.is-active { border-color: var(--aw-focus); box-shadow: inset 0 0 0 1px var(--aw-focus); }
.dp-metrics button:focus-visible, .dp button:focus-visible, .dp input:focus-visible { outline: 3px solid var(--aw-focus); outline-offset: 2px; }
.dp-card { min-width: 0; padding: 18px 22px 20px; border-radius: 23px; background: var(--aw-surface); }
.dp-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 20px; margin-bottom: 14px; }
.dp-card-head h3 { margin: 0; font-size: 20px; }
.dp-growth { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; max-width: 660px; margin: 0; }
.dp-growth label { display: grid; gap: 4px; color: var(--analytics-muted); font-size: 12px; font-weight: 550; }
.dp-growth input { width: 110px; min-height: 40px; padding: 0 10px; border: 1px solid var(--aw-line); border-radius: 10px; background: transparent; color: var(--analytics-ink); font: inherit; font-size: 16px; font-weight: 600; }
.dp-growth p { margin: 0; }
.dp-growth p > span { color: var(--analytics-muted); font-size: 13px; }
.dp-growth p > strong { margin-left: 8px; font-size: 22px; font-variant-numeric: tabular-nums; }
.dp-hint { flex-basis: 100%; color: var(--analytics-muted); font-size: 12.5px; line-height: 1.45; }
.dp-growth-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.dp-figures { margin-bottom: 6px; }
.dp-scroll { margin-top: 12px; }
.dp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.dp-table th, .dp-table td { padding: 7px 10px; border-bottom: 1px solid var(--analytics-line); text-align: right; white-space: nowrap; vertical-align: middle; }
.dp-table th:first-child { text-align: left; }
.dp-table tbody th { font-weight: 550; text-transform: capitalize; }
.dp-table thead th { color: var(--analytics-muted); font-size: 12px; font-weight: 600; }
.dp-table td small { display: block; color: var(--analytics-muted); font-size: 11px; }
.dp-table tfoot th, .dp-table tfoot td { border-bottom: 0; font-weight: 700; }
.dp-table tr.is-running > * { background: color-mix(in srgb, var(--aw-focus) 7%, transparent); }
.dp-table .is-up { color: #2f7a4c; }
.dp-table .is-down { color: #9a5a12; }
html[data-theme="dark"] .dp-table .is-up { color: #8fd3a8; }
html[data-theme="dark"] .dp-table .is-down { color: #f0b37a; }
.dp-plan-edit { display: inline-flex; align-items: center; gap: 4px; }
.dp-input { width: 118px; min-height: 34px; padding: 0 8px; border: 1px solid var(--aw-line); border-radius: 8px; background: transparent; color: var(--analytics-ink); font: inherit; text-align: right; }
.dp-input.is-manual { border-color: var(--aw-focus); font-weight: 600; }
.dp-reset { width: 28px; height: 28px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--analytics-muted); cursor: pointer; }
.dp-reset:hover { background: color-mix(in srgb, var(--aw-focus) 14%, transparent); color: var(--analytics-ink); }
.dp-reset svg { width: 14px; height: 14px; }

@media (max-width: 700px) {
  .aw-grid { grid-auto-rows: auto; }
  .aw-grid > .aw { grid-row: auto; }
  .aw-grid > .aw > .aw-body { overflow: visible; }
  .aw-grid > .aw.is-tile .analytics-kpi-tile { min-height: 150px; }
  .aw-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
  .aw-figure > strong { font-size: 20px; white-space: normal; overflow-wrap: anywhere; }
  .analytics-sections-row .analytics-sections { width: 100%; }
  .analytics-sections-row .analytics-sections button { flex: 1; }
  .dp-card { padding: 14px 12px 16px; border-radius: 18px; }
  .dp-metrics button { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .dp-table { font-size: 12px; }
  .dp-table th, .dp-table td { padding: 6px 4px; }
  .dp-table thead th { font-size: 11px; }
  .dp-input { width: 78px; padding: 0 5px; }
  .dp-reset { width: 22px; }
}
@media (max-width: 480px) {
  .dp-table tr > :last-child { display: none; }   /* «К плану»: on a phone the plan and the fact stay, the ratio is in «Выполнено» */
  .dp-table { font-size: 11.5px; letter-spacing: -.01em; }
  .dp-table th, .dp-table td { padding: 6px 3px; }
  .dp-input { width: 70px; padding: 0 4px; }
  .aw-head { flex-wrap: wrap; row-gap: 0; }
  .aw-head .aw-title { flex: 1 1 auto; }
  .aw-head .aw-scope { order: 3; flex: 1 0 100%; padding-left: 44px; }
  .analytics-chart-wrap { overflow-x: visible; }
  .analytics-chart-wrap svg, .analytics-chart-labels { min-width: 0; }
  .analytics-chart-labels span:nth-child(even) { visibility: hidden; }
}

/* the tab «Деньги»: the windows are as tall as their content */
.aw-grid.aw-v3 { grid-auto-rows: auto; }
.aw-grid.aw-v3 > .aw { grid-row: auto; }
.aw-grid.aw-v3 > .aw > .aw-body { overflow: visible; }
/* Прототип v2 (29.10.2026, на одобрение): карточки как в Метрике и страница отчёта по клику на заголовок. */
.analytics-page { --mc-prev: color-mix(in srgb, var(--analytics-muted) 45%, transparent); --mc-good: #1f9d55; --mc-bad: #d23b3b; }
html[data-theme="dark"] .analytics-page { --mc-good: #5fd08f; --mc-bad: #ff7b72; }
/* the card: as tall as its content (the long lists live in the reports), the neighbours in a row stretch to the tallest */
.aw-grid { grid-auto-rows: auto; }
.aw-grid > .aw { grid-row: auto; }
.aw-grid > .aw > .aw-body { overflow: visible; }
.aw-grid > .aw.is-tile .analytics-kpi-tile { min-height: 190px; }
/* the card: a plain title, ⓘ, no notes */
.aw { border-radius: 20px; }
.aw-head { min-height: 52px; padding: 14px 14px 2px 10px; }
.aw-title-wrap { position: relative; display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.aw-title { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.aw-title-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.aw-title-link svg { width: 14px; height: 14px; fill: none; stroke: var(--analytics-muted); stroke-width: 1.8; opacity: 0; transition: opacity 140ms ease; }
.aw-title-link:hover, .aw-title-link:focus-visible { color: var(--aw-focus); }
.aw-title-link:hover svg, .aw-title-link:focus-visible svg { opacity: 1; }
.aw-info { flex: 0 0 18px; box-sizing: border-box; min-width: 0; min-height: 0; width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--aw-line); border-radius: 50%; background: transparent; color: var(--analytics-muted); font: 500 11px/1 Georgia, serif; font-style: italic; cursor: pointer; opacity: .7; }
.aw-info:hover, .aw-info:focus-visible { opacity: 1; color: var(--analytics-ink); }
.aw-info-pop { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: min(340px, 80vw); padding: 10px 12px; border: 1px solid var(--aw-line); border-radius: 12px; background: var(--aw-surface); box-shadow: 0 12px 30px rgba(31, 36, 48, .18); color: var(--analytics-ink); font-size: 12.5px; font-weight: 400; line-height: 1.5; white-space: normal; }
.aw-warn { width: 18px; height: 18px; display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, #d9a400 22%, transparent); color: #8a6a00; font-size: 11px; font-weight: 700; cursor: help; }
html[data-theme="dark"] .aw-warn { color: #f2cf66; }
.aw .analytics-howto, .aw .aw-note { display: none; }
.aw-body { padding: 4px 22px 18px; }
/* the figures: a grey label, a big plain number with its change; the chosen one is drawn */
.mc-figures { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 6px; border: 0; border-radius: 0; overflow: visible; }
.mc-figure { display: grid; gap: 2px; min-width: 0; min-height: 0; padding: 6px 10px 8px 6px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; text-align: left; }
button.mc-figure { cursor: pointer; }
button.mc-figure:hover { background: var(--aw-soft); }
.mc-figure > span { display: inline-flex; align-items: center; gap: 6px; color: var(--analytics-muted); font-size: 13px; white-space: nowrap; }
.mc-figure > strong { display: inline-flex; align-items: baseline; gap: 8px; font-size: 24px; font-weight: 450; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mc-radio { width: 12px; height: 12px; border: 1.5px solid color-mix(in srgb, var(--analytics-muted) 60%, transparent); border-radius: 50%; }
.mc-figure.is-on .mc-radio { border: 3.5px solid var(--aw-focus); }
.mc-change { font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--analytics-muted); }
.mc-change.is-good { color: var(--mc-good); }
.mc-change.is-bad { color: var(--mc-bad); }
/* the chart */
.mc { position: relative; min-width: 0; margin: 2px 0 4px; }
.mc-svg svg { display: block; }
.mc-grid { stroke: color-mix(in srgb, var(--analytics-line) 80%, transparent); stroke-width: 1; }
.mc-grid.is-base { stroke: color-mix(in srgb, var(--analytics-muted) 35%, transparent); }
.mc-axis { fill: var(--analytics-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mc-weekend { fill: color-mix(in srgb, var(--analytics-muted) 6%, transparent); }
.mc-rev { fill: none; stroke: var(--aw-focus); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.mc-prev { fill: none; stroke: var(--mc-prev); stroke-width: 1.5; stroke-linejoin: round; }
.mc-last { fill: var(--aw-focus); }
.mc-cut-label { fill: var(--analytics-muted); font-size: 10.5px; font-weight: 500; }
.mc-hit { fill: transparent; cursor: crosshair; }
.mc-cursor { stroke: color-mix(in srgb, var(--analytics-muted) 45%, transparent); stroke-width: 1; }
.mc-dot { fill: var(--aw-surface); stroke: var(--aw-focus); stroke-width: 2; }
.mc-tip { position: absolute; top: 0; z-index: 5; display: grid; gap: 4px; min-width: 200px; padding: 8px 10px; border: 1px solid var(--aw-line); border-radius: 10px; background: var(--aw-surface); box-shadow: 0 8px 24px rgba(31, 36, 48, .16); color: var(--analytics-ink); font-size: 12px; pointer-events: none; }
.mc-tip strong { font-size: 12px; font-weight: 500; }
.mc-tip div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.mc-tip b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mc-tip i { width: 10px; height: 2px; border-radius: 1px; }
.mc-tip i.is-prev { background: var(--mc-prev); }
/* the legend and the short lists: a colour, a name on the left, the value on the right */
.mc-list { display: grid; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; }
.mc-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 34px; font-size: 14px; }
.mc-list li > i { width: 12px; height: 12px; border-radius: 3px; }
.mc-list li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-list li > b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mc-list li > span:first-child { grid-column: 1 / 3; }
.mc-bars li { grid-template-columns: 1fr auto 40px; grid-template-rows: auto 4px; row-gap: 3px; min-height: 40px; }
.mc-bars li > span:first-child { grid-column: 1; }
.mc-bars li > em { grid-column: 1 / 3; grid-row: 2; height: 4px; border-radius: 2px; background: color-mix(in srgb, #c27ab0 60%, transparent); }
.mc-bars li > small { grid-column: 3; grid-row: 1; color: var(--analytics-muted); font-size: 12px; text-align: right; }
.mc-sub { margin: 10px 0 0; color: var(--analytics-muted); font-size: 12.5px; }
.mc-more { margin: 8px 0 0; padding: 0; border: 0; background: none; color: var(--aw-focus); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; }
.mc-more:hover { text-decoration: underline; }
/* the report */
.rp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 14px 0 24px; min-width: 0; }
.rp-head { display: flex; align-items: center; gap: 12px; }
.rp-head h2 { margin: 0; font-size: 28px; font-weight: 500; letter-spacing: -.02em; }
.rp-back { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px 4px 8px; border: 1px solid var(--aw-line); border-radius: 10px; background: var(--aw-surface); color: var(--analytics-muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.rp-back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.rp-back:hover { color: var(--analytics-ink); }
.rp-card { min-width: 0; padding: 16px 22px 18px; border-radius: 20px; background: var(--aw-surface); }
.rp-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.rp-select { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 4px 0 12px; border: 1px solid var(--aw-line); border-radius: 10px; color: var(--analytics-muted); font-size: 14px; }
.rp-select select { min-height: 36px; border: 0; background: transparent; color: var(--analytics-ink); font: inherit; font-weight: 500; cursor: pointer; }
.rp-bars li { font-size: 14px; }
.rp-table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rp-search { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--aw-line); border-radius: 10px; color: var(--analytics-muted); }
.rp-search svg { width: 16px; height: 16px; }
.rp-search input { width: min(260px, 52vw); border: 0; outline: 0; background: transparent; color: var(--analytics-ink); font: inherit; font-size: 14px; }
.rp-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--aw-soft); }
.rp-seg button { min-width: 36px; min-height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--analytics-muted); font: inherit; font-weight: 600; cursor: pointer; }
.rp-seg button.is-active { background: var(--aw-surface); color: var(--analytics-ink); box-shadow: 0 1px 3px rgba(39, 43, 59, .14); }
.rp-table-wrap { overflow-x: auto; margin: 0 -22px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rp-table th, .rp-table td { padding: 10px 14px; border-bottom: 1px solid var(--analytics-line); text-align: right; vertical-align: top; white-space: nowrap; }
.rp-table .is-text { text-align: left; white-space: normal; min-width: 120px; }
.rp-table th:first-child, .rp-table td:first-child { padding-left: 22px; }
.rp-table thead th { font-weight: 400; color: var(--analytics-muted); font-size: 13px; }
.rp-table thead button { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.rp-table thead th[aria-sort="ascending"] button, .rp-table thead th[aria-sort="descending"] button { color: var(--analytics-ink); }
.rp-table tbody th { font-weight: 400; }
.rp-table td small { display: block; margin-top: 2px; color: var(--analytics-muted); font-size: 11.5px; }
.rp-table tr.is-total > * { background: var(--aw-soft); font-weight: 500; }
.rp-none { color: var(--analytics-muted); text-align: center; }
.rp-note { margin: 0 4px; color: var(--analytics-muted); font-size: 12px; line-height: 1.5; }
@media (max-width: 700px) {
  .aw-body { padding: 4px 14px 14px; }
  .mc-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-figure > strong { font-size: 20px; flex-wrap: wrap; gap: 2px 6px; white-space: normal; }
  .rp-head h2 { font-size: 22px; }
  .rp-card { padding: 12px 14px 14px; }
  .rp-table-wrap { margin: 0 -14px; }
  .rp-table th:first-child, .rp-table td:first-child { padding-left: 14px; }
  .rp-table th, .rp-table td { padding: 8px 10px; font-size: 13px; }
}

/* v2.1: typography and details (the owner: «со шрифтами, дизайном надо что-то делать») */
.analytics-page { --mc-num: 500; }
.aw { border-radius: 18px; box-shadow: 0 1px 2px rgba(31, 36, 48, .04), 0 0 0 1px color-mix(in srgb, var(--aw-line) 60%, transparent); }
.aw-head { min-height: 50px; padding: 16px 16px 0 14px; gap: 6px; }
.aw-title { font-size: 16.5px; font-weight: 550; letter-spacing: -.01em; line-height: 1.25; }
.aw-title-wrap { gap: 4px; }
.aw-info { flex: 0 0 26px; width: 26px; height: 26px; min-width: 0; min-height: 0; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--analytics-muted); opacity: .75; }
.aw-info svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.aw-info:hover, .aw-info:focus-visible { opacity: 1; background: var(--aw-soft); color: var(--analytics-ink); }
.aw-warn { width: 16px; height: 16px; font-size: 10px; }
.aw-body { padding: 6px 24px 20px; }
.mc-figures { gap: 2px 4px; margin: 0 -6px 10px; }
.mc-figure { gap: 4px; padding: 8px 12px 10px 6px; }
.mc-figure > span { font-size: 12.5px; letter-spacing: .01em; }
.mc-figure > strong { gap: 8px; font-size: 24px; font-weight: var(--mc-num); letter-spacing: -.025em; line-height: 1.1; font-feature-settings: "tnum" 1, "lnum" 1; }
.mc-radio { width: 11px; height: 11px; border-width: 1.5px; }
.mc-figure.is-on .mc-radio { border-width: 3.5px; }
.mc-change { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 5px; border-radius: 6px; background: color-mix(in srgb, var(--analytics-muted) 10%, transparent); font-size: 12px; font-weight: 500; letter-spacing: 0; line-height: 1.3; }
.mc-change svg { width: 8px; height: 8px; fill: currentColor; }
.mc-change.is-good { background: color-mix(in srgb, var(--mc-good) 12%, transparent); }
.mc-change.is-bad { background: color-mix(in srgb, var(--mc-bad) 11%, transparent); }
.mc-axis { font-size: 11px; letter-spacing: .01em; }
.mc-grid { stroke: color-mix(in srgb, var(--analytics-line) 70%, transparent); }
.mc-list li { min-height: 32px; font-size: 13.5px; }
.mc-list li > i { width: 10px; height: 10px; border-radius: 3px; }
.mc-list li > b { font-weight: 500; font-feature-settings: "tnum" 1; }
.mc-legend-change .mc-change { margin-left: 6px; }
.mc-more { font-size: 13px; }
.rp-head h2 { font-size: 26px; font-weight: 550; letter-spacing: -.02em; }
.rp-card { border-radius: 18px; box-shadow: 0 1px 2px rgba(31, 36, 48, .04), 0 0 0 1px color-mix(in srgb, var(--aw-line) 60%, transparent); }
.rp-table { font-size: 13.5px; }
.rp-table thead th { font-size: 12.5px; letter-spacing: .01em; }
.rp-table tr.is-total > * { font-weight: 550; }
@media (max-width: 700px) {
  .mc-figure > strong { font-size: 19px; }
  .aw-body { padding: 4px 16px 16px; }
}
.aw-title-wrap { align-items: center; }
.aw-info svg { width: 16px; height: 16px; stroke-width: 1.75; }
.aw-warn { width: 26px; height: 26px; display: inline-grid; place-items: center; border-radius: 8px; background: none; color: #b07d00; }
.aw-warn svg { width: 16px; height: 16px; }
html[data-theme="dark"] .aw-warn { color: #e8c35a; background: none; }
/* v3: the other windows as cards — the lists and long tables live in their report («Подробнее» or the title) */
#awGrid .aw .analytics-list-toggle, #awGrid .aw .analytics-demand-people, #awGrid .aw .analytics-inactive, #awGrid .aw .analytics-profit-note,
#awGrid .aw .analytics-chat-weeks, #awGrid .aw .bots-period, #awGrid .aw .analytics-more, #awGrid .aw .analytics-cancel-late { display: none; }
#awGrid .aw .analytics-table-scroll tbody tr:nth-child(n+7), #awGrid .aw .analytics-recon-scroll tbody tr:nth-child(n+6) { display: none; }
#awGrid .aw .analytics-profit-table tbody tr.analytics-profit-total { display: table-row; }
#awGrid .aw .analytics-chat-col .analytics-recon-table { display: none; }
#awGrid .aw .analytics-groups-grid .analytics-audience ul { display: none; }
#awGrid .aw .analytics-churn-filters { display: none; }
#awGrid .aw[data-widget="profit"] .analytics-churn-filters { display: none; }
.aw-more-link { justify-self: start; margin: -6px 24px 18px; }
.rp.is-full .rp-whole { padding: 18px 24px 20px; }
.rp.is-full .rp-whole .analytics-section-heading h3, .rp.is-full .rp-whole .analytics-section-kicker { display: none; }
.rp.is-full .rp-whole .analytics-howto { display: block; }
.rp-head .aw-scope { color: var(--analytics-muted); font-size: 13px; }
@media (max-width: 700px) { .aw-more-link { margin: -4px 16px 14px; } .rp.is-full .rp-whole { padding: 12px 14px 14px; } }
