.kita-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    min-height: 42px;
    padding: 10px;
    margin: 0;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #243047;
    cursor: pointer;
    vertical-align: middle;
}
.kita-theme-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.kita-theme-toggle:hover { background: #f0fdfa; border-color: #0d9488 }
.kita-theme-toggle:focus-visible { outline: 3px solid #14b8a6; outline-offset: 3px }
.kita-theme-toggle[hidden] { display: none !important }
.kita-theme-toggle:disabled { opacity: .55; cursor: wait }
.kita-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    min-height: 77px;
    margin: 0;
    padding: 17px 24px;
    border: 0;
    border-bottom: 1px solid #e3e8ef;
    border-radius: 0;
    background: #fff;
    color: #172033;
    box-shadow: none;
    font: 16px/normal Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.kita-header-title { flex: 1 1 220px; min-width: 0 }
.kita-header .kita-header-title h1 { margin: 0; font-size: 21px; font-weight: 700; line-height: normal; letter-spacing: normal; color: inherit }
.kita-header .kita-header-title :is(.muted, .hero-copy) { margin: 0; max-width: none; font-size: 13px; line-height: normal; color: #6b778c }
.kita-header-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 8px; margin-left: auto }
.kita-header-actions .kita-theme-toggle { width: 42px; height: 42px; min-height: 42px; margin: 0; padding: 10px; border-radius: 10px }
.kita-header > .kita-theme-status { flex-basis: 100%; margin: 0 }
.kita-standalone-header { width: 100%; display: flex; justify-content: flex-end }
.kita-theme-status { font-size: 12px; color: #be123c }
.kita-theme-status:empty { display: none }

@media screen {
:root[data-theme=dark] {
    color-scheme: dark;
    --bg: #0d1220;
    --surface: #182033;
    --solid: #182033;
    --soft: #1e293b;
    --text: #f5f7fb;
    --muted: #aab4c8;
    --border: #334155;
}
[data-theme=dark] body { background: var(--bg); color: var(--text) }
[data-theme=dark] :is(.top, .card, .dialog, .app-popup, body > main > section, .footer) {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}
[data-theme=dark] :is(input, select, textarea, .kita-theme-toggle, .btn:not(.primary):not(.btn-primary):not(.danger), .app-popup-button:not(.app-popup-accept)) {
    background: var(--soft);
    color: var(--text);
    border-color: var(--border);
}
[data-theme=dark] :is(.muted, .sub, .empty, .status, .closure-status, .technical-details, .problem-context, .app-popup p),
[data-theme=dark] .app :is(label, th, .stat small, .stat span, .person small, .rule-nav button, .rule-nav small, .toggle small, .tab) {
    color: var(--muted);
}
[data-theme=dark] :is(th, .num, .person:hover),
[data-theme=dark] tr:hover td {
    background: var(--soft);
}
[data-theme=dark] .app :is(td, th, .headline, .tabs, .week, .toggle, .group, .priority, .table-head, .planner-head) {
    border-color: var(--border);
}
[data-theme=dark] :is(.person.on, .rule-nav button.on, .closure-section .table-head, .closure-help, .closure-calendar) {
    background: #123b3a;
    color: #99f6e4;
    border-color: #28665e;
}
[data-theme=dark] :is(.person.on small, #closureTitle, .tab.on) { color: #5eead4 }
[data-theme=dark] :is(.error-text, #editStatus, #status.error, .kita-theme-status) { color: #ff7188 }
[data-theme=dark] .kita-theme-toggle:hover { background: #123b3a }
[data-theme=dark] .kita-header { background: #182033; color: #f5f7fb; border-color: #334155 }
[data-theme=dark] .kita-header .kita-header-title :is(.muted, .hero-copy) { color: #aab4c8 }
}

@media print {
    .kita-header-actions, .kita-theme-toggle, .kita-theme-status { display: none !important }
}
