:root {
    color-scheme: dark;
    --bg: #03070c;
    --surface: #08121e;
    --surface-strong: #0b1827;
    --surface-soft: rgba(8, 18, 30, 0.84);
    --border: #21364b;
    --border-soft: rgba(134, 173, 211, 0.16);
    --text: #f4f8fc;
    --muted: #91a0b2;
    --accent: #58a6ff;
    --accent-strong: #2e86e6;
    --accent-soft: rgba(88, 166, 255, 0.16);
    --green: #45d4a4;
    --orange: #f7bb59;
    --pink: #ee7894;
    --danger: #ff7484;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --ambient-strength: 24%;
    --ambient-wash: 7%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
    color-scheme: only light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-strong: #f7f8fa;
    --surface-soft: rgba(255, 255, 255, 0.96);
    --border: #d6dce3;
    --border-soft: rgba(25, 42, 61, 0.12);
    --text: #10151c;
    --muted: #5d6876;
    --accent-soft: rgba(46, 134, 230, 0.12);
    --shadow: 0 16px 38px rgba(31, 42, 54, 0.12);
    --ambient-strength: 10%;
    --ambient-wash: 3%;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: var(--accent); }
.hidden { display: none !important; }
.boot-view {
    position: fixed;
    z-index: 2;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 9px;
    background: var(--bg);
    color: var(--text);
}
.boot-view strong { font-size: 20px; }
.boot-view span { color: var(--muted); font-size: 12px; }
body:not(.app-booting) .boot-view { display: none; }
.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 760px 520px at 50% -120px, color-mix(in srgb, var(--accent) var(--ambient-strength), transparent) 0, transparent 68%),
        linear-gradient(180deg, color-mix(in srgb, var(--accent) var(--ambient-wash), var(--bg)) 0, var(--bg) 520px);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 31px; line-height: 1.12; }
h2 { margin-bottom: 6px; font-size: 23px; }
.eyebrow {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
}
.muted { color: var(--muted); line-height: 1.45; }
.center-view {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: calc(28px + var(--safe-top)) 18px calc(28px + var(--safe-bottom));
}
.auth-panel {
    width: min(100%, 420px);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    box-shadow: var(--shadow);
    backdrop-filter: blur(24px) saturate(130%);
    -webkit-backdrop-filter: blur(24px) saturate(130%);
}
.wide-panel { width: min(100%, 520px); }
.brand-line { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.brand-line h1 { margin: 0; }
.brand-line .eyebrow { margin-bottom: 3px; }
.brand-icon { width: 56px; height: 56px; border-radius: 8px; }
.brand-icon.small { width: 40px; height: 40px; }
.form-stack { display: grid; gap: 14px; margin-top: 20px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; color: var(--muted); }
input, textarea, select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font-size: 16px;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check-row { grid-template-columns: 22px 1fr; align-items: start; gap: 10px; color: var(--text); font-weight: 500; line-height: 1.4; }
.check-row input { min-height: 22px; width: 22px; accent-color: var(--accent); }
.check-row > span { display: grid; gap: 2px; }
.check-row small { color: var(--muted); font-size: 11px; font-weight: 400; }
.primary-button, .quiet-button, .danger-button, .text-button, .icon-button {
    border: 0;
    cursor: pointer;
}
.primary-button, .quiet-button, .danger-button {
    min-height: 48px;
    border-radius: 8px;
    padding: 11px 16px;
    font-weight: 750;
}
.primary-button { background: var(--accent); color: #06111d; }
.quiet-button { border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.danger-button { border: 1px solid color-mix(in srgb, var(--danger) 55%, var(--border)); background: transparent; color: var(--danger); }
.text-button { padding: 4px 0; justify-self: start; background: transparent; color: var(--accent); }
.icon-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    font-size: 24px;
}
button:disabled { opacity: 0.55; cursor: wait; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 13px; line-height: 1.35; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 20px 0 0; font-size: 12px; }
.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--surface) 76%, transparent);
}
.segmented.four { grid-template-columns: repeat(4, 1fr); }
.segmented button {
    min-height: 40px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
}
.segmented button.active { background: var(--accent); color: #06111d; box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 25%, transparent); }

.mobile-app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 620px;
    margin: 0 auto;
    padding-bottom: calc(82px + var(--safe-bottom));
}
.app-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(10px + var(--safe-top)) 16px 10px;
    border-bottom: 1px solid var(--border-soft);
    background: color-mix(in srgb, var(--bg) 84%, transparent);
    backdrop-filter: blur(22px) saturate(130%);
    -webkit-backdrop-filter: blur(22px) saturate(130%);
}
.compact-brand { margin: 0; }
.compact-brand div { display: grid; }
.compact-brand strong { font-size: 17px; }
.compact-brand span { color: var(--muted); font-size: 12px; }
.connection-banner { margin: 10px 16px 0; padding: 10px 12px; border: 1px solid var(--orange); border-radius: 8px; color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, var(--surface)); font-size: 13px; }
.screen-stack { padding: 14px 16px 28px; }
.screen { display: none; }
.screen.active { display: block; animation: appear 180ms ease-out; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }
.screen.period-swipe-left { animation: period-swipe-left 190ms ease-out; }
.screen.period-swipe-right { animation: period-swipe-right 190ms ease-out; }
@keyframes period-swipe-left { from { opacity: 0.42; transform: translateX(22px); } }
@keyframes period-swipe-right { from { opacity: 0.42; transform: translateX(-22px); } }

.calendar-title-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 10px;
}
.calendar-title-row h1, .calendar-title-row p { margin-bottom: 0; }
.calendar-title-actions { display: flex; align-items: center; gap: 5px; padding-bottom: 1px; }
.calendar-title-actions > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.title-icon-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 25px;
    line-height: 1;
}
.title-icon-button.has-restrictions { border-color: var(--border); background: var(--accent-soft); color: var(--accent); }
.calendar-heading { margin: 0 0 10px; }
.calendar-heading h2 { margin: 0; font-size: 19px; }

.month-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 13px 12px 13px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.published-schedule-offer {
    display: grid;
    gap: 14px;
    margin: 10px 0 14px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 54%, var(--border));
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 12%, transparent);
}

.published-schedule-offer h2 {
    margin: 3px 0 5px;
    font-size: 20px;
}

.published-schedule-offer p {
    margin: 0;
}

.published-schedule-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 10px;
}

.published-schedule-actions button {
    min-width: 0;
    min-height: 46px;
    padding-inline: 10px;
    white-space: normal;
}
.month-overview { min-width: 0; display: grid; gap: 7px; }
.month-primary { min-width: 0; display: flex; align-items: baseline; gap: 7px; overflow: hidden; white-space: nowrap; }
.month-primary > span { color: var(--muted); font-size: 15px; }
.month-primary strong { overflow: hidden; font-size: clamp(15px, 4.5vw, 19px); text-overflow: ellipsis; }
.month-overview small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.month-summary > button { width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.salary-eye {
    width: 26px;
    height: 21px;
    display: block;
    margin: auto;
    overflow: visible;
}
.salary-eye-outline, .salary-eye-slash { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.salary-eye-pupil { fill: currentColor; }
.salary-eye-glint { fill: var(--surface-strong); }
.salary-eye-slash { opacity: 0; stroke-width: 2.4; }
.month-summary > button.is-hidden { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); }
.month-summary > button.is-hidden .salary-eye-slash { opacity: 1; }
.month-heading { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 10px; margin: 20px 0 14px; text-align: center; }
.month-heading h1 { margin: 0; font-size: 24px; }
.month-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.weekdays { margin-bottom: 6px; color: var(--muted); font-size: 10px; text-align: center; }
.calendar-day {
    position: relative;
    min-width: 0;
    min-height: 74px;
    display: grid;
    align-content: start;
    gap: 3px;
    padding: 7px 5px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    text-align: left;
}
.calendar-day.empty { visibility: hidden; }
.calendar-day.today { border-color: var(--today-color, var(--accent)); box-shadow: inset 0 0 0 1px var(--today-color, var(--accent)); }
.calendar-day.has-shift::after { content: ""; position: absolute; right: 5px; top: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--cell-color, var(--accent)); }
.calendar-day.has-note-icon::after { display: none; }
.calendar-note-icon { position: absolute; top: 4px; right: 4px; width: 13px; height: 13px; display: grid; place-items: center; }
.calendar-note-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.calendar-day .number { font-size: 13px; font-weight: 800; }
.calendar-day .time, .calendar-day .status, .calendar-day .department { overflow: hidden; color: var(--cell-color, var(--muted)); font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day .department { color: var(--accent); }
.calendar-day.has-published-assignment:not(.has-shift) { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.calendar-day.planned { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
#calendarScreen { touch-action: pan-y; }
.section-title { margin: 8px 0 18px; }
.section-title h1 { margin-bottom: 0; }
.stats-title { margin-bottom: 8px; }
.stats-heading { margin: 6px 0 10px; }
.stats-heading h2 { margin: 0; font-size: 18px; }
.stats-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.stats-scopes { margin-bottom: 12px; }
.stats-scopes button { min-width: 0; padding-inline: 4px; font-size: 11px; }
.stats-view-switcher { margin-bottom: 10px; }
.statistics-chart { margin-bottom: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; }
.statistics-chart-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.statistics-chart-header > div:first-child { min-width: 0; display: grid; gap: 5px; }
.statistics-chart-header span { color: var(--muted); font-size: 11px; }
.statistics-chart-header strong { font-size: 20px; }
.chart-metric-switcher { width: min(190px, 56%); min-height: 36px; }
.chart-metric-switcher button { min-height: 32px; padding: 5px 8px; font-size: 11px; }
.statistics-chart-canvas { width: 100%; min-height: 0; margin-top: 10px; }
.statistics-chart-canvas svg { width: 100%; height: auto; aspect-ratio: 640 / 240; display: block; overflow: visible; }
.statistics-chart-grid { stroke: var(--border-soft); stroke-width: 1; }
.statistics-chart-axis { fill: var(--muted); font-size: 12px; }
.statistics-chart-bar { fill: var(--accent); opacity: .86; }
.statistics-chart-empty { min-height: 176px; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.duration-chart-content { display: grid; grid-template-columns: minmax(120px, .9fr) minmax(140px, 1.1fr); align-items: center; gap: 16px; margin-top: 12px; }
.duration-chart-canvas { min-width: 0; }
.duration-chart-canvas svg { width: 100%; max-width: 180px; display: block; margin: auto; transform: rotate(-90deg); }
.duration-chart-canvas text { transform: rotate(90deg); transform-origin: 64px 64px; }
.duration-chart-track { stroke: var(--border-soft); }
.duration-chart-number { fill: var(--text); font-size: 25px; font-weight: 850; }
.duration-chart-caption { fill: var(--muted); font-size: 11px; }
.duration-chart-empty { min-height: 128px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.duration-chart-legend { display: grid; gap: 12px; min-width: 0; }
.duration-legend-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.duration-legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.duration-legend-row > span:nth-child(2) { color: var(--muted); font-size: 12px; line-height: 1.3; }
.duration-legend-row strong { font-size: 13px; }
.statistics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 8px; }
.stat-card { min-height: 108px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: 11px; }
.stat-card strong { display: block; margin: 10px 0 4px; overflow-wrap: anywhere; font-size: clamp(18px, 5.5vw, 24px); }
.stat-card.accent strong { color: var(--accent); }
.stat-card.green strong { color: var(--green); }
.stat-card.orange strong { color: var(--orange); }
.stat-card.purple strong { color: #b08bff; }
.stat-card.pink strong { color: var(--pink); }
.content-band, .profile-band { margin-top: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.content-band { padding: 16px; }
.content-band h2 { font-size: 17px; }
.content-band p:last-child { margin-bottom: 0; }
.compact-copy { margin-bottom: 10px; font-size: 12px; }
.profile-band { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile-band div:last-child { display: grid; gap: 3px; }
.profile-band span { color: var(--muted); font-size: 13px; }
.profile-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #06111d; font-weight: 850; }
.action-list { padding: 0; overflow: hidden; }
.action-list button, .action-list a { width: 100%; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; color: var(--text); text-align: left; text-decoration: none; }
.action-list :last-child { border-bottom: 0; }
.action-list span { display: grid; gap: 4px; }
.action-list small { color: var(--muted); font-size: 11px; }
#settingsScreen > .danger-button { width: 100%; margin-top: 18px; }
#settingsScreen > .logout-all-button { margin-top: 10px; border-color: var(--border); color: var(--muted); }
.version-line { margin: 18px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.settings-actions, .stacked-actions { display: grid; gap: 9px; }
.settings-actions .quiet-button { width: 100%; justify-content: space-between; }
.import-photo-button { text-align: left; }
.import-photo-button > span:first-child { display: grid; gap: 3px; }
.import-photo-button strong { font-size: 13px; }
.import-photo-button small { color: var(--muted); font-size: 10px; font-weight: 600; }
.compact-button { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.note-icon-button { width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 11px; text-align: left; }
.note-icon-button svg, .note-icon-option svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.note-icon-none { font-size: 25px; line-height: 1; }
.note-icon-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.note-icon-option { min-width: 0; min-height: 76px; display: grid; place-items: center; align-content: center; gap: 7px; padding: 8px 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--muted); }
.note-icon-option span:last-child { max-width: 100%; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.note-icon-option.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.day-details { display: grid; gap: 10px; padding-top: 4px; }
.day-details h3 { margin: 0; color: var(--muted); font-size: 13px; }
.coworker-list, .candidate-list, .history-list { display: grid; gap: 8px; }
.coworker-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.coworker-row:last-child { border-bottom: 0; }
.coworker-row strong { min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.coworker-row span { color: var(--accent); font-size: 11px; font-weight: 750; text-align: right; }
.published-department-section { padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.published-department-section p { margin: 0; color: var(--muted); font-size: 10px; }
.published-department-list { display: flex; flex-wrap: wrap; gap: 6px; }
.published-department-chip { padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--border)); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.candidate-row, .history-row { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.candidate-row span, .history-row span { color: var(--muted); font-size: 11px; }
.history-row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.history-row > div { min-width: 0; display: grid; gap: 4px; }
.history-row .quiet-button { min-height: 36px; padding: 7px 10px; font-size: 11px; }

.import-privacy-note, .import-warning-box, .import-preview-summary {
    display: grid;
    gap: 6px;
    padding: 13px;
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.import-privacy-note span, .import-preview-summary span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.import-model-note { margin-top: 2px; font-size: 11px; }
.import-progress-dialog .sheet { top: 50%; bottom: auto; transform: translateY(-50%); border-radius: 8px; }
.import-progress-dialog progress { width: 100%; height: 9px; accent-color: var(--accent); }
.import-tall-sheet { max-height: min(92dvh, 820px); overflow-y: auto; overscroll-behavior: contain; }
.import-warning-box { border-color: color-mix(in srgb, #f3af4b 68%, var(--border)); background: color-mix(in srgb, #f3af4b 10%, var(--surface)); }
.import-warning-box strong { color: #e8a73e; }
.import-warning-box ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.import-employee-list, .import-preview-list { display: grid; gap: 8px; }
.import-employee-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
}
.import-employee-row:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.import-employee-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.import-employee-row > span { display: grid; min-width: 0; gap: 3px; }
.import-employee-row small { color: var(--muted); }
.import-employee-row em { color: var(--accent); font-size: 10px; font-style: normal; font-weight: 800; text-align: right; }
.sticky-sheet-actions { position: sticky; bottom: -18px; z-index: 2; margin: 8px -18px -18px; padding: 12px 18px max(12px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface-strong) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.import-preview-summary .is-warning { color: #e8a73e; font-weight: 750; }
.import-preview-row { display: grid; gap: 9px; padding: 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.import-preview-row.is-uncertain { border-color: #d89b38; }
.import-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.import-preview-heading .icon-button { width: 32px; height: 32px; min-height: 32px; color: #ff858b; }
.import-preview-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.import-preview-fields input, .import-preview-fields select { min-width: 0; min-height: 42px; padding: 8px 9px; font-size: 12px; }
.import-preview-row > small { color: var(--muted); font-size: 10px; }

.report-card { display: grid; gap: 14px; }
.report-card h2 { margin: 0; }
.report-card .segmented { margin-top: 0; }
#reportOutput { min-height: 154px; line-height: 1.5; }
.report-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--border-soft);
}
.report-metrics div { min-width: 0; display: grid; gap: 5px; padding: 13px 8px; background: var(--surface-strong); text-align: center; }
.report-metrics strong { overflow-wrap: anywhere; color: var(--accent); font-size: 15px; }
.report-metrics span { color: var(--muted); font-size: 10px; }

.settings-stack { display: grid; gap: 10px; margin-top: 12px; }
.settings-group { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 4px; border-bottom: 1px solid var(--border-soft); }
.settings-heading h2 { margin: 0; font-size: 18px; }
.settings-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.color-grid { align-items: end; }
.color-grid input[type="color"], .color-settings input[type="color"] { min-height: 48px; padding: 5px; }
.color-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.settings-save-status { min-height: 18px; margin: 0; color: var(--muted); font-size: 12px; text-align: center; }
.settings-save-status.saving { color: var(--accent); }
.settings-save-status.saved { color: var(--green); }
.scenario-result { display: grid; gap: 5px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.scenario-result span { color: var(--accent); font-size: 20px; font-weight: 800; }
.scenario-result small { color: var(--muted); }

.bottom-nav {
    position: fixed;
    z-index: 30;
    right: max(12px, calc((100vw - 596px) / 2));
    bottom: calc(8px + var(--safe-bottom));
    left: max(12px, calc((100vw - 596px) / 2));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 28px;
    background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}
.bottom-nav button { min-width: 0; min-height: 52px; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; border-radius: 24px; background: transparent; color: var(--muted); font-size: 10px; }
.bottom-nav button span { font-size: 15px; }
.bottom-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 800; }

.sheet-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--text); }
.sheet-dialog::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    max-height: 92vh;
    max-height: 92dvh;
    display: grid;
    gap: 16px;
    overflow-y: auto;
    padding: 8px 18px calc(18px + var(--safe-bottom));
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(26px) saturate(130%);
    -webkit-backdrop-filter: blur(26px) saturate(130%);
    animation: sheet-up 210ms ease-out;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto; border-radius: 4px; background: var(--border); }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-heading h2, .sheet-heading p { margin-bottom: 0; }
.month-lock-sheet { gap: 13px; }
.month-lock-section { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.month-lock-section > div { display: grid; gap: 4px; }
.month-lock-section strong { font-size: 16px; }
.month-lock-section small { color: var(--muted); line-height: 1.4; }
.month-lock-section .quiet-button.is-locked { border-color: color-mix(in srgb, var(--accent) 54%, var(--border)); background: var(--accent-soft); color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.install-sheet { padding-bottom: calc(28px + var(--safe-bottom)); }
.install-steps { display: grid; gap: 12px; margin: 0; padding-left: 26px; line-height: 1.45; }
.toast { position: fixed; z-index: 100; right: 18px; bottom: calc(86px + var(--safe-bottom)); left: 18px; max-width: 460px; margin: auto; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-strong); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 390px) {
    .screen-stack { padding-inline: 10px; }
    .app-header { padding-inline: 10px; }
    .calendar-grid, .weekdays { gap: 3px; }
    .calendar-day { min-height: 68px; padding-inline: 4px; }
    .calendar-title-actions > span { font-size: 10px; }
    .month-summary { gap: 8px; padding-left: 11px; }
    .stat-card { min-height: 102px; padding: 12px 10px; }
    .stat-card strong { font-size: clamp(16px, 5.1vw, 20px); }
    .bottom-nav button { font-size: 9px; }
    .color-settings { grid-template-columns: 1fr; }
    .duration-chart-content { grid-template-columns: 118px minmax(0, 1fr); gap: 10px; }
    .note-icon-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .coworker-row { grid-template-columns: 1fr; gap: 3px; }
    .coworker-row span { text-align: left; }
}

@media (display-mode: standalone) {
    .mobile-app { min-height: 100dvh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

.report-metrics > [hidden] { display: none; }
