/* Canteen only. Semantic colors follow the existing body[data-theme] setting. */
.canteen-page {
    --ct-text: #111827; --ct-muted: #526176; --ct-line: #e2e8f0; --ct-surface: #fff;
    --ct-navy: #0b1729; --ct-blue: #2563eb; --ct-green: #166534; --ct-red: #991b1b;
    --ct-primary-bg: #0b1729; --ct-on-primary: #fff; --ct-primary-hover: #24344b;
    --ct-control-text: #334155; --ct-input-border: #cbd5e1; --ct-control-border: #94a3b8;
    --ct-tab-hover: #e9eef5; --ct-subtle-bg: #f1f5f9; --ct-pressed-bg: #e2e8f0;
    --ct-placeholder: #64748b; --ct-disabled-bg: #f8fafc; --ct-separator: #edf0f4;
    --ct-selected-bg: #f1f5fa; --ct-selected-border: #5b718d; --ct-link: #1d4ed8;
    --ct-success-bg: #edf7ef; --ct-feedback-bg: #f0f8f3; --ct-success-border: #86b49a;
    --ct-warning: #92400e; --ct-warning-bg: #fff7ed; --ct-warning-border: #d9a76a;
    --ct-danger-bg: #fff1f2; --ct-danger-border: #e9bfc3; --ct-error-border: #d5a0a5;
    --ct-skeleton: #edf1f5; --ct-backdrop: rgba(11, 23, 41, .38);
    color-scheme: light;
    color: var(--ct-text); font-size: 14px; line-height: 1.5; container-type: inline-size;
}
body[data-theme="dark"] .canteen-page {
    --ct-text: #e8eef7; --ct-muted: #aab9cd; --ct-line: #334155; --ct-surface: #152033;
    --ct-navy: #f1f5f9; --ct-blue: #93c5fd; --ct-green: #87dfad; --ct-red: #ffb4bd;
    --ct-primary-bg: #2563eb; --ct-on-primary: #fff; --ct-primary-hover: #1d4ed8;
    --ct-control-text: #d5dfed; --ct-input-border: #5f728c; --ct-control-border: #7f94b0;
    --ct-tab-hover: #223149; --ct-subtle-bg: #1d2b40; --ct-pressed-bg: #2b3d56;
    --ct-placeholder: #a3b2c7; --ct-disabled-bg: #192438; --ct-separator: #2a394e;
    --ct-selected-bg: #213852; --ct-selected-border: #7baadd; --ct-link: #93c5fd;
    --ct-success-bg: #14372b; --ct-feedback-bg: #14372b; --ct-success-border: #388965;
    --ct-warning: #f6cc83; --ct-warning-bg: #3a2b18; --ct-warning-border: #b48743;
    --ct-danger-bg: #40212b; --ct-danger-border: #b97682; --ct-error-border: #a45666;
    --ct-skeleton: #27364b; --ct-backdrop: rgba(0, 0, 0, .65);
    color-scheme: dark;
}

.canteen-page *, .canteen-page *::before, .canteen-page *::after { box-sizing: border-box; }
.canteen-page [hidden] { display: none; }
.canteen-page button, .canteen-page input, .canteen-page textarea { font: inherit; }
.canteen-page button { cursor: pointer; }
.canteen-page button:disabled { cursor: not-allowed; }
.canteen-page :is(button, input, textarea, summary, [tabindex="0"]):focus-visible { outline: 3px solid var(--ct-blue); outline-offset: 3px; }
.canteen-page h1, .canteen-page h2, .canteen-page h3, .canteen-page p { margin: 0; }
.canteen-page .canteen-header { display: flex; align-items: center; margin-bottom: 24px; }
.canteen-page .canteen-header h1 { color: var(--ct-navy); font-size: 32px; line-height: 1.2; font-weight: 650; letter-spacing: -.8px; }
.canteen-page .canteen-header p { color: var(--ct-muted); margin-top: 8px; font-size: 14px; }
.canteen-page .canteen-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ct-line); margin-bottom: 24px; flex-wrap: wrap; }
.canteen-page .canteen-tab { border: 0; border-bottom: 2px solid transparent; border-radius: 4px 4px 0 0; background: transparent; color: var(--ct-muted); font-size: 14px; font-weight: 500; min-height: 44px; padding: 8px 16px; }
.canteen-page .canteen-tab:hover { background: var(--ct-tab-hover); color: var(--ct-navy); }
.canteen-page .canteen-tab.active { border-bottom-color: var(--ct-navy); color: var(--ct-navy); font-weight: 600; }
.canteen-page .canteen-feedback { color: var(--ct-green); font-size: 13px; }
.canteen-page .canteen-feedback:not(:empty) { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--ct-success-border); background: var(--ct-feedback-bg); border-radius: 0 6px 6px 0; }
.canteen-page .canteen-week-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.canteen-page .canteen-week-banner { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.canteen-page .canteen-week-banner strong { font-size: 18px; font-weight: 600; letter-spacing: -.25px; }
.canteen-page .canteen-week-banner > span { color: var(--ct-muted); font-size: 12px; }
.canteen-page .canteen-week-selector { display: flex; align-items: center; gap: 4px; }
.canteen-page .canteen-week-select { background: var(--ct-surface); color: var(--ct-text); border: 1px solid var(--ct-line); border-radius: 7px; height: 40px; padding: 6px 8px; max-width: 168px; }
.canteen-page .canteen-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--ct-input-border); border-radius: 7px; background: var(--ct-surface); color: var(--ct-control-text); font-size: 13px; font-weight: 500; text-decoration: none; white-space: normal; line-height: 1.4; }
.canteen-page .canteen-button:hover:not(:disabled) { border-color: var(--ct-control-border); background: var(--ct-subtle-bg); }
.canteen-page .canteen-button:active:not(:disabled) { background: var(--ct-pressed-bg); }
.canteen-page .canteen-button.is-primary { background: var(--ct-primary-bg); color: var(--ct-on-primary); border-color: var(--ct-primary-bg); }
.canteen-page .canteen-button.is-primary:hover:not(:disabled) { background: var(--ct-primary-hover); }
.canteen-page .canteen-button.is-danger { color: var(--ct-red); }
.canteen-page .canteen-button.is-danger:hover:not(:disabled) { background: var(--ct-danger-bg); border-color: var(--ct-danger-border); }
.canteen-page .canteen-button:disabled { background: var(--ct-subtle-bg); color: var(--ct-placeholder); border-color: var(--ct-line); }
.canteen-page .canteen-icon-button { width: 40px; padding: 8px; flex: 0 0 40px; }
.canteen-page .canteen-icon { width: 16px; height: 16px; flex: 0 0 16px; vertical-align: middle; }
.canteen-page .canteen-admin-control { margin-bottom: 20px; border-block: 1px solid var(--ct-line); font-size: 13px; }
.canteen-page .canteen-admin-control summary { display: flex; gap: 8px; align-items: center; padding: 12px 0; cursor: pointer; list-style: none; min-height: 44px; }
.canteen-page summary::-webkit-details-marker { display: none; }
.canteen-page .canteen-admin-control summary > .canteen-icon:last-child { margin-left: auto; }
.canteen-page .canteen-admin-control[open] summary > .canteen-icon:last-child { transform: rotate(90deg); }
.canteen-page .canteen-admin-state { color: var(--ct-muted); border-left: 1px solid var(--ct-input-border); padding-left: 12px; margin-left: 4px; }
.canteen-page .is-manual { color: var(--ct-warning); }
.canteen-page .canteen-admin-body { padding: 0 0 16px 24px; }
.canteen-page .canteen-admin-body p { color: var(--ct-muted); max-width: 760px; margin-bottom: 12px; }
.canteen-page .canteen-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.canteen-page .canteen-day-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.canteen-page .canteen-day-card { min-width: 0; border: 1px solid var(--ct-line); border-radius: 12px; background: var(--ct-surface); padding: 16px; overflow-wrap: anywhere; }
.canteen-page .canteen-day-card-header { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 20px; }
.canteen-page .canteen-day-card-header h3 { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.2px; }
.canteen-page .canteen-day-date { color: var(--ct-muted); font-size: 12px; display: block; margin-top: 4px; }
.canteen-page .canteen-badge { display: inline-flex; align-items: center; font-size: 12px; font-weight: 500; line-height: 1.4; padding: 3px 7px; border-radius: 5px; }
.canteen-page .canteen-badge.open { color: var(--ct-green); background: var(--ct-success-bg); }
.canteen-page .canteen-badge.closed { color: var(--ct-red); background: var(--ct-danger-bg); }
.canteen-page .canteen-badge.neutral { color: var(--ct-muted); background: var(--ct-subtle-bg); }
.canteen-page .canteen-menu-box > span, .canteen-page .canteen-choice-title { display: block; color: var(--ct-muted); font-size: 12px; font-weight: 500; margin-bottom: 8px; }
.canteen-page .canteen-menu-box p { font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.canteen-page .canteen-menu-box p.is-empty { color: var(--ct-muted); font-style: italic; font-size: 13px; }
.canteen-page .canteen-choice-box { border-top: 1px solid var(--ct-separator); margin-top: 20px; padding-top: 16px; }
.canteen-page .canteen-choice-actions { display: grid; gap: 6px; }
.canteen-page .canteen-choice-btn { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--ct-line); border-radius: 7px; background: var(--ct-surface); min-height: 40px; padding: 8px 10px; color: var(--ct-control-text); font-size: 13px; font-weight: 500; }
.canteen-page .canteen-choice-btn:hover:not(:disabled) { border-color: var(--ct-control-border); background: var(--ct-disabled-bg); }
.canteen-page .canteen-choice-btn.active { border-color: var(--ct-selected-border); background: var(--ct-selected-bg); color: var(--ct-navy); }
.canteen-page .canteen-choice-mark { display: flex; justify-content: center; align-items: center; width: 16px; height: 16px; border: 1px solid var(--ct-control-border); border-radius: 50%; flex: 0 0 16px; }
.canteen-page .active .canteen-choice-mark { background: var(--ct-primary-bg); border-color: var(--ct-primary-bg); color: var(--ct-on-primary); }
.canteen-page .canteen-choice-mark .canteen-icon { width: 12px; height: 12px; flex-basis: 12px; }
.canteen-page .canteen-choice-btn:disabled { color: var(--ct-placeholder); background: var(--ct-disabled-bg); }
.canteen-page .canteen-choice-btn.active:disabled { color: var(--ct-control-text); border-color: var(--ct-control-border); }
.canteen-page .canteen-choice-current { display: flex; gap: 5px; align-items: start; font-size: 12px; color: var(--ct-muted); margin-top: 10px; min-height: 18px; }
.canteen-page .is-saved { color: var(--ct-green); }
.canteen-page .is-draft { color: var(--ct-warning); }
.canteen-page .canteen-deadline { display: flex; gap: 6px; align-items: start; margin-top: 16px; color: var(--ct-muted); font-size: 12px; line-height: 1.5; }
.canteen-page .canteen-deadline.is-manual { color: var(--ct-warning); }
.canteen-page .canteen-guests-line { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ct-separator); display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.canteen-page .canteen-guests-line > span { display: inline-flex; align-items: center; gap: 6px; color: var(--ct-muted); }
.canteen-page .canteen-guests-line strong { color: var(--ct-text); font-weight: 600; }
.canteen-page .canteen-link { display: inline-flex; gap: 4px; align-items: center; justify-content: center; padding: 8px 0 8px 8px; min-height: 40px; color: var(--ct-link); border: 0; border-radius: 4px; background: transparent; font-size: 12px; font-weight: 500; }
.canteen-page .canteen-link:hover { text-decoration: underline; }
.canteen-page .canteen-week-summary { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--ct-line); }
.canteen-page .canteen-week-summary > div { display: flex; align-items: baseline; gap: 8px; }
.canteen-page .canteen-week-summary strong { font-size: 28px; font-weight: 600; letter-spacing: -1px; }
.canteen-page .canteen-week-summary p { color: var(--ct-muted); font-size: 13px; }
.canteen-page .canteen-total-pill { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 16px; }
.canteen-page .canteen-total-pill strong { font-size: 36px; line-height: 1; font-weight: 600; letter-spacing: -1.5px; }
.canteen-page .canteen-total-pill span { color: var(--ct-muted); font-size: 12px; }
.canteen-page .canteen-cook-stats { margin: 0 0 20px; font-size: 12px; }
.canteen-page .canteen-cook-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 4px 0; }
.canteen-page .canteen-cook-stats dt { color: var(--ct-muted); }
.canteen-page .canteen-cook-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.canteen-page .canteen-cook-card .canteen-menu-box { border-top: 1px solid var(--ct-separator); padding-top: 16px; }
.canteen-page .canteen-detail-button { margin-top: 16px; width: 100%; justify-content: space-between; }
.canteen-page .canteen-menu-progress { display: flex; align-items: center; gap: 8px; color: var(--ct-muted); font-size: 13px; margin-bottom: 16px; }
.canteen-page .canteen-menu-form { display: grid; gap: 8px; }
.canteen-page .canteen-menu-form label { color: var(--ct-muted); font-size: 12px; }
.canteen-page :is(input[type="text"], input[type="search"], textarea) { background: var(--ct-surface); color: var(--ct-text); border: 1px solid var(--ct-input-border); border-radius: 7px; padding: 10px; width: 100%; min-width: 0; line-height: 1.5; }
.canteen-page textarea { resize: vertical; min-height: 152px; max-height: 360px; font-size: 14px; }
.canteen-page input::placeholder, .canteen-page textarea::placeholder { color: var(--ct-placeholder); opacity: 1; }
.canteen-page .canteen-form-state { font-size: 12px; color: var(--ct-muted); min-height: 20px; }
.canteen-page .canteen-form-state.is-draft { color: var(--ct-warning); }
.canteen-page .canteen-menu-form button { margin-top: 4px; }
.canteen-page .canteen-dialog { color: var(--ct-text); background: var(--ct-surface); border: 1px solid var(--ct-line); border-radius: 12px; padding: 0; width: min(680px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px); margin: auto; overflow: hidden; }
.canteen-page .canteen-dialog::backdrop { background: var(--ct-backdrop); }
.canteen-page #canteenDialogBody { display: flex; flex-direction: column; max-height: calc(100dvh - 50px); }
.canteen-page .canteen-dialog-header { padding: 20px 24px; border-bottom: 1px solid var(--ct-line); display: flex; align-items: start; justify-content: space-between; gap: 16px; flex-shrink: 0; }
.canteen-page .canteen-dialog-header h2 { font-size: 20px; line-height: 1.4; letter-spacing: -.4px; font-weight: 600; }
.canteen-page .canteen-dialog-header p { font-size: 13px; color: var(--ct-muted); margin-top: 4px; }
.canteen-page .canteen-dialog-content { padding: 24px; overflow-y: auto; overscroll-behavior: contain; }
.canteen-page .canteen-panel-hint { color: var(--ct-muted); font-size: 13px; margin-bottom: 20px; }
.canteen-page .canteen-section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.canteen-page .canteen-section-title span { color: var(--ct-muted); margin-left: 4px; font-weight: 400; }
.canteen-page fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.canteen-page fieldset:disabled input { color: var(--ct-muted); background: var(--ct-disabled-bg); }
.canteen-page .canteen-name-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.canteen-page .canteen-name-fields label { display: grid; gap: 6px; color: var(--ct-muted); font-size: 13px; }
.canteen-page .canteen-guest-edit-form { border-bottom: 1px solid var(--ct-line); padding: 0 0 16px; margin-bottom: 16px; }
.canteen-page .canteen-guest-form { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ct-line); }
.canteen-page .canteen-error, .canteen-page .canteen-inline-notice { padding: 12px; background: var(--ct-warning-bg); color: var(--ct-warning); border-left: 3px solid var(--ct-warning-border); border-radius: 0 6px 6px 0; font-size: 13px; margin-block: 12px; }
.canteen-page .canteen-error { background: var(--ct-danger-bg); color: var(--ct-red); border-color: var(--ct-error-border); }
.canteen-page .canteen-muted { color: var(--ct-muted); font-size: 13px; }
.canteen-page .canteen-panel-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.canteen-page .canteen-panel-navigation strong { font-size: 16px; font-weight: 600; }
.canteen-page .canteen-search { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.canteen-page .canteen-search-results { color: var(--ct-muted); font-size: 12px; margin-bottom: 8px; }
.canteen-page .canteen-people-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.canteen-page .canteen-people-section h3 { font-size: 14px; font-weight: 600; border-bottom: 1px solid var(--ct-line); padding-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; }
.canteen-page .canteen-people-section h3 span { color: var(--ct-muted); font-weight: 400; }
.canteen-page .canteen-people-section ul { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; scrollbar-gutter: stable; }
.canteen-page .canteen-people-section li { padding: 10px 0; border-bottom: 1px solid var(--ct-subtle-bg); overflow-wrap: anywhere; }
.canteen-page .canteen-people-section small { display: block; color: var(--ct-muted); font-size: 12px; }
.canteen-page .canteen-people-section .canteen-muted { margin-top: 12px; }
.canteen-page .canteen-loading > span { display: block; font-size: 13px; color: var(--ct-muted); margin-bottom: 16px; }
.canteen-page .canteen-skeleton { height: 320px; border: 1px solid var(--ct-line); border-radius: 12px; background: var(--ct-surface); padding: 20px; }
.canteen-page .canteen-skeleton i { display: block; height: 16px; background: var(--ct-skeleton); border-radius: 4px; margin: 0 0 20px; }
.canteen-page .canteen-skeleton i:nth-child(2) { margin-top: 40px; height: 80px; }
.canteen-page .canteen-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@container (min-width: 520px) { .canteen-page .canteen-day-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 790px) { .canteen-page .canteen-day-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1100px) { .canteen-page .canteen-day-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 600px) {
    .canteen-page .canteen-header h1 { font-size: 28px; }
    .canteen-page .canteen-tab { font-size: 12px; padding-inline: 8px; }
    .canteen-page .canteen-week-banner strong { font-size: 16px; }
    .canteen-page .canteen-admin-control summary { flex-wrap: wrap; }
    .canteen-page .canteen-admin-state { border: 0; margin: 0; padding: 0; }
    .canteen-page .canteen-admin-body { padding-left: 0; }
    .canteen-page .canteen-dialog { width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 12px 12px 0 0; }
    .canteen-page #canteenDialogBody { max-height: 94dvh; }
    .canteen-page .canteen-dialog-header { padding: 16px; }
    .canteen-page .canteen-dialog-header h2 { font-size: 18px; }
    .canteen-page .canteen-dialog-content { padding: 20px 16px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
    .canteen-page .canteen-people-sections { grid-template-columns: minmax(0, 1fr); }
    .canteen-page .canteen-name-fields { grid-template-columns: minmax(0, 1fr); }
    .canteen-page .canteen-button, .canteen-page .canteen-choice-btn, .canteen-page .canteen-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .canteen-page *, .canteen-page *::before, .canteen-page *::after { animation: none; transition: none; scroll-behavior: auto; } }

@container (min-width: 300px) and (max-width: 519px) { .canteen-page .canteen-choice-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.canteen-page [data-guest-state]:empty { display: none; }
.canteen-page .canteen-guest-list .canteen-guest-edit-form:last-child { border-bottom: 0; margin-bottom: 0; }
