/* ══════════════════════════════════════════════════════════════
   NDMA KnowledgeWebPro — Design System
   Aesthetic: Command Deck — Horizontal Navigation
   Palette: Deep Navy + Warm Amber + Crisp White
   ══════════════════════════════════════════════════════════════ */

:root {
    /* ── Core Palette ── */
    --kw-navy-900: #0A1628;
    --kw-navy-800: #0D1F3C;
    --kw-navy-700: #132D50;
    --kw-navy-600: #1A3A64;
    --kw-navy-500: #1E4D8C;
    --kw-navy-400: #2563A8;
    --kw-navy-300: #3B82C4;
    --kw-navy-200: #6BA3DB;
    --kw-navy-100: #B8D4EE;
    --kw-navy-50: #E8F1FA;

    --kw-amber-500: #E8920C;
    --kw-amber-400: #F5A623;
    --kw-amber-300: #FBBF4E;
    --kw-amber-200: #FCD88A;
    --kw-amber-100: #FEF0CD;

    --kw-teal-500: #0D9488;
    --kw-teal-400: #14B8A6;
    --kw-emerald-500: #059669;
    --kw-rose-500: #E11D48;
    --kw-violet-500: #7C3AED;

    /* ── Surface & Text ── */
    --kw-surface: #FFFFFF;
    --kw-surface-raised: #FFFFFF;
    --kw-surface-muted: #F7F9FC;
    --kw-surface-hover: #EEF2F9;
    --kw-border: #E2E8F0;
    --kw-border-subtle: #F1F5F9;
    --kw-line: var(--kw-border);   /* legacy alias consumed widely; was never defined */
    --kw-text-primary: #1E293B;
    --kw-text-secondary: #64748B;
    --kw-text-muted: #94A3B8;

    /* ── Spacing ── */
    --kw-radius-sm: 6px;
    --kw-radius-md: 10px;
    --kw-radius-lg: 14px;
    --kw-radius-xl: 20px;

    /* ── Layout ── */
    --kw-topbar-h: 52px;
    --kw-navrail-h: 44px;
    --kw-header-total: calc(var(--kw-topbar-h) + var(--kw-navrail-h));

    /* ── Shadows ── */
    --kw-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.06);
    --kw-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
    --kw-shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
    --kw-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.03), 0 6px 24px rgba(15, 23, 42, 0.06);
    --kw-shadow-card-hover: 0 4px 8px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 23, 42, 0.10);

    /* ── Transitions ── */
    --kw-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --kw-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --kw-duration-fast: 150ms;
    --kw-duration-normal: 250ms;
    --kw-duration-slow: 400ms;
}

/* ── Dark mode overrides ──
   Applied by MainLayout/PublicLayout as `kw-dark` when the theme toggle is on.
   NOTE: do NOT rename this back to `.mud-theme-dark`. MudBlazor 9 never emits that
   class (it swaps CSS custom properties on :root instead), AND it ships its own
   `.mud-theme-dark` utility that forces `color`/`background-color` with !important —
   so borrowing the name both fails to apply and, if applied, paints the wrong colours. */
.kw-dark {
    --kw-surface: #141824;
    --kw-surface-raised: #1C2233;
    --kw-surface-muted: #111520;
    --kw-surface-hover: #232940;
    --kw-border: #2A3149;
    --kw-border-subtle: #1E2438;
    --kw-text-primary: #E8ECF4;
    --kw-text-secondary: #8B95AD;
    --kw-text-muted: #5A6478;
    --kw-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --kw-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
    --kw-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.3);
    --kw-shadow-card: 0 2px 8px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(0, 0, 0, 0.15);
    --kw-shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.25), 0 16px 48px rgba(0, 0, 0, 0.2);
}

/* ══════════════════════════════════════════════════════════════
   Global Resets & Base
   ══════════════════════════════════════════════════════════════ */

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: var(--kw-surface-muted);
    color: var(--kw-text-primary);
    margin: 0;
}

h1:focus { outline: none; }

::selection {
    background: var(--kw-navy-200);
    color: var(--kw-navy-900);
}

.kw-dark ::selection {
    background: var(--kw-navy-600);
    color: var(--kw-navy-50);
}

/* ══════════════════════════════════════════════════════════════
   Shell — Stacked Layout (no sidebar)
   ══════════════════════════════════════════════════════════════ */

.kw-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════
   Top Brand Bar
   ══════════════════════════════════════════════════════════════ */

.kw-topbar {
    height: var(--kw-topbar-h);
    background: linear-gradient(135deg, var(--kw-navy-900) 0%, var(--kw-navy-800) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: sticky;
    top: 0;
    z-index: 1100;
    flex-shrink: 0;
}

.kw-topbar-inner {
    max-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* Brand */
.kw-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kw-logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--kw-amber-400), var(--kw-amber-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--kw-navy-900);
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(232, 146, 12, 0.35);
    transition: transform var(--kw-duration-normal) var(--kw-ease-spring);
}

.kw-logo-mark:hover {
    transform: rotate(-6deg) scale(1.05);
}

.kw-brand-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kw-brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.92);
    letter-spacing: -0.01em;
}

.kw-brand-accent {
    color: var(--kw-amber-300);
}

.kw-brand-badge {
    padding: 2px 9px;
    border-radius: 100px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    line-height: 1.6;
}

/* Topbar Actions */
.kw-topbar-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.kw-topbar-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color var(--kw-duration-fast) var(--kw-ease-out),
                color var(--kw-duration-fast) var(--kw-ease-out);
    position: relative;
}

.kw-topbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.kw-topbar-btn--notif {
    position: relative;
}

.kw-notif-dot {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kw-amber-400);
    border: 2px solid var(--kw-navy-900);
    animation: kw-pulse 2s ease-in-out infinite;
}

@keyframes kw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.kw-topbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    margin: 0 8px;
}

.kw-avatar-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(135deg, var(--kw-navy-600), var(--kw-navy-500));
    color: rgba(255, 255, 255, 0.85);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color var(--kw-duration-fast) var(--kw-ease-out),
                transform var(--kw-duration-fast) var(--kw-ease-out);
}

.kw-avatar-btn:hover {
    border-color: var(--kw-amber-400);
    transform: scale(1.06);
}

/* ══════════════════════════════════════════════════════════════
   Navigation Rail — Horizontal
   ══════════════════════════════════════════════════════════════ */

.kw-nav-rail {
    height: var(--kw-navrail-h);
    background: var(--kw-surface);
    border-bottom: 1px solid var(--kw-border);
    position: sticky;
    top: var(--kw-topbar-h);
    z-index: 1090;
    flex-shrink: 0;
}

.kw-dark .kw-nav-rail {
    background: var(--kw-surface-raised);
    border-bottom-color: var(--kw-border);
}

.kw-nav-rail-inner {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.kw-nav-items {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kw-nav-items::-webkit-scrollbar {
    display: none;
}

.kw-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 34px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--kw-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color var(--kw-duration-fast) var(--kw-ease-out),
                color var(--kw-duration-fast) var(--kw-ease-out);
    position: relative;
    flex-shrink: 0;
}

.kw-nav-item:hover {
    background: var(--kw-surface-hover);
    color: var(--kw-text-primary);
}

.kw-nav-item.active {
    background: var(--kw-navy-50);
    color: var(--kw-navy-600);
    font-weight: 600;
}

.kw-dark .kw-nav-item.active {
    background: rgba(59, 130, 196, 0.12);
    color: var(--kw-navy-200);
}

/* Active indicator line */
.kw-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 14px;
    right: 14px;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--kw-navy-500);
}

.kw-dark .kw-nav-item.active::after {
    background: var(--kw-navy-300);
}

.kw-nav-item .mud-icon-root {
    font-size: 1.15rem;
    opacity: 0.7;
    transition: opacity var(--kw-duration-fast);
}

.kw-nav-item:hover .mud-icon-root,
.kw-nav-item.active .mud-icon-root {
    opacity: 1;
}

.kw-nav-sep {
    width: 1px;
    height: 20px;
    background: var(--kw-border);
    margin: 0 6px;
    flex-shrink: 0;
}

/* Nav toggle (expandable section) */
.kw-nav-toggle {
    position: relative;
}

.kw-nav-chevron {
    font-size: 0.9rem !important;
    opacity: 0.5;
    margin-left: -2px;
}

/* Nav sub-items (admin sub-routes) */
.kw-nav-sub {
    font-size: 0.72rem !important;
    padding: 4px 8px !important;
    opacity: 0.85;
}

.kw-nav-sub .mud-icon-root {
    font-size: 0.95rem !important;
}

.kw-nav-sub.active {
    opacity: 1;
}

/* ══════════════════════════════════════════════════════════════
   Two-tier contextual navigation (module bar + context bar)
   Each module carries its signature colour via the --kw-mod var.
   ══════════════════════════════════════════════════════════════ */
.kw-mod {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--kw-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color var(--kw-duration-fast) var(--kw-ease-out),
                color var(--kw-duration-fast) var(--kw-ease-out);
}
.kw-mod .mud-icon-root { font-size: 1.15rem; opacity: 0.7; }
.kw-mod:hover { background: var(--kw-surface-hover); color: var(--kw-text-primary); }
.kw-mod:hover .mud-icon-root { opacity: 1; }
.kw-mod.active {
    color: var(--kw-mod);
    background: color-mix(in srgb, var(--kw-mod) 12%, transparent);
    font-weight: 600;
}
.kw-mod.active .mud-icon-root { opacity: 1; }

.kw-nav-context {
    position: sticky;
    top: var(--kw-header-total);
    z-index: 1089;
    height: 40px;
    box-sizing: border-box;
    background: var(--kw-surface);
    border-bottom: 1px solid var(--kw-border);
    border-top: 2px solid color-mix(in srgb, var(--kw-mod) 55%, transparent);
    flex-shrink: 0;
}
.kw-dark .kw-nav-context { background: var(--kw-surface-raised); }
.kw-nav-context-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}
.kw-nav-context-inner::-webkit-scrollbar { display: none; }

.kw-ctx {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 7px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--kw-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
    transition: background-color var(--kw-duration-fast) var(--kw-ease-out),
                color var(--kw-duration-fast) var(--kw-ease-out);
}
.kw-ctx .mud-icon-root { font-size: 1rem; opacity: 0.65; }
.kw-ctx:hover { background: var(--kw-surface-hover); color: var(--kw-text-primary); }
.kw-ctx:hover .mud-icon-root { opacity: 1; }
.kw-ctx.active {
    color: var(--kw-mod);
    background: color-mix(in srgb, var(--kw-mod) 14%, transparent);
    font-weight: 600;
}
.kw-ctx.active .mud-icon-root { opacity: 1; }
.kw-ctx-chev { font-size: 0.85rem !important; opacity: 0.55; margin-left: -1px; }
.kw-ctx-bracket { width: 1px; height: 16px; background: var(--kw-border); margin: 0 6px; flex: 0 0 auto; }
.kw-ctx-sub { height: 26px; font-size: 0.76rem; }

/* Mobile drawer items */
.kw-mobile-nav-item { width: 100%; border: none; background: transparent; text-align: left; cursor: pointer; }
.kw-mobile-nav-sub2 { padding-left: 48px !important; font-size: 0.78rem; opacity: 0.82; }

/* Native <details> dropdown menus (avatar + More) — no popover/JS dependency */
.kw-menu { position: relative; }
.kw-menu > summary { list-style: none; cursor: pointer; }
.kw-menu > summary::-webkit-details-marker { display: none; }
.kw-menu > summary::marker { content: ""; font-size: 0; }
.kw-nav-more { flex-shrink: 0; }
.kw-menu-pop {
    position: absolute;
    top: calc(100% + 8px);
    z-index: 1300;
    min-width: 232px;
    padding: 6px;
    background: var(--kw-surface);
    border: 1px solid var(--kw-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
}
.kw-menu-pop--right { right: 0; }
.kw-menu-pop--left { left: 0; }
.kw-dark .kw-menu-pop { background: var(--kw-surface-raised); }
.kw-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--kw-border); margin-bottom: 4px; }
.kw-menu-name { font-weight: 600; font-size: 0.9rem; color: var(--kw-text-primary); }
.kw-menu-email { font-size: 0.78rem; color: var(--kw-text-secondary); margin-top: 2px; word-break: break-all; }
.kw-menu-item {
    display: flex; align-items: center; gap: 12px;
    width: 100%; box-sizing: border-box;
    padding: 9px 12px; border: none; background: transparent;
    border-radius: 8px; cursor: pointer; text-align: left; text-decoration: none;
    font-family: 'DM Sans', sans-serif; font-size: 0.85rem; color: var(--kw-text-primary);
}
.kw-menu-item .mud-icon-root { font-size: 1.15rem; opacity: 0.7; }
.kw-menu-item:hover { background: var(--kw-surface-hover); }
.kw-menu-divider { height: 1px; background: var(--kw-border); margin: 4px 0; }

/* nav items are now <a> — strip link underline */
.kw-mod, .kw-ctx, .kw-mobile-nav-item { text-decoration: none; }

/* ── E-signature pad ── */
.kw-sig-canvas-wrap { position: relative; }
.kw-sig-canvas {
    width: 100%;
    border: 1.5px dashed var(--kw-border);
    border-radius: 10px;
    background: #fff;
    cursor: crosshair;
    touch-action: none;
    display: block;
}
.kw-sig-hint {
    position: absolute; left: 12px; bottom: 8px;
    font-size: 0.72rem; color: var(--kw-text-muted); pointer-events: none;
}
.kw-sig-typed-preview {
    margin-top: 10px; padding: 10px 16px;
    border: 1px solid var(--kw-border); border-radius: 10px; background: #fff;
    font-family: 'Segoe Script', 'Brush Script MT', cursive;
    font-size: 1.9rem; color: #1e3a5f;
}
/* signature shown on the approval timeline */
.kw-sig-thumb { max-height: 56px; max-width: 220px; border: 1px solid var(--kw-border); border-radius: 6px; background:#fff; padding:2px 4px; }
.kw-sig-typed-thumb { font-family: 'Segoe Script', 'Brush Script MT', cursive; font-size: 1.25rem; color: #1e3a5f; }

/* ── Document preview drawer (right-side panel) ── */
.kw-prev-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.45);
    backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 1399;
}
.kw-prev-overlay.open { opacity: 1; visibility: visible; }
.kw-prev-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(900px, 92vw);
    background: #fff;
    border-left: 1px solid var(--kw-border, #e2e8f0);
    box-shadow: -8px 0 40px rgba(0,0,0,0.22);
    z-index: 1400;
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.kw-prev-panel.open { transform: translateX(0); }
.kw-prev-resize {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 7px; cursor: ew-resize; z-index: 5;
    background: transparent;
}
.kw-prev-resize:hover, .kw-prev-resize:active { background: rgba(245, 158, 11, 0.35); }
.kw-prev-head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; flex: 0 0 auto;
    background: #0f172a; color: #fff;
}
.kw-prev-head-icon { color: #f59e0b; }
.kw-prev-head-meta { flex: 1; min-width: 0; }
.kw-prev-head-title { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-prev-head-sub { font-size: 0.72rem; color: rgba(255,255,255,0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-prev-head-actions { display: flex; align-items: center; gap: 4px; }
.kw-prev-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: transparent; border: none; color: rgba(255,255,255,0.85);
    cursor: pointer; text-decoration: none; transition: background .15s ease;
}
.kw-prev-icon-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
.kw-prev-body { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #f1f5f9; position: relative; }
.kw-prev-frame { flex: 1; width: 100%; border: none; background: #fff; }
.kw-prev-imgwrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.kw-prev-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.18); }
.kw-prev-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px; text-align: center; }
.kw-prev-fallback { color: var(--kw-text-muted,#64748b); }
.kw-prev-fallback-title { font-weight: 600; font-size: 1rem; color: var(--kw-text-primary,#1e293b); }
.kw-prev-fallback-sub { font-size: 0.82rem; }
.kw-prev-note {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; font-size: 0.72rem; color: var(--kw-text-muted,#64748b);
    background: #fff; border-top: 1px solid var(--kw-border,#e2e8f0);
}
.kw-prev-note a { color: #2563eb; font-weight: 600; margin-left: 4px; }
@media (max-width: 600px) { .kw-prev-panel { width: 100vw; } }

/* ── Page-image viewer (kw-pages.js): partial preview of PDFs ── */
.kw-pv { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.kw-pv-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--kw-border, #e2e8f0);
    font-size: 0.78rem; color: #475569;
}
.kw-pv-pagebox { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; }
.kw-pv-pageinput {
    width: 52px; padding: 3px 6px; border: 1px solid #cbd5e1; border-radius: 6px;
    font: inherit; text-align: center; color: #0f172a; background: #fff;
}
.kw-pv-pageinput::-webkit-inner-spin-button { opacity: 0.4; }
.kw-pv-count { color: #64748b; }
.kw-pv-btn {
    min-width: 28px; height: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid #e2e8f0;
    background: #fff; color: #0f172a; font: inherit; font-size: 0.95rem; line-height: 1; cursor: pointer;
}
.kw-pv-btn:hover { background: #f1f5f9; }
.kw-pv-btn:focus-visible, .kw-pv-pageinput:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.kw-pv-btn--text { font-size: 0.76rem; font-weight: 600; }
.kw-pv-zoom { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.kw-pv-status { flex: 1; min-width: 120px; text-align: right; color: #64748b; font-size: 0.72rem; }
.kw-pv-full { color: #1d4ed8; border-color: #bfdbfe; }
.kw-pv-scroll { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.kw-pv-page {
    position: relative; flex: 0 0 auto; max-width: none; background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 4px 18px rgba(15, 23, 42, 0.08); border-radius: 2px; overflow: hidden;
}
.kw-pv-page img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .18s ease; user-select: none; }
.kw-pv-page img.on { opacity: 1; }
.kw-pv-label {
    position: absolute; right: 8px; bottom: 6px; padding: 1px 7px; border-radius: 999px;
    background: rgba(15, 23, 42, 0.55); color: #fff; font-size: 0.66rem; font-variant-numeric: tabular-nums; pointer-events: none;
}
.kw-pv-spin {
    position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
    border: 3px solid #e2e8f0; border-top-color: #f59e0b; border-radius: 50%; opacity: 0; transition: opacity .2s ease;
}
.kw-pv-page.busy .kw-pv-spin { opacity: 1; animation: kwPvSpin .8s linear infinite; }
.kw-pv-page.err::after {
    content: "This page couldn't be shown — use Full PDF"; position: absolute; inset: 0; display: flex;
    align-items: center; justify-content: center; padding: 16px; text-align: center; font-size: 0.78rem; color: #64748b;
}
@keyframes kwPvSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .kw-pv-page.busy .kw-pv-spin { animation: none; } .kw-pv-page img { transition: none; } }

/* Mobile nav sub-items */
.kw-mobile-nav-sub {
    padding-left: 32px !important;
    font-size: 0.85rem;
}

.kw-mobile-nav-sep {
    height: 1px;
    background: var(--kw-border);
    margin: 4px 8px;
}

/* Mobile toggle (hidden on desktop) */
.kw-mobile-toggle {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--kw-text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    transition: background var(--kw-duration-fast);
}

.kw-mobile-toggle:hover {
    background: var(--kw-surface-hover);
}

/* Mobile nav dropdown */
.kw-mobile-nav {
    display: none;
    position: absolute;
    top: var(--kw-navrail-h);
    left: 0;
    right: 0;
    background: var(--kw-surface);
    border-bottom: 1px solid var(--kw-border);
    box-shadow: var(--kw-shadow-lg);
    padding: 8px;
    animation: kw-slideDown 200ms var(--kw-ease-out);
    z-index: 1089;
}

.kw-dark .kw-mobile-nav {
    background: var(--kw-surface-raised);
}

@keyframes kw-slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kw-mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--kw-text-secondary);
    text-decoration: none;
    transition: background-color var(--kw-duration-fast), color var(--kw-duration-fast);
}

.kw-mobile-nav-item:hover {
    background: var(--kw-surface-hover);
    color: var(--kw-text-primary);
}

.kw-mobile-nav-item.active {
    background: var(--kw-navy-50);
    color: var(--kw-navy-600);
    font-weight: 600;
}

.kw-dark .kw-mobile-nav-item.active {
    background: rgba(59, 130, 196, 0.12);
    color: var(--kw-navy-200);
}

/* ── Responsive: collapse nav to hamburger ── */
@media (max-width: 900px) {
    .kw-nav-items {
        display: none;
    }

    .kw-nav-context {
        display: none;
    }

    .kw-mobile-toggle {
        display: flex;
    }

    .kw-mobile-nav {
        display: block;
    }

    .kw-brand-name {
        font-size: 0.95rem;
    }

    .kw-brand-badge {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════════
   Main Content Area — Full Width
   ══════════════════════════════════════════════════════════════ */

.kw-content {
    flex: 1;
    padding: 28px 32px 40px;
    background: var(--kw-surface-muted);
    max-width: 1920px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.kw-dark .kw-content {
    background: var(--kw-surface-muted);
}

@media (max-width: 600px) {
    .kw-content {
        padding: 16px;
    }
}

/* ══════════════════════════════════════════════════════════════
   Dashboard Page Header
   ══════════════════════════════════════════════════════════════ */

.kw-page-header {
    background: linear-gradient(135deg, var(--kw-navy-900) 0%, var(--kw-navy-700) 50%, var(--kw-navy-600) 100%);
    border-radius: var(--kw-radius-lg);
    padding: 36px 40px;
    position: relative;
    overflow: hidden;
    margin-bottom: 28px;
}

.kw-page-header::before {
    content: '';
    position: absolute;
    top: -60%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 166, 35, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.kw-page-header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: 20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 196, 0.10) 0%, transparent 70%);
    pointer-events: none;
}

.kw-page-header-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    color: #FFFFFF;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.kw-page-header-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.65);
    position: relative;
    z-index: 1;
}

.kw-page-header-date {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   Stat Cards
   ══════════════════════════════════════════════════════════════ */

.kw-stat-card {
    background: var(--kw-surface-raised);
    border: 1px solid var(--kw-border-subtle);
    border-radius: var(--kw-radius-lg);
    padding: 24px;
    box-shadow: var(--kw-shadow-card);
    transition: box-shadow var(--kw-duration-normal) var(--kw-ease-out),
                transform var(--kw-duration-normal) var(--kw-ease-out),
                border-color var(--kw-duration-normal) var(--kw-ease-out);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.kw-stat-card:hover {
    box-shadow: var(--kw-shadow-card-hover);
    transform: translateY(-3px);
    border-color: var(--kw-border);
}

.kw-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
    transition: width var(--kw-duration-normal) var(--kw-ease-out);
}

.kw-stat-card:hover::before {
    width: 6px;
}

.kw-stat-card--investments::before { background: linear-gradient(180deg, var(--kw-navy-400), var(--kw-navy-500)); }
.kw-stat-card--documents::before { background: linear-gradient(180deg, var(--kw-emerald-500), var(--kw-teal-500)); }
.kw-stat-card--workplans::before { background: linear-gradient(180deg, var(--kw-teal-400), var(--kw-teal-500)); }
.kw-stat-card--approvals::before { background: linear-gradient(180deg, var(--kw-amber-400), var(--kw-amber-500)); }

.kw-stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--kw-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--kw-duration-normal) var(--kw-ease-spring);
}

.kw-stat-card:hover .kw-stat-icon-wrap {
    transform: scale(1.08);
}

.kw-stat-icon-wrap--investments {
    background: linear-gradient(135deg, rgba(37, 99, 168, 0.10), rgba(37, 99, 168, 0.05));
    color: var(--kw-navy-400);
}

.kw-stat-icon-wrap--documents {
    background: linear-gradient(135deg, rgba(5, 150, 105, 0.10), rgba(5, 150, 105, 0.05));
    color: var(--kw-emerald-500);
}

.kw-stat-icon-wrap--workplans {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(20, 184, 166, 0.05));
    color: var(--kw-teal-400);
}

.kw-stat-icon-wrap--approvals {
    background: linear-gradient(135deg, rgba(232, 146, 12, 0.10), rgba(232, 146, 12, 0.05));
    color: var(--kw-amber-500);
}

.kw-stat-value {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.85rem;
    line-height: 1;
    color: var(--kw-text-primary);
    letter-spacing: -0.02em;
}

.kw-stat-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--kw-text-secondary);
    margin-top: 4px;
}

.kw-stat-trend {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 100px;
    margin-top: 8px;
}

.kw-stat-trend--up {
    background: rgba(5, 150, 105, 0.08);
    color: var(--kw-emerald-500);
}

.kw-stat-trend--neutral {
    background: rgba(100, 116, 139, 0.08);
    color: var(--kw-text-secondary);
}

/* ══════════════════════════════════════════════════════════════
   Info / Status Panel
   ══════════════════════════════════════════════════════════════ */

.kw-info-panel {
    background: var(--kw-surface-raised);
    border: 1px solid var(--kw-border-subtle);
    border-radius: var(--kw-radius-lg);
    padding: 28px 32px;
    box-shadow: var(--kw-shadow-sm);
    position: relative;
    overflow: hidden;
}

.kw-info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--kw-navy-500), var(--kw-amber-400), var(--kw-teal-400));
}

.kw-info-panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--kw-text-primary);
    margin-bottom: 8px;
}

.kw-info-panel-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--kw-text-secondary);
    line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════════
   Quick Action Cards
   ══════════════════════════════════════════════════════════════ */

.kw-action-card {
    background: var(--kw-surface-raised);
    border: 1px solid var(--kw-border-subtle);
    border-radius: var(--kw-radius-lg);
    padding: 24px;
    box-shadow: var(--kw-shadow-sm);
    transition: box-shadow var(--kw-duration-normal) var(--kw-ease-out),
                transform var(--kw-duration-normal) var(--kw-ease-out),
                border-color var(--kw-duration-normal) var(--kw-ease-out);
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: inherit;
}

.kw-action-card:hover {
    box-shadow: var(--kw-shadow-md);
    transform: translateY(-2px);
    border-color: var(--kw-navy-100);
}

.kw-dark .kw-action-card:hover {
    border-color: var(--kw-navy-600);
}

.kw-action-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--kw-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    font-size: 1.3rem;
    transition: transform var(--kw-duration-normal) var(--kw-ease-spring);
}

.kw-action-card:hover .kw-action-card-icon {
    transform: scale(1.1) rotate(-3deg);
}

.kw-action-card-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--kw-text-primary);
    margin-bottom: 4px;
}

.kw-action-card-desc {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    color: var(--kw-text-muted);
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════
   Staggered Entrance Animations
   ══════════════════════════════════════════════════════════════ */

@keyframes kw-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kw-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes kw-scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.kw-animate-in {
    animation: kw-fadeInUp var(--kw-duration-slow) var(--kw-ease-out) both;
}

.kw-animate-in--d1 { animation-delay: 0ms; }
.kw-animate-in--d2 { animation-delay: 60ms; }
.kw-animate-in--d3 { animation-delay: 120ms; }
.kw-animate-in--d4 { animation-delay: 180ms; }
.kw-animate-in--d5 { animation-delay: 240ms; }
.kw-animate-in--d6 { animation-delay: 300ms; }
.kw-animate-in--d7 { animation-delay: 360ms; }
.kw-animate-in--d8 { animation-delay: 420ms; }

/* ══════════════════════════════════════════════════════════════
   Activity / Timeline
   ══════════════════════════════════════════════════════════════ */

.kw-activity-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--kw-border-subtle);
    transition: background var(--kw-duration-fast);
}

.kw-activity-item:last-child {
    border-bottom: none;
}

.kw-activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.kw-activity-text {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.84rem;
    color: var(--kw-text-secondary);
    line-height: 1.5;
}

.kw-activity-time {
    font-size: 0.72rem;
    color: var(--kw-text-muted);
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════
   Divider with Label
   ══════════════════════════════════════════════════════════════ */

.kw-section-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 28px 0 18px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kw-text-muted);
}

.kw-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--kw-border);
}

/* ══════════════════════════════════════════════════════════════
   Blazor / Validation Defaults (preserved)
   ══════════════════════════════════════════════════════════════ */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--kw-rose-500);
}

.validation-message {
    color: var(--kw-rose-500);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--kw-radius-sm);
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ══════════════════════════════════════════════════════════════
   MudBlazor Overrides (minimal, surgical)
   ══════════════════════════════════════════════════════════════ */

.mud-table-root {
    border-radius: var(--kw-radius-lg) !important;
    overflow: hidden;
    border: 1px solid var(--kw-border-subtle) !important;
}

.mud-table-head .mud-table-cell {
    font-family: 'DM Sans', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--kw-text-muted);
}

.mud-table-body .mud-table-cell {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.875rem;
}

.mud-button-root {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    border-radius: var(--kw-radius-sm) !important;
}

.mud-chip {
    font-family: 'DM Sans', sans-serif !important;
    font-weight: 500;
}

/* ══════════════════════════════════════════════════════════════
   Scrollbar Styling
   ══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--kw-text-muted);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--kw-text-secondary);
}

/* Sign-in pages: their styles live in public.css (section "auth"). This one rule stays here because
   the private two-factor setup page uses the same input class. */
.kw-auth-input .mud-input-outlined-border {
    border-radius: var(--kw-radius-md) !important;
}

/* ══════════════════════════════════════════════════════════════
   Phase 12 — Notification Center
   Bell badge animation, dropdown panel, list cards, preference toggles
   ══════════════════════════════════════════════════════════════ */

/* ── BELL BUTTON & BADGE ── */
.kw-notif-trigger {
    position: relative;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 6px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.15s ease;
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
}
.kw-notif-trigger:hover { background: rgba(255, 255, 255, 0.06); }
.kw-notif-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px; height: 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
    animation: kwNotifPulse 2s ease-in-out infinite;
}
@keyframes kwNotifPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* ── DROPDOWN PANEL ── */
.kw-notif-panel {
    width: 380px;
    max-height: 540px;
    display: flex; flex-direction: column;
    background: var(--kw-surface);
    border: 1px solid var(--kw-line);
    border-radius: 14px;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}
.kw-notif-panel-head {
    padding: 16px 18px;
    border-bottom: 1px solid var(--kw-line);
    background: var(--kw-surface-muted);
    display: flex; align-items: center; gap: 8px;
}
.kw-notif-panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--kw-text-primary);
    margin: 0;
    flex: 1;
}
.kw-notif-panel-action {
    background: transparent; border: none; cursor: pointer;
    color: #F59E0B;
    font-size: 0.78rem; font-weight: 600;
    padding: 4px 8px; border-radius: 6px;
    transition: background 0.15s ease;
}
.kw-notif-panel-action:hover { background: rgba(245, 158, 11, 0.08); }
.kw-notif-list {
    flex: 1;
    overflow-y: auto;
    max-height: 420px;
}
.kw-notif-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    padding: 14px 18px 14px 24px;
    border-bottom: 1px solid var(--kw-line);
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none; color: inherit;
    position: relative;
}
.kw-notif-item:hover { background: var(--kw-surface-muted); }
.kw-notif-item.is-unread::before {
    content: '';
    position: absolute;
    left: 8px; top: 22px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #F59E0B;
}
.kw-notif-item-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--notif-color, #64748B) 14%, transparent);
    color: var(--notif-color, #64748B);
    flex-shrink: 0;
}
.kw-notif-item-body { min-width: 0; }
.kw-notif-item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--kw-text-primary);
    margin: 0 0 2px;
    line-height: 1.3;
}
.kw-notif-item-msg {
    font-size: 0.78rem;
    color: var(--kw-text-muted);
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.kw-notif-item-time {
    font-size: 0.7rem;
    color: var(--kw-text-muted);
    flex-shrink: 0;
    padding-top: 2px;
}
.kw-notif-panel-foot {
    padding: 12px 18px;
    text-align: center;
    border-top: 1px solid var(--kw-line);
    background: var(--kw-surface-muted);
}
.kw-notif-panel-foot a {
    color: var(--kw-text-secondary);
    font-size: 0.85rem; font-weight: 600;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
}
.kw-notif-panel-foot a:hover { color: #F59E0B; }
.kw-notif-empty {
    padding: 48px 20px;
    text-align: center;
    color: var(--kw-text-muted);
}
.kw-notif-empty-icon {
    font-size: 2.5rem;
    opacity: 0.35;
    margin-bottom: 10px;
}

/* ── PREFERENCES PAGE ── */
.kw-notif-pref-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.kw-notif-pref-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 16px 20px;
    background: var(--kw-surface);
    border: 1px solid var(--kw-line);
    border-radius: 14px;
    transition: border-color 0.15s ease;
}
.kw-notif-pref-row:hover { border-color: color-mix(in srgb, var(--pref-color, #1A3A64) 50%, var(--kw-line)); }
.kw-notif-pref-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--pref-color, #1A3A64) 14%, transparent);
    color: var(--pref-color, #1A3A64);
    display: flex; align-items: center; justify-content: center;
}
.kw-notif-pref-body { min-width: 0; }
.kw-notif-pref-title {
    font-weight: 600;
    color: var(--kw-text-primary);
    margin: 0 0 2px;
    font-size: 0.92rem;
}
.kw-notif-pref-desc {
    font-size: 0.78rem;
    color: var(--kw-text-muted);
    margin: 0;
}
.kw-notif-pref-toggle {
    display: flex; flex-direction: column; align-items: center;
    gap: 2px;
}
.kw-notif-pref-toggle-label {
    font-size: 0.68rem;
    color: var(--kw-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ── DIGEST CARD (preferences page top) ── */
.kw-notif-digest-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #fff;
    border-radius: 18px;
    padding: 28px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.kw-notif-digest-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 90% 10%, rgba(245,158,11,0.2), transparent 50%);
    pointer-events: none;
}
.kw-notif-digest-card-inner { position: relative; }
.kw-notif-digest-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    position: relative;
    margin-top: 18px;
}
.kw-notif-digest-tile {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex; align-items: center; gap: 14px;
}
.kw-notif-digest-tile-info { flex: 1; }
.kw-notif-digest-tile-title {
    font-weight: 600;
    margin: 0 0 2px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.92rem;
}
.kw-notif-digest-tile-desc {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}
@media (max-width: 600px) {
    .kw-notif-digest-grid { grid-template-columns: 1fr; }
    .kw-notif-pref-row { grid-template-columns: auto 1fr; }
    .kw-notif-pref-toggle { grid-column: 1 / -1; flex-direction: row; }
    .kw-notif-panel { width: calc(100vw - 32px); max-width: 380px; }
}

/* ══════════════════════════════════════════════════════════════
   Phase 13 — AI Knowledge Assistant
   Chat bubbles, citations, search results, suggestion chips
   ══════════════════════════════════════════════════════════════ */

.kw-ai-shell {
    display: grid;
    grid-template-rows: auto 1fr auto;
    height: calc(100vh - 180px);
    min-height: 540px;
    background: var(--kw-surface);
    border-radius: 18px;
    border: 1px solid var(--kw-line);
    overflow: hidden;
}

/* ── HERO header ── */
.kw-ai-hero {
    background:
        radial-gradient(800px 300px at 100% -20%, rgba(168,85,247,0.22), transparent 60%),
        radial-gradient(600px 300px at 0% 120%, rgba(245,158,11,0.15), transparent 60%),
        linear-gradient(135deg, #1E1B4B 0%, #312E81 60%, #4F46E5 100%);
    color: #fff;
    padding: 22px 28px;
    display: flex; align-items: center; gap: 16px;
}
.kw-ai-hero-avatar {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #A855F7 0%, #6366F1 100%);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35);
    flex-shrink: 0;
}
.kw-ai-hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0; line-height: 1.2;
}
.kw-ai-hero-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin: 4px 0 0;
}
.kw-ai-hero-status {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.kw-ai-hero-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.18);
    animation: kwAiPulse 2s ease-in-out infinite;
}
@keyframes kwAiPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

/* ── Conversation log ── */
.kw-ai-log {
    overflow-y: auto;
    padding: 24px 28px;
    background: var(--kw-surface-muted);
    display: flex; flex-direction: column; gap: 18px;
}
.kw-ai-row { display: flex; gap: 12px; }
.kw-ai-row--user { flex-direction: row-reverse; }
.kw-ai-bubble {
    max-width: min(720px, 80%);
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.55;
    font-size: 0.93rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.kw-ai-bubble--user {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #fff;
    border-bottom-right-radius: 6px;
}
.kw-ai-bubble--assistant {
    background: #fff;
    color: var(--kw-text-primary);
    border: 1px solid var(--kw-line);
    border-bottom-left-radius: 6px;
}
.kw-ai-avatar {
    width: 36px; height: 36px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
}
.kw-ai-avatar--assistant {
    background: linear-gradient(135deg, #A855F7 0%, #6366F1 100%);
    box-shadow: 0 4px 12px rgba(168,85,247,0.3);
}
.kw-ai-avatar--user {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

/* ── Citations ── */
.kw-ai-citations {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--kw-line);
    display: flex; flex-direction: column; gap: 6px;
}
.kw-ai-citations-head {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--kw-text-muted);
    margin-bottom: 4px;
}
.kw-ai-citation {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--kw-surface-muted);
    border-left: 3px solid var(--cite-color, #A855F7);
    text-decoration: none; color: inherit;
    transition: transform 0.15s ease;
}
.kw-ai-citation:hover { transform: translateX(2px); }
.kw-ai-citation-icon {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--cite-color, #A855F7) 14%, transparent);
    color: var(--cite-color, #A855F7);
}
.kw-ai-citation-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--kw-text-primary);
    margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kw-ai-citation-snippet {
    font-size: 0.74rem;
    color: var(--kw-text-muted);
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.kw-ai-citation-score {
    font-size: 0.7rem; font-weight: 600;
    color: var(--cite-color, #A855F7);
    font-variant-numeric: tabular-nums;
}

/* ── Composer ── */
.kw-ai-composer {
    padding: 16px 20px;
    border-top: 1px solid var(--kw-line);
    background: var(--kw-surface);
    display: flex; flex-direction: column; gap: 10px;
}
.kw-ai-composer-input {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}
.kw-ai-textarea {
    background: var(--kw-surface-muted);
    border: 1px solid var(--kw-line);
    border-radius: 14px;
    padding: 12px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.93rem;
    resize: none;
    min-height: 48px;
    max-height: 160px;
    color: var(--kw-text-primary);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kw-ai-textarea:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.kw-ai-send {
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
    color: #fff;
    padding: 0 20px;
    height: 48px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kw-ai-send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
}
.kw-ai-send:disabled {
    background: var(--kw-surface-muted);
    color: var(--kw-text-muted);
    cursor: not-allowed;
}

.kw-ai-suggestions {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.kw-ai-chip {
    background: var(--kw-surface-muted);
    border: 1px solid var(--kw-line);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    color: var(--kw-text-secondary);
}
.kw-ai-chip:hover {
    border-color: #6366F1;
    color: #4F46E5;
}

/* ── Thinking indicator ── */
.kw-ai-thinking {
    display: inline-flex; gap: 4px; padding: 14px 20px;
    background: #fff;
    border: 1px solid var(--kw-line);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
}
.kw-ai-thinking-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #A855F7;
    animation: kwAiThink 1.4s infinite ease-in-out both;
}
.kw-ai-thinking-dot:nth-child(1) { animation-delay: -0.32s; }
.kw-ai-thinking-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes kwAiThink {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.5; }
    40% { transform: scale(1.0); opacity: 1; }
}

/* ── Search results page ── */
.kw-ai-search-result {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    background: var(--kw-surface);
    border: 1px solid var(--kw-line);
    border-left: 3px solid var(--result-color, #6366F1);
    border-radius: 14px;
    margin-bottom: 10px;
    text-decoration: none; color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kw-ai-search-result:hover {
    transform: translateX(2px);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

/* ── Conversation history list ── */
.kw-ai-conv {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    background: var(--kw-surface);
    border: 1px solid var(--kw-line);
    border-radius: 14px;
    margin-bottom: 10px;
    transition: border-color 0.15s ease;
}
.kw-ai-conv:hover { border-color: #6366F1; }
.kw-ai-conv-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: color-mix(in srgb, #6366F1 14%, transparent);
    color: #6366F1;
    display: flex; align-items: center; justify-content: center;
}
.kw-ai-conv-title {
    font-weight: 600;
    margin: 0;
    color: var(--kw-text-primary);
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.kw-ai-conv-meta {
    font-size: 0.78rem;
    color: var(--kw-text-muted);
    margin: 4px 0 0;
}

@media (max-width: 720px) {
    .kw-ai-bubble { max-width: 92%; }
    .kw-ai-shell { height: calc(100vh - 120px); border-radius: 0; }
}

/* ── 2FA Setup Page ── */
.kw-2fa-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.kw-2fa-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.kw-2fa-header-icon {
    color: var(--mud-palette-primary);
}

.kw-2fa-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    margin: 0;
}

.kw-2fa-subtitle {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
    margin: 0.25rem 0 0;
}

.kw-2fa-card {
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    padding: 1.5rem;
}

.kw-2fa-manual-key {
    background: var(--mud-palette-background-grey);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.kw-2fa-shared-key {
    display: block;
    font-family: 'DM Sans', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--mud-palette-primary);
    margin-top: 0.5rem;
    word-break: break-all;
}

.kw-2fa-codes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.kw-2fa-code {
    display: block;
    background: var(--mud-palette-background-grey);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'DM Sans', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--mud-palette-text-primary);
    text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   Approval Timeline
   ══════════════════════════════════════════════════════════════ */

.kw-approval-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 4px;
}

.kw-timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    position: relative;
}

.kw-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: var(--kw-border);
}

.kw-timeline-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    background: var(--kw-surface);
}

.kw-timeline-completed .kw-timeline-marker {
    color: var(--kw-emerald-500);
}

.kw-timeline-current .kw-timeline-marker {
    color: var(--kw-amber-500);
    animation: kw-pulse 2s ease-in-out infinite;
}

.kw-timeline-returned .kw-timeline-marker {
    color: var(--kw-rose-500);
}

.kw-timeline-rejected .kw-timeline-marker {
    color: #e11d48;
}

.kw-timeline-upcoming .kw-timeline-marker {
    color: var(--kw-text-muted);
}

.kw-timeline-content {
    flex: 1;
    min-width: 0;
}

.kw-timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.kw-timeline-header strong {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--kw-text-primary);
}

.kw-timeline-status-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kw-timeline-completed .kw-timeline-status-label {
    background: rgba(5, 150, 105, 0.08);
    color: var(--kw-emerald-500);
}

.kw-timeline-current .kw-timeline-status-label {
    background: rgba(232, 146, 12, 0.08);
    color: var(--kw-amber-500);
}

.kw-timeline-returned .kw-timeline-status-label {
    background: rgba(225, 29, 72, 0.08);
    color: var(--kw-rose-500);
}

.kw-timeline-rejected .kw-timeline-status-label {
    background: rgba(225, 29, 72, 0.12);
    color: #be123c;
}

.kw-timeline-upcoming .kw-timeline-status-label {
    background: rgba(100, 116, 139, 0.08);
    color: var(--kw-text-muted);
}

.kw-timeline-approvers {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    color: var(--kw-text-secondary);
    margin-bottom: 6px;
}

.kw-timeline-action {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    margin-top: 6px;
}

.kw-timeline-action-by {
    font-weight: 600;
    color: var(--kw-text-primary);
}

.kw-timeline-action-type {
    color: var(--kw-text-secondary);
}

.kw-timeline-date {
    color: var(--kw-text-muted);
    font-size: 0.75rem;
}

.kw-timeline-comments {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--kw-text-secondary);
    margin-top: 6px;
    padding: 8px 12px;
    background: var(--kw-surface-muted);
    border-radius: var(--kw-radius-sm);
    border-left: 3px solid var(--kw-border);
    font-style: italic;
}

/* ══════════════════════════════════════════════════════════════
   Module Page Headers (reusable across all modules)
   ══════════════════════════════════════════════════════════════ */

/* The legacy module shell. Pages not yet hand-converted to `kw-ui` still use these three
   classes, so they are styled to MATCH the new shell: same width, same hero treatment, same
   token scope. That gives every remaining module the modern look and correct dark mode without
   touching its markup, and lets a legacy page drop in `kw-ui-*` pieces (stat bands, cards,
   tables) incrementally. New pages should use `kw-ui` directly. */
.kw-module-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 8px 48px;
}

.kw-module-header {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 26px 28px 28px;
    border-radius: 18px;
    margin-bottom: 22px;
    color: #fff;
}

/* Same soft grid + corner glow as .kw-ui-hero, so a legacy header reads as the same object. */
.kw-module-header::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, 0.10), transparent 55%),
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: auto, 30px 30px, 30px 30px;
}

/* Keep the header's own children above the texture layer. */
.kw-module-header > * { position: relative; }

.kw-module-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    letter-spacing: -0.01em;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.14;
}

.kw-module-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.78);
    margin: 5px 0 0;
    line-height: 1.5;
    max-width: 640px;
}

/* ══════════════════════════════════════════════════════════════
   Phase 10 — Dashboards & Analytics
   Modern bento layout, gradient KPI tiles, sparklines, RAG bars
   ══════════════════════════════════════════════════════════════ */

.kw-dash {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 32px;
}

/* ── Hero header ── */
.kw-dash-hero {
    position: relative;
    border-radius: 24px;
    padding: 28px 32px;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
.kw-dash-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at 88% -10%, rgba(255,255,255,0.18), transparent 55%),
                radial-gradient(circle at 5% 110%, rgba(255,255,255,0.10), transparent 60%);
    pointer-events: none;
}
.kw-dash-hero-inner {
    position: relative;
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.kw-dash-hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
}
.kw-dash-hero-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.75rem;
    margin: 4px 0 6px;
    line-height: 1.15;
}
.kw-dash-hero-sub {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.78);
    margin: 0;
}
.kw-dash-hero-actions { margin-left: auto; display: flex; gap: 8px; }

/* ── KPI tile (modern stat card with sparkline) ── */
.kw-dash-kpi {
    background: var(--kw-surface);
    border: 1px solid var(--kw-line);
    border-radius: 18px;
    padding: 18px 20px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kw-dash-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}
.kw-dash-kpi::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--kpi-color, #1A3A64), transparent);
    opacity: 0.85;
}
.kw-dash-kpi-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.kw-dash-kpi-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--kw-text-muted);
}
.kw-dash-kpi-icon {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    color: var(--kpi-color, #1A3A64);
    background: color-mix(in srgb, var(--kpi-color, #1A3A64) 12%, transparent);
}
.kw-dash-kpi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--kw-text-primary);
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.kw-dash-kpi-sub {
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--kw-text-muted);
    display: flex; align-items: center; gap: 4px;
}

.kw-dash-trend {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 0.72rem; font-weight: 600;
    padding: 2px 6px; border-radius: 999px;
}
.kw-dash-trend--up { color: #047857; background: rgba(16,185,129,0.12); }
.kw-dash-trend--down { color: #B91C1C; background: rgba(239,68,68,0.12); }
.kw-dash-trend--flat { color: #475569; background: rgba(100,116,139,0.12); }

/* Inline SVG sparkline area — reserved width */
.kw-spark { display: block; width: 100%; height: 36px; margin-top: 10px; }

/* ── Bento grid panel ── */
.kw-dash-panel {
    background: var(--kw-surface);
    border: 1px solid var(--kw-line);
    border-radius: 18px;
    padding: 20px;
    display: flex; flex-direction: column; gap: 14px;
}
.kw-dash-panel-head {
    display: flex; align-items: center; gap: 10px;
}
.kw-dash-panel-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    margin: 0;
    color: var(--kw-text-primary);
}
.kw-dash-panel-sub {
    font-size: 0.78rem;
    color: var(--kw-text-muted);
    margin: 0;
}
.kw-dash-panel-actions { margin-left: auto; }

/* ── RAG status segmented bar ── */
.kw-rag-bar {
    display: flex; height: 8px; border-radius: 999px; overflow: hidden;
    background: var(--kw-line);
    margin: 6px 0 4px;
}
.kw-rag-bar-seg { height: 100%; transition: width 0.3s ease; }
.kw-rag-bar-seg--green { background: #10B981; }
.kw-rag-bar-seg--amber { background: #F59E0B; }
.kw-rag-bar-seg--red { background: #EF4444; }
.kw-rag-legend {
    display: flex; gap: 12px; font-size: 0.74rem; color: var(--kw-text-muted);
}
.kw-rag-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.kw-rag-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── Activity feed ── */
.kw-dash-feed {
    display: flex; flex-direction: column; gap: 0;
    max-height: 420px; overflow-y: auto;
}
.kw-dash-feed-item {
    display: flex; gap: 12px; padding: 12px 0;
    border-bottom: 1px dashed var(--kw-line);
}
.kw-dash-feed-item:last-child { border-bottom: none; }
.kw-dash-feed-icon {
    width: 32px; height: 32px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--feed-color, #64748B) 14%, transparent);
    color: var(--feed-color, #64748B);
    flex-shrink: 0;
}
.kw-dash-feed-content { flex: 1; min-width: 0; }
.kw-dash-feed-title {
    font-size: 0.88rem; font-weight: 600;
    color: var(--kw-text-primary);
    margin: 0 0 2px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kw-dash-feed-desc {
    font-size: 0.78rem; color: var(--kw-text-muted); margin: 0;
}
.kw-dash-feed-time {
    font-size: 0.72rem; color: var(--kw-text-muted);
    flex-shrink: 0; padding-top: 4px;
}

/* ── Distribution bars (horizontal category chart) ── */
.kw-dist-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 12px;
    align-items: center;
    padding: 6px 0;
}
.kw-dist-label {
    font-size: 0.85rem;
    color: var(--kw-text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kw-dist-value {
    font-size: 0.82rem; font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--kw-text-secondary);
}
.kw-dist-bar {
    grid-column: 1 / 3;
    height: 6px; border-radius: 999px;
    background: var(--kw-line);
    overflow: hidden;
}
.kw-dist-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bar-color, #1A3A64), color-mix(in srgb, var(--bar-color, #1A3A64) 60%, white));
    transition: width 0.4s ease;
}

/* ── Empty state ── */
.kw-dash-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--kw-text-muted);
}
.kw-dash-empty-icon {
    font-size: 2.5rem;
    opacity: 0.35;
    margin-bottom: 8px;
}

/* ── Pending action card (User dashboard) ── */
.kw-action-tile {
    border: 1px solid var(--kw-line);
    border-left: 3px solid var(--action-color, #1A3A64);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--kw-surface);
    display: flex; gap: 10px; align-items: flex-start;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
    color: inherit;
}
.kw-action-tile:hover {
    transform: translateX(2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.kw-action-tile-body { flex: 1; min-width: 0; }
.kw-action-tile-title {
    font-size: 0.88rem; font-weight: 600;
    color: var(--kw-text-primary);
    margin: 0;
    overflow: hidden; text-overflow: ellipsis;
}
.kw-action-tile-desc {
    font-size: 0.75rem; color: var(--kw-text-muted);
    margin: 2px 0 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Hero gradient variants per dashboard ── */
.kw-hero--executive { background: linear-gradient(135deg, #0F172A 0%, #1E40AF 60%, #0EA5E9 100%); }
.kw-hero--investments { background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%); }
.kw-hero--planning { background: linear-gradient(135deg, #115E59 0%, #0D9488 50%, #14B8A6 100%); }
.kw-hero--activities { background: linear-gradient(135deg, #9A3412 0%, #EA580C 50%, #F97316 100%); }
.kw-hero--resources { background: linear-gradient(135deg, #064E3B 0%, #047857 50%, #10B981 100%); }
.kw-hero--user { background: linear-gradient(135deg, #1E293B 0%, #334155 50%, #475569 100%); }
.kw-hero--admin { background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 50%, #A855F7 100%); }
.kw-hero--tracker { background: linear-gradient(135deg, #1E3A8A 0%, #1D4ED8 50%, #6366F1 100%); }

/* ── Stagger fade-in animation ── */
@keyframes kwDashFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.kw-dash > * { animation: kwDashFade 0.4s ease both; }
.kw-dash > *:nth-child(2) { animation-delay: 0.06s; }
.kw-dash > *:nth-child(3) { animation-delay: 0.12s; }
.kw-dash > *:nth-child(4) { animation-delay: 0.18s; }
.kw-dash > *:nth-child(5) { animation-delay: 0.24s; }

/* Dark mode */
.kw-dark .kw-dash-kpi,
.kw-dark .kw-dash-panel,
.kw-dark .kw-action-tile {
    background: rgba(255,255,255,0.02);
    border-color: rgba(255,255,255,0.08);
}

/* ──────────────────────────────────────────────────────────────
   Work-plan bulk grid editor (Excel-like): frozen panes + inline cells
   ────────────────────────────────────────────────────────────── */
.kw-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.kw-grid-toolbar-info { display: flex; align-items: center; gap: 0.5rem; }
.kw-grid-toolbar-actions { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; }

.kw-grid-wrap {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid var(--kw-line, #e2e8f0);
    border-radius: 8px;
    background: var(--mud-palette-surface, #fff);
}
.kw-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.8rem;
}
.kw-grid th, .kw-grid td {
    border-bottom: 1px solid var(--kw-line, #e2e8f0);
    border-right: 1px solid var(--kw-line, #eef2f7);
    padding: 2px 6px;
    white-space: nowrap;
    background: var(--mud-palette-surface, #fff);
}
.kw-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--mud-palette-background-grey, #f1f5f9);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    color: var(--kw-text-muted, #64748b);
    text-align: left;
}
.kw-grid .kw-grid-num { text-align: right; }
.kw-grid th.kw-grid-num { text-align: right; }
.kw-grid .kw-grid-tint { background: var(--kw-amber-100, #fef3c7); }
.kw-grid thead th.kw-grid-tint { background: #fde9b8; }

/* frozen context columns — the strategic-plan hierarchy: Strategy › Activity › Output › Indicator */
.kw-grid .kw-grid-c1, .kw-grid .kw-grid-c2, .kw-grid .kw-grid-c3, .kw-grid .kw-grid-c4 {
    position: sticky;
    z-index: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.kw-grid .kw-grid-c1 { left: 0;     min-width: 150px; max-width: 150px; }
.kw-grid .kw-grid-c2 { left: 150px; min-width: 170px; max-width: 170px; }
.kw-grid .kw-grid-c3 { left: 320px; min-width: 150px; max-width: 150px; font-weight: 400; }
.kw-grid .kw-grid-c4 { left: 470px; min-width: 170px; max-width: 170px; border-right: 1px solid var(--mud-palette-lines-default, #e2e8f0); }
.kw-grid thead th.kw-grid-c1, .kw-grid thead th.kw-grid-c2,
.kw-grid thead th.kw-grid-c3, .kw-grid thead th.kw-grid-c4 { z-index: 4; }

/* strategic objective group header */
.kw-grid tr.kw-grid-group td {
    background: #ecfeff;
    border-top: 2px solid #06b6d4;
    padding: 6px 8px;
}
.kw-grid-group-label {
    position: sticky;
    left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #0e7490;
    white-space: nowrap;
}
.kw-grid-group-count { font-weight: 500; font-size: 0.72rem; color: var(--kw-text-muted, #64748b); }
.kw-grid tr.kw-grid-newstrategy td { border-top: 1px solid var(--mud-palette-lines-default, #e2e8f0); }
.kw-grid td.kw-grid-comments { font-size: 0.74rem; white-space: normal; min-width: 220px; max-width: 360px; }
.kw-dark .kw-grid tr.kw-grid-group td { background: rgba(6, 182, 212, 0.12); }
.kw-dark .kw-grid-group-label { color: #67e8f9; }

.kw-grid tfoot td {
    font-weight: 700;
    background: var(--mud-palette-background-grey, #f8fafc);
    position: sticky;
    bottom: 0;
    z-index: 2;
}
.kw-grid tfoot td.kw-grid-c1, .kw-grid tfoot td.kw-grid-c2,
.kw-grid tfoot td.kw-grid-c3, .kw-grid tfoot td.kw-grid-c4 { z-index: 3; }

.kw-grid-input {
    width: 100%;
    min-width: 64px;
    border: 1px solid transparent;
    background: transparent;
    padding: 3px 4px;
    font-size: 0.8rem;
    font-family: inherit;
    color: inherit;
    border-radius: 3px;
}
.kw-grid-num .kw-grid-input { text-align: right; }

/* Excel-style sums in figure cells (kw-calc.js): a hint in the grid toolbar, and a cell whose sum
   doesn't work out. */
.kw-calc-hint {
    display: inline-flex; align-items: center; gap: 4px; margin-left: 10px;
    font-size: 0.75rem; color: var(--mud-palette-text-secondary); white-space: nowrap;
}
input.kw-calc-bad { outline: 2px solid var(--mud-palette-error); outline-offset: -2px; }
.kw-grid-input:hover { border-color: var(--kw-line, #e2e8f0); }
.kw-grid-input:focus {
    outline: none;
    border-color: var(--kw-amber-400, #fbbf24);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}
.kw-grid-input.kw-grid-dirty { background: var(--kw-amber-100, #fef3c7); border-color: var(--kw-amber-300, #fcd34d); }
.kw-grid-input.kw-grid-invalid { background: #fee2e2; border-color: #ef4444; color: #b91c1c; }
.kw-grid-rowfail td { background: #fef2f2 !important; }
.kw-grid-empty { text-align: center; padding: 16px; color: var(--kw-text-muted, #94a3b8); }

/* ── All-Users Permissions Matrix (collapsed heatmap + drill-down) ── */
.kw-permmatrix-table { border-collapse: collapse; width: 100%; font-size: 0.82rem; }
.kw-permmatrix-table th, .kw-permmatrix-table td {
    border-bottom: 1px solid var(--kw-line, #e2e8f0);
    border-right: 1px solid var(--kw-line, #eef2f7);
    padding: 8px 10px;
    background: var(--mud-palette-surface, #fff);
    white-space: nowrap;
}
.kw-permmatrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--mud-palette-background-grey, #f1f5f9);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--kw-text-muted, #64748b);
    text-align: left;
}
.kw-permmatrix-modcol { cursor: pointer; text-align: center; user-select: none; }
.kw-permmatrix-modcol:hover { background: var(--kw-amber-100, #fef3c7); }
.kw-permmatrix-permcol { text-align: center; min-width: 64px; }
.kw-permmatrix-permcol-inner { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.68rem; }
.kw-permmatrix-collapse { width: 36px; text-align: center; }
.kw-permmatrix-c1 {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 220px;
    max-width: 260px;
    white-space: normal;
}
.kw-permmatrix-table thead th.kw-permmatrix-c1 { z-index: 4; }
.kw-permmatrix-email { font-size: 0.72rem; color: var(--kw-text-muted, #94a3b8); }
.kw-permmatrix-inactive { text-decoration: line-through; color: var(--kw-text-muted, #94a3b8); }
.kw-permmatrix-cell { display: inline-block; width: 22px; height: 12px; border-radius: 6px; }

.kw-dark .kw-grid th,
.kw-dark .kw-grid td { background: #1e293b; border-color: rgba(255,255,255,0.07); }
.kw-dark .kw-grid thead th { background: #0f172a; }

/* ══════════════════════════════════════════════════════════════
   Investment Impact Map (kw-map.js / Leaflet)
   Shared by the public homepage, /public/tracker and /investments/map.
   ══════════════════════════════════════════════════════════════ */

.kw-map-canvas {
    width: 100%;
    height: 440px;
    border-radius: var(--kw-radius-lg);
    overflow: hidden;
    border: 1px solid var(--kw-border);
    box-shadow: var(--kw-shadow-card);
}

/* Document capture — internal / external choice */
.kw-doc-audience { margin: 4px 0 10px; }
.kw-doc-audience-q { font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }

/* OpenStreetMap basemap, muted to a light grey "canvas" so our county labels and pins lead
   (OSM tiles carry their own place names; this keeps them as quiet context). */
.kw-map-tiles { filter: grayscale(1) brightness(1.06) contrast(0.82) opacity(0.9); }

/* Pin markers (CSS-drawn teardrop, no image asset) */
.kw-map-pin-wrap { background: transparent; border: none; }
.kw-map-pin {
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    position: relative;
    border: 2px solid #fff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.35);
}
.kw-map-pin-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* Hover tooltip */
.kw-map-tooltip {
    background: var(--kw-surface-raised);
    color: var(--kw-text-primary);
    border: 1px solid var(--kw-border);
    border-radius: var(--kw-radius-sm);
    box-shadow: var(--kw-shadow-md);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    padding: 4px 9px;
}
.kw-map-tooltip::before { display: none; }

/* Click popup */
.leaflet-popup-content-wrapper {
    background: var(--kw-surface-raised);
    color: var(--kw-text-primary);
    border-radius: var(--kw-radius-md);
    box-shadow: var(--kw-shadow-lg);
}
.leaflet-popup-tip { background: var(--kw-surface-raised); }
.leaflet-popup-content { margin: 14px 16px; }
.kw-map-popup { font-family: 'DM Sans', sans-serif; min-width: 180px; }
.kw-map-popup h4 {
    margin: 0 0 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--kw-text-primary);
}
.kw-map-popup-sub {
    font-size: 0.76rem;
    color: var(--kw-text-secondary);
    margin-bottom: 6px;
}
.kw-map-popup-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--kw-navy-500);
    margin-bottom: 8px;
}
.kw-map-popup-progress {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--kw-surface-muted);
    overflow: hidden;
    margin-bottom: 4px;
}
.kw-map-popup-progress-bar { height: 100%; border-radius: 3px; transition: width var(--kw-duration-normal) var(--kw-ease-out); }
.kw-map-popup-pct { font-size: 0.72rem; color: var(--kw-text-muted); margin-bottom: 8px; }
.kw-map-popup-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kw-amber-500);
    text-decoration: none;
}
.kw-map-popup-link:hover { text-decoration: underline; }

/* Legend control */
.kw-map-legend {
    background: var(--kw-surface-raised);
    border: 1px solid var(--kw-border);
    border-radius: var(--kw-radius-sm);
    box-shadow: var(--kw-shadow-md);
    padding: 8px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.72rem;
    color: var(--kw-text-secondary);
    line-height: 1.6;
}
.kw-map-legend-title {
    font-weight: 600;
    color: var(--kw-text-primary);
    margin-bottom: 2px;
}
.kw-map-legend-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.kw-map-legend-row--sep { border-top: 1px solid var(--kw-border); margin-top: 4px; padding-top: 5px; }
.kw-map-legend-swatch { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.kw-map-legend-swatch--sq {
    border-radius: 2px;
    background: rgba(245, 166, 35, 0.35);
    border: 1.5px solid #C9840A;
}

/* Permanent ASAL-county name label rendered directly on the choropleth fill */
.kw-map-county-label {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.72rem;
    color: #5C3D0A;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85), 0 0 6px rgba(255, 255, 255, 0.6);
    pointer-events: none;
}
.kw-map-county-label::before { display: none !important; }

.kw-dark .kw-grid-input:focus { background: #0f172a; }

/* ============================================================================
   PRIVATE-PORTAL MODULE SHELL — kw-ui-*
   The shared design system for private-portal module pages: gradient hero +
   glass stat band, section cards, form rail navigation, refined tables, status
   pills, progress meters/rings, and the results-framework editor/view.
   Introduced with the Investments module; adopted by the Executive Dashboard.
   Any new module page should compose from these rather than inventing its own.
   Put the module's accent on the hero (inline gradient) and per-tile via --tile.
   ============================================================================ */
/* `.kw-module-page` shares this scope so not-yet-converted pages can drop in kw-ui-* pieces
   (stat bands, cards, tables) and get the same theme-aware surfaces. */
.kw-ui, .kw-module-page {
    /* Brand accents — identical in both themes; they always sit on their own fill. */
    --ui-blue: #3b82f6;
    --ui-deep: #1d4ed8;
    --ui-navy: #0f2b5b;
    --ui-green: #10b981;
    --ui-amber: #f59e0b;
    --ui-red: #ef4444;

    /* Surfaces and ink follow MudBlazor's palette, which is the ONLY thing that changes
       when the theme is toggled. MudBlazor 9 swaps CSS custom properties on :root and never
       emits a `.mud-theme-dark` class, so keying off such a class silently does nothing —
       these var() references are what make the shell genuinely theme-aware. Fallbacks keep
       the light look if a palette variable is ever renamed. */
    --ui-card: var(--mud-palette-surface, #ffffff);
    --ui-bg: var(--mud-palette-background, #f8fafc);
    --ui-ink: var(--mud-palette-text-primary, #0f172a);
    --ui-ink-2: var(--mud-palette-text-secondary, #475569);
    --ui-ink-3: color-mix(in srgb, var(--ui-ink-2) 70%, transparent);
    --ui-line: var(--mud-palette-lines-default, #e2e8f0);

    /* Accent used for TEXT on a card. Mixing the brand blue toward the theme's own ink
       darkens it on light surfaces and lightens it on dark ones, so one token stays
       readable in both themes without a per-theme override. */
    --ui-accent: color-mix(in srgb, var(--ui-blue) 78%, var(--ui-ink));

    max-width: 1280px; margin: 0 auto; padding: 0 8px 48px;
}

/* --- hero ---------------------------------------------------------------- */
.kw-ui-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(128deg, var(--ui-navy) 0%, var(--ui-deep) 55%, var(--ui-blue) 120%);
    border-radius: 18px;
    padding: 26px 28px 30px;
    color: #fff;
    margin-bottom: 0;
}
.kw-ui-hero::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(90% 120% at 100% 0%, rgba(255, 255, 255, 0.10), transparent 55%),
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: auto, 30px 30px, 30px 30px;
}
/* The title keeps a readable width; when a page has many actions they wrap onto their own line
   below it instead of squeezing the title into one word per line. */
.kw-ui-hero-top { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px; }
.kw-ui-hero-body { min-width: min(340px, 100%); flex: 1 1 340px; }
.kw-ui-hero-eyebrow {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75); margin: 4px 0 8px;
}
.kw-ui-hero-title {
    font-family: 'Outfit', sans-serif; font-weight: 700;
    font-size: clamp(1.4rem, 2.6vw, 2.05rem); line-height: 1.12;
    margin: 0 0 10px; color: #fff; letter-spacing: -0.01em;
}
.kw-ui-hero-sub { font-size: 0.9rem; color: rgba(255, 255, 255, 0.78); margin: 0; max-width: 640px; line-height: 1.5; }
/* The way into the progress report (ProgressReportPanel) - the report's own blue, so it reads as the
   report wherever it sits; "Download Excel" in Excel green. */
.kw-prpt-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 16px;
               border-radius: 10px; background: #eef3fc; border: 1px solid #b4c6e7; border-left: 5px solid #4472C4; }
.kw-prpt-cta-icon { width: 42px; height: 42px; border-radius: 10px; background: #4472C4; color: #fff;
                    display: flex; align-items: center; justify-content: center; flex: none; }
.kw-prpt-cta-icon .mud-icon-root { font-size: 1.6rem; }
.kw-prpt-cta-body { flex: 1 1 320px; min-width: 0; }
.kw-prpt-cta-body strong { display: block; font-size: 1rem; color: #1f3864; }
.kw-prpt-cta-body span { display: block; font-size: 0.8rem; color: #334155; line-height: 1.4; }
.kw-prpt-cta-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kw-prpt-cta.compact { padding: 8px 12px; }
.kw-prpt-cta.compact .kw-prpt-cta-icon { width: 34px; height: 34px; }
.kw-prpt-cta.compact .kw-prpt-cta-icon .mud-icon-root { font-size: 1.3rem; }
.kw-dark .kw-prpt-cta { background: rgba(68,114,196,.14); border-color: rgba(68,114,196,.45); }
.kw-dark .kw-prpt-cta-body strong { color: #c7d7f5; }
.kw-dark .kw-prpt-cta-body span { color: #cbd5e1; }
.mud-button-root.kw-prpt-view-btn { background: #4472C4; color: #fff; }
.mud-button-root.kw-prpt-view-btn:hover { background: #365ea8; }
.mud-button-root.kw-prpt-excel-btn { background: #217346; color: #fff; }
.mud-button-root.kw-prpt-excel-btn:hover { background: #185c37; }
.mud-button-root.kw-prpt-excel-btn.top { margin-right: 40px; }   /* clear the dialog's close button */
/* The hero's report button: solid white, so it stands apart from the outlined navigation beside it. */
.mud-button-root.kw-prpt-hero-btn { background: #fff; font-weight: 700; }
.mud-button-root.kw-prpt-hero-btn.rev { color: #3730a3; }
.mud-button-root.kw-prpt-hero-btn.cap { color: #065f46; }
.mud-button-root.kw-prpt-hero-btn:hover { background: #f1f5f9; }
/* NDMA's work-plan progress report on screen (ProgressReportDialog) — the national work plan's palette,
   with the samples' achievement colours: green above the quarter's target, yellow on it, red below. */
.kw-prpt-wrap { overflow: auto; max-height: 64vh; border: 1px solid #b4c6e7; border-radius: 6px; }
.kw-prpt { border-collapse: separate; border-spacing: 0; font-family: Cambria, Georgia, serif; font-size: 0.78rem; min-width: 1900px; width: 100%; }
.kw-prpt th, .kw-prpt td { border-right: 1px solid #b4c6e7; border-bottom: 1px solid #b4c6e7; padding: 3px 6px; vertical-align: top; background: #fff; color: #1f2937; }
.kw-prpt thead th { background: #D9E1F2; color: #000080; font-weight: 700; text-align: center; vertical-align: middle; }
.kw-prpt thead th.kw-prpt-q { background: #92D050; }
.kw-prpt thead th.kw-prpt-title { background: #4472C4; color: #fff; font-size: 0.95rem; padding: 7px; }
.kw-prpt thead th.kw-prpt-status { background: #D9E1F2; color: #000080; font-size: 0.78rem; }
.kw-prpt tr.kw-prpt-so td { background: #EAF1FF; color: #FF0000; font-weight: 700; padding: 6px 8px; }
.kw-prpt-so-status { margin-left: 14px; color: #000080; font-weight: 600; font-size: 0.74rem; }
.kw-prpt td.kw-prpt-text { min-width: 150px; max-width: 220px; white-space: normal; }
.kw-prpt td.kw-prpt-text.b { font-weight: 700; }
.kw-prpt td.kw-prpt-num { text-align: center; white-space: nowrap; }
.kw-prpt td.kw-prpt-q { background: #92D050; color: #000; }
.kw-prpt td.kw-prpt-cum { background: #D9E1F2; color: #000; font-weight: 700; }
.kw-prpt td.kw-prpt-remark { min-width: 180px; max-width: 260px; white-space: normal; font-size: 0.74rem; }
.kw-prpt td.kw-prpt-a.hidden { background: #F2F2F2; }
.kw-prpt-uom { font-size: 0.68rem; color: #64748b; }
.kw-prpt-a.exceeded { background: #C6EFCE !important; color: #006100 !important; }
.kw-prpt-a.met { background: #FFEB9C !important; color: #9C6500 !important; }
.kw-prpt-a.below { background: #FFC7CE !important; color: #9C0006 !important; }
/* A figure captured in a quarter not submitted: a draft, counted nowhere. */
.kw-prpt-a.unsub { background: #EDEDED !important; color: #595959 !important; font-style: italic; }
.kw-prpt td.kw-prpt-a.unsub small { display: block; font-size: .62rem; font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #6b6b6b; }
.kw-prpt-legend { margin-top: 8px; font-size: 0.78rem; color: var(--mud-palette-text-secondary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kw-prpt-legend .kw-prpt-a { padding: 1px 8px; border-radius: 4px; font-weight: 600; }
/* The signed-in person's location (county, or HQ · department) on the landing dashboards' hero. */
.kw-loc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
               background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.3); color: #fff; font-size: 0.85rem; }
.kw-loc-chip .kw-loc-chip-lab { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.8; font-weight: 700; }
.kw-loc-chip strong { font-weight: 700; }
.kw-ui-hero-actions { position: relative; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; flex-shrink: 0; max-width: 100%; }

.kw-ui-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.16); color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.kw-ui-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.kw-ui-pill--published { background: rgba(16, 185, 129, 0.25); border-color: rgba(16, 185, 129, 0.6); }
.kw-ui-pill--approved { background: rgba(52, 211, 153, 0.18); border-color: rgba(52, 211, 153, 0.5); }
.kw-ui-pill--draft { background: rgba(255, 255, 255, 0.14); }
.kw-ui-pill--stalled { background: rgba(239, 68, 68, 0.28); border-color: rgba(239, 68, 68, 0.6); }
/* Partner-implemented. Cyan, which carries no other meaning in the status vocabulary — it must read
   as "a different kind of record", not as a stage in the NDMA approval chain. */
.kw-ui-pill--partner { background: rgba(8, 145, 178, 0.24); border-color: rgba(8, 145, 178, 0.6); }

/* table-context status pills (light surface) */
.kw-ui-status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
}
.kw-ui-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
/* Tinted from the status hue against the live surface, so each pill keeps its identity
   and its contrast in either theme without a second set of rules. */
.kw-ui-status--Draft {
    background: color-mix(in srgb, var(--ui-ink-2) 14%, transparent);
    color: var(--ui-ink-2);
}
.kw-ui-status--Approved {
    background: color-mix(in srgb, var(--ui-green) 16%, transparent);
    color: color-mix(in srgb, var(--ui-green) 78%, var(--ui-ink));
}
.kw-ui-status--Published {
    background: color-mix(in srgb, var(--ui-blue) 16%, transparent);
    color: var(--ui-accent);
}
.kw-ui-status--Submitted {
    background: color-mix(in srgb, var(--ui-amber) 18%, transparent);
    color: color-mix(in srgb, var(--ui-amber) 78%, var(--ui-ink));
}

/* --- glass stat band (overlaps hero) -------------------------------------- */
.kw-ui-stats {
    position: relative; z-index: 2;
    /* 154px min keeps up to seven tiles on one row at desktop width — several modules
       expose 6–7 statuses, and a single orphaned tile on a second row reads as broken. */
    display: grid; grid-template-columns: repeat(auto-fit, minmax(154px, 1fr)); gap: 14px;
    margin: -26px 18px 24px;
}
.kw-ui-stat {
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    border-radius: 14px;
    padding: 14px 16px 12px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    display: flex; align-items: center; gap: 12px; min-width: 0;
}
.kw-ui-stat-ic {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--tile, var(--ui-blue)) 14%, transparent);
    color: var(--tile, var(--ui-blue));
}
.kw-ui-stat-val {
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.22rem; line-height: 1.1;
    color: var(--ui-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.kw-ui-stat-lab { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-ink-3); margin-top: 2px; }

/* --- layout & cards -------------------------------------------------------- */
.kw-ui-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.kw-ui-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 86px; }
.kw-ui-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

.kw-ui-card { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 16px; overflow: hidden; }
.kw-ui-card-head {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; border-bottom: 1px solid var(--ui-line);
}
.kw-ui-card-ic {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--card-ac, var(--ui-blue)) 13%, transparent);
    color: var(--card-ac, var(--ui-blue));
}
.kw-ui-card-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.98rem; color: var(--ui-ink); margin: 0; }
.kw-ui-card-sub { font-size: 0.76rem; color: var(--ui-ink-3); margin: 1px 0 0; }
.kw-ui-card-head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.kw-ui-card-body { padding: 16px 18px; }
.kw-ui-card-body--flush { padding: 0; }

/* ── document capture: the file comes first ─────────────────────────── */
/* Sits above the form, so the thing being described is chosen before it is
   described. Dashed until a file is present, solid once one is. */
.kw-doc-filepick {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 16px; margin-bottom: 20px;
    border: 1px dashed var(--ui-line); border-radius: 12px;
    background: var(--ui-bg);
    transition: border-color var(--kw-duration-fast), background var(--kw-duration-fast);
}
.kw-doc-filepick.has-file { border-style: solid; border-color: var(--ui-line-2, var(--ui-line)); }
.kw-doc-filepick-ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: none; border-radius: 10px;
    background: var(--ui-bg-2, rgba(0,0,0,0.04)); color: var(--ui-ink-3);
}
.kw-doc-filepick-name { font-weight: 600; font-size: 0.88rem; color: var(--ui-ink); overflow-wrap: anywhere; }
.kw-doc-filepick-meta { font-size: 0.75rem; color: var(--ui-ink-3); }
.kw-doc-filenote { margin: 6px 0 0; font-size: 0.75rem; color: var(--ui-ink-3); }

.kw-doc-rule { border: 0; border-top: 1px solid var(--ui-line); margin: 22px 0 14px; }

/* the bulletin fields, shown when the document type is a bulletin type */
.kw-doc-reveal {
    margin-top: 10px; padding: 14px 16px;
    border: 1px dashed var(--ui-line); border-radius: 12px;
    background: var(--ui-bg);
    animation: kwDocReveal 0.18s ease-out;
}
@keyframes kwDocReveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .kw-doc-reveal { animation: none; } }
.kw-doc-bulletin { margin-top: 0; border-style: solid; border-color: #fcd34d; background: #fffbeb; }
.kw-doc-bulletin-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.85rem; color: #92400e; margin-bottom: 4px; }
.kw-doc-bulletin-head span { color: var(--ui-ink-3); font-size: 0.78rem; }
:root[data-theme="dark"] .kw-doc-bulletin { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.4); }
:root[data-theme="dark"] .kw-doc-bulletin-head { color: #fcd34d; }

/* ── Approval sequence preview ───────────────────────────────────────
   The chain a record will travel, shown before anything is submitted. A numbered vertical run with
   a connecting rule, so the order reads as order rather than as a list. */
.kw-seq-panel {
    margin-top: 12px; padding: 14px 16px;
    border: 1px solid var(--ui-line); border-left: 3px solid #059669;
    border-radius: 10px; background: var(--ui-bg);
}
.kw-seq-panel--row { margin: 0; border-radius: 0; border-left-width: 3px; }
.kw-seq-panel-head {
    display: flex; align-items: center; gap: 7px; margin-bottom: 12px;
    font-size: 0.78rem; font-weight: 600; color: var(--ui-ink-2);
}

.kw-seq { list-style: none; margin: 0; padding: 0; }
.kw-seq-step { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
/* The connector stops at the last step rather than trailing into nothing. */
.kw-seq-step:not(:last-child)::before {
    content: ""; position: absolute; left: 13px; top: 28px; bottom: 0;
    width: 2px; background: var(--ui-line);
}
.kw-seq-step:last-child { padding-bottom: 0; }

.kw-seq-num {
    flex: none; width: 28px; height: 28px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #059669; color: #fff;
    font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.kw-seq-num--end { background: var(--ui-ink-3); }

.kw-seq-body { min-width: 0; flex: 1; padding-top: 3px; }
.kw-seq-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kw-seq-title { font-size: 0.82rem; font-weight: 700; color: var(--ui-ink); }
.kw-seq-any, .kw-seq-sla { font-size: 0.7rem; color: var(--ui-ink-3); }
.kw-seq-sla { display: inline-flex; align-items: center; gap: 3px; }

.kw-seq-people { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.kw-seq-person {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 11px 5px 5px;
    border: 1px solid var(--ui-line); border-radius: 999px; background: var(--ui-card, #fff);
}
.kw-seq-avatar {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #d1fae5; color: #065f46; font-size: 0.62rem; font-weight: 800;
}
.kw-seq-person-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.kw-seq-name { font-size: 0.76rem; font-weight: 600; color: var(--ui-ink); }
.kw-seq-email { font-size: 0.68rem; color: var(--ui-ink-3); overflow-wrap: anywhere; }

/* A level with nobody on it is a dead end, and must not look like an ordinary empty row. */
.kw-seq-empty {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 7px;
    font-size: 0.73rem; color: #b45309;
}
.kw-seq-endnote { font-size: 0.72rem; color: var(--ui-ink-3); margin-top: 2px; }

.kw-seq-loading, .kw-seq-note {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.78rem; color: var(--ui-ink-3);
}
.kw-seq-note--warn { color: #b45309; }

@media (max-width: 640px) {
    .kw-seq-people { flex-direction: column; align-items: flex-start; }
}

/* ── document capture: AI auto-fill ─────────────────────────────────── */
.kw-doc-aitoggle {
    display: flex; align-items: center; gap: 4px; margin-left: auto;
    font-size: 0.78rem; color: var(--ui-ink-2); white-space: nowrap;
}
.kw-doc-aitoggle span { display: inline-flex; align-items: center; gap: 5px; }

/* One status line with three faces: working, went wrong, done. Never absent while something
   is happening — a silent stop is indistinguishable from a bug. */
.kw-doc-aibar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; margin: -8px 0 18px;
    border: 1px solid var(--ui-line); border-left: 3px solid #7c3aed;
    border-radius: 10px; background: var(--ui-bg);
    font-size: 0.82rem; color: var(--ui-ink-2);
}
.kw-doc-aibar--busy { border-left-color: #3b82f6; }
.kw-doc-aibar--warn { border-left-color: #d97706; background: rgba(217, 119, 6, 0.06); }
.kw-doc-ailink {
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; font-weight: 600; color: #7c3aed; text-decoration: underline;
    text-underline-offset: 2px;
}
.kw-doc-ailink:hover { color: #5b21b6; }

.kw-doc-hintbox {
    display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
    padding: 12px 14px; margin: -8px 0 18px;
    border: 1px dashed var(--ui-line); border-radius: 10px; background: var(--ui-bg);
}
.kw-doc-hintbox > :first-child { flex: 1; min-width: 240px; }

/* Per-field provenance. The rule down the left says how far to trust it; the sparkle opens the
   passage it came from. Three states, because "verified" and "we couldn't find the quote" are
   genuinely different things and collapsing them hides the one that matters. */
.kw-doc-ai { position: relative; }
.kw-doc-ai--ok       { box-shadow: inset 2px 0 0 0 #10b981; border-radius: 4px; }
.kw-doc-ai--unsure   { box-shadow: inset 2px 0 0 0 #d97706; border-radius: 4px; }
.kw-doc-ai--inferred { box-shadow: inset 2px 0 0 0 var(--ui-ink-3); border-radius: 4px; }
.kw-doc-ai-mark {
    position: absolute; top: -7px; right: -6px; z-index: 2;
    width: 20px; height: 20px; padding: 0; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: #7c3aed; color: #fff; font-size: 11px; line-height: 1;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.kw-doc-ai-mark:hover { background: #5b21b6; }
.kw-doc-ai--ok       .kw-doc-ai-mark { background: #10b981; }
.kw-doc-ai--ok       .kw-doc-ai-mark:hover { background: #059669; }
.kw-doc-ai--unsure   .kw-doc-ai-mark { background: #d97706; }
.kw-doc-ai--inferred .kw-doc-ai-mark { background: var(--ui-ink-3); }

/* candidate chips for an ambiguous lookup — offered, never preselected */
.kw-doc-cands { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.kw-doc-cands-lab { font-size: 0.72rem; color: var(--ui-ink-3); }
.kw-doc-cand {
    padding: 3px 10px; cursor: pointer;
    border: 1px solid var(--ui-line); border-radius: 999px; background: transparent;
    font-size: 0.72rem; font-weight: 600; color: var(--ui-ink-2);
}
.kw-doc-cand:hover { border-color: #7c3aed; color: #7c3aed; }
.kw-doc-cand.on { background: #7c3aed; border-color: #7c3aed; color: #fff; }

/* the source, with every quote highlighted at once */
.kw-doc-srcpanel {
    margin: 0 0 18px; border: 1px solid var(--ui-line); border-radius: 12px;
    background: var(--ui-card, #fff); overflow: hidden;
}
.kw-doc-srcpanel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--ui-line); background: var(--ui-bg);
}
.kw-doc-srcpanel-title { margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--ui-ink); }
.kw-doc-srcpanel-sub { margin: 2px 0 0; font-size: 0.75rem; color: var(--ui-ink-3); }
.kw-doc-srcpanel-body {
    max-height: 420px; overflow: auto; padding: 16px;
    font-size: 0.8rem; line-height: 1.75; color: var(--ui-ink-2);
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.kw-doc-srcpanel-body mark {
    background: rgba(124, 58, 237, 0.16); color: inherit;
    padding: 1px 2px; border-radius: 3px;
}
.kw-doc-srcpanel-body mark.on {
    background: rgba(124, 58, 237, 0.38);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

/* key-value facts */
.kw-ui-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }
.kw-ui-fact-lab { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ui-ink-3); margin-bottom: 3px; }
.kw-ui-fact-val { font-size: 0.9rem; font-weight: 600; color: var(--ui-ink); overflow-wrap: anywhere; }
.kw-ui-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.kw-ui-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 600;
    background: color-mix(in srgb, var(--ui-blue) 9%, transparent);
    color: var(--ui-accent); border: 1px solid color-mix(in srgb, var(--ui-blue) 28%, transparent);
}

/* progress meter */
.kw-ui-meter { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kw-ui-meter-track { flex: 1; height: 8px; border-radius: 999px; background: var(--ui-bg); border: 1px solid var(--ui-line); overflow: hidden; min-width: 40px; }
.kw-ui-meter-fill { display: block; height: 100%; border-radius: 999px; transition: width 0.4s var(--kw-ease-out); }
.kw-ui-meter-fill--green { background: linear-gradient(90deg, #34d399, var(--ui-green)); }
.kw-ui-meter-fill--amber { background: linear-gradient(90deg, #fbbf24, var(--ui-amber)); }
.kw-ui-meter-fill--red { background: linear-gradient(90deg, #f87171, var(--ui-red)); }
.kw-ui-meter-pct { font-size: 0.78rem; font-weight: 700; color: var(--ui-ink); font-variant-numeric: tabular-nums; min-width: 38px; text-align: right; }

/* conic ring */
.kw-ui-ring {
    --val: 0; --col: var(--ui-amber);
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
    background:
        radial-gradient(closest-side, var(--ui-card) 72%, transparent 73%),
        conic-gradient(var(--col) calc(var(--val) * 1%), var(--ui-bg) 0);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 0.76rem; color: var(--ui-ink);
    font-variant-numeric: tabular-nums;
}

/* --- refined data table ----------------------------------------------------- */
.kw-ui-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.kw-ui-table th {
    text-align: left; padding: 10px 16px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ui-ink-3); background: var(--ui-bg);
    border-bottom: 1px solid var(--ui-line); white-space: nowrap;
}
.kw-ui-table td { padding: 11px 16px; border-bottom: 1px solid var(--ui-line); color: var(--ui-ink); vertical-align: middle; }
.kw-ui-table tr:last-child td { border-bottom: none; }
.kw-ui-table tbody tr { transition: background var(--kw-duration-fast); }
.kw-ui-table tbody tr:hover { background: color-mix(in srgb, var(--ui-blue) 4%, transparent); }
.kw-ui-table .num { font-variant-numeric: tabular-nums; text-align: right; }
.kw-ui-empty { padding: 28px 16px; text-align: center; color: var(--ui-ink-3); font-size: 0.86rem; font-style: italic; }

/* --- results framework (shared view + editor) ------------------------------ */
.kw-ui-out { border: 1px solid var(--ui-line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; background: var(--ui-card); }
.kw-ui-out-head {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px; background: var(--ui-bg); border-bottom: 1px solid var(--ui-line);
}
.kw-ui-out-no {
    font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 0.72rem;
    color: var(--ui-accent); background: color-mix(in srgb, var(--ui-blue) 13%, transparent);
    border-radius: 8px; padding: 4px 8px; flex-shrink: 0;
}
.kw-ui-out-name { font-weight: 700; font-size: 0.92rem; color: var(--ui-ink); min-width: 0; flex: 1; overflow-wrap: anywhere; }
.kw-ui-out-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.kw-ui-indrow { border-bottom: 1px solid var(--ui-line); }
.kw-ui-indrow:last-child { border-bottom: none; }
.kw-ui-indrow-main {
    display: grid; grid-template-columns: minmax(0, 1.6fr) auto minmax(140px, 1fr) auto;
    gap: 8px 14px; align-items: center; padding: 11px 16px;
}
.kw-ui-ind-name { font-weight: 600; font-size: 0.87rem; color: var(--ui-ink); overflow-wrap: anywhere; }
.kw-ui-ind-meta { display: flex; gap: 6px; flex-wrap: wrap; font-size: 0.7rem; color: var(--ui-ink-3); }
.kw-ui-ind-tag {
    padding: 2px 8px; border-radius: 999px; font-weight: 600;
    background: var(--ui-bg); border: 1px solid var(--ui-line); white-space: nowrap;
}
/* Whole-project indicator (InvestmentKpi) — told apart from quarterly ones by word, tinted as a hint. */
.kw-ui-ind-tag--project { color: var(--ui-blue); border-color: color-mix(in srgb, var(--ui-blue) 35%, var(--ui-line)); }
.kw-ui-kpimode { width: 140px; cursor: pointer; }
.kw-ui-ind-vals { font-size: 0.76rem; color: var(--ui-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kw-ui-ind-actions { display: flex; align-items: center; gap: 2px; }

/* FY matrix (capture) */
.kw-ui-matrix { padding: 12px 16px 16px; background: color-mix(in srgb, var(--ui-blue) 3%, transparent); border-top: 1px dashed var(--ui-line); }
.kw-ui-matrix-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.kw-ui-matrix-fy {
    padding: 6px 12px; border-radius: 9px; border: 1px solid var(--ui-line);
    background: var(--ui-card); font-size: 0.8rem; font-weight: 700; color: var(--ui-ink);
    cursor: pointer; transition: border-color var(--kw-duration-fast), color var(--kw-duration-fast);
}
.kw-ui-matrix-fy:hover { border-color: var(--ui-blue); }
.kw-ui-matrix-fy.on { background: var(--ui-deep); border-color: var(--ui-deep); color: #fff; }
.kw-ui-matrix-grid { display: grid; grid-template-columns: 64px 1fr 1fr 74px; gap: 8px 10px; align-items: center; max-width: 560px; }
.kw-ui-matrix-grid .head { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ui-ink-3); }
.kw-ui-matrix-q { font-weight: 700; font-size: 0.82rem; color: var(--ui-ink-2); }
.kw-ui-matrix input[type="number"] {
    width: 100%; padding: 7px 10px; border-radius: 9px;
    border: 1px solid var(--ui-line); background: var(--ui-card); color: var(--ui-ink);
    font-size: 0.86rem; font-variant-numeric: tabular-nums;
    transition: border-color var(--kw-duration-fast), box-shadow var(--kw-duration-fast);
}
.kw-ui-matrix input[type="number"]:focus { outline: none; border-color: var(--ui-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-blue) 18%, transparent); }
.kw-ui-matrix-pct { font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.kw-ui-matrix-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.kw-ui-matrix-note { font-size: 0.72rem; color: var(--ui-ink-3); }

/* periods (read view) */
.kw-ui-periods { padding: 4px 16px 14px; }
.kw-ui-periods table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.kw-ui-periods th { text-align: left; padding: 6px 10px; color: var(--ui-ink-3); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--ui-line); }
.kw-ui-periods td { padding: 6px 10px; border-bottom: 1px solid color-mix(in srgb, var(--ui-line) 55%, transparent); color: var(--ui-ink-2); font-variant-numeric: tabular-nums; }
.kw-ui-periods tr:last-child td { border-bottom: none; }

/* inline add rows */
.kw-ui-addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; background: var(--ui-bg); border-top: 1px solid var(--ui-line); }
.kw-ui-input {
    padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ui-line);
    background: var(--ui-card); color: var(--ui-ink); font-size: 0.86rem; min-width: 0;
    transition: border-color var(--kw-duration-fast), box-shadow var(--kw-duration-fast);
}
.kw-ui-input:focus { outline: none; border-color: var(--ui-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-blue) 18%, transparent); }
.kw-ui-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 16px; border-radius: 10px; border: none; cursor: pointer;
    font-size: 0.82rem; font-weight: 700; letter-spacing: 0.01em;
    background: var(--ui-deep); color: #fff;
    transition: filter var(--kw-duration-fast), transform var(--kw-duration-fast);
}
.kw-ui-btn:hover { filter: brightness(1.12); }
.kw-ui-btn:active { transform: translateY(1px); }
.kw-ui-btn[disabled] { opacity: 0.5; pointer-events: none; }
.kw-ui-btn--ghost { background: transparent; color: var(--ui-accent); border: 1px solid var(--ui-line); }
.kw-ui-btn--ghost:hover { border-color: var(--ui-blue); filter: none; }
.kw-ui-btn--sm { padding: 6px 12px; font-size: 0.76rem; border-radius: 8px; }

/* --- form rail layout ------------------------------------------------------- */
.kw-ui-formgrid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.kw-ui-rail { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 4px; }
.kw-ui-rail-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 14px; border-radius: 12px; border: 1px solid transparent;
    background: transparent; cursor: pointer; text-align: left; width: 100%;
    color: var(--ui-ink-2); font-size: 0.86rem; font-weight: 600;
    transition: background var(--kw-duration-fast), color var(--kw-duration-fast), border-color var(--kw-duration-fast);
}
.kw-ui-rail-item:hover { background: color-mix(in srgb, var(--ui-blue) 7%, transparent); color: var(--ui-ink); }
.kw-ui-rail-item.on {
    background: var(--ui-card); color: var(--ui-accent);
    border-color: var(--ui-line);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}
.kw-ui-rail-badge {
    margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700;
    background: color-mix(in srgb, var(--ui-blue) 12%, transparent); color: var(--ui-accent);
}
.kw-ui-rail-lock { margin-left: auto; color: var(--ui-ink-3); display: inline-flex; }
.kw-ui-savebar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-top: 18px; padding: 14px 18px;
    background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 14px;
}
.kw-ui-savebar-hint { font-size: 0.78rem; color: var(--ui-ink-3); margin-left: auto; }

/* --- list toolbar ------------------------------------------------------------ */
.kw-ui-toolbar {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
    background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 14px;
    padding: 12px 14px; margin-bottom: 18px;
}
.kw-ui-seg { display: inline-flex; background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.kw-ui-seg button {
    border: none; background: transparent; cursor: pointer;
    padding: 6px 13px; border-radius: 9px; font-size: 0.79rem; font-weight: 600; color: var(--ui-ink-2);
    transition: background var(--kw-duration-fast), color var(--kw-duration-fast);
}
.kw-ui-seg button:hover { color: var(--ui-ink); }
.kw-ui-seg button.on { background: var(--ui-deep); color: #fff; box-shadow: 0 4px 10px rgba(29, 78, 216, 0.3); }

/* --- hero action buttons ----------------------------------------------------
   Buttons dropped into a hero sit on a saturated gradient, so force legible
   on-colour treatment rather than restating it inline on every page. Filled
   buttons keep their own accent (they carry their own background). */
.kw-ui-hero-actions .mud-button-outlined,
.kw-ui-hero-actions .mud-button-text {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
}
.kw-ui-hero-actions .mud-button-outlined:hover,
.kw-ui-hero-actions .mud-button-text:hover { background: rgba(255, 255, 255, 0.12) !important; }
.kw-ui-hero-actions .mud-icon-button { color: #fff; }
.kw-ui-hero-top > .mud-icon-button { color: #fff; }

/* --- automatic card treatment ------------------------------------------------
   Pages converted to the shell still use MudTable/MudPaper for their content.
   Rather than rewrite every table's markup, give them the card look here: same
   radius, hairline border and flat surface as .kw-ui-card. Portalled surfaces
   (dialogs, menus, popovers) render outside .kw-ui, so they are unaffected. */
.kw-ui > .mud-table,
.kw-ui .mud-table.mud-table-outlined,
.kw-ui > .mud-paper:not(.mud-alert) {
    border-radius: 16px;
    border: 1px solid var(--ui-line);
    box-shadow: none;
    overflow: hidden;
    background: var(--ui-card);
}
/* Tables already wrapped in a .kw-ui-card must not double-border. */
.kw-ui-card .mud-table { border: none; border-radius: 0; box-shadow: none; background: transparent; }
.kw-ui .mud-table-container { background: transparent; }
/* Match the shell's table header treatment (recessive, uppercase, hairline rule). */
.kw-ui .mud-table-head th, .kw-ui .mud-table-head .mud-table-cell {
    background: var(--ui-bg);
    color: var(--ui-ink-3);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ui-line);
}
.kw-ui .mud-table-row:hover { background: color-mix(in srgb, var(--ui-blue) 4%, transparent); }

/* Filter strips built as a MudPaper read as the shell's toolbar. */
.kw-ui > .mud-paper.pa-4.mb-4,
.kw-ui > .mud-paper.pa-3.mb-4 {
    border-radius: 14px;
    border: 1px solid var(--ui-line);
    box-shadow: none;
}

/* --- trend chip (on stat tiles) --------------------------------------------- */
.kw-ui-trend {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 1px 7px 1px 5px; border-radius: 999px;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap;
}
.kw-ui-trend--up { background: color-mix(in srgb, var(--ui-green) 14%, transparent); color: #047857; }
.kw-ui-trend--down { background: color-mix(in srgb, var(--ui-red) 14%, transparent); color: #b91c1c; }
.kw-ui-trend--neutral, .kw-ui-trend--flat { background: var(--ui-bg); color: var(--ui-ink-3); }
.kw-ui-stat-note { font-size: 0.68rem; color: var(--ui-ink-3); margin-top: 3px; overflow-wrap: anywhere; }

/* --- ring stat block (ring + caption) --------------------------------------- */
.kw-ui-ringstat { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.kw-ui-ringstat + .kw-ui-ringstat { border-top: 1px solid var(--ui-line); }
.kw-ui-ringstat-body { min-width: 0; }
.kw-ui-ringstat-lab { font-size: 0.82rem; font-weight: 700; color: var(--ui-ink); }
.kw-ui-ringstat-sub { font-size: 0.72rem; color: var(--ui-ink-3); margin-top: 2px; }
.kw-ui-ring--lg { width: 66px; height: 66px; font-size: 0.86rem; }

/* --- distribution rows ------------------------------------------------------- */
.kw-ui-dist { display: flex; flex-direction: column; gap: 11px; }
.kw-ui-dist-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 12px; align-items: baseline;
}
.kw-ui-dist-lab { font-size: 0.84rem; font-weight: 600; color: var(--ui-ink); min-width: 0; overflow-wrap: anywhere; }
.kw-ui-dist-val { font-size: 0.84rem; font-weight: 700; color: var(--ui-ink); font-variant-numeric: tabular-nums; }
.kw-ui-dist-track {
    grid-column: 1 / -1; height: 7px; border-radius: 999px;
    background: var(--ui-bg); border: 1px solid var(--ui-line); overflow: hidden;
}
.kw-ui-dist-fill {
    display: block; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--bar, var(--ui-blue)) 55%, #fff), var(--bar, var(--ui-blue)));
    transition: width 0.5s var(--kw-ease-out);
}

/* --- activity feed ----------------------------------------------------------- */
.kw-ui-feed { display: flex; flex-direction: column; }
.kw-ui-feed-item {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 11px 0; border-bottom: 1px solid var(--ui-line);
    text-decoration: none; color: inherit;
}
.kw-ui-feed-item:last-child { border-bottom: none; }
.kw-ui-feed-item[href]:hover .kw-ui-feed-title { color: var(--ui-accent); }
.kw-ui-feed-ic {
    width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--fic, var(--ui-blue)) 13%, transparent);
    color: var(--fic, var(--ui-blue));
}
.kw-ui-feed-body { min-width: 0; flex: 1; }
.kw-ui-feed-title {
    font-size: 0.86rem; font-weight: 600; color: var(--ui-ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    transition: color var(--kw-duration-fast);
}
.kw-ui-feed-meta { font-size: 0.72rem; color: var(--ui-ink-3); margin-top: 1px; }
.kw-ui-feed-when { font-size: 0.7rem; color: var(--ui-ink-3); white-space: nowrap; flex-shrink: 0; padding-top: 2px; }

/* --- action tiles (drill-down grid) ------------------------------------------ */
.kw-ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.kw-ui-tile {
    display: flex; flex-direction: column; gap: 7px;
    /* align-items must be set explicitly: the UA stylesheet gives <button> align-items:center,
       which would centre every child of this column flex. */
    align-items: flex-start;
    padding: 13px 14px; border-radius: 12px; cursor: pointer; text-align: left;
    background: var(--ui-card); border: 1px solid var(--ui-line); color: var(--ui-ink);
    transition: border-color var(--kw-duration-fast), transform var(--kw-duration-fast), box-shadow var(--kw-duration-fast);
    /* min-width:0 lets a long nowrap label actually ellipsize instead of forcing the tile wider. */
    overflow: hidden; min-width: 0;
}
.kw-ui-tile:hover {
    border-color: color-mix(in srgb, var(--tile, var(--ui-blue)) 45%, transparent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
.kw-ui-tile-ic {
    width: 32px; height: 32px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--tile, var(--ui-blue)) 13%, transparent);
    color: var(--tile, var(--ui-blue));
}
.kw-ui-tile-lab {
    font-size: 0.84rem; font-weight: 700;
    min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kw-ui-tile-sub {
    font-size: 0.7rem; color: var(--ui-ink-3);
    min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

/* --- live/status dot --------------------------------------------------------- */
.kw-ui-live { display: inline-flex; align-items: center; gap: 6px; }
.kw-ui-live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--ui-green);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--ui-green) 65%, transparent);
    animation: kw-ui-pulse 2s infinite;
}
@keyframes kw-ui-pulse {
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@media (prefers-reduced-motion: reduce) { .kw-ui-live-dot { animation: none; } }

/* responsive */
@media (max-width: 1024px) {
    .kw-ui-grid { grid-template-columns: 1fr; }
    .kw-ui-side { position: static; }
    .kw-ui-formgrid { grid-template-columns: 1fr; }
    .kw-ui-rail { position: static; flex-direction: row; flex-wrap: wrap; }
    .kw-ui-rail-item { width: auto; }
    .kw-ui-hero-top { flex-wrap: wrap; }
}
@media (max-width: 640px) {
    .kw-ui-stats { margin: -22px 8px 20px; }
    .kw-ui-indrow-main { grid-template-columns: 1fr auto; }
    .kw-ui-matrix-grid { grid-template-columns: 48px 1fr 1fr 60px; }
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   WIZARD SHELL  (kw-wiz-* / kw-drop-*)
   Lifted out of StrategicPlanImportWizard.razor so more than one wizard can
   use it. The accent is a custom property: set --kw-wiz-accent on the step
   strip or drop zone to re-skin the whole thing per module.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.kw-wiz-steps {
    --kw-wiz-accent: #14b8a6;
    --kw-wiz-accent-deep: #0f766e;
    display: flex; align-items: center; gap: 6px; margin: 18px 0 6px; flex-wrap: wrap;
}
.kw-wiz-steps.kw-wiz-ai { --kw-wiz-accent: #8b5cf6; --kw-wiz-accent-deep: #6d28d9; }
/* Work plans — cyan, per the module palette. The drop zone declares its own accent, so a wizard
   that re-skins the strip must set it there too (see .kw-drop.kw-wiz-plan below). */
.kw-wiz-steps.kw-wiz-plan { --kw-wiz-accent: #06b6d4; --kw-wiz-accent-deep: #0891b2; }
.kw-drop.kw-wiz-plan { --kw-wiz-accent: #06b6d4; }

.kw-wiz-step { display: flex; align-items: center; gap: 8px; opacity: .55; }
.kw-wiz-step.active, .kw-wiz-step.done { opacity: 1; }
.kw-wiz-dot {
    width: 30px; height: 30px; border-radius: 50%; background: #e2e8f0; color: #475569;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem;
}
.kw-wiz-step.active .kw-wiz-dot { background: var(--kw-wiz-accent); color: #fff; }
.kw-wiz-step.done .kw-wiz-dot { background: var(--kw-wiz-accent-deep); color: #fff; }
.kw-wiz-label { font-weight: 600; font-size: .9rem; }
.kw-wiz-bar { flex: 1; min-width: 24px; height: 3px; background: #e2e8f0; border-radius: 2px; }
.kw-wiz-bar.done { background: var(--kw-wiz-accent-deep); }

.kw-drop {
    --kw-wiz-accent: #14b8a6;
    position: relative; min-height: 180px; border: 2px dashed #cbd5e1; border-radius: 14px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s ease, background .15s ease, transform .1s ease; overflow: hidden;
}
.kw-drop:hover { border-color: color-mix(in srgb, var(--kw-wiz-accent) 55%, white); }
.kw-drop-over { border-color: var(--kw-wiz-accent); transform: scale(1.005); }
.kw-drop-filled { border-style: solid; border-color: color-mix(in srgb, var(--kw-wiz-accent) 40%, white); background: #fff; }
.kw-drop-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.kw-drop-input:disabled { cursor: default; }
.kw-drop-busy { opacity: .85; }
.kw-drop-prompt { text-align: center; padding: 28px 16px; pointer-events: none; }
.kw-drop-icon { color: var(--kw-wiz-accent); margin-bottom: 6px; }
.kw-drop-over .kw-drop-icon { filter: brightness(.85); }
.kw-drop-file-check { flex-shrink: 0; }
.kw-drop-title { font-weight: 700; color: #0f172a; }
.kw-drop-subtitle { color: #64748b; margin-top: 2px; }
.kw-drop-browse { color: var(--kw-wiz-accent); font-weight: 600; text-decoration: underline; }
.kw-drop-hint { color: #94a3b8; margin-top: 6px; display: block; }
.kw-drop-file { position: relative; z-index: 2; pointer-events: none; display: flex; align-items: center; gap: 14px; width: 100%; padding: 18px 22px; }
.kw-drop-file-icon {
    width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
    background: color-mix(in srgb, var(--kw-wiz-accent) 16%, white); color: var(--kw-wiz-accent);
    display: flex; align-items: center; justify-content: center;
}
.kw-drop-file-info { flex: 1; min-width: 0; }
.kw-drop-file-name { font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-drop-file-meta { color: #64748b; }
.kw-drop-remove { position: relative; z-index: 3; pointer-events: auto; flex-shrink: 0; }

.kw-dark .kw-wiz-dot, .kw-dark .kw-wiz-bar { background: #334155; color: #cbd5e1; }
.kw-dark .kw-drop { border-color: #475569; background: linear-gradient(180deg, #1e293b 0%, #172033 100%); }
.kw-dark .kw-drop-filled { background: #1e293b; }
.kw-dark .kw-drop-title, .kw-dark .kw-drop-file-name { color: #f1f5f9; }
.kw-dark .kw-drop-subtitle, .kw-dark .kw-drop-file-meta { color: #94a3b8; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DRAFT WITH AI  (kw-draft-*)
   The review screen's job is to make an AI proposal auditable at a glance:
   the quote sits under every value, and anything unverified is visibly
   different rather than quietly identical.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.kw-draft-dialog .mud-dialog { max-width: 1180px; width: 94vw; }
.kw-draft-muted { color: #64748b; }
.kw-dark .kw-draft-muted { color: #94a3b8; }

.kw-draft-title { display: flex; align-items: center; gap: 14px; }
.kw-draft-title-icon {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px rgba(139, 92, 246, .35);
}
.kw-draft-title-main { font-weight: 800; font-size: 1.15rem; line-height: 1.2; color: #0f172a; }
.kw-draft-title-sub { font-size: .82rem; color: #64748b; }
.kw-dark .kw-draft-title-main { color: #f1f5f9; }
.kw-dark .kw-draft-title-sub { color: #94a3b8; }

.kw-draft-caption { margin: 2px 0 14px; font-size: .84rem; color: #64748b; }
.kw-dark .kw-draft-caption { color: #94a3b8; }

.kw-draft-notice {
    display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px;
    border-radius: 10px; font-size: .84rem; line-height: 1.5;
    background: rgba(139, 92, 246, .07); border: 1px solid rgba(139, 92, 246, .22); color: #4c1d95;
}
.kw-dark .kw-draft-notice { background: rgba(139, 92, 246, .12); border-color: rgba(139, 92, 246, .35); color: #ddd6fe; }

.kw-draft-doc { display: flex; align-items: center; gap: 10px; padding: 2px 0; }
.kw-draft-doc-name { font-weight: 600; line-height: 1.25; }

/* â”€â”€ working â”€â”€ */
.kw-draft-working { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 16px 48px; }
.kw-draft-orbit {
    width: 76px; height: 76px; border-radius: 50%; color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    display: flex; align-items: center; justify-content: center;
    animation: kwDraftPulse 1.8s ease-in-out infinite;
}
.kw-draft-orbit .mud-icon-root { font-size: 34px; }
@keyframes kwDraftPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, .45); }
    50%      { box-shadow: 0 0 0 18px rgba(139, 92, 246, 0); }
}
@media (prefers-reduced-motion: reduce) { .kw-draft-orbit { animation: none; } }

/* â”€â”€ review â”€â”€ */
.kw-draft-panes { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .kw-draft-panes { grid-template-columns: 1fr; } }

.kw-draft-source { border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; background: #fff; }
.kw-draft-source-head {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-weight: 700; font-size: .82rem;
    text-transform: uppercase; letter-spacing: .04em; color: #475569;
}
.kw-draft-source-body {
    max-height: 52vh; overflow-y: auto; padding: 16px 18px;
    font-size: .84rem; line-height: 1.7; color: #334155; white-space: pre-wrap; word-break: break-word;
}
.kw-draft-mark { background: rgba(139, 92, 246, .16); color: inherit; border-radius: 3px; padding: 1px 2px; }
.kw-draft-mark.on { background: rgba(245, 158, 11, .42); box-shadow: 0 0 0 2px rgba(245, 158, 11, .25); }
.kw-dark .kw-draft-source { background: #1e293b; border-color: #334155; }
.kw-dark .kw-draft-source-head { background: #172033; border-color: #334155; color: #cbd5e1; }
.kw-dark .kw-draft-source-body { color: #cbd5e1; }
.kw-dark .kw-draft-mark { background: rgba(139, 92, 246, .3); }

.kw-draft-props { display: flex; flex-direction: column; gap: 14px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
/* flex-shrink:0 is load-bearing. Flex children shrink by default, so inside this max-height column
   each group would compress and clip its own rows against overflow:hidden — the reviewer would see
   a half-row and no scrollbar. Pinning the height makes the column scroll instead. */
.kw-draft-group { flex-shrink: 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: hidden; }
.kw-draft-group-head {
    display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0; font-weight: 700; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .04em; color: #475569;
}
.kw-draft-group-count { margin-left: auto; font-weight: 600; text-transform: none; letter-spacing: 0; color: #64748b; }
.kw-dark .kw-draft-group { background: #1e293b; border-color: #334155; }
.kw-dark .kw-draft-group-head { background: #172033; border-color: #334155; color: #cbd5e1; }

.kw-draft-row {
    display: flex; gap: 6px; align-items: flex-start; padding: 10px 12px 12px;
    border-bottom: 1px solid #f1f5f9; border-left: 3px solid transparent;
    transition: background .12s ease, border-color .12s ease;
}
.kw-draft-row:last-child { border-bottom: none; }
.kw-draft-row.on { background: #faf5ff; border-left-color: #8b5cf6; }
.kw-draft-row.unsure { background: #fffbeb; }
.kw-draft-row.unsure.on { background: #fef3c7; border-left-color: #f59e0b; }
.kw-dark .kw-draft-row { border-bottom-color: #334155; }
.kw-dark .kw-draft-row.on { background: rgba(139, 92, 246, .14); }
.kw-dark .kw-draft-row.unsure { background: rgba(245, 158, 11, .1); }
.kw-dark .kw-draft-row.unsure.on { background: rgba(245, 158, 11, .18); }

.kw-draft-row-body { flex: 1; min-width: 0; padding-top: 6px; }
.kw-draft-row-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #64748b; }
.kw-draft-row-value { font-weight: 600; color: #0f172a; line-height: 1.4; word-break: break-word; }
.kw-draft-row-pick { margin-top: 8px; max-width: 340px; }
.kw-dark .kw-draft-row-value { color: #f1f5f9; }
.kw-dark .kw-draft-row-label { color: #94a3b8; }

.kw-draft-quote {
    display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; padding-left: 8px;
    border-left: 2px solid #cbd5e1; font-size: .78rem; line-height: 1.5; color: #64748b; font-style: italic;
}
.kw-draft-quote .mud-icon-root { flex-shrink: 0; margin-top: 2px; opacity: .6; }
/* Quotes are whole sentences and can be long. Clamp rather than let them overflow — the group is
   overflow:hidden, so an unclamped quote is cut mid-line at the panel edge and reads as a bug. */
.kw-draft-quote span {
    display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}
.kw-draft-row.on .kw-draft-quote span { -webkit-line-clamp: unset; line-clamp: unset; overflow: visible; }
.kw-dark .kw-draft-quote { border-left-color: #475569; color: #94a3b8; }

.kw-draft-note { margin-top: 5px; font-size: .77rem; color: #b45309; }
.kw-dark .kw-draft-note { color: #fcd34d; }

.kw-draft-trust { flex-shrink: 0; padding-top: 8px; }
.kw-draft-trust.ok { color: #059669; }
.kw-draft-trust.warn { color: #d97706; }
.kw-draft-trust.inferred { color: #7c3aed; }

.kw-draft-warnlist { margin: 0; padding-left: 18px; font-size: .82rem; line-height: 1.6; }
.kw-draft-empty { text-align: center; padding: 42px 16px; color: #94a3b8; }
.kw-draft-empty .mud-icon-root { color: #cbd5e1; margin-bottom: 8px; }

.kw-draft-tally { margin-right: auto; padding-left: 8px; font-size: .84rem; color: #475569; }
.kw-draft-tally strong { color: #6d28d9; font-size: 1rem; }
.kw-draft-tally-warn { color: #d97706; font-weight: 600; }
.kw-draft-tally-hint { font-size: .76rem; color: #64748b; margin-top: 1px; }
.kw-dark .kw-draft-tally-hint { color: #94a3b8; }
.kw-dark .kw-draft-tally { color: #cbd5e1; }
.kw-dark .kw-draft-tally strong { color: #c4b5fd; }

/* â”€â”€ the entry point on the form â”€â”€ */
.kw-draft-cta {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important; color: #fff !important;
    border: none !important; box-shadow: 0 6px 18px rgba(139, 92, 246, .35);
}
.kw-draft-cta:hover { box-shadow: 0 8px 22px rgba(139, 92, 246, .48); }

/* â”€â”€ the queued-draft banner shown between create and flush â”€â”€ */
.kw-draft-pending {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 11px 14px;
    border-radius: 10px; font-size: .85rem;
    background: rgba(139, 92, 246, .08); border: 1px solid rgba(139, 92, 246, .25); color: #4c1d95;
}
.kw-dark .kw-draft-pending { background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .38); color: #ddd6fe; }


/* â”€â”€ results framework: a tree, not a list â”€â”€
   Indentation and a left rail carry the parent/child relationship, because accepting an indicator
   without its output is not a thing the database can store. */
.kw-draft-results-empty { padding: 18px 16px 20px; text-align: center; }

.kw-draft-out { border-bottom: 1px solid #f1f5f9; }
.kw-draft-out:last-child { border-bottom: none; }
.kw-draft-out-head { display: flex; gap: 6px; align-items: flex-start; padding: 10px 12px 8px; }
.kw-draft-out-body { flex: 1; min-width: 0; padding-top: 6px; }
.kw-dark .kw-draft-out { border-bottom-color: #334155; }

/* Suggestions are inference wearing the same layout as evidence-backed extraction. The tint and the
   left bar are the standing reminder of which one the reviewer is looking at. */
.kw-draft-out.suggested { background: rgba(139, 92, 246, .05); border-left: 3px solid #a78bfa; }
.kw-dark .kw-draft-out.suggested { background: rgba(139, 92, 246, .1); }

.kw-draft-ind { margin: 0 12px 8px 34px; padding-left: 12px; border-left: 2px solid #e2e8f0; }
.kw-draft-ind-head { display: flex; gap: 6px; align-items: flex-start; }
.kw-dark .kw-draft-ind { border-left-color: #475569; }

.kw-draft-uom {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
    background: #f1f5f9; color: #64748b; font-weight: 600; font-size: .68rem;
    text-transform: none; letter-spacing: 0;
}
.kw-dark .kw-draft-uom { background: #334155; color: #cbd5e1; }

.kw-draft-tgt {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: 2px 0 2px 6px; padding: 2px 0; font-size: .8rem; color: #475569;
}
.kw-draft-tgt-period { font-weight: 700; color: #0f172a; min-width: 92px; }
.kw-draft-tgt-figs { color: #64748b; }
.kw-dark .kw-draft-tgt { color: #cbd5e1; }
.kw-dark .kw-draft-tgt-period { color: #f1f5f9; }
.kw-dark .kw-draft-tgt-figs { color: #94a3b8; }

/* A figure the document gave without a period can't be stored against a quarter, and inventing one
   would make the other three read as zero progress. Shown, greyed, not applicable. */
.kw-draft-tgt.unplaceable .kw-draft-tgt-period { color: #d97706; font-weight: 600; font-style: italic; }
.kw-draft-tgt.unplaceable .kw-draft-tgt-figs { opacity: .7; }


.kw-draft-suggest-more { margin-left: 10px; text-transform: none; letter-spacing: 0; font-size: .74rem; }

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   BULK IMPORT  (kw-bi-*)
   Rides on the shared kw-wiz-* / kw-drop-* shell; only the pieces the
   import wizard adds live here.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.kw-wiz-steps.kw-wiz-inv { --kw-wiz-accent: #3b82f6; --kw-wiz-accent-deep: #1d4ed8; }

.kw-bi-muted { color: #64748b; }
.kw-dark .kw-bi-muted { color: #94a3b8; }

/* â”€â”€ the create-vs-update choice â”€â”€
   Cards rather than a radio list: the two modes differ in whether existing
   records get overwritten, which is worth more than one line of label. */
.kw-bi-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

.kw-bi-mode {
    display: flex; gap: 12px; align-items: flex-start; text-align: left;
    padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 12px;
    background: #fff; cursor: pointer; font: inherit; color: inherit;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.kw-bi-mode:hover { border-color: #93c5fd; }
.kw-bi-mode.on { border-color: #1d4ed8; background: #eff6ff; box-shadow: 0 0 0 1px #1d4ed8 inset; }
.kw-bi-mode .mud-icon-root { flex-shrink: 0; margin-top: 2px; color: #64748b; }
.kw-bi-mode.on .mud-icon-root { color: #1d4ed8; }
.kw-bi-mode-title { font-weight: 700; color: #0f172a; line-height: 1.3; }
.kw-bi-mode-sub { font-size: .8rem; color: #64748b; line-height: 1.45; margin-top: 2px; }

.kw-dark .kw-bi-mode { background: #1e293b; border-color: #334155; }
.kw-dark .kw-bi-mode:hover { border-color: #3b82f6; }
.kw-dark .kw-bi-mode.on { background: rgba(59, 130, 246, .14); border-color: #60a5fa; box-shadow: 0 0 0 1px #60a5fa inset; }
.kw-dark .kw-bi-mode-title { color: #f1f5f9; }
.kw-dark .kw-bi-mode-sub { color: #94a3b8; }

/* â”€â”€ preview table tags â”€â”€ */
.kw-bi-tag {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.kw-bi-tag.new { background: #ecfdf5; color: #059669; }
.kw-bi-tag.upd { background: #eff6ff; color: #2563eb; }
.kw-bi-tag.bad { background: #fef2f2; color: #dc2626; }
.kw-dark .kw-bi-tag.new { background: rgba(16, 185, 129, .16); color: #6ee7b7; }
.kw-dark .kw-bi-tag.upd { background: rgba(59, 130, 246, .18); color: #93c5fd; }
.kw-dark .kw-bi-tag.bad { background: rgba(239, 68, 68, .18); color: #fca5a5; }

.kw-bi-row-bad { background: #fef2f2; }
.kw-dark .kw-bi-row-bad { background: rgba(239, 68, 68, .1); }

.kw-wiz-stat.kw-bi-stat-bad { border-color: #fecaca; background: #fef2f2; }
.kw-wiz-stat.kw-bi-stat-bad .v { color: #dc2626; }
.kw-dark .kw-wiz-stat.kw-bi-stat-bad { border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .12); }

/* â”€â”€ the commit step â”€â”€
   A determinate bar, because a minute of indeterminate spinner reads as
   "hung" and a refresh mid-import tears down the circuit. */
.kw-bi-progress { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 16px 40px; }


/* â”€â”€ wizard summary tiles and completion panel â”€â”€
   Lifted out of StrategicPlanImportWizard alongside the step strip and drop zone; both wizards
   report their outcome the same way, and a page-scoped copy only reaches one of them. */
.kw-wiz-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.kw-wiz-stat {
    min-width: 96px; padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 10px;
    text-align: center; background: #f8fafc;
}
.kw-wiz-stat .v { display: block; font-size: 1.5rem; font-weight: 800; color: #0f172a; line-height: 1.1; }
.kw-wiz-stat .k { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.kw-wiz-stat.new { border-color: #a7f3d0; background: #ecfdf5; }
.kw-wiz-stat.new .v { color: #059669; }
.kw-wiz-stat.upd { border-color: #bfdbfe; background: #eff6ff; }
.kw-wiz-stat.upd .v { color: #2563eb; }
.kw-wiz-done { text-align: center; padding: 12px 0; }

.kw-dark .kw-wiz-stat { background: #1e293b; border-color: #334155; }
.kw-dark .kw-wiz-stat .v { color: #f1f5f9; }
.kw-dark .kw-wiz-stat .k { color: #94a3b8; }
.kw-dark .kw-wiz-stat.new { background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .4); }
.kw-dark .kw-wiz-stat.new .v { color: #6ee7b7; }
.kw-dark .kw-wiz-stat.upd { background: rgba(59, 130, 246, .12); border-color: rgba(59, 130, 246, .4); }
.kw-dark .kw-wiz-stat.upd .v { color: #93c5fd; }



/* ── row quick-action rail ─────────────────────────────────────────────────────
   Per-row tasks used to live entirely behind a bare "⋮", which is an affordance
   people genuinely did not find: it is unlabelled, it looks like decoration, and
   it gives no hint that four of the module's main destinations are behind it.

   The rail puts those destinations on the row itself and — this is the part that
   matters — renders them ALWAYS. At rest they sit recessive (ink-3, ~55% opacity);
   row hover and keyboard focus-within promote them to full strength. Hover
   amplifies something already on screen; it never reveals something hidden. A
   hover-only rail would have reproduced the original bug in a prettier form.

   Reusable: any list page can adopt these classes. Only the accent per button
   (--kw-ra) and the icon set are page-specific. */
.kw-rowacts {
    display: flex; align-items: center; justify-content: flex-end; gap: 2px;
    opacity: .55;
    transition: opacity var(--kw-duration-fast, 150ms) ease;
}
.mud-table-row:hover .kw-rowacts,
.mud-table-row:focus-within .kw-rowacts { opacity: 1; }

/* Shrink-to-fit and no wrapping: promoting the rail must not reflow the row that
   is currently under the cursor. */
.kw-rowacts-col { width: 1%; white-space: nowrap; }

.kw-rowact.mud-icon-button {
    color: var(--ui-ink-3);
    border-radius: 8px;
    transition: color var(--kw-duration-fast, 150ms) ease,
                background-color var(--kw-duration-fast, 150ms) ease;
}
.kw-rowact.mud-icon-button:hover,
.kw-rowact.mud-icon-button:focus-visible {
    color: var(--kw-ra, var(--ui-blue));
    background: color-mix(in srgb, var(--kw-ra, var(--ui-blue)) 13%, transparent);
}

/* The overflow control keeps its word. A labelled "More ⌄" is the one thing the
   kebab never was: readable without hovering it first. */
.kw-rowact-more.mud-button-root {
    margin-left: 6px; min-width: 0; padding: 1px 6px 1px 10px;
    font-size: .72rem; font-weight: 700; letter-spacing: .02em; text-transform: none;
    color: var(--ui-ink-3);
    border: 1px solid var(--ui-line); border-radius: 8px;
}
.kw-rowact-more.mud-button-root:hover { color: var(--ui-ink); background: var(--ui-bg); }
.kw-rowact-more .mud-button-icon-end { margin-left: 1px; }

/* Whole row is the "open" target. */
.kw-ui .mud-table-row.kw-row { cursor: pointer; }

/* One line telling people the row is live and where its actions are. Cheap, and it
   removes the last reason anyone has to hunt. */
.kw-list-hint {
    display: flex; align-items: center; gap: 7px;
    margin: 0 4px 10px; font-size: .76rem; color: var(--ui-ink-3);
}

/* Menu section captions. MudBlazor portals popovers to the document root, OUTSIDE
   `.kw-ui`, so the --ui-* tokens are not in scope here — key off the MudBlazor
   palette variables directly or this renders unstyled. */
.kw-menu-cap {
    padding: 9px 16px 3px;
    font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
    color: var(--mud-palette-text-secondary, #64748b);
}

/* No hover to amplify with on a touch device — show the rail at full strength. */
@media (hover: none) {
    .kw-rowacts { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .kw-rowacts, .kw-rowact.mud-icon-button { transition: none; }
}

/* Narrow screens: MudTable stacks each row into a card and lays the cell out itself,
   so the rail only needs to stop being a 1%-wide column and to wrap if it must. Its
   alignment is the stacked cell's business — it lines up with the other values. */
@media (max-width: 700px) {
    .kw-rowacts { flex-wrap: wrap; opacity: 1; }
    .kw-rowacts-col { width: auto; white-space: normal; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PLANNING RUNBOOK  (kw-rb-*)
   The end-to-end planning guide at /planning/guide. Its own family because it
   is a document rather than a data screen: a stage flow, prose, a rules table
   and a print stylesheet. Rides on the kw-ui shell for the hero.
   ═══════════════════════════════════════════════════════════════════════════ */

/* The pipeline strip. Auto-fit rather than a fixed count so eight stages wrap
   sensibly instead of scrolling sideways on a laptop. */
.kw-rb-flow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 10px;
    margin: 0 0 22px;
}
.kw-rb-node {
    display: flex; flex-direction: column; gap: 3px;
    padding: 12px 14px 11px;
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    border-top: 3px solid var(--rb, var(--ui-blue));
    border-radius: 12px;
    text-decoration: none;
    transition: transform var(--kw-duration-fast, 150ms) var(--kw-ease-out, ease),
                box-shadow var(--kw-duration-fast, 150ms) ease;
}
.kw-rb-node:hover { transform: translateY(-2px); box-shadow: var(--kw-shadow-md); }
.kw-rb-node-num {
    font-family: 'Outfit', sans-serif; font-weight: 800; font-size: .74rem;
    color: var(--rb, var(--ui-blue)); letter-spacing: .06em;
}
.kw-rb-node-title { font-weight: 700; font-size: .84rem; color: var(--ui-ink); line-height: 1.25; }
.kw-rb-node-who { font-size: .69rem; color: var(--ui-ink-3); line-height: 1.3; }

/* One stage. The left rule carries the stage colour so the flow strip above and
   the section below read as the same thing. */
.kw-rb-stage {
    background: var(--ui-card);
    border: 1px solid var(--ui-line);
    border-left: 4px solid var(--rb, var(--ui-blue));
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    scroll-margin-top: 96px;   /* the sticky header would otherwise cover the anchor */
}
.kw-rb-stage-head {
    display: flex; align-items: center; gap: 13px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--ui-line);
    background: var(--ui-bg);
}
.kw-rb-stage-num {
    width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 1rem;
    background: color-mix(in srgb, var(--rb, var(--ui-blue)) 15%, transparent);
    color: var(--rb, var(--ui-blue));
}
.kw-rb-stage-title { font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 1.02rem; color: var(--ui-ink); margin: 0; }
.kw-rb-stage-who { font-size: .74rem; color: var(--ui-ink-3); margin: 2px 0 0; }
.kw-rb-stage-go { margin-left: auto; flex-shrink: 0; }
.kw-rb-stage-body { padding: 16px 20px 18px; font-size: .88rem; line-height: 1.62; color: var(--ui-ink-2); }
.kw-rb-stage-body p { margin: 0 0 11px; }
.kw-rb-stage-body p:last-child { margin-bottom: 0; }
.kw-rb-stage-body code {
    font-size: .82em; padding: 1px 5px; border-radius: 4px;
    background: var(--ui-bg); border: 1px solid var(--ui-line); color: var(--ui-ink);
}

.kw-rb-steps { margin: 0 0 11px; padding-left: 20px; }
.kw-rb-steps li { margin-bottom: 6px; }

/* The hierarchy chain — wraps as a unit rather than breaking mid-arrow. */
.kw-rb-chain {
    display: inline-block; margin-top: 4px; padding: 8px 12px;
    background: var(--ui-bg); border: 1px solid var(--ui-line); border-radius: 8px;
    font-size: .8rem; font-weight: 600; color: var(--ui-ink);
}

/* "Watch out" strip — the thing about a stage that is not visible on its screen. */
.kw-rb-watch {
    display: flex; gap: 9px; align-items: flex-start;
    margin-top: 13px; padding: 10px 13px;
    background: color-mix(in srgb, var(--ui-amber) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--ui-amber) 32%, transparent);
    border-radius: 9px;
    font-size: .82rem; color: var(--ui-ink);
}
.kw-rb-watch .mud-icon-root { color: #b45309; flex-shrink: 0; margin-top: 1px; }

.kw-rb-rule { padding: 14px 0; border-bottom: 1px dashed var(--ui-line); }
.kw-rb-rule:last-child { border-bottom: none; padding-bottom: 0; }
.kw-rb-rule h3 {
    font-family: 'Outfit', sans-serif; font-weight: 700; font-size: .94rem;
    color: var(--ui-ink); margin: 0 0 7px;
}
.kw-rb-note {
    margin-top: 8px !important; padding-left: 11px;
    border-left: 2px solid var(--ui-line); font-size: .82rem; color: var(--ui-ink-3);
}

.kw-rb-table-wrap { overflow-x: auto; margin: 10px 0; }
.kw-rb-table { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 520px; }
.kw-rb-table th, .kw-rb-table td { padding: 8px 11px; text-align: left; border-bottom: 1px solid var(--ui-line); }
.kw-rb-table thead th {
    background: var(--ui-bg); color: var(--ui-ink-3);
    font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.kw-rb-table td.yes { color: #047857; font-weight: 700; }
.kw-rb-table td.no { color: var(--ui-ink-3); }

.kw-rb-faq { font-size: .86rem; line-height: 1.6; color: var(--ui-ink-2); }
.kw-rb-foot { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 8px; }

/* Print: this is a runbook, so it should come out of a printer readable. Drop the
   app chrome and the interactive affordances, keep the structure. */
@media print {
    .kw-ui-hero-actions, .kw-rb-stage-go, .kw-rb-foot, .kw-rb-flow { display: none !important; }
    /* Only on the runbook itself (:has) — unscoped, "nav, header" also removed the page header of every
       public page from its printout. */
    body:has(.kw-rb-stage) :is(.kw-topbar, .kw-navrail, .kw-mobile-toggle, .mud-appbar, nav, header) { display: none !important; }
    .kw-ui { max-width: none; padding: 0; }
    .kw-rb-stage { break-inside: avoid; page-break-inside: avoid; box-shadow: none; }
    .kw-rb-stage-head { background: none; }
    /* MudBlazor collapses panels by default; a printed FAQ has to show its answers. */
    .mud-expand-panel-content { display: block !important; height: auto !important; visibility: visible !important; }
    a[href]::after { content: ""; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Progress reporting (kw-prog-*): the hub (/progress) and quarterly capture.
   Emerald accent to set reporting apart from planning (cyan).
   ═══════════════════════════════════════════════════════════════════════════ */
.kw-prog-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 16px; }

.kw-prog-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.kw-prog-cards > * { min-width: 0; }
.kw-prog-card {
    background: var(--mud-palette-surface, #fff); border: 1px solid var(--mud-palette-lines-default, #e2e8f0);
    border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.kw-prog-card-muted { opacity: 0.72; }
.kw-prog-card-head { display: flex; align-items: center; gap: 10px; }
.kw-prog-card-title { flex: 1; min-width: 0; font-weight: 700; }
.kw-prog-card-title small { display: block; font-weight: 400; color: var(--kw-text-muted, #64748b); }
.kw-prog-card-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-height: 30px; align-items: center; }
.kw-prog-hint { font-size: 0.78rem; color: var(--kw-text-muted, #64748b); }

/* minmax(0, 1fr), not 1fr: a 1fr track won't shrink below its content, and the unwrappable
   "NOT SUBMITTED" status pushed Q4 out of the card. */
.kw-prog-qstrip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kw-prog-q {
    border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-radius: 8px; background: transparent;
    padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; text-align: left; color: inherit;
    min-width: 0;
}
.kw-prog-q:hover:not(:disabled) { border-color: #10b981; }
.kw-prog-q:disabled { cursor: default; }
.kw-prog-q.current { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
.kw-prog-q.future { opacity: 0.55; }
.kw-prog-q-label { font-weight: 700; font-size: 0.8rem; }
.kw-prog-q-bar { display: block; height: 6px; border-radius: 99px; background: #e2e8f0; overflow: hidden; min-width: 0; }
.kw-prog-q-bar > span { display: block; height: 100%; background: #10b981; border-radius: 99px; transition: width .3s; }
.kw-prog-q-status {
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.2;
    color: var(--kw-text-muted, #64748b); overflow-wrap: anywhere;   /* wraps to two lines on a narrow card */
}
.kw-prog-q-status.ok { color: #059669; }
.kw-prog-q-status.sent { color: #2563eb; }
.kw-prog-q-status.back { color: #d97706; }

/* capture: quarter tiles */
.kw-prog-quarters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 800px) { .kw-prog-quarters { grid-template-columns: repeat(2, 1fr); } }
.kw-prog-qtile {
    border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-radius: 12px; padding: 10px 12px;
    background: var(--mud-palette-surface, #fff); cursor: pointer; text-align: left; color: inherit;
    display: flex; flex-direction: column; gap: 8px;
}
.kw-prog-qtile:hover { border-color: #10b981; }
.kw-prog-qtile.active { border-color: #059669; box-shadow: 0 0 0 2px rgba(16,185,129,.35); background: #ecfdf5; }
.kw-prog-qtile.future { opacity: 0.6; }
.kw-prog-qtile-top { display: flex; align-items: baseline; gap: 8px; }
.kw-prog-qtile-top strong { font-size: 1.05rem; }
.kw-prog-qtile-top span { font-size: 0.78rem; color: var(--kw-text-muted, #64748b); }
.kw-prog-now { margin-left: auto; background: #10b981; color: #fff !important; border-radius: 99px; padding: 1px 8px; font-weight: 700; font-size: 0.66rem !important; }
.kw-prog-qtile-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 0.74rem; color: var(--kw-text-muted, #64748b); }

.kw-prog-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }

/* objective sections */
.kw-prog-so {
    border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-radius: 12px; margin-bottom: 14px;
    background: var(--mud-palette-surface, #fff); overflow: hidden;
}
.kw-prog-so-head {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; user-select: none;
    background: #ecfdf5; border-bottom: 1px solid #d1fae5;
}
.kw-prog-so-flag { color: #059669; }
.kw-prog-so-title { flex: 1; min-width: 0; font-weight: 700; color: #065f46; }
.kw-prog-so-meter { display: flex; align-items: center; gap: 8px; width: 170px; }
.kw-prog-so-meter .kw-prog-q-bar { flex: 1; }
.kw-prog-so-meter small { color: var(--kw-text-muted, #64748b); white-space: nowrap; }
.kw-prog-so-note { padding: 8px 14px; font-size: 0.8rem; color: var(--kw-text-muted, #64748b); background: #f8fafc; }

.kw-prog-subbar {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px;
    background: #f8fafc; border: 1px solid #e2e8f0;
}
.kw-prog-subbar.compact { border-radius: 0; margin: 0; border-width: 0 0 1px 0; }
.kw-prog-subbar.sent { background: #eff6ff; border-color: #bfdbfe; }
.kw-prog-subbar.ok { background: #ecfdf5; border-color: #a7f3d0; }
.kw-prog-subbar.back { background: #fffbeb; border-color: #fde68a; }
.kw-prog-subbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.82rem; }
.kw-prog-subbar-text span { color: var(--kw-text-muted, #475569); }

/* the capture table */
.kw-prog-table-wrap { overflow-x: auto; }
.kw-prog-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.kw-prog-table th {
    text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
    color: var(--kw-text-muted, #64748b); padding: 8px 10px; border-bottom: 1px solid var(--mud-palette-lines-default, #e2e8f0);
    white-space: nowrap;
}
.kw-prog-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.kw-prog-table .num { text-align: right; }
.kw-prog-table tr.dirty td { background: #fffbeb; }
.kw-prog-table tr.error td { background: #fef2f2; }
.kw-prog-ind { min-width: 280px; max-width: 460px; }
.kw-prog-crumb { font-size: 0.72rem; color: var(--kw-text-muted, #64748b); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-prog-crumb span { opacity: .6; margin: 0 2px; }
.kw-prog-ind-name { font-weight: 600; margin: 2px 0; }
.kw-prog-ind-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 0.72rem; color: var(--kw-text-muted, #64748b); }
.kw-prog-chip { background: #f1f5f9; border-radius: 99px; padding: 0 8px; }
.kw-prog-err { color: #dc2626; font-size: 0.76rem; margin-top: 4px; font-weight: 600; }
.kw-prog-target { font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.kw-prog-entry-col { width: 150px; }
.kw-prog-entry { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kw-prog-input {
    width: 100%; border: 1px solid #cbd5e1; border-radius: 8px; padding: 7px 9px; font: inherit;
    background: var(--mud-palette-surface, #fff); color: inherit;
}
input.kw-prog-input { text-align: right; font-weight: 700; font-size: 0.95rem; max-width: 130px; }
.kw-prog-input:focus { outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); }
.kw-prog-input.dirty { border-color: #f59e0b; }
.kw-prog-textarea { min-height: 36px; resize: vertical; font-size: 0.82rem; }
.kw-prog-comment { min-width: 220px; }
.kw-prog-fill { border: 0; background: transparent; color: #059669; font-size: 0.7rem; font-weight: 700; cursor: pointer; padding: 0; }
.kw-prog-fill:hover { text-decoration: underline; }
.kw-prog-pill { display: inline-block; min-width: 48px; text-align: center; border-radius: 99px; padding: 2px 8px; font-weight: 700; font-size: 0.78rem; }
.kw-prog-pill.above { background: #C6EFCE; color: #006100; }
.kw-prog-pill.on { background: #FFEB9C; color: #9C5700; }
.kw-prog-pill.below { background: #FFC7CE; color: #9C0006; }
.kw-prog-ytd { white-space: nowrap; color: var(--kw-text-muted, #475569); }
.kw-prog-muted { color: var(--kw-text-muted, #94a3b8); }

.kw-prog-savebar {
    position: sticky; bottom: 12px; z-index: 20; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; margin-top: 12px; border-radius: 12px;
    background: #064e3b; color: #fff; box-shadow: 0 10px 30px rgba(6, 78, 59, .35);
}
.kw-prog-savebar .mud-button-text { color: #d1fae5; }

.kw-dark .kw-prog-so-head { background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); }
.kw-dark .kw-prog-so-title { color: #6ee7b7; }
.kw-dark .kw-prog-qtile.active { background: rgba(16,185,129,.14); }
.kw-dark .kw-prog-table tr.dirty td { background: rgba(245,158,11,.10); }
.kw-dark .kw-prog-table tr.error td { background: rgba(239,68,68,.10); }
.kw-dark .kw-prog-subbar, .kw-dark .kw-prog-so-note { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.2); }
.kw-dark .kw-prog-chip { background: rgba(148,163,184,.18); }

/* ── Progress capture additions: reviewer flags, plan notes, history ── */
.kw-prog-table tr.flagged td { background: #fffbeb; }
.kw-prog-table tr.flagged td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.kw-prog-flag {
    display: flex; align-items: flex-start; gap: 4px; margin-top: 6px; padding: 4px 8px; border-radius: 6px;
    background: #fef3c7; color: #92400e; font-size: 0.76rem; font-weight: 600;
}
.kw-prog-plannote {
    font-size: 0.74rem; color: var(--kw-text-muted, #475569); background: #f1f5f9; border-radius: 6px;
    padding: 4px 8px; margin-bottom: 6px; white-space: pre-wrap;
}
.kw-prog-plannote span {
    display: inline-block; font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: #0e7490; margin-right: 4px;
}
.kw-prog-histtoggle {
    align-self: flex-start; margin-top: 4px; border: 0; background: transparent; padding: 0; cursor: pointer;
    color: #4338ca; font-size: 0.74rem; font-weight: 700;
}
.kw-prog-histtoggle:hover { text-decoration: underline; }

.kw-prog-timeline { list-style: none; margin: 0 0 12px; padding: 4px 0 0 4px; }
.kw-prog-timeline.compact { padding: 8px 14px 4px; margin: 0; border-bottom: 1px solid #f1f5f9; }
.kw-prog-timeline li { display: flex; gap: 10px; position: relative; padding-bottom: 12px; }
.kw-prog-timeline li:not(:last-child)::before {
    content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: #e2e8f0;
}
.kw-prog-tl-dot {
    flex: 0 0 24px; height: 24px; border-radius: 99px; display: flex; align-items: center; justify-content: center;
    background: #eef2ff; color: #4338ca;
}
.kw-prog-timeline li.ok .kw-prog-tl-dot { background: #d1fae5; color: #047857; }
.kw-prog-timeline li.back .kw-prog-tl-dot { background: #fef3c7; color: #b45309; }
.kw-prog-tl-body { min-width: 0; font-size: 0.8rem; }
.kw-prog-tl-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.kw-prog-tl-head span, .kw-prog-tl-head time { color: var(--kw-text-muted, #64748b); font-size: 0.74rem; }
.kw-prog-tl-text { margin-top: 2px; white-space: pre-wrap; }

/* ── Review queue and workspace (kw-rev-*) — indigo ── */
.kw-rev-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.kw-rev-kpi {
    display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 12px;
    border: 1px solid var(--mud-palette-lines-default, #e2e8f0); background: var(--mud-palette-surface, #fff); color: inherit;
}
button.kw-rev-kpi { cursor: pointer; }
button.kw-rev-kpi:hover { border-color: #6366f1; }
.kw-rev-kpi.active { border-color: #4338ca; box-shadow: 0 0 0 2px rgba(99,102,241,.3); }
.kw-rev-kpi.warn { border-color: #fca5a5; background: #fef2f2; }
.kw-rev-kpi.wide { grid-column: span 2; }
.kw-rev-kpi .v { font-size: 1.5rem; font-weight: 800; line-height: 1.1; }
.kw-rev-kpi .k { font-size: 0.74rem; color: var(--kw-text-muted, #64748b); }
.kw-rev-kpi .k b.above { color: #006100; } .kw-rev-kpi .k b.on { color: #9C5700; } .kw-rev-kpi .k b.below { color: #9C0006; }

.kw-rev-bands { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #e2e8f0; min-width: 80px; flex: 1; }
.kw-rev-bands.big { height: 14px; margin: 6px 0; }
.kw-rev-bands .above { background: #16A34A; } .kw-rev-bands .on { background: #EAB308; } .kw-rev-bands .below { background: #DC2626; }

.kw-rev-list { display: flex; flex-direction: column; gap: 8px; }
.kw-rev-item {
    display: flex; align-items: center; gap: 16px; padding: 12px 14px; border-radius: 12px; text-decoration: none; color: inherit;
    border: 1px solid var(--mud-palette-lines-default, #e2e8f0); background: var(--mud-palette-surface, #fff);
    transition: border-color .15s, box-shadow .15s;
}
.kw-rev-item:hover { border-color: #6366f1; box-shadow: 0 4px 14px rgba(67,56,202,.12); }
.kw-rev-item.overdue { box-shadow: inset 4px 0 0 #ef4444; }
.kw-rev-item-main { flex: 1; min-width: 0; }
.kw-rev-item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kw-rev-q { background: #eef2ff; color: #4338ca; border-radius: 6px; padding: 0 6px; font-weight: 800; font-size: 0.78rem; }
.kw-rev-badge { background: #fef3c7; color: #92400e; border-radius: 99px; padding: 0 7px; font-size: 0.72rem; font-weight: 700; }
.kw-rev-item-sub { font-size: 0.8rem; color: #3730a3; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Which part of a plan a submission covers — one HQ strategic objective, or a county's whole plan. */
.kw-rev-scope { display: inline-flex; align-items: center; gap: 3px; border-radius: 6px; padding: 0 7px; font-weight: 700; font-size: 0.74rem;
                background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.kw-rev-scope.so { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.kw-rev-scope .mud-icon-root { font-size: 0.95rem; }
.kw-rev-item-so { font-size: 0.82rem; color: #334155; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-rev-item-so strong { color: #b91c1c; }
.kw-rev-scope-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 16px; border-radius: 10px;
                       background: #f8fafc; border: 1px solid #cbd5e1; border-left: 5px solid #64748b; }
.kw-rev-scope-banner.so { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; }
.kw-rev-scope-banner > .mud-icon-root { color: #64748b; font-size: 1.8rem; }
.kw-rev-scope-banner.so > .mud-icon-root { color: #dc2626; }
.kw-rev-scope-banner small { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; font-weight: 700; }
.kw-rev-scope-banner strong { display: block; font-size: 1.05rem; color: #0f172a; }
.kw-rev-scope-banner.so strong { color: #b91c1c; }
.kw-rev-scope-banner span { font-size: 0.8rem; color: #475569; }
.kw-dark .kw-rev-scope-banner { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.3); }
.kw-dark .kw-rev-scope-banner.so { background: rgba(220,38,38,.1); border-color: rgba(220,38,38,.35); }
.kw-dark .kw-rev-scope-banner strong { color: #f1f5f9; }
.kw-dark .kw-rev-scope-banner.so strong, .kw-dark .kw-rev-item-so strong { color: #fca5a5; }
/* The submit dialog's "You are submitting" box. */
.kw-prog-submit-scope { border: 1px solid #fecaca; border-left: 5px solid #dc2626; background: #fef2f2; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.kw-prog-submit-scope-head { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: #991b1b; }
.kw-prog-submit-scope-plan { font-size: 0.85rem; color: #334155; margin-top: 2px; }
.kw-prog-submit-scope-label { font-size: 0.72rem; color: #64748b; margin-top: 8px; }
.kw-prog-submit-scope-what { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 1rem; color: #b91c1c; margin-top: 2px; }
.kw-prog-submit-scope-hint { font-size: 0.75rem; color: #64748b; margin-top: 4px; }
.kw-prog-submit-scope-list { margin: 6px 0 0; padding-left: 0; list-style: none; font-size: 0.82rem; color: #334155; max-height: 160px; overflow: auto; }
.kw-prog-submit-scope-list li { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.kw-prog-submit-scope-list .mud-icon-root { color: #dc2626; font-size: 0.95rem; }
.kw-dark .kw-prog-submit-scope { background: rgba(220,38,38,.1); border-color: rgba(220,38,38,.35); }
.kw-dark .kw-prog-submit-scope-plan, .kw-dark .kw-prog-submit-scope-list { color: #e2e8f0; }
.kw-prog-subbar-block { display: flex; align-items: flex-start; gap: 4px; margin-top: 4px; color: #92400e !important; font-size: 0.78rem; }
.kw-rev-item-meta { font-size: 0.74rem; color: var(--kw-text-muted, #64748b); margin-top: 2px; }
.kw-rev-wait { margin-left: 8px; font-weight: 700; }
.kw-rev-wait.late { color: #dc2626; }
.kw-rev-item-stats { display: flex; gap: 18px; }
.kw-rev-stat { display: flex; flex-direction: column; gap: 3px; width: 150px; font-size: 0.7rem; color: var(--kw-text-muted, #64748b); }
@media (max-width: 900px) { .kw-rev-item-stats { display: none; } }
.kw-rev-empty { text-align: center; padding: 48px 16px; color: var(--kw-text-muted, #64748b); display: flex; flex-direction: column; gap: 8px; align-items: center; }

.kw-rev-note {
    display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px;
    background: #eef2ff; border: 1px solid #c7d2fe; color: #312e81;
}
.kw-rev-note small { font-weight: 700; }
.kw-rev-note p { margin: 2px 0 0; white-space: pre-wrap; }
.kw-rev-comment { font-size: 0.82rem; white-space: pre-wrap; margin-bottom: 6px; }
.kw-rev-actions { white-space: nowrap; }
.kw-rev-flaginput { margin-top: 6px; border-color: #f59e0b; }
.kw-prog-so-head.rev { background: #eef2ff; border-color: #e0e7ff; }
.kw-prog-so-head.rev .kw-prog-so-title, .kw-prog-so-head.rev .kw-prog-so-flag { color: #3730a3; }
.kw-prog-so-head.ana { background: #f5f3ff; border-color: #ede9fe; cursor: default; }
.kw-prog-so-head.ana .kw-prog-so-title, .kw-prog-so-head.ana .kw-prog-so-flag { color: #5b21b6; }

.kw-rev-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.kw-rev-panel {
    border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-radius: 12px; padding: 14px;
    background: var(--mud-palette-surface, #fff);
}
.kw-rev-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.kw-rev-meta { font-size: 0.78rem; color: var(--kw-text-muted, #64748b); margin-bottom: 10px; }
.kw-rev-decide { display: flex; gap: 8px; justify-content: flex-end; margin: 6px 0; }
.kw-rev-feedback { border-top: 1px solid #f1f5f9; padding: 8px 0; font-size: 0.8rem; }
.kw-rev-feedback small { color: var(--kw-text-muted, #64748b); display: block; margin-bottom: 2px; }

/* ── Analytics (kw-ana-*) — violet ── */
.kw-ana-quarters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
@media (max-width: 900px) { .kw-ana-quarters { grid-template-columns: repeat(2, 1fr); } }
.kw-ana-q { border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.kw-ana-q-head { display: flex; gap: 8px; align-items: baseline; }
.kw-ana-q-head span { font-size: 0.76rem; color: var(--kw-text-muted, #64748b); }
.kw-ana-q-row { display: flex; align-items: center; gap: 8px; font-size: 0.7rem; color: var(--kw-text-muted, #64748b); }
.kw-ana-q-row small:first-child { width: 58px; }
.kw-ana-q-row .kw-prog-q-bar { flex: 1; }
.kw-ana-q-foot { display: flex; gap: 8px; flex-wrap: wrap; font-size: 0.7rem; font-weight: 700; }
.kw-ana-q-foot .sent { color: #2563eb; } .kw-ana-q-foot .ok { color: #059669; } .kw-ana-q-foot .back { color: #d97706; }

.kw-ana-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 10px; }
.kw-ana-legend { display: flex; gap: 10px; font-size: 0.72rem; }
.kw-ana-legend span { display: inline-flex; align-items: center; gap: 4px; }
.kw-ana-legend span::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: currentColor; opacity: .35; }
.kw-ana-legend .st-none { color: #94a3b8; } .kw-ana-legend .st-sent { color: #2563eb; }
.kw-ana-legend .st-ok { color: #059669; } .kw-ana-legend .st-back { color: #d97706; }

.kw-ana-matrix { width: 100%; border-collapse: separate; border-spacing: 4px; font-size: 0.8rem; }
.kw-ana-matrix th { text-align: center; font-size: 0.72rem; color: var(--kw-text-muted, #64748b); }
.kw-ana-matrix th:first-child { text-align: left; }
.kw-ana-plan { white-space: nowrap; font-weight: 600; padding-right: 8px; }
.kw-ana-cell {
    text-align: center; border-radius: 8px; padding: 6px 4px; cursor: pointer; min-width: 90px;
    display: table-cell; transition: transform .1s;
}
.kw-ana-cell:hover { transform: scale(1.04); }
.kw-ana-cell-top { display: block; font-weight: 800; }
.kw-ana-cell-sub { display: block; font-size: 0.64rem; text-transform: uppercase; letter-spacing: .03em; opacity: .85; }
.kw-ana-cell.st-future { background: #f8fafc; color: #cbd5e1; cursor: default; }
.kw-ana-cell.st-none { background: #f1f5f9; color: #475569; }
.kw-ana-cell.st-sent { background: #dbeafe; color: #1e40af; }
.kw-ana-cell.st-ok { background: #d1fae5; color: #065f46; }
.kw-ana-cell.st-back { background: #fef3c7; color: #92400e; }

.kw-ana-aggrow { cursor: pointer; }
.kw-ana-aggrow:hover td { background: #faf5ff; }
.kw-ana-breakdown > td { background: #faf5ff; padding: 4px 10px 10px 24px !important; }
.kw-ana-breakdown table { width: 100%; font-size: 0.78rem; border-collapse: collapse; }
.kw-ana-breakdown table td { padding: 4px 8px; border-bottom: 1px solid #ede9fe; }
.kw-ana-breakdown .num { text-align: right; }

.kw-dark .kw-prog-table tr.flagged td { background: rgba(245,158,11,.10); }
.kw-dark .kw-prog-flag { background: rgba(245,158,11,.18); color: #fcd34d; }
.kw-dark .kw-prog-plannote { background: rgba(148,163,184,.12); }
.kw-dark .kw-rev-note { background: rgba(99,102,241,.14); border-color: rgba(99,102,241,.35); color: #c7d2fe; }
.kw-dark .kw-prog-so-head.rev { background: rgba(99,102,241,.14); border-color: rgba(99,102,241,.25); }
.kw-dark .kw-prog-so-head.rev .kw-prog-so-title { color: #c7d2fe; }
.kw-dark .kw-prog-so-head.ana { background: rgba(139,92,246,.14); border-color: rgba(139,92,246,.25); }
.kw-dark .kw-prog-so-head.ana .kw-prog-so-title { color: #ddd6fe; }
.kw-dark .kw-rev-kpi.warn { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.kw-dark .kw-ana-aggrow:hover td, .kw-dark .kw-ana-breakdown > td { background: rgba(139,92,246,.08); }
.kw-dark .kw-ana-cell.st-none, .kw-dark .kw-ana-cell.st-future { background: rgba(148,163,184,.12); color: #cbd5e1; }
.kw-dark .kw-ana-cell.st-sent { background: rgba(37,99,235,.25); color: #bfdbfe; }
.kw-dark .kw-ana-cell.st-ok { background: rgba(16,185,129,.25); color: #a7f3d0; }
.kw-dark .kw-ana-cell.st-back { background: rgba(245,158,11,.25); color: #fde68a; }

/* ── Progress submission attachments ── */
.kw-prog-attachments { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.kw-prog-attachments-label { display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; color: var(--mud-palette-text-secondary); margin-right: 4px; }
.kw-prog-upload-row { display: flex; align-items: center; gap: 8px; padding: 2px 4px; border-bottom: 1px dashed var(--mud-palette-lines-default); }
.kw-prog-upload-row.removed { opacity: .5; text-decoration: line-through; }
.kw-prog-upload-row small { color: var(--mud-palette-text-secondary); white-space: nowrap; }
.kw-prog-upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.kw-prog-upload-title { flex: 1; min-width: 0; }

/* ══════════════════════════════════════════════
   Progress insights (kw-ins-*)
   ══════════════════════════════════════════════ */
.kw-ins-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--mud-palette-lines-default); }
.kw-ins-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: .875rem; font-weight: 600; color: var(--mud-palette-text-secondary); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.kw-ins-tabs a:hover { color: var(--mud-palette-text-primary); }
.kw-ins-tabs a.active { color: #7c3aed; border-bottom-color: #7c3aed; }
.kw-ins-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.kw-ins-f-sm { width: 150px; flex: 0 0 auto; }
.kw-ins-f-md { width: 220px; flex: 0 0 auto; }
.kw-ins-f-lg { width: 320px; flex: 1 1 240px; max-width: 420px; }

.kw-ins-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kw-ins-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 14px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; animation: kw-ins-in .35s ease both; }
a.kw-ins-kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.08); }
.kw-ins-kpi small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mud-palette-text-secondary); font-weight: 600; }
.kw-ins-kpi strong { font-size: 1.9rem; line-height: 1.1; font-weight: 700; }
.kw-ins-kpi strong span { font-size: .9rem; font-weight: 500; color: var(--mud-palette-text-secondary); }
.kw-ins-kpi em { font-style: normal; font-size: .75rem; color: var(--mud-palette-text-secondary); }
@keyframes kw-ins-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.kw-ins-panel { height: 100%; padding: 14px 16px; border-radius: 14px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); }
.kw-ins-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.kw-ins-panel-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.kw-ins-panel-head span { font-size: .75rem; color: var(--mud-palette-text-secondary); }

.kw-ins-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 150px; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 8px; text-decoration: none; color: inherit; }
.kw-ins-row:hover { background: var(--mud-palette-action-default-hover); }
.kw-ins-row:has(> :nth-child(2):last-child) { grid-template-columns: minmax(0, 1fr) 150px; }
.kw-ins-row-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
.kw-ins-row-label small { display: block; font-size: .72rem; color: var(--mud-palette-text-secondary); overflow: hidden; text-overflow: ellipsis; }
.kw-ins-vs { font-size: .72rem; color: var(--mud-palette-text-secondary); white-space: nowrap; }

.kw-ins-perf { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.kw-ins-perf-track { position: relative; flex: 1; height: 8px; border-radius: 4px; background: var(--mud-palette-background-gray); overflow: hidden; }
.kw-ins-perf-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.kw-ins-perf-mark { position: absolute; top: -2px; bottom: -2px; left: 66.67%; width: 2px; background: var(--mud-palette-text-secondary); opacity: .45; }
.kw-ins-perf span { width: 40px; text-align: right; font-weight: 700; font-size: .82rem; }
.kw-ins-cov { display: flex; align-items: center; gap: 8px; min-width: 100px; }
.kw-ins-cov-track { flex: 1; height: 6px; border-radius: 3px; background: var(--mud-palette-background-gray); overflow: hidden; }
.kw-ins-cov-track div { height: 100%; background: #3b82f6; border-radius: 3px; }
.kw-ins-cov span { width: 36px; text-align: right; font-size: .78rem; color: var(--mud-palette-text-secondary); }
.kw-ins-bands { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--mud-palette-background-gray); min-width: 60px; }
.kw-ins-band.above { background: #16A34A; }
.kw-ins-band.on { background: #EAB308; }
.kw-ins-band.below { background: #DC2626; }
.kw-ins-spark { width: 100%; height: 28px; display: block; }
.kw-ins-spark-target { stroke: var(--mud-palette-text-secondary); stroke-dasharray: 2 2; stroke-width: .6; opacity: .5; }

.kw-ins-quarters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 8px; }
.kw-ins-quarter { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; text-decoration: none; color: inherit; border: 1px solid transparent; }
a.kw-ins-quarter:hover { background: var(--mud-palette-action-default-hover); }
.kw-ins-quarter.selected { border-color: #7c3aed; background: rgba(124,58,237,.06); }
.kw-ins-quarter.future { opacity: .45; }
.kw-ins-quarter-bar { width: 38px; height: 110px; border-radius: 8px; background: var(--mud-palette-background-gray); display: flex; align-items: flex-end; overflow: hidden; margin-bottom: 4px; position: relative; }
.kw-ins-quarter-bar::after { content: ''; position: absolute; left: 0; right: 0; bottom: 66.67%; border-top: 1px dashed var(--mud-palette-text-secondary); opacity: .5; }
.kw-ins-quarter-bar div { width: 100%; border-radius: 8px 8px 0 0; transition: height .4s ease; }
.kw-ins-quarter small { font-size: .7rem; color: var(--mud-palette-text-secondary); text-align: center; }

.kw-ins-table-wrap { overflow-x: auto; }
.kw-ins-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.kw-ins-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mud-palette-text-secondary); padding: 6px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); white-space: nowrap; }
.kw-ins-table td { padding: 7px 8px; border-bottom: 1px solid var(--mud-palette-lines-default); vertical-align: middle; }
.kw-ins-table td small { color: var(--mud-palette-text-secondary); }
.kw-ins-table .num { text-align: right; white-space: nowrap; }
.kw-ins-click { cursor: pointer; }
.kw-ins-click:hover td { background: var(--mud-palette-action-default-hover); }
.kw-ins-rank { font-weight: 700; color: #7c3aed; width: 28px; }
.kw-ins-bad { color: #ef4444; font-weight: 600; }
.kw-ins-weight { height: 3px; margin-top: 4px; border-radius: 2px; background: rgba(124,58,237,.35); }
.kw-ins-actions { white-space: nowrap; text-align: right; }
.kw-ins-comment { max-width: 360px; }
.kw-ins-comment small { display: block; margin-top: 2px; }
.kw-ins-pill { display: inline-block; min-width: 44px; text-align: center; padding: 2px 8px; border-radius: 10px; color: #fff; font-weight: 700; font-size: .75rem; }
.kw-ins-status { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: .72rem; font-weight: 600; background: var(--mud-palette-background-gray); color: var(--mud-palette-text-secondary); white-space: nowrap; }
.kw-ins-status.accepted { background: rgba(16,185,129,.15); color: #047857; }
.kw-ins-status.submitted { background: rgba(59,130,246,.15); color: #1d4ed8; }
.kw-ins-status.returned { background: rgba(245,158,11,.18); color: #b45309; }

.kw-ins-heat { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.kw-ins-heat th { font-size: .72rem; font-weight: 600; color: var(--mud-palette-text-secondary); white-space: nowrap; padding: 2px 6px; }
.kw-ins-heat tbody th { text-align: left; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.kw-ins-heat tbody th a { color: inherit; text-decoration: none; }
.kw-ins-heat tbody th a:hover { text-decoration: underline; }
.kw-ins-heat td { min-width: 52px; height: 30px; text-align: center; border-radius: 6px; font-weight: 700; cursor: pointer; transition: transform .1s; }
.kw-ins-heat td:hover { transform: scale(1.08); }
.kw-ins-heat.wide td { min-width: 110px; font-weight: 600; cursor: default; }
.kw-ins-heat-empty { background: transparent; cursor: default !important; }
.kw-ins-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .75rem; color: var(--mud-palette-text-secondary); }
.kw-ins-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
/* Review & data-quality panel (progress dashboard) */
.kw-ins-quality { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kw-ins-quality > div > small { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mud-palette-text-secondary); margin-bottom: 6px; }
.kw-ins-quality-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.kw-ins-quality-chips span { font-size: .78rem; padding: 4px 10px; border-radius: 999px; background: var(--mud-palette-background-gray); color: var(--mud-palette-text-primary); }
@media (max-width: 700px) { .kw-ins-quality { grid-template-columns: 1fr; } }
/* Planning-cycle dashboard */
.kw-plan-matrix { border-collapse: separate; border-spacing: 3px; font-size: .78rem; width: 100%; }
.kw-plan-matrix th { text-align: left; font-weight: 600; color: var(--mud-palette-text-secondary); padding: 2px 6px; white-space: nowrap; }
.kw-plan-matrix td { text-align: center; padding: 5px 4px; border-radius: 5px; color: #fff; white-space: nowrap; }
.kw-plan-matrix td.none { background: var(--mud-palette-background-gray); color: var(--mud-palette-text-secondary); }
.kw-plan-matrix td.draft { background: #94a3b8; }
.kw-plan-matrix td.awaiting { background: #f59e0b; }
.kw-plan-matrix td.approved { background: #10b981; }
.kw-plan-matrix td.ontime { background: #10b981; }
.kw-plan-matrix td.late { background: #0ea5e9; }
.kw-plan-matrix td.duesoon { background: #f59e0b; }
.kw-plan-matrix td.overdue { background: #ef4444; }
.kw-plan-matrix td.notdue { background: var(--mud-palette-background-gray); color: var(--mud-palette-text-secondary); }
.kw-plan-matrix td a { color: inherit; text-decoration: none; display: block; }
.kw-plan-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kw-plan-timeline > div { border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 10px 12px; }
.kw-plan-timeline > div.current { border-color: #0d9488; box-shadow: 0 0 0 1px #0d9488 inset; }
.kw-plan-timeline strong { display: block; font-size: .95rem; }
.kw-plan-timeline small { display: block; color: var(--mud-palette-text-secondary); font-size: .75rem; }
@media (max-width: 700px) { .kw-plan-timeline { grid-template-columns: repeat(2, 1fr); } }
.kw-plan-check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--mud-palette-lines-default); }
.kw-plan-check:last-child { border-bottom: 0; }
.kw-plan-check b { font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }


.kw-ins-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 10px; font-size: .85rem; }
.kw-ins-crumbs a { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 14px; background: var(--mud-palette-background-gray); color: var(--mud-palette-text-primary); text-decoration: none; }
.kw-ins-crumbs a small { color: var(--mud-palette-text-secondary); font-size: .7rem; text-transform: uppercase; }
.kw-ins-crumbs a:hover { background: rgba(124,58,237,.12); }
.kw-ins-crumbs .sep { color: var(--mud-palette-text-secondary); }
.kw-ins-crumbs .kw-ins-crumb-x { padding: 0 7px; background: transparent; color: var(--mud-palette-text-secondary); margin-left: -4px; }
.kw-ins-groupby { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 12px; }
.kw-ins-groupby > span { font-size: .75rem; color: var(--mud-palette-text-secondary); margin-right: 4px; }
.kw-ins-groupby a { padding: 4px 12px; border-radius: 14px; font-size: .8rem; font-weight: 600; text-decoration: none; color: var(--mud-palette-text-secondary); border: 1px solid var(--mud-palette-lines-default); }
.kw-ins-groupby a.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
.kw-ins-slice { display: flex; flex-wrap: wrap; gap: 18px; padding: 12px 16px; margin-bottom: 12px; border-radius: 12px; background: rgba(124,58,237,.05); border: 1px solid rgba(124,58,237,.2); }
.kw-ins-slice > div { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
.kw-ins-slice small { font-size: .7rem; text-transform: uppercase; color: var(--mud-palette-text-secondary); font-weight: 600; }
.kw-ins-slice em { font-style: normal; font-size: .72rem; color: var(--mud-palette-text-secondary); }

.kw-ins-comments { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.kw-ins-quote { padding: 10px 12px; border-radius: 10px; background: var(--mud-palette-background-gray); border-left: 4px solid #94a3b8; }
.kw-ins-quote.above { border-left-color: #16A34A; }
.kw-ins-quote.on { border-left-color: #EAB308; }
.kw-ins-quote.below { border-left-color: #DC2626; }
.kw-ins-quote small { font-size: .72rem; color: var(--mud-palette-text-secondary); }
.kw-ins-quote p { margin: 4px 0 0; font-size: .85rem; }

.kw-ins-reports { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kw-ins-report { display: flex; gap: 14px; padding: 16px; border-radius: 14px; background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); }
.kw-ins-report > .mud-icon-root { color: #7c3aed; font-size: 2rem; flex: 0 0 auto; }
.kw-ins-report h3 { margin: 0 0 4px; font-size: 1rem; }
.kw-ins-report p { margin: 0; font-size: .85rem; color: var(--mud-palette-text-secondary); }

@media (max-width: 600px) {
  .kw-ins-row { grid-template-columns: minmax(0, 1fr) 120px; }
  .kw-ins-row > :nth-child(2):not(:last-child) { display: none; }
  .kw-ins-quarter-bar { height: 80px; width: 30px; }
}

/* National populate wizard: the SP target cell, cascaded from the strategic plan (read-only). */
.kw-grid-sp { color: var(--mud-palette-text-secondary); font-weight: 600; background: var(--mud-palette-background-gray); }

/* Grid: rephrase action beside an HQ/county indicator. */
.kw-grid-rephrase { border: 0; background: transparent; padding: 0 2px; margin-left: 4px; cursor: pointer; color: var(--mud-palette-primary); opacity: .55; vertical-align: middle; }
.kw-grid-rephrase:hover { opacity: 1; }

/* Current strategic plan strip (work-plan and progress pages). */
.kw-current-sp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 14px; border-radius: 10px; background: rgba(20,184,166,.08); border: 1px solid rgba(20,184,166,.3); font-size: .85rem; }
.kw-current-sp .mud-icon-root { color: #14b8a6; }
.kw-current-sp-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--mud-palette-text-secondary); }
.kw-current-sp a { font-weight: 700; color: var(--mud-palette-text-primary); text-decoration: none; }
.kw-current-sp a:hover { text-decoration: underline; }
.kw-current-sp-period { padding: 1px 8px; border-radius: 10px; background: rgba(20,184,166,.15); color: #0f766e; font-weight: 600; font-size: .75rem; }
.kw-current-sp-note { color: var(--mud-palette-text-secondary); font-size: .8rem; }
/* Fiscal-year picker at the end of the strip (CurrentStrategicPlanBanner ShowFiscalYear). */
.kw-current-fy { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.kw-current-fy-select { min-width: 170px; margin: 0 !important; }
.kw-current-fy-select .mud-input-outlined { background: var(--mud-palette-surface); }

/* HQ department focus line under the current-strategic-plan strip. */
.kw-current-focus { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: -6px 0 12px; padding: 8px 14px; border-radius: 10px; background: rgba(6,182,212,.07); border: 1px solid rgba(6,182,212,.28); font-size: .85rem; }
.kw-current-focus > .mud-icon-root { color: #0891b2; }
.kw-current-focus-sos { margin-left: 8px; }
/* A mapped objective the department only views (SoProgressRole.ViewOnly) — another department submits it. */
.kw-current-focus-so.is-viewonly { background: transparent; border: 1px dashed rgba(14,116,144,.45); color: #64748b; font-weight: 600; }
/* SO Mappings: a mapping's progress role in the matrix, and the view-only chips (SoProgressRole). */
.kw-som-role { display: inline-block; width: 14px; margin-left: 2px; font-size: .78rem; font-weight: 700; vertical-align: middle; }
.kw-som-role--primary { color: #b45309; }
.kw-som-role--submits { color: #0f766e; }
.kw-som-role--viewonly { color: #94a3b8; }
.kw-som-sub td { vertical-align: middle; }
.kw-som-chip { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 10px; border: 1px dashed #94a3b8; color: #64748b; font-size: .75rem; font-weight: 600; }
.kw-grid-notcum { flex: none; align-self: center; margin-left: 4px; padding: 0 6px; border-radius: 8px; border: 1px solid #c4b5fd; color: #6d28d9; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; cursor: help; }
.kw-current-focus-so { display: inline-block; padding: 1px 9px; border-radius: 10px; background: rgba(6,182,212,.16); color: #0e7490; font-weight: 700; font-size: .75rem; cursor: default; }
.kw-current-focus-none { color: var(--mud-palette-text-secondary); font-size: .8rem; }
.kw-ins-table th.kw-sp-current { background: rgba(13,148,136,.14); }
.kw-ins-table td.kw-sp-parent { color: var(--mud-palette-text-secondary); font-size: .8rem; max-width: 200px; vertical-align: top; }
.kw-ins-table tr.kw-sp-newstrategy td { border-top: 2px solid var(--mud-palette-lines-default); }
.kw-ins-table td.kw-sp-merged { border-bottom: 1px solid var(--mud-palette-lines-default); border-right: 1px solid var(--mud-palette-lines-default); }

/* Strategic plan scorecard cells and their tooltip */
.kw-sp-cell { display: flex; flex-direction: column; gap: 2px; cursor: help; }
.kw-sp-k { font-size: .72rem; color: var(--mud-palette-text-secondary); }
.kw-sp-tip { max-width: 380px; font-size: .78rem; line-height: 1.35; padding: 2px; text-align: left; white-space: normal; }
.kw-sp-tip-h { font-weight: 700; font-size: .82rem; margin-bottom: 4px; }
.kw-sp-tip-s { margin-top: 8px; margin-bottom: 2px; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; opacity: .75; }
.kw-sp-tip-r { display: flex; justify-content: space-between; gap: 14px; }
.kw-sp-tip-r b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.kw-sp-tip-n { opacity: .85; margin-top: 2px; }
.kw-sp-tip-w { margin-top: 6px; padding: 4px 6px; border-radius: 4px; background: rgba(245, 158, 11, .22); }

/* ── ChunkedFileInput: chunked, resumable uploads ── */
.kw-up { display: flex; flex-direction: column; gap: 8px; border-radius: 12px; transition: background .15s ease, box-shadow .15s ease; }
.kw-up-input { display: none; }
.kw-up.kw-up-drop { background: rgba(37, 99, 235, 0.06); box-shadow: 0 0 0 2px #93c5fd inset; }
.kw-up.is-disabled { opacity: 0.6; }
.kw-up-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kw-up-btn {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 8px; border: 1px solid #cbd5e1;
    background: #fff; color: #0f172a; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.kw-up-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #94a3b8; }
.kw-up-btn:disabled { cursor: not-allowed; }
.kw-up-btn:focus-visible, .kw-up-x:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.kw-up-hint { font-size: 0.76rem; color: var(--kw-text-secondary, #64748b); }
.kw-up-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
    border: 1px solid var(--kw-border, #e2e8f0); background: var(--kw-surface, #fff);
}
.kw-up-row-ic { color: #2563eb; flex: 0 0 auto; }
.kw-up-row--ready .kw-up-row-ic { color: #16a34a; }
.kw-up-row--failed { border-color: #fecaca; background: #fef2f2; }
.kw-up-row--failed .kw-up-row-ic { color: #dc2626; }
.kw-up-row-main { flex: 1; min-width: 0; }
.kw-up-row-name { font-size: 0.85rem; font-weight: 600; color: var(--kw-text-primary, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-up-row-meta { font-size: 0.72rem; color: var(--kw-text-secondary, #64748b); font-variant-numeric: tabular-nums; }
.kw-up-row-err { color: #b91c1c; }
.kw-up-bar { height: 5px; margin: 5px 0 3px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.kw-up-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: inherit; transition: width .25s ease; }
.kw-up-x {
    flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px; border: none; background: transparent;
    color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.kw-up-x:hover:not(:disabled) { background: rgba(100, 116, 139, 0.12); color: #0f172a; }
.kw-up--compact .kw-up-row { padding: 6px 8px; }
.kw-dark .kw-up-btn { background: var(--kw-surface-raised); color: var(--kw-text-primary); border-color: var(--kw-border); }
.kw-dark .kw-up-row--failed { background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.35); }
.kw-dark .kw-up-bar { background: rgba(148, 163, 184, 0.25); }
@media (prefers-reduced-motion: reduce) { .kw-up-bar > i { transition: none; } }
/* The Resource Center picker sits inside its uploader, so a dropped file lands on the picker. */
.kw-doc-uploader { margin-bottom: 20px; }
.kw-doc-uploader > .kw-doc-filepick { margin-bottom: 0; }
.kw-doc-uploader.kw-up-drop > .kw-doc-filepick { border-color: #3b82f6; background: rgba(59, 130, 246, 0.06); }
.kw-up-row-extra { margin-top: 4px; }
/* Investment draft wizard: the drop zone lives inside its chunked uploader. */
.kw-draft-uploader .kw-drop { cursor: pointer; }
.kw-draft-uploader.kw-up-drop .kw-drop { border-color: var(--kw-wiz-accent); transform: scale(1.005); }
.kw-draft-uploader.kw-up-drop .kw-drop-icon { filter: brightness(.85); }

/* ── Bulk county bulletins (/documents/bulletins/bulk) ── */
.kw-bb { display: flex; flex-direction: column; gap: 18px; }
.kw-bb-suggest { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: #ecfdf5; color: #065f46; font-size: 0.85rem; }
.kw-bb-zone { margin-bottom: 14px; }
.kw-bb-drop {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center;
    min-height: 120px; padding: 18px; border: 2px dashed var(--ui-line, #cbd5e1); border-radius: 14px; cursor: pointer;
    background: var(--ui-bg, #f8fafc); color: var(--ui-ink-2, #334155); transition: border-color .15s ease, background .15s ease;
}
.kw-bb-drop:hover, .kw-bb-zone.kw-up-drop .kw-bb-drop { border-color: #3b82f6; background: rgba(59, 130, 246, 0.06); }
.kw-bb-zone.is-disabled .kw-bb-drop { cursor: not-allowed; }
.kw-bb-drop-title { font-weight: 600; }
.kw-bb-drop-sub { font-size: 0.78rem; color: var(--ui-ink-3, #64748b); }
.kw-bb-tally { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.kw-bb-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; background: #f1f5f9; color: #334155; }
.kw-bb-pill--ok { background: #dcfce7; color: #166534; }
.kw-bb-pill--warn { background: #fef3c7; color: #92400e; }
.kw-bb-pill--bad { background: #fee2e2; color: #991b1b; }
.kw-bb-pill--busy { background: #dbeafe; color: #1e40af; }
.kw-bb-tablewrap { overflow-x: auto; border: 1px solid var(--ui-line, #e2e8f0); border-radius: 12px; }
.kw-bb-table td { vertical-align: top; }
.kw-bb-table .mud-input-control { margin-top: 0; }
.kw-bb-row--attn td { background: rgba(245, 158, 11, 0.06); }
.kw-bb-row--done td { background: rgba(22, 163, 74, 0.05); }
.kw-bb-file { max-width: 260px; font-weight: 600; font-size: 0.84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-bb-meta { font-size: 0.72rem; color: var(--ui-ink-3, #64748b); margin-top: 2px; }
.kw-bb-match { font-size: 0.71rem; margin-top: 3px; }
.kw-bb-match--exact { color: #15803d; }
.kw-bb-match--probable { color: #b45309; font-weight: 600; }
.kw-bb-match--none { color: #b91c1c; font-weight: 600; }
.kw-bb-match--hand { color: var(--ui-ink-3, #64748b); }
.kw-bb-status { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; }
.kw-bb-ok { color: #15803d; }
.kw-bb-warn { color: #b45309; }
.kw-bb-bad { color: #b91c1c; }
.kw-bb-link { margin-left: 8px; font-size: 0.78rem; color: #2563eb; }
.kw-bb-blockers { margin: 0 0 10px; padding-left: 20px; color: #92400e; font-size: 0.86rem; }
.kw-bb-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.kw-bb-summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: #f0fdf4; font-size: 0.88rem; }
.kw-dark .kw-bb-suggest { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.kw-dark .kw-bb-summary { background: rgba(22, 163, 74, 0.12); }
.kw-dark .kw-bb-pill { background: rgba(148, 163, 184, 0.18); color: var(--kw-text-primary); }
.kw-bb-confirm {
    margin-left: 6px; padding: 1px 9px; border-radius: 999px; border: 1px solid #f59e0b; background: #fffbeb; color: #92400e;
    font: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer;
}
.kw-bb-confirm:hover:not(:disabled) { background: #fef3c7; }
.kw-bb-confirm:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }

/* ══════════════════════════════════════════════════════════════════════
   Progress capture — earlier quarters beside the one being captured.
   Row quarter trail (.kw-qt), last quarter beside the box (.kw-prog-prev),
   last quarter's comment (.kw-prog-echo), the quarter-by-quarter timeline
   under a row (.kw-qh), and each objective's earlier-quarters ribbon (.kw-eq).
   ══════════════════════════════════════════════════════════════════════ */
.kw-prog-histswitch { margin-right: 4px; }
.kw-prog-histswitch .mud-switch-label, .kw-prog-histswitch .mud-typography { font-size: 0.82rem; }

/* ── row trail ── */
.kw-prog-trailcell { min-width: 182px; width: 200px; }
.kw-qt {
    display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 6px 8px; margin: -6px -8px;
    border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; font: inherit;
    text-align: left; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.kw-qt:hover, .kw-qt.open { background: #f0fdf4; border-color: #bbf7d0; }
.kw-qt:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(16,185,129,.3); }
.kw-qt-bars { display: flex; align-items: flex-end; gap: 7px; }
.kw-qt-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.kw-qt-track {
    position: relative; display: block; width: 24px; height: 42px; border-radius: 6px;
    background: #f1f5f9;
}
.kw-qt-fill {
    position: absolute; left: 0; right: 0; bottom: 0; display: block; border-radius: 6px 6px 3px 3px;
    background: linear-gradient(180deg, #cbd5e1, #94a3b8);
    transition: height .35s cubic-bezier(.2,.8,.2,1);
}
.kw-qt-slot.above .kw-qt-fill { background: linear-gradient(180deg, #4ade80, #16a34a); }
.kw-qt-slot.on .kw-qt-fill { background: linear-gradient(180deg, #fde047, #ca8a04); }
.kw-qt-slot.below .kw-qt-fill { background: linear-gradient(180deg, #fca5a5, #dc2626); }
.kw-qt-target {
    position: absolute; left: -3px; right: -3px; height: 2px; display: block; z-index: 1;
    background: #0f172a; opacity: .55; border-radius: 2px;
}
.kw-qt-slot.current .kw-qt-track { background: #ecfdf5; box-shadow: 0 0 0 2px #10b981; }
.kw-qt-slot.future .kw-qt-track { background: transparent; border: 1px dashed #cbd5e1; }
.kw-qt-slot.future .kw-qt-target { opacity: .3; }
.kw-qt-empty {
    position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: .8rem;
    color: #10b981; animation: kw-qt-blink 1.6s ease-in-out infinite;
}
@keyframes kw-qt-blink { 50% { opacity: .35; } }
.kw-qt-lab { font-size: .6rem; font-weight: 700; color: var(--kw-text-muted, #94a3b8); letter-spacing: .02em; }
.kw-qt-slot.current .kw-qt-lab { color: #047857; }
.kw-qt-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .74rem; }
.kw-qt-ytd { font-weight: 600; color: var(--kw-text-secondary, #475569); white-space: nowrap; }
.kw-qt-pace {
    display: inline-block; border-radius: 99px; padding: 1px 7px; font-size: .62rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.kw-qt-pace.above { background: #C6EFCE; color: #006100; }
.kw-qt-pace.on { background: #FFEB9C; color: #9C5700; }
.kw-qt-pace.below { background: #FFC7CE; color: #9C0006; }
.kw-qt-more { font-size: .64rem; font-weight: 700; color: #047857; opacity: 0; transition: opacity .15s ease; white-space: nowrap; }
.kw-qt:hover .kw-qt-more, .kw-qt.open .kw-qt-more, .kw-qt:focus-visible .kw-qt-more { opacity: 1; }

/* ── last quarter beside the box, and its comment above the comment box ── */
.kw-prog-prev { font-size: .7rem; color: var(--kw-text-muted, #64748b); white-space: nowrap; text-align: right; }
.kw-prog-prev span {
    font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-right: 2px;
    color: #6366f1;
}
.kw-prog-prev b { margin-left: 4px; font-weight: 800; }
.kw-prog-prev b.up { color: #059669; }
.kw-prog-prev b.down { color: #dc2626; }
.kw-prog-prev b.flat { color: var(--kw-text-muted, #64748b); }
.kw-prog-echo {
    font-size: .74rem; color: #3730a3; background: #eef2ff; border-radius: 6px; padding: 4px 8px; margin-bottom: 6px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kw-prog-echo span {
    display: inline-block; font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: #6366f1; margin-right: 4px;
}

/* ── quarter-by-quarter timeline under a row ── */
.kw-prog-table tr.kw-qh-row > td {
    padding: 2px 12px 16px; background: linear-gradient(180deg, #f8fafc 0%, rgba(248,250,252,0) 100%);
}
.kw-qh {
    position: relative; display: grid; gap: 10px;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) minmax(230px, 1.35fr);
}
/* the thread that ties the quarters together */
.kw-qh::before {
    content: ""; position: absolute; top: 24px; left: 16px; right: 16px; height: 2px;
    background: linear-gradient(90deg, #a7f3d0, #e2e8f0 70%); z-index: 0;
}
.kw-qh-card {
    position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0;
    padding: 10px 12px; border-radius: 12px; border: 1px solid #e2e8f0; border-top-width: 3px;
    background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.05);
    animation: kw-qh-in .28s cubic-bezier(.2,.8,.2,1) both;
}
.kw-qh-card:nth-child(2) { animation-delay: .04s; }
.kw-qh-card:nth-child(3) { animation-delay: .08s; }
.kw-qh-card:nth-child(4) { animation-delay: .12s; }
.kw-qh-card:nth-child(5) { animation-delay: .16s; }
@keyframes kw-qh-in { from { opacity: 0; transform: translateY(6px); } }
.kw-qh-card.above { border-top-color: #16A34A; }
.kw-qh-card.on { border-top-color: #EAB308; }
.kw-qh-card.below { border-top-color: #DC2626; }
.kw-qh-card.neutral { border-top-color: #94a3b8; }
.kw-qh-card.current { border-color: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.16); }
.kw-qh-card.future {
    background: repeating-linear-gradient(135deg, #fafbfc 0 8px, #f4f6f9 8px 16px);
    border-style: dashed; border-top-style: dashed; box-shadow: none;
}
.kw-qh-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kw-qh-head strong { font-size: 1rem; font-weight: 800; }
.kw-qh-months { font-size: .7rem; color: var(--kw-text-muted, #94a3b8); }
.kw-qh-head .kw-prog-q-status, .kw-qh-head .kw-qt-pace, .kw-qh-tag { margin-left: auto; }
.kw-qh-tag {
    font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
    padding: 1px 7px; border-radius: 99px; background: #f1f5f9; color: var(--kw-text-muted, #64748b);
}
.kw-qh-tag.now { background: #d1fae5; color: #047857; }
.kw-qh-fig { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; }
.kw-qh-fig b { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kw-qh-fig span { font-size: .76rem; color: var(--kw-text-muted, #64748b); }
.kw-qh-fig em { font-style: normal; margin-left: auto; min-width: 0; }
.kw-qh-meter { height: 5px; border-radius: 99px; background: #f1f5f9; overflow: hidden; }
.kw-qh-meter span { display: block; height: 100%; border-radius: 99px; background: #94a3b8; transition: width .35s ease; }
.kw-qh-card.above .kw-qh-meter span { background: #16A34A; }
.kw-qh-card.on .kw-qh-meter span { background: #EAB308; }
.kw-qh-card.below .kw-qh-meter span { background: #DC2626; }
.kw-qh-delta { font-size: .72rem; font-weight: 700; }
.kw-qh-delta.up { color: #059669; }
.kw-qh-delta.down { color: #dc2626; }
.kw-qh-delta.flat { color: var(--kw-text-muted, #94a3b8); font-weight: 600; }
.kw-qh-planned { font-size: .8rem; color: var(--kw-text-muted, #64748b); }
.kw-qh-planned b { font-size: 1.1rem; color: var(--kw-text-primary, #1e293b); }
.kw-qh-quote {
    margin: 0; padding: 6px 8px; border-left: 3px solid #a5b4fc; border-radius: 0 6px 6px 0;
    background: #f5f7ff; color: #334155; font-size: .76rem; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.kw-qh-none { font-size: .72rem; font-style: italic; color: var(--kw-text-muted, #94a3b8); }
.kw-qh-plan, .kw-qh-review { font-size: .7rem; color: var(--kw-text-secondary, #64748b); line-height: 1.35; }
.kw-qh-plan span, .kw-qh-review span {
    font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; margin-right: 3px;
}
.kw-qh-plan span { color: #0e7490; }
.kw-qh-review span { color: #4338ca; }

/* the year as a whole */
.kw-qh-card.kw-qh-outlook {
    border: 0; color: #ecfdf5; box-shadow: 0 8px 24px rgba(6,78,59,.22);
    background: radial-gradient(120% 140% at 100% 0%, #10b981 0%, #047857 45%, #064e3b 100%);
}
.kw-qh-outlook .kw-qh-fig span, .kw-qh-outlook .kw-qh-none { color: rgba(236,253,245,.78); }
.kw-qh-yearbar { position: relative; height: 8px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 4px 0 2px; }
.kw-qh-yearbar .done { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; transition: width .35s ease; }
.kw-qh-yearbar .done.above { background: #86efac; }
.kw-qh-yearbar .done.on { background: #fde047; }
.kw-qh-yearbar .done.below { background: #fca5a5; }
.kw-qh-yearbar i {
    position: absolute; top: -4px; width: 2px; height: 16px; margin-left: -1px; border-radius: 2px;
    background: #fff; box-shadow: 0 0 0 2px rgba(6,78,59,.35);
}
.kw-qh-facts { display: flex; justify-content: space-between; gap: 8px; font-size: .72rem; color: rgba(236,253,245,.85); }
.kw-qh-proj { font-size: .78rem; line-height: 1.35; }
.kw-qh-asof { font-size: .64rem; font-weight: 700; color: rgba(236,253,245,.75); }
.kw-qh-method { margin-top: auto; font-size: .64rem; color: rgba(236,253,245,.65); }

@media (max-width: 1200px) {
    .kw-qh { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kw-qh::before { display: none; }
    .kw-qh-outlook { grid-column: 1 / -1; }
}
@media (max-width: 640px) { .kw-qh { grid-template-columns: 1fr; } }

/* ── each objective's earlier quarters ── */
.kw-eq {
    display: flex; align-items: stretch; gap: 10px; padding: 10px 14px; overflow-x: auto;
    background: #fbfdfc; border-bottom: 1px solid #f1f5f9;
}
.kw-eq-label {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 60px;
    font-size: .6rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; line-height: 1.2;
    text-align: center; color: var(--kw-text-muted, #94a3b8);
}
.kw-eq-card {
    flex: 0 1 300px; min-width: 230px; display: flex; flex-direction: column; gap: 5px; padding: 8px 10px;
    border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: inherit; font: inherit; text-align: left;
    cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.kw-eq-card { align-items: stretch; justify-content: flex-start; }
.kw-eq-card > span { display: flex; width: 100%; text-align: left; }
.kw-eq-card > .kw-eq-meta, .kw-eq-card > .kw-eq-note { display: block; }
.kw-eq-card > .kw-eq-note { display: -webkit-box; }
.kw-eq-card:hover { border-color: #10b981; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,.08); }
.kw-eq-card:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(16,185,129,.3); }
.kw-eq-top { display: flex; align-items: center; gap: 6px; }
.kw-eq-top small { font-size: .68rem; color: var(--kw-text-muted, #94a3b8); }
.kw-eq-top .kw-prog-q-status { margin-left: auto; }
.kw-eq-bands { display: flex; gap: 1px; height: 6px; border-radius: 99px; overflow: hidden; background: #f1f5f9; }
.kw-eq-bands .above { background: #16A34A; }
.kw-eq-bands .on { background: #EAB308; }
.kw-eq-bands .below { background: #DC2626; }
.kw-eq-bands .none { background: #e2e8f0; }
.kw-eq-meta { font-size: .7rem; color: var(--kw-text-muted, #64748b); }
.kw-eq-meta b.above { color: #16a34a; }
.kw-eq-meta b.on { color: #ca8a04; }
.kw-eq-meta b.below { color: #dc2626; }
.kw-eq-note {
    font-size: .72rem; font-style: italic; color: #3730a3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* dark theme */
.kw-dark .kw-qt:hover, .kw-dark .kw-qt.open { background: rgba(16,185,129,.10); border-color: rgba(16,185,129,.3); }
.kw-dark .kw-qt-track { background: rgba(148,163,184,.16); }
.kw-dark .kw-qt-slot.current .kw-qt-track { background: rgba(16,185,129,.14); }
.kw-dark .kw-qt-slot.future .kw-qt-track { background: transparent; border-color: rgba(148,163,184,.35); }
.kw-dark .kw-qt-target { background: #e2e8f0; }
.kw-dark .kw-qt-slot.current .kw-qt-lab, .kw-dark .kw-qt-more { color: #6ee7b7; }
.kw-dark .kw-prog-echo { background: rgba(99,102,241,.16); color: #c7d2fe; }
.kw-dark .kw-prog-table tr.kw-qh-row > td { background: rgba(148,163,184,.05); }
.kw-dark .kw-qh::before { background: linear-gradient(90deg, rgba(16,185,129,.45), rgba(148,163,184,.2) 70%); }
.kw-dark .kw-qh-card { background: var(--mud-palette-surface, #1e293b); border-color: rgba(148,163,184,.22); box-shadow: none; }
.kw-dark .kw-qh-card.above { border-top-color: #16A34A; }
.kw-dark .kw-qh-card.on { border-top-color: #EAB308; }
.kw-dark .kw-qh-card.below { border-top-color: #DC2626; }
.kw-dark .kw-qh-card.current { border-color: #10b981; }
/* opaque base under the stripes, so the timeline thread does not show through */
.kw-dark .kw-qh-card.future {
    background-color: var(--mud-palette-surface, #1e293b);
    background-image: repeating-linear-gradient(135deg, rgba(148,163,184,.05) 0 8px, rgba(148,163,184,.10) 8px 16px);
}
.kw-dark .kw-qh-card.kw-qh-outlook {
    border: 0; box-shadow: 0 8px 24px rgba(0,0,0,.35);
    background: radial-gradient(120% 140% at 100% 0%, #10b981 0%, #047857 45%, #064e3b 100%);
}
.kw-dark .kw-prog-table tr.kw-qh-row > td { border-color: rgba(148,163,184,.15); }
.kw-dark .kw-eq-bands .none { background: rgba(148,163,184,.28); }
.kw-dark .kw-qh-meter, .kw-dark .kw-eq-bands { background: rgba(148,163,184,.18); }
.kw-dark .kw-qh-quote { background: rgba(99,102,241,.14); color: #e2e8f0; }
.kw-dark .kw-qh-tag { background: rgba(148,163,184,.18); }
.kw-dark .kw-qh-tag.now { background: rgba(16,185,129,.2); color: #6ee7b7; }
.kw-dark .kw-qh-planned b { color: #e2e8f0; }
.kw-dark .kw-eq { background: rgba(148,163,184,.05); border-color: rgba(148,163,184,.15); }
.kw-dark .kw-eq-card { background: var(--mud-palette-surface, #1e293b); border-color: rgba(148,163,184,.22); }
.kw-dark .kw-eq-note, .kw-dark .kw-qh-review span { color: #a5b4fc; }

@media (prefers-reduced-motion: reduce) {
    .kw-qh-card, .kw-qt-empty { animation: none; }
    .kw-qt-fill, .kw-qh-meter span, .kw-qh-yearbar .done, .kw-eq-card { transition: none; }
}

/* ── Approver notes: what approvers said, made hard to miss for the submitter ── */
.kw-appr-notes { margin-bottom: 16px; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px solid #e2e8f0; }
.kw-appr-notes-title { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: .9rem; color: #0f172a; margin-bottom: 8px; }
.kw-appr-notes .kw-appr-note + .kw-appr-note { margin-top: 8px; }
.kw-appr-note {
    margin-top: 6px; padding: 8px 12px; border-radius: 8px; border-left: 4px solid #3b82f6; background: #eff6ff; color: #1e293b;
}
.kw-appr-note.returned { border-left-color: #f59e0b; background: #fffbeb; }
.kw-appr-note.rejected { border-left-color: #ef4444; background: #fef2f2; }
.kw-appr-note-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .78rem; color: #475569; }
.kw-appr-note-head strong { color: #0f172a; }
.kw-appr-note-text { margin-top: 3px; font-size: .9rem; line-height: 1.45; color: #0f172a; white-space: pre-wrap; }
.kw-appr-note-cta { margin-top: 6px; font-size: .78rem; font-weight: 700; color: #92400e; }
.kw-timeline-comments { font-size: .88rem !important; color: #0f172a !important; border-left: 3px solid #3b82f6; }
.kw-timeline-returned .kw-timeline-comments { border-left-color: #f59e0b; background: #fffbeb !important; }
.kw-timeline-rejected .kw-timeline-comments { border-left-color: #ef4444; background: #fef2f2 !important; }
.kw-dark .kw-appr-notes { background: rgba(148,163,184,.08); border-color: rgba(148,163,184,.2); }
.kw-dark .kw-appr-notes-title, .kw-dark .kw-appr-note-head strong, .kw-dark .kw-appr-note-text { color: #e2e8f0; }
.kw-dark .kw-appr-note { background: rgba(59,130,246,.14); color: #e2e8f0; }
.kw-dark .kw-appr-note.returned { background: rgba(245,158,11,.14); }
.kw-dark .kw-appr-note.rejected { background: rgba(239,68,68,.14); }
.kw-dark .kw-appr-note-head { color: #cbd5e1; }
.kw-dark .kw-appr-note-cta { color: #fcd34d; }
.kw-dark .kw-timeline-comments { color: #e2e8f0 !important; }

/* ── Work-plan grid (NDMA layout): Strategy · Key Activity scroll away, Activity › Output › Indicator stay frozen ── */
.kw-grid.kw-wpg .kw-wpg-st,
.kw-grid.kw-wpg .kw-wpg-ka { min-width: 140px; max-width: 170px; white-space: normal; font-size: 0.74rem; color: var(--mud-palette-text-secondary); vertical-align: top; }
.kw-grid.kw-wpg .kw-grid-c2 { left: 0; white-space: normal; vertical-align: top; }
.kw-grid.kw-wpg .kw-grid-c3 { left: 170px; white-space: normal; vertical-align: top; }
.kw-grid.kw-wpg .kw-grid-c4 { left: 320px; white-space: normal; vertical-align: top; }
.kw-grid.kw-wpg td.kw-grid-c2, .kw-grid.kw-wpg td.kw-grid-c3, .kw-grid.kw-wpg td.kw-grid-c4 { background: var(--mud-palette-surface, #fff); }
.kw-grid.kw-wpg td.kw-grid-fixed { color: var(--mud-palette-text-secondary); background: var(--mud-palette-background-gray, #f8fafc); }
.kw-grid-uom { font-size: 0.68rem; color: var(--mud-palette-text-secondary); font-weight: 400; }
.kw-grid-custom { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 7px; font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
                  background: rgba(245, 158, 11, .16); color: #b45309; vertical-align: middle; }
.kw-grid tr.kw-grid-subtotal td { font-weight: 700; background: rgba(6, 182, 212, 0.07); border-top: 1px solid #06b6d4; }
.kw-grid .kw-wpg-total { text-align: left; }

/* The work-plan grid in the colours of NDMA's sample work plans (and of NationalWorkbook /
   WorkPlanNdmaExcel): navy headings on light blue, "Quarterly Targets" in green, the money (Total and
   the source of funds) in light blue, each strategic objective in red on pale blue, sub-totals in light
   blue and the grand total in the title blue. Coloured cells keep dark text in dark mode too. */
.kw-grid.kw-wpg thead th { background: #D9E1F2; color: #000080; font-weight: 700; text-transform: none; letter-spacing: 0;
                           font-size: 0.74rem; text-align: center; vertical-align: middle; border-color: #b4c6e7; }
.kw-grid.kw-wpg thead th.kw-wpg-q { background: #92D050; }
.kw-grid.kw-wpg thead th.kw-wpg-st, .kw-grid.kw-wpg thead th.kw-wpg-ka, .kw-grid.kw-wpg thead th.kw-grid-c2,
.kw-grid.kw-wpg thead th.kw-grid-c3, .kw-grid.kw-wpg thead th.kw-grid-c4 { color: #000080; font-size: 0.74rem; vertical-align: middle; }
.kw-grid.kw-wpg thead tr:first-child th:not([rowspan]) { height: 26px; box-sizing: border-box; }
.kw-grid.kw-wpg thead tr:nth-child(2) th { top: 26px; }
.kw-grid.kw-wpg td.kw-wpg-q { background: #92D050; color: #000; }
.kw-grid.kw-wpg td.kw-wpg-funds { background: #D9E1F2; color: #000; }
.kw-grid.kw-wpg td.kw-wpg-q .kw-grid-input:hover,
.kw-grid.kw-wpg td.kw-wpg-funds .kw-grid-input:hover { border-color: rgba(0, 0, 128, .35); }
.kw-grid.kw-wpg tr.kw-grid-group td { background: #EAF1FF; border-top: 1px solid #8ea9db; }
.kw-grid.kw-wpg .kw-grid-group-label { color: #FF0000; }
.kw-grid.kw-wpg tr.kw-grid-subtotal td { background: #D9E1F2; color: #000080; border-top: 1px solid #8ea9db; }
.kw-grid.kw-wpg tfoot tr.kw-wpg-grand td { background: #4472C4; color: #fff; }
/* County "Add activity or indicator" picker. */
.kw-cadd-act { border-bottom: 1px solid var(--mud-palette-lines-default, #e2e8f0); padding: 6px 0; }
.kw-cadd-so { display: block; font-size: 0.7rem; color: #b91c1c; font-weight: 700; }
.kw-cadd-out { margin-left: 34px; font-size: 0.78rem; color: var(--mud-palette-text-secondary); font-style: italic; }
.kw-cadd-ind { margin-left: 30px; font-size: 0.82rem; }
.kw-cadd-meta { margin-left: 6px; font-size: 0.72rem; color: var(--mud-palette-text-secondary); }
/* Activity notes: a fixed-width box that wraps and scrolls, so a long note never stretches the grid. */
.kw-grid.kw-wpg th.kw-grid-actnotes-h { min-width: 280px; }
.kw-grid.kw-wpg td.kw-grid-actnotes { min-width: 280px; max-width: 320px; white-space: normal; vertical-align: top; position: relative; }
.kw-grid-actnotes-box { max-height: 7.6em; overflow-y: auto; font-size: 0.72rem; line-height: 1.35; white-space: pre-wrap; word-break: break-word; padding-right: 26px; }
.kw-grid-actnote + .kw-grid-actnote { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--mud-palette-lines-default, #e2e8f0); }
.kw-grid-actnotes-empty { color: var(--mud-palette-text-secondary); font-style: italic; }
/* Budget note dialog: where the line sits */
.kw-bnote-ctx { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .82rem; padding: 10px 12px; border-radius: 8px; background: var(--mud-palette-background-gray, #f5f7fa); }
.kw-bnote-ctx > div { display: contents; }
.kw-bnote-ctx small { color: var(--mud-palette-text-secondary); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
.kw-grid.kw-wpg td.kw-grid-actnotes .mud-icon-button { position: absolute; top: 2px; right: 2px; }

/* The current-strategic-plan strip sits between a page hero and its stat band. The stat band overlaps
   the hero by design (negative top margin); with the strip in between it rode up over the strip and
   squeezed it. Give the strip its own space and let the band follow it normally. */
.kw-current-strip { margin: 16px 0 18px; display: flex; flex-direction: column; gap: 8px; }
.kw-current-strip > * { margin: 0 !important; }
.kw-current-strip + .kw-ui-stats { margin-top: 0; }
/* The tiles tuck up under the page's hero; with a notice between them (a read-only / convert-to-PDF / returned alert on
   a document's page) that lift would put them over the notice instead. */
.mud-alert + .kw-ui-stats { margin-top: 0; }
.kw-ui-hero + .mud-alert { margin-top: 16px; }
.kw-current-strip:empty { display: none; }

/* National edit grid: activity / output / indicator wording edited in place */
.kw-grid-wording { display: flex; gap: 4px; align-items: flex-start; }
.kw-grid-wording-no { font-weight: 600; padding-top: 4px; white-space: nowrap; }
.kw-grid-wording-input { min-height: 40px; resize: vertical; line-height: 1.3; font-family: inherit; white-space: pre-wrap; }

/* ══════════════════════════════════════════════════════════════
   Plan grids — room to work (GridViewBar, WorkPlanGridEditor, StrategicPlanGridEditor)
   Toolbars + grid are sized to fit exactly under the app's header, and clicking into a cell brings the
   whole host into that position (kw-grid.js), so both of the grid's scrollbars are on screen. (The
   toolbars are deliberately not sticky: scrolled past, they would slide over the grid's own header.)
   Full screen pins the same host over the whole window; the row editor docks one row beside the grid.
   ══════════════════════════════════════════════════════════════ */
.kw-gridhost { position: relative; --kw-gridhost-top: calc(var(--kw-header-total, 96px) + 40px); }
.kw-gridhost-head { background: var(--mud-palette-surface, #fff); }
/* Never capped below 300px, so a short window still shows a usable grid; a short plan isn't padded out. */
.kw-gridhost .kw-grid-wrap,
.kw-gridpanel { max-height: max(300px, calc(100vh - var(--kw-gridhost-top) - var(--kw-gridhost-head-h, 92px) - 14px)); }
.kw-gridhost .kw-grid-wrap { overscroll-behavior-x: contain; }
/* Inside a dialog there is no app header to sit under. */
.mud-dialog .kw-gridhost { --kw-gridhost-top: 0px; }
.mud-dialog .kw-gridhost:not(.kw-gridhost-fs) .kw-grid-wrap,
.mud-dialog .kw-gridhost:not(.kw-gridhost-fs) .kw-gridpanel { max-height: 65vh; }
@media (max-width: 900px) {
    .kw-gridhost:not(.kw-gridhost-fs) .kw-grid-wrap { max-height: 72vh; }
}

/* View bar */
.kw-gridbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.kw-gridbar .mud-input-control { margin-top: 0 !important; }
.kw-gridbar-search { flex: 1 1 260px; min-width: 200px; max-width: 360px; }
.kw-gridbar-filter { flex: 0 0 170px; max-width: 190px; }
.kw-gridbar-values { flex: 0 1 220px; min-width: 170px; max-width: 280px; }
.kw-gridbar-values-n { margin-left: 6px; font-size: .72rem; color: var(--mud-palette-text-secondary); }
.kw-gridbar-count { font-size: .75rem; color: var(--mud-palette-text-secondary); white-space: nowrap; }
.kw-gridbar-spacer { flex: 1 1 auto; }
.kw-gridbar-help { color: var(--mud-palette-text-secondary); margin: 0 4px; cursor: help; }

/* Full screen — above the app's own header (1100), below MudBlazor's menus (1200), dialogs, snackbars and tooltips. */
.kw-gridhost.kw-gridhost-fs { position: fixed; inset: 0; z-index: 1150; margin: 0; padding: 10px 14px 12px;
                              display: flex; flex-direction: column; background: var(--mud-palette-surface, #fff); }
.kw-gridhost-fs .kw-gridhost-head { flex: none; }
.kw-gridhost-fs .kw-gridhost-body { flex: 1 1 auto; min-height: 0; align-items: stretch; }
.kw-gridhost-fs .kw-grid-wrap,
.kw-gridhost-fs .kw-gridpanel { max-height: none; height: 100%; min-height: 0; }
html.kw-gridfs, html.kw-gridfs body { overflow: hidden !important; }

/* Grid + row editor side by side; stacked on a narrow screen. */
.kw-gridhost-body { display: flex; gap: 10px; align-items: flex-start; }
.kw-gridhost-body > .kw-grid-wrap { flex: 1 1 auto; min-width: 0; }
@media (max-width: 1100px) {
    .kw-gridhost-body { flex-direction: column; align-items: stretch; }
    .kw-gridhost-body > .kw-gridpanel { flex: none; width: auto; max-height: 50vh; }
    .kw-gridhost-fs .kw-gridhost-body > .kw-grid-wrap { flex: 1 1 0; height: auto; }
    .kw-gridhost-fs .kw-gridhost-body > .kw-gridpanel { height: auto; max-height: 45vh; }
}

/* The objective heading sticks under the header, so you always know which objective a row belongs to;
   click it to fold the objective away. */
.kw-gridhost .kw-grid thead th { z-index: 5; }
.kw-gridhost .kw-grid thead th.kw-grid-c1, .kw-gridhost .kw-grid thead th.kw-grid-c2,
.kw-gridhost .kw-grid thead th.kw-grid-c3, .kw-gridhost .kw-grid thead th.kw-grid-c4 { z-index: 6; }
.kw-gridhost .kw-grid tr.kw-grid-group > td,
.kw-gridhost .kw-grid tr.kw-spgrid-band-obj > td { position: sticky; top: var(--kw-grid-head-h, 52px); z-index: 4; }
button.kw-grid-group-label, button.kw-spgrid-band-toggle {
    border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; padding: 0; text-align: left;
}
button.kw-spgrid-band-toggle { display: inline-flex; align-items: center; gap: 6px; position: sticky; left: 8px; }
.kw-grid-group-label .mud-icon-root:first-child, .kw-spgrid-band-toggle .mud-icon-root:first-child { margin-left: -4px; }
.kw-grid-group-unsaved { font-size: .66rem; font-weight: 700; padding: 0 7px; border-radius: 9px;
                         background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.kw-spgrid-band-count { font-size: .7rem; font-weight: 500; color: #475569; }
.kw-grid tr.kw-grid-group.collapsed > td, .kw-grid tr.kw-spgrid-band-obj.collapsed > td { opacity: .92; }

/* The row being worked on — in the grid and in the row editor. */
.kw-gridhost tr.kw-grid-current > td:not([rowspan]),
.kw-gridhost tr.kw-grid-current > td[rowspan="1"] { box-shadow: inset 0 2px 0 #f59e0b, inset 0 -2px 0 #f59e0b; }
.kw-grid-indcell { display: flex; align-items: flex-start; gap: 2px; }
.kw-grid-indtext { flex: 1 1 auto; min-width: 0; }
.kw-grid-rowopen { flex: none; border: 0; background: transparent; padding: 0; margin: 1px 1px 0 -3px; cursor: pointer;
                   color: #4472C4; opacity: .3; line-height: 0; }
.kw-grid-rowopen .mud-icon-root { font-size: 1rem; }
.kw-gridhost tr:hover .kw-grid-rowopen, .kw-gridhost tr.kw-grid-current .kw-grid-rowopen, .kw-grid-rowopen:focus-visible { opacity: 1; }
/* Merged hierarchy cells (GridSpans): one cell down the rows it heads, as in the Excel downloads. Text sits at
   the top; an indicator-level figure sits in the middle of its lines. */
.kw-grid.kw-wpg td.kw-wpg-merged { vertical-align: top; }
.kw-grid.kw-wpg td.kw-wpg-merged.kw-grid-num { vertical-align: middle; }
.kw-grid.kw-wpg td.kw-wpg-merged:not([rowspan="1"]) { border-bottom: 1px solid var(--mud-palette-lines-default, #e2e8f0); }
.kw-gridhost td:hover .kw-grid-rowopen { opacity: 1; }

/* Long wording no longer makes a row screens tall: a few lines, the whole text on hover and in the row editor. */
.kw-gridhost .kw-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--kw-clamp, 4);
                         line-clamp: var(--kw-clamp, 4); overflow: hidden; white-space: normal; }
.kw-grid-actcell { display: flex; align-items: flex-start; gap: 2px; }
.kw-grid-actcell > .kw-clamp { flex: 1 1 auto; min-width: 0; }

/* Frozen columns sized from variables, so hiding one or going compact moves the next one over. */
.kw-gridhost .kw-grid.kw-wpg .kw-grid-c2 { left: 0; min-width: var(--kw-c2w, 170px); max-width: var(--kw-c2w, 170px); }
.kw-gridhost .kw-grid.kw-wpg .kw-grid-c3 { left: var(--kw-c2w, 170px); min-width: var(--kw-c3w, 150px); max-width: var(--kw-c3w, 150px); }
.kw-gridhost .kw-grid.kw-wpg .kw-grid-c4 { left: calc(var(--kw-c2w, 170px) + var(--kw-c3w, 150px)); min-width: var(--kw-c4w, 170px); max-width: var(--kw-c4w, 170px); }
.kw-gridhost .kw-grid.kw-spgrid .kw-grid-c1 { left: 0; min-width: var(--kw-c1w, 150px); max-width: var(--kw-c1w, 150px); }
.kw-gridhost .kw-grid.kw-spgrid .kw-grid-c2 { left: var(--kw-c1w, 150px); min-width: var(--kw-c2w, 210px); max-width: var(--kw-c2w, 210px); white-space: normal; }

/* Compact rows */
.kw-gridhost-compact .kw-grid { font-size: .74rem; }
.kw-gridhost-compact .kw-grid th, .kw-gridhost-compact .kw-grid td { padding: 1px 4px; }
.kw-gridhost-compact .kw-grid-input { padding: 1px 3px; font-size: .74rem; min-width: 54px; }
.kw-gridhost-compact .kw-grid.kw-wpg .kw-wpg-st, .kw-gridhost-compact .kw-grid.kw-wpg .kw-wpg-ka { min-width: 110px; max-width: 130px; font-size: .7rem; }
.kw-gridhost-compact .kw-grid.kw-wpg th.kw-grid-actnotes-h,
.kw-gridhost-compact .kw-grid.kw-wpg td.kw-grid-actnotes { min-width: 220px; max-width: 240px; }
.kw-gridhost-compact .kw-grid-actnotes-box { max-height: 4.2em; }
.kw-gridhost-compact .kw-grid tr.kw-grid-group td { padding: 3px 8px; }
.kw-gridhost-compact .kw-spgrid-band td { padding-top: 3px !important; padding-bottom: 3px !important; font-size: .76rem !important; }

/* Row editor */
.kw-gridpanel { flex: 0 0 380px; width: 380px; overflow: auto; border: 1px solid var(--kw-line, #e2e8f0); border-radius: 8px;
                background: var(--mud-palette-surface, #fff); font-size: .82rem; box-shadow: 0 6px 18px rgba(15, 23, 42, .08); }
.kw-gridpanel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 4px 6px;
                     background: #4472C4; color: #fff; }
.kw-gridpanel-head .mud-icon-button { color: #fff; }
.kw-gridpanel-head .mud-icon-button.mud-disabled { color: rgba(255, 255, 255, .4); }
.kw-gridpanel-pos { flex: 1; text-align: center; font-weight: 700; font-size: .8rem; line-height: 1.2; }
.kw-gridpanel-pos small { display: block; font-weight: 500; font-size: .68rem; opacity: .85; }
.kw-gridpanel-sec { padding: 8px 12px; border-bottom: 1px solid var(--kw-line, #e2e8f0); }
.kw-gridpanel-crumbs { font-size: .68rem; color: var(--mud-palette-text-secondary); line-height: 1.35; margin-bottom: 4px; }
.kw-gridpanel-so { color: #FF0000; font-weight: 700; font-size: .8rem; line-height: 1.3; }
.kw-gridpanel-ctx { margin: 0; }
.kw-gridpanel-ctx dt { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
                       color: var(--mud-palette-text-secondary); margin-top: 7px; }
.kw-gridpanel-ctx dd { margin: 1px 0 0; line-height: 1.35; white-space: pre-wrap; }
.kw-gridpanel-ctx dd.ind { font-weight: 700; color: #000080; }
.kw-gridpanel-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.kw-gridpanel-meta span { font-size: .68rem; padding: 1px 7px; border-radius: 9px; background: #eef3fc; color: #1f3864; border: 1px solid #b4c6e7; }
.kw-gridpanel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px;
                      font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #000080; }
.kw-gridpanel-title small { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--mud-palette-text-secondary); }
.kw-gridpanel-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.kw-gridpanel-field.wide { grid-column: 1 / -1; }
.kw-gridpanel-field label { display: block; font-size: .7rem; color: var(--mud-palette-text-secondary); margin-bottom: 2px; }
.kw-gridpanel .kw-grid-input { border: 1px solid #cbd5e1; background: #fff; padding: 5px 7px; font-size: .86rem; min-width: 0; }
.kw-gridpanel .kw-grid-input:hover { border-color: #94a3b8; }
.kw-gridpanel-field.q .kw-grid-input { background: #f1f9e8; }
.kw-gridpanel-field.funds .kw-grid-input { background: #f3f6fc; }
.kw-gridpanel .kw-grid-input.kw-grid-dirty { background: var(--kw-amber-100, #fef3c7); border-color: var(--kw-amber-300, #fcd34d); }
.kw-gridpanel-value { padding: 5px 7px; border-radius: 3px; background: var(--mud-palette-background-gray, #f8fafc);
                      border: 1px dashed #cbd5e1; font-weight: 600; min-height: 2em; }
.kw-gridpanel-note { font-size: .7rem; color: var(--mud-palette-text-secondary); margin-top: 2px; }
.kw-gridpanel-warn { display: flex; gap: 6px; align-items: flex-start; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d;
                     border-radius: 6px; padding: 6px 8px; font-size: .76rem; }
.kw-gridpanel-foot { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px; }
.kw-gridpanel-notes .kw-grid-actnote { font-size: .76rem; white-space: pre-wrap; }
.kw-gridpanel-keys { font-size: .68rem; color: var(--mud-palette-text-secondary); padding: 4px 12px 12px; line-height: 1.45; }
.kw-gridpanel-keys kbd { font-family: inherit; font-size: .64rem; padding: 0 4px; border: 1px solid #cbd5e1; border-bottom-width: 2px;
                         border-radius: 3px; background: #f8fafc; color: #334155; }
.kw-gridpanel-empty { padding: 28px 16px; text-align: center; color: var(--mud-palette-text-secondary); }
.kw-gridpanel-years { width: 100%; border-collapse: collapse; }
.kw-gridpanel-years th { font-size: .66rem; font-weight: 700; color: #000080; text-align: left; padding: 3px 4px; background: #D9E1F2; }
.kw-gridpanel-years th.t { background: #92D050; }
.kw-gridpanel-years td { padding: 3px 4px; border-bottom: 1px solid var(--kw-line, #eef2f7); }
.kw-gridpanel-years td.fy { font-weight: 700; white-space: nowrap; font-size: .76rem; }
.kw-gridpanel-years tfoot td { font-weight: 700; background: #D9E1F2; color: #000080; }
.kw-gridpanel-years .kw-grid-input { text-align: right; }

.kw-dark .kw-gridhost-head, .kw-dark .kw-gridhost.kw-gridhost-fs, .kw-dark .kw-gridpanel { background: #1e293b; }
.kw-dark .kw-gridpanel { border-color: rgba(255, 255, 255, .1); }
.kw-dark .kw-gridpanel .kw-grid-input { background: #0f172a; border-color: rgba(255, 255, 255, .16); color: inherit; }
.kw-dark .kw-gridpanel-field.q .kw-grid-input { background: rgba(146, 208, 80, .12); }
.kw-dark .kw-gridpanel-field.funds .kw-grid-input { background: rgba(68, 114, 196, .14); }
.kw-dark .kw-gridpanel-value { background: rgba(148, 163, 184, .1); border-color: rgba(148, 163, 184, .3); }
.kw-dark .kw-gridpanel-ctx dd.ind { color: #c7d7f5; }
.kw-dark .kw-gridpanel-title { color: #c7d7f5; }
.kw-dark .kw-gridpanel-meta span { background: rgba(68, 114, 196, .16); color: #c7d7f5; border-color: rgba(68, 114, 196, .4); }
.kw-dark .kw-gridpanel-warn { background: rgba(245, 158, 11, .12); color: #fcd34d; border-color: rgba(245, 158, 11, .4); }
.kw-dark .kw-gridpanel-keys kbd { background: #0f172a; color: #cbd5e1; border-color: rgba(255, 255, 255, .2); }
.kw-dark .kw-gridpanel-years td { border-color: rgba(255, 255, 255, .07); }

/* ── Balance brought forward: last year's unspent money carried into this year. Orange wherever budget
   lines show — the money cells of the line in the work-plan grids, the Structure tab, the row editor and
   every Excel download (Excel "Orange, Accent 2" #FCE4D6 / #C65911), so it never reads as new money. ── */
.kw-grid.kw-wpg tr.kw-grid-bbf td.kw-wpg-funds,
.kw-grid.kw-wpg tr.kw-grid-bbf td.kw-wpg-bbf { background: #FCE4D6; color: #000; }
.kw-grid.kw-wpg th.kw-wpg-bbf, .kw-grid.kw-wpg td.kw-wpg-bbf { text-align: center; min-width: 58px; }
.kw-grid-bbf-toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
input.kw-grid-bbf-check { width: 16px; height: 16px; accent-color: #C65911; cursor: pointer; margin: 0; }
.kw-grid-bbf-tag { display: inline-block; padding: 0 7px; border-radius: 9px; background: #C65911; color: #fff;
                   font-size: .66rem; font-weight: 700; letter-spacing: .03em; }
.kw-grid-bbf-legend { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; color: #C65911; font-weight: 600; white-space: nowrap; }
.kw-grid-bbf-legend i { display: inline-block; width: 14px; height: 12px; border-radius: 2px; background: #FCE4D6; border: 1px solid #C65911; }
.kw-gridpanel-field.bbf .kw-grid-bbf-toggle { color: #C65911; font-weight: 700; }
.kw-gridpanel .kw-grid-bbf-toggle span { font-size: .84rem; }
.kw-gridpanel.bbf .kw-gridpanel-field.funds .kw-grid-input { background: #FCE4D6; border-color: #e7a77a; }

/* ── Progress capture: activities head their indicators; required comments; the list of lines needing one ── */
.kw-prog-table tr.kw-prog-act-row > td { background: #ecfdf5; border-top: 2px solid #10b981; padding: 7px 10px 6px; }
.kw-prog-table tr.kw-prog-act-row.out > td { background: #f8fafc; border-top: 1px dashed #a7f3d0; padding: 4px 10px; }
.kw-prog-act { display: flex; align-items: baseline; gap: 8px; }
.kw-prog-act-tag { flex: none; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
                   color: #fff; background: #059669; border-radius: 4px; padding: 1px 6px; }
.kw-prog-act-name { font-weight: 700; color: #064e3b; font-size: .9rem; line-height: 1.35; }
.kw-prog-act-out { font-size: .78rem; color: #475569; margin-top: 2px; line-height: 1.35; }
.kw-prog-act-out span { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; margin-right: 4px; }
.kw-dark .kw-prog-table tr.kw-prog-act-row > td { background: rgba(16,185,129,.10); }
.kw-dark .kw-prog-table tr.kw-prog-act-row.out > td { background: rgba(148,163,184,.06); }
.kw-dark .kw-prog-act-name { color: #6ee7b7; }
.kw-dark .kw-prog-act-out { color: #cbd5e1; }

.kw-prog-textarea.required::placeholder { color: #b45309; }
.kw-prog-table tr.needs-comment td { background: #fff7ed; }
.kw-prog-table tr.needs-comment td:first-child { box-shadow: inset 4px 0 0 #ea580c; }
.kw-prog-table tr.needs-comment .kw-prog-textarea { border-color: #ea580c; background: #fff; box-shadow: 0 0 0 2px rgba(234,88,12,.15); }
.kw-prog-need { display: flex; gap: 4px; align-items: flex-start; margin-top: 4px; font-size: .74rem; font-weight: 600; color: #c2410c; line-height: 1.3; }
.kw-dark .kw-prog-table tr.needs-comment td { background: rgba(234,88,12,.10); }
.kw-dark .kw-prog-need { color: #fdba74; }

@keyframes kw-prog-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(234,88,12,0); } 30% { box-shadow: 0 0 0 4px rgba(234,88,12,.55); } }
.kw-prog-pulse { animation: kw-prog-pulse 1s ease-in-out 2; border-radius: 6px; }
tr.kw-prog-pulse > td { animation: kw-prog-pulse-cell 1.1s ease-in-out 2; }
@keyframes kw-prog-pulse-cell { 0%, 100% { filter: none; } 35% { filter: brightness(.9) saturate(1.6); } }

.kw-prog-issues { margin: 0 0 14px; border: 1px solid #fdba74; border-left: 5px solid #ea580c; border-radius: 10px; background: #fff7ed; }
.kw-prog-issues.done { border-color: #86efac; border-left-color: #16a34a; background: #f0fdf4; }
.kw-prog-issues-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: .86rem; color: #7c2d12; }
.kw-prog-issues.done .kw-prog-issues-head { color: #14532d; }
.kw-prog-issues-list { list-style: none; margin: 0; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px;
                       max-height: 340px; overflow-y: auto; counter-reset: issue; }
.kw-prog-issues-list li { counter-increment: issue; }
.kw-prog-issues-list button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
                              text-align: left; border: 1px solid #fed7aa; background: #fff; border-radius: 8px; padding: 7px 10px;
                              cursor: pointer; font: inherit; color: inherit; }
.kw-prog-issues-list button:hover { border-color: #ea580c; background: #fffbf5; }
.kw-prog-issue-where { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .8rem; color: #334155; }
.kw-prog-issue-where::before { content: counter(issue) "."; font-weight: 700; color: #ea580c; }
.kw-prog-issue-where .so { font-weight: 800; color: #b91c1c; }
.kw-prog-issue-where .ind { font-weight: 700; color: #0f172a; }
.kw-prog-issue-why { grid-column: 1; font-size: .76rem; color: #c2410c; }
.kw-prog-issue-go { grid-column: 2; grid-row: 1 / span 2; color: #ea580c; }
.kw-dark .kw-prog-issues { background: rgba(234,88,12,.08); border-color: rgba(234,88,12,.4); }
.kw-dark .kw-prog-issues.done { background: rgba(22,163,74,.08); border-color: rgba(22,163,74,.4); }
.kw-dark .kw-prog-issues-head { color: #fed7aa; }
.kw-dark .kw-prog-issues-list button { background: rgba(15,23,42,.6); border-color: rgba(234,88,12,.35); }
.kw-dark .kw-prog-issue-where { color: #cbd5e1; }
.kw-dark .kw-prog-issue-where .ind { color: #f1f5f9; }

/* Submit dialog: the county's required documents, one slot each. */
.kw-prog-reqdocs { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.kw-prog-reqdoc { border: 1px solid #e2e8f0; border-left: 4px solid #ea580c; border-radius: 8px; padding: 8px 10px; }
.kw-prog-reqdoc.ok { border-left-color: #16a34a; }
.kw-prog-reqdoc-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: .86rem; }
.kw-prog-reqdoc-head .req { font-size: .62rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff;
                            background: #ea580c; border-radius: 4px; padding: 0 5px; }
.kw-prog-reqdoc.ok .kw-prog-reqdoc-head .req { background: #16a34a; }
.kw-prog-reqdoc-help { font-size: .74rem; color: var(--mud-palette-text-secondary); margin: 1px 0 4px; }
.kw-prog-reqdoc-existing { display: flex; align-items: center; gap: 6px; font-size: .8rem; }
.kw-prog-reqdoc-existing.removed { opacity: .5; text-decoration: line-through; }
.kw-prog-doc-kind { font-weight: 700; color: #c2410c; margin-right: 4px; }

/* ══════════════════════════════════════════════════════════════
   Above / On / Below target — the one progress vocabulary (TargetBands). Excel's Good / Neutral / Bad
   cell styles for chips and cells; a stronger shade of each for bars and charts.
   ══════════════════════════════════════════════════════════════ */
:root { --kw-tb-above: #16A34A; --kw-tb-on: #EAB308; --kw-tb-below: #DC2626; --kw-tb-none: #CBD5E1;
        --kw-tb-above-bg: #C6EFCE; --kw-tb-on-bg: #FFEB9C; --kw-tb-below-bg: #FFC7CE;
        --kw-tb-above-ink: #006100; --kw-tb-on-ink: #9C5700; --kw-tb-below-ink: #9C0006; }
.kw-tb { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: .74rem;
         font-weight: 700; line-height: 1.5; white-space: nowrap; }
.kw-tb.sm { padding: 0 8px; font-size: .68rem; }
.kw-tb b { font-weight: 800; }
.kw-tb-above { background: var(--kw-tb-above-bg); color: var(--kw-tb-above-ink); }
.kw-tb-on { background: var(--kw-tb-on-bg); color: var(--kw-tb-on-ink); }
.kw-tb-below { background: var(--kw-tb-below-bg); color: var(--kw-tb-below-ink); }
.kw-tb-none { background: #F1F5F9; color: #64748B; }
/* A table cell or text coloured by band. */
td.kw-tbc-above, .kw-tbc-above { background: var(--kw-tb-above-bg) !important; color: var(--kw-tb-above-ink) !important; }
td.kw-tbc-on, .kw-tbc-on { background: var(--kw-tb-on-bg) !important; color: var(--kw-tb-on-ink) !important; }
td.kw-tbc-below, .kw-tbc-below { background: var(--kw-tb-below-bg) !important; color: var(--kw-tb-below-ink) !important; }
.kw-tbt-above { color: var(--kw-tb-above-ink); } .kw-tbt-on { color: var(--kw-tb-on-ink); } .kw-tbt-below { color: var(--kw-tb-below-ink); }
.kw-dark .kw-tbt-above { color: #86efac; } .kw-dark .kw-tbt-on { color: #fde047; } .kw-dark .kw-tbt-below { color: #fca5a5; }

.kw-tbs { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.kw-tbs-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #F1F5F9; }
.kw-tbs.compact .kw-tbs-bar { height: 8px; }
.kw-tbs-bar span { display: block; height: 100%; }
.kw-tbs-bar .above { background: var(--kw-tb-above); }
.kw-tbs-bar .on { background: var(--kw-tb-on); }
.kw-tbs-bar .below { background: var(--kw-tb-below); }
.kw-tbs-bar .none { background: var(--kw-tb-none); }
.kw-tbs-counts { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .72rem; color: var(--mud-palette-text-secondary); }
.kw-tbs-counts span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.kw-tbs-counts i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.kw-tbs-counts .above i { background: var(--kw-tb-above); } .kw-tbs-counts .on i { background: var(--kw-tb-on); }
.kw-tbs-counts .below i { background: var(--kw-tb-below); } .kw-tbs-counts .none i { background: var(--kw-tb-none); }
.kw-tbl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .74rem; color: var(--mud-palette-text-secondary); }
.kw-tbl-lead { font-weight: 600; }
.kw-tbl-rule { font-size: .7rem; }
/* Three coloured counts in a table cell: ▲ above · = on · ▼ below. */
.kw-tbn { display: inline-flex; gap: 8px; white-space: nowrap; font-size: .76rem; font-variant-numeric: tabular-nums; }
.kw-tbn b { font-weight: 700; }
.kw-tbn .above { color: var(--kw-tb-above-ink); } .kw-tbn .on { color: var(--kw-tb-on-ink); } .kw-tbn .below { color: var(--kw-tb-below-ink); }
.kw-dark .kw-tbn .above { color: #86efac; } .kw-dark .kw-tbn .on { color: #fde047; } .kw-dark .kw-tbn .below { color: #fca5a5; }
.kw-tbn.none { color: var(--mud-palette-text-secondary); }


/* ══════════════════════════════════════════════════════════════
   Progress Tracker and County Summary (Components/Pages/Private/Progress/Tracker) — above / on / below
   target as the focal point, implemented or not beside it.
   ══════════════════════════════════════════════════════════════ */
.kw-trk-hero .kw-ui-hero-sub b { color: #fff; }
.kw-trk-fy { position: relative; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.kw-trk-fy button { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.10); color: #fff; border-radius: 999px;
                    padding: 5px 14px; font-size: .8rem; font-weight: 600; cursor: pointer; transition: background .15s; }
.kw-trk-fy button:hover { background: rgba(255,255,255,.2); }
.kw-trk-fy button.on { background: #fff; color: #0e7490; border-color: #fff; }
.mud-button-root.kw-trk-dl { color: #fff; font-weight: 700; }
.mud-button-root.kw-trk-dl.pdf { background: #b91c1c; }
.mud-button-root.kw-trk-dl.pdf:hover { background: #991b1b; }
.mud-button-root.kw-trk-dl.xlsx { background: #217346; }
.mud-button-root.kw-trk-dl.xlsx:hover { background: #185c37; }
.kw-trk-county-pick { min-width: 220px; background: #fff; border-radius: 8px; }
.kw-trk-context { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 12px; font-size: .8rem; color: var(--ui-ink-2); }
.kw-trk-context span { display: inline-flex; align-items: center; gap: 5px; }

/* headline */
.kw-trk-head { display: grid; grid-template-columns: minmax(250px, 1.4fr) repeat(3, minmax(130px, 1fr)) minmax(260px, 1.5fr); gap: 12px; margin-bottom: 10px; }
@media (max-width: 1100px) { .kw-trk-head { grid-template-columns: repeat(3, 1fr); } .kw-trk-ring-tile, .kw-trk-impl-tile { grid-column: span 3; } }
@media (max-width: 600px) { .kw-trk-head { grid-template-columns: 1fr; } .kw-trk-ring-tile, .kw-trk-impl-tile { grid-column: auto; } }
.kw-trk-ring-tile, .kw-trk-impl-tile, .kw-trk-band { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 16px; padding: 14px 16px; }
.kw-trk-ring-tile { display: flex; align-items: center; gap: 14px; }
.kw-trk-ring { width: 96px; height: 96px; flex: none; transform: rotate(-90deg); }
.kw-trk-ring circle { fill: none; stroke-width: 10; }
.kw-trk-ring .track { stroke: color-mix(in srgb, var(--ui-line) 80%, transparent); }
.kw-trk-ring .fill { stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.kw-trk-ring text { transform: rotate(90deg); transform-origin: 50% 50%; font: 800 20px 'Outfit', sans-serif; fill: var(--ui-ink); }
.kw-trk-ring-text { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.kw-trk-ring-text small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-ink-2); font-weight: 700; }
.kw-trk-ring-text em { font-size: .74rem; font-style: normal; color: var(--ui-ink-3); line-height: 1.35; }
.kw-trk-band { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer; font: inherit;
               border: 0; border-left: 6px solid; transition: transform .12s, box-shadow .12s; }
.kw-trk-band:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,23,42,.08); }
.kw-trk-band small { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.kw-trk-band strong { font: 800 2.3rem/1.05 'Outfit', sans-serif; }
.kw-trk-band em { font-size: .72rem; font-style: normal; opacity: .85; }
.kw-trk-band.above { background: var(--kw-tb-above-bg); color: var(--kw-tb-above-ink); border-left-color: var(--kw-tb-above); }
.kw-trk-band.on { background: var(--kw-tb-on-bg); color: var(--kw-tb-on-ink); border-left-color: var(--kw-tb-on); }
.kw-trk-band.below { background: var(--kw-tb-below-bg); color: var(--kw-tb-below-ink); border-left-color: var(--kw-tb-below); }
.kw-trk-band.sel { outline: 3px solid currentColor; outline-offset: -3px; }
.kw-trk-impl-tile small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-ink-2); font-weight: 700; }
.kw-trk-impl-tile strong { display: block; font: 800 1.7rem/1.15 'Outfit', sans-serif; color: var(--ui-ink); margin: 2px 0 6px; }
.kw-trk-impl-tile strong span { font: 600 .85rem 'DM Sans', sans-serif; color: var(--ui-ink-2); }
.kw-trk-impl-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: color-mix(in srgb, var(--ui-line) 80%, transparent); }
.kw-trk-impl-bar span { height: 100%; }
.kw-trk-impl-bar .impl { background: #16A34A; } .kw-trk-impl-bar .notimpl { background: #DC2626; } .kw-trk-impl-bar .norep { background: #94A3B8; }
.kw-trk-impl-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 8px; }
.kw-trk-impl-chips button { border: 1px solid var(--ui-line); background: transparent; color: var(--ui-ink-2); border-radius: 999px; padding: 2px 9px;
                            font-size: .72rem; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.kw-trk-impl-chips button.sel { background: var(--ui-ink); color: var(--ui-card); border-color: var(--ui-ink); }
.kw-trk-impl-chips i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.kw-trk-impl-chips i.impl { background: #16A34A; } .kw-trk-impl-chips i.notimpl { background: #DC2626; }
.kw-trk-impl-chips i.norep { background: #94A3B8; } .kw-trk-impl-chips i.notdue { background: transparent; border: 1px dashed #94A3B8; }

/* toolbar, filters */
.kw-trk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.kw-trk-toolbar-end { margin-left: auto; display: flex; gap: 4px; }
.kw-trk-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-trk-filter { border: 1px solid var(--ui-line); background: var(--ui-card); color: var(--ui-ink-2); border-radius: 999px; padding: 4px 12px;
                 font-size: .78rem; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.kw-trk-filter b { font-variant-numeric: tabular-nums; opacity: .8; }
.kw-trk-filter.sel { background: var(--ui-ink); color: var(--ui-card); border-color: var(--ui-ink); }
.kw-trk-filter.f-above.sel { background: var(--kw-tb-above-bg); color: var(--kw-tb-above-ink); border-color: var(--kw-tb-above); }
.kw-trk-filter.f-on.sel { background: var(--kw-tb-on-bg); color: var(--kw-tb-on-ink); border-color: var(--kw-tb-on); }
.kw-trk-filter.f-below.sel { background: var(--kw-tb-below-bg); color: var(--kw-tb-below-ink); border-color: var(--kw-tb-below); }

/* objective cards */
.kw-trk-so { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.kw-trk-so.open { box-shadow: 0 4px 16px rgba(15,23,42,.06); }
.kw-trk-so-head { width: 100%; display: grid; grid-template-columns: auto minmax(220px, 1fr) minmax(200px, 300px) auto auto; align-items: center; gap: 14px;
                  padding: 12px 16px; background: transparent; border: 0; cursor: pointer; text-align: left; font: inherit; color: var(--ui-ink); }
@media (max-width: 900px) { .kw-trk-so-head { grid-template-columns: auto 1fr auto; } .kw-trk-so-split { grid-column: 1 / -1; } .kw-trk-so-perf { display: none; } }
.kw-trk-so-head:hover { background: color-mix(in srgb, var(--ui-line) 30%, transparent); }
.kw-trk-so-code { background: #0e7490; color: #fff; border-radius: 8px; padding: 4px 10px; font: 800 .82rem 'Outfit', sans-serif; white-space: nowrap; }
.kw-trk-so-name { font-weight: 700; font-size: .92rem; line-height: 1.3; min-width: 0; }
.kw-trk-so-name small { display: block; font-weight: 500; font-size: .74rem; color: var(--ui-ink-2); margin-top: 2px; }
.kw-trk-so-chev { color: var(--ui-ink-2); }
.kw-trk-so-body { border-top: 1px solid var(--ui-line); padding: 6px 14px 14px; }
.kw-trk-str { margin-top: 10px; }
.kw-trk-str-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .84rem; padding: 6px 8px;
                   background: color-mix(in srgb, #0e7490 9%, transparent); border-radius: 8px; color: var(--ui-ink); }
.kw-trk-str-head b { color: #0e7490; margin-right: 4px; }
.kw-trk-act { margin: 8px 0 0 10px; }
.kw-trk-act-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: .82rem; padding: 4px 4px 6px; }
.kw-trk-act-name { font-weight: 600; }
.kw-trk-act-name b { color: var(--ui-ink-2); font-weight: 700; margin-right: 4px; }
.kw-trk-mini { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--ui-ink-2); }

/* tables */
.kw-trk-table-wrap { overflow-x: auto; border: 1px solid var(--ui-line); border-radius: 10px; }
.kw-trk-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.kw-trk-table th { background: color-mix(in srgb, var(--ui-line) 45%, var(--ui-card)); color: var(--ui-ink-2); font-weight: 700; text-align: left;
                   padding: 6px 8px; font-size: .72rem; white-space: nowrap; }
.kw-trk-table th small { display: block; font-weight: 500; font-size: .64rem; opacity: .8; }
.kw-trk-table td { padding: 6px 8px; border-top: 1px solid var(--ui-line); vertical-align: middle; color: var(--ui-ink); }
.kw-trk-table td.num, .kw-trk-table th.num { text-align: right; white-space: nowrap; }
.kw-trk-table td.ind, .kw-trk-table th.ind { min-width: 220px; }
.kw-trk-table td.actions { white-space: nowrap; text-align: right; }
.kw-trk-table tr:hover td { background: color-mix(in srgb, var(--ui-line) 22%, transparent); }
.kw-trk-ind { display: block; font-weight: 600; line-height: 1.3; }
.kw-trk-uom { display: block; font-size: .7rem; color: var(--ui-ink-3); }
.kw-trk-table td.q { text-align: center; min-width: 64px; line-height: 1.15; }
.kw-trk-table td.q small { display: block; font-size: .64rem; opacity: .75; }
.kw-trk-table td.q b { font-size: .84rem; }
.kw-trk-table td.q.missing { background: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, #94A3B8 16%, transparent) 5px 10px); color: var(--ui-ink-3); }
.kw-trk-table td.q.future { color: var(--ui-ink-3); opacity: .55; }
.kw-trk-table td.q.empty { color: var(--ui-ink-3); }
.kw-trk-annual { height: 4px; border-radius: 3px; background: color-mix(in srgb, var(--ui-line) 80%, transparent); margin-top: 3px; overflow: hidden; }
.kw-trk-annual span { display: block; height: 100%; }
.kw-trk-annual span.prog { background: #0ea5e9; } .kw-trk-annual span.done { background: #16A34A; }
.kw-trk-state { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .7rem; font-weight: 700; white-space: nowrap; }
.kw-trk-state.impl { background: #DCFCE7; color: #166534; }
.kw-trk-state.notimpl { background: #FFC7CE; color: #9C0006; }
.kw-trk-state.norep { background: #FEF3C7; color: #92400E; }
.kw-trk-state.notdue { background: #F1F5F9; color: #64748B; }
.kw-trk-qs { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: .7rem; font-weight: 600; white-space: nowrap; }
.kw-trk-qs.ok { background: #DCFCE7; color: #166534; } .kw-trk-qs.sent { background: #DBEAFE; color: #1E40AF; }
.kw-trk-qs.back { background: #FFE4E6; color: #9F1239; } .kw-trk-qs.part { background: #FEF3C7; color: #92400E; }
.kw-trk-qs.none { background: #F1F5F9; color: #475569; } .kw-trk-qs.future { color: var(--ui-ink-3); }

/* years matrix */
.kw-trk-years { width: 100%; border-collapse: collapse; font-size: .78rem; min-width: 900px; }
.kw-trk-years th, .kw-trk-years td { border-top: 1px solid var(--ui-line); padding: 0; vertical-align: top; }
.kw-trk-years th { background: color-mix(in srgb, var(--ui-line) 45%, var(--ui-card)); }
.kw-trk-years th button, .kw-trk-years td.yc button { width: 100%; border: 0; background: transparent; color: inherit; font: inherit; text-align: left;
                                                     cursor: pointer; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.kw-trk-years th button { font-weight: 800; color: var(--ui-ink); }
.kw-trk-years th button small { font-weight: 500; font-size: .68rem; color: var(--ui-ink-2); }
.kw-trk-years th.sel, .kw-trk-years td.yc.sel { background: color-mix(in srgb, #06b6d4 12%, var(--ui-card)); }
.kw-trk-years th.cur button { color: #0e7490; }
.kw-trk-years td.so { padding: 8px 10px; font-weight: 600; max-width: 280px; color: var(--ui-ink); }
.kw-trk-years tr.total td { background: color-mix(in srgb, var(--ui-line) 25%, transparent); }
.kw-trk-years td.yc button:hover { background: color-mix(in srgb, var(--ui-line) 35%, transparent); }
.kw-trk-years td.yc.future { opacity: .6; }
.kw-trk-years .yc-sub, .kw-trk-years .yc-sp { font-size: .68rem; color: var(--ui-ink-2); }
.kw-trk-years .yc-sp { color: #0e7490; font-weight: 600; }
.kw-trk-note { font-size: .8rem; color: var(--ui-ink-2); margin: 0 0 10px; }
.kw-trk-empty { padding: 28px; text-align: center; color: var(--ui-ink-2); background: var(--ui-card); border: 1px dashed var(--ui-line); border-radius: 12px; }
.kw-trk-h3 { font: 700 .95rem 'Outfit', sans-serif; margin: 18px 0 8px; color: var(--ui-ink); }
.kw-trk-h4 { font: 700 .86rem 'Outfit', sans-serif; margin: 14px 0 6px; color: var(--ui-ink); }
.kw-trk-foot { font-size: .72rem; color: var(--ui-ink-3); margin-top: 14px; line-height: 1.45; }

/* indicator dialog */
.kw-trk-dlg-meta { font-size: .78rem; color: var(--mud-palette-text-secondary); margin-bottom: 8px; }
.kw-trk-dlg-figs { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.kw-trk-dlg-figs > span { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.kw-trk-dlg-figs small { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--mud-palette-text-secondary); font-weight: 700; }
.kw-trk-dlg-figs b { font: 800 1.15rem 'Outfit', sans-serif; }
.kw-trk-dlg-figs em { font-style: normal; font-size: .75rem; color: var(--mud-palette-text-secondary); }
.kw-trk-dlg .kw-trk-table-wrap { --ui-line: var(--mud-palette-lines-default, #e2e8f0); --ui-card: var(--mud-palette-surface, #fff);
                                 --ui-ink: var(--mud-palette-text-primary, #0f172a); --ui-ink-2: var(--mud-palette-text-secondary, #475569);
                                 --ui-ink-3: color-mix(in srgb, var(--mud-palette-text-secondary, #475569) 70%, transparent); }
.kw-trk-dlg { --ui-ink-2: var(--mud-palette-text-secondary, #475569); --ui-ink-3: color-mix(in srgb, var(--mud-palette-text-secondary, #475569) 70%, transparent); }
.kw-dark .kw-trk-state.impl { background: rgba(22,163,74,.25); color: #86efac; }
.kw-dark .kw-trk-state.notimpl { background: rgba(220,38,38,.25); color: #fca5a5; }
.kw-dark .kw-trk-state.norep { background: rgba(234,179,8,.2); color: #fde047; }
.kw-dark .kw-trk-state.notdue { background: rgba(148,163,184,.18); color: #cbd5e1; }


/* ══════════════════════════════════════════════════════════════
   Feedback & Comments (/progress/feedback) — every comment on the work plans and their progress.
   Voices: submitter blue, reviewer purple, planner teal.
   ══════════════════════════════════════════════════════════════ */
:root { --kw-fb-sub: #2563eb; --kw-fb-rev: #7c3aed; --kw-fb-plan: #0d9488; }
.kw-fb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kw-fb-stat { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 14px; padding: 10px 14px; text-align: left;
              font: inherit; color: var(--ui-ink); cursor: pointer; display: flex; flex-direction: column; gap: 1px;
              border-top: 4px solid #64748b; transition: transform .12s, box-shadow .12s; }
.kw-fb-stat:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,.07); }
.kw-fb-stat small { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-ink-2); font-weight: 700; }
.kw-fb-stat strong { font: 800 1.6rem/1.15 'Outfit', sans-serif; }
.kw-fb-stat em { font-style: normal; font-size: .72rem; color: var(--ui-ink-3); }
.kw-fb-stat.sub { border-top-color: var(--kw-fb-sub); } .kw-fb-stat.rev { border-top-color: var(--kw-fb-rev); }
.kw-fb-stat.plan { border-top-color: var(--kw-fb-plan); } .kw-fb-stat.warn { border-top-color: #ea580c; }
.kw-fb-stat.below { border-top-color: var(--kw-tb-below); } .kw-fb-stat.quiet { cursor: default; border-top-color: #94a3b8; }
.kw-fb-stat.quiet:hover { transform: none; box-shadow: none; }
.kw-fb-stat.sel { outline: 2px solid var(--ui-ink); outline-offset: -2px; }

/* AI panel */
.kw-fb-ai { background: linear-gradient(135deg, color-mix(in srgb, #6366f1 9%, var(--ui-card)), var(--ui-card) 60%);
            border: 1px solid color-mix(in srgb, #6366f1 30%, var(--ui-line)); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; scroll-margin-top: 140px; }
.kw-fb-ai-head { display: flex; gap: 10px; align-items: flex-start; color: #4338ca; }
.kw-fb-ai-head strong { display: block; font: 700 .98rem 'Outfit', sans-serif; color: var(--ui-ink); }
.kw-fb-ai-head span { display: block; font-size: .8rem; color: var(--ui-ink-2); }
.kw-fb-ai-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kw-fb-ai-presets button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid color-mix(in srgb, #6366f1 35%, var(--ui-line));
                           background: var(--ui-card); color: #4338ca; border-radius: 999px; padding: 5px 12px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.kw-fb-ai-presets button:hover:not(:disabled) { background: #4338ca; color: #fff; }
.kw-fb-ai-presets button:disabled { opacity: .5; cursor: default; }
.kw-fb-ai-wait { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .84rem; color: var(--ui-ink-2); }
.kw-fb-sum { margin-top: 12px; border-top: 1px dashed color-mix(in srgb, #6366f1 30%, var(--ui-line)); padding-top: 10px; position: relative; }
.kw-fb-sum-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.kw-fb-sum-scope { font: 700 .92rem 'Outfit', sans-serif; color: var(--ui-ink); }
.kw-fb-sum-meta { font-size: .72rem; color: var(--ui-ink-3); }
.kw-fb-sum-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; }
.kw-fb-sum-overview { font-size: .92rem; line-height: 1.55; color: var(--ui-ink); margin: 8px 0 10px; }
.kw-fb-themes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.kw-fb-theme { background: var(--ui-card); border: 1px solid var(--ui-line); border-left: 4px solid #6366f1; border-radius: 10px; padding: 10px 12px; }
.kw-fb-theme strong { font-size: .88rem; color: var(--ui-ink); }
.kw-fb-theme p, .kw-fb-gs p { font-size: .82rem; line-height: 1.5; color: var(--ui-ink); margin: 4px 0 6px; }
.kw-fb-h4 { font: 700 .86rem 'Outfit', sans-serif; margin: 14px 0 6px; color: var(--ui-ink); }
.kw-fb-groupsum { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.kw-fb-gs { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 10px; padding: 10px 12px; }
.kw-fb-gs-head { display: flex; justify-content: space-between; gap: 8px; }
.kw-fb-gs-head strong { font-size: .86rem; color: var(--ui-ink); }
.kw-fb-gs-head span { font-size: .7rem; color: var(--ui-ink-3); white-space: nowrap; }
.kw-fb-gs ul { margin: 0 0 6px 18px; padding: 0; font-size: .8rem; color: var(--ui-ink); }
.kw-fb-actions { margin: 0 0 4px 20px; padding: 0; font-size: .86rem; line-height: 1.55; color: var(--ui-ink); }
.kw-fb-cites { display: flex; flex-wrap: wrap; gap: 4px; }
.kw-fb-cites button { border: 1px solid color-mix(in srgb, #6366f1 35%, var(--ui-line)); background: transparent; color: #4338ca; border-radius: 6px;
                      padding: 0 6px; font-size: .7rem; font-weight: 700; cursor: pointer; }
.kw-fb-cites button.sel, .kw-fb-cites button:hover { background: #4338ca; color: #fff; }
.kw-fb-cite-open { position: sticky; bottom: 8px; margin-top: 10px; background: var(--ui-card); border: 1px solid #6366f1; border-radius: 10px;
                   padding: 8px 40px 8px 12px; box-shadow: 0 8px 24px rgba(15,23,42,.15); font-size: .8rem; color: var(--ui-ink); }
.kw-fb-cite-open p { margin: 4px 0 0; white-space: pre-wrap; }
.kw-fb-cite-open .mud-icon-button { position: absolute; top: 4px; right: 4px; }

/* filters */
.kw-fb-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.kw-fb-search { flex: 1 1 260px; min-width: 220px; }
.kw-fb-sel { flex: 0 1 200px; min-width: 150px; }
.kw-fb-sel.sm { flex-basis: 150px; min-width: 120px; }
.kw-fb-sel.lg { flex-basis: 300px; }
.kw-fb-groupby { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; font-size: .78rem; color: var(--ui-ink-2); }
.kw-fb-groupby button { border: 1px solid var(--ui-line); background: var(--ui-card); color: var(--ui-ink-2); border-radius: 999px; padding: 3px 11px;
                        font-size: .76rem; font-weight: 600; cursor: pointer; }
.kw-fb-groupby button.sel { background: var(--ui-ink); color: var(--ui-card); border-color: var(--ui-ink); }
.kw-fb-count { margin-left: auto; }

/* groups and items */
.kw-fb-group { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.kw-fb-group-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: color-mix(in srgb, var(--ui-line) 28%, var(--ui-card)); }
.kw-fb-group-toggle { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; background: transparent; border: 0; cursor: pointer;
                      font: inherit; color: var(--ui-ink); text-align: left; }
.kw-fb-group-toggle strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.kw-fb-voices { display: inline-flex; gap: 4px; }
.kw-fb-voices span { min-width: 22px; text-align: center; border-radius: 6px; font-size: .7rem; font-weight: 700; padding: 1px 5px; color: #fff; }
.kw-fb-voices .sub { background: var(--kw-fb-sub); } .kw-fb-voices .rev { background: var(--kw-fb-rev); } .kw-fb-voices .plan { background: var(--kw-fb-plan); }
.kw-fb-group-n { font: 800 .9rem 'Outfit', sans-serif; color: var(--ui-ink-2); }
.kw-fb-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 8px; padding: 10px 12px 12px; }
@media (max-width: 600px) { .kw-fb-items { grid-template-columns: 1fr; } }
.kw-fb-item { border: 1px solid var(--ui-line); border-left: 4px solid var(--kw-fb-sub); border-radius: 10px; padding: 8px 10px; background: var(--ui-card); }
.kw-fb-item.rev { border-left-color: var(--kw-fb-rev); } .kw-fb-item.plan { border-left-color: var(--kw-fb-plan); }
.kw-fb-item.open { box-shadow: inset 0 0 0 1px #fdba74; }
.kw-fb-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .72rem; }
.kw-fb-kind { font-weight: 700; border-radius: 6px; padding: 1px 7px; color: #fff; background: var(--kw-fb-sub); }
.kw-fb-kind.rev { background: var(--kw-fb-rev); } .kw-fb-kind.plan { background: var(--kw-fb-plan); }
.kw-fb-q { font-weight: 700; color: var(--ui-ink-2); }
.kw-fb-station { color: var(--ui-ink); font-weight: 600; }
.kw-fb-fig-plain { color: var(--ui-ink-3); }
.kw-fb-openflag { background: #ffedd5; color: #9a3412; font-weight: 800; border-radius: 6px; padding: 0 6px; }
.kw-fb-link { margin-left: auto; color: var(--ui-ink-3); display: inline-flex; }
.kw-fb-link:hover { color: #4338ca; }
.kw-fb-ctx { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font-size: .72rem; color: var(--ui-ink-2); }
.kw-fb-ctx span + span::before { content: "›"; margin-right: 8px; color: var(--ui-ink-3); }
.kw-fb-ctx .so { font-weight: 700; color: #0e7490; }
.kw-fb-ctx .ind { color: var(--ui-ink); font-weight: 600; }
.kw-fb-ctx .line { font-style: italic; }
.kw-fb-text { margin: 6px 0 2px; font-size: .86rem; line-height: 1.5; color: var(--ui-ink); white-space: pre-wrap; word-break: break-word; }
.kw-fb-by { font-size: .7rem; color: var(--ui-ink-3); }
.kw-fb-more { grid-column: 1 / -1; justify-self: start; border: 0; background: transparent; color: #4338ca; font-weight: 700; font-size: .8rem; cursor: pointer; padding: 2px 4px; }

/* Progress report opened at one indicator (the tracker's Report button): its rows stay marked in amber. */
.kw-prpt-focusbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 8px; padding: 6px 10px; border-radius: 8px;
                    background: #fff7e6; border: 1px solid #f59e0b; color: #78350f; font-size: .82rem; }
/* The focused indicator: its line cells outlined row by row, its merged indicator + implementer cells filled and
   framed. The merged strategy / activity / output cells above it are shared with other indicators, so they stay plain. */
.kw-prpt tr.kw-prpt-focus td:not(.kw-prpt-merged) { box-shadow: inset 0 2px 0 #f59e0b, inset 0 -2px 0 #f59e0b; }
.kw-prpt td.kw-prpt-focus-cell { background: #fff7e6; box-shadow: inset 0 0 0 2px #f59e0b; }
.kw-prpt td.kw-prpt-merged { vertical-align: top; }
#kw-prpt-focus-row { scroll-margin: 80px; }
.kw-dark .kw-prpt-focusbar { background: rgba(245,158,11,.14); color: #fcd34d; }

/* ── KPI status summary (Progress Tracker / County Summary): 100% stacked bar per strategic objective ── */
.kw-kpi { border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-radius: 12px; padding: 14px 16px 10px; margin: 0 0 14px;
          background: var(--mud-palette-surface, #fff); }
.kw-kpi-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.kw-kpi-title { margin: 0; font-size: 1rem; font-weight: 700; color: var(--mud-palette-text-primary); }
.kw-kpi-head small { color: var(--mud-palette-text-secondary); font-size: .76rem; }
.kw-kpi-actions { display: flex; align-items: center; gap: 4px; }
.kw-kpi-chart { overflow-x: auto; text-align: center; color: var(--mud-palette-text-primary); }
.kw-kpi-chart svg { max-width: 100%; height: auto; }
.kw-kpi-chart svg rect[fill^="#"]:hover { filter: brightness(1.08); }
.kw-kpi-empty { padding: 24px; text-align: center; color: var(--mud-palette-text-secondary); font-style: italic; }
.kw-kpi-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: .78rem; color: var(--mud-palette-text-secondary); margin-top: 4px; }
.kw-kpi-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: help; }
.kw-kpi-sw { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.kw-kpi-legend .kw-kpi-sw { margin-right: 0; }
.kw-kpi-sw.above { background: #16A34A; } .kw-kpi-sw.on { background: #EAB308; } .kw-kpi-sw.below { background: #DC2626; }
.kw-kpi-sw.notimpl { background: #7F1D1D; } .kw-kpi-sw.norep { background: #94A3B8; }
.kw-kpi-tablewrap { overflow-x: auto; }
.kw-kpi-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.kw-kpi-table th, .kw-kpi-table td { padding: 6px 8px; border-bottom: 1px solid var(--mud-palette-lines-default, #e2e8f0); text-align: center; white-space: nowrap; }
.kw-kpi-table th { font-weight: 600; color: var(--mud-palette-text-secondary); font-size: .74rem; }
.kw-kpi-table .obj { text-align: left; white-space: normal; min-width: 220px; }
.kw-kpi-table td small { color: var(--mud-palette-text-secondary); }
.kw-kpi-table tr.total td { font-weight: 700; border-top: 2px solid var(--mud-palette-lines-default, #e2e8f0); }

/* KPI status drill-down: breadcrumb, click targets over the bars, the objective's indicators by status */
.kw-kpi-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: .78rem; margin-bottom: 2px; color: var(--mud-palette-text-secondary); }
.kw-kpi-crumbs button { border: 0; background: none; padding: 1px 4px; border-radius: 4px; cursor: pointer; color: var(--mud-palette-primary); font: inherit; }
.kw-kpi-crumbs button:hover { background: var(--mud-palette-action-default-hover); }
.kw-kpi-crumbs button.on { color: var(--mud-palette-text-primary); font-weight: 700; cursor: default; }
.kw-kpi-canvas { position: relative; display: inline-block; max-width: 100%; }
.kw-kpi-canvas svg { display: block; }
.kw-kpi-hit { position: absolute; top: 4%; bottom: 0; border: 0; background: transparent; cursor: pointer; border-radius: 6px; padding: 0; }
.kw-kpi-hit:hover, .kw-kpi-hit:focus-visible { background: rgba(37, 99, 235, .07); outline: 2px solid rgba(37, 99, 235, .45); outline-offset: -2px; }
.kw-kpi-hit.sel { outline: 2px solid #2563eb; outline-offset: -2px; background: rgba(37, 99, 235, .06); }
.kw-kpi-hint { font-size: .74rem; color: var(--mud-palette-text-secondary); }
/* KPI status: the quarter filter (Year to date · Q1–Q4), each quarter with how many indicators had a target in it */
.kw-kpi-quarters { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; margin: 2px 0 8px; border-radius: 10px;
                   background: var(--mud-palette-background-gray, #f1f5f9); border: 1px solid var(--mud-palette-lines-default, #e2e8f0); }
.kw-kpi-quarters button { border: 0; background: none; cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600;
                          color: var(--mud-palette-text-secondary); padding: 5px 12px; border-radius: 8px; }
.kw-kpi-quarters button small { margin-left: 5px; font-size: .7rem; font-weight: 600; opacity: .75; }
.kw-kpi-quarters button:hover:not(:disabled) { color: var(--mud-palette-text-primary); background: var(--mud-palette-action-default-hover); }
.kw-kpi .kw-kpi-quarters button.on { background: var(--mud-palette-surface, #fff); color: var(--mud-palette-primary);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .16); }
.kw-kpi .kw-kpi-quarters button.on small { opacity: 1; }
.kw-kpi-quarters button:disabled { cursor: not-allowed; opacity: .45; }
.kw-kpi-table tr.drill { cursor: pointer; }
.kw-kpi-table tr.drill:hover td { background: var(--mud-palette-action-default-hover); }
.kw-kpi-chev { vertical-align: middle; opacity: .6; }
.kw-kpi-list { border-top: 1px solid var(--mud-palette-lines-default, #e2e8f0); margin-top: 10px; padding-top: 10px; }
.kw-kpi-list-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: .86rem; }
.kw-kpi-link { border: 0; background: none; color: var(--mud-palette-primary); cursor: pointer; font: inherit; font-size: .78rem; padding: 0; }
.kw-kpi-group { margin-bottom: 8px; }
.kw-kpi-group-h { font-size: .78rem; font-weight: 700; color: var(--mud-palette-text-secondary); margin: 4px 0; }
.kw-kpi-ind { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; width: 100%; text-align: left;
              border: 0; border-bottom: 1px dashed var(--mud-palette-lines-default, #e2e8f0); background: none; padding: 6px 4px; cursor: pointer;
              font: inherit; font-size: .82rem; color: var(--mud-palette-text-primary); }
.kw-kpi-ind:hover { background: var(--mud-palette-action-default-hover); }
.kw-kpi-ind .fig { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kw-kpi-ind .fig small { color: var(--mud-palette-text-secondary); }
.kw-kpi-undue { font-size: .76rem; color: var(--mud-palette-text-secondary); font-style: italic; }

/* ══════════════════════════════════════════════════════════════
   Planning home (/planning, Components/Pages/Private/Planning) — the scoped progress overview the Planning menu
   opens on. Planning teal for the frame; status colours (KPI buckets) only where a mark carries a status; one hue
   for magnitudes (targets met by objective).
   ══════════════════════════════════════════════════════════════ */
.kw-ph { --kw-ph-accent: #0f766e; --kw-ph-bar: #0d9488; --kw-ph-bar-track: color-mix(in srgb, var(--ui-line) 70%, transparent);
         --kw-ph-s1: #1e3a8a; --kw-ph-s2: #0d9488; --kw-ph-soft: color-mix(in srgb, #14b8a6 9%, var(--ui-card)); }
.kw-dark .kw-ph { --kw-ph-accent: #5eead4; --kw-ph-bar: #2dd4bf; --kw-ph-s1: #93c5fd; --kw-ph-s2: #5eead4;
                  --kw-ph-soft: color-mix(in srgb, #14b8a6 14%, var(--ui-card)); }

.kw-ph-hero { background: linear-gradient(128deg, #042f2e 0%, #0f766e 55%, #14b8a6 125%); }
.kw-ph-hero .kw-ui-hero-sub b { color: #fff; }
.kw-ph-deadline { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 12px; text-decoration: none;
                  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.kw-ph-deadline span { display: flex; flex-direction: column; line-height: 1.2; }
.kw-ph-deadline b { font-size: .84rem; } .kw-ph-deadline small { font-size: .7rem; opacity: .85; }
.kw-ph-deadline.warm { background: rgba(234,179,8,.25); border-color: #fde047; }
.kw-ph-deadline.hot { background: rgba(220,38,38,.35); border-color: #fca5a5; }
.kw-ph-lens { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; color: #fff; font-size: .82rem; font-weight: 600; }
.kw-ph-lens .kw-ph-lens-select { width: 360px !important; max-width: 100%; flex: 0 1 auto !important; background: #fff; border-radius: 8px; }
.kw-dark .kw-ph-lens-select { background: var(--ui-card); }
.kw-ph-lens-group { font-size: .7rem !important; text-transform: uppercase; letter-spacing: .06em; font-weight: 800 !important; opacity: 1 !important; }
.kw-ph-lens-back { border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; border-radius: 999px; padding: 4px 12px; font-size: .76rem; cursor: pointer; }
.kw-ph-lens-back:hover { background: rgba(255,255,255,.15); }

.kw-ph-skel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.kw-ph-denied { display: flex; gap: 14px; padding: 20px; border-radius: 16px; background: var(--ui-card); border: 1px solid var(--ui-line); }
.kw-ph-denied strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.kw-ph-denied p { margin: 0 0 10px; color: var(--ui-ink-2); max-width: 720px; }
.kw-ph-denied .links { display: flex; gap: 8px; flex-wrap: wrap; }

.kw-ph-context { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: .8rem; color: var(--ui-ink-2); align-items: center; }
.kw-ph-context > * { display: inline-flex; align-items: center; gap: 5px; }
.kw-ph-context a { color: inherit; text-decoration: none; } .kw-ph-context a:hover { text-decoration: underline; }
.kw-ph-context b.ok { color: var(--kw-tb-above-ink); } .kw-ph-context b.warn { color: var(--kw-tb-on-ink); }
.kw-dark .kw-ph-context b.ok { color: #86efac; } .kw-dark .kw-ph-context b.warn { color: #fde047; }
.kw-ph-context .asof { margin-left: auto; color: var(--ui-ink-3); }

/* segmented controls */
.kw-ph-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: color-mix(in srgb, var(--ui-line) 55%, transparent); }
.kw-ph-seg button { border: 0; background: transparent; color: var(--ui-ink-2); font: 600 .78rem 'DM Sans', sans-serif; padding: 5px 11px; border-radius: 8px; cursor: pointer; }
.kw-ph-seg button span { opacity: .7; margin-left: 3px; font-variant-numeric: tabular-nums; }
.kw-ph-seg button.on { background: var(--ui-card); color: var(--ui-ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.kw-ph-seg button:disabled { opacity: .4; cursor: default; }
.kw-ph-seg.small button { padding: 4px 9px; font-size: .74rem; }
.kw-ph-focusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 10px; font-size: .78rem; font-weight: 700; color: var(--ui-ink-2); text-transform: uppercase; letter-spacing: .05em; }
.kw-ph-focusbar .kw-ph-seg button { text-transform: none; letter-spacing: 0; }

/* pulse */
.kw-ph-pulse { display: grid; grid-template-columns: minmax(300px, 1.6fr) repeat(3, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
@media (max-width: 1200px) { .kw-ph-pulse { grid-template-columns: repeat(3, 1fr); } .kw-ph-tile.ring { grid-column: span 3; } }
@media (max-width: 760px) { .kw-ph-pulse { grid-template-columns: 1fr; } .kw-ph-tile.ring { grid-column: auto; } }
.kw-ph-tile.ring .txt .kw-ph-mix { margin-top: 4px; width: 100%; }
@media (max-width: 560px) { .kw-ph-pulse { grid-template-columns: 1fr; } .kw-ph-tile.ring { grid-column: auto; } .kw-ph-skel { grid-template-columns: 1fr; } }
.kw-ph-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; text-decoration: none; font: inherit; color: var(--ui-ink);
              background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 16px; padding: 14px 16px; cursor: pointer;
              border-top: 4px solid var(--kw-ph-bar); transition: transform .12s, box-shadow .12s; min-width: 0; }
.kw-ph-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15,23,42,.09); }
.kw-ph-tile:focus-visible { outline: 3px solid var(--kw-ph-accent); outline-offset: 2px; }
.kw-ph-tile small { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-ink-2); font-weight: 700; }
.kw-ph-tile strong { font: 800 2.1rem/1.08 'Outfit', sans-serif; font-variant-numeric: tabular-nums; }
.kw-ph-tile strong span { font: 600 .85rem 'DM Sans', sans-serif; color: var(--ui-ink-2); margin-left: 3px; }
.kw-ph-tile em { font-size: .74rem; font-style: normal; color: var(--ui-ink-3); line-height: 1.35; }
.kw-ph-tile .kw-ph-mix { margin-top: auto; }
.kw-ph-tile.warn { border-top-color: #DC2626; }
.kw-ph-tile.ring { flex-direction: row; align-items: center; gap: 14px; }
.kw-ph-tile.ring .txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kw-ph-ring { width: 96px; height: 96px; flex: none; transform: rotate(-90deg); }
.kw-ph-ring circle { fill: none; stroke-width: 10; }
.kw-ph-ring .track { stroke: var(--kw-ph-bar-track); }
.kw-ph-ring .fill { stroke: var(--kw-ph-bar); stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.kw-ph-ring text { transform: rotate(90deg); transform-origin: 50% 50%; font: 800 20px 'Outfit', sans-serif; fill: var(--ui-ink); }

/* status mix bar (2px gaps between segments) */
.kw-ph-mix { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; width: 100%; background: var(--kw-ph-bar-track); }
.kw-ph-mix i { display: block; height: 100%; min-width: 2px; }

/* grid of cards */
.kw-ph-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.kw-ph-card { background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 18px; padding: 16px 18px; min-width: 0; scroll-margin-top: 80px; }
.kw-ph-card > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 12px; }
.kw-ph-card > header h2 { margin: 0; font: 700 1.02rem 'Outfit', sans-serif; color: var(--ui-ink); }
.kw-ph-card > header small { color: var(--ui-ink-3); font-size: .76rem; }
.kw-ph-card.span4 { grid-column: span 4; } .kw-ph-card.span5 { grid-column: span 5; } .kw-ph-card.span7 { grid-column: span 7; }
.kw-ph-card.span8 { grid-column: span 8; } .kw-ph-card.span12 { grid-column: span 12; }
@media (max-width: 1100px) { .kw-ph-card.span4, .kw-ph-card.span5, .kw-ph-card.span7, .kw-ph-card.span8 { grid-column: span 12; } }
.kw-ph-muted { color: var(--ui-ink-3); font-size: .84rem; margin: 6px 0; }
.kw-ph-foot-note { color: var(--ui-ink-3); font-size: .74rem; margin: 10px 0 0; line-height: 1.5; }

/* legends */
.kw-ph-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .75rem; color: var(--ui-ink-2); }
.kw-ph-legend span { display: inline-flex; align-items: center; gap: 6px; }
.kw-ph-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.kw-ph-legend i.s1, .kw-ph-tip i.s1 { display: inline-block; height: 3px; border-radius: 2px; background: var(--kw-ph-s1); width: 18px; }
.kw-ph-legend i.s2, .kw-ph-tip i.s2 { display: inline-block; height: 0; border-top: 3px dashed var(--kw-ph-s2); width: 18px; border-radius: 0; background: none; }

/* scoreboard */
.kw-ph-score { display: grid; grid-template-columns: minmax(840px, 1fr); gap: 4px; overflow-x: auto; }
.kw-ph-score-row { display: grid; grid-template-columns: 108px minmax(170px, 2.2fr) repeat(4, minmax(58px, .7fr)) minmax(80px, .9fr) minmax(120px, 1.2fr);
                   gap: 10px; align-items: center; min-width: 840px; box-sizing: border-box; padding: 8px 10px; border-radius: 12px; border: 1px solid transparent;
                   background: transparent; color: var(--ui-ink); font: inherit; text-align: left; cursor: pointer; }
.kw-ph-score-row.head { cursor: default; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ui-ink-3); padding-bottom: 2px; }
button.kw-ph-score-row:hover { background: var(--kw-ph-soft); }
.kw-ph-score-row.agg { background: color-mix(in srgb, var(--ui-line) 30%, transparent); }
.kw-ph-score-row.sel, .kw-ph-score-row.agg.sel { border-color: var(--kw-ph-accent); background: var(--kw-ph-soft); }
.kw-ph-score-row.future { opacity: .55; cursor: default; }
.kw-ph-score-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.kw-ph-score-row .per strong { display: block; font: 700 .95rem 'Outfit', sans-serif; }
.kw-ph-score-row .per small, .kw-ph-score-row .mix small { font-size: .7rem; color: var(--ui-ink-3); }
.kw-ph-score-row .mix { display: flex; flex-direction: column; gap: 3px; }
.kw-ph-score-row .mix-empty { font-size: .78rem; color: var(--ui-ink-3); font-style: italic; }
.kw-ph-score-row .pct { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.kw-ph-score-row .pct strong { font-weight: 800; font-size: .92rem; }
.kw-ph-score-row .pct small { font-size: .68rem; color: var(--ui-ink-3); }
.kw-ph-score-row .pct.above strong { color: var(--kw-tb-above-ink); } .kw-ph-score-row .pct.on strong { color: var(--kw-tb-on-ink); }
.kw-ph-score-row .pct.below strong { color: var(--kw-tb-below-ink); } .kw-ph-score-row .pct.notdone strong { color: var(--ui-ink-2); }
.kw-dark .kw-ph-score-row .pct.above strong { color: #86efac; } .kw-dark .kw-ph-score-row .pct.on strong { color: #fde047; }
.kw-dark .kw-ph-score-row .pct.below strong { color: #fca5a5; }
.kw-ph-score-row .avg { font: 800 .95rem 'Outfit', sans-serif; }
.kw-ph-sub { display: inline-block; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 2px 9px; margin-right: 6px; white-space: nowrap;
             background: color-mix(in srgb, var(--ui-line) 60%, transparent); color: var(--ui-ink-2); }
.kw-ph-sub.ok { background: #dcfce7; color: #166534; } .kw-ph-sub.sent { background: #dbeafe; color: #1e40af; }
.kw-ph-sub.back { background: #fee2e2; color: #991b1b; } .kw-ph-sub.part { background: #fef9c3; color: #854d0e; }
.kw-ph-sub.none { background: #f1f5f9; color: #475569; }
.kw-dark .kw-ph-sub.ok { background: rgba(22,163,74,.25); color: #86efac; } .kw-dark .kw-ph-sub.sent { background: rgba(37,99,235,.25); color: #93c5fd; }
.kw-dark .kw-ph-sub.back { background: rgba(220,38,38,.25); color: #fca5a5; } .kw-dark .kw-ph-sub.part { background: rgba(234,179,8,.22); color: #fde047; }
.kw-dark .kw-ph-sub.none { background: rgba(148,163,184,.2); color: #cbd5e1; }
.kw-ph-due { font-size: .68rem; color: var(--ui-ink-3); white-space: nowrap; }

/* attention */
.kw-ph-card.attn { display: flex; flex-direction: column; }
.kw-ph-attn { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.kw-ph-attn-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ui-line);
                   border-left: 4px solid #94A3B8; background: color-mix(in srgb, var(--ui-line) 18%, transparent); }
.kw-ph-attn-item .ico { margin-top: 1px; flex: none; }
.kw-ph-attn-item .body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.kw-ph-attn-item strong { font-size: .86rem; } .kw-ph-attn-item span { font-size: .76rem; color: var(--ui-ink-2); line-height: 1.4; }
.kw-ph-attn-item .act { align-self: flex-start; margin-top: 4px; font: 700 .76rem 'DM Sans', sans-serif; color: var(--kw-ph-accent); text-decoration: none;
                        background: none; border: 0; padding: 0; cursor: pointer; }
.kw-ph-attn-item .act:hover { text-decoration: underline; }
.kw-ph-attn-item .count { flex: none; font: 800 .8rem 'Outfit', sans-serif; background: var(--ui-card); border: 1px solid var(--ui-line); border-radius: 999px; padding: 1px 8px; }
.kw-ph-attn-item.critical { border-left-color: #DC2626; } .kw-ph-attn-item.critical .ico { color: #DC2626; }
.kw-ph-attn-item.warning { border-left-color: #EAB308; } .kw-ph-attn-item.warning .ico { color: #CA8A04; }
.kw-ph-attn-item.info { border-left-color: #2563EB; } .kw-ph-attn-item.info .ico { color: #2563EB; }
.kw-ph-attn-item.good { border-left-color: #16A34A; } .kw-ph-attn-item.good .ico { color: #16A34A; }

/* trend */
.kw-ph-trend .kw-ph-legend { margin-bottom: 6px; }
.kw-ph-trend-canvas { position: relative; color: var(--ui-ink); }
.kw-ph-trend svg { display: block; width: 100%; height: auto; overflow: visible; }
.kw-ph-trend line.grid { stroke: var(--ui-line); stroke-width: 1; }
.kw-ph-trend line.ref { stroke: var(--ui-ink-3); stroke-width: 1; stroke-dasharray: 4 4; }
.kw-ph-trend text.axis { font: 600 11px 'DM Sans', sans-serif; fill: var(--ui-ink-2); }
.kw-ph-trend text.axis.muted { fill: var(--ui-ink-3); opacity: .6; }
.kw-ph-trend text.val { font: 800 12px 'Outfit', sans-serif; fill: var(--ui-ink); }
.kw-ph-trend text.val.sub { font-weight: 700; fill: var(--ui-ink-2); }
.kw-ph-trend path { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.kw-ph-trend path.s1 { stroke: var(--kw-ph-s1); } .kw-ph-trend path.s2 { stroke: var(--kw-ph-s2); stroke-dasharray: 6 5; }
.kw-ph-trend circle.s1 { fill: var(--kw-ph-s1); stroke: var(--ui-card); stroke-width: 2; }
.kw-ph-trend circle.s2 { fill: var(--kw-ph-s2); stroke: var(--ui-card); stroke-width: 2; }
.kw-ph-trend-hit { position: absolute; top: 0; bottom: 0; border: 0; background: transparent; cursor: pointer; border-radius: 10px; padding: 0; }
.kw-ph-trend-hit:hover:not(:disabled), .kw-ph-trend-hit.sel { background: color-mix(in srgb, var(--kw-ph-bar) 9%, transparent); }
.kw-ph-trend-hit:disabled { cursor: default; }
.kw-ph-tip { display: none; position: absolute; left: 50%; top: 4px; transform: translateX(-50%); z-index: 3; min-width: 230px; text-align: left;
             background: var(--ui-card); color: var(--ui-ink); border: 1px solid var(--ui-line); border-radius: 10px; padding: 8px 10px;
             box-shadow: 0 10px 24px rgba(15,23,42,.16); font-size: .76rem; flex-direction: column; gap: 3px; pointer-events: none; }
.kw-ph-trend-hit:hover .kw-ph-tip, .kw-ph-trend-hit:focus-visible .kw-ph-tip { display: flex; }
.kw-ph-tip span { display: inline-flex; align-items: center; gap: 6px; color: var(--ui-ink-2); }
.kw-ph-tip b { color: var(--ui-ink); }

/* key messages */
.kw-ph-card.msgs { background: var(--kw-ph-soft); }
.kw-ph-msgs { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.kw-ph-msgs li { position: relative; padding-left: 20px; font-size: .88rem; line-height: 1.5; color: var(--ui-ink); }
.kw-ph-msgs li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 7px; height: 7px; border-radius: 50%; background: var(--kw-ph-accent); }

/* objectives — small multiples + columns */
.kw-ph-objs { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; }
@media (max-width: 1000px) { .kw-ph-objs { grid-template-columns: 1fr; } }
.kw-ph-objs-quarters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .kw-ph-objs-quarters { grid-template-columns: 1fr; } }
.kw-ph-objs-q { border: 1px solid var(--ui-line); border-radius: 12px; padding: 10px 12px; }
.kw-ph-objs-q.sel { border-color: var(--kw-ph-accent); box-shadow: inset 0 0 0 1px var(--kw-ph-accent); }
.kw-ph-objs-q.future { opacity: .55; }
.kw-ph-objs-qh { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.kw-ph-objs-qh strong { font: 800 1rem 'Outfit', sans-serif; color: var(--kw-ph-accent); }
.kw-ph-objs-qh small { font-size: .72rem; color: var(--ui-ink-3); }
.kw-ph-rank { display: grid; grid-template-columns: 56px 1fr 44px; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent;
              color: var(--ui-ink); font: inherit; padding: 3px 4px; border-radius: 6px; cursor: pointer; text-align: left; }
.kw-ph-rank:hover { background: var(--kw-ph-soft); }
.kw-ph-rank .lbl { font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-ph-rank .bar { height: 10px; border-radius: 0 5px 5px 0; background: var(--kw-ph-bar-track); overflow: hidden; }
.kw-ph-rank .bar i { display: block; height: 100%; background: var(--kw-ph-bar); border-radius: 0 4px 4px 0; }
.kw-ph-rank .val { font: 700 .76rem 'DM Sans', sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.kw-ph-cols-wrap { border: 1px solid var(--ui-line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.kw-ph-cols-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.kw-ph-cols-h strong { font: 700 .92rem 'Outfit', sans-serif; } .kw-ph-cols-h small { font-size: .72rem; color: var(--ui-ink-3); }
.kw-ph-cols { display: flex; gap: 8px; align-items: stretch; height: 260px; overflow-x: auto; padding-bottom: 2px; }
.kw-ph-col { flex: 1 0 44px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--ui-ink);
             cursor: pointer; padding: 2px; border-radius: 8px; font: inherit; }
.kw-ph-col:hover { background: var(--kw-ph-soft); }
.kw-ph-col .v { font: 800 .78rem 'Outfit', sans-serif; }
.kw-ph-col .track { flex: 1; width: 26px; display: flex; align-items: flex-end; background: var(--kw-ph-bar-track); border-radius: 5px 5px 0 0; overflow: hidden; }
.kw-ph-col .track i { display: block; width: 100%; background: var(--kw-ph-bar); border-radius: 4px 4px 0 0; }
.kw-ph-col .l { font-size: .72rem; font-weight: 800; white-space: nowrap; }
.kw-ph-col .n { font-size: .64rem; color: var(--ui-ink-3); text-align: center; line-height: 1.2; max-width: 84px; height: 2.4em; overflow: hidden; }

/* SO health */
.kw-ph-health-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.kw-ph-health-actions { display: flex; align-items: center; gap: 6px; }
.kw-ph-health-group { padding: 6px 8px; border-radius: 10px; margin-bottom: 6px; }
.kw-ph-health-group.sel { background: var(--kw-ph-soft); }
.kw-ph-health-gh { font: 800 .78rem 'Outfit', sans-serif; color: var(--kw-ph-accent); text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 4px; }
.kw-ph-hrow { display: grid; grid-template-columns: 56px 1fr 30px; gap: 8px; align-items: center; width: 100%; border: 0; background: transparent; padding: 2px 4px;
              color: var(--ui-ink); font: inherit; cursor: pointer; border-radius: 6px; text-align: left; }
.kw-ph-hrow:hover { background: color-mix(in srgb, var(--ui-line) 35%, transparent); }
.kw-ph-hrow .lbl { font-size: .76rem; font-weight: 700; white-space: nowrap; }
.kw-ph-hrow .n { font-size: .7rem; color: var(--ui-ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.kw-ph-stack { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; background: var(--kw-ph-bar-track); }
.kw-ph-stack i { display: flex; align-items: center; justify-content: center; height: 100%; min-width: 2px; font-style: normal; }
.kw-ph-stack i b { font: 700 .64rem 'DM Sans', sans-serif; color: #fff; }
.kw-ph-stack i.on b, .kw-ph-stack i.norep b { color: #1f2937; }
.kw-ph-stack em { font-size: .7rem; color: var(--ui-ink-3); padding-left: 6px; align-self: center; }

/* tables */
.kw-ph-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.kw-ph-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-ink-3); padding: 6px 8px; border-bottom: 1px solid var(--ui-line); white-space: nowrap; }
.kw-ph-table td { padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--ui-line) 60%, transparent); vertical-align: middle; }
.kw-ph-table td small { color: var(--ui-ink-3); margin-left: 4px; font-size: .7rem; }
.kw-ph-table tr.click { cursor: pointer; } .kw-ph-table tr.click:hover td { background: var(--kw-ph-soft); }

/* activities */
.kw-ph-acts-scroll { overflow-x: auto; }
.kw-ph-acts { width: 100%; min-width: 640px; border-collapse: separate; border-spacing: 0; font-size: .8rem; }
.kw-ph-acts th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-ink-3); padding: 6px 8px; border-bottom: 2px solid var(--ui-line); }
.kw-ph-acts td { padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--ui-line) 60%, transparent); vertical-align: middle; }
.kw-ph-acts td.kra { font-weight: 700; vertical-align: top; max-width: 260px; background: color-mix(in srgb, var(--ui-line) 22%, transparent); border-right: 1px solid var(--ui-line); }
.kw-ph-acts tr.obj { cursor: pointer; } .kw-ph-acts tr.obj:hover td:not(.kra) { background: var(--kw-ph-soft); }
.kw-ph-acts td.so .mud-icon-root { vertical-align: middle; margin-right: 4px; }
.kw-ph-acts td.cnt { position: relative; width: 12%; text-align: right; font-variant-numeric: tabular-nums; }
.kw-ph-acts td.cnt .db { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); height: 14px; border-radius: 3px;
                         background: color-mix(in srgb, #f59e0b 45%, transparent); max-width: calc(100% - 12px); }
.kw-ph-acts td.cnt b { position: relative; }
.kw-ph-acts td.tot { text-align: right; font-weight: 800; width: 9%; }
.kw-ph-acts tr.sub td { font-weight: 700; background: color-mix(in srgb, var(--ui-line) 35%, transparent); }
.kw-ph-acts tr.grand td { font-weight: 800; background: color-mix(in srgb, var(--kw-ph-bar) 16%, transparent); border-bottom: 0; }
.kw-ph-acts tr.detail td { background: color-mix(in srgb, var(--ui-line) 14%, transparent); }
.kw-ph-actlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.kw-ph-actlist li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: .78rem; }
.kw-ph-actlist small { color: var(--ui-ink-3); }
.kw-ph-actlist .qd { display: inline-flex; gap: 2px; }
.kw-ph-actlist .qd i { font: 700 .6rem 'DM Sans', sans-serif; font-style: normal; padding: 1px 4px; border-radius: 4px; color: var(--ui-ink-3);
                       border: 1px solid var(--ui-line); }
.kw-ph-actlist .qd i.on { background: var(--kw-ph-bar); color: #fff; border-color: var(--kw-ph-bar); }

/* spotlight */
.kw-ph-spot .kw-ph-seg { margin-bottom: 10px; }
.kw-ph-spot-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.kw-ph-spot-list button { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; padding: 7px 8px;
                          border: 0; border-radius: 10px; background: transparent; color: var(--ui-ink); font: inherit; text-align: left; cursor: pointer; }
.kw-ph-spot-list button:hover { background: var(--kw-ph-soft); }
.kw-ph-spot-list .trail { display: inline-flex; gap: 2px; }
.kw-ph-spot-list .trail i { width: 9px; height: 22px; border-radius: 2px; background: var(--kw-ph-bar-track); }
.kw-ph-spot-list .trail i.above { background: var(--kw-tb-above); } .kw-ph-spot-list .trail i.on { background: var(--kw-tb-on); }
.kw-ph-spot-list .trail i.below { background: var(--kw-tb-below); } .kw-ph-spot-list .trail i.plain { background: #64748b; }
.kw-ph-spot-list .trail i.missing { background: transparent; border: 1px dashed #94A3B8; } .kw-ph-spot-list .trail i.future { opacity: .3; }
.kw-ph-spot-list .txt { display: flex; flex-direction: column; min-width: 0; }
.kw-ph-spot-list .txt strong { font-size: .8rem; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kw-ph-spot-list .txt small { font-size: .7rem; color: var(--ui-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kw-ph-spot-list .fig { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.kw-ph-spot-list .fig small { font-size: .68rem; color: var(--ui-ink-3); white-space: nowrap; }
.kw-ph-spot-list .fig b { font: 800 .8rem 'Outfit', sans-serif; }
.kw-ph-spot-list .fig b.up { color: var(--kw-tb-above-ink); } .kw-ph-spot-list .fig b.down { color: var(--kw-tb-below-ink); }
.kw-dark .kw-ph-spot-list .fig b.up { color: #86efac; } .kw-dark .kw-ph-spot-list .fig b.down { color: #fca5a5; }

/* stations */
.kw-ph-stations { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 16px; }
.kw-ph-stations.nomap { grid-template-columns: 1fr; }
@media (max-width: 1000px) { .kw-ph-stations { grid-template-columns: 1fr; } }
.kw-ph-map { height: 420px; border-radius: 12px; background: var(--mud-palette-background-gray); }
.kw-ph-league { min-width: 0; }
.kw-ph-league-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.kw-ph-league-bar small { color: var(--ui-ink-3); font-size: .74rem; }
.kw-ph-league-scroll { max-height: 440px; overflow: auto; }
.kw-ph-table.league th { position: sticky; top: 0; background: var(--ui-card); z-index: 1; }
.kw-ph-table.league th .sort { border: 0; background: none; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; }
.kw-ph-table.league th .sort.on { color: var(--kw-ph-accent); }
.kw-ph-table.league td.rank { color: var(--ui-ink-3); width: 28px; font-variant-numeric: tabular-nums; }
.kw-ph-table.league td.name button { border: 0; background: none; padding: 0; font: 700 .82rem 'DM Sans', sans-serif; color: var(--kw-ph-accent); cursor: pointer; text-align: left; }
.kw-ph-table.league td.name button:hover { text-decoration: underline; }
.kw-ph-table.league td.name small { display: block; margin: 0; }
.kw-ph-table.league td.barcell { min-width: 150px; white-space: nowrap; }
.kw-ph-table.league td.barcell .bar { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--kw-ph-bar-track); overflow: hidden; vertical-align: middle; margin-right: 8px; }
.kw-ph-table.league td.barcell .bar i { display: block; height: 100%; background: var(--kw-ph-bar); }
.kw-ph-table.league .q { text-align: center; width: 34px; }
.kw-ph-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #e2e8f0; border: 1px solid #cbd5e1; vertical-align: middle; }
.kw-ph-dot.ok { background: #16A34A; border-color: #16A34A; } .kw-ph-dot.sent { background: #2563EB; border-color: #2563EB; }
.kw-ph-dot.part { background: linear-gradient(90deg, #2563EB 50%, transparent 50%); border-color: #2563EB; }
.kw-ph-dot.back { background: #DC2626; border-color: #DC2626; } .kw-ph-dot.none { background: transparent; border: 2px solid #94A3B8; }
.kw-ph-dot.future { opacity: .35; }
.kw-ph-dots-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .7rem; color: var(--ui-ink-3); margin-top: 6px; }
.kw-ph-dots-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* go deeper */
.kw-ph-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.kw-ph-more > a, .kw-ph-more > button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--ui-line);
                                         text-decoration: none; color: var(--ui-ink); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.kw-ph-more > a:hover, .kw-ph-more > button:hover { border-color: var(--kw-ph-accent); background: var(--kw-ph-soft); }
.kw-ph-more .mud-icon-root { color: var(--kw-ph-accent); }
.kw-ph-more span { display: flex; flex-direction: column; } .kw-ph-more b { font-size: .84rem; } .kw-ph-more small { font-size: .72rem; color: var(--ui-ink-3); }

/* objective dialog */
.kw-ph-sodlg-periods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
@media (max-width: 700px) { .kw-ph-sodlg-periods { grid-template-columns: repeat(2, 1fr); } }
.kw-ph-sodlg-periods .cell { border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; }
.kw-ph-sodlg-periods .cell.future { opacity: .5; }
.kw-ph-sodlg-periods small { font-size: .7rem; font-weight: 800; text-transform: uppercase; color: var(--mud-palette-text-secondary); }
.kw-ph-sodlg-periods b { font: 800 1.3rem 'Outfit', sans-serif; } .kw-ph-sodlg-periods em { font-size: .7rem; font-style: normal; color: var(--mud-palette-text-secondary); }
.kw-ph-sodlg .kw-ph-mix { background: color-mix(in srgb, var(--mud-palette-lines-default) 70%, transparent); }
.kw-ph-sodlg-strat td { font-weight: 800; background: color-mix(in srgb, var(--mud-palette-lines-default) 45%, transparent); }
.kw-ph-sodlg-act td { font-weight: 600; font-size: .78rem; padding-left: 18px !important; color: var(--mud-palette-text-secondary); }
.kw-ph-sodlg-ind { cursor: pointer; } .kw-ph-sodlg-ind:hover td { filter: brightness(.97); }
.kw-ph-sodlg-ind td.ind { padding-left: 30px !important; }
.kw-ph-sodlg-table th small { display: block; font-weight: 500; text-transform: none; font-size: .64rem; opacity: .8; }
.kw-ph-kpi { display: inline-block; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: 1px 8px; color: #fff; background: var(--c); white-space: nowrap; }

@media (max-width: 600px) {
    .kw-ph-lens .kw-ph-lens-select { width: 100% !important; }
    .kw-ph-context .asof { margin-left: 0; }
    .kw-ph-card { padding: 14px 12px; }
}

@media print {
    .kw-ph-hero .kw-ui-hero-actions, .kw-ph-lens, .kw-ph-hero .kw-trk-fy, .kw-ph-focusbar, .kw-ph-card.more .kw-ph-more,
    .kw-ph-health-actions, .kw-ph-map-wrap { display: none !important; }
    .kw-ph-grid { display: block; }
    .kw-ph-card { break-inside: avoid; margin-bottom: 10px; border-color: #ccc; }
    .kw-ph-attn, .kw-ph-spot-list, .kw-ph-league-scroll { max-height: none; overflow: visible; }
    .kw-ph-tile { break-inside: avoid; }
}

/* ============================================================================
   EARLY WARNING PHASE CLASSIFICATION — staff side.
   kw-ewe-*: the capture editor (the bulletin's table, one line per livelihood zone, the county last).
   kw-ewv-*: the same table read-only. kw-bb-ew*: the phase picker in the bulk-bulletin grid.
   A phase's colour arrives as --ew (ink --ew-on, darker step --ew-deep) from EarlyWarningPhases.
   Built on MudBlazor's palette variables, so it reads in both themes and inside dialogs.
   ============================================================================ */
.kw-ewe {
    margin-top: 18px; padding: 14px 16px 14px;
    border: 1px solid var(--mud-palette-lines-default); border-radius: 14px;
    background: var(--mud-palette-surface);
}
.mud-dialog .kw-ewe { margin-top: 0; border: none; padding: 0; background: none; }
.kw-ewe-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.kw-ewe-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.95rem; color: var(--mud-palette-text-primary); }
.kw-ewe-hint { font-size: 0.8rem; color: var(--mud-palette-text-secondary); }
.kw-ewe-table { display: flex; flex-direction: column; }
.kw-ewe-row {
    display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(0, 2.6fr) minmax(120px, 0.9fr) 30px;
    align-items: center; gap: 10px;
    padding: 7px 0; border-top: 1px solid var(--mud-palette-lines-default);
}
.kw-ewe-row--head {
    border-top: none; padding: 0 0 6px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--mud-palette-text-secondary);
}
.kw-ewe-zone { min-width: 0; font-size: 0.9rem; color: var(--mud-palette-text-primary); }
.kw-ewe-row--add { grid-template-columns: minmax(130px, 1.1fr) minmax(0, 3.5fr); }
.kw-ewe-addnote { font-size: 0.8rem; color: var(--mud-palette-text-secondary); }
.kw-ewe-row--county {
    margin-top: 6px; padding: 10px; border-top: none; border-radius: 10px;
    background: var(--mud-palette-background-gray);
}
.kw-ewe-row--county.is-missing { outline: 2px solid #dc2626; outline-offset: 1px; }
.kw-ewe-phases { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.kw-ewe-phase {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px;
    border: 1px solid var(--mud-palette-lines-inputs); background: transparent;
    color: var(--mud-palette-text-primary); font: inherit; font-size: 0.78rem; font-weight: 600; cursor: pointer;
    transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.kw-ewe-phase i { width: 10px; height: 10px; border-radius: 3px; background: var(--ew); }
.kw-ewe-phase:hover:not(:disabled) { border-color: var(--ew-deep); transform: translateY(-1px); }
.kw-ewe-phase.on { background: var(--ew); border-color: var(--ew); color: var(--ew-on); font-weight: 800; }
.kw-ewe-phase.on i { background: var(--ew-on); opacity: 0.5; }
.kw-ewe-phase:disabled { cursor: default; opacity: 0.6; }
.kw-ewe-phase.on:disabled { opacity: 1; }
.kw-ewe-phase:focus-visible, .kw-ewe-select:focus-visible, .kw-bb-ewsel:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.kw-ewe-select {
    width: 100%; height: 34px; padding: 0 8px; border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-inputs); background: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary); font: inherit; font-size: 0.84rem;
}
.kw-ewe-select--add { max-width: 280px; font-weight: 600; }
.kw-ewe-x {
    width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent; cursor: pointer;
    color: var(--mud-palette-text-secondary); display: inline-flex; align-items: center; justify-content: center;
}
.kw-ewe-x:hover { background: rgba(220, 38, 38, 0.1); color: #dc2626; }
.kw-ewe-miss { margin: 8px 0 0; font-size: 0.82rem; font-weight: 600; color: #dc2626; }
/* Lines the AI auto-fill read from the bulletin's table: "read" (found in the file) or "check" (not matched). */
.kw-ewe-aitag {
    display: inline-flex; align-items: center; gap: 2px; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; vertical-align: 1px; white-space: nowrap;
    background: #ede9fe; color: #5b21b6;
}
.kw-ewe-aitag.is-check { background: #fef3c7; color: #92400e; }
.kw-ewe-row.is-ai-check { box-shadow: inset 3px 0 0 #f59e0b; }
.kw-ewe-ainote {
    display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 8px;
    font-size: 0.8rem; line-height: 1.45; background: #f5f3ff; color: #4c1d95;
}
.kw-ewe-ainote > div { display: flex; flex-direction: column; gap: 4px; }
.kw-ewe-ainote-x { color: #92400e; }
.kw-ewe-aiok {
    margin-left: 6px; padding: 1px 9px; border: 1px solid #c4b5fd; border-radius: 999px; background: #fff;
    color: #5b21b6; font: inherit; font-weight: 700; cursor: pointer;
}
.kw-ewe-aiok:hover { background: #ede9fe; }
.kw-dark .kw-ewe-aitag { background: rgba(167, 139, 250, 0.18); color: #ddd6fe; }
.kw-dark .kw-ewe-aitag.is-check { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.kw-dark .kw-ewe-ainote { background: rgba(167, 139, 250, 0.1); color: #ddd6fe; }
.kw-dark .kw-ewe-ainote-x { color: #fcd34d; }
.kw-dark .kw-ewe-aiok { background: transparent; color: #ddd6fe; border-color: rgba(167, 139, 250, 0.45); }
@media (max-width: 760px) {
    .kw-ewe-row--head { display: none; }
    .kw-ewe-row, .kw-ewe-row--county {
        grid-template-columns: minmax(0, 1fr) 30px;
        grid-template-areas: "zone x" "phase phase" "trend trend";
    }
    .kw-ewe-row > :nth-child(1) { grid-area: zone; }
    .kw-ewe-row > :nth-child(2) { grid-area: phase; }
    .kw-ewe-row > :nth-child(3) { grid-area: trend; }
    .kw-ewe-row > :nth-child(4) { grid-area: x; }
    .kw-ewe-row--add { grid-template-columns: 1fr; grid-template-areas: none; }
    .kw-ewe-row--add > * { grid-area: auto; }
}

/* read-only: the table as the bulletin prints it — the phase column filled with the phase's colour */
.kw-ewv { width: 100%; border-collapse: collapse; font-size: 0.88rem; color: var(--mud-palette-text-primary); }
.kw-ewv caption { caption-side: top; text-align: left; padding-bottom: 8px; font-weight: 700; font-size: 0.82rem; }
.kw-ewv th, .kw-ewv td { padding: 7px 10px; border: 1px solid var(--mud-palette-lines-default); text-align: left; vertical-align: middle; }
.kw-ewv thead th {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--mud-palette-text-secondary); background: var(--mud-palette-background-gray);
}
.kw-ewv tbody th { font-weight: 500; }
.kw-ewv td:nth-child(2) { padding: 0; width: 30%; }
.kw-ewv-phase { display: block; padding: 7px 10px; background: var(--ew); color: var(--ew-on); font-weight: 700; text-align: center; }
.kw-ewv-phase--chip { display: inline-block; padding: 2px 10px; border-radius: 6px; font-size: 0.8rem; }
.kw-ewv-county th, .kw-ewv-county td { font-weight: 700; border-top-width: 2px; }
.kw-ewv-none { display: block; padding: 7px 10px; color: var(--mud-palette-text-secondary); }
.kw-ewv td:not(:nth-child(2)) .kw-ewv-none { padding: 0; }
.kw-ewv-trend { white-space: nowrap; }

/* bulk bulletins: one pick per file, the phase's colour along the box's left edge */
.kw-bb-ew { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.kw-bb-ewsel.kw-bb-ewtrend { min-width: 118px; border-left-width: 1px; }
.kw-bb-ewsel {
    height: 36px; min-width: 126px; padding: 0 6px; border-radius: 6px;
    border: 1px solid var(--mud-palette-lines-inputs); border-left: 6px solid var(--ew, var(--mud-palette-lines-inputs));
    background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); font: inherit; font-size: 0.84rem;
}
.kw-bb-ewmore {
    border: none; background: none; padding: 0; cursor: pointer; white-space: nowrap;
    color: var(--mud-palette-primary); font: inherit; font-size: 0.78rem; font-weight: 600;
}
.kw-bb-ewmore:disabled, .kw-bb-ewsel:disabled { opacity: 0.6; cursor: default; }
/* The AI's read of a bulletin's phase table, under the phase pick */
.kw-bb-ewread {
    display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px;
    font-size: 0.74rem; font-weight: 600; line-height: 1.35; color: var(--mud-palette-text-secondary);
}
.kw-bb-ewread.is-ok { color: #5b21b6; }
.kw-bb-ewread.is-check { color: #92400e; }
.kw-bb-ewread.is-bad { color: #b91c1c; font-weight: 500; }
.kw-bb-ewread .kw-bb-confirm { margin-left: 0; }
.kw-bb-ainote {
    display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px;
    background: #f5f3ff; color: #4c1d95; font-size: 0.84rem; line-height: 1.45;
}
.kw-dark .kw-bb-ewread.is-ok { color: #c4b5fd; }
.kw-dark .kw-bb-ewread.is-check { color: #fcd34d; }
.kw-dark .kw-bb-ewread.is-bad { color: #fca5a5; }
.kw-dark .kw-bb-ainote { background: rgba(167, 139, 250, 0.1); color: #ddd6fe; }


/* ── Download protection: the options editor, the publish dialog, Admin › Download protection, the PDF wizard ── */
.kw-prot { display: flex; flex-direction: column; gap: 12px; }
.kw-prot-sec { border: 1px solid var(--kw-line, #e2e8f0); border-radius: 12px; padding: 12px 14px; }
.kw-prot-sec h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 0.92rem; font-weight: 600; }
.kw-prot-sec p { margin: -4px 0 0; font-size: 0.8rem; color: var(--mud-palette-text-secondary); }
.kw-prot-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.kw-prot-head h3 { margin-bottom: 4px; }
.kw-prot-opts { display: flex; flex-wrap: wrap; gap: 0 20px; }
.kw-prot-preview { margin-top: 6px; font-size: 0.74rem; color: #334155; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 6px 10px; }
.kw-prot-rec { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: #ecfdf5; color: #065f46; font-size: 0.84rem; }
.kw-prot-rec small { color: #047857; }
.kw-prot-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border: 1px solid var(--kw-line, #e2e8f0); border-radius: 12px; }
.kw-prot-mode { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.kw-prot-mode b { font-weight: 600; }
.kw-prot-mode-sub { display: block; font-size: 0.78rem; color: var(--mud-palette-text-secondary); }
.kw-dark .kw-prot-preview { background: rgba(148, 163, 184, 0.08); border-color: rgba(148, 163, 184, 0.35); color: #cbd5e1; }
.kw-dark .kw-prot-rec { background: rgba(16, 185, 129, 0.12); color: #a7f3d0; }
.kw-dark .kw-prot-rec small { color: #6ee7b7; }

/* Admin › Download protection */
.kw-dp-profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.kw-dp-card { border: 1px solid var(--kw-line, #e2e8f0); border-radius: 14px; padding: 14px 16px; background: var(--mud-palette-surface); display: flex; flex-direction: column; gap: 8px; }
.kw-dp-card.is-default { border-color: #6366f1; box-shadow: 0 0 0 1px #6366f1 inset; }
.kw-dp-card h3 { margin: 0; font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.kw-dp-card p { margin: 0; font-size: 0.82rem; color: var(--mud-palette-text-secondary); }
.kw-dp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.kw-dp-card-foot { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 4px; }
.kw-dp-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.kw-dp-table th { text-align: left; font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mud-palette-text-secondary); padding: 8px 10px; border-bottom: 1px solid var(--kw-line, #e2e8f0); }
.kw-dp-table td { padding: 6px 10px; border-bottom: 1px solid var(--kw-line, #eef2f7); vertical-align: middle; }
.kw-dp-table tr.is-class td:first-child { font-weight: 600; }
.kw-dp-table .kw-dp-kind { font-size: 0.7rem; color: var(--mud-palette-text-secondary); margin-left: 6px; }
.kw-dp-table .kw-dp-inherit { font-size: 0.76rem; color: var(--mud-palette-text-secondary); }
.kw-dp-engine { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; font-size: 0.86rem; }
.kw-dp-engine.is-ok { background: #ecfdf5; color: #065f46; }
.kw-dp-engine.is-off { background: #fef3c7; color: #92400e; }
.kw-dark .kw-dp-engine.is-ok { background: rgba(16, 185, 129, 0.12); color: #a7f3d0; }
.kw-dark .kw-dp-engine.is-off { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }

/* The Convert to PDF wizard */
.kw-pdfwiz-steps { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.kw-pdfwiz-step { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--kw-line, #e2e8f0); font-size: 0.84rem; color: var(--mud-palette-text-secondary); }
.kw-pdfwiz-step b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--kw-line, #e2e8f0); color: inherit; font-size: 0.74rem; }
.kw-pdfwiz-step.is-on { border-color: #10b981; color: #065f46; background: #ecfdf5; font-weight: 600; }
.kw-pdfwiz-step.is-on b { background: #10b981; color: #fff; }
.kw-pdfwiz-step.is-done b { background: #10b981; color: #fff; }
.kw-dark .kw-pdfwiz-step.is-on { background: rgba(16, 185, 129, 0.12); color: #a7f3d0; }
.kw-pdfwiz-card { border: 1px solid var(--kw-line, #e2e8f0); border-radius: 14px; padding: 18px 20px; background: var(--mud-palette-surface); }
.kw-pdfwiz-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; }
.kw-pdfwiz-facts div { border: 1px solid var(--kw-line, #e2e8f0); border-radius: 10px; padding: 8px 12px; }
.kw-pdfwiz-facts small { display: block; font-size: 0.72rem; color: var(--mud-palette-text-secondary); }
.kw-pdfwiz-facts strong { font-size: 0.98rem; }
.kw-pdfwiz-flow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.kw-pdfwiz-file { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--kw-line, #e2e8f0); }
.kw-pdfwiz-viewer { height: 70vh; min-height: 420px; border: 1px solid var(--kw-line, #e2e8f0); border-radius: 12px; overflow: hidden; background: #f1f5f9; }
.kw-pdfwiz-viewer .kw-pv { height: 100%; }
.kw-dark .kw-pdfwiz-viewer { background: #0b1220; }

/* ── National progress report (/progress/national-report) and its breakdown dialog ── */
.kw-ui-hero.kw-nprpt-hero { background: linear-gradient(128deg, #1f3864 0%, #2f5597 55%, #4472C4 125%); }
.kw-nprpt-fy button.on { color: #1f3864; }
.mud-button-root.kw-nprpt-hero-link { color: #fff; border-color: rgba(255,255,255,.6); }
.mud-button-root.kw-nprpt-hero-link:hover { background: rgba(255,255,255,.12); }
.kw-nprpt-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 12px; }
.kw-nprpt-kpi { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 10px;
    background: var(--mud-palette-surface, #fff); text-align: left; font: inherit; color: inherit; min-width: 0; }
.kw-nprpt-kpi .lab { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-ink-2); }
.kw-nprpt-kpi .val { font-size: 1.25rem; font-weight: 800; color: #1f3864; line-height: 1.2; }
.kw-nprpt-kpi .val small { font-size: .78rem; font-weight: 600; color: var(--ui-ink-2); }
.kw-nprpt-kpi .sub { font-size: .74rem; color: var(--ui-ink-2); }
.kw-nprpt-kpi--btn { cursor: pointer; }
.kw-nprpt-kpi--btn:hover { border-color: #4472C4; box-shadow: 0 2px 8px rgba(68,114,196,.15); }
.kw-nprpt-kpi.warn .val { color: #9C0006; }
.kw-nprpt-bar { display: block; height: 6px; border-radius: 99px; background: #D9E1F2; overflow: hidden; margin-top: 4px; }
.kw-nprpt-bar > span { display: block; height: 100%; background: #4472C4; border-radius: 99px; }
.kw-nprpt-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 10px; }
.kw-nprpt-toolbar .kw-nprpt-search { flex: 1 1 280px; max-width: 420px; margin: 0; }
.kw-nprpt-toolbar .kw-nprpt-so { flex: 0 1 300px; margin: 0; }
.kw-nprpt-count { margin-left: auto; font-size: .78rem; color: var(--ui-ink-2); }
.kw-nprpt-seg { display: inline-flex; border: 1px solid #b4c6e7; border-radius: 999px; overflow: hidden; background: var(--mud-palette-surface, #fff); }
.kw-nprpt-seg button { border: 0; background: transparent; padding: 6px 14px; font: inherit; font-size: .8rem; font-weight: 600; color: #1f3864; cursor: pointer; }
.kw-nprpt-seg button + button { border-left: 1px solid #b4c6e7; }
.kw-nprpt-seg button.on { background: #4472C4; color: #fff; }
.kw-nprpt-seg button:disabled { opacity: .4; cursor: default; }
.kw-nprpt-seg button:focus-visible { outline: 2px solid #f59e0b; outline-offset: -2px; }
.kw-nprpt-wrap { max-height: calc(100vh - 280px); min-height: 360px; }
.kw-prpt td.kw-nprpt-cell { cursor: pointer; position: relative; }
.kw-prpt td.kw-nprpt-cell:hover { box-shadow: inset 0 0 0 2px #4472C4; }
.kw-prpt td.kw-nprpt-cell.none { cursor: default; }
.kw-prpt td.kw-nprpt-cell.none:hover { box-shadow: none; }
.kw-nprpt-of { display: block; font-size: .62rem; font-weight: 700; opacity: .7; }
.kw-nprpt-ind { border: 0; background: none; padding: 0; font: inherit; color: #1f3864; text-align: left; cursor: pointer; text-decoration: underline;
    text-decoration-color: #b4c6e7; text-underline-offset: 2px; }
.kw-nprpt-ind:hover { text-decoration-color: #4472C4; }
.kw-nprpt-tag { display: inline-block; margin: 4px 4px 0 0; padding: 0 6px; border-radius: 99px; font-size: .64rem; font-weight: 700;
    background: #EAF1FF; color: #1f3864; font-family: var(--mud-typography-default-family); }
.kw-nprpt-tag.notcum { background: #FFF4D6; color: #7a4d00; }
.kw-prpt td.kw-nprpt-cov { color: #595959; font-size: .7rem; }
.kw-prpt td.kw-nprpt-cov.draft { color: #7a4d00; }
.kw-nprpt-stations { overflow: auto; border: 1px solid #b4c6e7; border-radius: 8px; }
.kw-nprpt-st { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 860px; }
.kw-nprpt-st th { background: #D9E1F2; color: #000080; text-align: left; padding: 7px 10px; font-size: .74rem; position: sticky; top: 0; }
.kw-nprpt-st td { padding: 6px 10px; border-top: 1px solid #e2e8f0; vertical-align: top; }
.kw-nprpt-st .n { text-align: center; }
.kw-nprpt-st td.name { font-weight: 700; color: #1f3864; }
.kw-nprpt-st td.act { white-space: nowrap; text-align: right; }
.kw-nprpt-st tr.noplan td { color: #64748b; font-style: italic; }
.kw-nprpt-state { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .72rem; font-weight: 700; background: #f1f5f9; color: #475569; }
.kw-nprpt-state.acc { background: #C6EFCE; color: #006100; }
.kw-nprpt-state.sub { background: #FFEB9C; color: #9C5700; }
.kw-nprpt-state.part { background: #FFF4D6; color: #7a4d00; }
.kw-nprpt-state.ret, .kw-nprpt-state.not { background: #FFC7CE; color: #9C0006; }
.kw-nprpt-lines { display: block; font-size: .68rem; color: #64748b; margin-top: 2px; }
.kw-nprpt-foot { font-size: .74rem; color: var(--ui-ink-2); margin: 8px 10px; }
.kw-nprpt-cta .kw-prpt-cta-icon { background: #1f3864; }

.kw-nprd-head { margin: 0 0 12px; }
.kw-nprd-trail { font-size: .74rem; color: var(--ui-ink-2); }
.kw-nprd-ind { font-size: 1.05rem; font-weight: 800; color: #1f3864; margin: 2px 0 6px; }
.kw-nprd-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .78rem; color: var(--ui-ink-2); }
.kw-nprd-meta b { color: var(--mud-palette-text-primary); }
.kw-nprd-how { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding: 7px 10px; border-radius: 8px; background: #EAF1FF; color: #1f3864; font-size: .78rem; }
.kw-nprd-periods { margin: 0 0 12px; }
.kw-nprd-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 10px; }
.kw-nprd-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--ui-line); border-radius: 10px; }
.kw-nprd-tile .lab { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-ink-2); }
.kw-nprd-tile .val { font-size: 1.35rem; font-weight: 800; color: #1f3864; line-height: 1.2; }
.kw-nprd-tile .sub { font-size: .72rem; color: var(--ui-ink-2); }
.kw-nprd-tile.main { border-width: 2px; border-color: #4472C4; }
.kw-nprd-tile.exceeded { background: #C6EFCE; border-color: #006100; }
.kw-nprd-tile.exceeded .val { color: #006100; }
.kw-nprd-tile.met { background: #FFEB9C; border-color: #9C6500; }
.kw-nprd-tile.met .val { color: #9C6500; }
.kw-nprd-tile.below { background: #FFC7CE; border-color: #9C0006; }
.kw-nprd-tile.below .val { color: #9C0006; }
.kw-nprd-tile.exceeded .lab, .kw-nprd-tile.exceeded .sub, .kw-nprd-tile.met .lab, .kw-nprd-tile.met .sub,
.kw-nprd-tile.below .lab, .kw-nprd-tile.below .sub { color: #334155; }
.kw-nprd-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; font-size: .78rem; }
.kw-nprd-sum .lab { font-weight: 700; color: var(--ui-ink-2); }
.kw-nprd-sum .term { padding: 2px 8px; border-radius: 99px; background: #f1f5f9; color: #334155; }
.kw-nprd-sum .term.more { background: transparent; font-style: italic; }
.kw-nprd-sum .eq { font-size: .9rem; color: #1f3864; }
.kw-nprd-tablewrap { overflow: auto; border: 1px solid #b4c6e7; border-radius: 8px; }
.kw-nprd-table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 820px; }
.kw-nprd-table th { background: #D9E1F2; color: #000080; padding: 6px 8px; font-size: .74rem; text-align: center; }
.kw-nprd-table th small { display: block; font-weight: 500; font-size: .62rem; opacity: .75; }
.kw-nprd-table th.st { text-align: left; }
.kw-nprd-table th.focus, .kw-nprd-table td.focus { box-shadow: inset 0 0 0 2px #4472C4; }
.kw-nprd-table td { padding: 5px 8px; border-top: 1px solid #e2e8f0; vertical-align: middle; }
.kw-nprd-table td.st { min-width: 210px; }
.kw-nprd-table td.st small, .kw-nprd-table tfoot td.st small { display: block; font-size: .68rem; color: #64748b; font-weight: 500; }
.kw-nprd-table td.q { text-align: center; white-space: nowrap; }
.kw-nprd-table td.q .a { font-weight: 700; }
.kw-nprd-table td.q .t { font-size: .7rem; opacity: .75; margin-left: 2px; }
.kw-nprd-table td.q .s { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 700; opacity: .7; }
.kw-nprd-table td.q .na { color: #94a3b8; }
.kw-nprd-table td.q.exceeded { background: #C6EFCE; color: #006100; }
.kw-nprd-table td.q.met { background: #FFEB9C; color: #9C6500; }
.kw-nprd-table td.q.below { background: #FFC7CE; color: #9C0006; }
.kw-nprd-table td.q.unsub { background: #EDEDED; color: #595959; font-style: italic; }
.kw-nprd-table td.q.none { color: #94a3b8; }
.kw-nprd-table td.ytd { background: #EAF1FF; color: #1f3864; }
.kw-nprd-table tr.out td.st b { color: #64748b; }
.kw-nprd-table td.share { min-width: 90px; white-space: nowrap; }
.kw-nprd-table td.share small { margin-left: 6px; font-size: .7rem; color: #475569; }
.kw-nprd-share { display: inline-block; vertical-align: middle; width: 56px; height: 7px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.kw-nprd-share > span { display: block; height: 100%; background: #4472C4; }
.kw-nprd-table td.go { width: 40px; text-align: right; }
.kw-nprd-table tfoot td { background: #D9E1F2; border-top: 2px solid #4472C4; font-weight: 700; color: #1f3864; }
.kw-nprd-stbtn { display: flex; align-items: flex-start; gap: 4px; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.kw-nprd-stbtn:focus-visible { outline: 2px solid #f59e0b; outline-offset: 2px; border-radius: 4px; }
.kw-nprd-table tr.detail td { background: #f8fafc; border-top: 0; }
.kw-nprd-detail { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 2fr); gap: 10px 20px; padding: 6px 4px 10px 26px; }
.kw-nprd-detail dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: .76rem; }
.kw-nprd-detail dt { color: #64748b; font-weight: 600; }
.kw-nprd-detail dd { margin: 0; color: #1f2937; }
.kw-nprd-remarks { display: grid; gap: 6px; }
.kw-nprd-remarks .rm { display: flex; flex-direction: column; font-size: .76rem; padding: 5px 8px; border-left: 3px solid #b4c6e7; background: #fff; border-radius: 0 6px 6px 0; }
.kw-nprd-remarks .rm .h { font-weight: 700; color: #1f3864; font-size: .7rem; }
.kw-nprd-remarks .rm .b { color: #334155; white-space: pre-wrap; }
.kw-nprd-detail > .mud-button-root { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 700px) { .kw-nprd-detail { grid-template-columns: 1fr; padding-left: 4px; } }
.kw-dark .kw-nprpt-kpi .val, .kw-dark .kw-nprd-tile .val, .kw-dark .kw-nprd-ind, .kw-dark .kw-nprpt-st td.name, .kw-dark .kw-nprpt-ind { color: #c7d7f5; }
.kw-dark .kw-nprd-how { background: rgba(68,114,196,.18); color: #c7d7f5; }
.kw-dark .kw-nprd-table tr.detail td, .kw-dark .kw-nprd-remarks .rm { background: rgba(255,255,255,.04); }
.kw-dark .kw-nprd-detail dd, .kw-dark .kw-nprd-remarks .rm .b { color: #e2e8f0; }
.kw-dark .kw-nprd-remarks .rm .h { color: #c7d7f5; }
.kw-dark .kw-nprd-table td, .kw-dark .kw-nprpt-st td { border-top-color: rgba(255,255,255,.08); }
.kw-dark .kw-nprd-sum .term { background: rgba(255,255,255,.08); color: #e2e8f0; }
.kw-dark .kw-nprd-table td.ytd { background: rgba(68,114,196,.2); color: #c7d7f5; }
.kw-dark .kw-nprpt-seg { background: transparent; }
.kw-dark .kw-nprpt-seg button { color: #c7d7f5; }
.kw-dark .kw-nprpt-seg button.on { color: #fff; }

/* ── Strategic plan progress report (/progress/strategic-plan-report) ── */
.kw-ui-hero.kw-sprpt-hero { background: linear-gradient(128deg, #134e4a 0%, #0f766e 55%, #14b8a6 125%); }
.kw-sprpt-plans button.on { color: #0f766e; }
.mud-button-root.kw-prpt-hero-btn.sp { color: #0f766e; }
.mud-button-root.kw-sprpt-view-btn { background: #0f766e; color: #fff; }
.mud-button-root.kw-sprpt-view-btn:hover { background: #115e59; }
.kw-sprpt-cta .kw-prpt-cta-icon { background: #0f766e; }
.kw-nprpt-kpi .val.kw-sprpt-small, .kw-nprd-tile .val.kw-sprd-small { font-size: .95rem; }
.kw-nprpt-kpi.kw-sprpt-year.now { border-color: #14b8a6; box-shadow: inset 0 3px 0 #14b8a6; }
.kw-nprpt-kpi.kw-sprpt-year.future { opacity: .6; }
.kw-prpt.kw-sprpt { min-width: 1500px; }
.kw-prpt thead th.kw-sprpt-yr small, .kw-prpt thead th.kw-sprpt-plan small { display: block; font-size: .64rem; font-weight: 600; opacity: .75; }
.kw-prpt thead th.kw-sprpt-yr.now { background: #CFF5EE; }
.kw-prpt thead th.kw-sprpt-yr.future { color: #64748b; }
.kw-prpt thead th.kw-sprpt-plan { background: #B4C6E7; }
.kw-prpt td.kw-sprpt-t { background: #E2EFDA; color: #1f2937; }
.kw-prpt td.kw-sprpt-t.none { color: #94a3b8; }
.kw-prpt td.kw-sprpt-pct { font-size: .72rem; color: #475569; }
.kw-prpt td.kw-prpt-a.partial { font-style: italic; }
.kw-sprpt-nwp { font-size: .6rem; font-weight: 700; text-transform: uppercase; color: #94a3b8; letter-spacing: .03em; }
.kw-sprd-years td.q { white-space: normal; }
.kw-sprd-q { margin-top: 4px; }
.kw-dark .kw-prpt td.kw-sprpt-pct { color: #cbd5e1; }

/* ── Not implemented / not reported (national and strategic plan progress reports) ── */
.kw-gap-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0 0 12px; }
.kw-gap-tile { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--ui-line); border-left-width: 4px;
    border-radius: 10px; background: var(--mud-palette-surface, #fff); text-align: left; font: inherit; color: inherit; cursor: pointer; min-width: 0; }
.kw-gap-tile .lab { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-ink-2); }
.kw-gap-tile .val { font-size: 1.3rem; font-weight: 800; color: #1f3864; line-height: 1.2; }
.kw-gap-tile .val small { font-size: .78rem; font-weight: 600; color: var(--ui-ink-2); }
.kw-gap-tile .sub { font-size: .72rem; color: var(--ui-ink-2); }
.kw-gap-tile:hover { box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.kw-gap-tile.on { box-shadow: inset 0 0 0 2px #4472C4; }
.kw-gap-tile.notimpl { border-left-color: #9C0006; } .kw-gap-tile.notimpl .val { color: #9C0006; }
.kw-gap-tile.norep { border-left-color: #B45309; } .kw-gap-tile.norep .val { color: #9C5700; }
.kw-gap-tile.nostation, .kw-gap-tile.nowp { border-left-color: #64748b; }
.kw-gap-tile.act { border-left-color: #7F1D1D; }
.kw-gap-years { margin: 0 0 12px; flex-wrap: wrap; }
.kw-gap-so { margin: 14px 0 6px; padding: 6px 10px; background: #EAF1FF; color: #FF0000; font-weight: 700; font-family: Cambria, Georgia, serif; border-radius: 6px; }
.kw-gap-act { border: 1px solid #e2e8f0; border-radius: 8px; margin: 0 0 8px; overflow: hidden; }
.kw-gap-act.dead { border-color: #FFC7CE; }
.kw-gap-act-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 7px 12px; background: #f8fafc; }
.kw-gap-act.dead .kw-gap-act-head { background: #FFF5F6; }
.kw-gap-act-head .name { font-weight: 700; color: #1f3864; font-size: .86rem; }
.kw-gap-act-head .tally { font-size: .74rem; color: #64748b; }
.kw-gap-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 12px; border-top: 1px solid #eef2f7; }
.kw-gap-item .body { flex: 1 1 auto; min-width: 0; }
.kw-gap-item .ind { font-weight: 600; font-size: .84rem; }
.kw-gap-item .meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .74rem; color: #64748b; }
.kw-gap-item .who { font-size: .74rem; margin-top: 2px; color: #334155; }
.kw-gap-item .who b { font-weight: 700; margin-right: 4px; }
.kw-gap-item .who.norep b { color: #9C5700; }
.kw-gap-item .who.zero b { color: #9C0006; }
.kw-gap-item .who.draft b { color: #595959; }
.kw-gap-chip { flex: none; display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .7rem; font-weight: 700; white-space: nowrap; background: #EDEDED; color: #475569; }
.kw-gap-chip.notimpl { background: #FFC7CE; color: #9C0006; }
.kw-gap-chip.norep { background: #FFEB9C; color: #9C5700; }
.kw-gap-chip.dead { background: #9C0006; color: #fff; }
.kw-dark .kw-gap-tile .val, .kw-dark .kw-gap-act-head .name { color: #c7d7f5; }
.kw-dark .kw-gap-act, .kw-dark .kw-gap-item { border-color: rgba(255,255,255,.08); }
.kw-dark .kw-gap-act-head { background: rgba(255,255,255,.04); }
.kw-dark .kw-gap-act.dead .kw-gap-act-head { background: rgba(156,0,6,.18); }
.kw-dark .kw-gap-item .who { color: #e2e8f0; }
.kw-dark .kw-gap-so { background: rgba(68,114,196,.18); color: #fca5a5; }
.kw-gap-tile > span, .kw-nprpt-kpi--btn > span { display: block; width: 100%; text-align: left; }
.kw-nprd-note { margin-top: 8px; padding: 7px 10px; border-radius: 8px; border-left: 3px solid #00B050; background: #F0FAF3; font-size: .78rem; color: #1f2937; white-space: pre-wrap; }
.kw-nprd-note b { color: #006100; margin-right: 6px; }
.kw-dark .kw-nprd-note { background: rgba(0,176,80,.12); color: #e2e8f0; }

/* ── Legacy migration: documents panel (/admin/migration) ── */
.kw-lmig-folder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .82rem; padding: 8px 10px; border-radius: 8px; background: var(--mud-palette-background-gray, #f1f5f9); }
.kw-lmig-folder b.ok { color: #15803d; }
.kw-lmig-folder b.bad { color: #b91c1c; }
.kw-lmig-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.kw-lmig-tiles > div { border: 1px solid var(--mud-palette-lines-default, #e2e8f0); border-left-width: 4px; border-radius: 8px; padding: 8px 10px; font-size: .75rem; color: var(--mud-palette-text-secondary); }
.kw-lmig-tiles > div span { display: block; font-size: 1.25rem; font-weight: 800; color: var(--mud-palette-text-primary); }
.kw-lmig-tiles > div.go { border-left-color: #2563eb; }
.kw-lmig-tiles > div.ok { border-left-color: #16a34a; }
.kw-lmig-tiles > div.off { border-left-color: #94a3b8; }
.kw-lmig-tiles > div.bad { border-left-color: #dc2626; }
.kw-lmig-types td.n, .kw-lmig-types th.n { text-align: right; }
.kw-lmig-out tr.failed td { color: #b91c1c; }
.kw-lmig-out tr.skipped td { color: #64748b; }
.kw-lmig-out tr.matched td { color: #1d4ed8; }

/* ══════════ MY INBOX — /inbox (MyInbox, InboxButton) ══════════
   Each item carries its module colour as --c and its group's as --g; urgency is a class (is-overdue, is-duesoon,
   is-waiting, is-info) and is always also said in words (the due line), never by colour alone. */
.kw-inbox-trigger {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 6px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85); text-decoration: none; transition: background 0.15s ease;
}
.kw-inbox-trigger:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.kw-inbox-badge {
    position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: #2563EB; color: #fff; font-size: 0.62rem; font-weight: 700;
    display: grid; place-items: center; box-shadow: 0 0 0 2px #111A24;
}
.kw-inbox-trigger.has-overdue .kw-inbox-badge { background: #DC2626; }

.kw-inbox-refresh {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: #fff; font: inherit; font-size: 0.82rem; font-weight: 600;
}
.kw-inbox-refresh:hover { background: rgba(255, 255, 255, 0.18); }
.kw-spin { animation: kwInboxSpin 0.9s linear infinite; }
@keyframes kwInboxSpin { to { transform: rotate(360deg); } }

.kw-inbox-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kw-inbox-kpi {
    display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
    text-align: left; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--kw-border); background: var(--kw-surface);
    font: inherit; color: var(--kw-text-primary); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.kw-inbox-kpi:not(.is-quiet):hover:not([disabled]) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); }
.kw-inbox-kpi[disabled] { cursor: default; opacity: 0.7; }
.kw-inbox-kpi.is-quiet { cursor: default; background: var(--kw-surface-muted); }
.kw-inbox-kpi b { display: block; font-family: 'Outfit', sans-serif; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kw-inbox-kpi span { font-size: 0.8rem; color: var(--kw-text-secondary); }
.kw-inbox-kpi.is-overdue b { color: #DC2626; }
.kw-inbox-kpi.is-soon b { color: #D97706; }
.kw-inbox-kpi.on { border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

.kw-inbox-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.kw-inbox-chips button {
    display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--kw-border); background: var(--kw-surface); color: var(--kw-text-secondary); font: inherit; font-size: 0.8rem; font-weight: 600;
}
.kw-inbox-chips button i { width: 8px; height: 8px; border-radius: 50%; background: var(--g, #94A3B8); }
.kw-inbox-chips button b { font-variant-numeric: tabular-nums; color: var(--kw-text-primary); }
.kw-inbox-chips button.on { border-color: var(--g, #2563EB); color: var(--kw-text-primary); background: color-mix(in srgb, var(--g, #2563EB) 10%, var(--kw-surface)); }

.kw-inbox-group { margin-bottom: 18px; border: 1px solid var(--kw-border); border-radius: 18px; background: var(--kw-surface); overflow: hidden; }
.kw-inbox-group-head {
    display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--kw-border);
    background: linear-gradient(90deg, color-mix(in srgb, var(--g) 9%, var(--kw-surface)), var(--kw-surface) 70%);
}
.kw-inbox-group-head > .mud-icon-root { color: var(--g); margin-top: 2px; }
.kw-inbox-group-head > div { flex: 1; min-width: 0; }
.kw-inbox-group-head h2 { margin: 0; font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 700; color: var(--kw-text-primary); display: flex; align-items: center; gap: 8px; }
.kw-inbox-group-head h2 span { font-size: 0.75rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--g); color: #fff; }
.kw-inbox-group-head p { margin: 3px 0 0; font-size: 0.82rem; color: var(--kw-text-secondary); }
.kw-inbox-all { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--g); text-decoration: none; white-space: nowrap; margin-top: 2px; }
.kw-inbox-all:hover { text-decoration: underline; }
.kw-inbox-list { list-style: none; margin: 0; padding: 0; }
.kw-inbox-item { position: relative; display: flex; align-items: center; gap: 14px; padding: 13px 18px 13px 20px; border-top: 1px solid var(--kw-border-subtle); }
.kw-inbox-item:first-child { border-top: 0; }
.kw-inbox-item::before { content: ''; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.kw-inbox-item.is-overdue::before { background: #DC2626; }
.kw-inbox-item.is-duesoon::before { background: #D97706; }
.kw-inbox-item:hover { background: var(--kw-surface-hover); }
.kw-inbox-item-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.kw-inbox-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kw-inbox-item-title { font-weight: 600; font-size: 0.92rem; color: var(--kw-text-primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kw-inbox-item-title:hover { text-decoration: underline; }
.kw-inbox-item-detail { font-size: 0.8rem; color: var(--kw-text-secondary); }
.kw-inbox-item-note { font-size: 0.8rem; font-style: italic; color: var(--kw-text-secondary); padding-left: 10px; border-left: 2px solid var(--kw-border); margin: 2px 0; }
.kw-inbox-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 0.74rem; color: var(--kw-text-muted); margin-top: 2px; }
.kw-inbox-tag { padding: 1px 8px; border-radius: 999px; background: var(--kw-surface-muted); border: 1px solid var(--kw-border); color: var(--kw-text-secondary); }
.kw-inbox-due { font-weight: 700; color: var(--kw-text-secondary); }
.kw-inbox-item.is-overdue .kw-inbox-due { color: #DC2626; }
.kw-inbox-item.is-duesoon .kw-inbox-due { color: #B45309; }
.kw-inbox-go {
    flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 7px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
    font-size: 0.8rem; font-weight: 600; color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: var(--kw-surface);
}
.kw-inbox-go:hover { background: var(--c); color: #fff; }
.kw-inbox-more { margin: 0; padding: 10px 18px; font-size: 0.8rem; color: var(--kw-text-secondary); border-top: 1px solid var(--kw-border-subtle); }
.kw-inbox-more a { color: var(--g); font-weight: 600; }
.kw-inbox-empty { text-align: center; padding: 56px 24px; border: 1.5px dashed var(--kw-border); border-radius: 20px; background: var(--kw-surface); }
.kw-inbox-empty-mark { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: linear-gradient(135deg, #10B981, #059669); }
.kw-inbox-empty h2 { margin: 0 0 6px; font-family: 'Outfit', sans-serif; font-size: 1.3rem; color: var(--kw-text-primary); }
.kw-inbox-empty p { margin: 0 auto 14px; max-width: 56ch; font-size: 0.9rem; color: var(--kw-text-secondary); }
.kw-inbox-empty-link { font-weight: 600; color: #2563EB; }
@media (max-width: 900px) { .kw-inbox-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .kw-inbox-item { flex-wrap: wrap; }
    .kw-inbox-item-title { white-space: normal; }
    .kw-inbox-go { margin-left: 50px; }
    .kw-inbox-group-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .kw-spin { animation: none; } }

/* Quarterly board pack button (BoardPackButton) — NDMA forest, so it reads as the board's document, not an export. */
.kw-bp-btn { box-shadow: none; }
.kw-bp-btn .mud-button-root, .kw-bp-btn .kw-bp-more .mud-icon-button { background: #217A40 !important; color: #fff !important; text-transform: none; font-weight: 600; }
.kw-bp-btn .mud-button-root:hover, .kw-bp-btn .kw-bp-more .mud-icon-button:hover { background: #1B6735 !important; }
.kw-bp-btn .kw-bp-more .mud-icon-button { border-radius: 0 6px 6px 0; padding: 4px 2px; border-left: 1px solid rgba(255,255,255,0.3); }
.kw-bp-btn .kw-bp-main { border-radius: 6px 0 0 6px; }
.kw-bp-btn:not(:has(.kw-bp-more)) .kw-bp-main { border-radius: 6px; }
.kw-bp-cta .kw-prpt-cta-icon { background: linear-gradient(135deg, #217A40, #0E371B); color: #fff; }

/* ── Registries (Documents › Registry): the table fits its card ──────────────
   The actions cell used to be one unbreakable line of up to five buttons, so the table outgrew the card and
   everything right of "Type" was cut off. Actions now wrap inside a bounded column, long type names wrap as a
   rounded label (a pill that wraps becomes a circle), short figures never wrap, and on a narrow screen the table
   scrolls sideways inside its card instead of being clipped. */
.kw-dreg-table .mud-table-container { overflow-x: auto; }
.kw-dreg-table .kw-dreg-col-doc { min-width: 240px; }
.kw-dreg-table .kw-dreg-col-type { min-width: 120px; max-width: 190px; }
.kw-dreg-table .kw-dreg-nowrap { white-space: nowrap; }
.kw-dreg-table .kw-dreg-col-actions { width: 1%; min-width: 320px; }
.kw-dreg-type { display: inline-block; white-space: normal; border-radius: 10px; line-height: 1.3; text-align: left; max-width: 180px; }
.kw-dreg-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 6px; max-width: 380px; margin-left: auto; }
.kw-dreg-actions .mud-button-root { white-space: nowrap; }
.kw-dreg-note { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: #92400e; white-space: nowrap; }
.kw-dark .kw-dreg-note { color: #fbbf24; }

/* Planning overview head: what you are looking at on the left, what you can do on the right (Nov 2026 — the single
   row of chips and buttons read as busy). Stacks on narrow screens. */
.kw-ph-head { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: start; }
.kw-ph-head-main { min-width: 0; }
.kw-ph-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.kw-ph-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.kw-ph-head .kw-ph-lens { margin-top: 14px; }
.kw-ph-reports .mud-button-root { background: #fff !important; color: #0f766e !important; text-transform: none; font-weight: 600; letter-spacing: 0; }
.kw-ph-reports .mud-button-root:hover { background: #f0fdfa !important; }
.kw-ph-head-actions .kw-bp-btn .mud-button-root { text-transform: none; }
.kw-ph-refresh { color: #fff !important; }
@media (max-width: 900px) {
    .kw-ph-head { grid-template-columns: minmax(0, 1fr); }
    .kw-ph-head-side { align-items: flex-start; }
    .kw-ph-head-actions { justify-content: flex-start; }
}

/* National progress report: each quarter's remarks cell names the stations behind the remarks, with a way in. */
.kw-nprpt-cov .kw-nprpt-rm-who { display: block; font-size: .74rem; font-weight: 600; color: var(--ui-ink-2, #334155); line-height: 1.3; }
.kw-nprpt-cov .kw-nprpt-rm-none { font-size: .72rem; color: var(--ui-ink-3, #64748b); font-style: italic; }
.kw-nprpt-cov .kw-nprpt-rm-go { margin-top: 3px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; font-size: .72rem;
    font-weight: 700; color: #0e7490; text-decoration: underline; text-underline-offset: 2px; }
.kw-nprpt-cov .kw-nprpt-rm-go:hover { color: #155e75; }
.kw-dark .kw-nprpt-cov .kw-nprpt-rm-go { color: #67e8f9; }

/* ══════════ INVESTMENT EVIDENCE — photo gallery (kw-gal), document cards (kw-files), milestone timeline (kw-mst) and the
   staff story editor (kw-story). Shared by the staff investment pages and the public investment page, so colours read the
   portal's tokens where they exist (--pp-*) and MudBlazor's otherwise. ══════════ */
.kw-gal, .kw-files, .kw-mst, .kw-story-ms {
    --g-surface: var(--pp-card, var(--mud-palette-surface, #fff));
    --g-paper: var(--pp-paper-2, var(--mud-palette-background-gray, #f3f4f6));
    --g-line: var(--pp-line, var(--mud-palette-lines-default, #e5e7eb));
    --g-ink: var(--pp-ink, var(--mud-palette-text-primary, #111827));
    --g-ink-2: var(--pp-ink-2, var(--mud-palette-text-primary, #374151));
    --g-ink-3: var(--pp-ink-3, var(--mud-palette-text-secondary, #6b7280));
    --g-accent: var(--pp-accent, var(--mud-palette-primary, #1d4ed8));
    --g-good: #15803d;
}

/* ── gallery: rows that always fill (each tile grows into the row's space, so no row ends in a hole); once there are
   three or more, the first photo leads, across the whole width ── */
.kw-gal { display: flex; flex-wrap: wrap; gap: 10px; }
.kw-gal-tile { flex: 1 1 200px; height: 170px; position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--g-paper); isolation: isolate; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.kw-gal--mosaic .kw-gal-tile:first-child { flex-basis: 100%; height: clamp(220px, 34vw, 380px); }
.kw-gal-open { all: unset; display: block; width: 100%; height: 100%; cursor: zoom-in; }
.kw-gal-open:focus-visible { outline: 3px solid var(--g-accent); outline-offset: -3px; border-radius: 14px; }
.kw-gal-open img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1); }
.kw-gal-tile:hover .kw-gal-open img { transform: scale(1.05); }
.kw-gal-cap {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; display: flex; flex-direction: column; gap: 1px; padding: 26px 12px 9px;
    color: #fff; pointer-events: none; background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0)); opacity: 0;
    transform: translateY(6px); transition: opacity 0.25s, transform 0.25s;
}
.kw-gal-tile:hover .kw-gal-cap, .kw-gal-tile:focus-within .kw-gal-cap { opacity: 1; transform: none; }
.kw-gal-cap-t { font-size: 0.8rem; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.kw-gal-cap-d { font-size: 0.7rem; opacity: 0.85; }
.kw-gal-badge {
    position: absolute; z-index: 2; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px;
    border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: var(--g-good); font-size: 0.68rem; font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.kw-gal-badge svg, .kw-gal-tool svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.kw-gal-tools { position: absolute; z-index: 2; top: 8px; right: 8px; display: flex; gap: 6px; opacity: 0; transition: opacity 0.2s; }
.kw-gal-tile:hover .kw-gal-tools, .kw-gal-tile:focus-within .kw-gal-tools { opacity: 1; }
.kw-gal-tool {
    display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
    background: rgba(15, 23, 42, 0.72); color: #fff; font: inherit; font-size: 0.7rem; font-weight: 700; backdrop-filter: blur(4px);
}
.kw-gal-tool.on { background: rgba(21, 128, 61, 0.92); }
.kw-gal-tool--danger { padding: 0 8px; }
.kw-gal-tool--danger:hover { background: rgba(185, 28, 28, 0.92); }
.kw-gal-tool:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (hover: none) { .kw-gal-cap, .kw-gal-tools { opacity: 1; transform: none; } }
@media (max-width: 640px) { .kw-gal-tile { flex-basis: 140px; height: 130px; } }

/* ── the viewer ── */
.kw-gal-lb { position: fixed; inset: 0; z-index: 6000; display: grid; grid-template-rows: auto 1fr auto; color: #fff; outline: none; animation: kw-gal-in 0.2s ease; }
@keyframes kw-gal-in { from { opacity: 0; } }
.kw-gal-lb-back { position: absolute; inset: 0; z-index: -1; background: rgba(6, 10, 9, 0.94); }
.kw-gal-lb-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.kw-gal-lb-count { font-size: 0.86rem; font-weight: 700; letter-spacing: 0.04em; opacity: 0.85; font-variant-numeric: tabular-nums; }
.kw-gal-lb-actions { display: flex; gap: 8px; }
.kw-gal-lb-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; justify-content: center; padding: 0 12px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.08); color: #fff !important; font: inherit; font-size: 0.82rem; font-weight: 700;
    cursor: pointer; text-decoration: none;
}
.kw-gal-lb-btn:hover { background: rgba(255, 255, 255, 0.18); }
.kw-gal-lb-btn svg, .kw-gal-lb-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kw-gal-lb-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 0 70px; }
.kw-gal-lb-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); animation: kw-gal-in 0.25s ease; }
.kw-gal-lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.kw-gal-lb-nav:hover { background: rgba(255, 255, 255, 0.22); }
.kw-gal-lb-nav--prev { left: 14px; }
.kw-gal-lb-nav--next { right: 14px; }
.kw-gal-lb-foot { padding: 12px 18px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kw-gal-lb-cap { margin: 0; text-align: center; font-size: 0.95rem; font-weight: 600; max-width: 900px; }
.kw-gal-lb-cap small { display: block; font-size: 0.76rem; font-weight: 500; opacity: 0.7; margin-top: 2px; }
.kw-gal-lb-strip { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; padding: 2px; scrollbar-width: thin; }
.kw-gal-lb-thumb { flex: none; width: 64px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; cursor: pointer; background: none; opacity: 0.55; transition: opacity 0.2s; }
.kw-gal-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kw-gal-lb-thumb:hover { opacity: 0.9; }
.kw-gal-lb-thumb.on { opacity: 1; border-color: #fff; }
@media (max-width: 640px) { .kw-gal-lb-stage { padding: 0 8px; } .kw-gal-lb-nav { width: 40px; height: 40px; background: rgba(0, 0, 0, 0.45); } .kw-gal-lb-btn span { display: none; } }
@media (prefers-reduced-motion: reduce) { .kw-gal-open img, .kw-gal-cap, .kw-gal-lb, .kw-gal-lb-img { transition: none; animation: none; } }

/* ── document cards ── */
.kw-files { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.kw-files-card {
    display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; background: var(--g-surface);
    border: 1px solid var(--g-line); transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.kw-files-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08); border-color: color-mix(in srgb, var(--ft) 40%, var(--g-line)); }
.kw-files-card.is-public { border-color: color-mix(in srgb, var(--g-good) 40%, var(--g-line)); }
.kw-files-plate {
    flex: none; position: relative; width: 50px; height: 62px; display: grid; place-items: center; padding: 0; cursor: pointer;
    border-radius: 6px 14px 6px 6px; border: 1px solid color-mix(in srgb, var(--ft) 38%, transparent);
    background: color-mix(in srgb, var(--ft) 11%, var(--g-surface)); color: var(--ft);
}
.kw-files-plate svg { position: absolute; top: 7px; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; opacity: 0.7; }
.kw-files-plate b { position: absolute; bottom: 7px; padding: 1px 5px; border-radius: 4px; background: var(--ft); color: #fff; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; }
.kw-files-plate:focus-visible { outline: 2px solid var(--ft); outline-offset: 2px; }
.kw-files-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kw-files-name {
    all: unset; cursor: pointer; font-size: 0.9rem; font-weight: 700; line-height: 1.3; color: var(--g-ink); word-break: break-word;
    overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.kw-files-name:hover { color: var(--ft); text-decoration: underline; text-underline-offset: 3px; }
.kw-files-name:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; border-radius: 3px; }
.kw-files-meta { font-size: 0.74rem; color: var(--g-ink-3); }
.kw-files-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.kw-files-btn {
    display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--g-line); background: var(--g-surface); color: var(--g-ink-2); font: inherit; font-size: 0.74rem; font-weight: 700;
}
.kw-files-btn:hover { border-color: var(--ft); color: var(--ft); }
.kw-files-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.kw-files-btn--danger { padding: 0 8px; margin-left: auto; }
.kw-files-btn--danger:hover { border-color: #b91c1c; color: #b91c1c; }
.kw-files-pub i { position: relative; width: 26px; height: 15px; border-radius: 999px; background: var(--g-line); transition: background 0.2s; }
.kw-files-pub i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: transform 0.2s; }
.kw-files-pub.on { color: var(--g-good); border-color: color-mix(in srgb, var(--g-good) 45%, var(--g-line)); }
.kw-files-pub.on i { background: var(--g-good); }
.kw-files-pub.on i::after { transform: translateX(11px); }
.kw-files-pub:hover { color: var(--g-good); border-color: var(--g-good); }
.kw-files-tag { font-size: 0.7rem; font-weight: 800; color: var(--g-good); }

/* ── milestone timeline ── */
.kw-mst { --ms-done: #15803d; --ms-inprogress: #1d4ed8; --ms-delayed: #b91c1c; --ms-notstarted: #6b7280; }
.kw-mst-sum { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-size: 0.86rem; color: var(--g-ink-2); }
.kw-mst-sum b { font-size: 1.05rem; color: var(--g-ink); }
.kw-mst-bar { flex: 1; max-width: 280px; height: 8px; border-radius: 999px; background: var(--g-line); overflow: hidden; }
.kw-mst-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ms-done); }
.kw-mst-list { list-style: none; margin: 0; padding: 0; position: relative; }
.kw-mst-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; --ms: var(--ms-notstarted); }
.kw-mst-item:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--g-line); }
.kw-mst--done { --ms: var(--ms-done); }
.kw-mst--inprogress { --ms: var(--ms-inprogress); }
.kw-mst--delayed { --ms: var(--ms-delayed); }
.kw-mst-mark { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--g-surface); border: 2px solid var(--ms); color: var(--ms); }
.kw-mst--done .kw-mst-mark { background: var(--ms); color: #fff; }
.kw-mst-mark svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.kw-mst--inprogress .kw-mst-mark svg circle { fill: currentColor; stroke: none; }
.kw-mst-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.kw-mst-name { font-weight: 700; font-size: 0.92rem; color: var(--g-ink); }
.kw-mst-chip { padding: 1px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; color: var(--ms); background: color-mix(in srgb, var(--ms) 12%, transparent); border: 1px solid color-mix(in srgb, var(--ms) 35%, transparent); }
.kw-mst-dates { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: 0.76rem; color: var(--g-ink-3); }
.kw-mst-dates b { color: var(--g-ink-2); font-weight: 700; }
.kw-mst-late { color: var(--ms-delayed); font-weight: 700; }
.kw-mst-note { margin: 5px 0 0; font-size: 0.82rem; color: var(--g-ink-2); line-height: 1.5; }

/* ── the staff story editor ── */
.kw-story { margin-bottom: 16px; }
.kw-story-ms { display: flex; flex-direction: column; gap: 6px; }
.kw-story-ms-h, .kw-story-ms-row { display: grid; grid-template-columns: 26px minmax(160px, 1.6fr) 140px 130px 140px minmax(120px, 1.3fr) 108px; gap: 8px; align-items: center; }
.kw-story-ms-h { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--g-ink-3); padding: 0 2px; }
.kw-story-ms-row { padding: 6px; border-radius: 10px; background: var(--g-paper); border-left: 3px solid var(--ms, var(--g-line)); }
.kw-story-ms-row.kw-mst--done { --ms: #15803d; } .kw-story-ms-row.kw-mst--inprogress { --ms: #1d4ed8; } .kw-story-ms-row.kw-mst--delayed { --ms: #b91c1c; } .kw-story-ms-row.kw-mst--notstarted { --ms: #9ca3af; }
.kw-story-ms-row .kw-ui-input { width: 100%; min-width: 0; }
.kw-story-ms-row .kw-ui-input:disabled { opacity: 0.75; cursor: not-allowed; }
.kw-story-ms-no { font-size: 0.78rem; font-weight: 800; color: var(--g-ink-3); text-align: center; }
.kw-story-ms-tools { display: flex; justify-content: flex-end; }
.kw-story-texts { display: grid; gap: 14px; }
.kw-story-switches { display: flex; flex-direction: column; gap: 2px; }
.kw-story-pub { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.02em;
    color: var(--mud-palette-text-secondary, #6b7280); background: var(--mud-palette-background-gray, #f3f4f6); border: 1px solid var(--mud-palette-lines-default, #e5e7eb); }
.kw-story-pub.on { color: #15803d; background: rgba(21, 128, 61, 0.1); border-color: rgba(21, 128, 61, 0.35); }
.kw-story-read h3 { margin: 0 0 4px; font-size: 0.86rem; font-weight: 800; }
.kw-story-read h3:not(:first-child) { margin-top: 16px; }
.kw-story-read p { margin: 0; white-space: pre-wrap; line-height: 1.6; font-size: 0.9rem; }
@media (max-width: 1000px) {
    .kw-story-ms-h { display: none; }
    .kw-story-ms-row { grid-template-columns: 26px 1fr 1fr; }
    .kw-story-ms-row > :nth-child(2), .kw-story-ms-row > :nth-child(6) { grid-column: 2 / -1; }
    .kw-story-ms-tools { grid-column: 1 / -1; }
}

/* ══════════ WORKING COUNTY (WorkingCounties) — the chooser after sign-in (an AuthLayout page, so colours fall back from
   the portal's --pp tokens to MudBlazor's), the top-bar chip, the menu line, the "switch to this plan's county" prompt,
   the admin list's "+2" and the profile note. A county officer given several counties works in one per session. ══════════ */
.kw-wc-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.kw-wc-card {
    display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 4px 12px; width: 100%; text-align: left;
    padding: 14px 16px; border-radius: 12px; cursor: pointer; font: inherit;
    border: 1.5px solid var(--pp-line-2, var(--mud-palette-lines-default, #d1d5db));
    background: var(--pp-card, var(--mud-palette-surface, #fff)); color: var(--pp-ink, var(--mud-palette-text-primary, #111));
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.kw-wc-card:hover:not(:disabled) { border-color: var(--pp-accent, var(--mud-palette-primary, #1d4ed8)); transform: translateY(-1px); }
.kw-wc-card.on {
    border-color: var(--pp-accent, var(--mud-palette-primary, #1d4ed8));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pp-accent, var(--mud-palette-primary, #1d4ed8)) 18%, transparent);
}
.kw-wc-card:focus-visible { outline: 3px solid var(--pp-accent, var(--mud-palette-primary, #1d4ed8)); outline-offset: 2px; }
.kw-wc-radio { grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pp-line-2, #9ca3af); position: relative; }
.kw-wc-card.on .kw-wc-radio { border-color: var(--pp-accent, var(--mud-palette-primary, #1d4ed8)); }
.kw-wc-card.on .kw-wc-radio::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--pp-accent, var(--mud-palette-primary, #1d4ed8)); }
.kw-wc-name { font-weight: 700; font-size: 1rem; }
.kw-wc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.kw-wc-tags:empty { display: none; }
.kw-wc-tag { padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700;
    color: var(--pp-ink-2, var(--mud-palette-text-secondary, #4b5563)); background: var(--pp-paper-2, var(--mud-palette-background-gray, #f3f4f6)); }
.kw-wc-tag--now { color: #15803d; background: rgba(21, 128, 61, .12); }
.kw-wc-tag--last { color: #1d4ed8; background: rgba(29, 78, 216, .1); }

.kw-wc-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 9px; margin-right: 2px; border-radius: 999px;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff !important;
    font-size: .8rem; font-weight: 700; text-decoration: none; white-space: nowrap; max-width: 210px;
}
.kw-wc-chip span { overflow: hidden; text-overflow: ellipsis; }
.kw-wc-chip:hover { background: rgba(255, 255, 255, .18); }
@media (max-width: 640px) { .kw-wc-chip span { display: none; } .kw-wc-chip { padding: 0 8px; } }
.kw-menu-county { margin-top: 6px; font-size: .78rem; color: var(--kw-text-secondary); }
.kw-menu-county b { color: var(--kw-text-primary); }

.kw-wc-switch-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.kw-wc-switch .mud-alert-message { flex: 1; }
.kw-wc-more { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: .7rem; font-weight: 800;
    color: #1d4ed8; background: rgba(29, 78, 216, .1); cursor: help; }
.kw-wc-profile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
    background: var(--mud-palette-background-gray, #f3f4f6); font-size: .86rem; }
.kw-wc-profile > span { flex: 1; min-width: 220px; }

/* ── Food Security Assessments: the figures editor (FoodSecurityEditor) and its chips ─────────────── */
.kw-fse { border: 1px solid var(--mud-palette-lines-default); border-radius: 12px; padding: 14px 16px; background: var(--mud-palette-surface); }
.kw-fse.is-missing { border-color: var(--mud-palette-error); box-shadow: 0 0 0 1px var(--mud-palette-error) inset; }
.kw-fse-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; margin-bottom: 10px; }
.kw-fse-head > span { color: var(--mud-palette-text-secondary); }
.kw-fse-check { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 10px; border-radius: 8px;
    background: rgba(230, 120, 0, .10); color: var(--mud-palette-text-primary); font-size: .84rem; }
.kw-fse-check > span { flex: 1; min-width: 220px; }
.kw-fse-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.kw-fse-year { flex: 0 1 200px; }
.kw-fse-county { flex: 1 1 260px; }
.kw-fse-label { font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--mud-palette-text-secondary);
    margin: 12px 0 6px; display: flex; align-items: center; gap: 8px; }
.kw-fse-req { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--mud-palette-error); }
.kw-fse-phases { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.kw-fse-phase { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--mud-palette-lines-default); background: var(--mud-palette-surface); color: var(--mud-palette-text-primary);
    border-left: 6px solid var(--ipc); font: inherit; text-align: left; transition: background .12s, box-shadow .12s; }
.kw-fse-phase:hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--ipc) 45%, transparent); }
.kw-fse-phase:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.kw-fse-phase.on { background: var(--ipc); color: var(--ipc-on); border-color: var(--ipc); }
.kw-fse-phase-n { font-weight: 800; font-size: 1.05rem; line-height: 1; }
.kw-fse-phase-name { font-size: .78rem; }
.kw-fse-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.kw-fse-table th, .kw-fse-table td { padding: 4px 6px; border-bottom: 1px solid var(--mud-palette-lines-default); text-align: left; vertical-align: middle; }
.kw-fse-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mud-palette-text-secondary); }
.kw-fse-table .num { text-align: right; white-space: nowrap; }
.kw-fse-table td.num:nth-child(2) { width: 210px; }
.kw-fse-table td.num:nth-child(3) { width: 70px; color: var(--mud-palette-text-secondary); }
.kw-fse-table th[scope="row"] { font-weight: 600; }
.kw-fse-total th, .kw-fse-total td { font-weight: 800; border-bottom: 0; }
.kw-fse-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--ipc); margin-right: 6px; vertical-align: -1px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25) inset; }
.kw-fse-ai { display: inline-block; font-size: .68rem; font-weight: 700; padding: 1px 6px; border-radius: 999px; margin-left: 4px;
    background: rgba(37, 99, 235, .12); color: #1d4ed8; text-transform: none; letter-spacing: 0; }
.kw-fse-ai.is-check { background: rgba(230, 120, 0, .16); color: #9a4f00; }
.kw-fse-warn { margin-top: 8px; font-size: .84rem; color: var(--mud-palette-error); font-weight: 600; }
.kw-fse-note { margin-top: 8px; font-size: .8rem; color: var(--mud-palette-text-secondary); }
@media (max-width: 640px) { .kw-fse-phases { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kw-fse-table td.num:nth-child(2) { width: auto; } }

/* An IPC phase as a chip (registry, details, bulk rows). Colour plus the number and name — never colour alone. */
.kw-ipc-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700;
    background: var(--ipc); color: var(--ipc-on); border: 1px solid rgba(0, 0, 0, .18); white-space: nowrap; }
.kw-ipc-chip.is-none { background: transparent; color: var(--mud-palette-text-secondary); border-style: dashed; }
.kw-fst-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.kw-fst-round { font-weight: 800; }
.kw-fst-where { color: var(--mud-palette-text-secondary); }
.kw-fse-period { flex: 1 1 220px; }
