@font-face { font-family: "Noto Sans"; src: url("fonts/NotoSans-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Sans"; src: url("fonts/NotoSans-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --font-ui: "Noto Sans", "Segoe UI", Arial, sans-serif;
  --font-editorial: Georgia, "Times New Roman", serif;
  --canvas: #fff; --surface: #f7f7f5; --ink: #171713; --muted: #65645e;
  --rule: #d8d7d2; --action: #154bd8; --action-soft: #eef3ff;
  --exception: #c83a2a; --exception-soft: #fff2f0; --warning: #a45c00;
  --success: #16724a; --denied: #5a5861; --focus: #154bd8;
  --control-border: #8c8b85; --action-hover: #103cad;
  --success-soft: #edf8f3; --warning-soft: #fff7e8; --on-action: #fff;
  --radius-control: 6px; --radius-panel: 10px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #181915; --surface: #23241f; --ink: #f3f2ed; --muted: #b8b7b0;
  --rule: #4b4c45; --action: #89a9ff; --action-soft: #26365f;
  --exception: #ff9487; --exception-soft: #4b2925; --warning: #f2b766;
  --success: #78d7a6; --denied: #c0bec7; --focus: #b2c6ff;
  --control-border: #777970; --action-hover: #a8beff;
  --success-soft: #203d31; --warning-soft: #45351f; --on-action: #11130f;
}
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --canvas: #181915; --surface: #23241f; --ink: #f3f2ed; --muted: #b8b7b0;
    --rule: #4b4c45; --action: #89a9ff; --action-soft: #26365f;
    --exception: #ff9487; --exception-soft: #4b2925; --warning: #f2b766;
    --success: #78d7a6; --denied: #c0bec7; --focus: #b2c6ff;
    --control-border: #777970; --action-hover: #a8beff;
    --success-soft: #203d31; --warning-soft: #45351f; --on-action: #11130f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color: var(--ink); background: var(--canvas); font-family: var(--font-ui); }
body { margin: 0; min-width: 320px; overflow-x: hidden; }
button, input, select, textarea { color: inherit; font: inherit; }
input[type="checkbox"], input[type="radio"], progress { accent-color: var(--action); }
button, select { min-height: 44px; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 12px 16px; background: var(--ink); color: var(--canvas); }
.skip-link:focus { top: 12px; }
.product-mark { margin: 0 0 32px; font-weight: 700; letter-spacing: -.02em; }
.section-label { margin: 0 0 8px; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2 { font-family: var(--font-editorial); font-weight: 400; }
h1 { margin: 0; font-size: clamp(2rem, 3.2vw, 3.25rem); line-height: 1.02; }
h2 { font-size: 1.625rem; line-height: 1.14; }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid var(--rule); border-radius: var(--radius-control); background: var(--canvas); font-weight: 700; text-decoration: none; }
.button--primary { border-color: var(--action); color: var(--on-action); background: var(--action); }
.button--primary:hover { background: var(--action-hover); }
.button--danger { border-color: var(--exception); color: var(--exception); background: var(--canvas); }
.button--danger:hover { background: var(--exception-soft); }
.button--quiet:hover { background: var(--surface); }
.button:disabled { cursor: not-allowed; color: var(--denied); background: var(--surface); border-color: var(--rule); }
.icon-button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.5rem; }

.session-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.session-gate__content { width: min(560px, 100%); }
.session-gate h1 { margin-bottom: 20px; }
.session-gate p { color: var(--muted); line-height: 1.55; }
.session-form { display: grid; gap: 12px; margin-top: 28px; }
.demo-access { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--rule); }
.demo-access summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.offline-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px calc(32px + env(safe-area-inset-bottom)); background: var(--surface); }
.offline-panel { width: min(620px, 100%); padding: clamp(28px, 6vw, 56px); border: 1px solid var(--rule); border-top: 5px solid var(--action); border-radius: var(--radius-panel); background: var(--canvas); box-shadow: 0 18px 54px rgba(23,23,19,.09); }
.offline-mark { display: block; margin-bottom: 32px; border-radius: 14px; }
.offline-panel h1 { margin-bottom: 20px; }
.offline-panel > p:not(.section-label) { max-width: 54ch; color: var(--muted); line-height: 1.6; }
.offline-note { margin: 24px 0; padding: 14px 16px; border-left: 4px solid var(--warning); background: var(--surface); }
label { font-size: .875rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--control-border); border-radius: var(--radius-control); background: var(--canvas); }
textarea { min-height: 112px; resize: vertical; }
.form-error, .field-error { min-height: 20px; margin: 4px 0 0; color: var(--exception); font-size: .8125rem; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(520px, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px; border-right: 1px solid var(--rule); background: var(--surface); }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { min-height: 44px; display: flex; align-items: center; width: 100%; padding: 0 12px; border: 0; border-left: 3px solid transparent; color: var(--ink); background: transparent; text-align: left; text-decoration: none; }
.nav-item:hover { background: var(--canvas); }
.nav-item--active { border-left-color: var(--action); background: var(--action-soft); font-weight: 700; }
.notification-badge { min-width: 24px; height: 24px; display: inline-grid; place-items: center; margin-left: auto; padding: 0 6px; border-radius: 12px; color: var(--on-action); background: var(--exception); font-size: .75rem; font-weight: 700; }
.session-tools { margin-top: auto; display: grid; gap: 8px; }
.session-tools p { margin: 0; font-weight: 700; }
.session-tools label { color: var(--muted); font-size: .75rem; }
.actor-roles { display: grid; gap: 3px; color: var(--muted); font-size: .75rem; line-height: 1.35; }
.workspace { min-width: 0; padding: 40px clamp(24px, 4vw, 64px) 72px; }
.workspace-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 32px; border-bottom: 1px solid var(--ink); }
.header-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.summary { margin: 14px 0 0; color: var(--muted); }
.view-switch { display: flex; gap: 4px; margin-top: 20px; }
.view-switch__button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--rule); background: var(--canvas); font-weight: 700; }
.view-switch__button:hover { background: var(--surface); }
.view-switch__button--active { border-color: var(--action); color: var(--action); background: var(--action-soft); }
.view-controls { display: flex; gap: 6px; overflow-x: auto; padding: 20px 0; scrollbar-width: thin; }
.view-controls select { flex: 0 0 auto; min-width: 150px; }
.filter-button { flex: 0 0 auto; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; }
.filter-button--active { border-bottom-color: var(--action); color: var(--action); font-weight: 700; }
.task-region h2 { margin: 20px 0 12px; font-family: var(--font-ui); font-size: 1.125rem; font-weight: 700; }
.task-list { border-top: 1px solid var(--rule); }
.task-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); }
.task-pagination p { margin: 0; }
.task-pagination .field-error { flex-basis: 100%; }
.task-detail--loading > :not(#task-detail-loading):not(#detail-team):not(#detail-title):not(.detail-close) { display: none; }
.task-row { width: 100%; min-height: 88px; display: grid; grid-template-columns: minmax(220px, 1fr) 130px 110px; gap: 16px; align-items: center; padding: 14px 8px; border: 0; border-bottom: 1px solid var(--rule); background: var(--canvas); text-align: left; }
:root[data-density="compact"] .task-row { min-height: 64px; padding-block: 8px; }
.task-row:hover { background: var(--surface); }
.task-row--selected { box-shadow: inset 3px 0 var(--action); background: var(--action-soft); }
.task-row--archived { opacity: .68; }
.task-row--archived:hover, .task-row--archived.task-row--selected { opacity: 1; }
.task-title { display: block; margin-bottom: 6px; font-weight: 700; }
.task-meta, .task-status { color: var(--muted); font-size: .8125rem; }
.task-status { color: var(--ink); font-weight: 700; }
.task-priority--critical { color: var(--exception); }
.task-priority--high { color: var(--warning); }
.task-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board-column { min-width: 0; border-top: 2px solid var(--ink); }
.board-column__header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-height: 50px; padding: 12px 4px 8px; }
.board-column__header h3 { margin: 0; font-family: var(--font-ui); font-size: .875rem; }
.board-column__header span { color: var(--muted); font-size: .75rem; font-weight: 700; }
.board-column__list { display: grid; gap: 8px; }
.board-card, .calendar-task { width: 100%; min-height: 64px; display: grid; gap: 5px; padding: 10px; border: 1px solid var(--rule); border-left: 3px solid var(--action); background: var(--canvas); text-align: left; }
.board-card:hover, .calendar-task:hover { background: var(--surface); }
.board-card__title, .calendar-task__title { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.board-card__meta, .calendar-task__meta { color: var(--muted); font-size: .6875rem; overflow-wrap: anywhere; }
.board-column__empty { margin: 0; padding: 12px 4px; color: var(--muted); font-size: .8125rem; }
.calendar-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; margin-bottom: 14px; }
.calendar-header h3 { margin: 0; text-align: center; font-family: var(--font-ui); font-size: 1rem; text-transform: capitalize; }
.calendar-header .button { min-width: 44px; padding-inline: 12px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays span { padding: 7px; border-bottom: 1px solid var(--ink); color: var(--muted); font-size: .6875rem; font-weight: 700; text-align: right; }
.calendar-day { min-width: 0; min-height: 112px; padding: 6px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.calendar-day:nth-child(7n + 1) { border-left: 1px solid var(--rule); }
.calendar-day--outside { background: var(--surface); }
.calendar-day__number { display: block; margin-bottom: 5px; color: var(--muted); font-size: .6875rem; font-weight: 700; text-align: right; }
.calendar-day__tasks { display: grid; gap: 4px; }
.calendar-task { min-height: 44px; padding: 5px; }
.calendar-task__title { font-size: .6875rem; }
.calendar-task__meta { font-size: .625rem; }
.calendar-unscheduled { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--ink); }
.calendar-unscheduled h3 { margin: 0 0 10px; font-family: var(--font-ui); font-size: .875rem; }
.calendar-unscheduled-list, #calendar-unscheduled-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.loading-state { min-height: 140px; padding: 24px 8px; color: var(--muted); }
.loading-line { display: block; height: 14px; width: 70%; margin-bottom: 14px; background: var(--surface); animation: pulse 1.4s ease-in-out infinite; }
.loading-line--short { width: 38%; }
@keyframes pulse { 50% { opacity: .45; } }
.state-panel { padding: 28px 0; border-top: 1px solid var(--rule); }
.state-panel h3, .state-panel h2 { margin: 0 0 8px; }
.state-panel p { max-width: 560px; color: var(--muted); line-height: 1.5; }
.state-panel--denied { border-top-color: var(--denied); }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 14px 16px; border-left: 4px solid var(--action); background: var(--action-soft); }
.notice strong, .notice p { display: block; margin: 0; }
.notice p { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.notice--error { border-left-color: var(--exception); background: var(--exception-soft); }
.notice--success { border-left-color: var(--success); background: var(--success-soft); }
.notice--denied { border-left-color: var(--denied); background: var(--surface); }
.notice--warning { border-left-color: var(--warning); background: var(--warning-soft); }
#telegram-content-panel { align-items: flex-start; }

.task-detail { position: fixed; z-index: 20; top: 0; right: 0; width: 400px; height: 100vh; overflow-y: auto; padding: 60px 32px 32px; border-left: 1px solid var(--rule); background: var(--canvas); box-shadow: -12px 0 32px rgba(23,23,19,.08); }
.detail-close { position: absolute; top: 12px; right: 12px; }
.task-detail h2 { margin: 0 0 28px; }
.task-metadata { margin: 0; }
.task-metadata div { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.task-metadata dt { color: var(--muted); font-size: .8125rem; }
.task-metadata dd { margin: 0; }
.task-actions { display: grid; gap: 10px; margin-top: 28px; }
.task-actions__hint { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.45; }

.task-watchers { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--ink); }
.task-watchers__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.task-watchers__header h3 { margin: 0; font-size: 1rem; }
.task-watchers__header span { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.watcher-list { display: grid; gap: 2px; margin: 14px 0 0; padding: 0; list-style: none; }
.watcher-item { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--rule); }
.watcher-item__name { min-width: 0; overflow-wrap: anywhere; }
.watcher-item button { min-width: 44px; min-height: 44px; padding: 4px 8px; border: 0; background: transparent; font-size: .75rem; }
.watcher-item button:hover { background: var(--surface); }
.watcher-empty, .watcher-candidates-empty { margin: 14px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.4; }
.watcher-add { display: grid; gap: 7px; margin-top: 16px; }
.watcher-add > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.watcher-add .button { padding-inline: 12px; }
.watcher-permission { margin-top: 16px; font-size: .8125rem; line-height: 1.4; }

.task-checklist { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--ink); }
.task-checklist__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.task-checklist__header h3 { margin: 0; font-size: 1rem; }
.task-checklist__header span { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.checklist-list { display: grid; gap: 2px; margin: 14px 0 0; padding: 0; list-style: none; }
.checklist-item { display: block; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.checklist-toggle { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; min-width: 0; font-weight: 400; }
.checklist-toggle input { width: 20px; min-height: 20px; height: 20px; margin: 0 12px; accent-color: var(--action); }
.checklist-item--completed .checklist-item__text { color: var(--muted); text-decoration: line-through; }
.checklist-item__text { align-self: center; overflow-wrap: anywhere; }
.checklist-item__meta { display: block; margin-top: 3px; color: var(--muted); font-size: .6875rem; }
.checklist-item__actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 2px; margin-left: 44px; }
.checklist-item__actions button { min-width: 44px; min-height: 44px; padding: 4px 8px; border: 0; background: transparent; font-size: .75rem; }
.checklist-item__actions button:hover { background: var(--surface); }
.checklist-item__actions button:disabled { cursor: not-allowed; color: #aaa; }
.checklist-empty { margin: 14px 0 0; color: var(--muted); font-size: .875rem; }
.checklist-add { display: grid; gap: 7px; margin-top: 16px; }
.checklist-add > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.checklist-add .button { padding-inline: 12px; }
.checklist-permission { margin-top: 16px; font-size: .8125rem; line-height: 1.4; }

.task-files { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--ink); }
.task-files__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.task-files__header h3 { margin: 0; font-size: 1rem; }
.task-files__header span { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.file-list { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.file-item { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.file-item > div { min-width: 0; display: grid; gap: 3px; }
.file-item strong { overflow-wrap: anywhere; font-size: .875rem; }
.file-item div span { color: var(--muted); font-size: .75rem; }
.file-state { max-width: 144px; color: var(--muted); font-size: .6875rem; line-height: 1.35; text-align: right; }
.file-state--scan_failed, .file-state--rejected { color: var(--exception); }
.file-empty { margin: 14px 0 0; color: var(--muted); font-size: .875rem; }
.file-resume { margin-top: 14px; padding: 10px 12px; border-left: 4px solid var(--warning); background: var(--surface); }
.file-resume p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.file-resume p + p { margin-top: 6px; }
.file-upload { display: grid; gap: 8px; margin-top: 16px; }
.file-upload p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.file-upload progress { width: 100%; height: 12px; accent-color: var(--action); }
.file-upload .button { justify-self: start; }
.file-permission { margin-top: 16px; font-size: .8125rem; line-height: 1.4; }

.task-comments { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--ink); }
.task-comments__header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.task-comments__header h3 { margin: 0; font-size: 1rem; }
.task-comments__header span { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.comment-list { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.comment-item { min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.comment-item__header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.comment-item__author { font-size: .8125rem; font-weight: 700; }
.comment-item__time { flex: 0 0 auto; color: var(--muted); font-size: .6875rem; }
.comment-item__context { display: block; margin-top: 3px; color: var(--muted); font-size: .6875rem; }
.comment-item__body { margin: 8px 0 0; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-item--hidden .comment-item__body { color: var(--muted); font-style: italic; }
.comment-item__actions { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; }
.comment-item__actions button { min-width: 44px; min-height: 44px; padding: 4px 8px; border: 0; background: transparent; font-size: .75rem; }
.comment-item__actions button:hover { background: var(--surface); }
.comment-empty { margin: 14px 0 0; color: var(--muted); font-size: .875rem; }
.comment-add { display: grid; gap: 7px; margin-top: 16px; }
.comment-add textarea { min-height: 88px; }
.comment-add .button { justify-self: start; }
.comment-permission { margin-top: 16px; font-size: .8125rem; line-height: 1.4; }

.notification-panel { position: fixed; z-index: 25; top: 0; right: 0; width: 400px; height: 100vh; overflow-y: auto; padding: 60px 32px 32px; border-left: 1px solid var(--rule); background: var(--canvas); box-shadow: -12px 0 32px rgba(23,23,19,.12); }
.audit-panel { position: fixed; z-index: 26; top: 0; right: 0; width: 480px; height: 100vh; overflow-y: auto; padding: 60px 32px 32px; border-left: 1px solid var(--rule); background: var(--canvas); box-shadow: -12px 0 32px rgba(23,23,19,.12); }
.monitoring-panel, .analytics-panel, .timeline-panel { position: fixed; z-index: 27; top: 0; right: 0; width: 520px; height: 100vh; overflow-y: auto; padding: 60px 32px 32px; border-left: 1px solid var(--rule); background: var(--canvas); box-shadow: -12px 0 32px rgba(23,23,19,.12); }
.people-admin-panel { position: fixed; z-index: 28; top: 0; right: 0; width: 620px; height: 100vh; overflow-y: auto; padding: 60px 32px 32px; border-left: 1px solid var(--rule); background: var(--canvas); box-shadow: -12px 0 32px rgba(23,23,19,.12); }
.people-admin-panel h2 { margin: 0 0 12px; }
.people-admin-proof { display: grid; gap: 7px; margin: 18px 0; padding: 16px; background: var(--surface); }
.people-admin-proof > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.people-admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.people-team-form { display: grid; gap: 7px; margin: 0 0 20px; padding: 16px; border: 1px solid var(--rule); }
.people-team-form h3 { margin: 0 0 4px; }
.people-team-form textarea, #people-admin-reason { min-height: 72px; }
.people-admin-feedback { margin: 12px 0; padding: 10px 12px; border-left: 4px solid var(--success); background: var(--surface); }
.people-admin-list { display: grid; gap: 12px; margin-top: 18px; }
.people-card { padding: 16px; border: 1px solid var(--rule); border-radius: var(--radius-control); }
.people-card--blocked { border-left: 4px solid var(--exception); }
.people-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.people-card h3 { margin: 0; font-size: 1rem; }
.people-card__identity { margin: 3px 0 12px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.people-card__status { flex: 0 0 auto; color: var(--muted); font-size: .6875rem; font-weight: 700; }
.people-card__actions { display: grid; gap: 8px; margin: 10px 0; }
.people-card__actions-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
.people-memberships { display: grid; gap: 10px; margin-top: 14px; }
.people-membership { padding-top: 10px; border-top: 1px solid var(--rule); }
.people-membership__label { margin: 0 0 7px; font-size: .8125rem; font-weight: 700; }
.people-membership__controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
.people-replace-responsible { display: flex; align-items: center; gap: 8px; margin: 7px 0 0; font-size: .75rem; }
.people-replace-responsible input { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; margin: 0; }
.monitoring-panel h2 { margin: 0 0 12px; }
.monitoring-overall { margin: 0; padding: 12px 14px; border-left: 4px solid var(--warning); background: var(--surface); line-height: 1.45; }
.monitoring-overall--healthy { border-left-color: var(--success); }
.monitoring-overall--unavailable { border-left-color: var(--exception); }
.monitoring-generated { margin: 8px 0 24px; color: var(--muted); font-size: .75rem; }
.monitoring-list { display: grid; gap: 12px; }
.monitoring-card { padding: 16px; border: 1px solid var(--rule); border-left: 4px solid var(--warning); border-radius: var(--radius-control); }
.monitoring-card--healthy { border-left-color: var(--success); }
.monitoring-card--unavailable { border-left-color: var(--exception); }
.monitoring-card__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.monitoring-card h3 { margin: 2px 0 8px; font-size: 1rem; }
.monitoring-card > p { margin: 0 0 14px; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.monitoring-status { flex: 0 0 auto; padding: 4px 7px; border: 1px solid currentColor; border-radius: 4px; color: var(--warning); font-size: .6875rem; font-weight: 700; }
.monitoring-status--healthy { color: var(--success); }
.monitoring-status--unavailable { color: var(--exception); }
.monitoring-metrics { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 14px; margin: 0; font-size: .75rem; }
.monitoring-metrics dt { color: var(--muted); }
.monitoring-metrics dd { margin: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.monitoring-email-action { width: 100%; margin-top: 18px; }
.analytics-panel h2 { margin: 0 0 12px; }
.analytics-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 24px 0; padding-block: 16px; border-block: 1px solid var(--rule); }
.analytics-filters label { color: var(--muted); font-size: .75rem; }
.analytics-filters select { min-width: 0; }
.analytics-filters .button { grid-column: 1 / -1; justify-self: end; }
.analytics-snapshot { color: var(--muted); font-size: .75rem; }
.analytics-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--ink); }
.analytics-metrics div { min-width: 0; padding: 14px 10px; border-bottom: 1px solid var(--rule); }
.analytics-metrics dt { color: var(--muted); font-size: .75rem; }
.analytics-metrics dd { margin: 4px 0 0; font: 700 1.375rem/1.2 var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.analytics-section { margin-top: 26px; }
.analytics-section h3, .analytics-export h3 { margin: 0 0 10px; }
.analytics-attention-row { width: 100%; min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 9px 0; text-align: left; border-bottom: 1px solid var(--rule); }
.analytics-attention-row span { color: var(--muted); font-size: .75rem; }
.analytics-trend { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.analytics-trend div { min-width: 0; padding: 8px; background: var(--canvas); }
.analytics-trend time, .analytics-trend span { display: block; color: var(--muted); font-size: .6875rem; }
.analytics-trend strong { display: block; margin-block: 4px; }
.analytics-definitions { margin-top: 24px; border-block: 1px solid var(--rule); }
.analytics-definitions summary { padding-block: 12px; font-weight: 700; cursor: pointer; }
.analytics-definitions dl { margin: 0 0 14px; }
.analytics-definitions dt { margin-top: 10px; font-weight: 700; }
.analytics-definitions dd { margin: 3px 0 0; color: var(--muted); font-size: .8125rem; }
.analytics-export { display: grid; gap: 9px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--ink); }
.analytics-export p { margin: 0; }
.analytics-export .button { justify-self: start; }
.timeline-panel h2 { margin: 0 0 12px; }
.timeline-list { margin: 24px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.timeline-item { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 14px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.timeline-item time { grid-row: span 2; color: var(--muted); font-size: .75rem; }
.timeline-item span { color: var(--muted); font-size: .8125rem; }
.email-admin-dialog { width: min(640px, calc(100% - 32px)); }
.email-admin-content { max-height: calc(100vh - 34px); overflow-y: auto; padding: 24px; }
.email-admin-dialog .dialog-heading h2 { margin-bottom: 12px; }
.email-admin-dialog form { padding: 0; }
.email-admin-form { display: grid; gap: 9px; margin-top: 18px; padding-top: 18px !important; border-top: 1px solid var(--rule); }
.email-admin-form h3 { margin: 0; }
.email-admin-form > p, .email-config-form fieldset > p { margin: 0 0 8px; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.email-config-form fieldset { min-width: 0; display: grid; gap: 9px; margin: 0; padding: 0; border: 0; }
.email-config-form legend { margin-bottom: 8px; padding: 0; font-weight: 700; }
.email-config-form fieldset:disabled { opacity: .62; }
.email-admin-feedback { margin: 10px 0 0; padding: 12px; border-left: 4px solid var(--success); background: var(--surface); line-height: 1.45; }
.email-admin-actions { flex-wrap: wrap; }
.audit-panel h2 { margin: 0 0 12px; }
.audit-integrity { margin: 0 0 24px; padding: 12px 14px; border-left: 4px solid var(--warning); background: var(--surface); }
.audit-integrity--ok { border-left-color: var(--success); }
.audit-integrity--broken { border-left-color: var(--exception); color: var(--exception); }
.audit-list { border-top: 1px solid var(--rule); }
.audit-item { display: grid; gap: 5px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.audit-item span { font-size: .8125rem; overflow-wrap: anywhere; }
.audit-item small { color: var(--muted); font-size: .6875rem; }
.audit-empty { color: var(--muted); }
.notification-panel h2 { margin: 0 0 8px; }
.notification-summary { margin: 0 0 24px; color: var(--muted); }
.notification-list { border-top: 1px solid var(--rule); }
.notification-item { width: 100%; min-height: 96px; display: grid; gap: 6px; padding: 14px 12px; border: 0; border-bottom: 1px solid var(--rule); background: var(--canvas); text-align: left; }
.notification-item:hover { background: var(--surface); }
.notification-item--unread { box-shadow: inset 3px 0 var(--action); background: var(--action-soft); }
.notification-item__title { font-weight: 700; }
.notification-item__event { color: var(--ink); font-size: .875rem; }
.notification-item__meta { color: var(--muted); font-size: .75rem; }
.notification-error { padding: 16px 0; border-top: 1px solid var(--exception); }
.notification-error p { margin: 0 0 12px; color: var(--exception); line-height: 1.45; }

.task-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--rule); border-radius: var(--radius-panel); box-shadow: 0 20px 60px rgba(23,23,19,.18); }
.task-dialog { color: var(--ink); background: var(--canvas); }
.task-dialog::backdrop { background: rgba(23,23,19,.44); }
.task-dialog form { display: grid; gap: 9px; padding: 24px; }
.form-field { display: grid; gap: 9px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; }
.dialog-heading .icon-button { flex: 0 0 44px; }
.dialog-heading h2, .task-dialog--reason h2 { margin: 0 0 16px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.permission-note { margin: 0 0 8px; padding: 12px; color: var(--denied); background: var(--surface); }
.mobile-nav { display: none; }

.preference-dialog { width: min(620px, calc(100% - 32px)); }
.preference-content { max-height: calc(100vh - 34px); overflow-y: auto; padding: 24px; }
.preference-content > p { color: var(--muted); line-height: 1.5; }
.preference-form { display: grid; gap: 9px; margin-top: 20px; }
.preference-check { min-height: 56px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 8px; }
.preference-check input { width: 24px; height: 24px; min-height: 24px; justify-self: center; }
.preference-check span { display: grid; gap: 3px; }
.preference-check small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.shortcut-help { margin-top: 8px; padding-block: 8px; border-block: 1px solid var(--rule); }
.shortcut-help summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.shortcut-help dl { display: grid; gap: 8px; margin: 10px 0; }
.shortcut-help dl div { display: grid; grid-template-columns: 108px minmax(0, 1fr); align-items: center; gap: 10px; }
.shortcut-help dt, .shortcut-help dd { margin: 0; }
.shortcut-help kbd { display: inline-grid; min-width: 30px; min-height: 30px; place-items: center; padding: 3px 7px; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); font: 700 .75rem/1 var(--font-ui); }
.shortcut-help p { color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.preference-feedback { margin: 8px 0 0; padding: 10px 12px; border-left: 4px solid var(--success); background: var(--success-soft); }
.preference-actions { flex-wrap: wrap; }

.offboarding-dialog { width: min(680px, calc(100% - 32px)); }
.offboarding-content { max-height: calc(100vh - 34px); overflow-y: auto; padding: 24px; }
.offboarding-content > p { color: var(--muted); line-height: 1.5; }
.offboarding-form { display: grid; gap: 10px; margin-top: 18px; }
.offboarding-target { margin: 0; font-weight: 700; }
.offboarding-teams { display: grid; gap: 10px; }
.offboarding-team { padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius-control); }
.offboarding-team h3 { margin: 0 0 6px; font: 700 .9375rem/1.3 var(--font-ui); }
.offboarding-team p { margin: 0 0 10px; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.offboarding-team label { display: grid; gap: 6px; margin-top: 9px; }
.offboarding-confirm { min-height: 56px; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; }
.offboarding-confirm input { width: 24px; height: 24px; min-height: 24px; justify-self: center; }
.offboarding-status { margin: 8px 0 0; padding: 12px; border-left: 4px solid var(--warning); background: var(--warning-soft); }
.offboarding-status--success { border-left-color: var(--success); background: var(--success-soft); }
.offboarding-actions { flex-wrap: wrap; }

.privileged-recovery-dialog { width: min(700px, calc(100% - 32px)); }
.privileged-recovery-content { max-height: calc(100vh - 34px); overflow-y: auto; padding: 24px; }
.privileged-recovery-content > p { color: var(--muted); line-height: 1.5; }
.privileged-recovery-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--rule); }
.privileged-recovery-section h3 { margin: 0 0 10px; }
.privileged-recovery-card { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.privileged-recovery-card p { margin: 3px 0; color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.privileged-recovery-card .button { margin-top: 8px; }
.privileged-recovery-action { display: grid; gap: 9px; margin-top: 22px; padding: 16px; border: 1px solid var(--rule); }
.privileged-recovery-action h3, .privileged-recovery-action p { margin: 0; }
.privileged-recovery-feedback { margin: 16px 0 0; padding: 12px; border-left: 4px solid var(--success); background: var(--success-soft); }
.privileged-recovery-actions { flex-wrap: wrap; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 420px) minmax(0, 1fr); }
.auth-aside { padding: 36px; background: var(--surface); border-right: 1px solid var(--rule); }
.auth-aside p:last-child { color: var(--muted); line-height: 1.55; }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-panel { width: min(560px, 100%); }
.auth-panel h1 { margin-bottom: 16px; }
.auth-panel > p { color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 10px; margin-top: 28px; }
.auth-form .button { margin-top: 10px; }
.auth-panel summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.auth-code { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0; padding: 14px 16px; background: var(--surface); border-left: 4px solid var(--action); }
.auth-code code { font-family: "Noto Sans Mono", monospace; font-size: 1rem; overflow-wrap: anywhere; }
.auth-recovery-material { display: grid; gap: 16px; }
.auth-recovery-codes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 0; padding: 16px 16px 16px 40px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-muted); overflow-wrap: anywhere; }
.auth-recovery-codes code { font-family: "Noto Sans Mono", monospace; font-size: .88rem; }
.auth-steps { margin: 24px 0; padding: 0; list-style: none; counter-reset: auth-step; }
.auth-steps li { counter-increment: auth-step; padding: 10px 0 10px 40px; position: relative; border-bottom: 1px solid var(--rule); }
.auth-steps li::before { content: counter(auth-step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 50%; }
.auth-secondary { margin-top: 18px; }
.auth-help-link { display: inline-flex; min-height: 44px; align-items: center; margin-top: 16px; color: var(--action); font-weight: 700; }
.auth-help-link--adjacent { margin-top: 0; }
.auth-proof-choice { display: grid; gap: 8px; margin: 8px 0; }
.auth-proof-choice label { min-height: 44px; display: flex; align-items: center; gap: 10px; }
.auth-proof-choice input { width: 24px; height: 24px; flex: 0 0 24px; }

@media (min-width: 1180px) {
  .app-shell:has(.task-detail:not([hidden])) { grid-template-columns: 224px minmax(520px, 1fr) 400px; }
  .app-shell:has(.task-detail:not([hidden])) .task-detail { position: sticky; grid-column: 3; box-shadow: none; }
}

@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { padding: 24px 20px calc(96px + env(safe-area-inset-bottom)); }
  .workspace-header { align-items: center; }
  .workspace-header .button { display: none; }
  .task-row { grid-template-columns: minmax(0, 1fr) auto; }
  .task-row > :last-child { display: none; }
  .task-board { grid-template-columns: 1fr; }
  .board-column { border-top-width: 1px; }
  .calendar-weekdays { display: none; }
  .calendar-grid { display: block; }
  .calendar-day { min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule); }
  .calendar-day--empty, .calendar-day--outside { display: none; }
  .calendar-day__number { margin: 0; text-align: left; }
  #calendar-unscheduled-list { grid-template-columns: 1fr; }
  .task-detail { width: min(100%, 430px); padding: 56px 20px calc(96px + env(safe-area-inset-bottom)); }
  .notification-panel { width: min(100%, 430px); padding: 56px 20px calc(96px + env(safe-area-inset-bottom)); }
  .audit-panel { width: min(100%, 430px); padding: 56px 20px calc(96px + env(safe-area-inset-bottom)); }
  .monitoring-panel, .analytics-panel, .timeline-panel { width: min(100%, 430px); padding: 56px 20px calc(96px + env(safe-area-inset-bottom)); }
  .people-admin-panel { width: min(100%, 430px); padding: 56px 20px calc(96px + env(safe-area-inset-bottom)); }
  .people-admin-proof > div, .people-card__actions-row, .people-membership__controls { grid-template-columns: 1fr; }
  .people-admin-proof .button, .people-card__actions-row .button, .people-membership__controls .button { width: 100%; }
  .mobile-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--rule); background: var(--canvas); }
  .mobile-nav button { position: relative; min-width: 0; padding: 6px 2px; border: 0; background: var(--canvas); font-size: .625rem; overflow-wrap: anywhere; }
  .mobile-nav .notification-badge { position: absolute; top: 0; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; font-size: .625rem; }
  .mobile-nav .mobile-create { color: var(--on-action); background: var(--action); border-radius: 6px; font-weight: 700; }
  .auth-page { display: block; }
  .auth-aside { padding: 20px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .auth-aside p:last-child { margin-bottom: 0; }
  .auth-main { display: block; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); }
}

@media (max-width: 430px) {
  #telegram-content-panel { align-items: stretch; flex-direction: column; }
  #telegram-content-panel .button { width: 100%; }
  .workspace-header { padding-bottom: 24px; }
  .summary { font-size: .875rem; }
  .task-row { min-height: 92px; padding-inline: 4px; }
  .view-controls { flex-wrap: wrap; overflow: visible; }
  .task-dialog { width: 100%; max-width: 100%; max-height: calc(100vh - 12px); margin: auto 0 0; border-radius: 10px 10px 0 0; }
  .task-dialog form { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .dialog-actions { position: sticky; bottom: 0; margin-inline: -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); background: var(--canvas); }
  .preference-content { max-height: calc(100vh - 12px); padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .preference-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .offboarding-content { max-height: calc(100vh - 12px); padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .offboarding-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .privileged-recovery-content { max-height: calc(100vh - 12px); padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .privileged-recovery-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .analytics-filters, .analytics-metrics { grid-template-columns: 1fr; }
  .analytics-filters .button { grid-column: auto; width: 100%; }
  .timeline-item { grid-template-columns: 1fr; }
  .timeline-item time { grid-row: auto; }
  #recurrence-dialog .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; margin-inline: 0; padding-inline: 0; }
  #recurrence-dialog .dialog-actions button[type="submit"] { grid-column: 1 / -1; width: 100%; }
  .email-admin-content { max-height: calc(100vh - 12px); padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
  .email-admin-actions { margin-inline: -20px; }
  .file-item { grid-template-columns: 1fr; }
  .file-state { max-width: none; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; scroll-behavior: auto !important; }
}
