

.brand {
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  
  --bg-page: #fafafa;
  --bg-surface: #ffffff;
  --bg-subtle: #f4f4f5;
  --bg-hover: #efefef;
  --fg: #0a0a0a;
  --fg-2: #404040;
  --fg-muted: #636363;          
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --border-input: #8c8c8c;      
  --primary: #fac800;
  --primary-hover: #ffd84d;
  --primary-fg: #733e0a;        
  --destructive: #e40014;
  --focus: #0a0a0a;             

  
  --neutral-fg: #525252;  --neutral-bg: #f4f4f5;  --neutral-line: #a3a3a3;
  --client-fg: #1d4ed8;   --client-bg: #eef3ff;   --client-line: #2f6fed;
  --brand-fg: #8a4b00;      --brand-bg: #fff3dc;      --brand-line: #b26a00;
  --danger-fg: #c0000f;   --danger-bg: #fdeced;   --danger-line: #e40014;
  --success-fg: #1b6b2e;  --success-bg: #eaf6ec;  --success-line: #2e7d32;

  
  --ai: #6d3fd1;  --ai-fg: #5b2fc2;  --ai-bg: #f3effc;

  
  --rule: #0f6b5c;
  --override-fg: #8a4b00;  --override-dot: #e07b00;
  --changed-bg: #fff4d6;

  
  --note-nc-line: #b26a00;      --note-nc-fg: #7a4200;      --note-nc-bg: #fff3dc;
  --note-scheme-line: #2f6fed;  --note-scheme-fg: #1d4ed8;  --note-scheme-bg: #eef3ff;

  
  --av-violet-bg: #ece6fb; --av-violet-fg: #5b2fc2;
  --av-amber-bg: #fff3dc;  --av-amber-fg: #7a4200;
  --av-teal-bg: #dff1ec;   --av-teal-fg: #0f5c50;
  --av-blue-bg: #eef3ff;   --av-blue-fg: #1d4ed8;
  --av-neutral-bg: #f4f4f5; --av-neutral-fg: #404040;

  
  --radius-sm: 3.2px;
  --radius-md: 5.2px;    
  --radius: 7.2px;       
  --radius-xl: 11.2px;   
  --radius-full: 9999px;

  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.2);
  --scrim: rgba(10, 10, 10, 0.45);

  --control-staff: 36px;
  --control-portal: 48px;

  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 20px;
  color: var(--fg);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01" on;
}

.brand[data-theme="dark"] {
  --bg-page: #0a0a0a; --bg-surface: #141414; --bg-subtle: #1f1f1f; --bg-hover: #262626;
  --fg: #fafafa; --fg-2: #d4d4d4; --fg-muted: #a1a1a1;
  --border: #2a2a2a; --border-strong: #3a3a3a; --border-input: #737373;
  --primary: #f0b100; --primary-hover: #f5c02e; --primary-fg: #5c3008;
  --destructive: #ff6467; --focus: #fafafa;
  --neutral-fg: #d4d4d4; --neutral-bg: #262626; --neutral-line: #737373;
  --client-fg: #9ab8ff;  --client-bg: #172340;  --client-line: #6b9bff;
  --brand-fg: #f5b453;     --brand-bg: #2e2009;     --brand-line: #e0a030;
  --danger-fg: #ff7b7e;  --danger-bg: #3a1214;  --danger-line: #ff6467;
  --success-fg: #74d38f; --success-bg: #10281a; --success-line: #4fb56d;
  --ai: #a585ff; --ai-fg: #c0a8ff; --ai-bg: #231a3a;
  --rule: #4fc4ad; --override-fg: #f5b453; --override-dot: #f59e2e;
  --changed-bg: #3a2e0c;
  --note-nc-line: #e0a030; --note-nc-fg: #f5b453; --note-nc-bg: #2e2009;
  --note-scheme-line: #6b9bff; --note-scheme-fg: #9ab8ff; --note-scheme-bg: #172340;
  --av-violet-bg: #2c2148; --av-violet-fg: #c0a8ff;
  --av-amber-bg: #2e2009;  --av-amber-fg: #f5b453;
  --av-teal-bg: #0f2a25;   --av-teal-fg: #6fd6c0;
  --av-blue-bg: #172340;   --av-blue-fg: #9ab8ff;
  --av-neutral-bg: #262626; --av-neutral-fg: #d4d4d4;
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px #2a2a2a;
  --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px #2a2a2a;
  --scrim: rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  .brand:not([data-theme="light"]) {
    --bg-page: #0a0a0a; --bg-surface: #141414; --bg-subtle: #1f1f1f; --bg-hover: #262626;
    --fg: #fafafa; --fg-2: #d4d4d4; --fg-muted: #a1a1a1;
    --border: #2a2a2a; --border-strong: #3a3a3a; --border-input: #737373;
    --primary: #f0b100; --primary-hover: #f5c02e; --primary-fg: #5c3008;
    --destructive: #ff6467; --focus: #fafafa;
    --neutral-fg: #d4d4d4; --neutral-bg: #262626; --neutral-line: #737373;
    --client-fg: #9ab8ff;  --client-bg: #172340;  --client-line: #6b9bff;
    --brand-fg: #f5b453;     --brand-bg: #2e2009;     --brand-line: #e0a030;
    --danger-fg: #ff7b7e;  --danger-bg: #3a1214;  --danger-line: #ff6467;
    --success-fg: #74d38f; --success-bg: #10281a; --success-line: #4fb56d;
    --ai: #a585ff; --ai-fg: #c0a8ff; --ai-bg: #231a3a;
    --rule: #4fc4ad; --override-fg: #f5b453; --override-dot: #f59e2e;
    --changed-bg: #3a2e0c;
    --note-nc-line: #e0a030; --note-nc-fg: #f5b453; --note-nc-bg: #2e2009;
    --note-scheme-line: #6b9bff; --note-scheme-fg: #9ab8ff; --note-scheme-bg: #172340;
    --av-violet-bg: #2c2148; --av-violet-fg: #c0a8ff;
    --av-amber-bg: #2e2009;  --av-amber-fg: #f5b453;
    --av-teal-bg: #0f2a25;   --av-teal-fg: #6fd6c0;
    --av-blue-bg: #172340;   --av-blue-fg: #9ab8ff;
    --av-neutral-bg: #262626; --av-neutral-fg: #d4d4d4;
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px #2a2a2a;
    --shadow-overlay: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px #2a2a2a;
    --scrim: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}

.brand *, .brand *::before, .brand *::after { box-sizing: border-box; }
.brand h1, .brand h2, .brand h3, .brand h4, .brand p, .brand ul, .brand ol, .brand dl, .brand dd, .brand figure { margin: 0; }
.brand ul, .brand ol { padding: 0; list-style: none; }
.brand h1 { font-size: 24px; line-height: 32px; font-weight: 500; letter-spacing: -0.02em; }
.brand h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.brand h3 { font-size: 14px; line-height: 20px; font-weight: 600; }
.brand a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--border-input); text-underline-offset: 3px; }
.brand a:hover { text-decoration-color: var(--fg); }
.brand button, .brand input, .brand select, .brand textarea { font: inherit; color: inherit; }
.brand button { cursor: pointer; }
.brand :focus { outline: none; }
.brand :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.brand s { color: var(--fg-muted); }
.brand-app { min-height: 100vh; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--font-mono); font-size: 0.93em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--fg-muted); }
.small { font-size: 13px; line-height: 18px; }
.xs { font-size: 12px; line-height: 16px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.brand .eyebrow, .eyebrow { font-family: var(--font-mono); font-size: 11px; line-height: 16px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-muted); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1 1 auto; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

.ic { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 20px; height: 20px; }

.ph-tag { display: inline-flex; align-items: center; margin-left: 6px; padding: 0 6px; height: 18px; border: 1px dashed var(--neutral-line); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 10.5px; line-height: 16px; font-weight: 400; letter-spacing: 0.02em; color: var(--neutral-fg); background: var(--bg-surface); white-space: nowrap; vertical-align: 1px; text-transform: none; }

.t-de { display: none; }
.lang-de .t-de { display: revert; }
.lang-de .t-en { display: none; }

.pin { display: none; }
.notes-on .pin { display: inline-block; position: relative; vertical-align: middle; margin: 0 4px; z-index: 5; }
.pin > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 1px 8px; border: 1.5px dashed; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 400; cursor: pointer; white-space: nowrap; text-transform: none; letter-spacing: 0; }
.pin > summary::-webkit-details-marker { display: none; }
.pin > summary::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: currentColor; flex: 0 0 auto; }
.pin-nc > summary { color: var(--note-nc-fg); background: var(--note-nc-bg); border-color: var(--note-nc-line); }
.pin-scheme > summary { color: var(--note-scheme-fg); background: var(--note-scheme-bg); border-color: var(--note-scheme-line); }
.pin-body { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: min(360px, 84vw); padding: 12px 14px; border-radius: var(--radius); background: var(--bg-surface); color: var(--fg); box-shadow: var(--shadow-pop); border: 1.5px dashed; font-family: var(--font-sans); font-size: 13px; line-height: 19px; font-weight: 400; white-space: normal; text-align: left; text-transform: none; letter-spacing: 0; display: flex; flex-direction: column; gap: 8px; }
.pin-nc .pin-body { border-color: var(--note-nc-line); }
.pin-scheme .pin-body { border-color: var(--note-scheme-line); }
.pin-right .pin-body { left: auto; right: 0; }

.notes-on .pin[open], .notes-on .pin:focus-within { z-index: 90; }

.notes-on :is(.work-side, .p-rail, .p-split-aside, .p02-aside, .p04-side, .modal, .drawer-body, .popover, .o4-stage, .o5-stage, .table-wrap:not(.tw-fit)) .pin[open] { display: block; max-width: 100%; }
.notes-on :is(.work-side, .p-rail, .p-split-aside, .p02-aside, .p04-side, .modal, .drawer-body, .popover, .o4-stage, .o5-stage, .table-wrap:not(.tw-fit)) .pin[open] > .pin-body { position: static; width: auto; margin-top: 6px; box-shadow: none; }
@media (max-width: 1279px) {
  .notes-on .table-wrap.tw-fit .pin[open] { display: block; max-width: 100%; }
  .notes-on .table-wrap.tw-fit .pin[open] > .pin-body { position: static; width: auto; margin-top: 6px; box-shadow: none; }
}

@container portal (width < 768px) {
  .notes-on .pin[open] { display: block; max-width: 100%; }
  .notes-on .pin[open] > .pin-body { position: static; width: auto; margin-top: 6px; box-shadow: none; }
}
.pin-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); display: block; margin-bottom: 2px; }
.pin-block { margin: 6px 0 0; }
.notes-on .pin.pin-block { display: block; margin: 6px 0 0; }
.notes-on .pin-target-scheme { outline: 1.5px dashed var(--note-scheme-line); outline-offset: 3px; }

.ghost { display: none !important; }
.notes-on .ghost-box { border: 1.5px dashed var(--note-nc-line); border-radius: var(--radius); background: repeating-linear-gradient(135deg, transparent 0 8px, var(--note-nc-bg) 8px 9px); color: var(--fg-muted); padding: 10px 12px; }
.notes-on tr.ghost td { border-top: 1.5px dashed var(--note-nc-line); color: var(--fg-muted); font-style: italic; background: repeating-linear-gradient(135deg, transparent 0 8px, var(--note-nc-bg) 8px 9px); }

.sample-label { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border: 1px solid var(--brand-line); border-radius: var(--radius-sm); color: var(--brand-fg); background: var(--brand-bg); font-size: 12px; line-height: 18px; font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--control-staff); padding: 0 14px; border-radius: var(--radius-md); border: 1px solid transparent; font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.brand a.btn { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.brand a.btn-primary { color: var(--primary-fg); }
.btn-secondary { background: var(--bg-surface); color: var(--fg); border-color: var(--border-input); }
.btn-secondary:hover { background: var(--bg-hover); }
.btn-ghost { background: transparent; color: var(--fg); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-danger { background: var(--danger-fg); color: #ffffff; border-color: var(--danger-fg); }
.btn-danger:hover { filter: brightness(1.08); }
.brand[data-theme="dark"] .btn-danger { background: var(--destructive); color: #1a0000; border-color: var(--destructive); }
@media (prefers-color-scheme: dark) { .brand:not([data-theme="light"]) .btn-danger { background: var(--destructive); color: #1a0000; border-color: var(--destructive); } }
.btn-sm { min-height: 28px; padding: 0 10px; font-size: 13px; }
.btn-lg { min-height: var(--control-portal); padding: 0 20px; font-size: 15px; }
.btn-icon { width: var(--control-staff); padding: 0; }
.btn-icon.btn-sm { width: 28px; }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; filter: none; }
.btn-link { background: none; border: 0; padding: 0; min-height: 0; color: var(--fg); font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-input); text-underline-offset: 3px; cursor: pointer; }
.btn-link:hover { text-decoration-color: var(--fg); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.disabled-reason { font-size: 12px; line-height: 16px; color: var(--fg-muted); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--fg); }
.label .opt { font-weight: 400; color: var(--fg-muted); }
.input, .select, .textarea { width: 100%; min-height: var(--control-staff); padding: 0 10px; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--fg); font-size: 14px; }
.textarea { padding: 8px 10px; min-height: 88px; line-height: 20px; resize: vertical; }
.select { padding-right: 28px; appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input::placeholder, .textarea::placeholder { color: var(--fg-muted); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger-line); box-shadow: 0 0 0 1px var(--danger-line); }
.input:disabled, .input[readonly] { background: var(--bg-subtle); }
.help { font-size: 12px; line-height: 16px; color: var(--fg-muted); }
.error-text { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 16px; color: var(--danger-fg); font-weight: 500; }
.input-search { padding-left: 32px; background-image: none; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap > .ic { position: absolute; left: 10px; color: var(--fg-muted); pointer-events: none; }

.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; line-height: 20px; }
.check input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--fg); flex: 0 0 auto; }
.portal .check { min-height: 48px; align-items: center; padding: 4px 0; }
.portal .check input { width: 22px; height: 22px; margin: 0; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; position: relative; line-height: 20px; }
.switch input { position: absolute; opacity: 0; width: 34px; height: 20px; margin: 0; cursor: pointer; }
.switch-track { width: 34px; height: 20px; border-radius: var(--radius-full); background: var(--bg-subtle); border: 1px solid var(--border-input); position: relative; flex: 0 0 auto; transition: background-color 0.15s; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--fg-muted); transition: transform 0.15s, background-color 0.15s; }
.switch input:checked + .switch-track { background: var(--fg); border-color: var(--fg); }
.switch input:checked + .switch-track::after { transform: translateX(14px); background: var(--bg-surface); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }

.seg { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--bg-surface); flex-wrap: wrap; }
.seg button { min-height: 30px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.seg button:hover { background: var(--bg-hover); }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg-surface); }
.seg-sm button { min-height: 26px; padding: 0 8px; font-size: 12px; }

.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border-input); border-radius: var(--radius); background: var(--bg-surface); cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--fg); box-shadow: 0 0 0 1px var(--fg); }
.radio-card:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.radio-card input { margin: 3px 0 0; accent-color: var(--fg); }

.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-title { font-size: 15px; line-height: 22px; font-weight: 600; }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-flush { padding: 0; }
.card-emph { border-color: var(--border-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }

.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 16px; }
.kv dt { color: var(--fg-muted); }
.kv dd { margin: 0; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); }
@media (min-width: 1280px) { .table-wrap.tw-fit { overflow: visible; } }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--fg-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--bg-surface); }
.table td { padding: 10px 12px; border-top: 1px solid var(--border); vertical-align: top; }
.table tbody tr:first-child td { border-top: 0; }
.table tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger-line); }
.table .td-sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 13px; color: var(--fg-muted); }
.table .td-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .td-menu { width: 44px; text-align: right; }
.table .group-row td { padding: 0; border-top: 1px solid var(--border); background: var(--bg-subtle); }
.group-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 0 12px; border: 0; background: transparent; text-align: left; font-weight: 600; font-size: 13px; }
.group-toggle .ic { transition: transform 0.15s; }
.group-toggle[aria-expanded="false"] .ic-chev { transform: rotate(-90deg); }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--bg-surface); border: 1px solid var(--border-strong); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg-2); }

.empty { padding: 40px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--fg-muted); }
.empty strong { color: var(--fg); font-weight: 500; }

.list { display: flex; flex-direction: column; }
.list > li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; padding-top: 0; }

sc-for, sc-if { display: contents; }
.dgrid { display: grid; width: 100%; font-size: 14px; }
.dg-row { display: contents; }
.dg-cell { padding: 10px 12px; border-top: 1px solid var(--border); min-width: 0; background: var(--bg-surface); }
.dg-head > .dg-cell { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--fg-muted); border-top: 0; white-space: nowrap; }
.dg-span { grid-column: 1 / -1; }
.dg-group > .dg-cell { padding: 0; background: var(--bg-subtle); }
.dg-row.is-overdue > .dg-cell:first-child { box-shadow: inset 3px 0 0 var(--danger-line); }
.dg-row.is-highlight > .dg-cell { background: var(--changed-bg); }
.dg-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dg-menu { display: flex; justify-content: flex-end; align-items: flex-start; }
.dg-cell .td-sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; font-size: 13px; color: var(--fg-muted); }
.ghost.dg-row { display: none !important; }
.notes-on .ghost.dg-row > .dg-cell { border-top: 1.5px dashed var(--note-nc-line); color: var(--fg-muted); font-style: italic; background: repeating-linear-gradient(135deg, transparent 0 8px, var(--note-nc-bg) 8px 9px); }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--radius-full); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; border: 1px solid transparent; }
.chip .ic { width: 13px; height: 13px; vertical-align: 0; }
.chip-neutral { color: var(--neutral-fg); background: var(--neutral-bg); border-color: var(--border-strong); }
.chip-client { color: var(--client-fg); background: var(--client-bg); }
.chip-brand { color: var(--brand-fg); background: var(--brand-bg); }
.chip-danger { color: var(--danger-fg); background: var(--danger-bg); }
.chip-success { color: var(--success-fg); background: var(--success-bg); }
.chip-lg { height: 28px; padding: 0 12px; font-size: 13px; }

.scheme { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 12px; line-height: 16px; font-weight: 500; color: var(--fg-2); background: var(--bg-surface); white-space: nowrap; }

.reg { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11.5px; line-height: 16px; color: var(--fg-2); background: var(--bg-subtle); white-space: nowrap; }
.reg-pending { border-style: dashed; border-color: var(--neutral-line); background: transparent; color: var(--neutral-fg); font-family: var(--font-sans); font-size: 12px; }

.rule-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--rule); border-radius: var(--radius-sm); color: var(--rule); font-size: 12px; line-height: 18px; font-weight: 500; background: transparent; }

.pc-marker { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--override-fg); font-size: 12px; font-weight: 600; line-height: 18px; }
.pc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--override-dot); flex: 0 0 auto; }
.pc-was { text-decoration: line-through; color: var(--fg-muted); margin-right: 6px; }
.tip-host { position: relative; display: inline-flex; }
.tip { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 30; width: max-content; max-width: 300px; padding: 8px 10px; border-radius: var(--radius); background: var(--fg); color: var(--bg-surface); font-size: 12px; line-height: 17px; font-weight: 400; box-shadow: var(--shadow-pop); visibility: hidden; opacity: 0; transition: opacity 0.12s; pointer-events: none; }
.tip-host:hover .tip, .tip-host:focus-within .tip { visibility: visible; opacity: 1; }

.case-stepper { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cs-step { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 3px solid var(--border-strong); min-width: 0; }
.cs-step .cs-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.cs-step .cs-meta { font-size: 12px; line-height: 16px; color: var(--fg-muted); }
.cs-step.is-done { border-top-color: var(--success-line); }
.cs-step.is-done .cs-name { color: var(--fg); }
.cs-step.is-current { border-top-color: var(--fg); }
.cs-step.is-blocked { border-top-color: var(--neutral-line); border-top-style: dashed; }
.cs-step.is-upcoming .cs-name { color: var(--fg-muted); font-weight: 500; }
@media (max-width: 900px) { .case-stepper { grid-template-columns: 1fr; } }

.mini-steps { display: inline-flex; gap: 3px; align-items: center; margin-right: 6px; vertical-align: 1px; }
.mini-steps i { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--fg-muted); display: block; }
.mini-steps i.on { background: var(--fg); border-color: var(--fg); }
.mini-steps.is-closed i.on { background: var(--neutral-line); border-color: var(--neutral-line); }
.stage-cell { display: flex; flex-direction: column; gap: 4px; }
.stage-name { display: inline-flex; align-items: center; font-weight: 500; }

.p-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.p-step { display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 17px; color: var(--fg-muted); }
.p-step .bar { height: 4px; border-radius: 2px; background: var(--border-strong); }
.p-step.is-done .bar { background: var(--success-line); }
.p-step.is-current .bar { background: var(--fg); }
.p-step.is-current { color: var(--fg); font-weight: 600; }
.p-step.is-done { color: var(--fg-2); }
.p-step .p-step-state { font-size: 12px; font-weight: 400; color: var(--fg-muted); }

.banners { display: flex; flex-direction: column; gap: 8px; }
.banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius); border: 1px solid; font-size: 14px; }
.banner-brand { background: var(--brand-bg); border-color: var(--brand-line); color: var(--fg); }
.banner-brand > .ic { color: var(--brand-fg); }
.banner-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--fg); }
.banner-danger > .ic { color: var(--danger-fg); }
.banner-info { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--fg); }
.banner .banner-text { flex: 1 1 240px; }
.banner a, .banner .btn-link { font-weight: 600; }
.banner-more { font-size: 13px; color: var(--fg-muted); }

.done-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); }
.done-row > .ic { color: var(--success-fg); }
.done-row .done-name { font-weight: 600; flex: 0 0 auto; white-space: nowrap; }
.done-row .done-sum { color: var(--fg-muted); flex: 1 1 auto; min-width: 0; }

.ai { border-left: 3px solid var(--ai); background: var(--ai-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; line-height: 18px; min-width: 0; }
.ai-label { display: inline-flex; align-items: center; gap: 5px; color: var(--ai-fg); font-weight: 600; font-size: 12px; line-height: 16px; }
.ai-label .ic { width: 14px; height: 14px; }
.ai-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-verdict { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border: 1px solid; border-radius: var(--radius-full); font-size: 12px; font-weight: 500; background: transparent; }
.v-ok { color: var(--success-fg); border-color: var(--success-line); }
.v-problem { color: var(--brand-fg); border-color: var(--brand-line); }
.v-person { color: var(--neutral-fg); border-color: var(--neutral-line); }
.ai-evidence { color: var(--fg); }
.ai-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-actions .btn { min-height: 26px; padding: 0 8px; font-size: 12px; }
.ai-running { position: relative; overflow: hidden; color: var(--fg-muted); }
.ai-running .shimmer { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--bg-subtle) 0%, var(--bg-hover) 40%, var(--bg-subtle) 80%); background-size: 200% 100%; animation: brand-shimmer 1.4s linear infinite; }
.ai-none { color: var(--fg-muted); font-style: italic; }
.ai-rel { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; border: 1px dashed var(--ai); color: var(--ai-fg); background: var(--bg-surface); white-space: nowrap; }
.ai-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: var(--radius); background: var(--ai-bg); border: 1px solid var(--ai); color: var(--fg); font-size: 13px; }
.ai-bar .ic { color: var(--ai-fg); }
@keyframes brand-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ai-running .shimmer { animation: none; } .brand * { transition: none !important; } }

.ov-layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.brand-app .ov-layer { top: var(--mkh, 0px); }
.brand-app .modal { max-height: calc(100vh - var(--mkh, 0px) - 32px); }
.ov-layer.ov-right { justify-content: flex-end; align-items: stretch; padding: 0; }
.ov-layer.ov-standalone { position: relative; min-height: 100vh; }
.ov-backdrop { position: absolute; inset: 0; background: var(--scrim); border: 0; padding: 0; width: 100%; cursor: default; }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-overlay); display: flex; flex-direction: column; }
.modal-lg { width: min(80vw, 1200px); height: min(80vh, 900px); }
.modal-head { padding: 20px 20px 0; display: flex; align-items: flex-start; gap: 12px; }
.modal-title { font-size: 17px; line-height: 24px; font-weight: 600; flex: 1 1 auto; }
.modal-body { padding: 10px 20px 4px; display: flex; flex-direction: column; gap: 8px; color: var(--fg-2); }
.modal-body p { margin: 0; }
.modal-foot { padding: 16px 20px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-danger .modal-title { color: var(--danger-fg); }

.drawer { position: relative; height: 100%; max-height: 100vh; width: min(560px, 100%); background: var(--bg-surface); box-shadow: var(--shadow-overlay); display: flex; flex-direction: column; }
.drawer-640 { width: min(640px, 100%); }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 17px; line-height: 24px; font-weight: 600; flex: 1 1 auto; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.drawer-foot { position: sticky; bottom: 0; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-surface); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.ov-standalone .drawer { min-height: 100vh; }

.popover { position: relative; width: min(420px, 100%); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; }

.receipt { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--success-line); border-radius: var(--radius); background: var(--success-bg); }
.receipt > .ic { width: 24px; height: 24px; color: var(--success-fg); margin-top: 2px; }
.receipt-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 auto; }
.receipt-title { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--fg); }
.receipt-meta { font-size: 13px; color: var(--fg-2); }
.receipt-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--fg); color: var(--bg-surface); box-shadow: var(--shadow-overlay); font-size: 14px; }
.toast .ic { flex: 0 0 auto; }

.sign { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sign-above { font-size: 14px; color: var(--fg); }
.sign-frame { position: relative; min-width: 320px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-subtle); overflow: hidden; display: flex; flex-direction: column; }
.sign-frame-label { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--border-strong); background: var(--bg-surface); font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.sign-inner { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.sign-doc { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; font-size: 13px; color: var(--fg-2); min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.sign-doc .line { height: 6px; border-radius: 3px; background: var(--bg-subtle); }
.sign-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-strong); }
.sign-tabs button { min-height: 32px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; font-weight: 500; color: var(--fg-muted); }
.sign-tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.sign-pad { height: 120px; border: 1px dashed var(--border-input); border-radius: var(--radius-sm); background: var(--bg-surface); position: relative; display: flex; align-items: flex-end; padding: 8px 12px; }
.sign-pad::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 30px; border-top: 1px solid var(--border-strong); }
.sign-pad .sign-ink { font-family: "Segoe Script", "Brush Script MT", cursive; font-size: 30px; line-height: 1; color: var(--fg); position: relative; z-index: 1; margin-bottom: 26px; }
.sign-pad-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.sign-state { min-height: 160px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; color: var(--fg-2); }
.sign-below { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--fg-muted); }
.sign-compact .sign-inner { padding: 10px; gap: 8px; }
.sign-compact .sign-frame { min-height: 220px; }
.sign-compact .sign-pad { height: 88px; }
.sign-compact .sign-doc { display: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--fg); animation: brand-spin 0.8s linear infinite; }
@keyframes brand-spin { to { transform: rotate(360deg); } }

.disclosure > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-input); text-underline-offset: 3px; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary .ic { transition: transform 0.15s; }
.disclosure[open] > summary .ic { transform: rotate(90deg); }
.disclosure > .disclosure-body { margin-top: 8px; }

.sec-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
.ss-complete { color: var(--success-fg); }
.ss-gaps { color: var(--brand-fg); }
.ss-gaps::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-line); }
.ss-changed { color: var(--brand-fg); }
.ss-confirmed { color: var(--neutral-fg); }
.ss-none { color: var(--fg-muted); }
.ss-none::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--neutral-line); }

.waiting { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; white-space: nowrap; }
.waiting-overdue { color: var(--danger-fg); font-weight: 600; }
.waiting-overdue .ic { color: var(--danger-fg); }
.exc-brand { color: var(--brand-fg); font-weight: 500; }
.exc-danger { color: var(--danger-fg); font-weight: 600; }

.rows-empty { padding: 16px; text-align: center; color: var(--fg-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.changed { background: var(--changed-bg); border-radius: var(--radius-sm); padding: 0 4px; }

.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-trigger { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 8px 0 4px; border-radius: var(--radius-md); border: 1px solid transparent; }
.menu-trigger:hover, .menu[open] > .menu-trigger { background: var(--bg-hover); }
.menu-panel { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 260px; padding: 8px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 4px; }
.menu-left .menu-panel { right: auto; left: 0; }
.menu-head { padding: 6px 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; gap: 2px; }
.menu-label { padding: 8px 8px 4px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 4px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; text-align: left; font-size: 14px; color: var(--fg); text-decoration: none; }
.brand a.menu-item { text-decoration: none; }
.menu-item:hover { background: var(--bg-hover); }
.menu-item[aria-pressed="true"] { background: var(--bg-subtle); font-weight: 600; }
.menu-item[aria-pressed="true"]::after { content: "Current"; margin-left: auto; font-size: 11px; font-weight: 500; color: var(--fg-muted); }
.menu-item .menu-item-sub { display: block; font-size: 12px; color: var(--fg-muted); font-weight: 400; }
.menu-sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu-dots > summary { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-md); }
.menu-dots > summary:hover, .menu-dots[open] > summary { background: var(--bg-hover); }
.menu-dots .menu-panel { min-width: 200px; }
.menu-panel .seg { align-self: flex-start; margin: 0 8px 4px; }

.avatar { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 600; flex: 0 0 auto; letter-spacing: 0; }
.av-violet { background: var(--av-violet-bg); color: var(--av-violet-fg); }
.av-amber { background: var(--av-amber-bg); color: var(--av-amber-fg); }
.av-teal { background: var(--av-teal-bg); color: var(--av-teal-fg); }
.av-blue { background: var(--av-blue-bg); color: var(--av-blue-fg); }
.av-neutral { background: var(--av-neutral-bg); color: var(--av-neutral-fg); }

.st-shell { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 100vh; background: var(--bg-page); }
.st-nav { flex: 0 0 232px; width: 232px; border-right: 1px solid var(--border); background: var(--bg-surface); display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.st-brand { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-height: 40px; padding: 0 6px; margin-bottom: 8px; }
.wordmark { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); white-space: nowrap; }
.st-navlist { display: flex; flex-direction: column; gap: 2px; }
.st-navitem { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--radius-md); color: var(--fg-2); font-weight: 500; }
.brand a.st-navitem { text-decoration: none; color: var(--fg-2); }
.brand a.st-navitem:hover { background: var(--bg-hover); color: var(--fg); }
.brand a.st-navitem[aria-current="page"] { background: var(--bg-subtle); color: var(--fg); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.nav-badge { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-full); background: var(--primary); color: var(--primary-fg); font-size: 12px; font-weight: 600; }
.st-navfoot { margin-top: auto; padding-top: 12px; }
.st-collapse { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--fg-muted); font-size: 13px; }
.st-collapse:hover { background: var(--bg-hover); color: var(--fg); }
.st-shell.nav-collapsed .st-nav { flex-basis: 64px; width: 64px; padding: 12px 8px; }
.st-shell.nav-collapsed .st-nav .nav-text, .st-shell.nav-collapsed .st-brand .ph-tag { display: none; }
.st-shell.nav-collapsed .st-navitem { justify-content: center; padding: 0; }
.st-shell.nav-collapsed .nav-badge { position: absolute; margin: -18px 0 0 18px; }

.brand .st-subnav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px 17px; padding: 0; border-left: 1px solid var(--border-strong); }
.st-subitem { position: relative; display: flex; align-items: center; min-height: 40px; margin-left: 6px; padding: 0 10px 0 12px; border-radius: var(--radius-md); color: var(--fg-muted); font-size: 13px; line-height: 18px; font-weight: 500; }
.brand a.st-subitem { text-decoration: none; color: var(--fg-muted); }
.brand a.st-subitem:hover { background: var(--bg-hover); color: var(--fg); }
.brand a.st-subitem[aria-current="page"] { color: var(--fg); font-weight: 600; }
.brand a.st-subitem[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--primary); }
.brand .st-shell.nav-collapsed .st-subnav { display: none; }
@media (max-width: 860px) { .brand .st-subnav { display: none; } }
.st-body { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.st-top { min-height: 56px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 8px 24px; border-bottom: 1px solid var(--border); background: var(--bg-surface); }
.crumbs ol { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--fg-muted); }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "/"; color: var(--border-input); }
.crumbs a { color: var(--fg-muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--fg); font-weight: 500; }
.st-search { flex: 1 1 240px; max-width: 420px; margin-left: auto; }
.st-search .input { min-height: 34px; background: var(--bg-subtle); border-color: var(--border-strong); }
.st-content { width: 100%; max-width: 1280px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { flex: 0 1 auto; }
.page-head .page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-sub { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; color: var(--fg-muted); font-size: 13px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { flex: 0 0 auto; }
.filters .select { min-width: 150px; }
@media (max-width: 860px) {
  .st-nav { flex-basis: 100%; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); }
  .st-navlist { flex-direction: row; flex-wrap: wrap; }
  .st-brand { margin-bottom: 0; }
  .st-navfoot { display: none; }
  .st-content { padding: 16px; }
}

.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.work-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.work-side { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1280px) {
  .work { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .work-side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
  .brand-app .work-side { top: calc(var(--mkh, 0px) + 16px); max-height: calc(100vh - var(--mkh, 0px) - 32px); }
  .work-side > * { flex-shrink: 0; }
}

.portal {
  container: portal / inline-size;
  --p-page: 1200px;                 
  --p-gutter: 32px;                 
  --p-sticky-top: calc(var(--mkh, 0px) + 24px);   
  font-size: 16px; line-height: 24px;
}
.portal .btn { min-height: var(--control-portal); padding: 6px 18px; font-size: 15px; white-space: normal; text-align: center; line-height: 20px; }
.portal .btn-sm { min-height: 40px; }
.portal .input, .portal .select { min-height: var(--control-portal); font-size: 16px; }
.portal .textarea { font-size: 16px; }
.portal h1 { font-size: 24px; line-height: 30px; }
@container portal (min-width: 768px) { .portal h1 { font-size: 28px; line-height: 36px; } }
.p-head { min-height: 64px; display: flex; align-items: center; gap: 8px 12px; padding: 8px 16px; border-bottom: 1px solid var(--border); background: var(--bg-surface); flex-wrap: wrap; }
.p-brand { display: flex; flex-direction: column; min-width: 0; flex: 1 1 140px; }
.p-brand-row { display: flex; align-items: center; flex-wrap: wrap; }
.p-company { font-size: 13px; line-height: 18px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@container portal (width < 768px) { .p-company { white-space: normal; overflow-wrap: anywhere; } }
.lang-switch { display: inline-flex; border: 1px solid var(--border-input); border-radius: var(--radius-md); overflow: hidden; }
.lang-switch button { min-width: 48px; min-height: 48px; border: 0; background: var(--bg-surface); font-weight: 600; font-size: 14px; color: var(--fg-2); }
.lang-switch button + button { border-left: 1px solid var(--border-input); }
.lang-switch button[aria-pressed="true"] { background: var(--fg); color: var(--bg-surface); }
.p-head .menu-trigger { min-height: 48px; min-width: 48px; justify-content: center; padding: 0 6px; }
.p-main { width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 20px; }
@container portal (min-width: 768px) { .p-main { padding: 32px 24px 48px; gap: 24px; } .p-head { padding: 8px 24px; } }
.p-section { display: flex; flex-direction: column; gap: 12px; }
.p-section > h2 { font-size: 18px; line-height: 26px; font-weight: 600; }
.todo { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-surface); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.todo-brand { border-color: var(--brand-line); background: var(--brand-bg); }
.todo-danger { border-color: var(--danger-line); background: var(--danger-bg); }
.todo-success { border-color: var(--success-line); }
.todo-text { font-size: 17px; line-height: 25px; font-weight: 500; }

.p-actionbar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; margin: 0 -16px -32px; background: var(--bg-surface); border-top: 1px solid var(--border); }
.p-actionbar .btn-primary { flex: 1 1 auto; }
@container portal (min-width: 768px) { .p-actionbar { position: static; margin: 0; padding: 0; border-top: 0; background: transparent; justify-content: flex-end; } .p-actionbar .btn-primary { flex: 0 0 auto; } }

.p-rail-layout, .p-split, .p-auth-split { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.p-rail, .p-rail-main, .p-split-doc, .p-split-aside, .p-auth-aside { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.p-auth { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
@container portal (min-width: 768px) {
  .p-rail-layout, .p-split, .p-auth-split, .p-rail, .p-rail-main, .p-split-doc, .p-split-aside, .p-auth-aside { gap: 24px; }
}
@container portal (width < 1024px) {
  .p-only-desktop { display: none !important; }
}
@container portal (min-width: 1024px) {
  .p-only-mobile { display: none !important; }

  
  .p-head { flex-wrap: nowrap; min-height: 64px; gap: 16px; padding: 0 max(var(--p-gutter), calc((100% - var(--p-page)) / 2)); }
  .p-brand { flex: 1 1 auto; flex-direction: row; align-items: center; min-width: 0; }
  .p-brand-row { flex: 0 0 auto; flex-wrap: nowrap; }
  .p-brand > .p-company { flex: 0 1 auto; min-width: 0; margin-left: 16px; padding-left: 16px; border-left: 1px solid var(--border-strong); font-size: 14px; line-height: 20px; }
  .p-brand > .p-company + .p-company { color: var(--fg-2); font-weight: 500; }

  
  .p-main { max-width: calc(var(--p-page) + 2 * var(--p-gutter)); padding: 40px var(--p-gutter) 64px; gap: 28px; }

  
  .p-rail-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "rail body"; gap: 32px; align-items: start; }
  .p-rail { grid-area: rail; position: sticky; top: var(--p-sticky-top); max-height: calc(100vh - var(--p-sticky-top) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .p-rail > * { flex-shrink: 0; }
  .p-rail-main { grid-area: body; }

  
  .p-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); grid-template-areas: "doc aside"; gap: 32px; align-items: start; }
  .p-split-doc { grid-area: doc; }
  .p-split-aside { grid-area: aside; position: sticky; top: var(--p-sticky-top); max-height: calc(100vh - var(--p-sticky-top) - 24px); overflow-y: auto; overscroll-behavior: contain; }
  .p-split-aside > * { flex-shrink: 0; }

  
  .p-auth { width: 100%; max-width: 480px; margin: 0 auto; padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--bg-surface); }
  .p-auth-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); grid-template-areas: "aside card"; gap: 48px; align-items: center; width: 100%; max-width: 1040px; margin: 0 auto; }
  .p-auth-split > .p-auth { grid-area: card; max-width: none; margin: 0; }
  .p-auth-aside { grid-area: aside; }
}

.p-note { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--brand-line); border-left-width: 4px; border-radius: var(--radius); background: var(--brand-bg); color: var(--fg); font-size: 15px; line-height: 22px; }
.p-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.p-note-word { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-fg); font-weight: 600; }
.p-note-word .ic { width: 16px; height: 16px; flex: 0 0 auto; }
.p-note-text { margin: 0; overflow-wrap: anywhere; }
.p-note-src { font-size: 12px; line-height: 16px; color: var(--fg-muted); font-family: var(--font-mono); letter-spacing: 0.02em; }
.p-note-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.p-note-actions .btn-link, .p-note-actions .btn { min-height: 48px; }
.p-note-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.p-note-chips button { min-height: 48px; padding: 0 14px; border: 1px solid var(--border-input); border-radius: 999px; background: var(--bg-surface); color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; }
.p-note-chips button[aria-pressed="true"] { border-color: var(--fg); background: var(--fg); color: var(--bg-surface); }
.p-note.is-dismissed { border-color: var(--border); border-left-width: 1px; background: var(--bg-subtle); }
.p-note.is-dismissed .p-note-word { color: var(--fg-2); }
.p-note.is-attached .p-note-state { color: var(--fg-2); font-weight: 500; }
.p-note textarea { min-height: 72px; }

.p-help-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0; border: 0; background: none; color: var(--client-fg); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.p-help { margin: 2px 0 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-subtle); color: var(--fg-2); font-size: 15px; line-height: 22px; }
.p-help-text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.p-help.is-more .p-help-text { display: block; -webkit-line-clamp: unset; }

.p-readback { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-subtle); color: var(--fg); font-size: 15px; line-height: 22px; }
.p-readback-label { font-size: 12px; line-height: 16px; color: var(--fg-muted); font-family: var(--font-mono); letter-spacing: 0.02em; }

.p-check-summary { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--brand-line); border-radius: var(--radius); background: var(--bg-surface); }
.p-check-summary h2, .p-check-summary h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
.p-check-summary h2:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.p-check-summary .p-check-sec { display: flex; flex-direction: column; gap: 4px; }
.p-check-summary .p-check-sec-h { font-size: 13px; line-height: 18px; color: var(--fg-muted); font-weight: 600; }
.p-check-summary ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.p-check-summary li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.p-check-summary li > span { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.p-check-summary .btn-link { min-height: 48px; }
.p-check-clean { color: var(--fg-2); }
.p-check-standing { font-size: 14px; line-height: 20px; color: var(--fg-2); }
.p-note-count { color: var(--brand-fg); font-size: 12px; line-height: 16px; font-weight: 500; }

.mk-bar { position: sticky; top: 0; z-index: 300; display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 6px 12px; background: repeating-linear-gradient(135deg, #1c1c1c 0 10px, #232323 10px 20px); color: #f5f5f5; font-family: var(--font-mono); font-size: 12px; line-height: 16px; border-bottom: 2px dashed #8c8c8c; }
.mk-bar a, .mk-bar button, .mk-bar select { font-family: var(--font-mono); font-size: 12px; color: #f5f5f5; }
.mk-tag { padding: 2px 6px; border: 1px solid #8c8c8c; border-radius: var(--radius-sm); letter-spacing: 0.1em; text-transform: uppercase; font-size: 10.5px; color: #d4d4d4; }
.mk-btn { min-height: 28px; padding: 0 10px; border: 1px solid #8c8c8c; border-radius: var(--radius-sm); background: #0a0a0a; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.mk-btn:hover { background: #333333; }
.mk-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mk-bar :focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.mk-cur { display: inline-flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mk-cur strong { font-weight: 600; color: #ffffff; }
.mk-path { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 2px 4px 2px 8px; border: 1px solid #fac800; border-radius: var(--radius-sm); }
.mk-path-text { color: #fde68a; }
.mk-field { display: inline-flex; align-items: center; gap: 6px; }
.mk-field select { min-height: 28px; max-width: 340px; padding: 0 6px; border: 1px solid #8c8c8c; border-radius: var(--radius-sm); background: #0a0a0a; }
.mk-bar .switch-track { background: #0a0a0a; border-color: #8c8c8c; }
.mk-bar .switch-track::after { background: #a3a3a3; }
.mk-bar .switch input:checked + .switch-track { background: #fac800; border-color: #fac800; }
.mk-bar .switch input:checked + .switch-track::after { background: #0a0a0a; }
.mk-bar .switch input:focus-visible + .switch-track { outline-color: #ffffff; }
.mk-menu .menu-panel.mk-panel { background: #111111; border-color: #4a4a4a; color: #f5f5f5; max-height: 70vh; overflow-y: auto; min-width: 340px; }
.mk-panel .menu-item { color: #f5f5f5; font-family: var(--font-mono); font-size: 12px; min-height: 32px; }
.mk-panel .menu-item:hover { background: #2e2e2e; }
.mk-panel .menu-item[aria-pressed="true"] { background: #262626; color: #ffffff; }
.mk-panel .menu-item[aria-pressed="true"]::after { color: #fde68a; }
.mk-menu > summary.mk-btn { max-width: 420px; }
.mk-state-cur { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; color: #ffffff; }
.mk-right { margin-left: auto; display: inline-flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.idx { width: 100%; max-width: 1180px; margin: 0 auto; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 32px; }
.idx-head { display: flex; flex-direction: column; gap: 6px; }
.idx-paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.idx-path { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); }
.idx-path .btn { align-self: flex-start; }
.idx-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px; align-items: start; }
.idx-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); }
.idx-list li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--border); }
.idx-list li:first-child { border-top: 0; }
.idx-link { display: inline-flex; gap: 10px; align-items: baseline; font-weight: 600; }
.brand a.idx-link { text-decoration: none; }
.brand a.idx-link:hover .idx-name { text-decoration: underline; text-underline-offset: 3px; }
.idx-id { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--fg-muted); min-width: 30px; }
.idx-job { font-size: 13px; color: var(--fg-muted); padding-left: 40px; }
.idx-retired { color: var(--fg-muted); }

.stub-note { padding: 14px 16px; border: 1px dashed var(--border-input); border-radius: var(--radius); color: var(--fg-muted); font-family: var(--font-mono); font-size: 12px; line-height: 18px; }

.brand-app .p02 .p02-nav, .brand-app .s05 .s05-toc { top: calc(var(--mkh, 0px) + 16px); }

.brand {
  --frame-staff-bg: #fff1bf;  --frame-staff-bg2: #ffe999;  --frame-staff-fg: #6b3a09;  --frame-staff-line: #b26a00;
  --frame-portal-bg: #eef3ff; --frame-portal-bg2: #e0e9ff; --frame-portal-fg: #1d4ed8; --frame-portal-line: #2f6fed;
  --frame-web-bg: #ececec;    --frame-web-bg2: #e0e0e0;    --frame-web-fg: #404040;    --frame-web-line: #8c8c8c;
}
.brand[data-theme="dark"] {
  --frame-staff-bg: #2a2208;  --frame-staff-bg2: #352a0a;  --frame-staff-fg: #fcd34d;  --frame-staff-line: #e0a030;
  --frame-portal-bg: #172340; --frame-portal-bg2: #1d2b4f; --frame-portal-fg: #9ab8ff; --frame-portal-line: #6b9bff;
  --frame-web-bg: #262626;    --frame-web-bg2: #303030;    --frame-web-fg: #d4d4d4;    --frame-web-line: #737373;
}
@media (prefers-color-scheme: dark) {
  .brand:not([data-theme="light"]) {
    --frame-staff-bg: #2a2208;  --frame-staff-bg2: #352a0a;  --frame-staff-fg: #fcd34d;  --frame-staff-line: #e0a030;
    --frame-portal-bg: #172340; --frame-portal-bg2: #1d2b4f; --frame-portal-fg: #9ab8ff; --frame-portal-line: #6b9bff;
    --frame-web-bg: #262626;    --frame-web-bg2: #303030;    --frame-web-fg: #d4d4d4;    --frame-web-line: #737373;
  }
}
.app-frame-staff { --af-bg: var(--frame-staff-bg); --af-bg2: var(--frame-staff-bg2); --af-fg: var(--frame-staff-fg); --af-line: var(--frame-staff-line); }
.app-frame-portal { --af-bg: var(--frame-portal-bg); --af-bg2: var(--frame-portal-bg2); --af-fg: var(--frame-portal-fg); --af-line: var(--frame-portal-line); }
.app-frame-website { --af-bg: var(--frame-web-bg); --af-bg2: var(--frame-web-bg2); --af-fg: var(--frame-web-fg); --af-line: var(--frame-web-line); }
.app-frame { position: relative; min-width: 0; }
.app-frame-strip { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; background: repeating-linear-gradient(135deg, var(--af-bg) 0 10px, var(--af-bg2) 10px 20px); color: var(--af-fg); border-bottom: 2px dashed var(--af-line); font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.02em; }
.app-frame-strip::before { content: ""; width: 8px; height: 8px; border-radius: 1px; background: var(--af-line); flex: 0 0 auto; }
.app-frame-strip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mk-top { position: sticky; top: 0; z-index: 300; }
.mk-top > .mk-bar { position: static; }
.mk-handoff { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; padding: 3px 12px; background: #0a0a0a; color: #f5f5f5; font-family: var(--font-mono); font-size: 11.5px; line-height: 16px; border-bottom: 1px dashed #8c8c8c; }
.mk-handoff-k { color: #fac800; font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

.mk-app { display: inline-flex; align-items: center; min-height: 22px; padding: 1px 8px; border: 1px dashed var(--af-line); border-radius: var(--radius-sm); background: var(--af-bg); color: var(--af-fg); font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }

.mk-dim { color: #bdbdbd; }                      
.mk-av { width: 20px; height: 20px; font-size: 9.5px; }
.mk-acting { max-width: 560px; }
.mk-acting-name { font-weight: 600; color: #ffffff; white-space: nowrap; }
.mk-acting-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mk-acting-ro { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border: 1px dashed #8c8c8c; border-radius: var(--radius-sm); max-width: 560px; }
.mk-person { display: flex; flex-direction: column; min-width: 0; }
.mk-panel .menu-label, .mk-panel .menu-item-sub { color: #bdbdbd; }
.mk-panel .menu-item-sub { font-size: 11.5px; }

.idx-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 24px; align-items: start; }
.idx-tile { display: flex; flex-direction: column; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-surface); overflow: hidden; }
.idx-tile-body { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.idx-tile-body .btn { align-self: flex-start; }
.brand .idx-tile h2 { font-size: 20px; line-height: 28px; }
.brand .idx-sub { margin-top: 10px; font-family: var(--font-mono); font-size: 11px; line-height: 16px; font-weight: 400; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.idx-starts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--fg-2); }
.idx-starts .mk-app, .idx-job .mk-app { min-height: 20px; font-size: 11px; font-weight: 500; }

.mk-menu { min-width: 0; max-width: 100%; }
.mk-acting, .mk-acting-ro { max-width: min(560px, 100%); min-width: 0; }
.mk-acting > .mk-dim:first-child, .mk-acting-ro > .mk-dim:first-child { white-space: nowrap; }
.mk-menu > summary.mk-btn { max-width: 100%; min-width: 0; }
.mk-menu > summary.mk-btn > span:first-child { white-space: nowrap; }
.mk-state-cur { min-width: 0; }
.mk-right { min-width: 0; max-width: 100%; }

.mk-row { display: none; }
.mk-ic-close { display: none; }
@media (max-width: 640px) {
  .mk-row { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 12px; background: repeating-linear-gradient(135deg, #1c1c1c 0 10px, #232323 10px 20px); color: #f5f5f5; font-family: var(--font-mono); font-size: 12px; line-height: 16px; border-bottom: 2px dashed #8c8c8c; }
  .mk-row button { font-family: var(--font-mono); font-size: 12px; color: #f5f5f5; }
  .mk-row :focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
  .mk-row-cur { flex: 0 0 auto; font-weight: 600; color: #ffffff; white-space: nowrap; }
  .mk-row .mk-app { display: inline-block; flex: 0 1 auto; min-width: 0; min-height: 0; line-height: 20px; overflow: hidden; text-overflow: ellipsis; }
  .mk-ibtn { min-width: 28px; padding: 0; justify-content: center; }
  .mk-path-mini { flex: 0 0 auto; flex-wrap: nowrap; gap: 0; padding: 0 0 0 6px; overflow: hidden; }
  .mk-path-mini .mk-path-text { white-space: nowrap; padding-right: 6px; }
  .mk-path-mini .mk-ibtn { min-height: 26px; border: 0; border-left: 1px solid #8c8c8c; border-radius: 0; background: transparent; }
  .mk-path-mini .mk-ibtn:hover:not(:disabled) { background: #333333; }
  .mk-path-mini .mk-ibtn:focus-visible { outline-offset: -2px; }
  .mk-toggle { flex: 0 0 auto; min-width: 32px; margin-left: auto; }
  .mk-toggle[aria-expanded="true"] { background: #fac800; border-color: #fac800; color: #0a0a0a; }
  .mk-toggle[aria-expanded="true"] .mk-ic-menu { display: none; }
  .mk-toggle[aria-expanded="true"] .mk-ic-close { display: block; }

  
  .mk-top:not(.mk-open) > .mk-bar { display: none; }
  .mk-top:not(.mk-open) .mk-handoff { display: block; padding: 1px 12px 0; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mk-top:not(.mk-open) .mk-handoff > span + span { margin-left: 6px; }

  
  .mk-bar { gap: 8px; padding: 8px 12px 10px; }
  .mk-bar .mk-wide { display: none; }
  .mk-bar .mk-cur { flex: 1 1 0; min-width: 0; }
  .mk-bar .mk-menu { display: block; width: 100%; }
  .mk-bar .mk-menu > summary.mk-btn, .mk-bar .mk-acting-ro { width: 100%; max-width: 100%; overflow: hidden; }
  .mk-bar .mk-menu > summary.mk-btn > .ic { margin-left: auto; }
  .mk-bar .mk-state-cur { max-width: none; }
  .mk-bar .mk-menu .menu-panel.mk-panel { left: 0; right: 0; min-width: 0; max-height: min(60vh, 440px); }
  .mk-bar .mk-path-full { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; align-items: flex-start; justify-content: space-between; padding: 4px 4px 4px 8px; }
  .mk-bar .mk-path-full .mk-path-text { min-width: 0; padding-top: 6px; }
  .mk-bar .mk-right { flex: 1 1 100%; width: 100%; margin-left: 0; gap: 10px 14px; }
}

@font-face{font-family:"Geist";src:url("fonts/Geist-Variable.woff2") format("woff2");font-weight:100 900;font-display:swap}
@font-face{font-family:"Geist Mono";src:url("fonts/GeistMono-Variable.woff2") format("woff2");font-weight:100 900;font-display:swap}
