:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #475569;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #dbeafe;
  --danger: #b91c1c;
  --border: #e2e8f0;
  --ring: rgba(37, 99, 235, .22);
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.07);
  --content-width: 1920px;
}

:root[data-portal-theme="dark"] {
  --bg: #07111f;
  --panel: #0f1b2d;
  --panel-soft: #12233a;
  --text: #eef6ff;
  --muted: #bed0e5;
  --accent: #60a5fa;
  --accent-dark: #93c5fd;
  --accent-soft: #1e3a5f;
  --danger: #fca5a5;
  --border: #29405f;
  --ring: rgba(96, 165, 250, .32);
  --shadow: 0 22px 70px rgba(0, 0, 0, .38);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, .28);
}

:root[data-portal-theme="contrast"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #020617;
  --muted: #1f2937;
  --accent: #0033a0;
  --accent-dark: #001f66;
  --accent-soft: #dbeafe;
  --border: #111827;
  --ring: rgba(0, 51, 160, .35);
  --shadow: 0 0 0 2px #111827;
  --shadow-soft: 0 0 0 1px #111827;
}

:root[data-portal-font="large"] { font-size: 112.5%; }
:root[data-portal-density="compact"] { --content-width: 1680px; }
:root[data-portal-cards="flat"] { --shadow: none; --shadow-soft: none; }

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; }
img, svg, video, canvas { max-width: 100%; height: auto; }
body {
  margin: 0;
  font-family: Arial, Helvetica, ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at 8% -10%, rgba(37, 99, 235, .22) 0, transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(14, 165, 233, .16) 0, transparent 26rem),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

:root[data-portal-theme="dark"] body {
  background:
    radial-gradient(circle at 8% -10%, rgba(96, 165, 250, .16) 0, transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(14, 165, 233, .12) 0, transparent 26rem),
    var(--bg);
}

:root[data-portal-theme="contrast"] body { background: var(--bg); }
:root[data-portal-density="compact"] .container { margin-top: 1rem; margin-bottom: 2rem; }
:root[data-portal-density="compact"] .card,
:root[data-portal-density="compact"] .hero,
:root[data-portal-density="compact"] .page-title,
:root[data-portal-density="compact"] .auth-card { border-radius: 18px; }
:root[data-portal-density="compact"] .card { padding: 1rem; margin-bottom: .75rem; }
:root[data-portal-density="compact"] .grid,
:root[data-portal-density="compact"] .stack { gap: .75rem; }
:root[data-portal-cards="flat"] .card,
:root[data-portal-cards="flat"] .auth-card,
:root[data-portal-cards="flat"] .hero,
:root[data-portal-cards="flat"] .page-title,
:root[data-portal-cards="flat"] .stat-card,
:root[data-portal-cards="flat"] .choice-card,
:root[data-portal-cards="flat"] .empty-state,
:root[data-portal-cards="flat"] .table-wrap { box-shadow: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 100; transform: translateY(-150%); padding: .75rem 1rem; border-radius: 999px; background: #0f172a; color: white; font-weight: 900; box-shadow: var(--shadow); }
.skip-link:focus { transform: translateY(0); outline: 4px solid #facc15; outline-offset: 3px; }
:focus-visible { outline: 4px solid #1d4ed8; outline-offset: 3px; }
#main-content:focus { outline: 3px solid #1d4ed8; outline-offset: .45rem; }
a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, .button:focus-visible, summary:focus-visible, .table-wrap:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 3px; box-shadow: 0 0 0 4px rgba(37, 99, 235, .18); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
@media (forced-colors: active) {
  a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, .button:focus-visible, summary:focus-visible, .table-wrap:focus-visible { outline: 3px solid Highlight; outline-offset: 3px; box-shadow: none; }
  .status-pill, .flash, .empty-state, .recovery-box { border: 1px solid CanvasText; }
}
@media (prefers-contrast: more) {
  :root { --muted: #334155; --border: #94a3b8; }
  .button, button, input, textarea, select { border-color: #64748b; }
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  justify-content: space-between;
  align-items: center;
  gap: .85rem;
  padding: .58rem clamp(.85rem, 4vw, 3rem);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
:root[data-portal-theme="dark"] .topbar { background: rgba(15, 27, 45, .92); }
:root[data-portal-theme="contrast"] .topbar { background: #fff; border-bottom: 2px solid #111827; }
.brand { display: inline-flex; gap: .85rem; align-items: center; min-width: 0; max-width: 100%; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: clamp(7.5rem, 14vw, 12rem); max-height: 2.7rem; object-fit: contain; object-position: left center; }
.brand-copy { min-width: 0; padding-left: .75rem; border-left: 1px solid var(--border); }
.brand strong, .brand small { display: block; line-height: 1.1; overflow-wrap: break-word; }
.brand small { margin-top: .18rem; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.main-nav { display: flex; gap: .32rem; align-items: center; justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
.main-nav a, .nav-button { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.35rem; padding: .42rem .7rem; border: 1px solid transparent; border-radius: 14px; color: #334155; font-weight: 800; font-size: .88rem; white-space: nowrap; }
.main-nav a:hover { background: var(--panel-soft); color: var(--accent); text-decoration: none; }
.main-nav a:focus-visible, .nav-button:focus-visible, .nav-dropdown summary:focus-visible { background: var(--accent-soft); color: #1e3a8a; }
.main-nav a[aria-current="page"] { background: var(--accent-soft); color: #1e3a8a; box-shadow: inset 0 0 0 1px rgba(37,99,235,.18); }
.nav-link-priority { background: rgba(255,255,255,.68); }
.nav-link-opter { padding: .34rem .72rem .34rem .46rem; background: rgba(255, 255, 255, .78); color: #0f172a !important; border-color: rgba(148, 163, 184, .42) !important; box-shadow: 0 1px 2px rgba(15, 23, 42, .06), inset 0 0 0 1px rgba(255,255,255,.72); letter-spacing: .01em; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .15s ease; }
.nav-link-opter:hover, .nav-link-opter:focus-visible, .nav-link-opter[aria-current="page"] { background: #fff; color: #1e3a8a !important; border-color: rgba(37, 99, 235, .28) !important; text-decoration: none; box-shadow: 0 6px 16px rgba(37, 99, 235, .12), inset 0 0 0 1px rgba(255,255,255,.9); transform: translateY(-1px); }
.nav-link-opter-icon { width: 1.55rem; height: 1.55rem; border-radius: .38rem; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .16)); }
.nav-dropdown { position: relative; }
.nav-dropdown summary { display: inline-flex; align-items: center; justify-content: center; min-height: 2.35rem; padding: .42rem .7rem; border: 1px solid transparent; border-radius: 14px; color: #334155; font-weight: 800; font-size: .88rem; cursor: pointer; list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: '▾'; margin-left: .4rem; font-size: .75rem; transition: transform .15s ease; }
.nav-dropdown[open] summary, .nav-dropdown summary:hover, .nav-dropdown[data-nav-current="true"] summary { background: var(--panel-soft); color: var(--accent); }
.nav-dropdown[open] summary::after { transform: rotate(180deg); }
.nav-dropdown-menu { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; display: grid; min-width: 220px; max-width: min(320px, calc(100vw - 2rem)); padding: .4rem; border: 1px solid var(--border); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.nav-dropdown-menu a { justify-content: flex-start; white-space: normal; }
.nav-dropdown-menu-sections { gap: .3rem; min-width: min(320px, calc(100vw - 2rem)); }
.nav-dropdown-section { display: grid; gap: .1rem; padding-top: .2rem; border-top: 1px solid rgba(226,232,240,.85); }
.nav-dropdown-section:first-of-type { border-top: 0; padding-top: 0; }
.nav-dropdown-label { margin: .15rem .4rem; color: var(--muted); font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.nav-button { background: #eef2f7; }
.settings-dropdown summary { gap: .35rem; background: #f0f9ff; color: #075985; border: 1px solid #bae6fd; box-shadow: inset 0 0 0 1px rgba(186,230,253,.45); }
.settings-dropdown summary small { color: #0f766e; font-size: .72rem; font-weight: 800; letter-spacing: .02em; }
.settings-dropdown .nav-icon-summary { width: 2.35rem; min-width: 2.35rem; padding-inline: 0; border-radius: 999px; font-size: 1.08rem; line-height: 1; }
.settings-dropdown .nav-icon-summary::after { content: none; margin: 0; }
.settings-menu { min-width: min(360px, calc(100vw - 2rem)); gap: .75rem; padding: .75rem; background: var(--panel); color: var(--text); }
.settings-menu-section { display: grid; gap: .45rem; padding: .65rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel-soft); }
.settings-menu-section + .settings-menu-section { margin-top: .15rem; }
.settings-menu-section > a { justify-content: flex-start; border-radius: 12px; background: #fff; }
.settings-menu-section .inline { margin: 0; }
.settings-menu-section .nav-button { justify-content: flex-start; width: 100%; border-radius: 12px; background: #fff; color: #334155; }
.settings-menu-inner { display: grid; gap: .65rem; margin-top: .35rem; padding: .75rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel-soft); }
.settings-menu-title { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.settings-menu-intro { margin: -.15rem 0 .1rem; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.settings-menu label { display: grid; gap: .38rem; padding: .65rem .7rem; border: 1px solid var(--border); border-radius: 14px; background: var(--panel-soft); color: var(--text); font-size: .9rem; font-weight: 900; }
.settings-menu-section label { background: #fff; }
.settings-menu select { min-height: 2.9rem; border-radius: 12px; }
.settings-reset { width: 100%; justify-content: center; }
.settings-menu-note { margin: -.15rem 0 0; color: var(--muted); font-size: .82rem; line-height: 1.35; }
.settings-menu-note[data-state="saving"] { color: #1d4ed8; }
.settings-menu-note[data-state="success"] { color: #166534; }
.settings-menu-note[data-state="error"] { color: #b91c1c; font-weight: 800; }
.settings-menu select:disabled, .settings-reset:disabled { cursor: wait; opacity: .72; }
.utility-menu { gap: .55rem; }
.utility-menu > a, .utility-menu > .inline .nav-button { justify-content: flex-start; width: 100%; }
.utility-menu > .nav-dropdown > summary { width: 100%; justify-content: space-between; border-radius: 12px; background: var(--panel-soft); }
.compact-search { display: grid; gap: .4rem; width: 100%; }
.compact-search label { font-size: .82rem; }
.compact-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
.compact-search-row input, .compact-search-row button { min-height: 2.35rem; }
:root[data-portal-theme="dark"] .nav-dropdown-menu,
:root[data-portal-theme="dark"] .card,
:root[data-portal-theme="dark"] .auth-card,
:root[data-portal-theme="dark"] .hero,
:root[data-portal-theme="dark"] .page-title,
:root[data-portal-theme="dark"] .stat-card,
:root[data-portal-theme="dark"] .choice-card,
:root[data-portal-theme="dark"] .empty-state,
:root[data-portal-theme="dark"] .request-card,
:root[data-portal-theme="dark"] .request-mini-card,
:root[data-portal-theme="dark"] .table-wrap { background: var(--panel); color: var(--text); }
:root[data-portal-theme="dark"] .feature-card,
:root[data-portal-theme="dark"] .dashboard-hero,
:root[data-portal-theme="dark"] .priority-tool-card,
:root[data-portal-theme="dark"] .admin-tool-grid-heading,
:root[data-portal-theme="dark"] .admin-form-card { background: linear-gradient(135deg, #0f1b2d, #12233a); }
:root[data-portal-theme="dark"] .muted,
:root[data-portal-theme="dark"] .hint,
:root[data-portal-theme="dark"] .choice-card p,
:root[data-portal-theme="dark"] .site-footer a { color: var(--muted); }
:root[data-portal-theme="dark"] input,
:root[data-portal-theme="dark"] textarea,
:root[data-portal-theme="dark"] select { background: #07111f; color: var(--text); border-color: var(--border); }
:root[data-portal-theme="dark"] .button.secondary,
:root[data-portal-theme="dark"] .nav-button,
:root[data-portal-theme="dark"] .main-nav a { background: #12233a; color: #e2e8f0; }
:root[data-portal-theme="dark"] .nav-context-bar { background: rgba(12, 23, 38, .94); border-color: #29405f; box-shadow: inset 0 1px 0 rgba(147,197,253,.08); }
:root[data-portal-theme="dark"] .nav-context-eyebrow { color: #93c5fd; }
:root[data-portal-theme="dark"] .nav-context-heading p,
:root[data-portal-theme="dark"] .nav-context-prompt { color: var(--muted); }
:root[data-portal-theme="dark"] .nav-context-links a { background: #12233a; border-color: #29405f; color: #e2e8f0; }
:root[data-portal-theme="dark"] .nav-link-priority,
:root[data-portal-theme="dark"] .nav-dropdown-calm summary { background: rgba(147, 197, 253, .06); }
:root[data-portal-theme="dark"] .nav-link-opter { background: rgba(15, 23, 42, .78); border-color: rgba(148, 163, 184, .28) !important; color: #e2e8f0 !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255,255,255,.05); }
:root[data-portal-theme="dark"] .nav-link-opter:hover,
:root[data-portal-theme="dark"] .nav-link-opter:focus-visible,
:root[data-portal-theme="dark"] .nav-link-opter[aria-current="page"] { background: rgba(37, 99, 235, .2); border-color: rgba(147, 197, 253, .42) !important; color: #dbeafe !important; box-shadow: 0 8px 18px rgba(37, 99, 235, .22), inset 0 0 0 1px rgba(255,255,255,.08); }
:root[data-portal-theme="dark"] .search-command-card,
:root[data-portal-theme="dark"] .search-example-chips span { background: #12233a; border-color: #29405f; color: #dbeafe; }
:root[data-portal-theme="dark"] .search-result h2 a { color: var(--text); }
:root[data-portal-theme="dark"] .onboarding-landing-hero,
:root[data-portal-theme="dark"] .onboarding-secondary-nav,
:root[data-portal-theme="dark"] .onboarding-progress-card { background: #0f1b2d; border-color: #29405f; }
:root[data-portal-theme="dark"] .onboarding-primary-next,
:root[data-portal-theme="dark"] .scan-link-list a { background: #12233a; border-color: #29405f; color: #dbeafe; }
:root[data-portal-theme="dark"] .onboarding-primary-next span { color: #dbeafe; }
:root[data-portal-theme="dark"] .login-field-sequence,
:root[data-portal-theme="dark"] .choose-primary-card,
:root[data-portal-theme="dark"] .choose-secondary-card,
:root[data-portal-theme="dark"] .choose-page-card { background: #12233a; border-color: #29405f; }
:root[data-portal-theme="dark"] .choose-admin-card { background: #1f1b12; border-color: #92400e; }
:root[data-portal-theme="dark"] .settings-dropdown summary { background: #12233a; color: #eef6ff; border-color: #29405f; box-shadow: inset 0 0 0 1px rgba(96,165,250,.18); }
:root[data-portal-theme="dark"] .settings-dropdown summary small { color: #93c5fd; }
:root[data-portal-theme="dark"] .nav-dropdown-admin summary { background: #0f1b2d; border-color: #29405f; color: #bfdbfe; box-shadow: inset 3px 0 0 rgba(96,165,250,.38); }
:root[data-portal-theme="dark"] .nav-dropdown-label { color: #93c5fd; }
:root[data-portal-theme="dark"] .nav-dropdown-section { border-top-color: rgba(41, 64, 95, .9); }
:root[data-portal-theme="dark"] .settings-menu label,
:root[data-portal-theme="dark"] .settings-menu-section,
:root[data-portal-theme="dark"] .settings-menu-section > a,
:root[data-portal-theme="dark"] .settings-menu-section .nav-button,
:root[data-portal-theme="dark"] .data-table th,
:root[data-portal-theme="dark"] .work-hours-table tr,
:root[data-portal-theme="dark"] .empty-action-list li,
:root[data-portal-theme="dark"] .employee-list-row,
:root[data-portal-theme="dark"] .employee-group-empty,
:root[data-portal-theme="dark"] .form-note,
:root[data-portal-theme="dark"] .recovery-hint,
:root[data-portal-theme="dark"] .success-hint { background: #12233a; color: var(--text); border-color: #29405f; }
:root[data-portal-theme="dark"] .data-table tbody tr:nth-child(even) td { background: #12233a; }
:root[data-portal-theme="dark"] .data-table td,
:root[data-portal-theme="dark"] .data-table th { color: var(--text); }
:root[data-portal-theme="dark"] .work-hours-table td,
:root[data-portal-theme="dark"] .work-hours-table th::before,
:root[data-portal-theme="dark"] .work-hours-table td::before,
:root[data-portal-theme="dark"] .settings-menu-intro,
:root[data-portal-theme="dark"] .settings-menu-note { color: var(--muted); }
:root[data-portal-theme="dark"] .settings-menu-note[data-state="saving"] { color: #93c5fd; }
:root[data-portal-theme="dark"] .settings-menu-note[data-state="success"] { color: #86efac; }
:root[data-portal-theme="dark"] .settings-menu-note[data-state="error"] { color: #fca5a5; }
:root[data-portal-theme="contrast"] .card,
:root[data-portal-theme="contrast"] .auth-card,
:root[data-portal-theme="contrast"] .hero,
:root[data-portal-theme="contrast"] .page-title,
:root[data-portal-theme="contrast"] .stat-card,
:root[data-portal-theme="contrast"] .choice-card,
:root[data-portal-theme="contrast"] .empty-state,
:root[data-portal-theme="contrast"] input,
:root[data-portal-theme="contrast"] textarea,
:root[data-portal-theme="contrast"] select { border-width: 2px; }
:root[data-portal-theme="contrast"] .settings-dropdown summary,
:root[data-portal-theme="contrast"] .settings-menu label,
:root[data-portal-theme="contrast"] .data-table th,
:root[data-portal-theme="contrast"] .empty-action-list li,
:root[data-portal-theme="contrast"] .work-hours-table tr { border-width: 2px; box-shadow: none; }
:root[data-portal-theme="contrast"] .data-table tbody tr:nth-child(even) td { background: #eef4ff; }
:root[data-portal-theme="contrast"] .main-nav a,
:root[data-portal-theme="contrast"] .nav-button,
:root[data-portal-theme="contrast"] .nav-dropdown summary,
:root[data-portal-theme="contrast"] .nav-context-bar,
:root[data-portal-theme="contrast"] .nav-context-links a { border: 2px solid #111827; box-shadow: none; }
.site-search { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: .5rem; justify-self: end; width: min(520px, 100%); }
.site-search input { min-height: 2.6rem; border-radius: 999px; }
.site-search button { min-height: 2.6rem; padding-inline: 1.1rem; }
.compact-search { grid-column: auto; grid-template-columns: 1fr; justify-self: stretch; width: 100%; }
.compact-search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .4rem; }
.compact-search input, .compact-search button { min-height: 2.35rem; }
.nav-context-bar { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .85rem 1rem; align-items: center; padding: .85rem 1rem; border: 1px solid rgba(148, 163, 184, .2); border-radius: 24px; background: rgba(255, 255, 255, .46); box-shadow: inset 0 1px 0 rgba(255,255,255,.42); }
.nav-context-eyebrow { margin: 0 0 .25rem; color: var(--accent); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.nav-context-heading strong { display: block; font-size: 1rem; line-height: 1.2; }
.nav-context-heading p { margin: .22rem 0 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.nav-context-links-wrap { display: grid; justify-items: end; gap: .45rem; }
.nav-context-prompt { margin: 0; color: var(--muted); font-size: .76rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.nav-context-links { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.nav-context-links a { display: inline-flex; align-items: center; min-height: 2.4rem; padding: .45rem .75rem; border: 1px solid rgba(148, 163, 184, .18); border-radius: 999px; background: rgba(255,255,255,.68); color: #334155; font-weight: 800; font-size: .92rem; }
.nav-context-links a:hover { background: var(--panel-soft); color: var(--accent); text-decoration: none; }
.container { width: min(var(--content-width), calc(100% - .75rem)); margin: 2rem auto 4rem; }

.hero, .page-title, .auth-card, .card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}
.card, .auth-card, .stat-card, .empty-state, .notice-card, .table-wrap { backdrop-filter: saturate(115%) blur(2px); }
.hero, .page-title { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; padding: clamp(1.5rem, 4vw, 3rem); margin-bottom: 1.5rem; overflow-wrap: break-word; }
.hero > *, .page-title > *, .card > *, .stat-card > *, .feature-card > * { min-width: 0; }
.page-title > .eyebrow, .page-title > h1, .page-title > .muted { flex: 1 1 100%; }
.auth-card { max-width: 460px; margin: 4rem auto; padding: clamp(1.35rem, 4vw, 2rem); }
.login-hero { min-height: calc(100vh - 4.4rem); display: grid; grid-template-columns: minmax(0, .62fr) minmax(340px, 460px); align-items: center; gap: clamp(1.25rem, 6vw, 4rem); margin: -2rem calc(50% - 50vw) -4rem; padding: clamp(2rem, 8vw, 5rem) max(1rem, calc((100vw - var(--content-width)) / 2)); background: linear-gradient(120deg, rgba(15, 23, 42, .9), rgba(30, 64, 175, .5)), url('/images/login-background.jpg') center / cover no-repeat; }
.login-copy { max-width: 340px; color: white; opacity: .92; }
.login-copy .eyebrow { color: #dbeafe; }
.login-copy .login-heading { margin: 0 0 .5rem; font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; line-height: 1.03; letter-spacing: -.055em; }
.login-copy p:not(.eyebrow) { max-width: 24rem; color: rgba(255, 255, 255, .82); font-size: 1rem; }
.login-card { width: min(460px, 100%); margin: 0; background: rgba(255, 255, 255, .96); border-color: rgba(191, 219, 254, .72); box-shadow: 0 22px 64px rgba(15, 23, 42, .32); backdrop-filter: blur(18px); }
.login-task-card h1 { margin-bottom: .25rem; }
.login-task-card #login-help { margin: 0 0 .6rem; color: var(--muted); }
.login-field-sequence { display: grid; gap: .3rem; padding: .75rem; border: 1px solid #dbeafe; border-radius: 16px; background: #f8fafc; }
.login-field-sequence label:not(:first-child) { margin-top: .42rem; }
.login-field-sequence .field-error { margin-top: -.15rem; }
.login-form button.primary { min-height: 3.15rem; }
.login-recovery-alert { border-left: 5px solid #b91c1c; padding-block: .7rem; }
.login-credential-hint { margin: -.2rem 0 0; padding: .5rem .65rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; font-size: .9rem; }
.choose-user-badge { opacity: .9; }
.choose-user-badge strong { font-size: clamp(1rem, 2vw, 1.35rem); letter-spacing: -.02em; }
.choose-destination-section { margin-bottom: .7rem; }
.choose-section-heading { margin: .1rem 0 .5rem; padding: 0 .1rem .4rem; border-bottom: 1px solid var(--border); }
.choose-section-heading h2, .choose-section-heading p { margin-bottom: 0; }
.choose-section-heading h2 { font-size: 1.05rem; color: #334155; }
.choose-grid { gap: .6rem; }
.choose-destination-section:first-of-type .choose-grid { grid-template-columns: minmax(0, 1.45fr) minmax(220px, .8fr); align-items: stretch; }
.choose-primary-card { min-height: 0; padding: 1.25rem; border-color: #93c5fd; background: linear-gradient(135deg, #ffffff, #eff6ff); box-shadow: var(--shadow); }
.choose-primary-card h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
.choose-secondary-card, .choose-admin-card, .choose-page-card { min-height: 0; padding: .82rem; border-radius: 18px; box-shadow: none; }
.choose-secondary-card { background: #fbfdff; }
.choose-page-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .55rem; }
.choose-page-card { display: grid; gap: .2rem; border-color: #e2e8f0; background: #fff; }
.choose-page-card h2 { margin-bottom: 0; font-size: 1rem; }
.choose-page-card p { display: -webkit-box; margin: 0; overflow: hidden; -webkit-line-clamp: 1; -webkit-box-orient: vertical; line-height: 1.45; }
.choose-admin-section { margin-top: .95rem; padding-top: .6rem; border-top: 1px solid #fde68a; }
.choose-admin-section .choose-section-heading { border-color: #fde68a; }
.choose-admin-section .choose-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choose-admin-card { background: #fffdf5; border-color: #fde68a; box-shadow: none; }
.choose-admin-card .choice-icon { width: 2.35rem; height: 2.35rem; margin-bottom: .55rem; }
@media (max-width: 760px) { .choose-destination-section:first-of-type .choose-grid, .choose-admin-section .choose-grid { grid-template-columns: 1fr; } }
.card { padding: clamp(1.1rem, 2vw, 1.5rem); margin-bottom: 1rem; }
.card > :last-child, .auth-card > :last-child, .page-title > :last-child { margin-bottom: 0; }
.feature-card { background: linear-gradient(135deg, #ffffff, #eff6ff); }
.card-kicker { display: inline-flex; margin-bottom: 1rem; padding: .4rem .65rem; border-radius: 999px; background: var(--accent-soft); color: #1e3a8a; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.hero-badge { flex: 0 0 auto; min-width: 150px; padding: 1rem; border-radius: 22px; background: var(--panel-soft); border: 1px solid var(--border); text-align: right; }
.hero-badge span { display: block; color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.hero-badge strong { display: block; margin: .2rem 0; font-size: clamp(1.35rem, 3vw, 2rem); line-height: 1; }
.admin-badge { background: #fffbeb; border-color: #fde68a; }
.warning-badge { background: #fffbeb; border-color: #fde68a; }

.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.compact-status { flex: 0 1 470px; margin-bottom: 0; grid-template-columns: repeat(3, minmax(110px, 1fr)); }
.admin-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 1rem; }
.dashboard-hero { border-color: #dbeafe; background: rgba(255,255,255,.96); box-shadow: var(--shadow-soft); }
.dashboard-hero .compact-status { align-self: stretch; }
.dashboard-hero .stat-card { border-color: #e2e8f0; background: #ffffff; box-shadow: none; }
.stat-card { padding: 1rem; border: 1px solid var(--border); border-radius: 22px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-soft); }
.stat-card span { display: block; color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.stat-card strong { display: block; margin-top: .35rem; font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1; letter-spacing: -.05em; }
.stat-card p { margin: .65rem 0 0; color: var(--muted); font-size: .94rem; }
.stat-card.large { min-height: 138px; }
.stat-card.ok { border-color: #bbf7d0; background: linear-gradient(135deg, #ffffff, #f0fdf4); }
.stat-card.attention { border-color: #fde68a; background: linear-gradient(135deg, #ffffff, #fffbeb); }
.section-heading { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 1.9rem; margin: .25rem .35rem .25rem 0; padding: .35rem .7rem; border-radius: 999px; background: #eef2f7; color: #334155; font-size: .78rem; font-weight: 900; white-space: nowrap; overflow-wrap: normal; text-align: center; }
.status-pill.success { background: #dcfce7; color: #14532d; }
.status-pill.warning { background: #fef3c7; color: #78350f; }
.status-pill.admin { background: #e0e7ff; color: #3730a3; }
.status-pill.neutral { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.status-pill.uusi { background: #dbeafe; color: #1e3a8a; }
.status-pill.kasittelyssa { background: #fef3c7; color: #78350f; }
.status-pill.valmis { background: #dcfce7; color: #14532d; }
.status-pill.hylatty { background: #fee2e2; color: #7f1d1d; }
.notice-card { display: flex; gap: .75rem; align-items: center; margin: -0.5rem 0 1rem; padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: 20px; background: white; box-shadow: var(--shadow-soft); }
.notice-card strong { flex: 0 0 auto; }
.notice-card.warning { border-color: #fde68a; background: #fffbeb; color: #78350f; }
.empty-state { display: grid; justify-items: center; gap: .6rem; padding: clamp(1.5rem, 5vw, 2.5rem); border: 1px dashed #cbd5e1; border-radius: 22px; background: linear-gradient(135deg, #ffffff, var(--panel-soft)); text-align: center; }
.empty-state.compact { padding: 1rem; gap: .45rem; }
.empty-state h3, .empty-state p { margin: 0; }
.empty-state .button { margin-top: .25rem; }
.action-empty-state { justify-items: stretch; text-align: left; }
.action-empty-state .empty-icon, .action-empty-state h3, .action-empty-state > p, .action-empty-state > .button { justify-self: center; text-align: center; }
.data-load-empty { justify-items: start; text-align: left; }
.data-load-empty .empty-icon, .data-load-empty h3 { justify-self: center; text-align: center; }
.media-load-failed { border: 2px solid #fecaca; background: #fff7f7; }
.media-load-error { margin: .5rem 0 0; padding: .65rem .75rem; border: 1px solid #fecaca; border-radius: 12px; background: #fff7f7; color: #7f1d1d; font-weight: 800; }
.empty-action-list { display: grid; gap: .55rem; width: min(100%, 38rem); margin: .5rem auto 0; padding: 0; list-style: none; counter-reset: empty-steps; }
.empty-action-list li { counter-increment: empty-steps; position: relative; min-height: 2.5rem; padding: .65rem .8rem .65rem 3rem; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; color: #1e3a8a; font-weight: 800; }
.empty-action-list li::before { content: counter(empty-steps); position: absolute; left: .75rem; top: .55rem; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 900; }
.empty-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 16px; background: var(--accent-soft); color: #1e3a8a; font-size: 1.25rem; box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .12); }
.error-state { display: grid; justify-items: start; gap: .75rem; max-width: 720px; margin: clamp(2rem, 8vw, 5rem) auto; padding: clamp(1.5rem, 5vw, 3rem); }
.error-state h1, .error-state p { margin-bottom: 0; }
.error-state code { padding: .15rem .35rem; border-radius: 8px; background: #f1f5f9; color: #334155; }
.recovery-box { width: 100%; padding: 1rem; border: 1px solid #bfdbfe; border-radius: 18px; background: #eff6ff; color: #1e3a8a; }
.recovery-box ul { margin: .5rem 0 0; padding-left: 1.25rem; }
.recovery-box li + li { margin-top: .35rem; }
.error-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.error-icon { background: #fee2e2; color: #7f1d1d; font-weight: 900; }
.inline-empty { display: inline-flex; align-items: center; min-height: 2rem; padding: .45rem .7rem; border-radius: 12px; background: #f8fafc; color: #334155; border: 1px dashed #94a3b8; font-weight: 800; }
.search-hero { padding-block: clamp(1rem, 3vw, 1.45rem); border-color: #dbeafe; background: linear-gradient(135deg, #ffffff, #f8fbff); }
.search-hero .muted { max-width: 48rem; }
.search-command-card { margin-bottom: .5rem; padding-block: 1rem; border-color: #dbeafe; background: #ffffff; box-shadow: none; }
.search-page-form { display: grid; grid-template-columns: minmax(0, 1fr); justify-self: stretch; width: 100%; gap: .42rem; }
.search-page-form label { font-size: .95rem; font-weight: 900; color: var(--text); }
.search-page-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .55rem; align-items: stretch; }
.search-page-row input { min-height: 3.1rem; border-radius: 16px; font-size: 1rem; }
.search-page-row button { min-height: 3.1rem; border-radius: 16px; padding-inline: 1.25rem; }
.search-example-chips { display: flex; flex-wrap: wrap; gap: .3rem; color: var(--muted); }
.search-example-chips span { display: inline-flex; align-items: center; min-height: 1.55rem; padding: .18rem .5rem; border: 1px solid #dbeafe; border-radius: 999px; background: #f8fafc; color: #1e3a8a; font-size: .82rem; font-weight: 800; }
.search-results { display: grid; gap: .5rem; }
.search-results-heading { margin: -.1rem 0 .05rem; color: #334155; font-size: clamp(1rem, 1.8vw, 1.16rem); }
.search-empty-state { max-width: 52rem; justify-self: stretch; }
.search-start-state { border-style: dashed; }
.search-no-results-state { border-color: #fed7aa; border-left: 4px solid #f97316; background: #fffaf5; }
.search-result { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .7rem; align-items: center; justify-content: space-between; padding: .72rem .85rem; border-left: 4px solid var(--accent); box-shadow: none; }
.search-result-main { display: grid; gap: .25rem; min-width: 0; }
.search-result h2 { margin-bottom: 0; font-size: clamp(1rem, 1.9vw, 1.15rem); }
.search-result h2 a { color: var(--text); }
.search-result-excerpt { display: -webkit-box; max-width: 62rem; margin: 0; overflow: hidden; -webkit-line-clamp: 1; -webkit-box-orient: vertical; line-height: 1.4; overflow-wrap: anywhere; }
.search-result-action { flex: 0 0 auto; color: #1e3a8a; font-weight: 850; text-decoration: none; font-size: .88rem; }
.search-result-action::after { content: ' →'; }
.result-type { width: fit-content; padding: .14rem .42rem; border-radius: 999px; background: #f8fafc; color: #64748b; font-size: .68rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.filter-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-links .button { flex: 0 1 auto; }
.filter-links .button[aria-current="page"] { box-shadow: inset 0 0 0 2px rgba(255,255,255,.78); }
.filter-count { display: inline-grid; place-items: center; min-width: 1.6rem; min-height: 1.6rem; margin-left: .35rem; padding: .1rem .4rem; border-radius: 999px; background: rgba(255,255,255,.82); color: inherit; font-size: .78rem; font-weight: 900; }
.request-list, .own-requests { display: grid; gap: .06rem; }
.request-card, .request-mini-card { padding: .14rem; border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: none; }
.request-card p, .request-mini-card p { overflow-wrap: break-word; }
.change-requests-hero { display: grid; gap: .08rem; padding-block: clamp(.44rem, 1.2vw, .58rem); }
.change-requests-hero h1, .change-requests-hero p { margin-bottom: 0; }
.change-request-scan-guide { display: grid; gap: .35rem; max-width: 44rem; margin-top: .9rem; padding: .85rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; color: #334155; font-size: .9rem; }
.change-request-summary { max-width: 22rem; margin-top: .25rem; }
.change-request-scan-guide strong { color: #0f172a; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.change-request-scan-guide span { overflow-wrap: anywhere; }
.change-request-filter-card { padding: .18rem; box-shadow: none; opacity: 1; }
.change-request-list-card { padding: .22rem; border-color: #1d4ed8; box-shadow: 0 22px 32px rgba(37,99,235,.12); }
.request-card-heading { align-items: start; gap: .06rem; margin-bottom: 0; }
.request-work-item { min-width: 0; }
.request-work-item h3 { max-width: 62rem; margin: 0; font-size: clamp(.84rem, 1.3vw, .94rem); line-height: 1.01; overflow-wrap: anywhere; }
.request-page-context { margin: 0; color: #64748b; font-size: .58rem; font-weight: 800; }
.request-meta-row { display: flex; flex-wrap: wrap; gap: .35rem .75rem; margin: -.1rem 0 .65rem; color: var(--muted); font-size: .82rem; font-weight: 700; }
.request-card .status-pill { flex: 0 0 auto; }
.request-card-status { opacity: 1; }
.request-quote { margin: .75rem 0 1rem; padding: .85rem 1rem; border-left: 4px solid var(--accent); border-radius: 0 14px 14px 0; background: #f8fafc; color: var(--text); line-height: 1.55; overflow-wrap: break-word; }
.request-decision-form { display: grid; grid-template-columns: minmax(5.6rem, .2fr) auto minmax(0, .66fr); gap: .06rem; align-items: end; padding-top: .05rem; border-top: 1px solid #e2e8f0; }
.request-decision-primary, .request-decision-note { display: grid; gap: .05rem; }
.request-decision-form .hint { margin: -.25rem 0 0; }
.request-card textarea { min-height: 1.3rem; }
.request-optional-note { padding-left: .06rem; border-left: 1px solid #e2e8f0; opacity: 1; }
.request-card form button, .change-request-card form button { width: fit-content; min-height: 1.68rem; }
.request-save-action { min-width: 4.8rem; }
.compact-heading { margin-bottom: .5rem; }
.change-request-card { background: linear-gradient(135deg, #ffffff, #f8fafc); }
.site-footer { display: flex; justify-content: center; margin: 2rem 0 0; color: var(--muted); font-size: .92rem; }
.site-footer a { color: #475569; font-weight: 800; }
.privacy-card h2 { margin-top: 1.5rem; }
.privacy-card h2:first-child { margin-top: 0; }
.admin-group-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: end; padding: 1rem 0; border-top: 1px solid var(--border); }
.status-row { border-radius: 18px; padding-inline: .85rem; transition: background .15s ease, border-color .15s ease; }
.status-row.has-data { background: linear-gradient(90deg, rgba(240,253,244,.72), rgba(255,255,255,0)); border-top-color: #bbf7d0; }
.status-row.needs-attention { background: linear-gradient(90deg, rgba(255,251,235,.9), rgba(255,255,255,0)); border-top-color: #fde68a; }
.admin-workflow-card { border-color: #e2e8f0; background: #ffffff; box-shadow: none; }
.admin-flow-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; align-items: center; border-color: #e2e8f0; background: #ffffff; box-shadow: none; }
.admin-flow-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: flex-end; }
.admin-flow-actions .button { min-height: 2.75rem; }
.workflow-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin: 0; padding: 0; list-style: none; counter-reset: workflow; }
.workflow-list li { counter-increment: workflow; position: relative; min-width: 0; padding: .78rem .85rem .78rem 2.75rem; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.86); }
.workflow-list li::before { content: counter(workflow); position: absolute; left: .85rem; top: .9rem; display: grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 999px; background: var(--accent); color: white; font-weight: 900; }
.workflow-list strong, .workflow-list span { display: block; }
.workflow-list span { margin-top: .25rem; color: var(--muted); line-height: 1.45; }
.onboarding-landing-hero { padding-block: clamp(1.05rem, 3vw, 1.55rem); border-color: #dbeafe; background: linear-gradient(135deg, #ffffff, #f8fbff); }
.onboarding-landing-hero > div:first-child { display: grid; gap: .65rem; max-width: 52rem; }
.onboarding-landing-hero h1, .onboarding-landing-hero p { margin-bottom: 0; }
.onboarding-primary-next { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .85rem; align-items: center; max-width: 36rem; padding: .75rem; border: 1px solid #bfdbfe; border-radius: 18px; background: #eff6ff; color: #1e3a8a; }
.onboarding-primary-next strong { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; }
.onboarding-primary-next span { color: #1e3a8a; font-weight: 850; }
.onboarding-primary-next .button { grid-row: 1 / span 2; grid-column: 2; min-height: 3rem; }
.onboarding-count-badge { display: grid; gap: .25rem; min-width: 11rem; text-align: left; box-shadow: none; opacity: 1; }
.onboarding-count-badge span { display: flex; justify-content: space-between; gap: .75rem; align-items: center; color: var(--muted); }
.hero-badge.onboarding-count-badge strong { display: inline; margin: 0; color: var(--text); font-size: 1.05rem; line-height: 1; }
.onboarding-progress-card { padding-block: 1rem; border-color: #e2e8f0; background: #ffffff; box-shadow: none; }
.onboarding-progress-heading { margin-bottom: .45rem; }
.onboarding-scan-nav { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 1rem; align-items: center; }
.onboarding-secondary-nav { background: #ffffff; box-shadow: var(--shadow-soft); }
.scan-link-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.scan-link-list a { display: flex; align-items: center; min-height: 2.75rem; padding: .65rem .8rem; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; color: #1e3a8a; font-weight: 900; text-decoration: none; }
.scan-link-list a:hover, .scan-link-list a:focus-visible { background: #dbeafe; text-decoration: none; }
.onboarding-checklist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin: 0; padding: 0; list-style: none; }
.onboarding-checklist li { position: relative; min-height: 3rem; padding: 0; border: 1px solid #e2e8f0; border-radius: 14px; background: rgba(255,255,255,.88); }
.onboarding-checklist li::before { content: '…'; position: absolute; left: .65rem; top: .65rem; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 999px; background: #fef3c7; color: #78350f; font-weight: 900; pointer-events: none; }
.onboarding-checklist li.is-complete::before { content: '✓'; background: #dcfce7; color: #14532d; }
.onboarding-checklist a { display: grid; gap: .05rem; min-height: 3.45rem; padding: .58rem .68rem .58rem 2.55rem; color: inherit; text-decoration: none; }
.onboarding-checklist a:hover, .onboarding-checklist a:focus-visible { background: #f8fafc; border-radius: 16px; text-decoration: none; }
.onboarding-checklist strong, .onboarding-checklist span { display: block; }
.onboarding-checklist span { color: var(--muted); line-height: 1.3; }
.onboarding-progress-card > .button { min-height: 3rem; }
.onboarding-main-content { grid-template-columns: minmax(0, 1.35fr) minmax(240px, .75fr); align-items: start; }
.onboarding-content-section > .eyebrow, .onboarding-content-section > h2 { margin-bottom: .35rem; }
.onboarding-info-card, .onboarding-file-card { padding-block: 1rem; box-shadow: none; border-color: #e2e8f0; }
.onboarding-info-card h3, .onboarding-file-card h3 { margin-bottom: .45rem; }
.onboarding-file-card .hint { margin-top: 0; }
.onboarding-file-card > a:not(.image-link) { width: fit-content; }
.document-review-row { align-items: flex-start; }
.document-review-row .hint, .attention-text { margin: .25rem 0 0; }
.attention-text { color: #92400e; font-weight: 800; }
.app-chip-list { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.app-chip-list li { display: inline-flex; gap: .35rem; align-items: center; padding: .45rem .65rem; border-radius: 999px; background: #eff6ff; color: #1e3a8a; font-size: .9rem; }
.app-chip-list span { color: var(--muted); }
.credential-scan-guide { display: grid; gap: .35rem; align-self: stretch; min-width: min(100%, 18rem); padding: .85rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; color: #334155; font-size: .9rem; }
.credential-scan-guide strong { color: #0f172a; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.credential-scan-guide span { overflow-wrap: anywhere; }
.credential-scan-summary { min-width: min(100%, 14rem); align-content: center; }
.credential-action-card { border-color: #bfdbfe; box-shadow: none; }
.credential-list-card { border-color: #e2e8f0; box-shadow: none; }
.credential-missing-state { display: inline-flex; gap: .18rem; padding: .45rem .65rem; border: 1px solid #fde68a; border-radius: 999px; background: #fffbeb; color: #78350f; font-weight: 850; }
.credential-missing-state span { color: #92400e; font-size: .9rem; font-weight: 700; }
.admin-back-link a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 900; }
.employee-detail-back-link { margin: -.74rem 0 .06rem; }
.employee-detail-back-link a { min-height: 1.42rem; color: #334155; font-size: .78rem; opacity: 1; }
.admin-tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .1rem; margin-bottom: .08rem; }
.admin-tool-grid-heading { grid-column: 1 / -1; padding: 0 .02rem .02rem; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; }
.admin-tool-grid-heading h2, .admin-tool-grid-heading p { margin-bottom: 0; }
.admin-tool-grid .card { display: grid; align-content: start; gap: .06rem; margin-bottom: 0; min-height: 3.75rem; padding: .4rem; border-color: #e2e8f0; background: #ffffff; box-shadow: none; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.admin-tool-grid .card:hover { transform: translateY(-1px); border-color: #93c5fd; box-shadow: var(--shadow-soft); }
.admin-tool-grid .button { align-self: end; width: 100%; }
.admin-dashboard-hero > div:first-child { display: grid; gap: .06rem; max-width: 64rem; }
.admin-dashboard-hero h1, .admin-dashboard-hero p { margin-bottom: 0; }
.admin-next-task { display: grid; gap: .25rem; max-width: 40rem; padding: .75rem .85rem; border: 1px solid #bfdbfe; border-radius: 18px; background: #eff6ff; color: #1e3a8a; }
.admin-next-task strong { font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; }
.admin-next-task span { font-weight: 850; line-height: 1.4; }
.admin-quiet-metrics .stat-card { padding: .85rem; box-shadow: none; background: #f8fafc; }
.admin-section-label { grid-column: 1 / -1; padding: .1rem 0 .25rem; }
.admin-section-label h2, .admin-section-label p { margin: 0; }
.admin-quiet-metrics .stat-card strong { font-size: clamp(1.15rem, 2.4vw, 1.55rem); }
.admin-overview-grid { margin-bottom: .9rem; }
.admin-overview-grid .stat-card { box-shadow: none; }
.admin-primary-tool-card { border-color: #2563eb; background: linear-gradient(135deg, #ffffff, #eff6ff); }
.admin-primary-tool-card h2 { font-size: 1.02rem; }
.admin-tool-grid .admin-primary-tool-card { box-shadow: 0 8px 18px rgba(37,99,235,.08); }
.admin-secondary-tools-heading { margin-top: 0; opacity: 1; }
.admin-secondary-tool-card { min-height: 8.75rem; background: #fbfdff; box-shadow: none; }
.admin-secondary-tool-card h2 { font-size: .96rem; }
.admin-tool-grid .admin-secondary-tool-card { min-height: 2.42rem; background: #fbfdff; opacity: 1; }
.admin-tool-grid .admin-secondary-tool-card .button { min-height: 1.8rem; padding-block: .22rem; box-shadow: none; }
.admin-system-card { margin-top: 0; border-color: #e2e8f0; background: #fbfdff; box-shadow: none; opacity: 1; }
.admin-secondary-export-action { color: #475569; background: #f8fafc; }
.admin-utility-card { padding: .18rem .26rem; }
.admin-utility-card .section-heading { margin-bottom: 0; }
.admin-material-intro { margin-top: .08rem; opacity: 1; }
.admin-material-grid .admin-form-card { border-color: #dbeafe; opacity: 1; }
.priority-tool-card { border-color: #bfdbfe; background: #ffffff; }
.admin-tool-grid .admin-primary-tool-card { border-color: #2563eb; background: linear-gradient(135deg, #ffffff, #eff6ff); }
.priority-tool-card .button.primary { min-height: 1.98rem; box-shadow: 0 6px 14px rgba(37,99,235,.11); }
.admin-users-card { grid-column: 1 / -1; }

h1, h2, h3 { margin-top: 0; line-height: 1.1; overflow-wrap: break-word; word-break: normal; hyphens: manual; }
p, a, span, strong, small, label, button, .button { overflow-wrap: break-word; word-break: normal; }
h1 { font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.045em; }
h2 { font-size: 1.35rem; }
p { line-height: 1.6; }
.eyebrow { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; overflow-wrap: normal; word-break: keep-all; hyphens: none; }
.muted, .hint { color: var(--muted); }
.hint { font-size: .9rem; }
.required-label, .optional-label { display: inline-flex; align-items: center; width: fit-content; margin-left: .35rem; padding: .15rem .45rem; border-radius: 999px; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.required-label { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.optional-label { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chooser-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.choice-card { display: block; min-height: 220px; padding: 1.5rem; color: var(--text); background: rgba(255, 255, 255, 0.94); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow-soft); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; overflow-wrap: break-word; }
.choice-card:hover, .choice-card:focus-visible { text-decoration: none; border-color: #1d4ed8; box-shadow: var(--shadow), 0 0 0 4px rgba(37, 99, 235, .18); }
.choice-card:hover { transform: translateY(-3px); }
.choice-card:focus-visible { transform: none; }
.card:focus-within, .feature-card:focus-within, .change-request-card:focus-within, .status-row:focus-within, .app-overview-row:focus-within, .page-admin-row:focus-within, .admin-row:focus-within, .admin-group-row:focus-within, .admin-option-row:focus-within, .list-row:focus-within, .search-result:focus-within, .page-list-section:focus-within, .table-wrap:focus-within, .action-empty-state:focus-within, .onboarding-progress-card:focus-within, .onboarding-scan-nav:focus-within, .request-mini-card:focus-within { border-color: #93c5fd; box-shadow: var(--shadow-soft), 0 0 0 3px rgba(37, 99, 235, .12); }
.choice-card p { color: var(--muted); }
.choice-icon { display: inline-grid; place-items: center; width: 3rem; height: 3rem; margin-bottom: 1rem; border-radius: 18px; background: var(--accent-soft); font-size: 1.5rem; }
.admin-choice .choice-icon { background: #fef3c7; }
.pages-browse-hero { border-color: #dbeafe; background: linear-gradient(135deg, #ffffff, #f8fbff); }
.pages-browse-hero .muted, .content-page-hero .muted { max-width: 52rem; }
.content-page-hero { display: grid; gap: .45rem; padding-block: clamp(1rem, 3vw, 1.45rem); border-color: #dbeafe; background: linear-gradient(135deg, #ffffff, #f8fbff); }
.content-page-heading { display: grid; gap: .2rem; max-width: 64rem; }
.content-page-heading h1, .content-page-heading p { margin-bottom: 0; }
.page-group-section { display: grid; gap: .55rem; padding-block: .9rem; border-color: #e2e8f0; border-left: 4px solid #dbeafe; box-shadow: none; }
.page-group-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .7rem; align-items: center; padding-bottom: .55rem; border-bottom: 1px solid var(--border); }
.page-group-heading .eyebrow, .page-group-heading h2 { grid-column: 1; }
.page-group-heading .muted { grid-column: 2; grid-row: 1 / span 2; align-self: center; padding: .2rem .48rem; border-radius: 999px; background: #f8fafc; color: #64748b; font-size: .8rem; font-weight: 850; white-space: nowrap; }
.page-group-heading h2, .page-group-heading p { margin: 0; }
.page-group-heading-subtle { border-bottom-style: dashed; }
.page-ungrouped-section { background: #fbfdff; border-left-color: #cbd5e1; border-style: dashed; }
.page-card-grid { grid-template-columns: 1fr; gap: .35rem; }
.page-browse-card { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .65rem; align-items: center; padding: .62rem .75rem; border-radius: 14px; box-shadow: none; border-left: 0; }
.page-browse-card:hover, .page-browse-card:focus-visible { transform: none; }
.page-browse-card .result-type { grid-row: 1 / span 2; align-self: start; margin-top: .05rem; }
.page-browse-card h3 { margin: 0; font-size: 1rem; line-height: 1.25; color: var(--text); }
.page-card-excerpt { display: -webkit-box; grid-column: 2 / -1; margin: 0; max-width: 54rem; overflow: hidden; -webkit-line-clamp: 1; -webkit-box-orient: vertical; line-height: 1.38; }
.page-browse-card .page-hidden-note { grid-column: 2; grid-row: 1; margin: 0; }
.pages-empty-state { grid-column: 1 / -1; justify-items: start; text-align: left; }
.pages-empty-state .empty-icon, .pages-empty-state h2 { justify-self: start; }
.page-hidden-note, .page-hidden-banner { width: fit-content; margin: .05rem 0 0; padding: .35rem .6rem; border: 1px solid #fed7aa; border-left: 4px solid #f97316; border-radius: 999px; background: #fff7ed; color: #9a3412; font-size: .82rem; font-weight: 900; }
.page-content { max-width: 76ch; margin-bottom: .65rem; padding: clamp(1.15rem, 3.5vw, 2rem); border-color: #e2e8f0; box-shadow: none; font-size: clamp(1rem, 1.5vw, 1.1rem); line-height: 1.76; }
.page-content p { margin-block: 0 1.05rem; }
.page-content h2, .page-content h3 { margin-top: 1.6em; line-height: 1.25; }
.page-content :first-child { margin-top: 0; }
.page-feedback-card { max-width: 62rem; margin-top: 0; border-style: solid; border-color: #e2e8f0; background: #fbfdff; box-shadow: none; }
.page-feedback-card h2 { font-size: 1.2rem; }
.page-feedback-card textarea { min-height: 7rem; }
@media (max-width: 760px) { .grid.two { grid-template-columns: 1fr; } }

.stack { display: grid; gap: 1.1rem; }
label { display: grid; gap: .45rem; min-width: 0; font-weight: 800; line-height: 1.35; }
.admin-form-card .stack label { padding: .78rem; border: 1px solid #e2e8f0; border-radius: 16px; background: #f8fafc; }
.admin-form-card .stack label:focus-within { border-color: #93c5fd; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.10); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .82rem .9rem;
  min-height: 2.75rem;
  min-width: 0;
  background: white;
  color: var(--text);
  font: inherit;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type="file"] { padding: .55rem; }
input[type="file"]::file-selector-button { min-height: 2.5rem; margin-right: .75rem; border: 0; border-radius: 999px; padding: .55rem .85rem; background: #e9edf2; color: var(--text); font: inherit; font-weight: 800; cursor: pointer; }
.password-toggle-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: stretch; width: 100%; }
.password-toggle-wrap input { min-width: 0; }
.password-toggle-button { min-height: 2.75rem; padding-inline: .85rem; border-radius: 14px; white-space: nowrap; }
input:user-invalid, textarea:user-invalid, select:user-invalid { border-color: var(--danger); background: #fff7f7; }
input:user-valid, textarea:user-valid, select:user-valid { border-color: #16a34a; }
input:user-invalid:focus-visible, textarea:user-invalid:focus-visible, select:user-invalid:focus-visible { box-shadow: 0 0 0 4px rgba(185, 28, 28, .18); }
.field-error { display: none; margin: .05rem 0 0; color: var(--danger); font-size: .88rem; font-weight: 800; }
input:user-invalid + .field-error, textarea:user-invalid + .field-error, select:user-invalid + .field-error,
label:has(input:user-invalid) .field-error, label:has(textarea:user-invalid) .field-error, label:has(select:user-invalid) .field-error,
.field-error.is-visible, input[aria-invalid="true"] + .field-error, textarea[aria-invalid="true"] + .field-error, select[aria-invalid="true"] + .field-error,
label:has(input[aria-invalid="true"]) .field-error, label:has(textarea[aria-invalid="true"]) .field-error, label:has(select[aria-invalid="true"]) .field-error { display: block; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); background: #fff7f7; }
input[aria-invalid="true"]:focus-visible, textarea[aria-invalid="true"]:focus-visible, select[aria-invalid="true"]:focus-visible { outline-color: var(--danger); box-shadow: 0 0 0 4px rgba(185, 28, 28, .2); }
.field-has-error { scroll-margin-top: 7rem; }
.form-success-note { margin: .75rem 0 0; padding: .75rem .9rem; border-radius: 14px; background: #dcfce7; color: #14532d; font-weight: 800; }
.form-submit-status { grid-column: 1 / -1; margin: .25rem 0 0; padding: .75rem .9rem; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; color: #1e3a8a; font-weight: 900; }
.form-alert { grid-column: 1 / -1; margin: 0; padding: .75rem .9rem; border: 1px solid #fecaca; border-radius: 14px; background: #fff7f7; color: #7f1d1d; font-weight: 900; }
.form-note { margin: 0 0 1rem; padding: .8rem .95rem; border: 1px solid #bfdbfe; border-radius: 16px; background: #eff6ff; color: #1e3a8a; line-height: 1.5; }
.form-note.compact { margin: -.25rem 0 0; font-size: .92rem; }
.admin-section-intro { margin: .85rem 0 .45rem; padding: .15rem .1rem .35rem; border-bottom: 1px solid var(--border); }
.admin-section-intro h2, .admin-section-intro p { margin-bottom: 0; }
.admin-section-intro .muted { max-width: 58rem; }
.admin-form-grid { align-items: start; }
.admin-form-card, .admin-maintenance-card { border-color: #e2e8f0; background: #ffffff; box-shadow: none; }
.admin-form-card h2 { margin-bottom: .35rem; }
.admin-maintenance-card { padding: .5rem; opacity: 1; }
.admin-maintenance-card .empty-state { padding: .65rem; }
.admin-maintenance-card .section-heading { margin-bottom: .24rem; }
.admin-maintenance-grid { align-items: start; }
.admin-card-intro { margin: 0 0 1rem; }
.admin-form-card .stack > button { justify-self: start; min-width: 12rem; margin-top: .15rem; box-shadow: 0 8px 18px rgba(37,99,235,.16); }
.empty-state-action { justify-self: center; min-width: 12rem; }
.runtime-error-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid #fecaca; border-left: 5px solid #dc2626; border-radius: 16px; background: #fff7f7; color: #7f1d1d; font-weight: 900; box-shadow: var(--shadow-soft); }
.runtime-error-banner:focus { outline: 3px solid #b91c1c; outline-offset: 3px; }
.runtime-error-banner p { margin: .15rem 0 0; font-weight: 700; }
.runtime-error-actions { display: inline-flex; flex-wrap: wrap; gap: .5rem; }
.runtime-error-actions a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .45rem .75rem; border-radius: 999px; background: white; color: #7f1d1d; font-weight: 900; text-decoration: none; }
.runtime-recovery-banner { margin: 0 0 1rem; padding: .8rem .95rem; border: 1px solid #bbf7d0; border-left: 5px solid #16a34a; border-radius: 16px; background: #f0fdf4; color: #14532d; font-weight: 900; box-shadow: var(--shadow-soft); }
.form-needs-attention { border-radius: 18px; padding-inline: .85rem; }
textarea { resize: vertical; }
button, .button {
  border: 0;
  border-radius: 999px;
  padding: .72rem 1rem;
  min-height: 2.75rem;
  background: #e9edf2;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  white-space: normal;
  line-height: 1.2;
  transition: transform .15s ease, filter .15s ease, background .15s ease;
}
button:hover, .button:hover { filter: brightness(.97); text-decoration: none; transform: translateY(-1px); }
form.is-submitting { opacity: .82; }
form.is-submitting button { cursor: progress; }
button:disabled, .button[aria-disabled="true"] { cursor: not-allowed; opacity: .72; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.danger { background: #b91c1c; color: #fff; }
.danger:hover { background: #991b1b; }
.inline { display: inline; }
.inline button { padding: .45rem .8rem; }

.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 16px; margin-bottom: 1rem; font-weight: 800; box-shadow: var(--shadow-soft); }
.flash::before { flex: 0 0 auto; }
.flash.success::before { content: '✓'; }
.flash.error::before { content: '!'; }
.flash.success { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.flash.error { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.recovery-hint, .success-hint { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; margin: -.35rem 0 1rem; padding: .75rem .9rem; border: 1px solid #bfdbfe; border-radius: 14px; background: #eff6ff; color: #1e3a8a; font-weight: 800; }
.success-hint { border-color: #86efac; background: #f0fdf4; color: #14532d; }
.recovery-hint > span, .success-hint > span { min-width: 0; overflow-wrap: anywhere; }
.recovery-actions { display: inline-flex; flex-wrap: wrap; gap: .5rem; }
.recovery-actions a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .45rem .75rem; border-radius: 999px; background: white; color: #1e3a8a; font-weight: 900; text-decoration: none; }
.success-actions { display: inline-flex; flex-wrap: wrap; gap: .5rem; }
.success-actions a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: .45rem .75rem; border-radius: 999px; background: white; color: #14532d; font-weight: 900; text-decoration: none; }
.request-id-inline { display: inline-flex; align-items: center; gap: .25rem; margin-left: .35rem; padding: .15rem .45rem; border-radius: 999px; background: rgba(255,255,255,.75); color: #1e3a8a; font-weight: 900; white-space: nowrap; }

.prose { overflow-wrap: anywhere; }
.prose p { white-space: pre-wrap; }
.prose img, .prose table, .prose pre, .prose code { max-width: 100%; }
.prose pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.content-list, .file-list { display: grid; gap: 1rem; }
.image-link { display: block; cursor: zoom-in; border-radius: 18px; }
.image-link:focus-visible .uploaded-image { border-color: #1d4ed8; box-shadow: 0 0 0 4px rgba(37, 99, 235, .18); }
.uploaded-image { width: 100%; height: auto; max-height: min(70vh, 760px); object-fit: contain; border-radius: 18px; border: 1px solid var(--border); background: #fff; }
.pdf-icon { width: 92px; height: 116px; display: grid; place-items: center; border-radius: 14px; background: #fee2e2; color: #7f1d1d; font-weight: 900; margin-bottom: 1rem; border: 1px solid #fecaca; }
.admin-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto auto; gap: .75rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--border); }
.admin-option-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .5rem; align-items: start; padding: .8rem 0; border-top: 1px solid var(--border); }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--border); }
.user-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 1.4fr) minmax(220px, .8fr); gap: 1rem; align-items: start; padding: 1rem 0; border-top: 1px solid var(--border); overflow: visible; }
.user-summary { min-width: 0; }
.user-summary strong, .user-summary .muted, .user-summary .hint { overflow-wrap: break-word; }
.user-summary .status-pill { display: flex; width: max-content; max-width: 100%; white-space: normal; overflow-wrap: break-word; }
.reset-password-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: .5rem; align-items: start; min-width: 0; }
.reset-password-form label, .reset-password-form input, .user-actions form { min-width: 0; }
.reset-password-form button, .user-actions button { width: 100%; white-space: normal; }
.user-actions { display: flex; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.user-actions form { flex: 1 1 180px; }
.qr-code { display: block; width: min(240px, 100%); margin: .75rem auto 0; border: 1px solid var(--border); border-radius: 18px; background: white; }
.account-security-hero { display: grid; gap: .2rem; padding-block: clamp(1rem, 3vw, 1.4rem); }
.account-identity-summary { display: inline-grid; justify-self: start; max-width: 44rem; padding: .4rem .55rem; border: 1px solid #e2e8f0; border-radius: 999px; background: #f8fafc; color: #334155; opacity: 1; }
.account-identity-summary strong { color: #0f172a; font-size: .86rem; overflow-wrap: anywhere; }
.account-identity-summary span { color: var(--muted); font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.account-security-card { padding-block: 1rem; border-color: #dbeafe; box-shadow: none; }
.account-security-card h2 { margin-bottom: .4rem; }
.account-security-form { gap: .48rem; }
.password-field-group { display: grid; gap: .22rem; padding: .6rem .72rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; }
.password-field-current { border-left: 4px solid #94a3b8; }
.password-field-new { border-left: 4px solid #2563eb; background: #fbfdff; }
.password-field-confirm { border-left: 4px solid #22c55e; }
.password-field-group label { margin: 0; }
.password-inline-rule { margin: -.08rem 0 .02rem; color: #475569; font-size: .84rem; font-weight: 700; line-height: 1.34; }
.password-field-group .hint { margin: -.1rem 0 0; }
.account-security-form button.primary { min-height: 3rem; margin-top: .02rem; }
.manual-secret { display: block; padding: .55rem; margin-top: .45rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; color: #334155; overflow-wrap: anywhere; font-weight: 800; line-height: 1.38; }
.two-factor-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; margin: .7rem 0 .8rem; }
.two-factor-flow span { display: flex; gap: .4rem; align-items: center; padding: .5rem .55rem; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fafc; color: #334155; font-weight: 800; }
.two-factor-flow strong { display: inline-grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 999px; background: #dbeafe; color: #1e3a8a; font-size: .86rem; }
.two-factor-setup-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: .6rem; align-items: stretch; margin-top: .75rem; }
.two-factor-qr-panel, .two-factor-manual-panel, .two-factor-form { padding: .75rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; }
.two-factor-qr-panel h2, .two-factor-manual-panel h2, .two-factor-form h2 { margin: 0; font-size: 1rem; }
.two-factor-manual-panel { border-color: #e2e8f0; background: #fbfdff; }
.two-factor-manual-panel h2 { color: #475569; font-size: .94rem; }
.two-factor-form { margin-top: .6rem; }
.two-factor-form .hint { margin-top: -.25rem; }
.applications-detail-hero > div:first-child { max-width: 58rem; }
.credential-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .7rem; align-items: end; }
.credential-create-form { padding: .9rem; border: 1px solid #bfdbfe; border-radius: 18px; background: #fbfdff; }
.credential-form .hint { grid-column: span 1; margin: -.6rem 0 0; align-self: start; }
.credential-form button { align-self: end; }
.credential-row { display: grid; grid-template-columns: minmax(170px, .8fr) repeat(4, minmax(130px, 1fr)) minmax(130px, auto); gap: .6rem; align-items: end; padding: .85rem; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: none; }
.credential-row + .credential-row { margin-top: .65rem; }
.credential-row-summary { align-self: stretch; display: grid; align-content: center; gap: .15rem; min-width: 0; padding: .65rem .75rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; }
.credential-row-summary strong { color: #0f172a; font-size: 1.02rem; overflow-wrap: anywhere; }
.credential-row-summary span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.credential-row-actions { display: grid; gap: .35rem; align-self: end; }
.credential-row-actions .danger { margin-top: .1rem; }
.app-overview-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) auto; gap: .75rem; align-items: center; padding: .85rem; border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; box-shadow: none; }
.app-overview-row + .app-overview-row { margin-top: .55rem; }
.app-overview-row.needs-attention { border-color: #fde68a; border-left: 4px solid #f59e0b; background: #fffdf7; }
.app-overview-row.needs-attention .app-edit-action { box-shadow: none; }
.app-overview-row h3 { margin-bottom: .15rem; }
.app-user-summary { min-width: 0; }
.app-access-summary { min-width: 0; }
.app-access-count { justify-self: start; }
.app-access-zero { color: #92400e; font-size: .9rem; font-weight: 900; }
.app-edit-action { justify-self: end; min-width: 9rem; }
.page-admin-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto auto; gap: .75rem; align-items: end; padding: 1rem 0; border-top: 1px solid var(--border); }
.checkbox-label { display: flex; gap: .5rem; align-items: center; }
.checkbox-label input { width: 1.15rem; min-width: 1.15rem; height: 1.15rem; }
.edit-panel { border-color: #bfdbfe; background: #eff6ff; }
.page-content { font-size: 1.05rem; overflow-wrap: break-word; }
.compact-list { margin: 0; padding-left: 1.1rem; }
.compact-list li { margin-bottom: .25rem; }
.table-wrap { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #94a3b8 #f8fafc; border: 1px solid var(--border); border-radius: 18px; background: white; }
.table-wrap:focus-visible { outline: 4px solid #1d4ed8; outline-offset: 3px; box-shadow: 0 0 0 4px rgba(37, 99, 235, .18); }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 520px; }
.data-table th, .data-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: break-word; word-break: normal; }
.data-table th { background: var(--panel-soft); color: #334155; font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.data-table thead th:first-child { border-top-left-radius: 17px; }
.data-table thead th:last-child { border-top-right-radius: 17px; }
.data-table tbody tr:nth-child(even) td { background: #fbfdff; }
.data-table tr:last-child td { border-bottom: 0; }
.narrow-card { max-width: 620px; }
.guide-preview { min-height: 18rem; }
@media (max-width: 1040px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .main-nav { width: 100%; max-width: 100%; min-width: 0; justify-content: flex-end; }
  .main-nav a, .main-nav details, .nav-button { flex: 0 0 auto; }
  .main-nav .inline { flex: 0 0 auto; margin-left: auto; }
  .main-nav .inline button { white-space: nowrap; }
  .main-nav a, .nav-button, .nav-dropdown summary { scroll-snap-align: start; }
  .nav-dropdown { position: static; }
  .nav-dropdown-menu { left: 1rem; right: 1rem; }
}
@media (max-width: 900px) {
  .workflow-list, .admin-tool-grid { grid-template-columns: 1fr; }
  .admin-tool-grid { gap: .06rem; }
  .admin-tool-grid .card { min-height: 0; padding: .32rem; }
  .admin-tool-grid-heading { padding-bottom: 0; }
  .admin-tool-grid .admin-secondary-tool-card { min-height: 0; }
  .admin-flow-nav { grid-template-columns: 1fr; }
  .admin-flow-actions { justify-content: stretch; gap: .65rem; }
  .admin-flow-actions .button { width: 100%; justify-content: center; text-align: center; line-height: 1.35; }
  .onboarding-scan-nav { grid-template-columns: 1fr; }
  .employee-list-row, .employee-row-fields, .employee-import-block { grid-template-columns: 1fr; }
  .employee-list-row { gap: .12rem; padding: .32rem; border-radius: 14px; }
  .employee-row-status { display: flex; flex-wrap: wrap; gap: .12rem; align-items: center; }
  .employee-row-actions { justify-items: stretch; }
  .employee-row-actions-main, .employee-row-actions-save { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .12rem; justify-content: stretch; }
  .employee-row-actions .button, .employee-row-actions button { width: 100%; min-width: 0; }
  .admin-row, .admin-option-row, .reset-password-form, .credential-form, .credential-row, .app-overview-row, .page-admin-row, .admin-group-row, .user-admin-row { grid-template-columns: minmax(0, 1fr); }
  .admin-row label, .admin-option-row label, .reset-password-form label, .credential-form label, .credential-row label, .app-overview-row > *, .page-admin-row label, .admin-group-row label, .user-admin-row > * { min-width: 0; }
  .list-row { align-items: flex-start; }
  .admin-row button, .admin-option-row button, .admin-group-row button, .reset-password-form button, .credential-row button, .credential-form button, .page-admin-row button { width: 100%; }
  .user-actions form { flex-basis: 100%; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .admin-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-tool-grid .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .admin-tool-grid .button { width: fit-content; min-width: 12rem; justify-self: start; }
}
@media (max-width: 820px) {
  .section-heading, .notice-card { flex-direction: column; align-items: stretch; }
  .section-heading { gap: .55rem; }
  .section-heading .status-pill { width: fit-content; max-width: 100%; white-space: normal; text-align: left; }
}
@media (max-width: 760px) {
  .container { width: min(100% - 1rem, var(--content-width)); margin-top: .75rem; margin-bottom: 2rem; }
  .hero, .page-title { align-items: stretch; flex-direction: column; gap: 1rem; padding: 1.15rem; border-radius: 22px; }
  .hero p, .page-title p { line-height: 1.55; }
  .hero-badge { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .35rem .75rem; width: 100%; min-width: 0; text-align: left; }
  .hero-badge strong { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }
  .hero-badge span { min-width: 0; overflow-wrap: anywhere; }
  .compact-status, .admin-status-grid { grid-template-columns: 1fr; }
  .status-grid { gap: .75rem; margin-bottom: .9rem; }
  .stat-card.large { min-height: auto; }
  .card { border-radius: 22px; }
  .card + .card, .feature-card + .feature-card { margin-top: .85rem; }
  .section-heading, .notice-card { flex-direction: column; }
  .section-heading { gap: .5rem; }
  .section-heading > *, .notice-card > *, .list-row > * { min-width: 0; }
  .dashboard-hero .compact-status .stat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .35rem .8rem; }
  .dashboard-hero .compact-status .stat-card span { align-self: end; }
  .dashboard-hero .compact-status .stat-card strong { justify-self: end; margin-top: 0; }
  .dashboard-hero h1, .dashboard-hero p { overflow-wrap: anywhere; }
  .status-pill { white-space: normal; overflow-wrap: break-word; word-break: normal; }
  .status-row { padding-inline: .75rem; }
  .filter-links .button { flex: 1 1 10rem; }
  .request-decision-form { grid-template-columns: 1fr; gap: .08rem; }
  .request-optional-note { padding-left: 0; border-left: 0; }
  .request-card form button, .change-request-card form button { width: 100%; }
  .change-request-card { padding: 1rem; }
  .change-request-card textarea { min-height: 9rem; }
  .list-row { flex-direction: column; align-items: stretch; gap: .75rem; }
  .list-row form, .list-row button { width: 100%; }
  .runtime-error-banner { align-items: stretch; }
  .runtime-error-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .runtime-error-actions a { justify-content: center; min-height: 3rem; text-align: center; line-height: 1.35; }
  .app-chip-list { align-items: stretch; flex-direction: column; }
  .app-chip-list li { border-radius: 14px; justify-content: space-between; overflow-wrap: break-word; }
  .app-overview-row { gap: .75rem; padding: 1rem .75rem; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
  .app-overview-row + .app-overview-row { margin-top: .85rem; }
  .app-overview-row h3 { margin-bottom: .15rem; }
  .app-overview-row .status-pill { width: 100%; justify-content: center; }
  .credential-form, .credential-row, .page-admin-row, .admin-row, .admin-option-row, .admin-group-row { gap: .9rem; }
  .request-card form { gap: .22rem; }
  .credential-form .hint { grid-column: 1 / -1; margin-top: -.45rem; }
  .credential-form .password-toggle-wrap,
  .credential-row .password-toggle-wrap { grid-template-columns: 1fr; }
  .credential-form .password-toggle-button,
  .credential-row .password-toggle-button { width: 100%; min-height: 2.55rem; }
  .credential-create-form,
  .credential-row { padding: .75rem; border-radius: 16px; }
  .credential-row-summary { padding: .65rem; border-radius: 13px; }
  .credential-row-actions { gap: .5rem; }
  .topbar { gap: .55rem; }
  .main-nav { max-width: 100%; justify-content: flex-end; gap: .3rem; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-block: .12rem; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a, .nav-button, .nav-dropdown summary { flex: 0 0 auto; min-height: 2.45rem; }
  .settings-dropdown summary { min-width: 0; text-align: left; }
  .search-page-form input { width: 100%; }
  .search-page-row, .search-result { grid-template-columns: 1fr; flex-direction: column; align-items: stretch; }
  .search-result-action { width: 100%; justify-content: center; }
  .two-factor-flow, .two-factor-setup-grid { grid-template-columns: 1fr; }
  .two-factor-flow span { min-height: 2.75rem; }
  .login-hero { grid-template-columns: 1fr; min-height: calc(100vh - 5.1rem); padding: 2rem 1rem; }
  .login-copy { display: none; }
  .auth-card { border-radius: 22px; }
  .auth-card, .login-card { width: 100%; max-width: none; }
  .choice-card { min-height: auto; }
}
@media (max-width: 640px) {
  .chooser-grid { grid-template-columns: 1fr; gap: .9rem; }
  .choice-card { min-height: 4.5rem; padding: 1rem; }
  .choice-icon { width: 2.7rem; height: 2.7rem; margin-bottom: .65rem; }
  .status-grid { grid-template-columns: 1fr; }
  .hero, .page-title { margin-bottom: 1rem; }
  .table-wrap { border-radius: 14px; margin-inline: -.15rem; width: calc(100% + .3rem); }
  .data-table { min-width: 440px; }
  .data-table th, .data-table td { padding: .7rem .75rem; }
  .work-hours-table { min-width: 0; border-spacing: 0 .75rem; }
  .work-hours-table thead { display: none; }
  .work-hours-table, .work-hours-table tbody, .work-hours-table tr, .work-hours-table th, .work-hours-table td { display: block; width: 100%; }
  .work-hours-table tr { padding: .85rem; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft); }
  .work-hours-table th, .work-hours-table td { display: flex; justify-content: space-between; gap: 1rem; padding: .42rem 0; border-bottom: 1px solid #e2e8f0; font-size: .94rem; }
  .work-hours-table th { background: transparent; color: var(--text); letter-spacing: 0; text-transform: none; }
  .work-hours-table th::before { content: 'Kuljettaja'; color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
  .work-hours-table td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
  .work-hours-table tr:last-child td, .work-hours-table tr:last-child th, .work-hours-table td:last-child { border-bottom: 0; }
  .file-list .card { display: grid; gap: .75rem; }
  .file-list .card, .document-review-row, .list-row { min-width: 0; }
  .file-list a, .document-review-row a, .list-row strong, .list-row span { overflow-wrap: anywhere; }
  .file-list .card > a:not(.image-link) { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 3rem; padding: .65rem .85rem; border-radius: 14px; background: var(--panel-soft); }
  .uploaded-image { max-height: 55vh; }
  input, textarea, select { font-size: 16px; }
  textarea { min-height: 8rem; }
  button, .button { min-height: 3rem; }
  label { gap: .45rem; line-height: 1.35; }
  .field-error.is-visible, input[aria-invalid="true"] + .field-error, textarea[aria-invalid="true"] + .field-error, select[aria-invalid="true"] + .field-error { margin-top: .15rem; padding: .6rem .7rem; border: 1px solid #fecaca; border-radius: 12px; background: #fff7f7; line-height: 1.4; }
  .form-submit-status, .form-alert { padding: .85rem; border-radius: 14px; line-height: 1.45; }
  form.is-submitting { opacity: .92; }
  form.is-submitting button { min-height: 3.15rem; }
  .empty-action-list li { min-height: 3rem; padding: .75rem .85rem .75rem 3rem; }
  .stack, .reset-password-form, .user-actions { gap: .8rem; }
  .checkbox-label { align-items: flex-start; min-height: 3rem; padding-block: .35rem; }
  .checkbox-label input { width: 1.35rem; min-width: 1.35rem; height: 1.35rem; margin-top: .1rem; }
}
@media (max-width: 520px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); padding: .5rem .55rem; gap: .45rem; }
  .brand { width: auto; }
  .brand-copy { min-width: 0; }
  .brand-logo { width: clamp(6.8rem, 31vw, 8.8rem); max-height: 2.22rem; }
  .brand small { display: none; }
  .main-nav { gap: .22rem; display: flex; flex-wrap: nowrap; justify-content: flex-start; min-width: 0; padding-bottom: .18rem; }
  .main-nav a, .nav-button { min-height: 2.3rem; max-width: none; font-size: .8rem; padding-inline: .52rem; white-space: nowrap; text-align: center; }
  .main-nav .inline { flex: 0 0 auto; justify-self: auto; }
  .main-nav .inline .nav-button { width: auto; }
  .nav-dropdown { width: auto; }
  .nav-dropdown summary { min-height: 2.3rem; max-width: none; font-size: .8rem; padding-inline: .52rem; white-space: nowrap; text-align: center; width: auto; }
  .nav-dropdown-menu { left: .5rem; right: .5rem; min-width: 0; max-width: calc(100vw - 1rem); max-height: min(70vh, 28rem); overflow-y: auto; }
  .settings-dropdown { width: auto; }
  .settings-dropdown summary { min-width: 0; padding-block: .5rem; text-align: left; }
  .settings-menu { gap: .85rem; padding: .95rem; }
  .settings-menu label { padding: .75rem; }
  .settings-menu select, .settings-reset { min-height: 3rem; }
  .nav-dropdown-menu a { min-height: 2.55rem; padding-block: .58rem; }
  .site-search { grid-template-columns: 1fr; width: 100%; }
  .site-search button { width: 100%; }
  .admin-tool-grid .card, .admin-workflow-card, .workflow-list li { min-width: 0; }
  .search-page-form { width: 100%; }
  .filter-links { display: grid; grid-template-columns: 1fr; }
  .filter-links .button { width: 100%; min-height: 3rem; justify-content: space-between; }
  .filter-count { margin-left: auto; }
  h1 { font-size: clamp(1.9rem, 12vw, 2.75rem); }
  .dashboard-hero h1 { font-size: clamp(1.85rem, 10vw, 2.35rem); letter-spacing: -.055em; }
  .account-security-hero h1 { font-size: clamp(2.1rem, 10vw, 2.45rem); letter-spacing: -.04em; }
  .account-security-card { padding: .85rem; }
  .account-security-form { gap: .58rem; }
  .password-field-group { gap: .18rem; padding: .55rem .65rem; border-radius: 13px; }
  .password-inline-rule { font-size: .8rem; line-height: 1.3; }
  h2 { font-size: 1.2rem; }
  .hero, .page-title { padding: 1rem; }
  .auth-card, .narrow-card { margin: 1rem auto; }
  .auth-card label, .narrow-card label { line-height: 1.35; }
  .hero-badge { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero-badge strong { grid-column: auto; grid-row: auto; justify-self: center; }
  .card, .choice-card { padding: 1rem; }
  .card > *, .choice-card > *, .auth-card > *, .page-title > *, form, fieldset { min-width: 0; max-width: 100%; }
  .grid.two > section { min-width: 0; }
  .grid.two > section > h2 { margin-bottom: .65rem; }
  .change-request-card .form-note { margin-bottom: .2rem; }
  .change-request-card button { margin-top: .1rem; }
  .image-link { min-height: 3rem; }
  .workflow-list li { padding: .9rem .9rem .9rem 2.8rem; }
  .workflow-list li::before { left: .75rem; top: .85rem; }
  .onboarding-checklist { grid-template-columns: 1fr; }
  .onboarding-checklist li { padding: 0; }
  .onboarding-checklist li::before { left: .75rem; top: .8rem; }
  .onboarding-checklist li, .scan-link-list a { overflow-wrap: anywhere; }
  .onboarding-progress-card .status-pill { width: 100%; justify-content: center; text-align: center; }
  .onboarding-progress-card > .button { width: 100%; }
  .onboarding-scan-nav { gap: .75rem; }
  .scan-link-list { gap: .65rem; }
  .scan-link-list a { min-height: 3rem; padding: .75rem .85rem; line-height: 1.35; }
  input[type="file"]::file-selector-button { display: block; width: 100%; margin: 0 0 .45rem; }
  .status-pill { width: fit-content; justify-content: flex-start; text-align: left; }
  .hero-badge strong { font-size: clamp(1.2rem, 8vw, 1.6rem); }
  .admin-row, .user-admin-row, .list-row, .credential-row, .app-overview-row, .page-admin-row, .admin-group-row, .request-card, .request-mini-card, .change-request-card { overflow-wrap: break-word; }
  .manual-secret, .recovery-box { overflow-wrap: anywhere; }
  .flash, .form-submit-status, .form-alert, .form-note, .recovery-hint, .success-hint, .runtime-recovery-banner { width: 100%; line-height: 1.45; overflow-wrap: break-word; }
  .flash { align-items: flex-start; padding: .8rem .85rem; }
  .stack > button, form.stack > .button { width: 100%; justify-content: center; text-align: center; }
  .stack > label + input, .stack > label + textarea, .stack > label + select { width: 100%; }
  .stack label > input, .stack label > textarea, .stack label > select { width: 100%; min-width: 0; margin-top: .35rem; }
  .request-id-inline { display: flex; width: fit-content; max-width: 100%; margin: .45rem 0 0; white-space: normal; overflow-wrap: anywhere; }
  .inline-empty { display: flex; width: 100%; justify-content: center; text-align: center; }
  .app-overview-row { padding: .9rem; }
  .app-chip-list li { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: .15rem; padding: .7rem .8rem; }
  .app-chip-list span { overflow-wrap: anywhere; }
  .error-actions { width: 100%; }
  .recovery-hint { align-items: stretch; }
  .success-hint { align-items: stretch; }
  .recovery-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .recovery-actions a { justify-content: center; min-height: 3rem; text-align: center; line-height: 1.35; }
  .success-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .success-actions a { justify-content: center; min-height: 3rem; text-align: center; line-height: 1.35; }
  .runtime-recovery-banner { padding: .75rem .85rem; border-radius: 14px; }
  .admin-row button, .admin-option-row button, .admin-group-row button, .user-actions button, .reset-password-form button, .credential-row button, .credential-form button, .page-admin-row button, .app-overview-row .button, .request-card button, .error-actions .button, .button { width: 100%; }
  .employee-list-row { gap: .16rem; padding: .42rem; }
  .employee-row-actions-main, .employee-row-actions-save { grid-template-columns: 1fr; gap: .14rem; }
  .employee-row-status .status-pill, .employee-portal-pill { min-height: 2rem; }
  .admin-back-link a { justify-content: center; width: 100%; min-height: 3rem; padding: .65rem .85rem; border-radius: 14px; background: var(--panel-soft); text-align: center; }
  .inline button, .main-nav .inline button { width: auto; }
  .empty-state { padding: 1.1rem; }
  .empty-icon { width: 2.8rem; height: 2.8rem; border-radius: 16px; }
  .site-footer { align-items: center; text-align: center; padding-inline: .75rem; margin-top: 1.25rem; }
}
@media (max-width: 380px) {
  .container { width: min(100% - .5rem, var(--content-width)); }
  .topbar { padding: .6rem .5rem; }
  .login-hero { padding-inline: .5rem; }
  .main-nav a, .nav-button, .nav-dropdown summary { max-width: min(14rem, calc(100vw - 1rem)); padding-inline: .68rem; }
  .data-table { min-width: 360px; }
  .data-table th, .data-table td { padding: .58rem .5rem; font-size: .9rem; }
  .password-toggle-wrap { grid-template-columns: 1fr; }
  .password-toggle-button { width: 100%; }
  .recovery-box { padding: .85rem; border-radius: 16px; }
  .hero, .page-title, .card, .choice-card { border-radius: 18px; }
  .card, .choice-card, .change-request-card { padding: .85rem; }
  .request-card, .request-mini-card { padding: .26rem; }
  input, textarea, select { padding-inline: .75rem; }
  .stack { gap: .7rem; }
}

@media print {
  @page { margin: 14mm; }
  * { box-shadow: none !important; text-shadow: none !important; }
  html, body { min-width: 0; overflow: visible; background: #fff !important; color: #111827; font-size: 11pt; }
  body { background: #fff !important; }
  .topbar, .site-search, .main-nav, .site-footer, form, button, .button, .skip-link, .flash, .recovery-hint, .success-hint, .runtime-error-banner { display: none !important; }
  .container { width: 100%; margin: 0; }
  .hero, .page-title, .card, .auth-card { border: 0; border-radius: 0; background: #fff !important; padding: 0; margin: 0 0 10mm; }
  .dashboard-hero { display: block; page-break-after: avoid; }
  .page-title h1, .hero h1 { font-size: 22pt; margin-bottom: 3mm; }
  h2 { font-size: 15pt; margin: 0 0 4mm; }
  h3 { font-size: 12pt; }
  p, .muted, .hint { color: #334155 !important; }
  .status-grid, .compact-status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; margin: 5mm 0; }
  .stat-card { border: 1px solid #cbd5e1; border-radius: 0; padding: 4mm; break-inside: avoid; }
  .stat-card span { color: #334155; font-size: 8pt; }
  .stat-card strong { font-size: 18pt; }
  .grid, .grid.two { display: block; }
  .table-wrap { overflow: visible !important; border: 0; border-radius: 0; background: transparent; }
  .data-table, .work-hours-table { display: table; width: 100%; min-width: 0; border-collapse: collapse; border-spacing: 0; font-size: 9.5pt; }
  .data-table caption { text-align: left; margin-bottom: 3mm; font-weight: 800; }
  .data-table thead, .work-hours-table thead { display: table-header-group; }
  .data-table tbody, .work-hours-table tbody { display: table-row-group; }
  .data-table tr, .work-hours-table tr { display: table-row; break-inside: avoid; border: 0; padding: 0; background: transparent; }
  .data-table th, .data-table td, .work-hours-table th, .work-hours-table td { display: table-cell; width: auto; padding: 2.5mm 2mm; border: 1px solid #cbd5e1; background: #fff; color: #111827; text-align: left; vertical-align: top; font-size: 9.5pt; }
  .data-table th, .work-hours-table th { font-weight: 800; }
  .work-hours-table th::before, .work-hours-table td::before { content: none !important; }
  .section-heading { display: block; margin-bottom: 4mm; }
  .status-pill { border: 1px solid #cbd5e1; color: #111827 !important; background: #fff !important; }
  .list-row { display: block; border-top: 1px solid #cbd5e1; padding: 4mm 0; break-inside: avoid; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 8pt; color: #475569; }
}

/* Excel-style work shift page */
.work-shift-hero { padding-block: clamp(.5rem, 1.35vw, .7rem); background: rgba(255,255,255,.96); border-color: #e2e8f0; box-shadow: none; }
.work-flow-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; min-width: min(100%, 28rem); margin: 0; padding: 0; list-style: none; }
.work-flow-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; align-items: center; min-height: 3rem; padding: .55rem .65rem; border: 1px solid #dbeafe; border-radius: 16px; background: #f8fafc; color: #334155; font-weight: 800; }
.work-flow-steps strong { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: .82rem; }
.work-flow-steps span { min-width: 0; font-size: .86rem; line-height: 1.2; }
.work-scan-guide { display: grid; gap: .35rem; align-self: stretch; min-width: min(100%, 18rem); padding: .85rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; color: #334155; font-size: .88rem; }
.work-scan-guide strong { color: #0f172a; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.work-scan-guide span { overflow-wrap: anywhere; }
.work-shift-controls { align-items: stretch; }
.work-range-card, .work-compact-card, .work-import-card, .work-rows-card { border-color: #e2e8f0; box-shadow: none; }
.work-range-card, .work-compact-card { padding: .16rem; background: #fbfdff; }
.work-support-card { opacity: 1; }
.work-range-card.work-support-card { opacity: 1; }
.work-range-actions, .work-range-form { display: flex; flex-wrap: wrap; gap: .1rem; align-items: end; }
.work-range-actions { margin-bottom: .1rem; }
.work-group-filters { margin: 0 0 .1rem; }
.work-range-form + .work-range-form { margin-top: .1rem; }
.work-range-form label { flex: 1 1 8rem; margin: 0; }
.work-range-form button, .work-range-actions .button { min-height: 1.9rem; }
.work-bulk-edit-card { padding: .16rem; background: #fbfdff; border-style: dashed; }
.work-bulk-toolbar { display: flex; flex-wrap: wrap; gap: .1rem; align-items: end; }
.work-bulk-toolbar button { min-height: 1.68rem; }
.work-bulk-toolbar label { flex: 1 1 7rem; margin: 0; }
.work-bulk-toolbar input, .work-bulk-toolbar select { width: 100%; }
.work-shift-controls { gap: .2rem; }
.work-import-card { display: grid; align-content: start; gap: .06rem; padding: .16rem; opacity: 1; }
.work-card-intro { margin: 0; padding: .5rem .6rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; }
.work-import-row { align-items: center; border-color: #dbeafe; background: #fbfdff; }
.work-import-row strong { overflow-wrap: anywhere; }
.work-hours-empty-state { justify-items: start; text-align: left; }
.work-hours-empty-state .empty-icon, .work-hours-empty-state h3 { justify-self: start; }
.spreadsheet-card { overflow: hidden; border-color: #bfdbfe; }
.work-master-sheet-card { border-color: #1d4ed8; box-shadow: 0 24px 36px rgba(37,99,235,.15); }
.work-master-sheet-card > .section-heading { padding-bottom: .08rem; border-bottom: 1px solid #dbeafe; }
.work-master-sheet-card h2 { font-size: .98rem; }
.work-secondary-sheet-card, .work-rows-card { border-color: #e2e8f0; background: #fbfdff; box-shadow: none; opacity: 1; }
.work-secondary-sheet-card h2, .work-rows-card h2, .work-import-card h2 { font-size: 1rem; }
.spreadsheet-wrap { border-radius: 16px; background: #f8fafc; border: 1px solid #cbd5e1; box-shadow: inset 0 1px 0 rgba(255,255,255,.7); }
.excel-like-table { min-width: 980px; border-collapse: collapse; font-size: .86rem; background: white; }
.excel-like-table th,
.excel-like-table td { border: 1px solid #b7c7db; padding: .45rem .55rem; white-space: nowrap; text-align: right; }
.excel-like-table th { background: #d9ead3; color: #173b16; font-weight: 900; text-align: center; }
.excel-like-table thead .group-row th { background: #b6d7a8; color: #102a10; }
.excel-like-table tbody th { position: sticky; left: 0; z-index: 1; min-width: 190px; background: #f3f6fb; color: #111827; text-align: left; }
.excel-like-table tbody tr:nth-child(even) td,
.excel-like-table tbody tr:nth-child(even) th { background-color: #fbfdff; }
.excel-like-table tbody tr:hover td,
.excel-like-table tbody tr:hover th { background-color: #fff7d6; }
.excel-like-table td:empty::after,
.excel-like-table .empty-cell::after { content: '·'; color: #cbd5e1; }
.excel-like-table .filled-cell { background: #ecfdf5; color: #064e3b; font-weight: 800; }
.work-hours-table .work-status-duunissa { background: #ffffff; color: #111827; font-weight: 900; }
.work-hours-table .work-status-koulutus { background: #ff0000; color: #ffffff; font-weight: 900; }
.work-hours-table .work-status-vuosiloma { background: #00b050; color: #ffffff; font-weight: 900; }
.work-hours-table .work-status-pekkanen { background: #ffff00; color: #111827; font-weight: 900; }
.work-hours-table .work-status-sairaus { background: #7030a0; color: #ffffff; font-weight: 900; }
.work-hours-table .work-status-muu-syy { background: #00b0f0; color: #ffffff; font-weight: 900; }
.work-hours-table tr:hover .work-status-duunissa,
.work-hours-table tr:hover .work-status-koulutus,
.work-hours-table tr:hover .work-status-vuosiloma,
.work-hours-table tr:hover .work-status-pekkanen,
.work-hours-table tr:hover .work-status-sairaus,
.work-hours-table tr:hover .work-status-muu-syy { filter: brightness(.96); }
.work-master-sheet-card { overflow: hidden; }
.work-master-wrap { max-height: none; }
.work-master-table { width: max-content; min-width: 100%; border-collapse: collapse; background: #fff; font-size: .6rem; }
.work-master-table th, .work-master-table td { min-width: 27px; height: 1.32rem; padding: .07rem .12rem; border: 1px solid #d6e0ec; text-align: center; white-space: nowrap; }
.work-master-table .work-status-duunissa,
.work-master-table .work-status-koulutus,
.work-master-table .work-status-vuosiloma,
.work-master-table .work-status-pekkanen,
.work-master-table .work-status-sairaus,
.work-master-table .work-status-muu-syy,
.work-master-table .work-status-total { width: 33px; min-width: 33px; max-width: 33px; padding-inline: .1rem; }
.work-master-table .editable-summary-cell { cursor: cell; }
.work-master-table .editable-summary-cell:focus { background: #fff7d6 !important; outline: 3px solid rgba(37,99,235,.25); }
.work-master-table .shift-letter-cell { position: relative; width: 23px; min-width: 23px; max-width: 23px; padding: .05rem; font-weight: 900; cursor: cell; }
.work-master-table .shift-letter-cell:focus { background: #fff7d6; outline: 3px solid rgba(37,99,235,.25); }
.work-master-table .shift-letter-cell.is-selected { outline: 3px solid #2563eb; outline-offset: -3px; box-shadow: inset 0 0 0 2px #ffffff; }
.work-master-table .shift-letter-cell.has-project { min-width: 42px; max-width: 42px; padding-bottom: .72rem; vertical-align: top; }
.work-master-table .shift-letter-cell.has-project::before { content: attr(data-project); position: absolute; left: 2px; right: 2px; bottom: 1px; overflow: hidden; color: #1e3a8a; font-size: .42rem; font-weight: 900; line-height: 1; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.shift-letter-cell.shift-color-green { background: #c6efce !important; color: #006100 !important; }
.shift-letter-cell.shift-color-yellow { background: #ffeb9c !important; color: #9c5700 !important; }
.shift-letter-cell.shift-color-red { background: #ffc7ce !important; color: #9c0006 !important; }
.shift-letter-cell.shift-color-blue { background: #cfe2f3 !important; color: #17365d !important; }
.shift-letter-cell.has-note::after { content: ''; position: absolute; top: 0; right: 0; width: 0; height: 0; border-top: 9px solid #dc2626; border-left: 9px solid transparent; pointer-events: none; }
.work-master-table .master-driver-col { position: sticky; left: 0; z-index: 4; width: 136px; min-width: 136px; max-width: 136px; background: #f3f6fb; color: #111827; text-align: left; white-space: normal; overflow-wrap: anywhere; line-height: 1.02; }
.work-master-table .master-driver-col span { display: block; font-size: .7rem; }
.work-master-table .master-driver-col small { display: inline-flex; margin-top: .2rem; padding: .08rem .35rem; border-radius: 999px; background: #fef3c7; color: #78350f; font-size: .68rem; font-weight: 900; text-transform: uppercase; }
.work-master-table .master-driver-col.storage-worker { background: #fffbeb; }
.work-master-table .master-driver-col.office-worker { background: #eff6ff; }
.work-master-table .master-driver-col.office-worker small { background: #dbeafe; color: #1e3a8a; }
.work-master-table .master-driver-col:not(.storage-worker):not(.office-worker) small { background: #dcfce7; color: #14532d; }
.work-master-table thead th { position: sticky; top: 0; z-index: 3; background: #eef6ee; color: #173b16; font-weight: 900; }
.work-master-table thead tr:nth-child(2) th { top: 2rem; }
.work-master-table thead tr:nth-child(3) th { top: 4rem; }
.work-master-table thead .master-driver-col { z-index: 6; background: #b6d7a8; }
.work-master-table .master-group-row th { background: #d9ead3; color: #102a10; }
.work-master-table .master-week-col { background: #e8f2fb; color: #17365d; font-size: .72rem; }
.work-master-table .master-day-row th, .work-master-table .master-weekday-row th { background: #eaf2f8; color: #17365d; }
.work-master-table tbody tr:nth-child(even) td, .work-master-table tbody tr:nth-child(even) th { background-color: #fbfdff; }
.work-master-table tbody tr:hover td, .work-master-table tbody tr:hover th { filter: brightness(.97); }
.work-master-table .filled-cell { background: #ecfdf5; color: #064e3b; font-weight: 900; }
.day-matrix-table th { background: #cfe2f3; color: #17365d; }
.day-matrix-table thead th:first-child { background: #9fc5e8; }
.raw-work-hours-table { min-width: 560px; }
@media (max-width: 760px) {
  .work-flow-steps { grid-template-columns: 1fr 1fr; }
  .spreadsheet-card .section-heading { position: sticky; left: 0; }
  .excel-like-table { min-width: 860px; font-size: .8rem; }
  .excel-like-table th, .excel-like-table td { padding: .38rem .45rem; }
  .work-range-card, .work-compact-card, .work-bulk-edit-card, .work-import-card { padding: .14rem; }
  .work-hours-table { border-spacing: 0 .14rem; }
  .work-hours-table tr { padding: .2rem; box-shadow: none; }
  .work-hours-table th, .work-hours-table td { padding: .08rem 0; font-size: .68rem; }
}
@media (max-width: 640px) {
  .work-range-card,
  .work-compact-card,
  .work-bulk-edit-card,
  .work-import-card { padding: .75rem; border-radius: 18px; }
  .work-range-card .section-heading { margin-bottom: .55rem; }
  .work-range-actions,
  .work-group-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .42rem; margin-bottom: .55rem; }
  .work-group-filters .button:first-child { grid-column: 1 / -1; }
  .work-range-actions .button,
  .work-group-filters .button { min-height: 2.55rem; padding: .45rem .65rem; border-radius: 14px; }
  .work-range-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: end; }
  .work-range-form + .work-range-form { margin-top: .55rem; }
  .work-range-form label,
  .admin-search-form label { min-width: 0; }
  .work-range-form button,
  .admin-search-form button,
  .admin-search-form .button { min-height: 2.75rem; border-radius: 14px; }
  .work-compact-card .admin-search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: end; }
  .work-compact-card .admin-search-form .button { grid-column: 1 / -1; }
  .work-master-sheet-card { padding: .75rem; }
  .work-master-wrap { overflow-x: auto; margin-inline: 0; border-radius: 14px; -webkit-overflow-scrolling: touch; }
  .work-master-table.work-hours-table,
  .work-master-table.work-hours-table tbody,
  .work-master-table.work-hours-table tr,
  .work-master-table.work-hours-table th,
  .work-master-table.work-hours-table td { display: revert; width: auto; }
  .work-master-table.work-hours-table { display: table; width: max-content; min-width: max-content; border-collapse: collapse; border-spacing: 0; font-size: .58rem; }
  .work-master-table.work-hours-table thead { display: table-header-group; }
  .work-master-table.work-hours-table tbody { display: table-row-group; }
  .work-master-table.work-hours-table tr { display: table-row; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .work-master-table.work-hours-table th,
  .work-master-table.work-hours-table td { display: table-cell; height: 1.45rem; padding: .08rem .12rem; border: 1px solid #d6e0ec; font-size: .58rem; line-height: 1.05; white-space: nowrap; }
  .work-master-table.work-hours-table th::before,
  .work-master-table.work-hours-table td::before { content: none; }
  .work-master-table .master-driver-col { width: 108px; min-width: 108px; max-width: 108px; overflow-wrap: normal; word-break: normal; }
  .work-master-table .master-driver-col span { font-size: .62rem; }
  .work-master-table .master-driver-col small { font-size: .58rem; }
  .work-master-table .work-status-duunissa,
  .work-master-table .work-status-koulutus,
  .work-master-table .work-status-vuosiloma,
  .work-master-table .work-status-pekkanen,
  .work-master-table .work-status-sairaus,
  .work-master-table .work-status-muu-syy,
  .work-master-table .work-status-total { width: 30px; min-width: 30px; max-width: 30px; }
  .work-master-table .shift-letter-cell { width: 25px; min-width: 25px; max-width: 25px; }
}
.work-month-calendars { display: grid; gap: 1.2rem; }
.work-month-calendar { overflow: hidden; border: 1px solid #bfdbfe; border-radius: 22px; background: #fff; box-shadow: var(--shadow-soft); }
.work-month-header { padding: .9rem 1rem; background: linear-gradient(135deg, #dbeafe, #eff6ff); border-bottom: 1px solid #bfdbfe; }
.work-month-header h3 { margin: 0; text-transform: capitalize; }
.work-month-weekdays, .work-month-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.work-month-weekdays span { padding: .55rem; background: #1d4ed8; color: white; font-size: .78rem; font-weight: 900; text-align: center; text-transform: uppercase; letter-spacing: .06em; }
.work-month-weekdays .week-number-head { background: #0f172a; }
.work-month-cell { min-height: 132px; padding: .5rem; border-right: 1px solid #dbeafe; border-bottom: 1px solid #dbeafe; background: #ffffff; }
.work-week-number { display: grid; place-items: start center; min-height: 132px; padding: .65rem .35rem; border-right: 1px solid #bfdbfe; border-bottom: 1px solid #dbeafe; background: #f1f5f9; color: #334155; font-weight: 900; }
.work-month-cell.outside-month { background: #f8fafc; color: #94a3b8; }
.work-month-cell.has-shifts { background: #eff6ff; }
.work-month-date { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin-bottom: .35rem; font-weight: 900; }
.work-month-date span { display: inline-grid; place-items: center; min-width: 1.8rem; min-height: 1.8rem; border-radius: 999px; background: #ffffff; color: #0f172a; border: 1px solid #bfdbfe; }
.work-month-date strong { color: #065f46; font-size: .82rem; white-space: nowrap; }
.work-month-cell ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .22rem; }
.work-month-cell li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem; align-items: center; padding: .24rem .35rem; border-radius: 8px; background: rgba(255,255,255,.76); font-size: .78rem; }
.work-month-cell li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-month-cell li strong { color: #065f46; white-space: nowrap; }
.calendar-more { margin: .3rem .15rem 0; color: var(--muted); font-weight: 800; font-size: .78rem; }
@media (max-width: 900px) { .work-month-cell, .work-week-number { min-height: 112px; } .work-month-cell { padding: .38rem; } .work-month-cell li { font-size: .72rem; } }
@media (max-width: 640px) { .work-month-calendars { overflow-x: auto; } .work-month-calendar { min-width: 760px; } }
/* Maintenance and inspections */
.maintenance-hero { background: rgba(255,255,255,.96); border-color: #fde68a; box-shadow: var(--shadow-soft); }
.maintenance-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.maintenance-card { position: relative; overflow: hidden; padding: 1rem; border: 1px solid var(--border); border-radius: 26px; background: white; box-shadow: var(--shadow-soft); }
.maintenance-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 7px; background: #22c55e; }
.maintenance-card.soon::before { background: #f59e0b; }
.maintenance-card.overdue::before { background: #ef4444; }
.maintenance-card header { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-top: .35rem; }
.maintenance-card h2 { margin: .1rem 0 .25rem; font-size: clamp(1.45rem, 4vw, 2.1rem); letter-spacing: -.04em; }
.maintenance-status { display: inline-flex; align-items: center; justify-content: center; min-height: 1.85rem; padding: .3rem .65rem; border-radius: 999px; background: #dcfce7; color: #14532d; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.maintenance-status.soon { background: #fef3c7; color: #78350f; }
.maintenance-status.overdue { background: #fee2e2; color: #7f1d1d; }
.autosave-status { display: inline-flex; align-items: center; justify-content: center; min-height: 1.85rem; padding: .3rem .65rem; border-radius: 999px; background: #eef2f7; color: #334155; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.autosave-status.saved { background: #dcfce7; color: #14532d; }
.autosave-status.pending, .autosave-status.saving { background: #fef3c7; color: #78350f; }
.autosave-status.error { background: #fee2e2; color: #7f1d1d; }
.sheet-context-menu { position: fixed; z-index: 1000; min-width: 150px; padding: .35rem; border: 1px solid #94a3b8; border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.sheet-context-menu button { display: flex; width: 100%; min-height: 2.25rem; align-items: center; justify-content: flex-start; padding: .45rem .65rem; border: 0; border-radius: 10px; background: transparent; color: #0f172a; font-weight: 900; text-align: left; }
.sheet-context-menu button:hover, .sheet-context-menu button:focus-visible { background: #eff6ff; color: #1d4ed8; }
.sheet-context-menu button:disabled { opacity: .45; cursor: not-allowed; }
.maintenance-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 1rem 0; }
.maintenance-facts div { padding: .65rem; border-radius: 16px; background: #f8fafc; border: 1px solid #e2e8f0; }
.maintenance-facts dt { color: var(--muted); font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.maintenance-facts dd { margin: .15rem 0 0; font-weight: 900; overflow-wrap: anywhere; }
.maintenance-progress { height: .55rem; overflow: hidden; border-radius: 999px; background: #e2e8f0; }
.maintenance-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2563eb, #22c55e); }
.maintenance-card.overdue .maintenance-progress span { background: linear-gradient(90deg, #ef4444, #f97316); }
.maintenance-card.soon .maintenance-progress span { background: linear-gradient(90deg, #f59e0b, #facc15); }
.maintenance-checklist { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .45rem; }
.maintenance-checklist li { display: flex; gap: .5rem; align-items: center; color: #334155; font-weight: 750; }
.maintenance-checklist li span { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 999px; background: #e2e8f0; color: #475569; font-size: .8rem; font-weight: 900; }
.maintenance-checklist li.done span { background: #dcfce7; color: #14532d; }
.maintenance-timeline { display: grid; gap: .7rem; }
.maintenance-timeline-row { display: grid; grid-template-columns: 100px minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .75rem; border: 1px solid #e2e8f0; border-left: 6px solid #22c55e; border-radius: 18px; background: #fff; }
.maintenance-timeline-row.soon { border-left-color: #f59e0b; }
.maintenance-timeline-row.overdue { border-left-color: #ef4444; }
.maintenance-timeline-row time { font-weight: 900; color: #0f172a; }
.maintenance-timeline-row span:not(.maintenance-status) { display: block; color: var(--muted); font-size: .9rem; }
.maintenance-form input:disabled, .maintenance-form select:disabled, .maintenance-form textarea:disabled, .maintenance-form button:disabled { opacity: .72; cursor: not-allowed; }
.maintenance-table th, .maintenance-table td { white-space: nowrap; }
@media (max-width: 760px) {
  .maintenance-card header, .maintenance-timeline-row { display: block; }
  .maintenance-status { margin-top: .5rem; }
  .maintenance-facts { grid-template-columns: 1fr; }
}
.maintenance-edit-panel { margin-top: 1rem; border-top: 1px solid #e2e8f0; padding-top: .8rem; }
.maintenance-edit-panel summary { cursor: pointer; width: fit-content; min-height: 2.4rem; padding: .55rem .8rem; border-radius: 999px; background: #eff6ff; color: #1e3a8a; font-weight: 900; }
.maintenance-edit-panel[open] summary { margin-bottom: .8rem; }
.maintenance-edit-panel form + form { margin-top: .65rem; }
/* Editable spreadsheet maintenance view */
.maintenance-sheet-card { overflow: hidden; border-color: #e2e8f0; box-shadow: var(--shadow-soft); }
.maintenance-sheet-wrap { overflow: auto; border: 1px solid #e2e8f0; border-radius: 18px; background: #fff; box-shadow: none; }
.maintenance-sheet-table { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; background: white; font-size: .86rem; }
.maintenance-sheet-table th,
.maintenance-sheet-table td { border: 0; border-bottom: 1px solid #e2e8f0; padding: .65rem .75rem; vertical-align: top; }
.maintenance-sheet-table th { position: sticky; top: 0; z-index: 2; background: #f8fafc; color: #334155; font-size: .76rem; font-weight: 900; letter-spacing: .07em; text-align: left; white-space: nowrap; }
.maintenance-sheet-table th:nth-child(1),
.maintenance-sheet-table th:nth-child(2),
.maintenance-sheet-table th:nth-child(3) { color: #0f172a; }
.maintenance-sheet-table td:first-child,
.maintenance-sheet-table th:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 8px 0 14px rgba(15,23,42,.04); }
.maintenance-sheet-table th:first-child { z-index: 3; background: #f8fafc; }
.maintenance-sheet-table input,
.maintenance-sheet-table select,
.maintenance-sheet-table textarea { width: 100%; min-width: 120px; border: 0; border-radius: 10px; background: transparent; padding: .45rem; font: inherit; box-shadow: none; }
.maintenance-sheet-table textarea { min-width: 210px; resize: vertical; }
.maintenance-sheet-table input:focus,
.maintenance-sheet-table select:focus,
.maintenance-sheet-table textarea:focus { background: #fff7d6; outline: 3px solid rgba(37,99,235,.25); }
.maintenance-sheet-row.overdue td,
.maintenance-sheet-row.soon td,
.maintenance-sheet-row.ok td { background: #fff; }
.maintenance-sheet-table tbody tr:nth-child(even) td { background: #f8fafc; }
.maintenance-sheet-table tbody tr:hover td { background: #f1f5f9; }
.maintenance-primary-cell strong { display: block; color: #0f172a; font-size: 1.05rem; letter-spacing: .02em; }
.maintenance-due-cell strong { color: #0f172a; font-size: 1rem; }
.maintenance-actions-cell .inline-add-panel > summary { min-width: 7rem; }
.maintenance-actions-cell .button,
.maintenance-actions-cell button { min-height: 2.55rem; }
.maintenance-control-form { align-items: stretch !important; }
.maintenance-control-form .maintenance-section-heading { align-self: stretch; display: grid; align-content: center; gap: .25rem; min-width: 11rem; padding: .75rem .85rem; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fafc; color: #64748b; }
.maintenance-control-form .maintenance-section-heading strong { color: #0f172a; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; }
.maintenance-control-form .maintenance-section-heading span { font-size: .84rem; line-height: 1.35; }
.maintenance-control-form label { display: grid; gap: .35rem; margin: 0; }
.maintenance-control-form .maintenance-check-card { align-self: center; min-height: 3rem; padding: .75rem .85rem; border: 1px solid #dbeafe; border-radius: 14px; background: #fff; }
.maintenance-control-form .maintenance-submit-row { display: flex; align-items: end; justify-content: flex-end; }
.maintenance-control-form .maintenance-submit-row .primary { min-width: 11rem; }
.maintenance-control-form-compact { grid-template-columns: minmax(180px, .9fr) minmax(180px, 1fr) minmax(180px, .9fr) minmax(180px, 1fr) auto !important; }
.maintenance-quiet-hint { margin: 0; color: #64748b; font-size: .84rem; }
.maintenance-empty-state { justify-items: start; text-align: left; }
.maintenance-empty-state .empty-icon, .maintenance-empty-state h3 { justify-self: start; }
.compact-button { min-height: 2.35rem; padding: .45rem .75rem; white-space: nowrap; }
.add-row-table th { background: #cfe2f3; color: #17365d; }
@media (max-width: 760px) {
  .maintenance-hero .compact-status { align-self: start; flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: .55rem; width: 100%; }
  .maintenance-hero .compact-status .stat-card { display: flex; align-items: center; justify-content: space-between; gap: .55rem; min-height: 0; padding: .72rem .78rem; border-radius: 16px; }
  .maintenance-hero .compact-status .stat-card span { align-self: auto; min-width: 0; font-size: .7rem; line-height: 1.2; overflow-wrap: anywhere; word-break: normal; }
  .maintenance-hero .compact-status .stat-card strong { flex: 0 0 auto; margin-top: 0; font-size: 1.35rem; }
  .maintenance-sheet-card { gap: .75rem; padding: .9rem; border-radius: 18px; box-shadow: none; }
  .maintenance-sheet-card .section-heading { gap: .65rem; }
  .maintenance-sheet-card .user-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: center; width: 100%; }
  .maintenance-sheet-card .user-actions .inline-add-panel { min-width: 0; }
  .maintenance-sheet-card .user-actions .inline-add-panel > summary { width: 100%; justify-content: center; }
  .maintenance-sheet-card .user-actions > .status-pill { margin: 0; min-height: 2.55rem; align-self: stretch; justify-content: center; white-space: nowrap; }
  .maintenance-empty-state { padding: .85rem; border-radius: 16px; }
  .maintenance-empty-state .empty-icon { width: 2.7rem; height: 2.7rem; }
  .maintenance-control-form .maintenance-section-heading { min-width: 0; padding: .65rem; border-radius: 12px; }
  .maintenance-control-form .maintenance-section-heading span,
  .maintenance-quiet-hint { font-size: .8rem; line-height: 1.35; }
  .maintenance-control-form .maintenance-check-card { min-height: 2.75rem; padding: .65rem; border-radius: 12px; }
  .maintenance-control-form .maintenance-check-card.check-row { display: flex; align-items: center; gap: .55rem; }
  .maintenance-control-form .maintenance-check-card input { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; }
  .maintenance-sheet-card .maintenance-sheet-wrap { overflow: visible; border: 0; background: transparent; }
  .maintenance-sheet-card .maintenance-sheet-table { min-width: 0; border-collapse: separate; border-spacing: 0 .75rem; font-size: .9rem; }
  .maintenance-sheet-card .maintenance-sheet-table thead { display: none; }
  .maintenance-sheet-card .maintenance-sheet-table,
  .maintenance-sheet-card .maintenance-sheet-table tbody,
  .maintenance-sheet-card .maintenance-sheet-table tr,
  .maintenance-sheet-card .maintenance-sheet-table td { display: block; width: 100%; }
  .maintenance-sheet-card .maintenance-sheet-row { padding: .85rem; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
  .maintenance-sheet-card .maintenance-sheet-row td { display: grid; grid-template-columns: minmax(5.8rem, .34fr) minmax(0, 1fr); gap: .55rem; padding: .45rem 0; border: 0; background: transparent !important; }
  .maintenance-sheet-card .maintenance-sheet-row td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .maintenance-sheet-card .maintenance-sheet-row .maintenance-actions-cell { grid-template-columns: 1fr; }
  .maintenance-sheet-card .maintenance-sheet-row .maintenance-actions-cell::before { content: none; }
  .maintenance-actions-cell .inline-add-panel > summary { width: 100%; }
  .maintenance-control-form,
  .maintenance-control-form-compact { grid-template-columns: 1fr !important; }
  .maintenance-control-form .maintenance-submit-row { justify-content: stretch; }
  .maintenance-control-form .maintenance-submit-row .primary { width: 100%; }
}

.employee-directory-card { display: grid; gap: .08rem; border-color: #1d4ed8; box-shadow: 0 24px 34px rgba(37,99,235,.13); }
.employee-tools-card, .employee-add-card { border-color: #dbeafe; background: #ffffff; box-shadow: none; }
.employee-tools-card, .employee-support-card { padding: .2rem; }
.employee-tools-card { opacity: 1; }
.employee-support-card { opacity: 1; }
.employee-filter-guide { display: grid; gap: .35rem; align-self: stretch; min-width: min(100%, 20rem); padding: .85rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; color: #334155; font-size: .9rem; }
.employee-filter-guide strong { color: #0f172a; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.employee-filter-guide span { overflow-wrap: anywhere; }
.employee-active-filters { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-bottom: .6rem; padding: .6rem .7rem; border: 1px solid #dbeafe; border-radius: 16px; background: #f8fafc; }
.employee-active-filters span { color: var(--muted); font-size: .78rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.employee-active-filters strong { display: inline-flex; align-items: center; min-height: 2rem; padding: .25rem .6rem; border-radius: 999px; background: #fff; color: #1e3a8a; font-size: .84rem; box-shadow: inset 0 0 0 1px #dbeafe; }
.employee-filter-form, .employee-import-form { display: flex; flex-wrap: wrap; gap: .1rem; align-items: end; }
.employee-filter-form label, .employee-import-form label { flex: 1 1 8rem; margin: 0; }
.employee-filter-form button, .employee-filter-form .button, .employee-import-form button { min-height: 1.9rem; }
.employee-import-block { display: grid; grid-template-columns: minmax(2.6rem, .1fr) minmax(0, 1fr); gap: .08rem; align-items: end; margin-top: .08rem; padding-top: .08rem; border-top: 1px solid #e2e8f0; opacity: 1; }
.employee-import-block strong { color: #0f172a; font-size: .88rem; }
.employee-support-label { color: #64748b; font-size: .86rem; }
.employee-import-block p { margin: .15rem 0 0; }
.employee-import-form { margin: 0; }
.employee-detail-card, .fleet-detail-card { border-color: #bfdbfe; background: #ffffff; box-shadow: none; }
.employee-detail-card { padding: .22rem; border-color: #1d4ed8; box-shadow: 0 24px 32px rgba(37,99,235,.13); }
.employee-detail-form, .fleet-detail-form { max-width: 960px; }
.fleet-detail-hero h1 { overflow-wrap: anywhere; }
.fleet-detail-focus { display: flex; justify-content: space-between; gap: 1rem; align-items: start; border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff, #eff6ff); box-shadow: var(--shadow-soft); }
.fleet-detail-focus h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.35rem); overflow-wrap: anywhere; }
.fleet-detail-focus .eyebrow { margin-bottom: .25rem; }
.fleet-detail-focus dl { display: grid; grid-template-columns: repeat(3, minmax(6rem, 1fr)); gap: .6rem; margin: 0; min-width: min(100%, 28rem); }
.fleet-detail-focus dl div { padding: .75rem; border: 1px solid #dbeafe; border-radius: 16px; background: #fff; }
.fleet-detail-focus dt { color: var(--muted); font-size: .74rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.fleet-detail-focus dd { margin: .2rem 0 0; color: #0f172a; font-size: 1.25rem; font-weight: 900; }
.fleet-trailers-card, .fleet-documents-card { border-color: #dbeafe; box-shadow: var(--shadow-soft); }
.fleet-related-create-form { display: grid; gap: .9rem; margin-bottom: 1rem; padding: 1rem; border: 1px solid #dbeafe; border-radius: 18px; background: #fbfdff; }
.fleet-related-fields { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: .75rem; align-items: start; }
.fleet-related-fields label { display: grid; gap: .3rem; margin: 0; color: #334155; font-size: .9rem; font-weight: 850; }
.fleet-related-fields label span { display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }
.fleet-related-fields small { color: var(--muted); font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.fleet-related-fields .field-required small { color: #9a3412; }
.fleet-related-fields input { min-height: 3rem; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; padding: .65rem .8rem; font: inherit; }
.fleet-related-fields input:focus { border-color: #2563eb; outline: 3px solid rgba(37,99,235,.16); }
.fleet-related-create-form .primary { justify-self: end; min-height: 3rem; }
.fleet-row-danger { display: flex; justify-content: flex-end; margin: 0; }
.fleet-row-danger .danger { min-height: 2.55rem; }
.employee-profile-guide { display: grid; gap: .35rem; align-self: stretch; min-width: min(100%, 20rem); padding: .85rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; color: #334155; font-size: .9rem; }
.employee-profile-guide strong { color: #0f172a; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.employee-profile-guide span { overflow-wrap: anywhere; }
.employee-detail-status { align-self: start; max-width: 28rem; opacity: 1; }
.employee-detail-status .stat-card { padding: .16rem .24rem; box-shadow: none; }
.employee-detail-status .stat-card span { font-size: .56rem; }
.employee-detail-status .stat-card strong { font-size: .68rem; }
.employee-profile-section { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .32rem; align-items: end; padding: .38rem; border: 1px solid #dbeafe; border-radius: 16px; background: #fbfdff; }
.employee-profile-section-identity { border-color: #bfdbfe; background: #ffffff; }
.employee-profile-section-contact { background: #ffffff; opacity: 1; }
.employee-profile-section-notes { border-color: #e2e8f0; background: #f8fafc; opacity: 1; }
.employee-section-heading { align-self: stretch; display: grid; align-content: center; gap: .16rem; padding: .55rem .65rem; border-radius: 14px; background: #ffffff; color: var(--muted); }
.employee-section-heading strong { color: #0f172a; font-size: .86rem; letter-spacing: .04em; text-transform: uppercase; }
.employee-section-heading span { font-size: .86rem; line-height: 1.35; overflow-wrap: anywhere; }
.employee-profile-section textarea, .employee-profile-section .hint, .employee-profile-section .check-row { grid-column: 1 / -1; }
.employee-detail-actions { justify-content: flex-end; gap: .18rem; padding-top: .1rem; border-top: 1px solid #e2e8f0; }
.employee-detail-actions .primary { min-width: 7.8rem; box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.employee-detail-actions .employee-secondary-action { order: -1; }
.employee-secondary-action { color: #475569; background: #f8fafc; }
.employee-linked-status-card { margin-top: -1.3rem; padding: .16rem; border-color: #e2e8f0; background: #fbfdff; box-shadow: none; }
.employee-support-status-card { opacity: 1; }
.employee-portal-account-line { margin: 0; font-size: .68rem; }
.employee-portal-card { border-color: #e2e8f0; background: #fff; box-shadow: none; }
.employee-portal-card .section-heading { align-items: center; }
.employee-portal-actions { justify-content: flex-start; padding-top: .1rem; border-top: 1px solid #e2e8f0; }
.employee-portal-actions .hint { max-width: 34rem; margin: 0; }
.employee-group-section { display: grid; gap: .05rem; }
.employee-group-heading { display: flex; align-items: center; justify-content: space-between; gap: .14rem; padding: .02rem 0 0; border-top: 1px solid var(--border); }
.employee-group-heading h3 { margin: 0; color: #64748b; font-size: .7rem; }
.employee-group-empty { margin: 0; padding: .75rem .85rem; border: 1px dashed #cbd5e1; border-radius: 16px; background: #f8fafc; }
.employee-empty-state { margin-top: .1rem; }
.employee-list { display: grid; gap: .02rem; }
.employee-list-row { display: grid; grid-template-columns: minmax(282px, 2.75fr) minmax(84px, .15fr) minmax(142px, .34fr); gap: .08rem; align-items: center; padding: .18rem; border: 1px solid #e2e8f0; border-radius: 14px; background: #ffffff; box-shadow: none; }
.employee-list-row.is-inactive { background: #f8fafc; }
.employee-row-fields { display: grid; grid-template-columns: minmax(176px, 1fr) minmax(86px, .24fr); gap: .08rem; align-items: end; }
.employee-row-fields label { gap: .06rem; color: #334155; font-size: .7rem; }
.employee-row-status { display: grid; gap: .05rem; align-content: center; justify-items: start; }
.employee-row-status .status-pill { margin: 0; }
.employee-portal-pill.warning { background: #fffbeb; color: #92400e; }
.employee-row-actions { display: grid; gap: .05rem; justify-items: end; }
.employee-row-actions-main, .employee-row-actions-save { display: flex; flex-wrap: wrap; gap: .05rem; justify-content: flex-end; }
.employee-row-actions-save { padding-top: 0; }
.employee-row-actions .button, .employee-row-actions button { min-height: 1.8rem; padding: .2rem .32rem; }
.employee-row-actions .primary { min-width: 4.8rem; }
.employee-secondary-action, .employee-danger-action { opacity: 1; }
.employee-portal-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 1; }
@media (max-width: 640px) {
  .employee-tools-card,
  .employee-support-card,
  .employee-directory-card { padding: .85rem; border-radius: 18px; box-shadow: none; }
  .employee-tools-card .section-heading,
  .employee-add-card .section-heading,
  .employee-directory-card .section-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .6rem; }
  .employee-tools-card .section-heading .button,
  .employee-directory-card .section-heading .button { min-height: 2.55rem; padding: .48rem .8rem; white-space: nowrap; }
  .employee-filter-form { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; align-items: end; }
  .employee-filter-form label { min-width: 0; }
  .employee-filter-form label:first-child { grid-column: 1 / -1; }
  .employee-filter-form button,
  .employee-filter-form .button { width: 100%; min-height: 2.7rem; }
  .employee-import-block { grid-template-columns: 1fr; gap: .45rem; margin-top: .75rem; padding-top: .75rem; }
  .employee-import-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
  .employee-import-form label { min-width: 0; }
  .employee-import-form input[type="file"] { width: 100%; min-height: 3rem; border: 1px solid #dbeafe; border-radius: 14px; background: #fff; padding: .45rem; }
  .employee-import-form button { min-height: 3rem; padding-inline: .9rem; }
  .employee-edit-row { gap: .65rem; }
  .employee-add-card .employee-edit-row button.primary { width: 100%; }
  .employee-directory-card { gap: .55rem; }
  .employee-group-section { gap: .35rem; }
  .employee-group-heading { padding-top: .45rem; }
  .employee-list { gap: .55rem; }
  .employee-list-row { grid-template-columns: minmax(0, 1fr) !important; gap: .6rem; padding: .75rem; border-radius: 16px; }
  .employee-row-fields { grid-template-columns: 1fr; gap: .5rem; }
  .employee-row-status { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
  .employee-row-status .check-row { min-height: 2.35rem; padding: 0; }
  .employee-portal-pill { white-space: normal; overflow-wrap: anywhere; }
  .employee-row-actions { gap: .45rem; justify-items: stretch; }
  .employee-row-actions-main,
  .employee-row-actions-save { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
  .employee-row-actions .button,
  .employee-row-actions button { min-height: 2.65rem; padding: .48rem .55rem; }
}
.employee-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: #fff; }
.employee-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.employee-table th, .employee-table td { padding: .62rem .78rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.employee-table th { color: var(--muted); font-size: .72rem; letter-spacing: .055em; line-height: 1.2; text-transform: uppercase; }
.employee-table td { color: #334155; font-size: .9rem; }
.employee-table tbody tr:last-child th, .employee-table tbody tr:last-child td { border-bottom: 0; }
.employee-table tbody tr:nth-child(even) { background: #f8fafc; }
.employee-group-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 5.8rem; padding: .18rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 900; }
.employee-group-pill.group-kuljettaja { background: #dcfce7; color: #14532d; }
.employee-group-pill.group-varasto { background: #fef3c7; color: #78350f; }
.employee-group-pill.group-toimisto { background: #dbeafe; color: #1e3a8a; }

.two-factor-card { max-width: 620px; }
.two-factor-card h1 { font-size: clamp(2rem, 4vw, 3rem); overflow-wrap: normal; word-break: keep-all; hyphens: none; letter-spacing: -.035em; }

/* Prevent Finnish UI labels from splitting in the middle of words. */
h1, h2, h3, button, .button, .nav-button, .main-nav a, .site-search button, label { overflow-wrap: normal; word-break: keep-all; hyphens: none; }
button, .button, .nav-button, .site-search button { white-space: normal; }

.fleet-technical-hint { margin: .25rem 0 0; color: #64748b; font-size: .82rem; font-weight: 700; }
.fleet-directory-card { display: grid; gap: 1rem; border-color: #dbeafe; box-shadow: var(--shadow-soft); }
.fleet-directory-card .maintenance-sheet-wrap { border-radius: 18px; border: 1px solid var(--border); background: #fff; box-shadow: none; }
.fleet-directory-card .maintenance-sheet-table th { background: #f8fafc; color: #334155; font-size: .76rem; letter-spacing: .07em; }
.fleet-directory-card .maintenance-sheet-row td { background: #fff; vertical-align: top; }
.fleet-directory-card .maintenance-sheet-row:nth-child(even) td { background: #fbfdff; }
.fleet-directory-card .maintenance-sheet-row:hover td { background: #f8fafc; }
.fleet-registration-cell strong { display: block; font-size: 1rem; letter-spacing: .02em; }
.fleet-actions-cell .inline-add-panel > summary { min-width: 7rem; }
.fleet-empty-state { justify-items: start; text-align: left; }
.fleet-empty-state .empty-icon, .fleet-empty-state h3 { justify-self: start; }
.fleet-create-panel { align-content: start; }
.fleet-create-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.fleet-create-heading h3 { margin: 0; font-size: 1.35rem; }
.fleet-create-heading .eyebrow { margin-bottom: .25rem; }
.fleet-create-heading .status-pill { margin-top: .15rem; white-space: normal; text-align: left; }
.fleet-create-form { display: grid; gap: 1rem; }
.form-helper-note { margin: 0; padding: .75rem .85rem; border: 1px solid #bfdbfe; border-radius: 16px; background: #eff6ff; color: #1e3a8a; font-size: .92rem; }
.fleet-create-section { display: grid; grid-template-columns: repeat(3, minmax(170px, 1fr)); gap: .8rem; margin: 0; padding: 1rem; border: 1px solid #e2e8f0; border-radius: 18px; background: #fbfdff; }
.fleet-create-section-primary { grid-template-columns: repeat(2, minmax(220px, 1fr)); background: #ffffff; border-color: #bfdbfe; }
.fleet-create-section legend { padding: 0 .35rem; color: #334155; font-weight: 900; }
.fleet-section-hint { grid-column: 1 / -1; margin: -.15rem 0 .1rem; color: #64748b; font-size: .86rem; font-weight: 750; }
.fleet-create-section label { display: grid; gap: .3rem; margin: 0; color: #334155; font-size: .9rem; font-weight: 850; }
.fleet-create-section label span { display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; }
.fleet-create-section label small { color: var(--muted); font-size: .74rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.fleet-create-section label.field-required small { color: #9a3412; }
.fleet-create-section input,
.fleet-create-section select,
.fleet-create-section textarea { min-height: 3rem; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; padding: .65rem .8rem; font: inherit; }
.fleet-create-section textarea { min-height: 6rem; resize: vertical; }
.fleet-create-section input:focus,
.fleet-create-section select:focus,
.fleet-create-section textarea:focus { background: #fff; border-color: #2563eb; outline: 3px solid rgba(37,99,235,.16); }
.fleet-create-section input:invalid { border-color: #f59e0b; }
.fleet-create-section label em { color: var(--muted); font-size: .8rem; font-style: normal; font-weight: 650; line-height: 1.35; }
.fleet-create-notes { grid-column: span 2; }
.fleet-link-section { grid-template-columns: 1fr; }
.fleet-checkbox-card { grid-template-columns: auto 1fr; column-gap: .75rem; align-items: start; padding: .85rem; border: 1px solid #bfdbfe; border-radius: 16px; background: #ffffff; }
.fleet-checkbox-card input { width: 1.25rem; min-height: 1.25rem; margin-top: .15rem; accent-color: #2563eb; }
.fleet-checkbox-card span,
.fleet-checkbox-card em { grid-column: 2; }
.fleet-create-submit { position: sticky; bottom: -1.35rem; z-index: 1; display: flex; flex-wrap: wrap; gap: .85rem; justify-content: space-between; align-items: center; margin-top: .25rem; padding: .9rem 0 0; border-top: 1px solid #dbeafe; background: linear-gradient(180deg, rgba(255,255,255,.92), #fff 38%); }
.fleet-create-submit p { max-width: 34rem; margin: 0; }
.fleet-create-submit .primary { min-height: 3rem; min-width: 11rem; }
.fleet-edit-panel { align-content: start; }
.fleet-edit-context { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding-bottom: 1rem; border-bottom: 1px solid #e2e8f0; }
.fleet-edit-context h3 { margin: 0; font-size: 1.25rem; }
.fleet-edit-context .eyebrow { margin-bottom: .25rem; }
.fleet-edit-context .status-pill { margin-top: .15rem; white-space: normal; text-align: left; }
.fleet-edit-panel .admin-row { padding: .85rem; border: 1px solid #e2e8f0; border-radius: 18px; background: #fbfdff; }
.fleet-edit-panel .admin-row button.primary { min-height: 3rem; }
.fleet-danger-zone { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .85rem; align-items: center; padding: 1rem; border: 1px solid #fecaca; border-radius: 18px; background: #fff7f7; }
.fleet-danger-zone p { max-width: 42rem; margin: 0; color: #7f1d1d; }
.inline-action-panel .fleet-danger-zone .inline-delete-form { padding: 0; border: 0; }
.fleet-danger-zone .danger { min-height: 3rem; }
.inline-add-panel { position: relative; display: inline-block; }
.inline-add-panel > summary { list-style: none; cursor: pointer; }
.inline-add-panel > summary::-webkit-details-marker { display: none; }
.inline-add-panel .inline-action-panel { display: none; }
.inline-add-panel[open] { z-index: 99998; }
.inline-add-panel[open]::before { content: none; }
.inline-modal-backdrop { display: none; position: fixed; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0; transform: none; z-index: 99998; border: 0; border-radius: 0; appearance: none; background: rgba(15,23,42,.18); backdrop-filter: blur(1px); cursor: default; }
.inline-modal-open .inline-modal-backdrop { display: block; }
.inline-add-panel[open] .inline-action-panel,
.inline-action-panel.is-portal-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 99999;
  display: grid;
  gap: .75rem;
  width: min(1040px, calc(100vw - 3rem));
  max-height: min(86vh, 820px);
  overflow: auto;
  transform: translate(-50%, -50%);
  padding: 1.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15,23,42,.12);
}
.maintenance-sheet-table .inline-add-panel[open] .inline-action-panel,
.inline-action-panel.is-portal-modal { width: min(980px, calc(100vw - 3rem)); }
.inline-action-panel .admin-row { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 1rem; align-items: end; }
.inline-action-panel .admin-row label { display: grid; gap: .35rem; margin: 0; font-weight: 800; color: #334155; }
.inline-action-panel .admin-row label span { display: flex; flex-wrap: wrap; gap: .35rem; align-items: baseline; font-size: .84rem; }
.inline-action-panel .admin-row label small { color: var(--muted); font-size: .72rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.inline-action-panel .admin-row input,
.inline-action-panel .admin-row select { min-height: 3rem; border: 1px solid #cbd5e1; border-radius: 14px; background: #f8fafc; padding: .65rem .8rem; }
.inline-action-panel .admin-row input:focus,
.inline-action-panel .admin-row select:focus { background: #fff; border-color: #2563eb; outline: 3px solid rgba(37,99,235,.16); }
.inline-action-panel .admin-row button.primary { grid-column: 1 / -1; justify-self: end; min-width: 10rem; }
.inline-action-panel .inline-delete-form { display: flex; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid #e2e8f0; }
.inline-action-panel .modal-close-button { justify-self: end; min-height: 2.35rem; padding: .4rem .8rem; }
@media (max-width: 760px) { .inline-action-panel .admin-row, .fleet-create-section, .fleet-create-section-primary { grid-template-columns: 1fr; } .fleet-create-heading, .fleet-edit-context { display: grid; } .fleet-create-notes { grid-column: auto; } }
.fleet-table-wrap { overflow-x: auto; }
.fleet-table th:first-child { min-width: 9rem; }
.fleet-table td, .fleet-table th { white-space: nowrap; }
.fleet-table th { color: var(--muted); font-size: .72rem; letter-spacing: .055em; line-height: 1.2; text-transform: uppercase; }
.fleet-table td { color: #334155; font-size: .9rem; }
.fleet-table .maintenance-status { margin: 0; }

.employee-edit-row { grid-template-columns: minmax(220px, 1.4fr) minmax(140px, .6fr) auto auto auto auto; align-items: center; }
.fleet-edit-row { grid-template-columns: minmax(120px, .8fr) minmax(110px, .7fr) minmax(110px, .7fr) minmax(130px, .7fr) minmax(120px, .7fr) minmax(130px, .7fr) auto auto auto; align-items: center; }
.check-row { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; }
.check-row input { width: auto; }
@media (max-width: 900px) { .employee-edit-row, .fleet-edit-row { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .employee-profile-section, .fleet-detail-focus { grid-template-columns: 1fr; } .employee-profile-section { gap: .28rem; padding: .32rem; } .employee-detail-actions { display: grid; grid-template-columns: 1fr 1fr; } .employee-detail-actions .primary, .employee-detail-actions .button { width: 100%; min-width: 0; } .fleet-detail-focus { display: grid; } .fleet-detail-focus dl, .fleet-related-fields { grid-template-columns: 1fr; } .employee-profile-section textarea, .employee-profile-section .hint, .employee-profile-section .check-row { grid-column: 1 / -1; } }
@media (max-width: 760px) {
  .dashboard-hero[aria-labelledby="fleet-title"] .compact-status { align-self: start; flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: .55rem; width: 100%; }
  .dashboard-hero[aria-labelledby="fleet-title"] .compact-status .stat-card { display: flex; align-items: center; justify-content: space-between; gap: .55rem; min-height: 0; padding: .72rem .78rem; border-radius: 16px; }
  .dashboard-hero[aria-labelledby="fleet-title"] .compact-status .stat-card span { align-self: auto; min-width: 0; font-size: .7rem; line-height: 1.2; overflow-wrap: anywhere; word-break: normal; }
  .dashboard-hero[aria-labelledby="fleet-title"] .compact-status .stat-card strong { flex: 0 0 auto; margin-top: 0; font-size: 1.35rem; }
  .fleet-directory-card { gap: .75rem; padding: .9rem; border-radius: 18px; box-shadow: none; }
  .fleet-directory-card .section-heading { gap: .65rem; }
  .fleet-directory-card .user-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; align-items: center; width: 100%; }
  .fleet-directory-card .user-actions .inline-add-panel { min-width: 0; }
  .fleet-directory-card .user-actions .inline-add-panel > summary { width: 100%; justify-content: center; }
  .fleet-directory-card .user-actions > .status-pill { margin: 0; min-height: 2.55rem; align-self: stretch; justify-content: center; white-space: nowrap; }
  .fleet-empty-state { padding: .85rem; border-radius: 16px; }
  .fleet-empty-state .empty-icon { width: 2.7rem; height: 2.7rem; }
  .inline-add-panel[open] .inline-action-panel,
  .inline-action-panel.is-portal-modal {
    width: calc(100vw - .75rem);
    max-height: calc(100dvh - 1rem);
    padding: .8rem;
    border-radius: 16px;
  }
  .fleet-create-heading,
  .fleet-edit-context { gap: .55rem; padding-bottom: .7rem; }
  .fleet-create-heading h3,
  .fleet-edit-context h3 { font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
  .fleet-create-heading .status-pill,
  .fleet-edit-context .status-pill { margin: 0; width: fit-content; max-width: 100%; }
  .fleet-create-form { gap: .7rem; }
  .form-helper-note { padding: .65rem; border-radius: 12px; font-size: .84rem; line-height: 1.45; }
  .fleet-create-section { gap: .6rem; padding: .75rem; border-radius: 14px; }
  .fleet-create-section legend { font-size: .9rem; }
  .fleet-section-hint,
  .fleet-create-section label em { font-size: .8rem; line-height: 1.35; }
  .fleet-checkbox-card { padding: .7rem; border-radius: 14px; }
  .fleet-create-submit { position: static; display: grid; grid-template-columns: 1fr; gap: .55rem; padding-top: .65rem; }
  .fleet-create-submit .primary { width: 100%; min-width: 0; }
  .fleet-edit-panel .admin-row { gap: .65rem; padding: .7rem; border-radius: 14px; }
  .fleet-danger-zone { display: grid; grid-template-columns: 1fr; gap: .6rem; padding: .75rem; border-radius: 14px; }
  .fleet-danger-zone .inline-delete-form,
  .fleet-danger-zone .danger { width: 100%; justify-content: center; }
  .fleet-directory-card .maintenance-sheet-wrap { overflow: visible; border: 0; background: transparent; }
  .fleet-directory-card .maintenance-sheet-table { min-width: 0; border-collapse: separate; border-spacing: 0 .75rem; }
  .fleet-directory-card .maintenance-sheet-table thead { display: none; }
  .fleet-directory-card .maintenance-sheet-table,
  .fleet-directory-card .maintenance-sheet-table tbody,
  .fleet-directory-card .maintenance-sheet-table tr,
  .fleet-directory-card .maintenance-sheet-table td { display: block; width: 100%; }
  .fleet-directory-card .maintenance-sheet-row { padding: .85rem; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); }
  .fleet-directory-card .maintenance-sheet-row td { display: grid; grid-template-columns: minmax(7.5rem, .45fr) minmax(0, 1fr); gap: .6rem; padding: .45rem 0; border: 0; background: transparent !important; }
  .fleet-directory-card .maintenance-sheet-row td::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
  .fleet-directory-card .maintenance-sheet-row .fleet-actions-cell { grid-template-columns: 1fr; }
  .fleet-directory-card .maintenance-sheet-row .fleet-actions-cell::before { content: none; }
  .fleet-actions-cell .inline-add-panel > summary { width: 100%; }
}

.fleet-detail-hero .compact-status .stat-card { box-shadow: none; }
.fleet-detail-registration { margin-bottom: .15rem; font-size: clamp(3rem, 8vw, 5.5rem); letter-spacing: -.055em; }
.fleet-detail-meta { margin: 0 0 .55rem; color: #1e3a8a; font-size: 1rem; font-weight: 900; }
.fleet-detail-focus { border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff, #f8fbff); }
@media (max-width: 760px) {
  .fleet-detail-hero { gap: .85rem; }
  .fleet-detail-registration { font-size: 2.2rem; line-height: 1.02; letter-spacing: 0; }
  .fleet-detail-meta { font-size: .92rem; line-height: 1.35; }
  .fleet-detail-hero .compact-status { align-self: start; flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, auto); gap: .55rem; width: 100%; }
  .fleet-detail-hero .compact-status .stat-card { display: flex; align-items: center; justify-content: space-between; gap: .55rem; min-height: 0; padding: .72rem .78rem; border-radius: 16px; }
  .fleet-detail-hero .compact-status .stat-card:first-child { grid-column: 1 / -1; }
  .fleet-detail-hero .compact-status .stat-card span { align-self: auto; min-width: 0; font-size: .7rem; line-height: 1.2; overflow-wrap: anywhere; word-break: normal; }
  .fleet-detail-hero .compact-status .stat-card strong { flex: 0 0 auto; max-width: 70%; margin-top: 0; font-size: 1.25rem; text-align: right; overflow-wrap: anywhere; }
  .fleet-detail-focus { gap: .75rem; padding: .85rem; border-radius: 18px; box-shadow: none; }
  .fleet-detail-focus h2 { font-size: 1.45rem; }
  .fleet-detail-focus dl { gap: .5rem; }
  .fleet-detail-focus dl div { padding: .65rem; border-radius: 14px; }
  .fleet-detail-focus dd { font-size: 1.05rem; }
  .fleet-detail-card,
  .fleet-trailers-card,
  .fleet-documents-card { padding: .9rem; border-radius: 18px; box-shadow: none; }
  .fleet-detail-card .section-heading,
  .fleet-trailers-card .section-heading,
  .fleet-documents-card .section-heading { gap: .65rem; }
  .fleet-detail-form { gap: .7rem; }
  .fleet-legacy-fields { padding-top: .25rem; }
  .fleet-detail-form > .user-actions { display: grid; grid-template-columns: 1fr; gap: .55rem; }
  .fleet-detail-form > .user-actions .button,
  .fleet-detail-form > .user-actions button { width: 100%; justify-content: center; }
  .fleet-related-create-form,
  .fleet-document-upload-form { gap: .7rem; padding: .75rem; border-radius: 14px; }
  .fleet-related-create-form .primary,
  .fleet-document-upload-form .primary { width: 100%; justify-self: stretch; }
  .fleet-trailer-row,
  .fleet-document-row { gap: .65rem; }
  .fleet-row-danger,
  .fleet-row-danger .danger { width: 100%; justify-content: center; }
}
.fleet-detail-focus dl dd { font-size: 1.25rem; }
.subtle-status { opacity: .9; transform: scale(.96); transform-origin: right center; }
.fleet-related-create-form .primary,
.fleet-document-upload-form .primary,
.fleet-detail-form .primary { min-height: 3rem; }
.fleet-document-upload-form { margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #bfdbfe; }
.fleet-document-row { align-items: start; }
.fleet-document-preview { max-width: 220px; margin-top: .65rem; }
.fleet-document-preview .uploaded-image { max-height: 160px; }
.maintenance-warning-panel, .maintenance-warning-list { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .55rem; }
.maintenance-warning-panel { padding: .75rem .85rem; border: 1px solid #fde68a; border-radius: 16px; background: #fffbeb; }
.maintenance-warning { display: inline-flex; align-items: center; min-height: 1.8rem; padding: .25rem .55rem; border-radius: 999px; background: #dbeafe; color: #1e3a8a; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.maintenance-warning.soon { background: #fef3c7; color: #78350f; }
.maintenance-warning.overdue { background: #fee2e2; color: #7f1d1d; }
.compact-warning-list { max-width: 20rem; }
.maintenance-status.completed { background: #e0f2fe; color: #075985; }
.maintenance-sheet-row.completed td { background: #f8fafc; color: #334155; }
.maintenance-timeline-row.completed { border-color: #93c5fd; background: #eff6ff; }
.sheet-check-label { display: inline-flex; align-items: center; gap: .35rem; min-width: 6rem; font-weight: 900; color: #0f172a; }
.sheet-check-label input { width: auto; min-width: auto; accent-color: #2563eb; }
.maintenance-history summary { cursor: pointer; min-height: 2rem; font-weight: 900; color: #1d4ed8; }
.maintenance-history ul { margin: .35rem 0 0; padding-left: 1rem; min-width: 12rem; color: #475569; }
.maintenance-history li + li { margin-top: .2rem; }
.maintenance-history li span { display: inline; color: #0f172a; font-weight: 800; }
.admin-search-card { border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff, #eff6ff); }
.admin-search-form { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.admin-search-form label { flex: 1 1 18rem; margin: 0; }
.admin-search-form input[type="search"], .admin-search-form input[name="q"] { min-height: 3rem; }
.admin-search-form button, .admin-search-form .button { min-height: 3rem; }
.reliability-card { border-color: #bbf7d0; background: linear-gradient(135deg, #ffffff, #f0fdf4); }
.activity-log { margin-top: 1rem; border-top: 1px solid #bbf7d0; padding-top: .85rem; }
.activity-log h3 { margin-top: 0; }
.activity-log-row { display: grid; grid-template-columns: 9rem minmax(12rem, 1fr) minmax(8rem, .8fr); gap: .75rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid #dcfce7; }
.activity-log-row time { color: var(--muted); font-weight: 800; }
.activity-log-row span { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 760px) { .activity-log-row { grid-template-columns: 1fr; gap: .2rem; } }

.mapon-map-card { display: grid; gap: 1rem; }
.mapon-map { min-height: 560px; width: 100%; border: 1px solid var(--border); border-radius: 22px; overflow: hidden; background: #e0f2fe; box-shadow: inset 0 0 0 1px rgba(15,23,42,.04); }
.mapon-map-meta { display: flex; flex-wrap: wrap; gap: .6rem; color: var(--muted); font-weight: 800; }
.mapon-map-meta span { display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .65rem; border-radius: 999px; background: #eff6ff; color: #1e3a8a; }
.button-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; justify-content: flex-end; }
@media (max-width: 760px) {
  .mapon-map-card { gap: .75rem; padding: .9rem; border-radius: 18px; box-shadow: none; }
  .mapon-map-card .section-heading { gap: .65rem; }
  .mapon-map { min-height: min(58vh, 430px); border-radius: 16px; }
  .mapon-map-meta,
  .mapon-map-legend { display: grid; grid-template-columns: 1fr; gap: .45rem; }
  .mapon-map-meta span,
  .mapon-map-legend span { width: 100%; justify-content: flex-start; white-space: normal; }
  .button-row { display: grid; grid-template-columns: 1fr; gap: .45rem; justify-content: stretch; width: 100%; }
  .button-row .button,
  .button-row button { width: 100%; justify-content: center; }
}

.api-key-grid { align-items: start; }
.api-key-card { display: grid; gap: .08rem; border-color: #bfdbfe; background: #ffffff; box-shadow: none; }
.api-key-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; min-width: min(100%, 26rem); margin: 0; padding: 0; list-style: none; }
.api-key-flow li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; align-items: center; min-height: 3rem; padding: .55rem .65rem; border: 1px solid #dbeafe; border-radius: 16px; background: #f8fafc; color: #334155; font-weight: 850; }
.api-key-flow strong { display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: .82rem; }
.api-key-flow span { min-width: 0; font-size: .86rem; line-height: 1.2; }
.api-inbound-workspace { grid-template-columns: minmax(0, 1.45fr) minmax(17rem, .55fr); }
.generated-secret-card { border-color: #f59e0b; background: #fffbeb; box-shadow: inset 3px 0 0 #f59e0b, 0 6px 14px rgba(245,158,11,.07); }
.api-priority-secret-card { border-width: 2px; }
.generated-secret-card h2 { margin-top: .1rem; color: #78350f; }
.generated-secret-card .copy-block { border: 1px solid #fbbf24; background: #fff; }
.api-primary-key-card { border-color: #1d4ed8; box-shadow: 0 24px 36px rgba(37,99,235,.16); }
.api-key-inventory-wrap { margin-top: 0; }
.api-key-inventory-table td, .api-key-inventory-table th { padding-block: .1rem; }
.api-key-inventory-table code { font-size: .72rem; }
.api-primary-key-card .maintenance-status { opacity: 1; }
.api-support-card { opacity: 1; }
.api-instructions-card { background: #fbfdff; border-color: #e2e8f0; box-shadow: none; }
.api-instructions-card .code-sample { max-height: 1.85rem; overflow: auto; margin-bottom: 0; font-size: .6rem; }
.external-services-panel { border-color: #e2e8f0; background: #f8fafc; opacity: 1; }
.external-services-panel > .api-key-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .14rem; }
.external-service-card { display: grid; gap: .05rem; padding: .16rem; border-color: #e2e8f0; background: #fff; box-shadow: none; }
.external-service-card .section-heading { align-items: start; }
.external-service-card h2 { font-size: .88rem; }
.api-key-status { display: grid; gap: .05rem; margin: 0; }
.api-key-status div { display: grid; grid-template-columns: 2.45rem minmax(0,1fr); gap: .06rem; padding: .07rem .12rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.api-key-status dt { font-weight: 900; color: #1e3a8a; }
.api-key-status dd { margin: 0; overflow-wrap: anywhere; color: #334155; font-weight: 700; }
.api-key-form { padding-top: .08rem; border-top: 1px solid #e2e8f0; }
.api-key-create-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .12rem; }
.api-danger-action { opacity: 1; }
.api-key-security-card { border-color: #e2e8f0; background: #fbfdff; box-shadow: none; }
.api-key-security-card { padding: .16rem; opacity: 1; }
.api-key-security-card h2 { font-size: .88rem; }
.api-key-security-card .checklist { margin-bottom: 0; }
.external-service-card .api-key-form button { min-height: 1.9rem; }
.destructive-check { padding: .16rem .24rem; border: 1px solid #fecaca; border-radius: 12px; background: #fff7f7; color: #7f1d1d; }
@media (max-width: 1040px) { .external-services-panel > .api-key-grid, .api-inbound-workspace { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .api-inbound-workspace,
  .external-services-panel > .api-key-grid { gap: .75rem; }
  .api-key-flow { grid-template-columns: 1fr; }
  .api-key-card,
  .external-services-panel,
  .external-service-card,
  .api-key-security-card { padding: .85rem; border-radius: 18px; box-shadow: none; }
  .api-key-card .section-heading,
  .external-service-card .section-heading { gap: .55rem; }
  .api-key-card .maintenance-status,
  .external-service-card .maintenance-status { min-height: 2.2rem; margin: 0; }
  .api-key-inventory-wrap { border-radius: 14px; }
  .api-key-inventory-table { min-width: 0; }
  .api-key-inventory-table thead { display: none; }
  .api-key-inventory-table,
  .api-key-inventory-table tbody,
  .api-key-inventory-table tr,
  .api-key-inventory-table td { display: block; width: 100%; }
  .api-key-inventory-table tr { padding: .65rem; border-bottom: 1px solid #e2e8f0; }
  .api-key-inventory-table tr:last-child { border-bottom: 0; }
  .api-key-inventory-table td { padding: .2rem 0; border: 0; }
  .api-key-inventory-table td[colspan] { color: var(--muted); font-weight: 850; }
  .api-key-create-form { grid-template-columns: 1fr; gap: .55rem; }
  .api-key-create-form button,
  .external-service-card .api-key-form button { width: 100%; min-height: 2.7rem; }
  .api-key-status { gap: .35rem; }
  .api-key-status div { grid-template-columns: minmax(4rem, .3fr) minmax(0, 1fr); gap: .35rem; padding: .55rem .65rem; border-radius: 12px; }
  .api-instructions-card .code-sample { max-height: 8rem; font-size: .72rem; }
  .destructive-check { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-content: start; gap: .65rem; min-height: 3rem; padding: .65rem; white-space: normal; overflow-wrap: anywhere; }
  .destructive-check input { width: 1.25rem; min-width: 1.25rem; height: 1.25rem; justify-self: start; }
}

.mapon-map-legend { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; color: #334155; font-weight: 800; }
.mapon-map-legend span { display: inline-flex; gap: .4rem; align-items: center; padding: .35rem .65rem; border: 1px solid #e2e8f0; border-radius: 999px; background: #fff; }
.mapon-dot { width: .8rem; height: .8rem; border-radius: 999px; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(15,23,42,.12); }
.mapon-dot.moving { background: #22c55e; }
.mapon-dot.idle { background: #facc15; }
.mapon-dot.long-idle { background: #ef4444; }
.mapon-vehicle-marker { position: relative; width: 120px; height: 54px; transform: translateY(-2px); pointer-events: auto; }
.mapon-vehicle-label { position: absolute; left: 50%; top: 0; transform: translateX(-50%); max-width: 116px; padding: .18rem .45rem; border-radius: 999px; background: #fff; color: #0f172a; border: 2px solid currentColor; box-shadow: 0 6px 18px rgba(15,23,42,.18); font: 900 12px/1.15 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapon-vehicle-pin { position: absolute; left: 50%; bottom: 0; width: 24px; height: 24px; transform: translateX(-50%) rotate(45deg); border: 3px solid #fff; border-radius: 50% 50% 50% 0; box-shadow: 0 8px 22px rgba(15,23,42,.24); }
.mapon-vehicle-pin::after { content: ''; position: absolute; inset: 5px; border-radius: 999px; background: rgba(255,255,255,.92); }
.mapon-vehicle-marker.moving { color: #15803d; }
.mapon-vehicle-marker.moving .mapon-vehicle-pin { background: #22c55e; }
.mapon-vehicle-marker.idle { color: #a16207; }
.mapon-vehicle-marker.idle .mapon-vehicle-pin { background: #facc15; }
.mapon-vehicle-marker.long-idle { color: #b91c1c; }
.mapon-vehicle-marker.long-idle .mapon-vehicle-pin { background: #ef4444; }
.mapon-vehicle-arrow { position: absolute; left: 50%; bottom: 0; width: 30px; height: 34px; transform: translateX(-50%) rotate(var(--heading, 0deg)); transform-origin: 50% 50%; filter: drop-shadow(0 8px 14px rgba(15,23,42,.26)); }
.mapon-vehicle-arrow span { position: absolute; left: 50%; top: 0; width: 0; height: 0; transform: translateX(-50%); border-left: 13px solid transparent; border-right: 13px solid transparent; border-bottom: 31px solid currentColor; }
.mapon-vehicle-arrow span::after { content: ''; position: absolute; left: -6px; top: 11px; width: 12px; height: 12px; border-radius: 999px; background: rgba(255,255,255,.94); }
.mapon-vehicle-marker.moving .mapon-vehicle-arrow { color: #22c55e; }
.mapon-vehicle-marker.idle .mapon-vehicle-arrow { color: #facc15; }
.mapon-vehicle-marker.long-idle .mapon-vehicle-arrow { color: #ef4444; }

/* Polished Mapon fleet markers */
.mapon-vehicle-marker { height: 68px; }
.mapon-vehicle-label {
  top: 0;
  min-width: 58px;
  max-width: 118px;
  padding: .28rem .55rem .3rem;
  border: 0;
  background: rgba(255,255,255,.96);
  color: #0f172a;
  box-shadow: 0 10px 26px rgba(15,23,42,.22), 0 0 0 1px rgba(148,163,184,.35);
  backdrop-filter: blur(8px);
}
.mapon-vehicle-label::before {
  content: '';
  display: inline-block;
  width: .48rem;
  height: .48rem;
  margin-right: .35rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9);
  vertical-align: .04rem;
}
.mapon-vehicle-arrow {
  bottom: 2px;
  width: 38px;
  height: 42px;
  filter: drop-shadow(0 10px 14px rgba(15,23,42,.28));
}
.mapon-vehicle-arrow span {
  border-left-width: 16px;
  border-right-width: 16px;
  border-bottom-width: 38px;
  border-bottom-color: currentColor;
}
.mapon-vehicle-arrow span::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 3px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.92);
}
.mapon-vehicle-arrow span::after {
  left: -4px;
  top: 12px;
  width: 8px;
  height: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15,23,42,.08);
}
.mapon-vehicle-marker.moving .mapon-vehicle-label { color: #15803d; }
.mapon-vehicle-marker.idle .mapon-vehicle-label { color: #a16207; }
.mapon-vehicle-marker.long-idle .mapon-vehicle-label { color: #b91c1c; }
.mapon-vehicle-marker:hover .mapon-vehicle-label { transform: translateX(-50%) translateY(-2px); box-shadow: 0 14px 34px rgba(15,23,42,.28), 0 0 0 1px rgba(148,163,184,.45); }
.mapon-vehicle-marker:hover .mapon-vehicle-arrow { filter: drop-shadow(0 14px 18px rgba(15,23,42,.34)); }

/* Top-down semi truck markers. Cabin/front is status-colored and rotates by Mapon heading. */
.mapon-truck {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 34px;
  height: 50px;
  transform: translateX(-50%) rotate(var(--heading, 0deg));
  transform-origin: 50% 54%;
  filter: drop-shadow(0 10px 14px rgba(15,23,42,.28));
}
.mapon-truck .truck-cabin,
.mapon-truck .truck-trailer {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  box-sizing: border-box;
}
.mapon-truck .truck-cabin {
  top: 0;
  width: 25px;
  height: 18px;
  border-radius: 7px 7px 4px 4px;
  background: currentColor;
  border: 2px solid #fff;
  z-index: 2;
  box-shadow: inset 0 -5px 0 rgba(15,23,42,.13);
}
.mapon-truck .truck-cabin::before,
.mapon-truck .truck-cabin::after {
  content: '';
  position: absolute;
  top: 5px;
  width: 4px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255,255,255,.9);
}
.mapon-truck .truck-cabin::before { left: 5px; }
.mapon-truck .truck-cabin::after { right: 5px; }
.mapon-truck .truck-cabin i {
  position: absolute;
  left: 50%;
  top: -7px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 8px solid currentColor;
}
.mapon-truck .truck-trailer {
  top: 18px;
  width: 31px;
  height: 31px;
  border-radius: 5px 5px 9px 9px;
  background: linear-gradient(180deg, #ffffff, #e5e7eb);
  border: 2px solid #fff;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.16);
}
.mapon-truck .truck-trailer::before,
.mapon-truck .truck-trailer::after {
  content: '';
  position: absolute;
  bottom: 5px;
  width: 4px;
  height: 10px;
  border-radius: 2px;
  background: #475569;
}
.mapon-truck .truck-trailer::before { left: -4px; }
.mapon-truck .truck-trailer::after { right: -4px; }
.mapon-truck .truck-trailer i {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 18px;
  height: 2px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(15,23,42,.16);
  box-shadow: 0 7px 0 rgba(15,23,42,.12), 0 14px 0 rgba(15,23,42,.09);
}
.mapon-vehicle-marker.moving .mapon-truck { color: #22c55e; }
.mapon-vehicle-marker.idle .mapon-truck { color: #facc15; }
.mapon-vehicle-marker.long-idle .mapon-truck { color: #ef4444; }
.mapon-vehicle-marker:hover .mapon-truck { filter: drop-shadow(0 14px 18px rgba(15,23,42,.34)); }

/* More realistic top-down semi-truck marker style */
.mapon-vehicle-marker { width: 140px; height: 82px; }
.mapon-vehicle-label {
  top: 0;
  font-size: 11px;
  padding: .24rem .5rem;
  box-shadow: 0 8px 20px rgba(15,23,42,.2), 0 0 0 1px rgba(15,23,42,.12);
}
.mapon-truck {
  bottom: 0;
  width: 44px;
  height: 62px;
  transform-origin: 50% 55%;
  filter: drop-shadow(0 9px 10px rgba(15,23,42,.32));
}
.mapon-truck .truck-cabin {
  top: 0;
  width: 32px;
  height: 23px;
  border-radius: 10px 10px 5px 5px;
  border: 2px solid #111827;
  box-shadow: inset 0 -6px 0 rgba(15,23,42,.16), inset 0 2px 0 rgba(255,255,255,.34);
}
.mapon-truck .truck-cabin::before,
.mapon-truck .truck-cabin::after {
  top: 6px;
  width: 6px;
  height: 9px;
  border-radius: 3px 3px 2px 2px;
  background: rgba(219,234,254,.95);
  box-shadow: inset 0 1px 0 #fff;
}
.mapon-truck .truck-cabin::before { left: 6px; }
.mapon-truck .truck-cabin::after { right: 6px; }
.mapon-truck .truck-cabin i {
  top: -9px;
  border-left-width: 8px;
  border-right-width: 8px;
  border-bottom-width: 10px;
  filter: drop-shadow(0 -1px 0 #111827);
}
.mapon-truck .truck-trailer {
  top: 22px;
  width: 39px;
  height: 39px;
  border-radius: 4px 4px 10px 10px;
  background: linear-gradient(180deg, #f8fafc 0%, #e5e7eb 100%);
  border: 2px solid #111827;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.75), inset 0 -8px 12px rgba(15,23,42,.08);
}
.mapon-truck .truck-trailer::before,
.mapon-truck .truck-trailer::after {
  bottom: 7px;
  width: 5px;
  height: 13px;
  border-radius: 3px;
  background: #111827;
  box-shadow: 0 -18px 0 #111827;
}
.mapon-truck .truck-trailer::before { left: -6px; }
.mapon-truck .truck-trailer::after { right: -6px; }
.mapon-truck .truck-trailer i {
  top: 7px;
  width: 24px;
  height: 2px;
  background: rgba(15,23,42,.18);
  box-shadow: 0 8px 0 rgba(15,23,42,.14), 0 16px 0 rgba(15,23,42,.1), 0 24px 0 rgba(255,255,255,.8);
}
.mapon-vehicle-marker:hover .mapon-truck { filter: drop-shadow(0 13px 16px rgba(15,23,42,.38)); }

/* Final Mapon marker: clean directional arrowhead with label */
.mapon-vehicle-marker { width: 132px; height: 72px; }
.mapon-arrowhead {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 42px;
  height: 48px;
  transform: translateX(-50%) rotate(var(--heading, 0deg));
  transform-origin: 50% 55%;
  filter: drop-shadow(0 12px 16px rgba(15,23,42,.3));
}
.mapon-arrowhead span {
  position: absolute;
  left: 50%;
  top: 0;
  width: 32px;
  height: 42px;
  transform: translateX(-50%);
  background: currentColor;
  clip-path: polygon(50% 0%, 95% 100%, 50% 78%, 5% 100%);
  box-shadow: inset 0 -8px 0 rgba(15,23,42,.16);
}
.mapon-arrowhead span::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 14px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(15,23,42,.12);
}
.mapon-vehicle-marker.moving .mapon-arrowhead { color: #22c55e; }
.mapon-vehicle-marker.idle .mapon-arrowhead { color: #facc15; }
.mapon-vehicle-marker.long-idle .mapon-arrowhead { color: #ef4444; }
.mapon-vehicle-marker:hover .mapon-arrowhead { filter: drop-shadow(0 16px 20px rgba(15,23,42,.38)); }

/* Final Mapon marker: rotating map pointer; tip shows heading direction */
.mapon-pointer {
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 42px;
  height: 48px;
  transform: translateX(-50%) rotate(calc(var(--heading, 0deg) + 90deg));
  transform-origin: 50% 55%;
  filter: drop-shadow(0 12px 16px rgba(15,23,42,.32));
}
.mapon-pointer span {
  position: absolute;
  left: 50%;
  top: 1px;
  width: 34px;
  height: 34px;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 50% 50% 50% 6px;
  background: currentColor;
  border: 3px solid #fff;
  box-shadow: inset -5px -5px 0 rgba(15,23,42,.13), 0 0 0 1px rgba(15,23,42,.18);
}
.mapon-pointer span::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.14);
}
.mapon-vehicle-marker.moving .mapon-pointer { color: #22c55e; }
.mapon-vehicle-marker.idle .mapon-pointer { color: #facc15; }
.mapon-vehicle-marker.long-idle .mapon-pointer { color: #ef4444; }
.mapon-vehicle-marker:hover .mapon-pointer { filter: drop-shadow(0 16px 20px rgba(15,23,42,.4)); }

/* Document-like admin page editor */
.admin-docs-title { margin-bottom: 1rem; }
.docs-authoring-guide { display: grid; gap: .35rem; max-width: 44rem; margin-top: .85rem; padding: .85rem; border: 1px solid #dbeafe; border-radius: 18px; background: #f8fafc; color: #334155; font-size: .9rem; }
.docs-authoring-guide strong { color: #0f172a; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.docs-authoring-guide span { overflow-wrap: anywhere; }
.docs-editor-shell { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 1rem; align-items: start; }
.docs-editor-sidebar { position: sticky; top: 1rem; display: grid; gap: .9rem; }
.docs-sidebar-section { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-soft); padding: 1rem; }
.docs-sidebar-section h2, .docs-sidebar-section summary { margin: 0 0 .65rem; font-size: 1rem; font-weight: 800; }
.docs-sidebar-section summary { cursor: pointer; }
.docs-page-picker { width: 100%; margin-top: .35rem; }
.docs-page-link { width: 100%; display: grid; gap: .15rem; text-align: left; margin-top: .45rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); color: var(--text); padding: .7rem .8rem; cursor: pointer; }
.docs-page-link small { color: var(--muted); font-weight: 600; }
.docs-page-link.is-active { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.docs-mini-form { gap: .5rem; margin-bottom: .75rem; }
.docs-nav-group-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .35rem; align-items: center; margin-top: .45rem; }
.docs-nav-group-row input { min-width: 0; }
.docs-nav-group-row button { padding: .55rem .7rem; }
.docs-editor-main { min-width: 0; border: 1px solid var(--border); border-radius: 22px; background: #f8fafc; box-shadow: var(--shadow-soft); overflow: hidden; }
.docs-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); padding: .65rem .8rem; }
.docs-toolbar button { border: 1px solid var(--border); border-radius: 999px; background: white; color: var(--text); padding: .45rem .75rem; font-weight: 800; cursor: pointer; }
.docs-toolbar button:hover { border-color: #93c5fd; background: #eff6ff; }
.docs-toolbar-label { align-self: center; color: var(--muted); font-size: .75rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.docs-toolbar-divider { align-self: stretch; width: 1px; min-height: 2rem; margin-inline: .15rem; background: var(--border); }
.docs-toolbar-spacer { flex: 1; }
.docs-toolbar-hint { color: var(--muted); font-size: .85rem; }
.docs-document-panel { display: none; padding: 1.25rem; }
.docs-document-panel.is-active { display: block; }
.docs-document-form { max-width: 980px; margin: 0 auto; }
.docs-document-title { margin: 0; font-size: 1.35rem; }
.docs-meta-grid { display: grid; grid-template-columns: minmax(190px, .9fr) repeat(4, minmax(0, 1fr)); gap: .8rem; align-items: end; border: 1px solid var(--border); border-radius: 16px; background: white; padding: .9rem; }
.docs-current-state { align-self: stretch; display: grid; align-content: center; gap: .2rem; min-width: 0; padding: .75rem .85rem; border: 1px solid #dbeafe; border-radius: 14px; background: #f8fafc; }
.docs-current-state strong { color: #0f172a; font-size: 1rem; overflow-wrap: anywhere; }
.docs-current-state span { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.docs-visible-toggle { align-self: center; margin-top: 1.4rem; }
.docs-paper-label { font-weight: 900; color: var(--muted); }
.docs-paper { min-height: 720px; white-space: pre-wrap; outline: none; border: 1px solid #e2e8f0; border-radius: 4px; background: white; box-shadow: 0 24px 60px rgba(15, 23, 42, .12); padding: 72px 86px; color: #111827; font-family: Georgia, 'Times New Roman', serif; font-size: 1.04rem; line-height: 1.75; caret-color: #2563eb; }
.docs-paper:focus { border-color: #93c5fd; box-shadow: 0 24px 60px rgba(15, 23, 42, .12), 0 0 0 4px rgba(37,99,235,.14); }
.docs-paper:empty::before { content: attr(data-placeholder); color: #94a3b8; }
.docs-hidden-textarea { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.docs-actions { display: flex; justify-content: flex-end; gap: .6rem; align-items: center; border-top: 1px solid var(--border); padding-top: .9rem; }
@media (max-width: 900px) {
  .docs-editor-shell { grid-template-columns: 1fr; }
  .docs-editor-sidebar { position: static; }
  .docs-meta-grid { grid-template-columns: 1fr; }
  .docs-paper { min-height: 520px; padding: 36px 24px; }
  .docs-actions { flex-direction: column; align-items: stretch; }
}
@media (max-width: 640px) {
  .admin-docs-title { gap: .65rem; padding: .9rem; }
  .admin-docs-title h1 { font-size: 1.55rem; line-height: 1.15; }
  .admin-docs-title .muted { margin-bottom: 0; }
  .docs-authoring-guide { gap: .25rem; margin-top: .1rem; padding: .7rem; border-radius: 14px; font-size: .84rem; }
  .docs-editor-shell { gap: .75rem; }
  .docs-editor-sidebar { gap: .65rem; }
  .docs-sidebar-section { padding: .75rem; border-radius: 14px; box-shadow: none; }
  .docs-sidebar-section h2,
  .docs-sidebar-section summary { margin-bottom: .45rem; font-size: .95rem; }
  .docs-page-picker { min-height: 2.75rem; }
  .docs-page-link { min-height: 2.7rem; margin-top: .35rem; padding: .55rem .65rem; border-radius: 10px; }
  .docs-mini-form { gap: .45rem; }
  .docs-nav-group-row { grid-template-columns: 1fr; }
  .docs-nav-group-row button,
  .docs-asset-button,
  .docs-group-drop { min-height: 2.65rem; }
  .docs-editor-main { border-radius: 16px; box-shadow: none; }
  .docs-toolbar { position: static; flex-wrap: nowrap; gap: .35rem; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; padding: .5rem; scrollbar-width: thin; }
  .docs-toolbar-label,
  .docs-toolbar-divider,
  .docs-toolbar-hint,
  .docs-toolbar-spacer { display: none; }
  .docs-toolbar button { flex: 0 0 auto; min-height: 2.4rem; padding: .4rem .65rem; border-radius: 999px; white-space: nowrap; }
  .docs-toolbar-count { flex: 0 0 auto; min-height: 2.4rem; display: inline-flex; align-items: center; padding: .35rem .6rem; font-size: .78rem; }
  .docs-search-input { flex: 0 0 9.5rem; width: 9.5rem; min-height: 2.4rem; }
  .docs-document-panel { padding: .7rem; }
  .docs-document-form { max-width: none; gap: .7rem; }
  .docs-document-title { font-size: 1.15rem; line-height: 1.25; overflow-wrap: anywhere; }
  .docs-meta-grid { gap: .65rem; padding: .7rem; border-radius: 14px; }
  .docs-current-state { padding: .65rem; border-radius: 12px; }
  .docs-visible-toggle { margin-top: 0; }
  .docs-drop-hint,
  .docs-page-meta-line,
  .docs-a11y-report { font-size: .84rem; line-height: 1.45; }
  .docs-paper { min-height: 430px; padding: 1rem; border-radius: 12px; box-shadow: none; font-size: 1rem; line-height: 1.6; }
  .docs-paper:focus { box-shadow: 0 0 0 4px rgba(37,99,235,.14); }
  .docs-preview { padding: .85rem; border-radius: 14px; box-shadow: none; }
  .docs-version-history { padding: .15rem 0; }
  .docs-version-row { display: grid; grid-template-columns: 1fr; gap: .45rem; }
  .docs-version-row button { width: 100%; }
  .docs-actions { gap: .45rem; padding-top: .7rem; }
  .docs-actions .button,
  .docs-actions button { width: 100%; justify-content: center; }
}

.docs-drop-hint { margin: -.25rem 0 .5rem; color: var(--muted); font-size: .9rem; }
.docs-paper.is-drag-over { border-color: #2563eb; background: linear-gradient(rgba(239,246,255,.88), rgba(239,246,255,.88)), #fff; box-shadow: 0 24px 60px rgba(15,23,42,.12), 0 0 0 5px rgba(37,99,235,.18); }
.docs-paper.is-uploading { cursor: progress; opacity: .82; }
.page-attachment.image { margin: 1rem 0; }
.page-attachment.image img { display: block; max-width: min(100%, 720px); height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.page-attachment.image figcaption { margin-top: .4rem; color: var(--muted); font-size: .9rem; }
.page-attachment.file a { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; background: var(--surface-muted); font-weight: 800; }
.page-attachment.file a::before { content: '📎'; }
.docs-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.docs-toolbar-count { border: 1px solid var(--border); border-radius: 999px; background: var(--surface-muted); color: var(--muted); padding: .35rem .65rem; font-size: .82rem; font-weight: 800; white-space: nowrap; }
.docs-search-input { width: 11rem; min-height: 2.2rem; border: 1px solid var(--border); border-radius: 999px; padding: .35rem .75rem; }
.docs-asset-library { display: grid; gap: .4rem; }
.docs-asset-button, .docs-group-drop { width: 100%; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: .55rem .65rem; color: var(--text); font-weight: 700; }
.docs-asset-button { display: grid; grid-template-columns: auto 1fr; gap: .5rem; align-items: center; }
.docs-group-drop { margin: .35rem 0; border-style: dashed; color: var(--muted); }
.docs-group-drop.is-drag-over { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.docs-page-meta-line { color: var(--muted); font-size: .88rem; margin: -.25rem 0 .35rem; }
.docs-preview { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); padding: 1.25rem; box-shadow: var(--shadow-soft); }
.docs-a11y-report { color: var(--muted); font-size: .88rem; }
.docs-version-history { border: 1px solid var(--border); border-radius: 14px; padding: .75rem; background: var(--surface-muted); }
.docs-version-row { display: flex; justify-content: space-between; gap: .75rem; align-items: center; padding: .4rem 0; border-top: 1px solid var(--border); }
.docs-version-row:first-of-type { border-top: 0; }
.page-attachment.image.is-small img { max-width: 280px; }
.page-attachment.image.is-medium img { max-width: 520px; }
.page-attachment.image.is-full img { max-width: 100%; }
.page-attachment.image.align-center img { margin-inline: auto; }
.page-attachment.image.align-right img { margin-left: auto; }
.page-attachment.pdf object { width: 100%; min-height: 520px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-muted); }
.docs-toolbar [data-docs-command].is-active { background: #dbeafe; border-color: #2563eb; color: #1d4ed8; }
.docs-paper h2 { font-size: 1.9rem; line-height: 1.2; margin: 1.2rem 0 .55rem; color: var(--text); }
.docs-paper h3 { font-size: 1.35rem; line-height: 1.25; margin: 1rem 0 .45rem; color: var(--text); }
.docs-paper blockquote { margin: 1rem 0; padding: .9rem 1rem; border-left: 5px solid #2563eb; background: #eff6ff; border-radius: 12px; color: #1e3a8a; }
.docs-paper hr { border: 0; border-top: 2px solid var(--border); margin: 1.25rem 0; }
.docs-paper table { width: 100%; border-collapse: collapse; margin: 1rem 0; overflow: hidden; border-radius: 12px; }
.docs-paper td, .docs-paper th { border: 1px solid var(--border); padding: .65rem .75rem; }
.docs-paper ul, .docs-paper ol { padding-left: 1.5rem; }
.docs-editor-attachment.image { margin: 1rem 0; }
.docs-editor-attachment.image img { display: block; max-width: min(100%, 720px); height: auto; border-radius: 12px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.docs-editor-attachment.image figcaption { margin-top: .4rem; color: var(--muted); font-size: .9rem; }
.docs-editor-attachment.file a { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; background: var(--surface-muted); font-weight: 800; }
.docs-editor-attachment.image.is-small img { max-width: 280px; }
.docs-editor-attachment.image.is-full img { max-width: 100%; }
.docs-editor-attachment.image.align-center img { margin-inline: auto; }
.docs-editor-attachment.image.align-right img { margin-left: auto; }

/* Admin database UML */
.db-uml-hero > div:first-child { display: grid; gap: .55rem; max-width: 60rem; }
.db-uml-hero h1, .db-uml-hero p { margin-bottom: 0; }
.db-uml-source { width: fit-content; margin-top: .15rem; padding: .4rem .65rem; border: 1px solid var(--border); border-radius: 999px; background: #f8fafc; color: var(--muted); font-size: .88rem; font-weight: 800; }
.db-uml-source code { color: #334155; font-size: .86em; }
.db-uml-counts { display: grid; gap: .35rem; min-width: 12rem; text-align: left; box-shadow: none; }
.db-uml-counts span { display: flex; justify-content: space-between; gap: .75rem; align-items: center; color: var(--muted); }
.hero-badge.db-uml-counts strong { display: inline; margin: 0; color: var(--text); font-size: 1.05rem; }
.db-uml-summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  border-color: #dbeafe;
  box-shadow: var(--shadow-soft);
}

.db-uml-summary > div:first-child { max-width: 60rem; }

.db-uml-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin: 0;
}

.db-uml-legend div {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 999px;
  padding: .38rem .65rem;
  background: var(--surface-soft, #f8fafc);
}

.db-uml-legend dt,
.db-uml-legend dd { display: inline; margin: 0; }
.db-uml-legend dt { font-weight: 800; margin-right: .35rem; }
.db-uml-legend dd { color: var(--muted, #64748b); }

.db-uml-domain-nav { display: grid; gap: .55rem; box-shadow: var(--shadow-soft); }
.db-uml-domain-nav .eyebrow { margin-bottom: 0; }
.db-uml-domain-nav ul { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.db-uml-domain-nav li { display: inline-flex; gap: .45rem; align-items: center; min-height: 2.45rem; padding: .35rem .6rem; border: 1px solid #dbeafe; border-radius: 999px; background: #eff6ff; }
.db-uml-domain-nav a { color: #1e3a8a; font-weight: 900; }
.db-uml-domain-nav span { color: var(--muted); font-size: .82rem; font-weight: 850; }

.db-uml-focus { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.2fr); gap: 1rem; align-items: start; border-color: #bfdbfe; background: linear-gradient(135deg, #ffffff, #eff6ff); box-shadow: var(--shadow-soft); }
.db-uml-focus h2 { margin: 0; }
.db-uml-focus .eyebrow { margin-bottom: .25rem; }
.db-uml-focus ol { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.db-uml-focus li { display: grid; grid-template-columns: auto 1fr; gap: .55rem; align-items: start; padding: .65rem .75rem; border: 1px solid #dbeafe; border-radius: 16px; background: #fff; }
.db-uml-focus li strong { display: inline-grid; place-items: center; min-width: 1.75rem; min-height: 1.75rem; border-radius: 999px; background: #1d4ed8; color: #fff; font-size: .76rem; }
.db-uml-focus code { color: #1e3a8a; }

.db-uml-board {
  display: grid;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

.db-uml-domain {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 1.25rem;
  background: #f8fbff;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.db-uml-domain-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: .9rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid #dbeafe;
}

.db-uml-domain-heading .eyebrow, .db-uml-domain-heading h2 { margin: 0; }
.db-uml-domain-heading span { color: var(--muted, #64748b); font-weight: 800; }

.db-uml-table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .9rem;
}

.db-table-card {
  border: 1px solid var(--border, #d8dee8);
  border-radius: 1rem;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
}
.db-table-card.is-central { border-color: #2563eb; box-shadow: inset 0 0 0 2px #dbeafe; }
.db-table-card.is-central .db-table-card-heading { background: #eff6ff; border-bottom-color: #bfdbfe; }

.db-table-card-heading {
  display: grid;
  gap: .25rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
}

.db-table-card-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}
.db-table-card-heading p { margin: 0; color: var(--muted); font-size: .86rem; font-weight: 800; }

.db-column-list {
  list-style: none;
  margin: 0;
  padding: .6rem .75rem .8rem;
  display: grid;
  gap: .25rem;
}

.db-column-list li {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) minmax(5rem, auto) auto minmax(7rem, auto);
  gap: .4rem;
  align-items: center;
  padding: .25rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border, #d8dee8) 65%, transparent);
  font-size: .88rem;
}

.db-column-list li:last-child { border-bottom: 0; }
.db-column-name { font-weight: 700; overflow-wrap: anywhere; }
.db-column-type { color: var(--muted, #64748b); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; }
.db-column-flag { border-radius: 999px; padding: .12rem .35rem; font-size: .68rem; font-weight: 800; justify-self: start; }
.db-column-reference { color: #475569; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; overflow-wrap: anywhere; }
.db-column-flag.pk { background: #dcfce7; color: #166534; }
.db-column-flag.fk { background: #ffedd5; color: #9a3412; }
.db-column-flag.uq { background: #e0e7ff; color: #3730a3; }

.db-relation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: .5rem;
}

.db-relation-row {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .7rem;
  border: 1px solid var(--border, #d8dee8);
  border-radius: .75rem;
  background: var(--surface-soft, #f8fafc);
  overflow-x: auto;
}

.db-relation-row code { white-space: nowrap; }
.db-relation-label { border-radius: 999px; padding: .12rem .42rem; background: #e0e7ff; color: #3730a3; font-size: .68rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
:root[data-portal-theme="dark"] .db-uml-source,
:root[data-portal-theme="dark"] .db-uml-focus,
:root[data-portal-theme="dark"] .db-uml-focus li,
:root[data-portal-theme="dark"] .db-uml-domain,
:root[data-portal-theme="dark"] .db-table-card,
:root[data-portal-theme="dark"] .db-table-card-heading,
:root[data-portal-theme="dark"] .db-relation-row,
:root[data-portal-theme="dark"] .db-uml-domain-nav li { background: #12233a; border-color: #29405f; }
:root[data-portal-theme="dark"] .db-uml-domain-nav a { color: #dbeafe; }
:root[data-portal-theme="dark"] .db-uml-source code { color: #dbeafe; }

@media (max-width: 700px) {
  .db-uml-summary,
  .db-uml-focus,
  .db-uml-domain-heading { display: block; }
  .db-column-list li { grid-template-columns: 1fr; gap: .15rem; }
  .db-relation-list { grid-template-columns: 1fr; }
}
