/* EKOS v1.0. Loaded after Compass styles; one shell for every role. */
:root {
  --ekos-header-bg: #26313A;
  --ekos-sidebar-bg: #2D3A42;
  --ekos-accent: #5A7D7D;
  --ekos-canvas-bg: #F4F6F7;
  --ekos-surface: #FFFFFF;
  --ekos-text: #20313B;
  --ekos-text-secondary: #52636C;
  --ekos-border: #DCE4E6;
  --ekos-hover: #EFF3F3;
  --ekos-focus-ring: #1D6E73;
  --ekos-positive-text: #246B51;
  --ekos-warning-text: #906100;
  --ekos-negative-text: #B13E38;
  --ekos-selected-check: #5A9F4C;
  --ekos-sidebar-width: 224px;
  --bg: var(--ekos-canvas-bg);
  --surface: var(--ekos-surface);
  --ink: var(--ekos-text);
  --muted: var(--ekos-text-secondary);
  --brand: var(--ekos-accent);
  --brand-soft: var(--ekos-hover);
  --border: var(--ekos-border);
  --danger: var(--ekos-negative-text);
  --ok: var(--ekos-positive-text);
  --topbar-height: 48px;
  --sg-bg: var(--ekos-canvas-bg);
  --sg-card: var(--ekos-surface);
  --sg-line: var(--ekos-border);
  --sg-text: var(--ekos-text);
  --sg-text-2: var(--ekos-text-secondary);
  --sg-acc: var(--ekos-accent);
  --sg-acc-text: var(--ekos-text);
  --sg-acc-soft: var(--ekos-hover);
  --sg-r-card: 12px;
  --sg-r-stat: 12px;
}
.ekos { font-size: 16px; line-height: 1.5; }
.ekos :focus-visible { outline: 3px solid var(--ekos-focus-ring); outline-offset: 3px; }
.ekos .topbar :focus-visible, .ekos-sidebar :focus-visible { outline-color: var(--ekos-surface); outline-offset: -3px; }
.ekos-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ekos-skip { position: fixed; left: 8px; top: -80px; z-index: 100; padding: 8px; background: var(--ekos-surface); }
.ekos-skip:focus { top: 0; }
.ekos .topbar {
  height: calc(48px + env(safe-area-inset-top)); min-height: 48px;
  padding: env(safe-area-inset-top) 8px 0; gap: 0;
  background: var(--ekos-header-bg); box-shadow: none;
  display: flex; flex-direction: row; z-index: 30;
}
.ekos .topbar-brand { display: flex; align-items: center; gap: 8px; padding: 0 4px; height: 44px; background: transparent; border-radius: 8px; }
.ekos .topbar-brand strong { font-size: 16px; }
.ekos .topbar-mark { display: block; width: 28px; height: 28px; padding: 3px; border: 0; background: var(--ekos-accent); }
.ekos .topbar-actions { gap: 0; flex: 0 0 auto; margin-left: auto; }
.ekos .icon-btn { width: 44px; height: 44px; min-width: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; }
.ekos .icon-btn:hover { background: var(--ekos-accent); }
.ekos-popover { position: absolute; top: calc(48px + env(safe-area-inset-top)); width: 264px; max-width: calc(100vw - 16px); padding: 8px; background: var(--ekos-surface); color: var(--ekos-text); border: 1px solid var(--ekos-border); border-radius: 12px; box-shadow: 0 12px 32px #20313B26; }
#moduleMenu { left: 8px; }
#profileMenu { right: 8px; }
.ekos-popover strong { display: block; padding: 8px 12px; font-size: 14px; }
.ekos-popover button { width: 100%; min-height: 48px; background: transparent; color: var(--ekos-text); text-align: left; display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; font-weight: 500; }
.ekos-popover button:hover { background: var(--ekos-hover); }
#currentModule { justify-content: flex-start; gap: 12px; }
#currentModule > .ekos-module-check { color: var(--ekos-selected-check); font-size: 24px; margin-left: auto; }
#logoutBtn { border-top: 1px solid var(--ekos-border); border-radius: 0; color: var(--ekos-negative-text); }
.ekos-sidebar { position: fixed; top: calc(48px + env(safe-area-inset-top)); bottom: 0; left: 0; width: var(--ekos-sidebar-width); background: var(--ekos-sidebar-bg); color: var(--ekos-surface); z-index: 20; display: flex; flex-direction: column; overscroll-behavior: contain; }
.ekos-nav-backdrop { position: fixed; inset: 48px 0 0; z-index: 19; background: #20313B66; }
.ekos-sidebar-title { padding: 24px 16px 12px; font-size: 14px; white-space: nowrap; }
.ekos .tabs { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 8px; margin: 0; overflow-y: auto; min-width: 0; min-height: 0; max-height: none; max-width: none; width: 100%; position: static; background: transparent; box-shadow: none; border: 0; border-radius: 0; }
.ekos .tabs > button { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ekos-surface); font-size: 16px; font-weight: 400; white-space: normal; }
.ekos .tabs > button svg { flex-shrink: 0; }
.ekos .tabs > button:hover { background: var(--ekos-header-bg); }
.ekos .tabs > button.active { background: var(--ekos-accent); font-weight: 600; }
.ekos .mode-switch { display: flex; flex: 0 0 auto; flex-direction: column; width: 100%; margin: 0 0 16px; border: 1px solid var(--ekos-accent); background: transparent; border-radius: 8px; }
.ekos .mode-switch .mode-option { flex: 0 0 auto; min-height: 44px; white-space: normal; font-size: 14px; color: var(--ekos-surface); background: transparent; }
.ekos .mode-switch .mode-option.is-active { background: var(--ekos-accent); color: var(--ekos-surface); }
.ekos .mode-option svg { display: none; }
.ekos-sidebar-footer { margin-top: auto; padding: 16px 8px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; }
#shellContext { width: 100%; overflow-wrap: anywhere; }
.ekos-sidebar-footer button { min-height: 44px; background: transparent; color: inherit; padding: 8px; font-size: 14px; }
#sidebarCollapse { width: 44px; font-size: 24px; }
#sidebarResize { position: absolute; top: 0; right: -4px; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; }
#sidebarResize:hover, #sidebarResize:focus { background: var(--ekos-accent); }
.ekos-sidebar.is-collapsed .ekos-nav-label, .ekos-sidebar.is-collapsed .ekos-sidebar-title, .ekos-sidebar.is-collapsed #shellContext, .ekos-sidebar.is-collapsed #sidebarReset { display: none; }
.ekos-sidebar.is-collapsed .tabs > button { padding: 12px; }
.ekos-sidebar.is-collapsed .mode-option { padding: 12px; display: flex; justify-content: center; }
.ekos-sidebar.is-collapsed .mode-option span { display: none; }
.ekos-sidebar.is-collapsed .mode-option svg { display: block; }
.ekos main { max-width: none; width: auto; padding: 24px; margin: 0; min-width: 0; }
.ekos-signed-in main { margin-left: var(--ekos-sidebar-width); }
.ekos-page-context { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--ekos-text-secondary); font-size: 14px; }
.ekos #navToggle { display: none; color: var(--ekos-text); }
.ekos #content { min-width: 0; overflow-wrap: anywhere; }
.ekos #content .sg-screen, .ekos #content .sg-desk, .ekos #content .sg-page { max-width: none; width: 100%; font-size: 16px; }
.ekos #content :is(.sg-screen, .sg-desk, .sg-page) { margin: 0; }
.ekos #content .sg-desk-title, .ekos #content h1 { font-size: 26px; font-weight: 650; line-height: 1.25; }
.ekos #content .sg-trainee-name { font-size: 26px; font-weight: 650; }
.ekos #content h3 { font-size: 18px; }
.ekos #content .sg-desk-sub, .ekos #content .sg-subtitle, .ekos #content .sg-trainee-meta, .ekos #content .sg-desk-foot, .ekos #content .sg-desk-hint { font-size: 14px; }
.ekos #content .card, .ekos #content .sg-panel, .ekos #content .sg-path-card, .ekos #content .sg-mentor-card { border-radius: 12px; padding: 24px; box-shadow: none; }
.ekos #content button, .ekos dialog button { min-height: 44px; }
.ekos #content input:not([type=checkbox]):not([type=radio]), .ekos #content select { min-height: 44px; max-width: 100%; font-size: 16px; }
.ekos #content textarea { max-width: 100%; font-size: 16px; }
.ekos #content label { font-size: 16px; }
.ekos #content .sg-btn, .ekos #content .sg-chip-filter, .ekos #content .sg-desk-back { font-size: 16px; }
.ekos #content .sg-table-wrap { max-width: 100%; overflow-x: auto; }
.ekos #content .sg-card-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; }
.ekos #content .sg-card-grid > * { min-width: 0; }
.ekos #content .sg-path-card { border-top: 3px solid var(--ekos-accent); }
.ekos #content .sg-header { background: var(--ekos-surface); border: 1px solid var(--ekos-border); padding: 0 0 24px; border-width: 0 0 1px; border-radius: 0; margin-bottom: 24px; }
.ekos #content .sg-header-name { font-size: 26px; font-weight: 650; color: var(--ekos-text); }
.ekos #content .sg-header-role { font-size: 14px; color: var(--ekos-text-secondary); opacity: 1; }
.ekos #content .sg-panel-title { font-size: 18px; }
.ekos #content :is(.sg-path-card-head span, .sg-mentor-info strong, .sg-mentor-info span, .sg-progress-row, .sg-block-count, .sg-block-reason, .sg-day-badge, .sg-list-card .sg-list-sub) { font-size: 14px; }
.ekos #content :is(.sg-path-label, .sg-path-meta, .sg-mentor-name, .sg-mentor-role, .sg-list-title, .sg-list-meta, .sg-step-label, .sg-step-meta, .sg-block-title, .sg-block-sub, .sg-alert-head, .sg-eyebrow, .sg-today-title, .sg-welcome, .sg-sub, .sg-chip, .sg-help-text) { font-size: 14px; }
.ekos #content form.card { max-width: none; margin: 24px 0; }
.ekos #content form.card > h3 { padding-bottom: 16px; border-bottom: 1px solid var(--ekos-border); }
.ekos #content .ql-toolbar { display: flex; flex-wrap: wrap; }
.ekos #content .ql-editor { min-height: 200px; font-size: 16px; line-height: 1.6; }
.ekos #content .row-actions { flex-wrap: wrap; }
.ekos dialog { max-width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 24px; border: 1px solid var(--ekos-border); border-radius: 12px; }
.ekos dialog::backdrop { background: #20313B66; }
.ekos #shellDialog { width: 560px; }
.ekos #shellDialog h2 { padding-right: 24px; }
.ekos [hidden], .ekos .hidden { display: none !important; }
@media (max-width: 1023px) {
  .ekos main { padding: 16px; }
  .ekos #content .sg-card-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .ekos-signed-in main { margin-left: 0; }
  .ekos-sidebar { width: min(300px, calc(100vw - 32px)); box-shadow: 8px 0 24px #20313B26; display: none; }
  .ekos-sidebar:has(.nav-open) { display: flex; }
  .ekos .tabs { display: flex; }
  .ekos #navToggle:not(.hidden) { display: flex; }
  .ekos-page-context { margin-bottom: 16px; }
  #sidebarResize, .ekos-sidebar-footer button { display: none; }
  .ekos-sidebar.is-collapsed .ekos-nav-label, .ekos-sidebar.is-collapsed .ekos-sidebar-title, .ekos-sidebar.is-collapsed #shellContext { display: block; }
  .ekos-sidebar.is-collapsed .mode-option { font-size: 14px; padding: 8px; }
  .ekos-sidebar.is-collapsed .mode-option span { display: block; }
  .ekos-sidebar.is-collapsed .mode-option svg { display: none; }
  .ekos #content .card, .ekos #content .sg-panel, .ekos #content .sg-path-card, .ekos #content .sg-mentor-card { padding: 16px; }
  .ekos #content .sg-step-card { margin-left: 40px; min-width: 0; flex-wrap: wrap; }
  .ekos #content .sg-desk-head { gap: 12px; }
  .ekos #content .sg-desk-head > div { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .ekos *, .ekos *::before, .ekos *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* One workspace grid; account fields retain the same columns across every row. */
.ekos #content[data-ekos-screen="users"] > :is(form.card, section.card) { width: 100%; max-width: none; }
.ekos #content[data-ekos-screen="users"] .account-row:not(.roster-row-edit) { display: grid; grid-template-columns: minmax(140px,1.3fr) minmax(100px,1fr) minmax(90px,.8fr) minmax(110px,1fr) minmax(150px,1fr) 120px 96px; gap: 16px; padding: 16px; align-items: center; white-space: normal; overflow: visible; }
.ekos #content[data-ekos-screen="users"] .account-row > * { min-width: 0; }
.ekos #content[data-ekos-screen="users"] .account-row .account-name { max-width: none; min-width: 0; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.ekos #content[data-ekos-screen="users"] .account-row > .muted { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.ekos #content .account-contacts { display: flex; flex-direction: column; gap: 4px; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.ekos #content .account-contacts a { display: inline-flex; align-items: center; min-height: 44px; }
.ekos #content .account-no-contacts { color: var(--ekos-text-secondary); }
.ekos #content .account-status { justify-self: start; white-space: normal; }
.ekos #content[data-ekos-screen="users"] .account-actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-left: 0; justify-content: flex-end; }
.ekos #content .account-actions button { flex: 0 0 44px; width: 44px; }
.ekos #createUserForm .inline-form > .check-row { display: flex; align-items: center; align-self: end; flex: 0 0 auto; min-height: 44px; }
@media (max-width: 1399px) {
 .ekos #content[data-ekos-screen="users"] .account-row:not(.roster-row-edit) { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 96px; }
 .ekos #content .account-name { grid-column: 1 / 3; }
 .ekos #content .account-login { grid-column: 1; }
 .ekos #content .account-role { grid-column: 2; }
 .ekos #content .account-location { grid-column: 1; }
 .ekos #content .account-contacts { grid-column: 2; grid-row: 3 / 5; }
 .ekos #content .account-status { grid-column: 1; }
 .ekos #content .account-actions { grid-column: 3; grid-row: 1; }
}
@media (max-width: 767px) {
 .ekos #content[data-ekos-screen="users"] .account-row:not(.roster-row-edit) { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; }
 .ekos #content[data-ekos-screen="users"] .account-row:not(.roster-row-edit) > * { grid-column: 1 / -1; grid-row: auto; }
 .ekos #content[data-ekos-screen="users"] .account-row .account-role, .ekos #content[data-ekos-screen="users"] .account-row .account-status { grid-column: 1; }
 .ekos #content[data-ekos-screen="users"] .account-row .account-location, .ekos #content[data-ekos-screen="users"] .account-row .account-actions { grid-column: 2; }
 .ekos #content .account-row [data-label]::before { content: attr(data-label); display: block; font-size: 14px; color: var(--ekos-text-secondary); margin-bottom: 4px; }
 .ekos #content .account-actions { justify-content: flex-start; }
 .ekos #content .account-actions:empty { display: none; }
 .ekos #content .account-contacts { gap: 4px; }
}

/* Phone lists keep the employee, status and action together instead of crushing columns. */
@media (max-width: 767px) {
 .ekos #content :is(.sg-table-control, .sg-table-team) { display: block; }
 .ekos #content :is(.sg-table-control, .sg-table-team) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 .ekos #content :is(.sg-table-control, .sg-table-team) tbody { display: block; }
 .ekos #content :is(.sg-table-control, .sg-table-team) tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 16px; border-bottom: 1px solid var(--ekos-border); }
 .ekos #content :is(.sg-table-control, .sg-table-team) tbody tr:last-child { border-bottom: 0; }
 .ekos #content :is(.sg-table-control, .sg-table-team) td { width: auto; padding: 0; border: 0; min-width: 0; }
 .ekos #content :is(.sg-table-control, .sg-table-team) td:first-child { grid-column: 1; }
 .ekos #content :is(.sg-table-control, .sg-table-team) td:last-child { grid-column: 2; grid-row: 1 / 4; align-self: center; }
 .ekos #content .sg-table-control td:nth-child(4)::before { content: 'Прогресс: '; color: var(--ekos-text-secondary); }
 .ekos #content .sg-table-control td:nth-child(4), .ekos #content .sg-table-control td:nth-child(5), .ekos #content .sg-table-team td:nth-child(4) { grid-column: 1; }
}

/* Shared page rhythm, including the legacy learning and employee screens. */
.ekos #content .section-title { margin: 0 0 24px; }
.ekos #content .sg-header { background: transparent; }
.ekos #content[data-ekos-screen="training-editor"] > :is(form.card, section.card) { width: 100%; margin: 0 0 24px; }
.ekos #content[data-ekos-screen="training-editor"] form.card { gap: 16px; }
.ekos #content[data-ekos-screen="training-editor"] :is(form.card, section.card) > :is(h3,p) { margin: 0; }
.ekos #content[data-ekos-screen="training-editor"] .inline-form { gap: 16px; }
.ekos #content .contacts { flex-wrap: wrap; min-width: 0; max-width: 100%; gap: 8px; }
.ekos #content .contact-chip { min-width: 44px; min-height: 44px; flex-shrink: 0; }
.ekos #content .contact-chip[aria-label="Telegram"] { width: auto; height: auto; padding: 8px; white-space: normal; overflow-wrap: anywhere; }
.ekos #content .contact-missing { color: var(--ekos-text-secondary); white-space: normal; }
.ekos #content .sg-mentor-card { flex-wrap: wrap; }
.ekos #content .sg-mentor-info { min-width: 0; }
.ekos #content .sg-tiles { gap: 12px; }
@media (min-width: 1100px) {
 .ekos #content .sg-tiles { grid-template-columns: repeat(5,minmax(0,1fr)); }
}
@media (max-width: 767px) {
 .ekos #content .sg-tiles { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .ekos #content .sg-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
 .ekos #content[data-ekos-screen="training-editor"] > :is(form.card,section.card) { margin-bottom: 16px; }
 .ekos #content[data-ekos-screen="training-editor"] .inline-form { display: grid; grid-template-columns: minmax(0,1fr); }
 .ekos #content[data-ekos-screen="training-editor"] .inline-form button { width: 100%; }
 .ekos #content .sg-mentor-card .contact-missing { width: 100%; }
}

/* The route editor's input style must not turn a learner's title into a field. */
.ekos #content div.sg-step-title { border: 0; border-radius: 0; padding: 0; background: transparent; font-size: 16px; font-weight: 600; }
.ekos #content :is(.section-title h2, .sg-title) { font-size: 26px; font-weight: 650; line-height: 1.25; }
/* Source employee-card details use the same reading rhythm as route panels. */
.sg-incomplete ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.sg-incomplete li { display: grid; gap: 6px; min-width: 0; }
.sg-incomplete-meta { color: var(--sg-muted, #667780); font-size: 14px; overflow-wrap: anywhere; }
.sg-incomplete a { overflow-wrap: anywhere; }
.sg-desk-head { flex-wrap: wrap; }
#newRegulationPlacements { display: grid; gap: 12px; }
#newRegulationPlacements select { max-width: 100%; }
.humor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.humor-actions button { min-height: 44px; }
/* Keep the format name readable when the editor toolbar wraps on phones. */
.ql-toolbar .ql-picker.ql-header { width: 140px; }
.ql-toolbar .ql-picker-label { white-space: nowrap; }
/* Imported history extends the current card, without changing its grid. */
.ekos-import-history { margin-block: 16px; min-width: 0; }
.ekos-import-history > summary { cursor: pointer; font-size: 18px; font-weight: 600; padding-block: 10px; }
.ekos-import-history :is(p,li,dd,summary) { overflow-wrap: anywhere; }
.ekos-import-history :is(summary,button):focus-visible { outline: 2px solid var(--ekos-text-primary, #263238); outline-offset: 3px; }
.ekos-archive-groups { display: grid; gap: 24px; }
.ekos-archive-groups h3 { margin: 0 0 12px; font-size: 17px; }
.ekos-archive-groups h4 { margin: 16px 0 8px; font-size: 15px; }
.ekos-archive-entry { border-bottom: 1px solid var(--ekos-border, #dce2e5); padding-block: 12px; }
.ekos-archive-entry > summary { display: list-item; cursor: pointer; padding-block: 8px; }
.ekos-archive-entry > summary strong { margin-inline-start: 12px; font-variant-numeric: tabular-nums; }
.ekos-archive-entry p { margin-block: 10px; }
.ekos-archive-facts { margin: 0; display: grid; gap: 8px; }
.ekos-archive-facts > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 3fr); gap: 12px; }
.ekos-archive-facts dt { color: var(--ekos-text-secondary, #52636d); }
.ekos-archive-facts dd { margin: 0; min-width: 0; }
.ekos-archive-files { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.ekos-archive-files button { min-height: 44px; white-space: normal; text-align: start; }
@media (max-width: 767px) {
 .ekos-archive-facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
 .ekos-archive-entry > summary strong { display: block; margin-inline-start: 0; margin-block-start: 4px; }
}
.ekos-archive-groups { grid-template-columns: minmax(0, 1fr); }
.ekos-archive-groups > section { min-width: 0; max-width: 100%; }
.ekos #content .ekos-import-history .sg-person-meta { white-space: normal; overflow: visible; text-overflow: clip; }
/* One type scale across every role and screen (EKOS UI standard). */
:root {
 --ekos-font-family: Inter, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
 --ekos-type-page: 26px;
 --ekos-type-section: 18px;
 --ekos-type-body: 16px;
 --ekos-type-caption: 14px;
}
.ekos { font-family: var(--ekos-font-family); font-size: var(--ekos-type-body); line-height: 1.5; }
.ekos :is(button,input,select,textarea) { font-family: inherit; }
.ekos #content :is(h1,h2,.sg-desk-title,.sg-title,.sg-header-name,.sg-trainee-name) { font-size: var(--ekos-type-page); line-height: 1.25; font-weight: 650; }
.ekos #content :is(h3,h4,.sg-panel-title,.ekos-archive-groups h3,.ekos-archive-groups h4) { font-size: var(--ekos-type-section); line-height: 1.4; font-weight: 600; }
.ekos #content :is(td,.sg-person-name,.sg-bar-value,.sg-state,.sg-badge,.id-status,.id-training-state,.account-name,.sg-list-title) { font-size: var(--ekos-type-body); line-height: 1.5; }
.ekos #content :is(.sg-person-name,.account-name,.sg-list-title) { font-weight: 600; }
.ekos #content :is(.sg-person-meta,.sg-cell-muted,.id-muted,.muted,.sg-subtitle,.sg-list-meta,.sg-list-sub,.sg-step-meta,.sg-block-sub,.sg-desk-sub) { font-size: var(--ekos-type-caption); line-height: 1.5; }
.ekos #content td.sg-cell-muted, .ekos #content .id-training-state { font-size: var(--ekos-type-body); }
.ekos #content :is(.sg-person-meta,.id-status) .id-muted { font-size: var(--ekos-type-caption); }
.ekos #content :is(th,.badge,.pill) { font-size: var(--ekos-type-caption); line-height: 1.5; }
.ekos #content :is(.sg-bar-value,.sg-progress-row) { font-variant-numeric: tabular-nums; }
/* Legacy desk selectors used to outrank the shared scale. */
.ekos #content.desk-skin { font-size: var(--ekos-type-body); }
.ekos #content.desk-skin :is(h1,h2,.section-title h2) { font-size: var(--ekos-type-page); }
.ekos #content.desk-skin :is(h3,h4,.profile-head h3) { font-size: var(--ekos-type-section); }
.ekos #content.desk-skin :is(p,.section-title p,.roster-row .muted,.notice,.profile-row,.draft-row,.prog-group-title,.prog-hint,.prog-side-title) { font-size: var(--ekos-type-caption); line-height: 1.5; }
.ekos #content.desk-skin :is(input:not([class*="sg-"]),select:not([class*="sg-"]),textarea:not([class*="sg-"]),button:not([class*="sg-"]),.roster-row strong,.account-name) { font-size: var(--ekos-type-body); }
.ekos #content :is(.sg-tile-label,.sg-tile-note,.sg-open-link,.sg-recipients-count,.sg-recipient-job,.sg-cat-meta,.sg-block-chip-count,.sg-awaiting,.sg-manager-title,.sg-manager-waiting,.sg-trainee-more,.sg-welcome-foot,.contact-missing,.sg-today-banner,.sg-day-heading,.sg-day-now,.sg-link-note,.sg-ref-group-title,.sg-ref-chevron,.account-no-contacts,.detail,.prog-pick,.sg-link-btn,.sg-cat-action) { font-size: var(--ekos-type-caption); line-height: 1.5; }
.ekos #content :is(.sg-cat-name,.sg-recipient-name,.sg-prog-btn) { font-size: var(--ekos-type-body); }
.ekos #content :is(.sg-trainee-quiet,.sg-note-list,.sg-memo-guide) :is(p,li,span,strong,summary,button) { font-size: var(--ekos-type-caption); }
.ekos #content .notifications-card :is(p,strong) { font-size: var(--ekos-type-caption); }
.ekos #content .sg-trainee-who span { font-size: var(--ekos-type-caption); }
.ekos #content .sg-trainee-tools button.secondary { font-size: var(--ekos-type-caption); }
.ekos #content .id-row .id-more-list .id-button { font-size: var(--ekos-type-body); }
.ekos #content :is(.prog-filter,.prog-filter span,.prog-hint,.sg-memo > summary,.account-contacts a,.sg-ref-row,.sg-ref-label > span,.sg-ref-icon) { font-size: var(--ekos-type-caption); }
.ekos #content button.secondary { font-size: var(--ekos-type-body); }
.ekos #content :is(.sg-status-line strong,.sg-recipients-head strong) { font-size: var(--ekos-type-body); }
.ekos #content .sg-recipients-summary strong { font-size: var(--ekos-type-body); }
/* Visual pass: keep control columns readable and phone tables as cards. */
@media (min-width: 768px) {
 .ekos #content .sg-table-control { table-layout: fixed; }
 .ekos #content .sg-table-control th:nth-child(1) { width: 28%; }
 .ekos #content .sg-table-control th:nth-child(2) { width: 16%; }
 .ekos #content .sg-table-control th:nth-child(3) { width: 14%; }
 .ekos #content .sg-table-control th:nth-child(4) { width: 12%; }
 .ekos #content .sg-table-control th:nth-child(5) { width: 18%; }
 .ekos #content .sg-table-control th:nth-child(6) { width: 12%; }
 .ekos #content .sg-table-control .sg-bar-track { width: 48px; }
 .ekos #content .sg-table-control .sg-bar-value { white-space: nowrap; }
}
.ekos #content .sg-tile-value { font-size: 28px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ekos #content .sg-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; }
.ekos #content .sg-tile-label { line-height: 1.5; }
@media (min-width: 1024px) {
 .ekos #content[data-ekos-screen="users"] .account-row:not(.roster-row-edit) { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) minmax(0,.8fr) minmax(0,1fr) minmax(0,1.1fr) 84px 96px; gap: 12px; }
 .ekos #content[data-ekos-screen="users"] .account-row:not(.roster-row-edit) > * { grid-column: auto; grid-row: auto; }
 .ekos #createUserForm .inline-form { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-items: end; }
 .ekos #createUserForm .inline-form > * { min-width: 0; }
 .ekos #createUserForm .inline-form > button { justify-self: start; }
}
@media (max-width: 767px) {
 .ekos #content[data-ekos-screen="users"] section.card > .section-title { flex-wrap: wrap; gap: 12px; }
 .ekos #content[data-ekos-screen="users"] section.card > .section-title h3 { flex: 1 0 100%; white-space: nowrap; }
 .ekos #content[data-ekos-screen="users"] section.card > .section-title .check-row { max-width: 100%; }
 .ekos #content .sg-status-line { flex-wrap: wrap; }
 .ekos #content .sg-status-line .detail { flex: 1 1 100%; }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) { display: block; }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) tbody { display: block; }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) tbody tr { display: grid; grid-template-columns: minmax(0,1fr); gap: 8px; padding: 16px; border-bottom: 1px solid var(--ekos-border); }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) tbody tr:last-child { border-bottom: 0; }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) td { display: block; width: auto; min-width: 0; border: 0; padding: 0; overflow-wrap: break-word; }
 .ekos #content :is(.sg-table-roadmaps,.sg-table-outbox,.sg-table-materials) .sg-table-empty td { text-align: left; }
 .ekos #content .sg-table-roadmaps .sg-cat-actions { justify-content: flex-start; flex-wrap: wrap; }
 .ekos #content .sg-table-roadmaps .sg-cat-action { min-height: 44px; white-space: nowrap; }
 .ekos #content .sg-table-roadmaps .sg-state { white-space: normal; }
 .ekos #content .sg-table-materials td:nth-child(2)::before { content: 'Назначено: '; }
 .ekos #content .sg-table-materials td:nth-child(3)::before { content: 'Ознакомились: '; }
 .ekos #content .sg-table-materials td:nth-child(4)::before { content: 'Тест сдан: '; }
 .ekos #content .sg-table-materials td:nth-child(5)::before { content: 'Средний балл: '; }
 .ekos #content .sg-table-outbox td[data-label]:not([data-label=""])::before { content: attr(data-label) ': '; color: var(--ekos-text-secondary); }
}
@media (max-width: 479px) {
 .ekos #createUserForm .inline-form { display: grid; grid-template-columns: minmax(0,1fr); }
 .ekos #createUserForm .inline-form > button { justify-self: start; }
}
@media (min-width: 768px) {
 .ekos #content[data-ekos-screen="training-editor"] form.card > button { justify-self: start; width: auto; }
}
@media (min-width: 768px) {
 .ekos #content .sg-table-roadmaps { table-layout: fixed; }
 .ekos #content .sg-table-roadmaps th:nth-child(1) { width: 26%; }
 .ekos #content .sg-table-roadmaps th:nth-child(2) { width: 16%; }
 .ekos #content .sg-table-roadmaps th:nth-child(3) { width: 16%; }
 .ekos #content .sg-table-roadmaps th:nth-child(4) { width: 16%; }
 .ekos #content .sg-table-roadmaps th:nth-child(5) { width: 12%; }
 .ekos #content .sg-table-roadmaps th:nth-child(6) { width: 14%; }
 .ekos #content .sg-table-roadmaps .sg-cat-actions { flex-wrap: wrap; }
}
@media (max-width: 767px) {
 .ekos #content .sg-table-materials td { text-align: left; }
}
.ekos #content :is(.sg-mastery-head,.sg-history-date,.sg-history-text) { font-size: var(--ekos-type-caption); line-height: 1.5; }
.ekos #content .sg-trainee-head .check-row { display: flex; align-items: center; gap: 8px; margin-block: 8px; }
.ekos #content .sg-trainee-head .check-row label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: var(--ekos-type-body); }
@media (max-width: 767px) {
 .ekos #content .sg-table-control td:nth-child(4) { display: flex; align-items: center; gap: 8px; }
 .ekos #content .sg-table-control td:last-child { grid-row: 1 / 5; align-self: start; }
}

/* Approved scale: distinguish primary content, secondary captions and actions. */
.ekos #content :is(.sg-btn,.sg-open-link,.sg-cat-action,.sg-chip-filter,.sg-desk-back,.sg-link-btn,.prog-pick,.sg-prog-btn,.sg-ref-row,.id-button,.button-link) { font-size: var(--ekos-type-body); }
.ekos #content :is(button,summary,.button-link) { min-height: 44px; min-width: 44px; box-sizing: border-box; }
.ekos #content :is(button,summary) :is(.sg-ref-label > span:first-child) { font-size: var(--ekos-type-body); }
.ekos #content .sg-ref-row .sg-link-note { font-size: var(--ekos-type-caption); }
.ekos #content.desk-skin label:not([class*="sg-"]) { font-size: var(--ekos-type-body); }
.ekos #content.desk-skin p:not(.muted):not(.prog-hint):not(.sg-person-meta):not(.sg-desk-sub) { font-size: var(--ekos-type-body); }
.ekos #content.desk-skin .section-title p, .ekos #content .profile-row { font-size: var(--ekos-type-caption); }
.ekos #content :is(.sg-person-meta,.sg-person-meta span,.id-muted,.account-login,.account-role,.account-location,.account-contacts,.sg-list-meta,.sg-step-meta,.sg-history-date,.sg-history-text) { font-size: var(--ekos-type-caption); line-height: 1.5; }
.ekos #content :is(.sg-person-name,.account-name,.sg-list-title,.sg-step-title,.id-status,.sg-state,.sg-bar-value) { font-size: var(--ekos-type-body); }
.ekos #content .sg-trainee-quiet button, .ekos #content .sg-memo > summary.sg-btn, .ekos #content .sg-trainee-tools button.secondary { font-size: var(--ekos-type-body); }
.ekos .topbar .icon-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
@media (min-width: 768px) and (max-width: 1100px) {
 .ekos #content .sg-table .sg-bar-track { display: none; }
}
.ekos #content :is(.sg-trainee-quiet,.sg-note-list,.sg-memo-guide) button, .ekos #content .sg-memo > summary { font-size: var(--ekos-type-body); }

.ekos #content.desk-skin :is(label,legend) { font-size: var(--ekos-type-body); }

/* Login actions occupy separate rows, including the OIDC link appended at boot. */
.ekos .login-card .id-button {
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  max-width: 100%;
  text-decoration: none;
}
.ekos .login-card > [data-id-login] { margin-top: 12px; }

/* OIDC entry uses the same compact card width as the regular login. */
.ekos main.id-entry { width: 100%; max-width: 478px; margin: 6vh auto; padding: 0 24px; box-sizing: border-box; }
.ekos .id-entry .id-panel { margin: 0; padding: 16px; }
.ekos .id-entry .id-actions { margin-top: 12px; }
.ekos .id-entry .id-actions .id-button { flex: 0 1 auto; min-width: 0; }
.ekos .id-entry .id-button { max-width: 100%; box-sizing: border-box; }
@media (max-width: 767px) { .ekos main.id-entry { padding: 0 16px; } }
