:root {
  color-scheme: dark;
  --brand-950: #041c3c;
  --brand-900: #082f63;
  --brand-800: #0b447f;
  --brand-700: #0e5a99;
  --accent: #df2f3d;
  --accent-soft: #44151d;
  --sun: #f47a38;
  --night: #3867c7;
  --ok: #168165;
  --warn: #b55c13;
  --bg: #000000;
  --surface: #07131f;
  --surface-2: #0d2135;
  --text: #ffffff;
  --muted: #a9b8c9;
  --border: #1b3f61;
  --shadow: 0 18px 48px rgba(0, 0, 0, .42);
  --radius: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; min-width: 0; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button { max-width: 100%; }
[hidden] { display: none !important; }

.boot {
  min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center;
  gap: 12px; color: var(--muted); background:
    radial-gradient(circle at 78% 12%, rgba(31, 103, 173, .18), transparent 34%), var(--bg);
}
.boot strong { font-size: 2rem; color: var(--brand-800); letter-spacing: -.04em; }
.brand-mark { width: 68px; height: 68px; border-radius: 22px; background: white url('/assets/mystn-icon-192.png') center/cover no-repeat; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.brand-mark i, .brand-mark b { display: none; }

.auth-shell {
  min-height: 100vh; min-height: 100dvh; padding: max(30px, var(--safe-top)) 20px max(30px, var(--safe-bottom));
  display: grid; place-items: center; background:
    linear-gradient(135deg, rgba(4, 28, 60, .93), rgba(11, 68, 127, .74)),
    url('/assets/corporate-header.jpg') center/cover no-repeat;
}
.auth-card { width: min(100%, 430px); border-radius: 32px; padding: 30px; background: var(--surface); box-shadow: 0 28px 80px rgba(0,0,0,.34); }
.auth-brand { display: flex; gap: 15px; align-items: center; margin-bottom: 30px; }
.auth-brand .brand-mark { width: 54px; height: 54px; border-radius: 18px; flex: 0 0 auto; }
.auth-brand h1 { margin: 0; font-size: 1.8rem; letter-spacing: -.04em; }
.auth-brand p { margin: 3px 0 0; color: var(--muted); }
.auth-card h2 { margin: 0 0 8px; font-size: 1.35rem; }
.auth-card > p { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }

.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: .86rem; color: var(--muted); font-weight: 650; }
.field input, .field select, .field textarea, .search-input {
  width: 100%; border: 1px solid var(--border); border-radius: 15px; padding: 13px 14px;
  color: var(--text); background: var(--surface); outline: none; min-height: 48px;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus { border-color: var(--brand-700); box-shadow: 0 0 0 3px rgba(14,90,153,.14); }
.help { margin: -6px 0 16px; font-size: .82rem; line-height: 1.45; color: var(--muted); }
.error-text { color: var(--accent); min-height: 1.2em; font-size: .88rem; margin: 8px 0 0; }

.primary, .secondary, .danger, .ghost, .icon-button, .chip {
  border: 0; border-radius: 14px; min-height: 44px; padding: 10px 16px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.primary { color: white; background: var(--brand-700); box-shadow: 0 8px 20px rgba(8,47,99,.22); }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .55; cursor: wait; }
.secondary { color: white; background: var(--surface-2); border: 1px solid var(--border); }
.danger { color: #fff; background: var(--accent); }
.ghost { color: var(--text); background: transparent; }
.icon-button { width: 44px; padding: 0; color: var(--text); background: var(--surface-2); font-size: 1.2rem; }
.auth-card .primary { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.button-row.end { justify-content: flex-end; }

.app-shell { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 250px minmax(0,1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: max(24px,var(--safe-top)) 16px 24px;
  background: var(--brand-950); color: white; display: flex; flex-direction: column; gap: 22px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.side-brand .brand-mark { width: 44px; height: 44px; border-radius: 14px; box-shadow: none; }
.side-brand strong { font-size: 1.35rem; letter-spacing: -.04em; }
.side-brand span { display: block; font-size: .72rem; opacity: .72; text-transform: uppercase; letter-spacing: .06em; }
.side-nav { display: grid; gap: 4px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.nav-link { border: 0; background: transparent; color: rgba(255,255,255,.74); padding: 11px 12px; border-radius: 13px; text-align: left; display: flex; gap: 11px; align-items: center; font-weight: 650; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,.12); }
.nav-icon { width: 24px; text-align: center; font-size: 1.05rem; }
.side-user { margin-top: auto; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.09); }
.side-user strong, .side-user span { display: block; overflow: hidden; text-overflow: ellipsis; }
.side-user span { margin-top: 3px; opacity: .7; font-size: .8rem; }

.page { min-width: 0; padding: max(22px,var(--safe-top)) clamp(18px,4vw,48px) calc(92px + var(--safe-bottom)); }
.page-inner { width: min(1160px,100%); margin: 0 auto; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { margin: 0; font-size: clamp(1.65rem,3vw,2.35rem); letter-spacing: -.045em; }
.page-subtitle { margin: 4px 0 0; color: var(--muted); }

.hero {
  min-height: 270px; border-radius: 32px; padding: clamp(24px,5vw,50px); color: white; overflow: hidden; position: relative;
  background:
    linear-gradient(90deg, rgba(4,28,60,.95) 0 25%, rgba(4,28,60,.22) 72%, rgba(4,28,60,.42)),
    url('/assets/corporate-header.jpg') center/cover no-repeat;
  box-shadow: var(--shadow); display: grid; align-content: end;
}
.hero::before { content: ""; position: absolute; width: 460px; height: 460px; border: 64px solid rgba(255,255,255,.06); border-radius: 50%; right: -150px; top: -220px; }
.hero::after { display: none; }
.hero.hero-image-only { background: url('/assets/corporate-header.jpg') center/cover no-repeat; }
.hero.hero-image-only::before { display: none; }
.hero-kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .77rem; font-weight: 750; color: rgba(255,255,255,.7); position: relative; z-index: 1; }
.hero h1 { margin: 8px 0 8px; font-size: clamp(2.2rem,7vw,4.5rem); letter-spacing: -.07em; position: relative; z-index: 1; }
.hero p { margin: 0; max-width: 570px; color: rgba(255,255,255,.76); position: relative; z-index: 1; }

.home-search { margin: -26px auto 28px; position: relative; z-index: 3; width: min(720px,calc(100% - 28px)); scroll-margin-top: max(12px,var(--safe-top)); }
.home-search.active { position: sticky; top: max(10px,var(--safe-top)); z-index: 20; }
.home-search .search-input { min-height: 58px; border: 0; border-radius: 20px; box-shadow: var(--shadow); padding-left: 48px; }
.home-search::before { content: "⌕"; position: absolute; left: 17px; top: 14px; z-index: 1; font-size: 1.45rem; color: var(--muted); }
.search-results { position: absolute; top: 64px; left: 0; right: 0; max-height: 370px; overflow: auto; border: 1px solid var(--border); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: 8px; }
.search-result { width: 100%; border: 0; background: transparent; color: var(--text); border-radius: 13px; padding: 11px 12px; text-align: left; }
.search-result:hover { background: var(--surface-2); }
.search-result strong, .search-result span { display: block; }
.search-result span { color: var(--muted); font-size: .82rem; margin-top: 3px; }

.home-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.summary-card { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 20px; padding: 15px 18px; text-align: left; box-shadow: 0 8px 28px rgba(24,47,78,.05); }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card span { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.summary-card strong { display: block; margin: 5px 0 3px; font-size: clamp(1.05rem,2vw,1.35rem); }
.summary-card:hover { border-color: var(--brand-500); }

.tile-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.tile { border: 1px solid var(--border); background: var(--surface); color: var(--text); min-height: 180px; padding: 20px; border-radius: 24px; text-align: left; box-shadow: 0 8px 28px rgba(24,47,78,.06); transition: transform .18s ease, box-shadow .18s ease; display: flex; flex-direction: column; }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile-icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem; background: var(--surface-2); }
.tile h2 { margin: auto 0 5px; font-size: 1.08rem; }
.tile p { margin: 0; color: var(--muted); line-height: 1.35; font-size: .88rem; }
.tile.accent { background: var(--brand-900); color: white; border: 1px solid var(--brand-700); }
.tile.salary-accent { background: #4a1018; border-color: var(--accent); }
.tile.accent p { color: rgba(255,255,255,.72); }
.tile.accent .tile-icon { background: rgba(255,255,255,.14); }

.card { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); padding: clamp(16px,3vw,24px); box-shadow: 0 8px 28px rgba(24,47,78,.05); }
.card + .card { margin-top: 16px; }
.card h2, .card h3 { margin-top: 0; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.metric { padding: 17px; border-radius: 18px; background: var(--surface-2); }
.metric span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.metric strong { font-size: 1.25rem; letter-spacing: -.03em; }
.split { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(270px,.6fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: var(--surface-2); color: var(--muted); font-size: .74rem; font-weight: 750; }
.badge.danger { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: rgba(22,129,101,.12); color: var(--ok); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }

.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.calendar-toolbar h2 { margin: 0; text-transform: capitalize; }
.calendar { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 7px; }
.weekday { text-align: center; color: var(--muted); font-size: .75rem; font-weight: 750; padding: 7px 0; }
.day { min-height: 88px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 15px; padding: 8px; text-align: left; position: relative; }
.day:hover { border-color: var(--brand-700); }
.day.outside { opacity: .34; }
.day.today { box-shadow: inset 0 0 0 2px var(--brand-700); }
.day-number { font-size: .78rem; font-weight: 800; }
.shift-dot { display: block; margin-top: 8px; padding: 4px 6px; border-radius: 8px; color: white; font-size: .67rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-dot.day-shift { background: var(--sun); }
.shift-dot.night-shift { background: var(--night); }
.shift-dot.custom-shift { background: var(--ok); }
.absence-dot { display: block; color: var(--accent); font-size: .68rem; margin-top: 4px; }
.upcoming-list { display: grid; gap: 10px; }
.upcoming { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 15px; background: var(--surface-2); }
.date-chip { width: 50px; height: 50px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; flex: 0 0 auto; }
.date-chip strong, .date-chip span { display: block; text-align: center; }
.date-chip span { font-size: .64rem; text-transform: uppercase; color: var(--muted); }

.component-list, .library-list, .vault-list, .scheme-list { display: grid; gap: 10px; }
.component, .list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 15px; background: var(--surface-2); }
.list-item { border: 0; width: 100%; color: var(--text); text-align: left; }
.list-item:hover { filter: brightness(.98); }
.list-item strong, .list-item span { display: block; }
.list-item span { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.article-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.62; color: white; }
.article-body img { max-width: 100%; height: auto; border-radius: 14px; }
.contact-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.contact { padding: 14px; border-radius: 15px; background: var(--surface-2); }
.contact strong, .contact span { display: block; }
.contact span { color: var(--muted); margin-top: 3px; font-size: .82rem; }

.secret { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.vault-entry { padding: 17px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.vault-entry[draggable="true"] { cursor: grab; }
.vault-entry.dragging { opacity: .45; }
.vault-entry h3 { margin: 0 0 4px; }
.vault-entry .actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.vault-row { cursor: pointer; }
.vault-row:hover, .vault-row:focus-visible, .section-row:hover, .section-row:focus-visible { border-color: var(--brand-700); outline: none; }
.vault-row-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vault-avatar { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: white; font-weight: 800; }
.vault-chevron { color: var(--muted); font-size: 1.5rem; }
.password-detail-card { padding-top: 0; padding-bottom: 0; }
.password-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.password-field:last-child { border-bottom: 0; }
.password-field span, .password-field strong { display: block; }
.password-field span { margin-bottom: 5px; color: var(--muted); font-size: .78rem; }
.password-field strong { overflow-wrap: anywhere; }
.password-danger-actions { margin-top: 16px; }
.vault-locked { text-align: center; padding: 50px 20px; }
.vault-locked .lock { font-size: 3rem; margin-bottom: 12px; }

.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings-menu-card { border-color: rgba(14,90,153,.72); }
.section-row { cursor: pointer; border: 1px solid transparent; }
.section-row.selected { border-color: var(--brand-700); }

.full-width { width: 100%; }
.back-link, .month-button { border: 0; padding: 0; color: var(--muted); background: transparent; font-weight: 750; }
.back-link { display: inline-flex; margin-bottom: 8px; }
.month-button { color: var(--text); font-size: 1.15rem; text-transform: capitalize; }
.sync-banner, .context-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 18px;
  padding: 16px 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
}
.sync-banner div, .context-strip > div { display: grid; gap: 4px; }
.sync-banner span, .context-strip div > span { color: var(--muted); font-size: .84rem; line-height: 1.4; }
.status-pill { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-2); font-size: .72rem; font-weight: 800; }
.status-pill.ok { color: #72ddc0; background: rgba(22,129,101,.2); }
.status-pill.warning { color: #ffc078; background: rgba(181,92,19,.22); }
.inline-message { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.calendar-card { overflow: hidden; }
.calendar-help { margin: 13px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.day.preferred { box-shadow: inset 0 0 0 2px var(--brand-700); }
.preference-dot { position: absolute; top: 6px; right: 7px; color: #4ea8de; font-size: .62rem; }
.date-detail { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: var(--surface-2); }
.date-detail h3, .date-detail p { margin: 0; }
.date-detail p { margin-top: 5px; color: var(--muted); }
.preference-card { display: grid; gap: 4px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--brand-700); border-radius: 16px; }
.preference-card span { color: var(--muted); }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; gap: 4px; padding: 4px 0 16px 20px; border-left: 2px solid var(--border); }
.timeline-item::before { content: ""; position: absolute; width: 9px; height: 9px; left: -5.5px; top: 7px; border-radius: 50%; background: var(--brand-700); }
.timeline-item span { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.timeline.compact { max-height: 290px; overflow: auto; }

.vacation-chart { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; }
.vacation-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.vacation-header, .vacation-row { display: grid; grid-template-columns: 132px max-content; min-width: max-content; min-height: 31px; }
.vacation-header { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.vacation-header > strong, .vacation-row > strong { position: sticky; left: 0; z-index: 2; width: 132px; padding: 7px 9px; overflow: hidden; color: var(--text); background: var(--surface); text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; }
.vacation-days { display: grid; grid-auto-flow: column; grid-auto-columns: 27px; }
.vacation-day-head, .vacation-cell { display: grid; place-items: center; width: 27px; min-height: 31px; border-left: 1px solid var(--border); font-size: .67rem; }
.vacation-day-head.weekend { color: #ff7a87; }
.vacation-cell { margin: 2px 0; min-height: 27px; color: transparent; background: var(--surface-2); }
.vacation-cell.filled { color: white; }
.color-0.filled, .absence-color.color-0 { background: #22a6d5; } .color-1.filled, .absence-color.color-1 { background: #e76f51; }
.color-2.filled, .absence-color.color-2 { background: #2a9d8f; } .color-3.filled, .absence-color.color-3 { background: #f4a261; }
.color-4.filled, .absence-color.color-4 { background: #8e7cc3; } .color-5.filled, .absence-color.color-5 { background: #4ea8de; }
.color-6.filled, .absence-color.color-6 { background: #e0527d; } .color-7.filled, .absence-color.color-7 { background: #7cb342; }
.absence-list { display: grid; gap: 8px; margin-top: 16px; }
.absence-item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 10px; align-items: start; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.absence-color { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; }
.absence-item p, .absence-item small { display: block; margin: 3px 0 0; color: var(--muted); }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 16px; padding-bottom: 2px; overflow-x: auto; }
.admin-tabs .chip { flex: 0 0 auto; color: var(--muted); background: var(--surface); border: 1px solid var(--border); }
.admin-tabs .chip.active { color: white; background: var(--brand-700); border-color: var(--brand-700); }
.admin-layout { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(280px,.55fr); gap: 16px; align-items: start; }
.admin-status { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.admin-status h2 { margin: 8px 0 4px; }
.admin-status p { margin: 0; color: var(--muted); }
.admin-status.draft { border-color: var(--warn); }
.warning-card { padding: 12px 14px; border: 1px solid var(--warn); border-radius: 14px; color: #ffc078; background: rgba(181,92,19,.12); }
.employee-select { margin: 0 0 12px; }
.loading-line { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--muted); }
.account-list, .feedback-list { display: grid; gap: 10px; margin-top: 16px; }
.account-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.account-row div:nth-child(2) { display: grid; gap: 3px; }
.account-row div:nth-child(2) span, .feedback-row span { color: var(--muted); font-size: .76rem; overflow-wrap: anywhere; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--brand-700); font-weight: 800; }
.feedback-row { display: flex; justify-content: space-between; align-items: start; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface-2); }
.feedback-row p { margin: 7px 0; white-space: pre-wrap; }

.zkl-add { width: 100%; margin-top: 16px; min-height: 54px; font-size: 1rem; }
.zkl-date-time { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); gap: 12px; }
.zkl-segments { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-2); }
.zkl-segments b { color: var(--muted); }
.zkl-segment { width: 3.2ch; min-width: 0; border: 0; border-radius: 8px; padding: 8px 4px; background: var(--surface); color: white; text-align: center; font-variant-numeric: tabular-nums; outline: none; }
.zkl-segment[data-zkl-part="year"] { width: 5.2ch; }
.zkl-segment:focus { box-shadow: 0 0 0 2px var(--brand-700); }
.zkl-field-label { margin: 14px 0 7px; color: var(--muted); font-size: .86rem; font-weight: 650; }
.zkl-result { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 13px 15px; border-radius: 15px; background: var(--surface-2); }
.zkl-result span { color: var(--muted); }
.zkl-suggestions { position: relative; z-index: 4; display: grid; gap: 4px; margin-top: 5px; }
.zkl-suggestions:not(:empty) { padding: 7px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.segmented { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 5px; border-radius: 15px; background: var(--surface-2); }
.segmented button { border: 0; border-radius: 11px; padding: 9px; color: var(--muted); background: transparent; }
.segmented button.active { color: var(--text); background: var(--surface); box-shadow: 0 3px 10px rgba(0,0,0,.08); }

.mobile-nav { display: none; }
.modal { width: min(620px,calc(100% - 28px)); max-height: min(86vh,820px); border: 0; border-radius: 26px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.modal::backdrop { background: rgba(3,14,30,.62); backdrop-filter: blur(5px); }
.modal-inner { padding: 24px; overflow: auto; max-height: min(86vh,820px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.modal-head h2 { margin: 0; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 14px; background: var(--brand-950); color: white; box-shadow: var(--shadow); }
.toast.error { background: #9e2230; }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .split { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .page { padding: max(18px,var(--safe-top)) 14px calc(92px + var(--safe-bottom)); }
  .hero { min-height: 235px; border-radius: 26px; padding: 25px; }
  .hero h1 { font-size: 3rem; }
  .tile-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }
  .tile { min-height: 155px; padding: 16px; border-radius: 20px; }
  .tile-icon { width: 43px; height: 43px; border-radius: 14px; }
  .metric-grid, .settings-grid, .contact-grid { grid-template-columns: 1fr 1fr; }
  .mobile-nav {
    position: fixed; z-index: 10; left: 10px; right: 10px; bottom: max(10px,var(--safe-bottom));
    display: grid; grid-template-columns: repeat(5,1fr); padding: 7px; border: 1px solid var(--border);
    border-radius: 21px; background: color-mix(in srgb,var(--surface) 91%,transparent); backdrop-filter: blur(18px); box-shadow: var(--shadow);
  }
  .mobile-nav .nav-link { color: var(--muted); padding: 7px 2px; justify-content: center; display: grid; gap: 2px; text-align: center; font-size: .64rem; }
  .mobile-nav .nav-link.active { color: var(--brand-700); background: var(--surface-2); }
  .mobile-nav .nav-icon { width: auto; font-size: 1.15rem; }
  .day { min-height: 68px; border-radius: 12px; padding: 6px; }
  .shift-dot { padding: 3px; font-size: 0; height: 8px; border-radius: 99px; }
  .weekday { font-size: .67rem; }
  .page-head { margin-bottom: 18px; }
  .page-title { font-size: 1.72rem; }
  .schedule-layout { display: grid; grid-template-columns: 1fr; }
  .vacation-header, .vacation-row { grid-template-columns: 112px max-content; }
  .vacation-header > strong, .vacation-row > strong { width: 112px; }
  .admin-status { align-items: stretch; flex-direction: column; }
  .admin-status .primary { width: 100%; }
  .admin-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); overflow: visible; }
  .admin-tabs .chip { width: 100%; }
  .account-row { grid-template-columns: 42px minmax(0,1fr) auto; }
  .account-row > .status-pill { display: none; }
  .account-row > button { grid-column: 2 / -1; justify-self: start; }
}

@media (max-width: 430px) {
  .auth-card { padding: 24px 20px; border-radius: 26px; }
  .metric-grid, .settings-grid, .contact-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
  .page-head { flex-direction: column; }
  .page-head > .button-row, .page-head > button { width: 100%; }
  .page-head > .button-row > button { flex: 1 1 auto; }
  .page-head .button-row { justify-content: flex-end; }
  .calendar { gap: 4px; }
  .day { min-height: 62px; }
  .home-summary { gap: 9px; }
  .summary-card { padding: 13px; border-radius: 17px; }
  .zkl-date-time { grid-template-columns: 1fr; }
  .zkl-result { display: grid; }
  .zkl-segments { gap: 2px; padding: 6px; }
  .zkl-segment { width: 2.8ch; padding-inline: 2px; }
  .zkl-segment[data-zkl-part="year"] { width: 4.8ch; }
  .password-field { align-items: flex-start; }
  .vault-order { display: none; }
  .sync-banner, .context-strip { display: grid; }
  .sync-banner button, .context-strip button { width: 100%; }
  .absence-item { grid-template-columns: 10px minmax(0,1fr); }
  .absence-item > button { grid-column: 2; justify-self: start; }
  .feedback-row { display: grid; }
  .feedback-row button { width: 100%; }
  .modal { width: calc(100% - 18px); max-height: calc(100dvh - 18px); border-radius: 22px; }
  .modal-inner { max-height: calc(100dvh - 18px); padding: 20px 16px; }
  .modal .button-row.end { align-items: stretch; flex-direction: column-reverse; }
  .modal .button-row.end > button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
