:root {
    --app-max-width: 820px;
    --app-safe-top: env(safe-area-inset-top, 0px);
    --app-safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-viewport-height: 100vh;
    --workspace-pad-top: 20px;
    --workspace-pad-x: clamp(10px, 2vw, 24px);
    --workspace-pad-bottom: calc(12px + var(--app-safe-bottom));
    --shell-gap: clamp(8px, 1.3vh, 14px);
    --bottom-bar-height: calc(72px + var(--app-safe-bottom));
    --bottom-tab-icon-size: 23px;
    --bottom-tab-label-size: 0.78rem;
    --page: #f5f6f2;
    --surface: #ffffff;
    --surface-strong: #eef3ef;
    --text: #1f2a26;
    --muted: #65726b;
    --border: #d9dfda;
    --primary: #146b5f;
    --primary-dark: #0f5349;
    --blue: #2f5f9b;
    --amber: #a16f1a;
    --red: #b34545;
    --red-dark: #943737;
    --shadow: 0 14px 38px rgba(31, 42, 38, 0.09);
    --calendar-surface: var(--surface);
    --calendar-cell: color-mix(in srgb, var(--surface-strong) 52%, transparent);
    --calendar-empty: transparent;
    --calendar-border: color-mix(in srgb, var(--border) 88%, var(--primary) 12%);
    --calendar-text: var(--text);
    --calendar-muted: var(--muted);
    --calendar-subtle: color-mix(in srgb, var(--muted) 78%, var(--text) 22%);
    --calendar-disabled: color-mix(in srgb, var(--muted) 62%, var(--surface) 38%);
    --calendar-hover: color-mix(in srgb, var(--primary) 8%, var(--surface));
    --calendar-control-bg: color-mix(in srgb, var(--surface) 90%, var(--primary) 10%);
    --calendar-control-hover: color-mix(in srgb, var(--primary) 14%, var(--surface) 86%);
    --calendar-control-border: var(--calendar-border);
    --calendar-control-text: var(--calendar-text);
    --calendar-today-bg: var(--primary);
    --calendar-today-text: #ffffff;
    --calendar-pending-soft-bg: color-mix(in srgb, var(--amber) 12%, transparent);
    --calendar-pending-bg: color-mix(in srgb, var(--amber) 40%, var(--surface) 60%);
    --calendar-pending-border: color-mix(in srgb, var(--amber) 78%, var(--surface) 22%);
    --calendar-pending-text: var(--calendar-text);
    --calendar-pending-dot: color-mix(in srgb, var(--primary) 70%, #d58ce3 30%);
    --calendar-preview-bg: color-mix(in srgb, var(--primary) 13%, transparent);
    --calendar-preview-border: color-mix(in srgb, var(--primary) 68%, transparent);
    --calendar-preview-border-soft: color-mix(in srgb, var(--primary) 38%, transparent);
    --calendar-preview-border-strong: color-mix(in srgb, var(--primary) 88%, transparent);
    --calendar-preview-shadow: color-mix(in srgb, var(--primary) 24%, transparent);
    --calendar-holiday: var(--red-dark);
    --calendar-full: var(--amber);
    --calendar-shadow: var(--shadow);
    --hierarchy-marker: color-mix(in srgb, var(--primary) 82%, var(--text) 18%);
    --hierarchy-marker-soft: color-mix(in srgb, var(--primary) 24%, transparent);
    --calendar-summary-bg: var(--surface);
    --calendar-summary-border: var(--calendar-border);
    --calendar-summary-text: var(--calendar-text);
}

:root[data-theme="forest"] {
    --page: linear-gradient(135deg, #e8f5ee 0%, #f4fbf7 46%, #d7efe6 100%);
    --surface: #ffffff;
    --surface-strong: #def4eb;
    --text: #152822;
    --muted: #60776c;
    --border: #cde4d9;
    --primary: #06a56b;
    --primary-dark: #08764f;
    --blue: #287c92;
    --amber: #98731a;
    --red: #b14d58;
    --red-dark: #843846;
    --shadow: 0 18px 42px rgba(8, 118, 79, 0.13);
}

:root[data-theme="sunset"] {
    --page: linear-gradient(135deg, #fff1e6 0%, #f8e7ff 48%, #e4efff 100%);
    --surface: rgba(255, 255, 255, 0.94);
    --surface-strong: #fff1f7;
    --text: #2e2330;
    --muted: #7b6478;
    --border: #ead8e4;
    --primary: #c4567b;
    --primary-dark: #954161;
    --blue: #5b6fb4;
    --amber: #b26c25;
    --red: #b9495a;
    --red-dark: #903644;
    --shadow: 0 18px 44px rgba(148, 65, 97, 0.16);
}

:root[data-theme="midnight"] {
    --page: radial-gradient(circle at top left, #234238 0%, #121a16 38%, #0b0f0d 100%);
    --surface: #171f1b;
    --surface-strong: #22302a;
    --text: #eef6f1;
    --muted: #a3b2aa;
    --border: #35453d;
    --primary: #21c77a;
    --primary-dark: #18a363;
    --blue: #6b91ff;
    --amber: #e0b24a;
    --red: #e87878;
    --red-dark: #ff9b9b;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.3);
}

:root[data-theme="paper"] {
    --page: #f7f3ea;
    --surface: #fffdf7;
    --surface-strong: #f2eadf;
    --text: #24211c;
    --muted: #746d61;
    --border: #ded4c4;
    --primary: #6f5c3f;
    --primary-dark: #4d412d;
    --blue: #57718d;
    --amber: #9a6b23;
    --red: #a34848;
    --red-dark: #823737;
    --shadow: 0 14px 34px rgba(77, 65, 45, 0.12);
}

:root[data-theme="ocean"] {
    --page: linear-gradient(135deg, #e7f5ff 0%, #f7fbff 46%, #dcecff 100%);
    --surface: #ffffff;
    --surface-strong: #e6f3ff;
    --text: #152536;
    --muted: #607082;
    --border: #cfe0ef;
    --primary: #1977f3;
    --primary-dark: #145fc4;
    --blue: #00a2ff;
    --amber: #a66f1c;
    --red: #b84b5d;
    --red-dark: #923848;
    --shadow: 0 18px 42px rgba(20, 95, 196, 0.14);
}

@supports (height: 100dvh) {
    :root {
        --app-viewport-height: 100dvh;
    }
}

html,
body {
    height: var(--app-viewport-height);
    min-height: var(--app-viewport-height);
    margin: 0;
    background: var(--page);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Segoe UI", "Noto Sans TC", Arial, sans-serif;
    overflow-x: hidden;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

a {
    color: var(--primary);
}

h1,
h2,
h3,
p {
    margin: 0;
}

.workspace {
    width: 100%;
    max-width: var(--app-max-width);
    min-height: var(--app-viewport-height);
    margin: 0 auto;
    padding: calc(var(--workspace-pad-top) + var(--app-safe-top)) var(--workspace-pad-x) var(--workspace-pad-bottom);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.workspace:not(.login-workspace) {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    overflow: hidden;
}

.login-workspace {
    --workspace-pad-bottom: calc(24px + var(--app-safe-bottom));
}

.app-shell {
    height: calc(var(--app-viewport-height) - var(--workspace-pad-top) - var(--workspace-pad-bottom) - var(--app-safe-top));
    min-height: 0;
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: var(--shell-gap);
    overflow: hidden;
}

.workspace.no-bottom-bar {
    --workspace-pad-bottom: calc(28px + var(--app-safe-bottom));
}

.workspace.no-bottom-bar .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
}

.login-surface {
    min-height: calc(var(--app-viewport-height) - var(--workspace-pad-top) - var(--workspace-pad-bottom) - var(--app-safe-top));
    display: grid;
    place-items: center;
    padding: 0;
}

.login-panel {
    position: relative;
    width: min(420px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
    display: grid;
    gap: 26px;
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    display: inline-grid;
    place-items: center;
    padding: 0;
    box-shadow: 0 8px 20px rgba(31, 42, 38, 0.08);
}

.icon-button:hover:not(:disabled) {
    background: var(--surface-strong);
}

.settings-entry,
.help-entry {
    flex: 0 0 auto;
}

.login-settings-entry {
    position: absolute;
    top: 24px;
    right: 24px;
}

.gear-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
}

.gear-icon::before {
    content: "⚙";
    font-size: 1.35rem;
    line-height: 1;
}

.help-icon {
    width: 24px;
    height: 24px;
    position: relative;
    display: grid;
    place-items: center;
}

.help-icon::before {
    content: "?";
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-panel h1,
.product-bar h1 {
    margin-top: 4px;
    font-size: 2rem;
    line-height: 1.15;
}

.login-form {
    display: grid;
    gap: 16px;
}

.setup-hint {
    color: var(--muted);
    font-weight: 700;
    line-height: 1.45;
}

.login-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

.login-label-text {
    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.2;
}

.login-label-text small {
    font-size: 0.78rem;
    font-weight: 700;
}

.login-form input,
.login-form select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    background: var(--surface);
}

.login-form select {
    min-height: 50px;
}

.product-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: clamp(6px, 1.2vw, 14px);
    min-width: 0;
    min-height: 0;
    margin-bottom: 0;
}

.product-brand {
    min-width: 0;
}

.product-brand h1 {
    overflow-wrap: anywhere;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin-top: 4px;
    font-size: 1.35rem;
}

.section-heading > span {
    color: var(--muted);
    font-size: 0.9rem;
}

.form-row {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 900;
}

.form-row input,
.form-row textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
    font-weight: 800;
}

.form-row input {
    min-height: 44px;
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.page-back-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 10px;
}

.login-back-row {
    margin-bottom: -12px;
}

.page-back-button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.86rem;
}

.mobile-version-panel {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.app-shell > .mobile-version-panel {
    margin-top: -6px;
    margin-bottom: 12px;
}

.mobile-version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.mobile-version-row strong {
    color: var(--text);
    font-size: 0.82rem;
}

.mobile-update-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    padding: 10px;
}

.mobile-update-card.required {
    border-color: color-mix(in srgb, #dc2626 44%, var(--border));
    background: color-mix(in srgb, #dc2626 10%, var(--surface));
}

.mobile-update-card div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.mobile-update-card strong {
    color: var(--text);
    font-size: 0.88rem;
}

.mobile-update-card span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.35;
}

.mobile-update-button {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.82rem;
}

.news-section {
    margin-bottom: 16px;
}

.standalone-news {
    margin-bottom: 0;
}

.news-carousel {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow: visible;
    padding-bottom: 0;
}

.news-pager {
    display: grid;
    gap: 10px;
}

.news-card {
    min-height: 176px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(31, 42, 38, 0.05);
    overflow: hidden;
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    touch-action: pan-y;
}

.news-nav {
    min-height: 38px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary-dark);
    font-weight: 800;
}

.news-nav:hover:not(:disabled) {
    background: var(--surface-strong);
}

.news-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-weight: 800;
}

.news-dots {
    display: flex;
    align-items: center;
    gap: 7px;
}

.news-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: #cfd8d2;
}

.news-dot.active {
    width: 24px;
    border-radius: 999px;
    background: var(--primary);
}

.news-media {
    min-height: 176px;
    display: grid;
    align-content: center;
    place-items: center;
    gap: 8px;
    color: #ffffff;
    font-weight: 800;
    text-align: center;
    padding: 16px;
}

.news-media.has-player {
    padding: 0;
    background: #10231f;
}

.news-video {
    width: 100%;
    height: 100%;
    min-height: 176px;
    display: block;
    object-fit: cover;
    background: #10231f;
}

.video-card {
    background:
        linear-gradient(135deg, rgba(12, 73, 60, 0.94), rgba(34, 136, 119, 0.86)),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.16), rgba(255,255,255,0.16) 3px, transparent 3px, transparent 26px);
}

.image-card {
    background:
        linear-gradient(135deg, rgba(47, 95, 155, 0.92), rgba(20, 107, 95, 0.72)),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.18), rgba(255,255,255,0.18) 8px, transparent 8px, transparent 16px);
}

.gif-card {
    background:
        radial-gradient(circle at 26% 24%, rgba(255, 255, 255, 0.28), transparent 24%),
        linear-gradient(135deg, #1977f3, #10a66a 52%, #f6b544);
}

.notice-card {
    background:
        linear-gradient(135deg, rgba(122, 88, 38, 0.96), rgba(233, 164, 46, 0.82)),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.18), rgba(255,255,255,0.18) 8px, transparent 8px, transparent 18px);
}

.ad-card {
    background:
        radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.22), transparent 23%),
        linear-gradient(135deg, #8a4c65, #c4567b 48%, #b36f45);
}

.news-media strong {
    font-size: 1.08rem;
    line-height: 1.2;
}

.news-media small {
    color: rgba(255, 255, 255, 0.84);
    font-size: 0.76rem;
}

.play-mark {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    position: relative;
    display: block;
}

.play-mark::after {
    content: "";
    position: absolute;
    left: 19px;
    top: 14px;
    border-left: 15px solid #ffffff;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.gif-mark {
    width: 58px;
    height: 42px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 5px;
}

.gif-mark span {
    border-radius: 999px 999px 6px 6px;
    background: rgba(255, 255, 255, 0.86);
    min-height: 18px;
    animation: gifPulse 1.1s ease-in-out infinite;
}

.gif-mark span:nth-child(2) {
    min-height: 34px;
    animation-delay: 0.16s;
}

.gif-mark span:nth-child(3) {
    min-height: 25px;
    animation-delay: 0.32s;
}

.notice-mark,
.ad-mark {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: grid;
    place-items: center;
    font-size: 1.65rem;
    line-height: 1;
}

@keyframes gifPulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.72;
    }

    50% {
        transform: translateY(-7px);
        opacity: 1;
    }
}

.news-copy {
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 18px;
}

.news-copy span {
    width: fit-content;
    border-radius: 999px;
    padding: 4px 9px;
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
}

.news-copy h3 {
    font-size: 1.12rem;
}

.news-copy p {
    color: var(--muted);
    line-height: 1.55;
}

.news-copy small {
    color: var(--primary);
    font-weight: 800;
}

.green-news {
    border-top: 4px solid var(--primary);
}

.blue-news {
    border-top: 4px solid var(--blue);
}

.amber-news {
    border-top: 4px solid var(--amber);
}

.rose-news {
    border-top: 4px solid var(--red);
}

.tab-content-area {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 1px;
}

.profile-area {
    flex: 1 1 min(360px, 100%);
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    text-align: right;
}

.profile-area .profile-summary {
    flex: 1 1 auto;
    display: grid;
    gap: 3px;
    min-width: 0;
}

.profile-name {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.92rem, 2.4vw, 1rem);
    line-height: 1.2;
}

.profile-area .profile-role-label {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.profile-area .profile-summary > span {
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.72rem, 2vw, 0.86rem);
    line-height: 1.25;
}

.profile-area .profile-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: clamp(5px, 1vw, 8px);
}

.top-back-button {
    flex: 0 0 auto;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    font-size: 0.84rem;
    font-weight: 800;
}

.top-back-button:hover:not(:disabled) {
    background: var(--surface-strong);
}

.top-back-icon {
    width: 13px;
    height: 13px;
    display: inline-grid;
    place-items: center;
}

.top-back-icon::before {
    content: "";
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}

.settings-section {
    width: 100%;
    display: grid;
    gap: 12px;
}

.settings-heading {
    margin-bottom: 0;
}

.settings-panel {
    display: grid;
    gap: 8px;
}

.settings-subheading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 900;
}

.settings-subheading span {
    color: var(--muted);
    font-size: 0.82rem;
    text-align: right;
}

.settings-theme-subheading {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.settings-auto-login-panel {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 16px;
}

.settings-checkbox-row {
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    font-weight: 900;
}

.settings-checkbox-row input {
    width: 21px;
    height: 21px;
    accent-color: var(--primary);
    flex: 0 0 auto;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.language-option {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: grid;
    gap: 2px;
    justify-items: start;
    padding: 9px 10px;
    text-align: left;
}

.language-option:hover,
.language-option.selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.language-option.selected {
    outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent);
}

.language-option strong,
.language-option small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.language-option strong {
    font-size: 0.92rem;
}

.language-option small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.theme-option {
    min-width: 0;
    min-height: 120px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: grid;
    grid-template-rows: 50px auto auto;
    gap: 5px;
    padding: 8px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(31, 42, 38, 0.05);
}

.theme-option:hover,
.theme-option.selected {
    border-color: var(--primary);
    box-shadow: 0 12px 24px rgba(31, 42, 38, 0.12);
}

.theme-option.selected {
    outline: 2px solid color-mix(in srgb, var(--primary) 42%, transparent);
}

.theme-option strong,
.theme-option small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.theme-option small {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.theme-preview {
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 6px;
    overflow: hidden;
}

.theme-preview span {
    border-radius: 5px;
    min-height: 16px;
}

.theme-preview span:first-child {
    grid-row: span 2;
}

.theme-classic-preview {
    background: #f5f6f2;
}

.theme-classic-preview span:first-child {
    background: #ffffff;
}

.theme-classic-preview span:nth-child(2) {
    background: #146b5f;
}

.theme-classic-preview span:nth-child(3) {
    background: #d9dfda;
}

.theme-forest-preview {
    background: linear-gradient(135deg, #e8f5ee, #d7efe6);
}

.theme-forest-preview span:first-child {
    background: #ffffff;
}

.theme-forest-preview span:nth-child(2) {
    background: #06a56b;
}

.theme-forest-preview span:nth-child(3) {
    background: #287c92;
}

.theme-sunset-preview {
    background: linear-gradient(135deg, #fff1e6, #f8e7ff, #e4efff);
}

.theme-sunset-preview span:first-child {
    background: #ffffff;
}

.theme-sunset-preview span:nth-child(2) {
    background: #c4567b;
}

.theme-sunset-preview span:nth-child(3) {
    background: #5b6fb4;
}

.theme-midnight-preview {
    background: radial-gradient(circle at top left, #234238, #0b0f0d);
}

.theme-midnight-preview span:first-child {
    background: #171f1b;
}

.theme-midnight-preview span:nth-child(2) {
    background: #21c77a;
}

.theme-midnight-preview span:nth-child(3) {
    background: #6b91ff;
}

.theme-paper-preview {
    background: #f7f3ea;
}

.theme-paper-preview span:first-child {
    background: #fffdf7;
}

.theme-paper-preview span:nth-child(2) {
    background: #6f5c3f;
}

.theme-paper-preview span:nth-child(3) {
    background: #ded4c4;
}

.theme-ocean-preview {
    background: linear-gradient(135deg, #e7f5ff, #dcecff);
}

.theme-ocean-preview span:first-child {
    background: #ffffff;
}

.theme-ocean-preview span:nth-child(2) {
    background: #1977f3;
}

.theme-ocean-preview span:nth-child(3) {
    background: #00a2ff;
}

.settings-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.settings-actions.single-action,
.profile-action-grid.single-action {
    grid-template-columns: 1fr;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
    margin-bottom: 10px;
}

.summary-strip > div {
    display: grid;
    gap: 4px;
    justify-items: center;
    align-content: center;
    background: var(--surface);
    padding: 10px 14px;
    text-align: center;
}

.summary-strip span {
    color: var(--muted);
    font-size: 0.86rem;
}

.summary-strip strong {
    font-size: 1.35rem;
    line-height: 1;
    text-align: center;
}

.summary-inline-button {
    min-height: 34px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary-dark);
    font-size: 0.84rem;
    font-weight: 900;
}

.summary-inline-button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

.summary-requirement-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    width: 100%;
}

.summary-requirement-actions .summary-inline-button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    white-space: nowrap;
}

.quantity-stepper {
    display: grid;
    grid-template-columns: 36px minmax(48px, 1fr) 36px;
    align-items: center;
    gap: 6px;
    width: min(156px, 100%);
}

.quantity-stepper button,
.quantity-stepper input {
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-align: center;
    font-weight: 700;
}

.quantity-stepper button:hover:not(:disabled) {
    background: var(--surface-strong);
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.reservation-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: -4px 0 12px;
}

.reservation-tools button {
    min-height: 42px;
    padding: 0 8px;
}

.reservation-tool-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.reservation-tool-button > span:last-child {
    min-width: 0;
    white-space: nowrap;
}

.reservation-tool-icon {
    position: relative;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    color: currentColor;
}

.month-reserve-icon,
.month-cancel-icon {
    border: 2px solid currentColor;
    border-radius: 5px;
}

.month-reserve-icon::before,
.month-reserve-icon::after,
.month-cancel-icon::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.month-reserve-icon::after {
    width: 2px;
    height: 9px;
}

.range-reserve-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    right: 3px;
    top: 8px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.range-reserve-icon::after {
    content: "";
    position: absolute;
    left: 1px;
    top: 5px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 9px 0 0 currentColor;
}

.range-selection-hint {
    margin: -4px 0 12px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.35;
}

.range-selection-hint.selected {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--text);
}

.calendar-panel,
.info-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 8px 22px rgba(31, 42, 38, 0.05);
}

.calendar-panel {
    padding: 18px;
    background: var(--calendar-surface);
    border-color: var(--calendar-border);
    color: var(--calendar-text);
    box-shadow: var(--calendar-shadow);
}

.calendar-toolbar {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 96px;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.calendar-toolbar h2 {
    text-align: center;
    font-size: 1.35rem;
}

.calendar-panel .calendar-toolbar h2 {
    color: var(--calendar-text);
}

.calendar-panel .ghost-action {
    background: var(--calendar-control-bg);
    border-color: var(--calendar-control-border);
    color: var(--calendar-control-text);
}

.calendar-panel .ghost-action:hover:not(:disabled) {
    background: var(--calendar-control-hover);
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
}

.calendar-weekdays {
    margin-bottom: 12px;
    color: var(--calendar-text);
    font-size: 0.98rem;
    font-weight: 700;
    text-align: center;
}

.calendar-weekdays span {
    padding: 0 4px;
}

.calendar-grid {
    overflow: hidden;
    border-top: 1px solid var(--calendar-border);
    border-left: 1px solid var(--calendar-border);
    border-radius: 8px;
}

.calendar-day,
.calendar-empty {
    min-width: 0;
    min-height: 76px;
    border-radius: 0;
    border-right: 1px solid var(--calendar-border);
    border-bottom: 1px solid var(--calendar-border);
}

.calendar-empty {
    background: var(--calendar-empty);
}

.calendar-day {
    background: var(--calendar-cell);
    color: var(--calendar-text);
    padding: 7px 4px;
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto;
    align-content: center;
    justify-items: center;
    gap: 1px;
    text-align: center;
    transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.calendar-day.requirement-mode {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: center;
    gap: 2px;
    padding: 5px 3px;
}

.calendar-day:hover {
    transform: translateY(-1px);
    background: var(--calendar-hover);
    box-shadow: none;
}

.calendar-day.selected {
    box-shadow: none;
}

.calendar-day.selected .day-number {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--calendar-today-bg);
    color: var(--calendar-today-text);
}

.calendar-day.range-start,
.calendar-day.range-selected,
.calendar-day.range-selected.pending-change,
.calendar-day.range-selected.action-preview {
    animation: none;
    background: var(--calendar-pending-bg);
    color: var(--calendar-pending-text);
    box-shadow: inset 0 0 0 3px var(--calendar-pending-border), 0 0 14px color-mix(in srgb, var(--amber) 24%, transparent);
}

.calendar-day.range-start .day-number,
.calendar-day.range-selected .day-number,
.calendar-day.selected.range-selected .day-number {
    width: auto;
    height: auto;
    min-width: 28px;
    min-height: 24px;
    border-radius: 0;
    display: block;
    place-items: initial;
    background: transparent;
    color: var(--calendar-pending-text);
}

.calendar-day.pending-change {
    background: var(--calendar-pending-soft-bg);
}

.calendar-day.action-preview {
    animation: actionPreviewPulse 1.05s ease-in-out infinite;
    background: var(--calendar-preview-bg);
    box-shadow: inset 0 0 0 2px var(--calendar-preview-border);
}

@keyframes actionPreviewPulse {
    0%,
    100% {
        box-shadow: inset 0 0 0 2px var(--calendar-preview-border-soft);
    }

    50% {
        box-shadow: inset 0 0 0 3px var(--calendar-preview-border-strong), 0 0 14px var(--calendar-preview-shadow);
    }
}

.calendar-day.pending-change .day-number::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--calendar-pending-dot);
    position: absolute;
    transform: translate(16px, -12px);
}

.meal-requirement-marker {
    position: absolute;
    left: 5px;
    top: 5px;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--blue);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 18%, transparent);
}

.meal-requirement-marker::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 3px;
    height: 3px;
    border-radius: inherit;
    background: #ffffff;
}

.day-number {
    position: relative;
    min-width: 28px;
    min-height: 24px;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1;
}

.day-status {
    min-height: 1.05em;
    font-size: 0.83rem;
    font-weight: 500;
    line-height: 1.05;
    word-break: keep-all;
}

.day-count {
    min-height: 1em;
    color: var(--calendar-subtle);
    font-size: 0.72rem;
    line-height: 1;
    white-space: nowrap;
}

.day-requirement-summary {
    color: var(--primary) !important;
    display: -webkit-box;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
    font-size: 0.66rem;
    line-height: 1.12;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.calendar-day.available {
    color: var(--calendar-text);
}

.calendar-day.reserved {
    color: var(--calendar-text);
}

.calendar-day.reserved .day-status,
.calendar-day.reserved .day-count {
    color: var(--calendar-subtle);
}

.calendar-day.closed,
.calendar-day.expired {
    color: var(--calendar-disabled);
}

.calendar-day.closed .day-status,
.calendar-day.closed .day-count,
.calendar-day.expired .day-status,
.calendar-day.expired .day-count {
    color: var(--calendar-disabled);
}

.calendar-day.closed:hover,
.calendar-day.expired:hover {
    transform: none;
    background: var(--calendar-cell);
    cursor: default;
}

.calendar-day.holiday {
    color: var(--calendar-holiday);
}

.calendar-day.holiday .day-status,
.calendar-day.holiday .day-count {
    color: var(--calendar-holiday);
}

.calendar-day.holiday.expired-past .day-status {
    color: var(--calendar-holiday);
}

.calendar-day.holiday.expired-past .day-count {
    color: var(--calendar-disabled);
}

.calendar-day.full {
    color: var(--calendar-full);
}

.calendar-day.range-start,
.calendar-day.range-selected,
.calendar-day.range-start .day-status,
.calendar-day.range-start .day-count,
.calendar-day.range-selected .day-status,
.calendar-day.range-selected .day-count {
    color: var(--calendar-pending-text);
}

.pending-actions {
    margin: 12px 0 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--calendar-summary-border);
    border-radius: 8px;
    background: var(--calendar-summary-bg);
    box-shadow: 0 8px 22px rgba(31, 42, 38, 0.08);
}

.pending-actions span {
    color: var(--calendar-summary-text);
    font-weight: 700;
}

.pending-actions div {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pending-actions .ghost-action {
    background: var(--calendar-control-bg);
    border-color: var(--calendar-control-border);
    color: var(--calendar-control-text);
}

.pending-actions .ghost-action:hover:not(:disabled) {
    background: var(--calendar-control-hover);
}

.lunch-message {
    margin-top: 12px;
}

.detail-panel {
    padding: 18px;
    position: sticky;
    top: 16px;
}

.info-panel {
    padding: 18px;
}

.detail-heading,
.admin-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.detail-heading {
    margin-bottom: 16px;
}

.detail-heading h2 {
    margin-top: 4px;
    font-size: 1.45rem;
}

.status-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-pill.available {
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary-dark);
}

.status-pill.reserved {
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
    color: var(--primary-dark);
}

.status-pill.closed {
    background: var(--surface-strong);
    color: var(--text);
}

.status-pill.holiday {
    background: color-mix(in srgb, var(--red) 14%, var(--surface));
    color: var(--red-dark);
}

.status-pill.full {
    background: color-mix(in srgb, var(--amber) 18%, var(--surface));
    color: var(--amber);
}

.detail-list {
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--border);
    margin: 0 0 16px;
}

.detail-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--surface);
    padding: 13px;
}

.detail-list dt {
    color: var(--muted);
}

.detail-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.profile-list {
    margin-bottom: 0;
}

.profile-list dd {
    word-break: break-word;
}

.profile-edit-row {
    align-items: stretch;
}

.profile-edit-row dd {
    flex: 1;
    min-width: 0;
}

.profile-edit-input,
.password-change-panel input {
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 8px 11px;
    font-weight: 700;
    text-align: right;
    outline: none;
}

.password-change-panel input {
    text-align: left;
}

.profile-edit-input:focus,
.password-change-panel input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

.profile-action-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.profile-password-button {
    width: 100%;
    margin-top: 10px;
}

.password-change-panel {
    display: grid;
    gap: 14px;
}

.password-change-panel label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 700;
}

.roster-panel {
    display: grid;
    gap: 14px;
}

.admin-panel {
    display: grid;
    gap: 16px;
}

.admin-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.admin-menu-tile {
    min-height: 132px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--text);
    padding: 16px 14px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 10px;
    text-align: center;
    box-shadow: 0 10px 24px rgba(31, 42, 38, 0.07);
}

.admin-menu-tile:not(:disabled):hover {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

.admin-menu-tile strong {
    font-size: 1.08rem;
    font-weight: 900;
}

.admin-menu-tile small {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
}

.admin-menu-tile.disabled {
    opacity: 0.78;
}

.admin-menu-icon {
    width: 34px;
    height: 34px;
    position: relative;
    display: block;
    color: var(--primary);
}

.holiday-maintenance-panel {
    display: grid;
    gap: 14px;
}

.holiday-maintenance-toolbar {
    display: grid;
    grid-template-columns: minmax(86px, 1fr) minmax(0, 1.4fr) minmax(86px, 1fr);
    align-items: center;
    gap: 10px;
}

.holiday-maintenance-toolbar h3 {
    color: var(--text);
    font-size: 1.18rem;
    font-weight: 900;
    text-align: center;
}

.holiday-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0 10px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.legend-item::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--muted);
}

.legend-item.holiday::before {
    background: var(--red);
}

.legend-item.workday::before {
    background: var(--primary);
}

.legend-item.default-day::before {
    background: var(--border);
}

.holiday-maintenance-layout {
    display: block;
}

.holiday-calendar-card,
.holiday-editor-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-strong);
    overflow: hidden;
}

.holiday-calendar-weekdays,
.holiday-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.holiday-calendar-weekdays {
    gap: 0;
    border-bottom: 1px solid var(--border);
}

.holiday-calendar-weekdays span {
    min-height: 34px;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
}

.holiday-calendar-grid {
    border-left: 1px solid var(--border);
}

.holiday-maintenance-day {
    min-width: 0;
    min-height: 76px;
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    padding: 7px 4px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    text-align: center;
}

.holiday-maintenance-day.empty {
    background: color-mix(in srgb, var(--surface-strong) 58%, transparent);
}

.holiday-maintenance-day strong {
    font-size: 1.06rem;
    font-weight: 900;
    line-height: 1;
}

.holiday-maintenance-day span,
.holiday-maintenance-day small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.68rem;
    font-weight: 900;
}

.holiday-maintenance-day small {
    color: inherit;
    opacity: 0.82;
}

.holiday-maintenance-day.default-holiday,
.holiday-maintenance-day.holiday {
    color: var(--red-dark);
}

.holiday-maintenance-day.workday {
    color: var(--primary-dark);
}

.holiday-maintenance-day.configured {
    background: color-mix(in srgb, var(--primary) 9%, var(--surface));
}

.holiday-maintenance-day.holiday.configured {
    background: color-mix(in srgb, var(--red) 12%, var(--surface));
}

.holiday-maintenance-day.workday.configured {
    background: color-mix(in srgb, var(--primary) 16%, var(--surface));
}

.holiday-maintenance-day.expired {
    cursor: not-allowed;
    background: color-mix(in srgb, var(--surface-strong) 68%, var(--surface));
    color: color-mix(in srgb, var(--muted) 76%, var(--text));
    opacity: 0.58;
}

.holiday-maintenance-day.selected {
    position: relative;
    z-index: 1;
    outline: 3px solid color-mix(in srgb, var(--primary) 46%, transparent);
    outline-offset: -3px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 62%, transparent);
}

.holiday-maintenance-day:not(:disabled):hover {
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
}

.holiday-editor-card {
    display: grid;
    gap: 14px;
    padding: 14px;
}

.holiday-editor-empty {
    color: var(--muted);
    font-weight: 800;
    line-height: 1.45;
}

.holiday-editor-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.holiday-editor-heading div {
    display: grid;
    gap: 4px;
}

.holiday-editor-heading span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.holiday-editor-heading strong {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 900;
}

.holiday-kind-pill {
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 5px 9px;
    background: var(--surface);
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    white-space: nowrap;
}

.holiday-kind-pill.holiday,
.holiday-kind-pill.default-holiday {
    color: var(--red-dark);
    border-color: color-mix(in srgb, var(--red) 34%, var(--border));
}

.holiday-kind-pill.workday {
    color: var(--primary-dark);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}

.holiday-kind-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.holiday-editor-dialog {
    width: min(500px, 100%);
}

.holiday-kind-button {
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0 9px;
    font-size: 0.78rem;
    font-weight: 900;
}

.holiday-kind-button.active {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 13%, var(--surface));
    color: var(--primary-dark);
}

.holiday-name-row {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 900;
}

.holiday-name-row input {
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0 12px;
    font-weight: 800;
}

.holiday-updated-meta {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.4;
}

.holiday-editor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.roster-heading {
    align-items: center;
}

.roster-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
}

.roster-add-button {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.88rem;
    white-space: nowrap;
}

.roster-department-list {
    display: grid;
    gap: 10px;
}

.roster-department {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.roster-department-toggle {
    width: 100%;
    min-height: 54px;
    border: 0;
    background: var(--surface);
    color: var(--text);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22px;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-align: left;
}

.roster-department-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-inline-start: calc(var(--department-level, 0) * 10px);
    white-space: nowrap;
}

.roster-department-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}

.roster-department-level-1 .roster-department-name {
    padding-inline-start: 22px;
    font-size: 1.06rem;
}

.roster-department-level-1 .roster-department-name::before {
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hierarchy-marker);
    box-shadow: 0 0 0 3px var(--hierarchy-marker-soft);
}

.roster-department-level-2 .roster-department-name {
    padding-inline-start: 26px;
    font-size: 0.96rem;
}

.roster-department-level-2 .roster-department-name::before {
    left: 0;
    width: 21px;
    height: 9px;
    background-image:
        radial-gradient(circle at 5px 50%, var(--hierarchy-marker) 0 3.9px, transparent 4.1px),
        radial-gradient(circle at 16px 50%, var(--hierarchy-marker) 0 3.9px, transparent 4.1px);
}

.roster-department-level-3 .roster-department-name {
    padding-inline-start: 29px;
    font-size: 0.88rem;
}

.roster-department-level-3 .roster-department-name::before {
    left: 0;
    width: 25px;
    height: 7px;
    background-image:
        radial-gradient(circle at 4px 50%, var(--hierarchy-marker) 0 3px, transparent 3.2px),
        radial-gradient(circle at 13px 50%, var(--hierarchy-marker) 0 3px, transparent 3.2px),
        radial-gradient(circle at 22px 50%, var(--hierarchy-marker) 0 3px, transparent 3.2px);
}

.roster-department-level-4 .roster-department-name {
    padding-inline-start: 31px;
    font-size: 0.82rem;
}

.roster-department-level-4 .roster-department-name::before {
    left: 0;
    width: 28px;
    height: 6px;
    background-image:
        radial-gradient(circle at 3px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px),
        radial-gradient(circle at 10px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px),
        radial-gradient(circle at 17px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px),
        radial-gradient(circle at 24px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px);
}

.roster-department-title span {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 800;
}

.roster-department-level-1 .roster-department-title span {
    font-size: 1rem;
}

.roster-department-level-2 .roster-department-title span {
    font-size: 0.92rem;
}

.roster-department-level-3 .roster-department-title span,
.roster-department-level-4 .roster-department-title span {
    font-size: 0.84rem;
}

.roster-department-toggle .expand-icon {
    justify-self: end;
    grid-area: auto;
}

.roster-empty {
    margin: 0;
    padding: 14px 18px;
    color: var(--muted);
    font-weight: 700;
    background: var(--surface-strong);
}

.roster-employee-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface-strong);
}

.roster-employee-table th,
.roster-employee-table td {
    border-top: 1px solid var(--border);
    padding: 11px 12px;
    color: var(--text);
    text-align: left;
    vertical-align: middle;
}

.roster-employee-table th {
    color: var(--muted);
    font-weight: 900;
}

.roster-employee-table td {
    font-weight: 800;
}

.roster-employee-table th:nth-child(3),
.roster-employee-table td:nth-child(3) {
    text-align: left;
    white-space: nowrap;
}

.roster-employee-table th:nth-child(4),
.roster-employee-table td:nth-child(4) {
    min-width: 76px;
    text-align: left;
    white-space: normal;
}

.roster-employee-table th:nth-child(5),
.roster-employee-table td:nth-child(5) {
    text-align: right;
    white-space: nowrap;
}

.roster-name-button {
    border: 0;
    border-radius: 5px;
    padding: 2px 5px;
    background: color-mix(in srgb, var(--primary) 13%, transparent);
    color: var(--primary);
    font: inherit;
    font-weight: 900;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    touch-action: manipulation;
}

.roster-name-button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
}

.roster-name-button:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 28%, transparent);
    outline-offset: 3px;
    border-radius: 4px;
}

.roster-badge {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    margin-left: 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary-dark);
    padding: 0 7px;
    font-size: 0.68rem;
    font-weight: 900;
    vertical-align: middle;
}

.roster-edit-form {
    display: grid;
    gap: 12px;
}

.roster-edit-list {
    margin-bottom: 0;
}

.roster-edit-control {
    appearance: auto;
}

.roster-toggle-row dd {
    display: flex;
    justify-content: flex-end;
}

.toggle-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 900;
}

.toggle-field input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.action-row {
    display: grid;
    margin-bottom: 12px;
}

.primary-action,
.secondary-action,
.danger-action,
.ghost-action {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.primary-action {
    background: var(--primary);
    color: #ffffff;
}

.primary-action:hover:not(:disabled) {
    background: var(--primary-dark);
}

.danger-action {
    background: var(--red);
    color: #ffffff;
}

.danger-action:hover:not(:disabled) {
    background: var(--red-dark);
}

.secondary-action,
.ghost-action {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.secondary-action:hover,
.ghost-action:hover:not(:disabled) {
    background: var(--surface-strong);
}

.login-visitor-entry {
    display: flex;
    align-items: center;
    margin-top: -4px;
}

.login-visitor-entry .secondary-action {
    min-height: 34px;
    padding-inline: 12px;
    font-size: 0.9rem;
    font-weight: 800;
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(31, 42, 38, 0.58);
}

.confirm-dialog {
    width: min(420px, 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 64px rgba(31, 42, 38, 0.28);
    padding: 22px;
    display: grid;
    gap: 16px;
}

.confirm-dialog h2 {
    font-size: 1.18rem;
    line-height: 1.35;
    text-align: center;
}

.help-dialog {
    width: min(520px, 100%);
}

.meal-requirement-dialog {
    width: min(560px, 100%);
    max-height: min(760px, calc(var(--app-viewport-height) - 40px - var(--app-safe-top) - var(--app-safe-bottom)));
    overflow: auto;
}

.visitor-scanner-dialog {
    width: min(440px, 100%);
}

.visitor-scanner-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #050807;
}

.visitor-scanner-frame video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.visitor-scanner-corners {
    position: absolute;
    inset: 18%;
    border: 3px solid color-mix(in srgb, var(--primary) 86%, #ffffff 14%);
    border-radius: 12px;
    box-shadow:
        0 0 0 999px rgba(0, 0, 0, 0.22),
        0 0 18px color-mix(in srgb, var(--primary) 36%, transparent);
    pointer-events: none;
}

.visitor-scanner-form {
    display: grid;
    gap: 10px;
}

.visitor-scanner-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-weight: 900;
}

.visitor-scanner-form input {
    width: 100%;
}

.help-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.help-dialog-heading h2 {
    text-align: left;
}

.help-close-button {
    flex: 0 0 auto;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.help-section {
    display: grid;
    gap: 6px;
}

.help-section h3 {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 900;
}

.help-section p,
.help-section li {
    color: var(--text);
    font-weight: 700;
    line-height: 1.55;
}

.help-section ol {
    margin: 0;
    padding-left: 22px;
}

.requirement-section {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.requirement-section h3 {
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 900;
}

.requirement-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.requirement-section-heading h3 {
    margin: 0;
}

.requirement-help-button {
    width: 34px;
    height: 34px;
    min-height: 34px;
    box-shadow: none;
    font-size: 1rem;
    font-weight: 900;
}

.requirement-choice-grid,
.requirement-option-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.requirement-choice,
.requirement-option {
    min-width: 0;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    font-weight: 800;
    line-height: 1.25;
}

.requirement-choice input,
.requirement-option input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    accent-color: var(--primary);
}

.requirement-choice:has(input:checked),
.requirement-option:has(input:checked) {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, var(--surface));
    color: var(--primary-dark);
}

.requirement-option.disabled {
    color: var(--muted);
    opacity: 0.58;
}

.requirement-calendar-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    gap: 8px;
}

.requirement-calendar-heading strong {
    font-size: 1rem;
    white-space: nowrap;
}

.requirement-calendar-heading span {
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.68rem, 2vw, 0.82rem);
    font-weight: 800;
    line-height: 1.35;
}

.inner-dialog-backdrop {
    z-index: 90;
}

.meal-requirement-help-dialog {
    width: min(460px, 100%);
}

.requirement-calendar-weekdays,
.requirement-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.requirement-calendar-weekdays {
    gap: 4px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-align: center;
}

.requirement-calendar-grid {
    overflow: hidden;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-radius: 8px;
}

.requirement-calendar-day,
.requirement-calendar-empty {
    min-height: 54px;
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.requirement-calendar-empty {
    background: color-mix(in srgb, var(--surface-strong) 42%, transparent);
}

.requirement-calendar-day {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 2px;
    padding: 5px 2px;
    background: var(--surface);
    color: var(--text);
    font-weight: 900;
}

.requirement-calendar-day.has-requirement {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: center;
    gap: 1px;
    padding: 4px 2px;
}

.requirement-calendar-day small {
    min-height: 1em;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.requirement-calendar-day .requirement-calendar-summary {
    color: var(--primary);
    display: -webkit-box;
    max-width: 100%;
    min-height: 0;
    overflow: hidden;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: anywhere;
    line-height: 1.08;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.requirement-calendar-day.selectable {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    color: var(--text);
}

.requirement-calendar-day.selectable:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}

.requirement-calendar-day.in-range {
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
}

.requirement-calendar-day.range-edge {
    background: var(--primary);
    color: #ffffff;
}

.requirement-calendar-day.range-edge small {
    color: color-mix(in srgb, #ffffff 84%, transparent);
}

.requirement-calendar-day.range-edge .requirement-calendar-summary {
    color: #ffffff;
}

.requirement-calendar-day.disabled {
    background: color-mix(in srgb, var(--surface-strong) 48%, transparent);
    color: color-mix(in srgb, var(--muted) 70%, transparent);
    cursor: default;
}

.requirement-date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.requirement-date-grid label,
.requirement-note,
.requirement-select-field {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 900;
}

.requirement-date-grid input,
.requirement-select-field select,
.requirement-note textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
    font: inherit;
    font-weight: 700;
}

.requirement-select-field select {
    min-height: 44px;
}

.pickup-group-summary {
    color: var(--muted);
    font-weight: 900;
}

.pickup-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.pickup-heading-actions span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.pickup-add-button {
    min-height: 36px;
    padding: 0 13px;
    font-size: 0.86rem;
    white-space: nowrap;
}

.pickup-group-list {
    display: grid;
    gap: 8px;
}

.pickup-group-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.pickup-group-item div {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.pickup-group-item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pickup-group-name-button {
    width: fit-content;
    max-width: 100%;
    border: 0;
    border-radius: 5px;
    padding: 2px 5px;
    background: color-mix(in srgb, var(--primary) 13%, transparent);
    color: var(--primary);
    font: inherit;
    font-weight: 900;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pickup-group-name-button:hover:not(:disabled) {
    background: color-mix(in srgb, var(--primary) 22%, transparent);
}

.pickup-group-item span,
.pickup-group-item small {
    color: var(--muted);
    font-weight: 800;
}

.pickup-group-item small {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    white-space: nowrap;
}

.visitor-invite-button {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.78rem;
}

.visitor-visit-item {
    align-items: start;
}

.visitor-visit-item div {
    gap: 4px;
}

.visitor-visit-item span,
.visitor-visit-item .pickup-group-name-button {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.visitor-visit-item span {
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.visitor-visit-item small {
    align-self: center;
}

.pickup-group-inactive {
    border-radius: 999px;
    background: color-mix(in srgb, var(--red) 12%, var(--surface));
    color: var(--red-dark);
    padding: 2px 6px;
    font-size: 0.72rem;
    font-weight: 900;
}

.pickup-group-editor-dialog {
    width: min(520px, 100%);
    max-height: min(760px, calc(var(--app-viewport-height) - 40px - var(--app-safe-top) - var(--app-safe-bottom)));
    overflow: auto;
    align-content: start;
    overscroll-behavior: contain;
}

.visitor-invite-dialog {
    width: min(520px, 100%);
    max-height: min(760px, calc(var(--app-viewport-height) - 40px - var(--app-safe-top) - var(--app-safe-bottom)));
    overflow: auto;
    align-content: start;
    overscroll-behavior: contain;
}

.visitor-qr-box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(410px, 100%);
    aspect-ratio: 1;
    justify-self: center;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.visitor-qr-box svg {
    display: block;
    width: 100%;
    max-width: 380px;
    height: auto;
}

.visitor-invite-code {
    display: grid;
    gap: 4px;
    text-align: center;
}

.visitor-invite-code span {
    color: var(--muted);
    font-weight: 800;
}

.visitor-invite-code strong {
    color: var(--text);
    font-size: 1.8rem;
    letter-spacing: 0.08em;
}

.visitor-invite-revoked {
    border: 1px solid color-mix(in srgb, var(--red) 36%, var(--border));
    border-radius: 8px;
    background: color-mix(in srgb, var(--red) 14%, var(--surface));
    color: var(--red-dark);
    padding: 18px;
    text-align: center;
    font-weight: 900;
    line-height: 1.45;
}

.visitor-invite-meta {
    display: grid;
    gap: 8px;
    margin: 0;
}

.visitor-invite-meta div {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.visitor-invite-meta dt {
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}

.visitor-invite-meta dd {
    margin: 0;
    min-width: 0;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visitor-invite-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    gap: 10px;
    margin: 0 -2px -2px;
    padding-top: 10px;
    padding-bottom: 2px;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--surface) 0%, transparent),
        var(--surface) 34%
    );
}

.pickup-group-edit-form {
    display: grid;
    gap: 12px;
}

.pickup-group-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pickup-group-active-toggle {
    align-self: end;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 0 12px;
}

.requirement-note textarea {
    resize: vertical;
    min-height: 86px;
}

.dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pickup-group-editor-dialog .dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin: 0 -2px -2px;
    padding-top: 10px;
    background: linear-gradient(
        to bottom,
        color-mix(in srgb, var(--surface) 0%, transparent),
        var(--surface) 34%
    );
}

.message {
    border-radius: 8px;
    padding: 11px 12px;
    font-weight: 700;
}

.message.success {
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary-dark);
}

.message.error {
    background: color-mix(in srgb, var(--red) 14%, var(--surface));
    color: var(--red-dark);
}

.admin-panel {
    border-top: 1px solid var(--border);
    margin-top: 18px;
    padding-top: 18px;
}

.admin-heading {
    margin-bottom: 12px;
}

.admin-heading h3 {
    font-size: 1.05rem;
}

.reservation-list {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.reservation-row {
    display: grid;
    gap: 3px;
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
}

.reservation-row:last-child {
    border-bottom: 0;
}

.reservation-row span,
.muted {
    color: var(--muted);
}

.loading-block {
    min-height: 280px;
    display: grid;
    place-items: center;
    color: var(--muted);
}

.stats-toolbar {
    margin-bottom: 16px;
}

.stats-title {
    display: grid;
    gap: 2px;
    line-height: 1.18;
}

.stats-title-main,
.stats-title-sub {
    display: block;
}

.stats-title-sub {
    color: var(--muted);
    font-size: 0.72em;
    font-weight: 800;
}

.stats-company-line {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--surface-strong);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stats-company-name {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.stats-company-name span {
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.stats-company-name strong {
    font-size: 1.08rem;
    color: var(--text);
    overflow-wrap: anywhere;
}

.stats-filter-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--text);
    font-weight: 800;
    white-space: nowrap;
}

.stats-filter-toggle input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.stats-filter-toggle span {
    color: var(--text);
}

.daily-stats-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.daily-stats-empty {
    padding: 18px 16px;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.daily-stats-row + .daily-stats-row {
    border-top: 1px solid var(--border);
}

.daily-stats-toggle {
    width: 100%;
    min-height: 64px;
    border: 0;
    background: var(--surface);
    color: var(--text);
    display: grid;
    grid-template-columns: 20px 128px 78px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-align: left;
}

.daily-stats-toggle:hover {
    background: var(--surface-strong);
}

.daily-stats-row.holiday .daily-stats-toggle,
.daily-stats-row.holiday .daily-stats-date,
.daily-stats-row.holiday .daily-stats-weekday,
.daily-stats-row.holiday .daily-stats-metric {
    color: var(--red-dark);
}

.expand-icon {
    width: 20px;
    height: 20px;
    color: var(--muted);
    display: grid;
    place-items: center;
}

.expand-icon::before {
    content: "";
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 120ms ease;
}

.expand-icon.expanded::before {
    transform: rotate(45deg);
}

.daily-stats-date,
.daily-stats-weekday {
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}

.daily-stats-metric {
    justify-self: end;
    font-size: 1rem;
    text-align: right;
    white-space: nowrap;
}

.stats-metric-number {
    color: var(--primary);
    font-size: 1.12em;
    font-weight: 900;
    padding: 0 2px;
}

.daily-departments {
    display: grid;
    gap: 2px;
    padding: 0 16px 14px 64px;
    background: var(--surface-strong);
    color: var(--text);
}

.daily-departments-table {
    width: 100%;
    border-collapse: collapse;
}

.daily-department-row td {
    color: var(--text);
    font-weight: 800;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.daily-department-name {
    width: auto;
    padding-right: 8px;
    white-space: nowrap;
}

.department-hierarchy-name {
    position: relative;
    display: inline-block;
    line-height: 1.25;
    white-space: nowrap;
}

.department-hierarchy-name::before {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-repeat: no-repeat;
    pointer-events: none;
}

.daily-department-row.department-level-1 .department-hierarchy-name {
    padding-inline-start: 22px;
    font-size: 0.92rem;
}

.daily-department-row.department-level-1 .department-hierarchy-name::before {
    left: 0;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--hierarchy-marker);
    box-shadow: 0 0 0 3px var(--hierarchy-marker-soft);
}

.daily-department-row.department-level-2 .department-hierarchy-name {
    padding-inline-start: 26px;
    font-size: 0.84rem;
}

.daily-department-row.department-level-2 .department-hierarchy-name::before {
    left: 0;
    width: 21px;
    height: 9px;
    background-image:
        radial-gradient(circle at 5px 50%, var(--hierarchy-marker) 0 3.9px, transparent 4.1px),
        radial-gradient(circle at 16px 50%, var(--hierarchy-marker) 0 3.9px, transparent 4.1px);
}

.daily-department-row.department-level-3 .department-hierarchy-name {
    padding-inline-start: 29px;
    font-size: 0.76rem;
}

.daily-department-row.department-level-3 .department-hierarchy-name::before {
    left: 0;
    width: 25px;
    height: 7px;
    background-image:
        radial-gradient(circle at 4px 50%, var(--hierarchy-marker) 0 3px, transparent 3.2px),
        radial-gradient(circle at 13px 50%, var(--hierarchy-marker) 0 3px, transparent 3.2px),
        radial-gradient(circle at 22px 50%, var(--hierarchy-marker) 0 3px, transparent 3.2px);
}

.daily-department-row.department-level-4 .department-hierarchy-name {
    padding-inline-start: 31px;
    font-size: 0.72rem;
}

.daily-department-row.department-level-4 .department-hierarchy-name::before {
    left: 0;
    width: 28px;
    height: 6px;
    background-image:
        radial-gradient(circle at 3px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px),
        radial-gradient(circle at 10px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px),
        radial-gradient(circle at 17px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px),
        radial-gradient(circle at 24px 50%, var(--hierarchy-marker) 0 2.4px, transparent 2.6px);
}

.daily-department-action {
    width: 66px;
    text-align: right;
    padding-left: 4px;
    padding-right: 8px;
}

.detail-link-button {
    min-height: 32px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 44%, var(--border));
    background: color-mix(in srgb, var(--primary) 13%, var(--surface));
    color: var(--primary);
    padding: 0 10px;
    font-weight: 900;
}

.detail-link-button:hover:not(:disabled) {
    background: var(--primary);
    color: #ffffff;
}

.daily-department-metric {
    width: 116px;
    text-align: right;
    white-space: nowrap;
    font-size: 0.9rem;
}

.daily-department-metric .stats-metric-number {
    color: var(--primary);
}

.stats-detail-heading {
    display: block;
    margin-bottom: 14px;
}

.stats-detail-heading h2 {
    font-size: 1.45rem;
    line-height: 1.18;
}

.stats-detail-heading span {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 3px;
}

.stats-detail-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
}

.stats-detail-summary div {
    display: grid;
    gap: 4px;
    padding: 13px;
    background: var(--surface);
    text-align: center;
}

.stats-detail-summary div + div {
    border-left: 1px solid var(--border);
}

.stats-detail-summary span {
    color: var(--muted);
    font-weight: 800;
}

.stats-detail-summary strong {
    color: var(--primary);
    font-size: 1.55rem;
}

.reservation-detail-table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.reservation-detail-table th,
.reservation-detail-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.reservation-detail-table th {
    color: var(--muted);
    background: var(--surface-strong);
    font-weight: 900;
}

.reservation-detail-table td {
    color: var(--text);
    font-weight: 800;
}

.detail-employee-no,
.detail-employee-name,
.detail-meal-count,
.detail-meal-requirement {
    display: inline-block;
}

.detail-employee-no {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.detail-employee-name {
    word-break: keep-all;
    overflow-wrap: normal;
    line-height: 1.35;
}

.detail-meal-count {
    min-width: 1.4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.detail-meal-requirement {
    max-width: 20rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.reservation-detail-table th:last-child,
.reservation-detail-table td:last-child {
    text-align: right;
}

.reservation-detail-table tbody tr:last-child td {
    border-bottom: 0;
}

.bottom-bar {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    box-sizing: border-box;
    transform: none;
    height: var(--bottom-bar-height);
    min-height: 0;
    max-height: var(--bottom-bar-height);
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 4px;
    margin-top: 0;
    padding: 6px 6px calc(6px + var(--app-safe-bottom));
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    box-shadow: 0 16px 42px rgba(31, 42, 38, 0.18);
    backdrop-filter: blur(12px);
    overflow: hidden;
}

.bottom-bar.admin {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bottom-tab {
    min-width: 0;
    min-height: 0;
    height: 100%;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    display: grid;
    grid-template-rows: var(--bottom-tab-icon-size) minmax(0, 1fr);
    align-items: center;
    justify-items: center;
    gap: 4px;
    padding: 4px 2px;
    font-size: var(--bottom-tab-label-size);
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.bottom-tab span:last-child {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bottom-tab.active {
    background: var(--surface-strong);
    color: var(--primary);
}

.tab-icon {
    width: var(--bottom-tab-icon-size);
    height: var(--bottom-tab-icon-size);
    position: relative;
    display: block;
}

.news-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 4px;
    width: 17px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.news-icon::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    width: 9px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.lunch-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    right: 4px;
    top: 7px;
    height: 10px;
    border: 2px solid currentColor;
    border-radius: 2px 2px 7px 7px;
}

.lunch-icon::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: 3px;
    height: 2px;
    border-top: 2px solid currentColor;
    box-shadow: 0 4px 0 currentColor;
}

.profile-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 9px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.profile-icon::after {
    content: "";
    position: absolute;
    left: 4px;
    bottom: 2px;
    width: 15px;
    height: 9px;
    border: 2px solid currentColor;
    border-radius: 10px 10px 3px 3px;
}

.stats-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    bottom: 3px;
    width: 3px;
    height: 8px;
    background: currentColor;
    box-shadow: 6px -5px 0 currentColor, 12px -2px 0 currentColor;
    border-radius: 2px 2px 0 0;
}

.stats-icon::after {
    content: "";
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 1px;
    border-bottom: 2px solid currentColor;
}

.admin-icon::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 6px;
    height: 6px;
    border: 2px solid currentColor;
    border-radius: 3px;
    box-shadow: 9px 0 0 -1px currentColor, 0 9px 0 -1px currentColor, 9px 9px 0 -1px currentColor;
}

.admin-icon::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 7px;
    height: 7px;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.admin-menu-icon.stats-icon::before {
    left: 7px;
    bottom: 6px;
    width: 5px;
    height: 12px;
    box-shadow: 8px -7px 0 currentColor, 16px -3px 0 currentColor;
}

.admin-menu-icon.stats-icon::after {
    left: 4px;
    right: 4px;
    bottom: 3px;
    border-bottom-width: 3px;
}

.roster-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 4px;
    width: 17px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 3px;
}

.roster-icon::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 8px;
    width: 9px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 4px 0 currentColor, 0 8px 0 currentColor;
}

.admin-menu-icon.roster-icon::before {
    left: 5px;
    top: 7px;
    width: 24px;
    height: 22px;
}

.admin-menu-icon.roster-icon::after {
    left: 11px;
    top: 13px;
    width: 12px;
    height: 2px;
    box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor;
}

.admin-menu-icon.holiday-icon::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 7px;
    width: 24px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 5px;
}

.admin-menu-icon.holiday-icon::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 14px;
    height: 2px;
    background: currentColor;
    box-shadow: 0 6px 0 currentColor;
}

.admin-menu-icon.pickup-icon::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 12px;
    width: 24px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 4px;
}

.admin-menu-icon.pickup-icon::after {
    content: "";
    position: absolute;
    left: 11px;
    top: 6px;
    width: 10px;
    height: 10px;
    border-left: 2px solid currentColor;
    border-top: 2px solid currentColor;
    transform: rotate(45deg);
}

.admin-menu-icon.prep-icon::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    top: 11px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 3px 3px 10px 10px;
}

.admin-menu-icon.prep-icon::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: 5px;
    height: 2px;
    border-top: 2px solid currentColor;
    box-shadow: 0 5px 0 currentColor;
}

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(31, 42, 38, 0.18);
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #d6ddd8;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: 700;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading");
}

@media (max-width: 920px) {
    .main-grid {
        grid-template-columns: 1fr;
    }

    .holiday-maintenance-layout {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        position: static;
    }
}

@media (max-width: 640px) {
    .workspace {
        width: 100%;
        --workspace-pad-top: 8px;
        --workspace-pad-x: 6px;
        --workspace-pad-bottom: calc(6px + var(--app-safe-bottom));
        --shell-gap: 7px;
        --bottom-bar-height: calc(72px + var(--app-safe-bottom));
        --bottom-tab-icon-size: 21px;
        --bottom-tab-label-size: clamp(0.62rem, 2.3vw, 0.72rem);
    }

    .workspace.no-bottom-bar {
        --workspace-pad-bottom: calc(16px + var(--app-safe-bottom));
    }

    .login-workspace {
        --workspace-pad-top: 10px;
        --workspace-pad-x: 14px;
        --workspace-pad-bottom: calc(14px + var(--app-safe-bottom));
    }

    .product-bar,
    .profile-area {
        align-items: flex-start;
    }

    .product-bar {
        flex-direction: column;
    }

    .product-brand {
        display: none;
    }

    .profile-area {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }

    .profile-area .profile-actions {
        justify-content: flex-end;
    }

    .login-settings-entry {
        top: 18px;
        right: 18px;
    }

    .theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: clamp(8px, 1.2vh, 12px);
    }

    .theme-option {
        min-height: clamp(118px, 17vh, 148px);
        padding: 8px;
        grid-template-rows: clamp(46px, 7vh, 58px) auto auto;
    }

    .theme-option strong {
        font-size: 0.9rem;
    }

    .theme-option small {
        font-size: 0.72rem;
    }

    .summary-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-bottom: 8px;
    }

    .summary-strip > div {
        min-height: 58px;
        gap: 3px;
        padding: 7px 6px;
    }

    .summary-strip span {
        font-size: 0.72rem;
        line-height: 1.05;
        white-space: nowrap;
    }

    .summary-strip strong {
        font-size: 1.28rem;
    }

    .summary-inline-button {
        min-height: 30px;
        padding: 0 6px;
        font-size: 0.74rem;
    }

    .summary-requirement-actions {
        gap: 4px;
    }

    .summary-requirement-actions .summary-inline-button {
        padding: 0 5px;
        font-size: 0.7rem;
        min-width: 0;
    }

    .news-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .news-media {
        min-height: 188px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .pickup-heading-actions {
        flex-wrap: wrap;
    }

    .pickup-group-field-grid {
        grid-template-columns: 1fr;
    }

    .admin-menu-grid {
        gap: 10px;
    }

    .admin-menu-tile {
        min-height: 118px;
        padding: 13px 10px;
    }

    .admin-menu-tile strong {
        font-size: 0.98rem;
    }

    .holiday-maintenance-toolbar {
        grid-template-columns: 82px minmax(0, 1fr) 82px;
        gap: 8px;
    }

    .holiday-maintenance-toolbar h3 {
        font-size: 1rem;
    }

    .holiday-legend {
        gap: 6px;
    }

    .legend-item {
        min-height: 25px;
        padding: 0 8px;
        font-size: 0.68rem;
    }

    .holiday-calendar-weekdays span {
        min-height: 30px;
        font-size: 0.74rem;
    }

    .holiday-maintenance-day {
        min-height: 58px;
        padding: 5px 2px;
    }

    .holiday-maintenance-day strong {
        font-size: 0.9rem;
    }

    .holiday-maintenance-day span,
    .holiday-maintenance-day small {
        font-size: 0.56rem;
        line-height: 1.12;
    }

    .holiday-editor-card {
        padding: 12px;
    }

    .holiday-kind-options {
        gap: 6px;
    }

    .holiday-kind-button {
        min-height: 38px;
        padding: 0 6px;
        font-size: 0.7rem;
    }

    .holiday-editor-actions {
        gap: 8px;
    }

    .roster-heading {
        align-items: flex-end;
        gap: 8px;
    }

    .roster-heading-actions {
        gap: 7px;
        font-size: 0.78rem;
    }

    .roster-add-button {
        min-height: 32px;
        padding: 0 10px;
        font-size: 0.78rem;
    }

    .mobile-update-card {
        grid-template-columns: 1fr;
    }

    .mobile-update-button {
        width: 100%;
    }

    .detail-panel,
    .info-panel,
    .login-panel {
        padding: 14px;
    }

    .calendar-panel {
        margin-left: 0;
        margin-right: 0;
        padding: 12px 0 14px;
    }

    .calendar-toolbar {
        grid-template-columns: 74px minmax(0, 1fr) 74px;
        gap: 8px;
        margin: 0 14px 14px;
    }

    .calendar-toolbar h2 {
        font-size: 1.08rem;
    }

    .calendar-weekdays {
        gap: 0;
        margin-bottom: 8px;
        font-size: 0.86rem;
    }

    .calendar-grid {
        gap: 0;
        border-radius: 0;
    }

    .calendar-day,
    .calendar-empty {
        min-height: 68px;
        border-radius: 0;
    }

    .calendar-day {
        padding: 5px 2px;
    }

    .calendar-day.requirement-mode {
        padding: 4px 2px;
        gap: 1px;
    }

    .calendar-day.selected .day-number {
        width: 30px;
        height: 30px;
    }

    .calendar-day.pending-change .day-number::after {
        width: 5px;
        height: 5px;
        transform: translate(13px, -10px);
    }

    .day-number {
        min-width: 24px;
        min-height: 20px;
        font-size: 0.98rem;
    }

    .pending-actions {
        grid-template-columns: 1fr;
    }

    .pending-actions div {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dialog-backdrop {
        align-items: end;
        padding: 18px;
    }

    .confirm-dialog {
        padding: 18px;
    }

    .pickup-group-editor-dialog {
        max-height: calc(var(--app-viewport-height) - 36px - var(--app-safe-top) - var(--app-safe-bottom));
    }

    .visitor-invite-dialog {
        max-height: calc(var(--app-viewport-height) - 36px - var(--app-safe-top) - var(--app-safe-bottom));
    }

    .meal-requirement-dialog {
        max-height: calc(var(--app-viewport-height) - 36px - var(--app-safe-top) - var(--app-safe-bottom));
    }

    .requirement-choice-grid,
    .requirement-option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .requirement-choice,
    .requirement-option {
        min-height: 38px;
        padding: 8px;
        gap: 6px;
        font-size: 0.82rem;
    }

    .requirement-date-grid {
        grid-template-columns: 1fr;
    }

    .requirement-calendar-day,
    .requirement-calendar-empty {
        min-height: 46px;
    }

    .requirement-calendar-day {
        padding: 4px 1px;
        font-size: 0.86rem;
    }

    .requirement-calendar-day.has-requirement {
        padding: 3px 1px;
    }

    .requirement-calendar-day small {
        font-size: 0.54rem;
    }

    .requirement-calendar-day .requirement-calendar-summary {
        font-size: 0.5rem;
        line-height: 1.05;
    }

    .day-status {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    .day-count {
        font-size: 0.62rem;
    }

    .day-requirement-summary {
        font-size: 0.55rem;
        line-height: 1.08;
    }

    .meal-requirement-marker {
        left: 3px;
        top: 3px;
        width: 8px;
        height: 8px;
    }

    .primary-action,
    .secondary-action,
    .danger-action,
    .ghost-action,
    .top-back-button {
        min-height: 40px;
        padding: 0 10px;
        font-size: 0.9rem;
    }

    .top-back-button {
        min-height: 40px;
        font-size: 0.84rem;
    }

    .bottom-bar {
        height: var(--bottom-bar-height);
        max-height: var(--bottom-bar-height);
        padding: 5px 6px calc(8px + var(--app-safe-bottom));
    }

    .bottom-tab {
        font-size: var(--bottom-tab-label-size);
    }

    .daily-stats-toggle {
        grid-template-columns: 20px minmax(0, 1fr) auto;
        grid-template-areas:
            "icon date weekday"
            ". metric metric";
        gap: 4px 8px;
        padding: 12px 14px;
    }

    .expand-icon {
        grid-area: icon;
    }

    .daily-stats-date {
        grid-area: date;
    }

    .daily-stats-weekday {
        grid-area: weekday;
    }

    .daily-stats-metric {
        grid-area: metric;
        justify-self: start;
        text-align: left;
        font-size: 0.94rem;
    }

    .stats-metric-number {
        padding: 0 1px;
    }

    .daily-departments {
        padding: 0 10px 12px 22px;
    }

    .daily-department-row td {
        padding: 12px 0;
    }

    .daily-department-name {
        width: auto;
        padding-right: 5px;
    }

    .daily-department-action {
        width: 46px;
        padding-left: 2px;
        padding-right: 5px;
        text-align: right;
    }

    .detail-link-button {
        min-height: 28px;
        padding: 0 7px;
        font-size: 0.7rem;
    }

    .daily-department-metric {
        width: 86px;
        font-size: 0.76rem;
    }

    .daily-department-row.department-level-1 .department-hierarchy-name {
        padding-inline-start: 19px;
        font-size: 0.84rem;
    }

    .daily-department-row.department-level-1 .department-hierarchy-name::before {
        width: 12px;
        height: 12px;
    }

    .daily-department-row.department-level-2 .department-hierarchy-name {
        padding-inline-start: 23px;
        font-size: 0.76rem;
    }

    .daily-department-row.department-level-2 .department-hierarchy-name::before {
        width: 19px;
        height: 8px;
        background-image:
            radial-gradient(circle at 4px 50%, var(--hierarchy-marker) 0 3.4px, transparent 3.6px),
            radial-gradient(circle at 14px 50%, var(--hierarchy-marker) 0 3.4px, transparent 3.6px);
    }

    .daily-department-row.department-level-3 .department-hierarchy-name {
        padding-inline-start: 26px;
        font-size: 0.7rem;
    }

    .daily-department-row.department-level-3 .department-hierarchy-name::before {
        width: 23px;
        height: 6px;
        background-image:
            radial-gradient(circle at 3px 50%, var(--hierarchy-marker) 0 2.7px, transparent 2.9px),
            radial-gradient(circle at 12px 50%, var(--hierarchy-marker) 0 2.7px, transparent 2.9px),
            radial-gradient(circle at 20px 50%, var(--hierarchy-marker) 0 2.7px, transparent 2.9px);
    }

    .daily-department-row.department-level-4 .department-hierarchy-name {
        padding-inline-start: 28px;
        font-size: 0.66rem;
    }

    .daily-department-row.department-level-4 .department-hierarchy-name::before {
        width: 25px;
        height: 5px;
        background-image:
            radial-gradient(circle at 2px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px),
            radial-gradient(circle at 9px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px),
            radial-gradient(circle at 16px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px),
            radial-gradient(circle at 23px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px);
    }

    .roster-department-toggle {
        min-height: 48px;
        padding: 10px 11px;
    }

    .roster-department-title {
        gap: 7px;
        padding-inline-start: calc(var(--department-level, 0) * 8px);
    }

    .roster-department-level-1 .roster-department-name {
        padding-inline-start: 19px;
        font-size: 0.98rem;
    }

    .roster-department-level-1 .roster-department-name::before {
        width: 12px;
        height: 12px;
    }

    .roster-department-level-2 .roster-department-name {
        padding-inline-start: 23px;
        font-size: 0.9rem;
    }

    .roster-department-level-2 .roster-department-name::before {
        width: 19px;
        height: 8px;
        background-image:
            radial-gradient(circle at 4px 50%, var(--hierarchy-marker) 0 3.4px, transparent 3.6px),
            radial-gradient(circle at 14px 50%, var(--hierarchy-marker) 0 3.4px, transparent 3.6px);
    }

    .roster-department-level-3 .roster-department-name {
        padding-inline-start: 26px;
        font-size: 0.82rem;
    }

    .roster-department-level-3 .roster-department-name::before {
        width: 23px;
        height: 6px;
        background-image:
            radial-gradient(circle at 3px 50%, var(--hierarchy-marker) 0 2.7px, transparent 2.9px),
            radial-gradient(circle at 12px 50%, var(--hierarchy-marker) 0 2.7px, transparent 2.9px),
            radial-gradient(circle at 20px 50%, var(--hierarchy-marker) 0 2.7px, transparent 2.9px);
    }

    .roster-department-level-4 .roster-department-name {
        padding-inline-start: 28px;
        font-size: 0.76rem;
    }

    .roster-department-level-4 .roster-department-name::before {
        width: 25px;
        height: 5px;
        background-image:
            radial-gradient(circle at 2px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px),
            radial-gradient(circle at 9px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px),
            radial-gradient(circle at 16px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px),
            radial-gradient(circle at 23px 50%, var(--hierarchy-marker) 0 2.2px, transparent 2.4px);
    }

    .roster-employee-table th,
    .roster-employee-table td {
        padding: 9px 5px;
        font-size: 0.78rem;
        line-height: 1.2;
    }

    .roster-employee-table th:nth-child(5),
    .roster-employee-table td:nth-child(5) {
        display: none;
    }

    .roster-employee-table th:nth-child(1),
    .roster-employee-table td:nth-child(1) {
        width: 45px;
    }

    .roster-employee-table th:nth-child(3),
    .roster-employee-table td:nth-child(3) {
        font-size: 0.72rem;
    }

    .roster-employee-table th:nth-child(4),
    .roster-employee-table td:nth-child(4) {
        width: 72px;
        font-size: 0.72rem;
        line-height: 1.25;
    }

    .roster-badge {
        margin-left: 0;
        margin-top: 4px;
        width: fit-content;
    }

    .stats-detail-heading {
        grid-template-columns: 1fr;
    }

    .stats-detail-heading .ghost-action {
        justify-self: stretch;
    }

    .reservation-detail-table {
        display: block;
        border-collapse: separate;
        background: transparent;
    }

    .reservation-detail-table thead {
        display: none;
    }

    .reservation-detail-table tbody {
        display: grid;
        background: var(--surface);
    }

    .reservation-detail-table tr {
        display: grid;
        grid-template-columns: minmax(64px, 0.85fr) minmax(112px, 1.35fr) minmax(40px, 0.42fr);
        grid-template-areas:
            "employeeNo employeeName mealCount"
            "requirement requirement requirement";
        align-items: center;
        gap: 7px 10px;
        padding: 12px;
        border-bottom: 1px solid var(--border);
    }

    .reservation-detail-table tbody tr:last-child {
        border-bottom: 0;
    }

    .reservation-detail-table th,
    .reservation-detail-table td,
    .reservation-detail-table th:last-child,
    .reservation-detail-table td:last-child {
        display: block;
        padding: 0;
        border-bottom: 0;
        text-align: left;
    }

    .reservation-detail-table td:nth-child(1) {
        grid-area: employeeNo;
    }

    .reservation-detail-table td:nth-child(2) {
        grid-area: employeeName;
    }

    .reservation-detail-table td:nth-child(3) {
        grid-area: mealCount;
        justify-self: end;
    }

    .reservation-detail-table td:nth-child(4) {
        grid-area: requirement;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: 8px;
        padding-top: 8px;
        border-top: 1px dashed var(--border);
    }

    .reservation-detail-table td:nth-child(4)::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 900;
        line-height: 1.45;
        white-space: nowrap;
    }

    .detail-employee-no {
        font-size: 0.82rem;
        line-height: 1.2;
    }

    .detail-employee-name {
        font-size: 0.92rem;
        line-height: 1.25;
    }

    .detail-meal-count {
        min-width: 30px;
        border-radius: 999px;
        background: color-mix(in srgb, var(--primary) 14%, transparent);
        color: var(--primary);
        padding: 3px 8px;
        font-size: 0.86rem;
        font-weight: 900;
    }

    .detail-meal-requirement {
        max-width: none;
        justify-self: end;
        text-align: right;
        font-size: 0.84rem;
        line-height: 1.45;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }
}
