:root {
    color-scheme: light;
    --ink: #162c3e;
    --muted: #53697b;
    --navy: #0c304e;
    --accent: #08796e;
    --accent-surface: #e5f5f2;
    --canvas: #f3f7f7;
    --border: #dae5e8;
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; color: var(--ink); background: var(--canvas); }
body.newkleo { --navy: #29234e; --accent: #6550a4; --accent-surface: #efebfa; }
a { color: var(--accent); font-weight: 650; text-underline-offset: 3px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #d78218; outline-offset: 3px; }
.topbar { min-height: 64px; padding: 10px 26px; display: flex; gap: 12px clamp(12px, 2vw, 26px); flex-wrap: wrap; align-items: center; background: var(--navy); color: white; }
.wordmark { color: white; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 1.15rem; font-weight: 760; letter-spacing: -.025em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #ffffff20; border: 1px solid #ffffff45; }
.workspace-nav { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.workspace-nav a { padding: 6px 10px; border-radius: 7px; color: #ebf3fa; text-decoration: none; font-size: .9rem; }
.workspace-nav a[aria-current], .workspace-nav a:hover { color: white; background: #ffffff27; }
.scope { color: white; padding: 4px 11px; border: 1px solid #ffffff60; border-radius: 999px; font-size: .88rem; }
.identity, .switcher { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.identity { margin-left: auto; }
.user { color: #ebf3fa; font-size: .875rem; }
.quiet { border: 1px solid #ffffff65; background: transparent; color: white; border-radius: 7px; padding: 5px 11px; font-weight: 650; }
.quiet:hover { background: #ffffff18; }
.switcher select { width: auto; min-height: 35px; padding: 4px 10px; }
.shell { min-height: calc(100vh - 64px); display: flex; flex-direction: column; }
.content, .pilot-note { width: min(100%, 1140px); padding-inline: clamp(15px, 3.2vw, 38px); margin-inline: auto; }
.content { padding-top: clamp(21px, 3.2vw, 36px); padding-bottom: 38px; }
.pilot-note { color: var(--muted); font-size: .82rem; margin-top: auto; padding-bottom: 23px; }
.page-header { margin: 0 0 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 13px; }
h1 { margin: 0; line-height: 1.15; font-size: clamp(1.6rem, 4vw, 2.15rem); letter-spacing: -.04em; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 1.06rem; line-height: 1.3; letter-spacing: -.012em; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.stat, .panel, .login-panel { background: white; border: 1px solid var(--border); border-radius: 13px; box-shadow: 0 2px 6px #142c4808; }
.stat { padding: 15px 19px; border-left: 3px solid var(--accent); }
.stat h2 { color: var(--muted); font-size: .89rem; }
.stat strong { display: block; margin-top: 5px; font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -.055em; }
.panel { margin: 0 0 20px; }
.panel-header { padding: 19px 21px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--border); }
.panel.padded { padding: 21px; }
.padded h2 { margin-bottom: 17px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 13px 21px; border-bottom: 1px solid #e5edf3; }
th { color: var(--muted); font-size: .83rem; background: #f7f9fb; font-weight: 720; }
tr:last-child td { border-bottom: 0; }
.empty { margin: 18px 21px; color: var(--muted); }
.muted, .record-id, time { color: var(--muted); }
.record-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 17px;
    padding: clamp(15px, 3.4vw, 29px);
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(110deg, var(--accent-surface), white 78%);
}
.record-avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: clamp(43px, 6vw, 61px);
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: white;
    color: var(--accent);
    font-size: 1.22rem;
    font-weight: 750;
}
.record-identity { flex: 1 1 140px; min-width: 0; }
.record-identity h1 { font-size: clamp(1.5rem, 4vw, 2.38rem); }
.record-id { margin: 5px 0 0; font-size: .875rem; overflow-wrap: anywhere; }
.record-id span { margin-inline: 2px; }
.back { display: inline-block; margin-bottom: 12px; font-size: .875rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 3px 8px; margin: 9px 0 18px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 10px 8px; border-bottom: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: .92rem; }
.tabs a[aria-current], .tabs a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.employee-overview { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: 16px; }
.overview-card { min-width: 0; margin: 0; padding: clamp(15px, 2.6vw, 23px); overflow-wrap: anywhere; }
.overview-card:not(.overview-employment) { display: flex; flex-direction: column; align-items: flex-start; }
.current-assignment { width: 100%; margin: 12px 0 15px; }
.current-assignment + .current-assignment { padding-top: 13px; border-top: 1px solid var(--border); }
.current-assignment h3 { margin: 0; font-size: clamp(1.1rem, 2.5vw, 1.45rem); letter-spacing: -.025em; line-height: 1.2; }
.current-assignment p { margin: 4px 0 12px; }
.overview-facts { display: flex; flex-wrap: wrap; gap: 9px 24px; margin: 0; }
.overview-facts dt { color: var(--muted); font-size: .78rem; }
.overview-facts dd { margin: 2px 0 0; font-size: .89rem; font-weight: 680; }
.overview-empty { margin: 14px 0; color: var(--muted); }
.overview-link { align-self: flex-start; margin-top: auto; font-size: .875rem; }
.overview-link span { padding-left: 2px; }
.overview-employment { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 25px; }
.overview-employment .overview-link { align-self: center; margin: 0 0 0 auto; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 41px; text-decoration: none; padding: 8px 15px; border-radius: 8px; font-weight: 700; }
.primary { color: white; background: var(--accent); border: 1px solid var(--accent); }
.primary:hover { filter: brightness(.9); }
.secondary { color: var(--ink); background: white; border: 1px solid #9bb0c1; }
.secondary:hover { background: var(--canvas); }
.tag { display: inline-flex; padding: 3px 9px; border-radius: 100px; font-size: .8rem; font-weight: 710; background: #eaf0f5; color: #314a5e; }
.tag.active { background: #def4e9; color: #155c41; }
.tag.separated { background: #f8ebe1; color: #793d24; }
.search { padding: 17px 21px; display: grid; gap: 6px; max-width: 650px; }
.inline { display: flex; gap: 8px; align-items: end; }
.inline a { align-self: center; flex-shrink: 0; }
label { color: var(--ink); font-weight: 650; font-size: .9rem; display: grid; gap: 5px; }
input, select { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #9bb0c1; border-radius: 7px; color: var(--ink); background: white; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.stack { display: grid; gap: 15px; }
.episode { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; padding: 14px 21px; border-bottom: 1px solid #e5edf3; }
.episode:last-child { border-bottom: 0; }
.episode p { color: var(--muted); margin: 3px 0 0; }
.audit-list { margin: 0; padding: 7px 19px 7px 38px; list-style: none; }
.audit-list li { position: relative; padding: 10px 0 12px 17px; border-left: 1px solid var(--border); }
.audit-list li::before { content: ""; position: absolute; top: 16px; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.audit-detail { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; color: var(--muted); font-size: .875rem; }
.compact-audit { padding: 0 0 0 7px; margin: 11px 0 13px; font-size: .92rem; }
.compact-audit li { padding: 0 0 10px 13px; }
.compact-audit li:last-child { padding-bottom: 0; }
.compact-audit li::before { top: 7px; width: 7px; height: 7px; left: -4px; }
.compact-audit .audit-detail { gap: 1px 8px; font-size: .8rem; }
.end-form input { min-width: 140px; }
.notice { padding: 10px 14px; margin: 0 0 16px; border-radius: 8px; font-weight: 600; }
.notice.success { background: #def4e9; color: #155c41; }
.notice.error { background: #fbe9e7; color: #7d2c25; }
.login-shell { display: grid; place-items: center; padding: 38px 18px; min-height: calc(100vh - 64px); background: radial-gradient(ellipse at top, var(--accent-surface), transparent 57%); }
.login-panel { padding: clamp(23px, 5vw, 36px); width: min(100%, 420px); }
.login-panel h1 { font-size: clamp(1.6rem, 4vw, 1.95rem); }
.login-panel p { margin: 10px 0 0; overflow-wrap: anywhere; }
.login-panel .notice { margin: 0 0 14px; }
.login-panel .stack { margin-top: 20px; }
.login-options { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 11px; margin-top: 10px; }
.text-button { border: 0; background: transparent; color: var(--accent); font-weight: 650; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.pin-input { font-variant-numeric: tabular-nums; letter-spacing: .3em; }
.visually-hidden { position: absolute; overflow: hidden; width: 1px; height: 1px; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 740px) {
    .topbar { padding: 10px 15px; }
    .stat { padding: 10px 12px; }
    .stats { gap: 8px; }
    th, td, .panel-header, .episode { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 590px) {
    .employee-overview { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .overview-employment .overview-link { margin-left: 0; }
}
@media (max-width: 450px) {
    .fields { grid-template-columns: 1fr; }
    .identity { margin-left: 0; }
    .end-form { flex-wrap: wrap; }
    .stats { grid-template-columns: 1fr; }
}
