@layer interface {
/* Общие стили */
* {box-sizing:border-box}
html {scroll-behavior:smooth}
body {margin:0;min-width:0;font-size:15px;line-height:1.55}
.form-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;align-items:end}
.app-shell {display:grid;grid-template-columns:204px minmax(0,1fr);min-height:100dvh;max-width:1920px;margin:auto}
.sidebar {position:sticky;top:0;height:100dvh;display:flex;flex-direction:column;padding:32px 18px 23px;background:var(--forest);color:var(--paper);z-index:45;isolation:isolate}
.sidebar:after {content:'';position:absolute;left:34px;top:133px;bottom:150px;border-left:1px solid #cfdfc733;z-index:-1}
.sidebar>.hint {color:#cfdbce;font-size:11px;line-height:1.6;margin:14px 0 0;max-width:145px}
.sidebar-foot {margin-top:auto;padding:22px 5px 0;color:#d1decf;border-top:1px solid #a6c0a73d;font-size:12px}
.sidebar-foot .hint {color:#c1d0c0;font-size:12px}
.sidebar-foot .section-title {margin:0 0 8px;color:var(--paper);font-weight:600}
.sidebar-foot .button {color:var(--paper);padding:10px 0;font-size:12px;text-align:left;justify-content:flex-start}
.sidebar-foot .button:hover {background:transparent;text-decoration:underline}
.main {min-width:0;padding:0 32px 36px}
.topbar {position:sticky;top:0;z-index:35;display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:78px;padding:16px 0;background:var(--bg);border-bottom:1px solid var(--line)}
.topbar-label {display:flex;align-items:baseline;gap:12px;font-size:13px;font-weight:600;min-width:0}
.topbar-label .eyebrow {font-size:9px;margin:0;white-space:nowrap}
.topbar-actions {display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.topbar-actions .button {min-height:42px;padding:10px 14px;font-size:12px}
.main>footer {margin-top:26px;padding:18px 0 0;border-top:1px solid var(--line);font-size:11px}
.notes-accordion>.field,.notes-accordion>.hint,.notes-accordion>textarea,.notes-accordion>.panel,.questions-accordion>.question-row,.questions-accordion>.field,.profile-group>.field,.profile-group>.form-grid,.profile-group>form,.helper-explanation>p {margin:18px 22px}
.table-scroll {max-width:100%;overflow-x:auto;margin:18px 0;border:1px solid var(--line);border-radius:8px;overscroll-behavior-inline:contain}
.modal {width:760px;max-width:calc(100vw - 28px);max-height:90dvh;margin:auto;border:1px solid #b5c7a8;border-radius:8px;padding:0;color:var(--ink);background:var(--paper);box-shadow:none}
.modal[open] {display:flex;flex-direction:column}
.modal::backdrop,.modal-backdrop {background:#14382e9c;backdrop-filter:blur(4px)}
.modal-head {padding:24px 26px 18px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;gap:14px;flex:0 0 auto}
.modal-head h2 {margin:0;font-size:27px}
.modal-body {padding:25px 26px;overflow-y:auto;min-height:0;overscroll-behavior:contain;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#7f9488 transparent;transition:none}
.modal-body[data-scroll-state="start"] {box-shadow:inset 0 -22px 18px -22px #315f50aa}
.modal-body[data-scroll-state="middle"] {box-shadow:inset 0 22px 18px -22px #315f50aa,inset 0 -22px 18px -22px #315f50aa}
.modal-body[data-scroll-state="end"] {box-shadow:inset 0 22px 18px -22px #315f50aa}
.modal-actions {padding:17px 0 0;border-top:1px solid var(--line);display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:20px;flex:0 0 auto}
@media(min-width:1600px) {
.main {padding-left:52px;padding-right:52px}
}
@media(max-width:1200px) {
.app-shell {grid-template-columns:188px minmax(0,1fr)}
.sidebar {padding:29px 15px 22px}
.main {padding:0 25px 32px}
}
@media(max-width:950px) {
.app-shell {grid-template-columns:170px minmax(0,1fr)}
.sidebar {padding:26px 11px 20px}
.main {padding:0 21px 30px}
.topbar {gap:12px;align-items:flex-start;flex-direction:column;padding:14px 0;min-height:75px}
.topbar-actions {width:100%}
.topbar-label {gap:11px}
}
@media(max-width:650px) {
body {font-size:14px}
.app-shell {display:block}
.sidebar {position:sticky;top:0;height:auto;display:block;padding:13px 15px 8px;border:0;box-shadow:none}
.sidebar:after,.sidebar>.hint,.sidebar-foot {display:none}
.sidebar>.brand {font-size:33px;letter-spacing:-2px}
.main {padding:0 14px 26px}
.topbar {position:static;padding:14px 0;gap:11px;border-bottom-color:#c5d1bb}
.topbar-label {font-size:12px;gap:12px}
.topbar-label .eyebrow {font-size:8px}
.topbar-actions {gap:6px;flex-wrap:nowrap}
.topbar-actions .button {font-size:11px;padding:9px 11px;min-height:41px}
.form-grid {grid-template-columns:1fr;gap:15px}
.notes-accordion>.field,.notes-accordion>.hint,.notes-accordion>textarea,.notes-accordion>.panel,.questions-accordion>.question-row,.questions-accordion>.field,.profile-group>.field,.profile-group>.form-grid,.profile-group>form {margin:17px 18px}
.table-scroll {margin:15px -1px}
.modal {max-height:92dvh;border-radius:8px}
.modal-head {padding:21px 20px 16px}
.modal-head h2 {font-size:24px}
.modal-body {padding:21px 20px}
.modal-actions {padding-top:16px}
.modal-actions .button {flex:1}
}
@media(max-width:380px) {
.main {padding-left:12px;padding-right:12px}
.sidebar {padding-left:13px;padding-right:13px}
.topbar-actions .button {font-size:10px;padding:9px}
.topbar-actions {gap:5px}
}
.sidebar {background:#173f36}
.sidebar:after {display:none}
.main {padding-top:0}
.topbar {border-bottom-color:#c6cebf}
.conflict,.helper-window,.diff-after,.preview-panel,.table-scroll,.ritm-markdown pre {border-radius:6px}
.modal {border-radius:8px;box-shadow:none}
.modal-head h2 {font-weight:550}
@media(max-width:650px) {
.modal {border-radius:7px}
.sidebar {box-shadow:none;border-bottom:1px solid #315448}
}
@media(max-width:650px) {
.sidebar {display:flex;flex-direction:row;align-items:center;gap:13px;width:100%;max-width:100%;min-width:0;padding:10px 12px}
.sidebar>.brand {font-size:29px;letter-spacing:-2px;flex:0 0 auto}
.sidebar>.nav {min-width:0;width:0;max-width:100%;flex:1 1 0%;overflow-x:auto;overflow-y:hidden;margin:0;padding:3px 1px 5px;justify-content:flex-start}
.sidebar>.nav .nav-item {min-height:40px;width:auto;max-width:none;flex:0 0 auto}
.topbar-label {display:none}
.topbar {padding:13px 0;min-height:66px}
.topbar-actions {margin:0}
}
.boot-shell {display:grid;grid-template-columns:204px minmax(0,1fr);min-height:100dvh;max-width:1920px;margin:auto;background:var(--bg)}
body:has(.no-script-panel) .boot-shell {display:none}
@media(max-width:650px) {
.boot-shell {display:block}
}
@media(max-width:650px) {
.modal {max-width:calc(100vw - max(28px,calc(env(safe-area-inset-left) + env(safe-area-inset-right) + 16px)));max-height:min(92dvh,calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px))}
.modal-head {padding-top:max(16px,calc(env(safe-area-inset-top) + 8px));padding-right:max(20px,calc(env(safe-area-inset-right) + 16px));padding-left:max(20px,calc(env(safe-area-inset-left) + 16px))}
.modal-body {padding-right:max(20px,calc(env(safe-area-inset-right) + 16px));padding-bottom:max(24px,calc(env(safe-area-inset-bottom) + 16px));padding-left:max(20px,calc(env(safe-area-inset-left) + 16px));scroll-padding-block:18px max(28px,calc(env(safe-area-inset-bottom) + 20px))}
}

/* Цвет и типографика */
html[data-theme] body { background: transparent; }
html[data-theme] .app-shell { max-width: 1920px; background: transparent; }
html[data-theme] .sidebar {
  background: #050607e8;
  border-right: 1px solid #ffffff14;
  backdrop-filter: blur(24px);
  color: #f3f4f6;
}
html[data-theme] .sidebar > .hint,
html[data-theme] .sidebar-foot,
html[data-theme] .sidebar-foot .hint { color: #9bA1ad; }
html[data-theme] .sidebar-foot { border-color: #ffffff1a; }
html[data-theme] .sidebar-foot .section-title,
html[data-theme] .sidebar-foot .button,
html[data-theme] .brand { color: #f3f4f6; }
html[data-theme] .main { background: transparent; }
html[data-theme] .topbar {
  background: var(--topbar-surface, var(--bg));
  border-color: #ffffff1a;
  backdrop-filter: blur(24px);
}
html[data-theme] .topbar-label { color: #dfe3eb; }
html[data-theme] .topbar-label .eyebrow { color: #7f8795; }
html[data-theme] .sidebar { color: #f3f4f6; background: #05080de8; border-right: 1px solid #ffffff1c; backdrop-filter: blur(24px); }
html[data-theme] .sidebar > .hint { color: #a4afbf; }
html[data-theme] .sidebar-foot { color: #a8b4c6; border-color: #ffffff20; }
html[data-theme] .sidebar-foot .section-title { color: #d4deec; }
html[data-theme] .sidebar-foot .hint { color: #929fb2; }
html[data-theme] .sidebar-foot .button { color: #c2d2e8; }
html[data-theme] .main > footer { color: #929aa8; border-color: #ffffff1a; }
html[data-theme] .modal { background: #10151e; color: #f3f4f6; border-color: #657086; box-shadow: 0 30px 140px #000b; }
html[data-theme] .modal::backdrop,
html[data-theme] .modal-backdrop { background: #000b; backdrop-filter: blur(12px); }
html[data-theme] .modal-head { background: #141c28; border-color: #374355; }
html[data-theme] .modal-actions { border-color: #374355; }
html[data-theme] .modal-body { scrollbar-color: #8fa7c7 #10151e; }
html[data-theme] .modal-body[data-scroll-state="start"] { box-shadow: inset 0 -24px 20px -22px #91bfff8f; }
html[data-theme] .modal-body[data-scroll-state="middle"] { box-shadow: inset 0 24px 20px -22px #91bfff73, inset 0 -24px 20px -22px #91bfff8f; }
html[data-theme] .modal-body[data-scroll-state="end"] { box-shadow: inset 0 24px 20px -22px #91bfff73; }
html[data-theme] .boot-shell { background: #05070c; }
@media(max-width:650px) {
html[data-theme] .sidebar { background: #050607ed; border-bottom: 1px solid #ffffff20; border-right: 0; }
html[data-theme] .topbar { backdrop-filter: none; }
html[data-theme] .topbar-actions { flex-wrap: wrap; gap: 7px; }
html[data-theme] .topbar-actions .motion-toggle { margin-left: auto; min-height: 40px; }
}

/* Движение */
html[data-theme][data-ambient-motion="on"] .sidebar { view-transition-name: none; }
html[data-theme][data-ambient-motion="on"] .modal[open] { animation: ritm-dialog-in 500ms var(--motion-ease) both; }
html[data-theme][data-ambient-motion="on"] .modal[open]::backdrop { animation: ritm-backdrop-in 350ms ease both; }

/* Читаемость */
html[data-theme] body { font-size: 15px; line-height: 1.65; }
html[data-theme] .topbar-actions { align-items: center; flex-wrap: wrap; }
html[data-theme] .topbar-actions .button { font-size: 11px; padding: 10px 13px; }
html[data-theme] .topbar-actions .action-hint { font-size: 9px; }
html[data-theme] .table-scroll,
html[data-theme] .task-table-scroll {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: min(75vh,760px);
  overflow: auto;
  overscroll-behavior-inline: contain;
  margin: 14px 0 24px;
  border: 1px solid #7185a1;
  border-radius: 10px;
  background: #101824;
  box-shadow: 0 10px 35px #0002;
  scrollbar-color: #8298b8 #152132;
  scrollbar-width: auto;
}
html[data-theme] .table-scroll table,
html[data-theme] .task-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.7;
  color: #e7eefb;
  background: #101824;
}
html[data-theme] .table-scroll :is(th,td),
html[data-theme] .task-table :is(th,td) {
  padding: 15px 18px;
  text-align: left;
  vertical-align: top;
  border: 0;
  border-right: 1px solid #455874;
  border-bottom: 1px solid #4c607d;
  min-width: 130px;
  max-width: 440px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: inherit;
}
html[data-theme] .table-scroll th,
html[data-theme] .task-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #f5f8ff;
  background: #2d4667;
  border-bottom: 2px solid #9fbee7;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.55;
  letter-spacing: .015em;
}
html[data-theme] .table-scroll tbody tr:nth-child(odd) > *,
html[data-theme] .task-table tbody tr:nth-child(odd) > * { background: #111c2b; }
html[data-theme] .table-scroll tbody tr:nth-child(even) > *,
html[data-theme] .task-table tbody tr:nth-child(even) > * { background: #1b2a3e; }
html[data-theme] .table-scroll tbody tr:is(:hover,:focus-within) > *,
html[data-theme] .task-table tbody tr:is(:hover,:focus-within) > * { background: #2a405d; }
html[data-theme] .table-scroll tr > :last-child,
html[data-theme] .task-table tr > :last-child { border-right: 0; }
html[data-theme] .table-scroll tbody tr:last-child > *,
html[data-theme] .task-table tbody tr:last-child > * { border-bottom: 0; }
html[data-theme] .table-scroll :is(td,th) :is(strong,b),
html[data-theme] .task-title { color: #fff; font-weight: 700; }
html[data-theme] .table-scroll td a { color: #c3ddff; text-decoration-thickness: 1px; text-underline-offset: 3px; }
html[data-theme] .table-scroll td:first-child { font-variant-numeric: tabular-nums; font-weight: 650; }
@media (max-width:1050px) {
html[data-theme] .topbar-actions { gap: 7px; }
}
@media (max-width:650px) {
html[data-theme] body { font-size: 14px; line-height: 1.7; }
html[data-theme] .topbar-actions { flex-wrap: wrap; width: 100%; justify-content: flex-end; }
html[data-theme] .topbar-actions .button { font-size: 10px; padding: 10px 11px; }
html[data-theme] .topbar-actions .action-hint { font-size: 8px; }
html[data-theme] .table-scroll,
  html[data-theme] .task-table-scroll { margin: 12px 0 20px; border-radius: 8px; max-height: 70vh; }
html[data-theme] .table-scroll table,
  html[data-theme] .task-table { font-size: 13px; line-height: 1.7; }
html[data-theme] .table-scroll :is(th,td),
  html[data-theme] .task-table :is(th,td) { padding: 13px 14px; }
html[data-theme] .table-scroll th,
  html[data-theme] .task-table th { font-size: 11px; }
html[data-theme] .modal-head h2 { font-size: 22px; line-height: 1.3; }
}

/* Переходы */
html[data-theme] body { background:#020304; }
html[data-theme] .app-shell { display:block; width:100%; max-width:none; min-height:100vh; }
html[data-theme] .main { width:min(100%,1920px); margin-inline:auto; padding:98px var(--kinetic-edge) 72px; }
html[data-theme] .sidebar {
  position:fixed; inset:18px var(--kinetic-edge) auto; z-index:80;
  width:auto; height:64px; min-height:0; padding:7px 9px 7px 18px;
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:18px;
  color:#fff; background:#05070bc7; border:1px solid #ffffff29; border-radius:999px;
  box-shadow:0 18px 65px #0007; backdrop-filter:blur(28px) saturate(1.25);
}
html[data-theme] .sidebar > .hint,
html[data-theme] .sidebar-foot > :not(.button) { display:none; }
html[data-theme] .sidebar .brand { font-size:28px; line-height:1; letter-spacing:-.075em; padding-right:4px; }
html[data-theme] .sidebar .brand-dot { color:var(--coral); }
html[data-theme] .sidebar .nav { display:flex; min-width:0; gap:3px; margin:0; overflow-x:auto; scrollbar-width:none; }
html[data-theme] .sidebar .nav::-webkit-scrollbar { display:none; }
html[data-theme] .sidebar .nav-item {
  flex:0 0 auto; width:auto; min-height:48px; padding:0 14px; gap:8px;
  color:#bbc3d0; background:transparent; border:0; border-radius:999px;
  font-size:11px; letter-spacing:-.01em;
}
html[data-theme] .sidebar .nav-item .ui-icon { width:18px; height:18px; }
html[data-theme] .sidebar .nav-item.active,
html[data-theme] .sidebar .nav-item.active:hover { color:#05070a; background:#f4f6fb; }
html[data-theme] .sidebar .nav-item.active:before { display:none; }
html[data-theme] .sidebar-foot { display:flex; padding:0; margin:0; border:0; }
html[data-theme] .sidebar-foot .button { min-height:48px; padding:0 17px; white-space:nowrap; border-radius:999px; background:#172031; border-color:#63738b; }
html[data-theme] .topbar {
  position:relative; top:auto; min-height:64px; padding:13px 0 16px; margin:0 0 10px;
  border:0; backdrop-filter:none;
}
html[data-theme] .topbar-label { gap:13px; color:#f7f8fb; }
html[data-theme] .topbar-label:before { content:''; width:7px; height:7px; border-radius:50%; background:var(--kinetic-lime); box-shadow:0 0 18px #c7ff387d; }
html[data-theme] .topbar-actions { gap:8px; }
html[data-theme] .topbar-actions .button { border-radius:999px; min-height:46px; padding-inline:17px; }
@media (max-width:1180px) {
html[data-theme] .main { padding-top:0; }
html[data-theme] .sidebar { position:sticky; inset:0 auto auto; width:100%; height:auto; padding:13px var(--kinetic-edge) 9px; display:block; border:0; border-bottom:1px solid #ffffff24; border-radius:0; }
html[data-theme] .sidebar .brand { display:inline-block; font-size:30px; }
html[data-theme] .sidebar .nav { width:100%; max-width:100%; margin-top:10px; padding-bottom:5px; }
html[data-theme] .sidebar-foot { display:none; }
html[data-theme] .topbar { padding-top:16px; }
}
@media (max-width:760px) {
html[data-theme] .main { padding-inline:var(--kinetic-edge); padding-bottom:44px; }
html[data-theme] .topbar { align-items:flex-start; gap:12px; }
html[data-theme] .topbar-actions { width:100%; justify-content:flex-start; }
html[data-theme] .topbar-actions .save-state { order:-1; flex-basis:100%; }
}
@media screen and (max-height:500px) and (max-width:1180px) {
html[data-theme] .sidebar { position:relative; }
}

/* Рабочие разделы */
@media screen {
html[data-theme] :is(.field,.form-grid) { min-width: 0; }
html[data-theme] .form-grid { gap: 22px 20px; align-items: start; }
html[data-theme] .form-grid > .hint { margin: -7px 0 0; color: var(--work-muted); font-size: 12px; line-height: 1.75; }
html[data-theme] .form-grid > .notice.error:empty { display: none; }
html[data-theme] .form-grid > .notice.error { grid-column: 1 / -1; margin: 0; }
html[data-theme] .modal { width: 820px; max-width: calc(100vw - 32px); max-height: min(90dvh,1000px); border: 1px solid #667792; border-radius: 24px; background: #090d14; box-shadow: 0 35px 130px #000c,0 0 0 1px #ffffff09; }
html[data-theme] .modal::backdrop { background: #010205b8; backdrop-filter: blur(16px); }
html[data-theme] .modal-head { padding: 27px 30px 24px; align-items: flex-start; background: linear-gradient(120deg,#192333,#0c111a); border-bottom: 1px solid #45536b; }
html[data-theme] .modal-head h2 { min-width: 0; max-width: 100%; padding-top: 4px; font-size: clamp(25px,3vw,36px); line-height: 1.2; letter-spacing: -.04em; overflow-wrap: anywhere; }
html[data-theme] .modal-head .button { flex: 0 0 auto; min-height: 42px; padding: 11px 17px; font-size: 11px; }
html[data-theme] .modal-body { padding: 28px 30px 32px; scrollbar-color: #6d85a7 #101621; scroll-padding-block: 18px; }
html[data-theme] .modal-body .form-grid > button[type="submit"] { grid-column: 1 / -1; width: 100%; min-height: 53px; margin-top: 7px; }
html[data-theme] .modal-actions { margin-top: 26px; padding-top: 22px; border-color: #45536b; }
html[data-theme] .modal :is(.hint,.tracker-section-hint) { color: #b8c7df; }
html[data-theme] .modal :is(.table-scroll,.task-table-scroll) { max-height: 45dvh; }
html[data-theme] :is(.table-scroll,.task-table-scroll) { border-color: #5d6e88; border-radius: 15px; background: #0d131e; scrollbar-color: #8c9fbd #111b2a; box-shadow: none; }
html[data-theme] :is(.table-scroll table,.task-table) { background: #0f1723; font-size: 14px; line-height: 1.7; }
html[data-theme] :is(.table-scroll,.task-table) :is(th,td) { padding: 18px 20px; border-right-color: #374a66; border-bottom-color: #4c607c; }
html[data-theme] :is(.table-scroll,.task-table) th { background: #263952; color: #f7faff; border-bottom: 2px solid #afc8ed; font-size: 11px; letter-spacing: .045em; }
html[data-theme] :is(.table-scroll,.task-table) tbody tr:nth-child(odd) > * { background: #101a29; }
html[data-theme] :is(.table-scroll,.task-table) tbody tr:nth-child(even) > * { background: #1a283c; }
html[data-theme] :is(.table-scroll,.task-table) tbody tr:is(:hover,:focus-within) > * { background: #293d59; }
@media (max-width:650px) {
html[data-theme] .form-grid { gap: 19px; }
html[data-theme] .modal { max-width: calc(100vw - 20px); max-height: 94dvh; border-radius: 18px; }
html[data-theme] .modal-head { padding: 20px 18px; gap: 11px; }
html[data-theme] .modal-head h2 { font-size: 25px; }
html[data-theme] .modal-head .button { padding-inline: 12px; }
html[data-theme] .modal-body { padding: 22px 18px 24px; }
html[data-theme] :is(.table-scroll,.task-table) :is(th,td) { padding: 15px 16px; }
}
}
@media screen and (prefers-reduced-motion:no-preference) {
html[data-theme][data-ambient-motion="on"] :is(.table-scroll,.task-table) tbody tr > * { transition: background-color 220ms ease; }
}

/* Меню */
@media screen {
html[data-theme] .sidebar-foot .menu-toggle {
    display:inline-flex; align-items:center; justify-content:space-between; gap:20px;
    min-width:116px; min-height:48px; padding:0 18px;
    background:#eef3fb; border-color:#eef3fb; color:#101925;
    font-size:11px; font-weight:650; border-radius:999px;
    transition:background-color var(--motion-color,200ms),border-color var(--motion-color,200ms);
  }
html[data-theme] dialog.site-menu-panel {
    position:fixed; inset:18px max(5vw,40px) auto auto; margin:0;
    width:440px; max-width:calc(100vw - 32px); max-height:calc(100dvh - 36px);
    padding:11px; border:1px solid #8da3c242; border-radius:25px;
    color:#edf3ff; background:#090e17; box-shadow:0 30px 100px #000a;
    overflow:hidden; font-family:var(--font-body); overscroll-behavior:contain;
  }
html[data-theme] dialog.site-menu-panel[open] { display:flex; flex-direction:column; }
html[data-theme] dialog.site-menu-panel:not([open]) { display:none; }
html[data-theme] dialog.site-menu-panel::backdrop { background:#01040b8f; backdrop-filter:blur(7px); }
html[data-theme] .site-menu-panel .menu-close {
    min-height:42px; padding:10px 16px; border:1px solid #7186a5;
    border-radius:999px; background:#182437; color:#fff; font-size:11px;
  }
.site-menu-panel[data-state="opening"] .menu-panel-nav { animation:menu-panel-in var(--motion-menu,520ms) cubic-bezier(.4,0,.1,1) both; }
.site-menu-panel[data-state="opening"] .menu-panel-note { animation:menu-panel-in var(--motion-menu,520ms) var(--motion-stagger,60ms) cubic-bezier(.4,0,.1,1) both; }
.site-menu-panel[data-state="opening"] .menu-panel-actions { animation:menu-panel-in var(--motion-menu,520ms) calc(var(--motion-stagger,60ms) * 2) cubic-bezier(.4,0,.1,1) both; }
.site-menu-panel[data-state="closing"] .menu-panel-content { animation:menu-panel-out var(--motion-color,200ms) cubic-bezier(.4,0,.1,1) both; }
html[data-ambient-motion="off"] .site-menu-panel *,html[data-ambient-motion="off"] .menu-toggle-mark { animation:none; transition:none; }
@media (max-width:1180px) {
html[data-theme] .sidebar {
      position:sticky; top:0; inset-inline:auto; width:100%; height:auto; min-height:72px;
      padding:11px var(--kinetic-edge); display:flex; flex-direction:row; justify-content:space-between; align-items:center; gap:18px;
      border-radius:0; border:0; border-bottom:1px solid #7385a52e; background:#05080eeb;
    }
html[data-theme] .sidebar .nav { display:none; }
html[data-theme] .sidebar-foot { display:flex; flex:0 0 auto; margin:0; padding:0; border:0; }
html[data-theme] .sidebar .brand { margin:0; padding:0; line-height:1; }
html[data-theme] .main { padding-top:0; }
html[data-theme] dialog.site-menu-panel { inset:12px max(4vw,25px) auto auto; max-height:calc(100dvh - 24px); }
}
@media (max-width:650px) {
html[data-theme] .sidebar { min-height:68px; padding-block:10px; }
html[data-theme] .sidebar-foot .menu-toggle { min-height:44px; min-width:111px; gap:16px; padding-inline:16px; }
html[data-theme] dialog.site-menu-panel { inset:12px 25px auto; width:calc(100vw - 50px); max-width:none; padding:9px; border-radius:22px; }
}
@media (max-width:400px) {
html[data-theme] dialog.site-menu-panel { inset-inline:15px; width:calc(100vw - 30px); }
}
@media (max-height:550px) {
html[data-theme] .sidebar { position:relative; }
html[data-theme] dialog.site-menu-panel { top:8px; max-height:calc(100dvh - 16px); }
html[data-theme] .site-menu-panel .menu-close { min-height:40px; }
}
}

/* Главная */
@media screen {
html[data-theme] .sidebar {
    position:fixed; inset:28px var(--kinetic-edge) auto; z-index:80;
    display:flex; flex-direction:row; flex-wrap:nowrap; align-items:center; justify-content:space-between; gap:24px;
    width:auto; height:54px; min-height:0; padding:0; border:0; border-radius:0;
    background:transparent; box-shadow:none; backdrop-filter:none;
  }
html[data-theme] .sidebar:after,
  html[data-theme] .sidebar .nav { display:none; }
html[data-theme] .sidebar:before {
    content:''; position:absolute; z-index:-1; pointer-events:none;
    top:-28px; left:calc(-1 * var(--kinetic-edge)); right:calc(-1 * var(--kinetic-edge)); height:128px;
    background:linear-gradient(180deg,#020304f5 0%,#020304ef 64%,#02030400 100%);
  }
html[data-theme] .sidebar .brand { margin:0; padding:0; font-size:35px; letter-spacing:-.075em; line-height:1; }
html[data-theme] .sidebar .sidebar-foot { display:flex; align-items:center; gap:9px; margin:0; padding:0; border:0; }
html[data-theme] .sidebar-foot .reference-header-action {
    position:relative; display:inline-flex; align-items:center; justify-content:center;
    min-height:54px; min-width:164px; padding:0 20px 0 36px;
    color:#f0f1fa; border:1px solid #494d59; background:#2b2e3a; border-radius:999px;
    font-size:11px; font-weight:500; box-shadow:none;
    transform:none; translate:none; rotate:none;
  }
html[data-theme] .sidebar-foot .reference-header-action .action-hint { display:none; }
html[data-theme] .sidebar-foot .reference-header-action:before {
    content:''; position:absolute; width:6px; height:6px; left:19px; top:calc(50% - 3px);
    background:#ff936f; border-radius:50%; opacity:1;
  }
html[data-theme] .sidebar-foot .menu-toggle { min-height:54px; min-width:123px; padding:0 20px; font-weight:500; }
@media (max-width:1180px) {
html[data-theme] .sidebar {
      position:sticky; inset:auto; top:0; width:100%; height:auto; min-height:86px;
      padding:16px var(--kinetic-edge); border:0; background:transparent;
    }
html[data-theme] .sidebar:before { top:0; left:0; right:0; height:116px; }
}
@media (max-width:600px) {
html[data-theme] .sidebar-foot .reference-header-action { display:none; }
html[data-theme] .sidebar { min-height:80px; padding-block:13px; }
html[data-theme] .sidebar .brand { font-size:31px; }
html[data-theme] .sidebar-foot .menu-toggle { min-height:48px; min-width:112px; }
}
}

/* Карточки разделов */
@media screen {
html[data-theme] .section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:2vw; row-gap:clamp(64px,6vw,112px); align-items:start; }
@media (min-aspect-ratio:21/9) {
html[data-theme] .section-grid { row-gap:10em; }
}
@media (max-width:812px) {
html[data-theme] .section-grid { grid-template-columns:minmax(0,1fr); gap:46px; }
}
}

/* Итоги */
@media screen {
html[data-theme] .main > footer.reference-finale {
    --finale-ink:#f0f1fa;
    --finale-accent:#253cf3;
    display:block; margin:clamp(90px,12vw,190px) 0 0; padding:0;
    border:0; border-radius:0; color:var(--finale-ink); font-size:16px;
    background:transparent; overflow:visible;
  }
@media (max-width:812px) {
html[data-theme] .main > footer.reference-finale { margin-top:100px; }
}
}

/* Компактный интерфейс */
@media screen {
html[data-theme] body {
    background: var(--bg);
    color: #f1f5f9;
    font-size: 14.5px;
    line-height: 1.56;
  }
html[data-theme] .boot-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #0b0e14;
    padding: 24px;
  }
html[data-theme] .app-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    max-width: none;
    margin: 0;
    background: #0b0e14;
  }
html[data-theme] .sidebar {
    position: sticky;
    inset: auto;
    top: 0;
    height: 100vh;
    min-height: 0;
    width: 220px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    padding: 14px 10px 12px;
    margin: 0;
    border: 0;
    border-right: 1px solid #252f42;
    border-radius: 0;
    background: #0e121a;
    color: #ecf1f8;
    box-shadow: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #2d394e #0e121a;
  }
html[data-theme] .sidebar:before,
  html[data-theme] .sidebar:after {
    display: none;
    content: none;
  }
html[data-theme] .sidebar .brand {
    display: inline-flex;
    align-items: center;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.04em;
    padding: 2px 8px;
    margin: 0;
    color: #f3f6fc;
  }
html[data-theme] .sidebar > .hint {
    display: block;
    margin: 0 0 4px;
    padding: 0 8px;
    font-size: 11px;
    line-height: 1.4;
    color: #8492a8;
    max-width: none;
  }
.sidebar-nav-scroll { display: contents; }
html[data-theme] .sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
html[data-theme] .sidebar .nav-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: #b4c0d4;
    font-size: 13px;
    font-weight: 550;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
html[data-theme] .sidebar .nav-item .ui-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.85;
  }
html[data-theme] .sidebar .nav-item.active,
  html[data-theme] .sidebar .nav-item.active:hover {
    background: #1a2742;
    color: #e4eeff;
    border-color: #365694;
    box-shadow: inset 3px 0 0 #4c82f7;
  }
html[data-theme] .sidebar .nav-item.active:before {
    display: none;
  }
html[data-theme] .sidebar .nav-item.active .ui-icon {
    color: #8ab4ff;
    opacity: 1;
  }
html[data-theme] .sidebar .sidebar-foot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding: 10px 2px 0;
    border-top: 1px solid #252f42;
  }
html[data-theme] .sidebar-foot .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 7px;
    border: 1px solid #303d54;
    background: #151b27;
    color: #c7d3e6;
    font-size: 12px;
    font-weight: 600;
  }
html[data-theme] dialog.site-menu-panel {
    padding: 10px;
    border-radius: 14px;
    border: 1px solid #32405a;
    background: #111621;
    color: #ecf1f8;
    box-shadow: 0 24px 64px #000c;
  }
html[data-theme] dialog.site-menu-panel::backdrop {
    background: #000000b8;
  }
html[data-theme] .site-menu-panel .menu-close {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 7px;
    border: 1px solid #3a4964;
    background: #19202e;
    color: #ecf1f8;
    font-size: 12px;
  }
html[data-theme] .main {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 18px 24px;
    min-width: 0;
  }
html[data-theme] .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 48px;
    padding: 8px 0;
    margin: 0 0 12px;
    background: var(--topbar-surface, var(--bg));
    border-bottom: 1px solid #252f42;
  }
html[data-theme] .topbar-label {
    gap: 8px;
    font-size: 13px;
    color: #ecf1f8;
  }
html[data-theme] .topbar-label:before {
    width: 6px;
    height: 6px;
    background: #4c82f7;
    box-shadow: none;
  }
html[data-theme] .topbar-label .eyebrow {
    font-size: 10px;
    color: #8492a8;
    margin: 0;
  }
html[data-theme] .topbar-actions {
    gap: 6px;
  }
html[data-theme] .topbar-actions .button {
    min-height: 32px;
    padding: 5px 11px;
    font-size: 12px;
    border-radius: 7px;
  }
html[data-theme] .compact-view-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: #131823;
    border: 1px solid #252f42;
    border-radius: 10px;
  }
html[data-theme] .form-grid {
    gap: 10px 12px;
  }
html[data-theme] .section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 8px;
  }
html[data-theme] :is(.table-scroll, .task-table-scroll) {
    border-radius: 9px;
    border-color: #2a364c;
    background: #111621;
    margin: 8px 0 12px;
  }
html[data-theme] :is(.table-scroll, .task-table) :is(th, td) {
    padding: 9px 11px;
    font-size: 13px;
    line-height: 1.45;
    border-right-color: #222c3e;
    border-bottom-color: #242f43;
  }
html[data-theme] :is(.table-scroll, .task-table) th {
    background: #1a2436;
    color: #edf3fd;
    border-bottom: 1px solid #3c5277;
    font-size: 11.5px;
  }
html[data-theme] :is(.table-scroll, .task-table) tbody tr:nth-child(odd) > * {
    background: #111621;
  }
html[data-theme] :is(.table-scroll, .task-table) tbody tr:nth-child(even) > * {
    background: #151c29;
  }
html[data-theme] :is(.table-scroll, .task-table) tbody tr:is(:hover, :focus-within) > * {
    background: #1d283b;
  }
html[data-theme] .modal {
    width: min(720px, calc(100vw - 24px));
    border: 1px solid #35445e;
    border-radius: 12px;
    background: #121824;
    box-shadow: 0 24px 70px #000c;
  }
html[data-theme] .modal::backdrop {
    background: #000000b8;
  }
html[data-theme] .modal-head {
    padding: 14px 18px;
    background: #161d2b;
    border-bottom: 1px solid #252f42;
  }
html[data-theme] .modal-head h2 {
    font-size: 18px;
    margin: 0;
  }
html[data-theme] .modal-body {
    padding: 14px 18px 18px;
  }
html[data-theme] .modal-body .form-grid > button[type="submit"] {
    min-height: 38px;
  }
html[data-theme] .sidebar .nav-item[data-badge]::after {
    content: attr(data-badge);
    margin-left: auto;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: #1b2436;
    border: 1px solid #2f3f5c;
    color: #9bb8e8;
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.4;
    text-align: center;
  }
html[data-theme] .sidebar .nav-item.active[data-badge]::after {
    background: #274173;
    border-color: #4c82f7;
    color: #ffffff;
  }
html[data-theme] .sidebar-foot-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px;
  }
html[data-theme] .sidebar-foot-row .button {
    min-height: 30px;
    padding: 4px 8px;
    font-size: 11px;
    justify-content: center;
  }
html[data-theme][data-density="comfortable"] :is(.table-scroll, .task-table) :is(th, td) {
    padding: 12px 14px;
  }
html[data-theme][data-density="comfortable"] .sidebar .nav-item {
    min-height: 38px;
    padding: 8px 11px;
  }
html[data-theme] .app-shell {
    background: var(--bg);
  }
html[data-theme] .sidebar {
    background: var(--sidebar-surface);
    border-right-color: var(--border-subtle);
  }
html[data-theme] .topbar {
    background: var(--topbar-surface);
    border-bottom-color: var(--border-subtle);
  }
html[data-theme] .panel,
  html[data-theme] .compact-view-head,
  html[data-theme] .visual-metric,
  html[data-theme] .day-column,
  html[data-theme] .tracker-toolbar,
  html[data-theme] .tracker-summary-card,
  html[data-theme] .route-zone,
  html[data-theme] .notes-accordion,
  html[data-theme] .questions-accordion,
  html[data-theme] .profile-group,
  html[data-theme] .helper-explanation,
  html[data-theme] .full-week-reader {
    background: var(--paper);
    border-color: var(--border-subtle);
    border-radius: 12px;
  }
html[data-theme] .sidebar-foot > [data-appearance-control] {
    width: 100%;
    min-height: 31px;
    padding: 5px 10px;
    font-size: 11.5px;
    justify-content: center;
    text-decoration: none;
  }
html:root[data-theme="light"] body,
  html:root[data-theme="light"] .app-shell {
    background: #f4f3ee;
    color: #1b342e;
  }
html:root[data-theme="light"] .sidebar {
    background: #173e37;
    color: #eaf2ec;
    border-right-color: #12332d;
  }
html:root[data-theme="light"] .sidebar .nav-item,
  html:root[data-theme="light"] .sidebar .nav-sphere-item {
    color: #cde0d6;
  }
html:root[data-theme="light"] .sidebar .nav-item:hover,
  html:root[data-theme="light"] .sidebar .nav-sphere-item:hover {
    background: #235046;
    color: #ffffff;
  }
html:root[data-theme="light"] .sidebar .nav-item.active,
  html:root[data-theme="light"] .sidebar .nav-sphere-item.active {
    background: #285b50;
    color: #ffffff;
    border-color: #4e8a7b;
    box-shadow: inset 3px 0 0 #9cd6b8;
  }
html:root[data-theme="light"] .sidebar .nav-group-label {
    color: #8fb4a4;
  }
html:root[data-theme="light"] .topbar {
    border-bottom-color: #d6dfd6;
  }
html:root[data-theme="light"] .topbar-label,
  html:root[data-theme="light"] h1,
  html:root[data-theme="light"] h2,
  html:root[data-theme="light"] h3,
  html:root[data-theme="light"] h4,
  html:root[data-theme="light"] .panel-heading :is(h2, h3),
  html:root[data-theme="light"] .today-bar-main h1,
  html:root[data-theme="light"] .compact-view-copy h1,
  html:root[data-theme="light"] .metric-figure strong,
  html:root[data-theme="light"] .metric-copy .metric-label {
    color: #18362f;
  }
html:root[data-theme="light"] :is(.table-scroll, .task-table) th {
    background: #e8efe9;
    color: #18362f;
    border-bottom-color: #c2d1c6;
  }
html:root[data-theme="light"] :is(.table-scroll, .task-table) tbody tr:nth-child(odd) > * {
    background: #ffffff;
    color: #1b342e;
  }
html:root[data-theme="light"] :is(.table-scroll, .task-table) tbody tr:nth-child(even) > * {
    background: #f6f8f4;
    color: #1b342e;
  }
html:root[data-theme="light"] .modal,
  html:root[data-theme="light"] dialog.command-palette,
  html:root[data-theme="light"] dialog.site-menu-panel {
    background: #ffffff;
    border-color: #c5d2c5;
    color: #1b342e;
  }
html:root[data-theme="light"] .modal-head,
  html:root[data-theme="light"] .palette-head,
  html:root[data-theme="light"] .palette-foot,
  html:root[data-theme="light"] .menu-panel-nav {
    background: #f3f6f1;
    border-color: #d6dfd6;
    color: #1b342e;
  }
@media (min-width: 960px) {
  html[data-theme] .sidebar { overflow: hidden; }
  html[data-theme] .sidebar > :is(.brand, .hint, .sidebar-foot) { flex: none; }
  html[data-theme] .sidebar-nav-scroll {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-padding-block: 4px;
    scrollbar-width: thin;
  }
  html[data-theme] .sidebar .nav-item > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  html[data-theme] .sidebar .nav-item[data-badge]::after { flex: none; }
}
@media (max-width: 1180px) {
html[data-theme] .app-shell {
      grid-template-columns: 204px minmax(0, 1fr);
    }
html[data-theme] .sidebar {
      position: sticky;
      top: 0;
      width: 204px;
      height: 100vh;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      padding: 12px 8px;
      background: var(--sidebar-surface);
      border-right: 1px solid var(--border-subtle);
      border-bottom: 0;
    }
html:root[data-theme="light"] .sidebar {
      background: #173e37;
      border-right-color: #12332d;
    }
html[data-theme] .sidebar .nav {
      display: flex;
      flex-direction: column;
    }
html[data-theme] .sidebar .sidebar-foot {
      display: flex;
      margin-top: auto;
      padding-top: 8px;
      border-top: 1px solid #252f42;
    }
}
html[data-theme] .analytics-panel .table-scroll {
    max-width: 100%;
    overflow-x: auto;
  }
html[data-theme] .analytics-panel .table-scroll table.analytics-month-table {
    min-width: 0;
    width: 100%;
    border-collapse: collapse;
  }
html[data-theme] .analytics-panel .table-scroll table.analytics-month-table :is(th, td) {
    min-width: 0;
  }
@media (max-width: 959px) {
html[data-theme] .app-shell {
      display: block;
    }
html[data-theme] .sidebar {
      position: sticky;
      top: 0;
      width: 100%;
      height: auto;
      padding: 8px 12px;
      flex-direction: row;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 6px 10px;
      border-right: 0;
      border-bottom: 1px solid #252f42;
    }
html[data-theme] .sidebar > .hint,
    html[data-theme] .sidebar .nav-group-label,
    html[data-theme] .sidebar .sidebar-foot-row,
    html[data-theme] .sidebar-foot > [data-appearance-control] {
      display: none;
    }
html[data-theme] .sidebar .nav-spheres {
      order: 4;
      flex-basis: 100%;
      width: 100%;
      margin: 2px 0 0;
      padding: 4px 0 0;
      overflow-x: auto;
      scrollbar-width: thin;
    }
html[data-theme] .sidebar .nav-spheres-list {
      flex-direction: row;
      gap: 4px;
    }
html[data-theme] .sidebar .nav-sphere-item {
      width: auto;
      flex: 0 0 auto;
      min-height: 28px;
      padding: 3px 9px;
      font-size: 11.5px;
    }
html[data-theme] .topbar {
      top: var(--sidebar-height, auto);
      flex-wrap: wrap;
      gap: 6px 8px;
    }
html[data-theme] .topbar-actions {
      flex-wrap: wrap;
      width: 100%;
    }
html[data-theme] .topbar-actions .command-trigger {
      flex: 1 1 auto;
      justify-content: space-between;
    }
html[data-theme] .sidebar .brand {
      font-size: 20px;
      padding: 0;
    }
html[data-theme] .sidebar .sidebar-foot {
      order: 2;
      margin: 0;
      padding: 0;
      border: 0;
    }
html[data-theme] .sidebar-foot .menu-toggle {
      width: auto;
      min-height: 32px;
      padding: 4px 10px;
    }
html[data-theme] .sidebar .nav {
      order: 3;
      flex-basis: 100%;
      flex-direction: row;
      overflow-x: auto;
      gap: 4px;
      padding: 4px 0 2px;
      scrollbar-width: thin;
    }
html[data-theme] .sidebar .nav-item {
      width: auto;
      flex: 0 0 auto;
      min-height: 32px;
      padding: 5px 10px;
      font-size: 12px;
    }
html[data-theme] .sidebar .nav-item.active {
      box-shadow: inset 0 -2px 0 #4c82f7;
    }
html[data-theme] .main {
      padding: 0 12px 20px;
    }
}
}

@media screen {
  html[data-menu-open="true"] { overflow: hidden; scrollbar-gutter: stable; }
  html[data-surface-mode] .today-bar { padding-block: var(--surface-inset); }
  html[data-surface-mode] .today-bar-main { row-gap: var(--surface-gap); }
}
}

@media (max-width: 480px) {
  html[data-theme] .topbar-actions .command-trigger {
    position: relative;
    width: 44px;
    min-height: 44px;
    padding: 0;
  }
  html[data-theme] .topbar-actions .command-trigger > :is(span, kbd) { display: none; }
  html[data-theme] .command-trigger::before {
    content: "";
    position: absolute;
    top: 11px;
    left: 12px;
    width: 13px;
    height: 13px;
    border: 2px solid currentColor;
    border-radius: 50%;
  }
  html[data-theme] .command-trigger::after {
    content: "";
    position: absolute;
    top: 27px;
    left: 26px;
    width: 8px;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
  }
}
