[x-cloak] { display: none !important; }
body { color: var(--brand-ink); background: var(--brand-canvas); }

.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-strong);
    --bs-btn-hover-border-color: var(--brand-strong);
    --bs-btn-active-bg: var(--brand-strong);
    --bs-btn-active-border-color: var(--brand-strong);
    --bs-btn-disabled-bg: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn-outline-primary {
    --bs-btn-color: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary);
    --bs-btn-hover-border-color: var(--brand-primary);
    --bs-btn-active-bg: var(--brand-strong);
    --bs-btn-active-border-color: var(--brand-strong);
    --bs-btn-disabled-color: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn-outline-secondary {
    --bs-btn-color: var(--brand-muted);
    --bs-btn-border-color: #7d8f82;
    --bs-btn-hover-color: var(--brand-ink);
    --bs-btn-hover-bg: var(--brand-hover);
    --bs-btn-hover-border-color: var(--brand-muted);
    --bs-btn-active-color: var(--brand-ink);
    --bs-btn-active-bg: var(--brand-hover);
    --bs-btn-active-border-color: var(--brand-muted);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.text-muted, .form-text { color: var(--brand-muted) !important; }
.form-control, .form-select { border-color: var(--brand-border); color: var(--brand-ink); caret-color: var(--brand-primary); }
.form-control::placeholder { color: var(--brand-muted); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .15); }
.form-check-input:checked, .form-check-input[type="checkbox"]:indeterminate { background-color: var(--brand-primary); border-color: var(--brand-primary); }
.dropdown-menu { --bs-dropdown-link-hover-bg: var(--brand-soft); --bs-dropdown-link-active-bg: var(--brand-primary); --bs-dropdown-link-color: var(--brand-ink); --bs-dropdown-border-color: var(--brand-border); }
.day-panel { scrollbar-color: #7d8f82 var(--brand-soft); }
.day-number, .calendar-week-number { font-variant-numeric: tabular-nums; }

body { display: flex; flex-direction: column; min-height: 100vh; }
.schedule-shell { --schedule-panel-width: 300px; --schedule-gap: 24px; max-width: 1500px; padding: 20px 28px; flex: 1; }
.page-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; width: 100%; max-width: 1500px; margin: 0 auto; padding: 16px 28px; border-top: 1px solid var(--brand-border); color: var(--brand-muted); font-size: 13px; }
.page-footer p { margin: 0; }
.page-footer a { color: var(--brand-muted); text-underline-offset: 4px; }
.page-footer a:hover { color: var(--brand-primary); }
.page-footer a:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; border-radius: 4px; }
@media (max-width: 600px) {
    .page-footer { justify-content: center; text-align: center; padding: 16px 12px; }
}
.schedule-nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 1px solid var(--brand-border); }
.calendar-toolbar { width: calc(100% - var(--schedule-panel-width) - var(--schedule-gap)); }
.calendar-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 20px; margin-bottom: 16px; }
.calendar-navigation { display: flex; flex-wrap: wrap; max-width: 100%; align-items: center; gap: 16px; flex-shrink: 0; }
.calendar-actions { display: flex; flex-wrap: wrap; align-items: center;justify-content: flex-end; gap: 8px; padding-top: 16px; border-top: 1px solid var(--brand-border); }
.calendar-assign { display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin-right: auto; }
.calendar-pending-count { padding: 0 6px; border-radius: 4px; background: rgba(255, 255, 255, .18); font-size: 12px; font-variant-numeric: tabular-nums; }
.calendar-actions .calendar-filter-toggle,
.calendar-actions .calendar-appearance-menu > summary,
.calendar-actions > .schedule-export > summary {
    min-height: 36px;
    padding: 5px 10px;
    border: 1px solid var(--brand-border);
    border-radius: 8px;
    background: white;
    color: var(--brand-ink);
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.calendar-actions .calendar-filter-toggle:hover,
.calendar-actions .calendar-appearance-menu > summary:hover,
.calendar-actions > .schedule-export > summary:hover {
    border-color: var(--brand-primary);
    background: var(--brand-hover);
    color: var(--brand-strong);
}
.calendar-actions .calendar-filter-toggle[aria-expanded="true"],
.calendar-actions .calendar-filter-toggle.btn-outline-primary,
.calendar-actions .calendar-appearance-menu[open] > summary,
.calendar-actions > .schedule-export[open] > summary {
    border-color: var(--brand-primary);
    background: var(--brand-soft);
    color: var(--brand-strong);
}
.calendar-actions > .schedule-export { flex-shrink: 0; }
.calendar-appearance-menu { position: relative; flex-shrink: 0; }
.calendar-appearance-menu > summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; }
.calendar-appearance-menu > summary::-webkit-details-marker { display: none; }
.calendar-appearance-menu > summary:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.calendar-appearance-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1100; display: flex; flex-direction: column; gap: 12px; width: 320px; max-width: calc(100vw - 56px); padding: 16px; background: white; border: 1px solid var(--brand-border); border-radius: 8px; box-shadow: 0 4px 16px #20372e20; }
.calendar-appearance-option + .calendar-appearance-option { padding-top: 12px; border-top: 1px solid var(--brand-border); }
.calendar-appearance-option .form-text { margin: 4px 0 0; padding-left: 24px; }
.calendar-view-toggle { display: flex; align-items: center; margin-left: 8px; }
.calendar-view-toggle .btn-group { padding: 3px; border-radius: 6px; background: var(--brand-soft); }
.calendar-view-toggle .btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-height: 32px; padding: 6px; border: 0; border-radius: 4px !important; }
.calendar-view-toggle .btn-outline-secondary { background: transparent; }
.calendar-filter-toggle { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.calendar-toolbar .mdi { width: 16px; height: 16px; }
.calendar-view-toggle .mdi { width: 18px; height: 18px; }
.calendar-toolbar .settings-chevron { width: 12px; height: 12px; }
.calendar-filter-toggle[aria-expanded="true"] .settings-chevron { transform: rotate(180deg); }
.calendar-filter-menu { position: relative; flex-shrink: 0; }
.calendar-filters { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1100; display: flex; flex-direction: column; gap: 16px; width: 320px; max-width: calc(100vw - 56px); padding: 16px; background: white; border: 1px solid var(--brand-border); border-radius: 8px; }
.filter-menu-heading { margin: 0; font-size: 12px; font-weight: 600; color: var(--brand-muted); }
.calendar-filters > div { min-width: 0; width: 100%; }
.calendar-filters .form-label { font-size: 14px; font-weight: 600; }
.calendar-filters > button { flex-shrink: 0; }
.month-navigation { display: flex; align-items: center; gap: 12px; }
.month-arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 8px; flex-shrink: 0; }
.month-title { width: 16rem; flex-shrink: 0; text-align: center; white-space: nowrap; }
.month-title::first-letter, .selected-date::first-letter { text-transform: uppercase; }
.schedule-layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--schedule-panel-width); gap: var(--schedule-gap); align-items: start; }
.calendar { border: 1px solid var(--brand-border); border-radius: 8px; overflow: hidden; background: white; }
.calendar-week, .calendar-grid { display: grid; grid-template-columns: 42px repeat(7, minmax(0, 1fr)); }
.calendar-week { background: var(--brand-soft); text-align: center; font-weight: 600; font-size: 14px; }
.calendar-week span { padding: 12px 0; }
.calendar-day { width: 100%; height: 100%; min-height: 128px; min-width: 0; padding: 10px; border: 0; border-top: 1px solid var(--brand-border); border-right: 1px solid var(--brand-border); background: white; color: var(--brand-ink); text-align: left; display: flex; flex-direction: column; gap: 6px; }
.calendar-cell:last-child .calendar-day { border-right: 0; }
.calendar-day:hover { background: var(--brand-soft); }
.calendar-day.outside-month { background: #fafbf9; color: #647368; }
.calendar-day.selected { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand-primary); }
.day-number { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; font-weight: 600; flex-shrink: 0; }
.today .day-number { background: var(--brand-primary); color: white; border-radius: 50%; }
.calendar-assignment { display: block; flex-shrink: 0; font-size: 12px; width: 100%; }
.calendar-assignment strong, .calendar-assignment span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-assignment > strong, .calendar-assignment .calendar-duty-row { padding: 2px 4px; }
.calendar-assignment > strong { padding-inline: 6px; padding-bottom: 0; font-weight: 600; }
.calendar-assignment > .calendar-duty-row:first-of-type { padding-top: 1px; }
.calendar-assignment > strong, .calendar-assignment .calendar-duty-row > span { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: baseline; }
.calendar-assignment .calendar-duty-row > span:not(.calendar-subduty) { margin-inline-start: 8px; }
.calendar-assignment .color-tag { grid-column: 1; grid-row: 1; margin-right: 0; }
.calendar-assignment .color-tag-label, .calendar-assignment .text-muted { grid-column: 2; min-width: 0; }
.calendar-assignment.calendar-color-background .color-tag:not(.person-color-tag) { visibility: hidden !important; }
.calendar-assignment .calendar-subduty-row { margin-left: 12px; padding-left: 4px; }
.calendar-assignment .calendar-duty-row + .calendar-duty-row { margin-top: 0; }
.calendar-color-background .text-muted { color: inherit !important; }
.calendar-expanded .calendar-assignment { display: block; }
.calendar-expanded .calendar-assignment strong, .calendar-expanded .calendar-assignment span { overflow: visible; white-space: normal; overflow-wrap: anywhere; }
.calendar-subduty-row { padding-left: 8px; }
.calendar-subduty { font-weight: 600; }
.calendar-duty-row + .calendar-duty-row { margin-top: 4px; }
.assignment-count { font-size: 11px; margin-top: auto; color: var(--brand-muted); }
.calendar-detail-jump { display: none; }
.day-panel { scroll-margin-top: 16px; height: var(--calendar-height, auto); min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-gutter: stable; scrollbar-width: thin; background: white; border: 1px solid var(--brand-border); border-radius: 8px; padding: 20px; }
.day-panel:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; }
.assignment-list { list-style: none; padding: 0; margin: 0; }
.assignment-groups { list-style: none; padding: 0; margin: 0; }
.assignment-group { padding: 12px 0; border-bottom: 1px solid var(--brand-border); overflow-wrap: anywhere; }
.assignment-group:first-child { padding-top: 4px; }
.assignment-group:last-child { border-bottom: 0; }
.assignment-group-toggle { display: flex; align-items: center; gap: 12px; min-height: 36px; cursor: pointer; list-style: none; border-radius: 4px; }
.assignment-group-toggle::-webkit-details-marker { display: none; }
.assignment-group-toggle .assignment-parent { flex: 1; min-width: 0; margin: 0; }
.assignment-group-toggle .color-tag, .assignment-subduty .color-tag { box-sizing: border-box; width: 9px; height: 9px; }
.assignment-group-toggle > .mdi { color: var(--brand-muted); transform: rotate(-90deg); }
.assignment-disclosure[open] > .assignment-group-toggle { margin-bottom: 6px; }
.assignment-disclosure[open] > .assignment-group-toggle > .mdi { transform: none; }
.assignment-group-toggle .assignment-section-count { font-size: 14px; color: var(--brand-muted); }
.assignment-groups .assignment-content { padding: 12px; border: 0; border-top: 2px solid var(--assignment-color, var(--brand-border)); border-radius: 6px; background: #f5f6f5; }
.assignment-groups .assignment-content + .assignment-content { margin-top: 8px; }
.assignment-content :is(.assignment-metadata, .assignment-notes, .assignment-person > i, .assignment-action:not(.assignment-delete)) { color: inherit; }
.assignment-content .assignment-delete { color: #8c1825; background: #ffffff; }
.assignment-content .assignment-action:not(.assignment-delete):hover { background: transparent; outline: 1px solid currentColor; }

.assignment-group-toggle:hover { background: var(--brand-soft); }
.assignment-group-toggle:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; }

.assignment-list li + li { margin-top: 6px; }
.assignment-duty-row + .assignment-duty-row { margin-top: 8px; }
.assignment-notes { display: flex; align-items: flex-start; gap: 6px; white-space: pre-wrap; margin: 6px 0 0; font-size: 14px; color: var(--brand-muted); }
.assignment-notes > i { margin-top: 3px; }
.assignment-notes > .assignment-notes-summary { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.management-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; margin-top: 24px; }
.management-form { align-self: start; background: white; padding: 24px; border: 1px solid var(--brand-border); border-radius: 8px; }
.management-title { display: flex; align-items: center; gap: 10px; }
.management-title > i { font-size: 20px; color: var(--brand-muted); }
.management-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.people-groups, .people-group-rows, .person-permissions { list-style: none; padding: 0; margin: 0; }
.people-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.people-search { flex: 1 1 220px; }
.person-locations { margin: 0 0 6px; font-size: 13px; color: var(--brand-muted); }
.people-groups { display: flex; flex-direction: column; gap: 16px; }
.people-group-heading { display: flex; align-items: center; gap: 8px; margin: 0; padding: 16px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--brand-border); overflow-wrap: anywhere; cursor: pointer; list-style: none; }
.people-group-heading::-webkit-details-marker { display: none; }
.people-group-heading:hover { background: var(--brand-hover); }
.people-group-heading:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: -3px; }
.people-location-name { margin: 0; min-width: 0; font-size: inherit; font-weight: inherit; }
.people-group-count { margin-left: auto; flex-shrink: 0; font-size: 13px; font-weight: 400; color: var(--brand-muted); }
.people-group-chevron { font-size: 12px; }
.people-location-group[open] > .people-group-heading .people-group-chevron { transform: rotate(180deg); }
.people-location-group:not([open]) > .people-group-heading { border-bottom: 0; }
.people-group-heading > i { flex-shrink: 0; color: var(--brand-muted); }
.people-country-heading { font-size: 16px; color: var(--brand-ink); font-weight: 600; }
.people-sublocation-group:not(.people-direct-group) > .people-group-heading { padding: 16px; font-size: 17px; }
.people-sublocation-group + .people-sublocation-group { border-top: 1px solid var(--brand-border); }
.people-sublocation-group:not(.people-direct-group) > .people-group-rows { padding-left: 12px; }
.person-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--brand-border); }
.people-group-rows > li:last-child { border-bottom: 0; }
.person-details { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.person-name { display: block; font-size: 16px; line-height: 1.5; font-weight: 600; margin-bottom: 6px; }
.person-permissions { font-size: 13px; line-height: 1.6; color: var(--brand-muted); }
.person-permissions li { display: inline; }
.person-permissions li + li::before { content: ' · '; color: var(--brand-muted); }
.permission-duty + span { margin-left: 4px; }
.permission-duty { font-weight: 600; }
.person-permission-empty { margin: 0; font-size: 13px; color: var(--brand-muted); }
.files-section { max-width: 800px; }
.files-intro { color: var(--brand-muted); margin-bottom: 24px; }
.files-export > .form-text { margin-bottom: 24px; }
.files-export-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.files-export-option { display: flex; flex-direction: column; align-items: flex-start; }
.files-export-option p { color: var(--brand-muted); font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.files-export-option .btn { margin-top: auto; }
.files-individual { margin: 16px 0 24px; }
.files-individual:not([open]) > summary { border-bottom: 0; }
.files-individual[open] > summary .people-group-chevron { transform: rotate(180deg); }
.file-list { list-style: none; padding: 0; margin: 0; }
.file-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-bottom: 1px solid var(--brand-border); }
.file-row:last-child { border-bottom: 0; }
.file-name { display: flex; align-items: center; gap: 10px; min-width: 0; overflow-wrap: anywhere; }
.file-name > i { color: var(--brand-muted); flex-shrink: 0; }
.file-name strong { font-size: 16px; font-weight: 600; }
.file-key { display: block; color: var(--brand-muted); font-size: 12px; margin-top: 2px; }
.file-row > .btn { flex-shrink: 0; }
button:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; position: relative; z-index: 1; }
@media (max-width: 1100px) {
    .calendar-toolbar { width: 100%; }
    .schedule-layout { grid-template-columns: minmax(0, 1fr); }
    .day-panel { max-width: none; height: auto; overflow: visible; scrollbar-gutter: auto; }
    .calendar-detail-jump { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 16px; text-align: left; }
    .management-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .schedule-shell { padding: 16px 12px; }
    .calendar-toolbar { gap: 16px; }
    .calendar-actions { position: relative; width: 100%; gap: 8px; }
    .calendar-assign { width: 100%; min-height: 44px; margin: 0 0 4px; }
    .calendar-actions > .schedule-export > summary, .calendar-actions .calendar-appearance-menu > summary, .calendar-filter-toggle { min-width: 44px; min-height: 44px; justify-content: center; padding: 6px; font-size: 12px; gap: 4px; }
    .calendar-view-toggle { margin-left: 8px; }
    .calendar-view-toggle .btn { width: 44px; min-height: 44px; }
    .calendar-action-label { display: inline; }
    .calendar-filter-menu, .calendar-actions > .schedule-export { position: static; }
    .calendar-navigation { gap: 8px; }
    .calendar-filters { gap: 12px; }
    .month-navigation { gap: 6px; }
    .month-title { width: 11rem; font-size: 17px; }
    .calendar-day { min-height: 80px; padding: 5px 2px; }
    .calendar-assignment { display: none; }
    .assignment-count { align-self: center; min-width: 20px; padding: 2px 5px; border-radius: 4px; background: var(--brand-hover); color: var(--brand-strong); text-align: center; }
    .count-label { display: none; }
    .calendar-week { font-size: 12px; }
    .management-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}

.duty-group { display: block; padding: 4px 0; }

.calendar-week-number { border: 0; padding: 15px 0 0; display: flex; justify-content: center; align-items: flex-start; padding-top: 15px; border-top: 1px solid var(--brand-border); border-right: 1px solid var(--brand-border); background: var(--brand-soft); color: var(--brand-muted); font-size: 13px; }
.calendar-cell { position: relative; min-width: 0; }
.date-preview { display: none; position: fixed; width: min(320px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: hidden; padding: 12px; border: 1px solid var(--brand-ink); background-color: var(--brand-ink); color: white; border-radius: 6px; box-shadow: 0 4px 16px #20372e30; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; z-index: 1000; }
@media (min-width: 1101px) and (hover: hover) and (pointer: fine) {
    .calendar-cell:hover .date-preview, .calendar-cell:focus-within .date-preview { display: block; }
}
@media (max-width: 600px) {
    .calendar-week, .calendar-grid { grid-template-columns: 28px repeat(7, minmax(0, 1fr)); }
    .calendar-week-number { font-size: 11px; }
}
@media (max-width: 360px) {
    .schedule-shell { padding-inline: 4px; }
    .calendar-week, .calendar-grid { grid-template-columns: 24px repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .calendar-grid { position: relative; }
    .calendar-cell { position: static; }
}

.assignment-panel { position: fixed; inset: 0 0 0 auto; width: min(440px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 24px; border: 0; border-left: 1px solid var(--brand-border); background: white; color: var(--brand-ink); overflow-y: auto; box-shadow: -8px 0 32px #20372e20; }
.assignment-panel::backdrop { background: #20372e30; }
.assignment-panel h3 { margin-right: 32px; margin-bottom: 24px; }
@media (max-width: 600px) {
    .assignment-panel { width: 100%; border-left: 0; }
}

.duty-groups, .duty-group-rows { list-style: none; padding: 0; margin: 0; }
.duty-groups { display: flex; flex-direction: column; gap: 16px; }
.duty-group-card { background: white; border: 1px solid var(--brand-border); border-radius: 8px; overflow: hidden; }
.duty-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
.duty-row + .duty-row { border-top: 1px solid var(--brand-border); }
.duty-root { background: var(--brand-soft); }
.duty-row-content { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: calc(var(--duty-depth) * 20px); }
.duty-branch, .duty-root-icon { color: var(--brand-muted); flex-shrink: 0; font-size: 16px; }
.duty-row-name { min-width: 0; overflow-wrap: anywhere; }
.duty-row-name strong { display: block; font-size: 16px; line-height: 1.5; font-weight: 600; }
.duty-row-description { display: block; font-size: 13px; line-height: 1.6; color: var(--brand-muted); margin-top: 2px; }
.duty-rule-label { font-weight: 600; }
.duty-row-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.duty-order { font-size: 13px; color: var(--brand-muted); margin-right: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) {
    .duty-row { flex-wrap: wrap; gap: 8px; padding: 12px; }
    .duty-row-content { width: calc(100% - var(--duty-depth) * 20px); }
    .duty-row-controls { width: 100%; justify-content: flex-end; }
    .duty-order { margin-right: auto; }
    .management-layout .assignment-action { width: 44px; height: 44px; }
}

.day-panel-header { padding-bottom: 4px; margin-bottom: 0; }
.day-panel-range { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: var(--brand-muted); }
.week-panel .day-panel-header { padding-bottom: 0; margin-bottom: 0; }
.week-panel .day-panel-range { margin-bottom: 12px; text-align: center; }
.day-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.day-panel-title .selected-date { min-width: 0; margin: 0; }
.day-panel-title .btn { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; }
.day-panel-title .btn:disabled { opacity: 1; color: var(--brand-muted); background: var(--brand-soft); border-color: var(--brand-border); }
.day-navigation { gap: 6px; }
.day-navigation .selected-date { flex: 1; text-align: center; }
.day-navigation .day-arrow { justify-content: center; width: 44px; min-height: 44px; padding: 6px; border-color: transparent; }
.day-panel-context { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.day-panel-context .day-panel-location { width: 100%; min-width: 0; overflow-wrap: anywhere; }
.day-panel-status { display: flex; align-items: flex-start; gap: 12px; margin: 4px 0 16px; padding: 16px; border-radius: 8px; background: var(--brand-soft); font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--brand-ink); overflow-wrap: anywhere; }
.day-panel-status .mdi { margin-top: 2px; font-size: 20px; color: var(--brand-primary); }
.day-panel .day-panel-export { border-top: 1px solid var(--brand-border); padding-top: 12px; margin-top: 0; }
.day-panel-section-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 12px; font-weight: 600; color: var(--brand-muted); }
.day-panel-section-title::after { content: ''; flex: 1; border-top: 1px solid var(--brand-border); }
.assignment-section-count { font-variant-numeric: tabular-nums; font-weight: 400; }
.assignment-groups-toggle { flex-shrink: 0; min-height: 44px; padding: 4px; font: inherit; color: var(--brand-primary); text-underline-offset: 3px; }
.schedule-export { min-width: 0; padding: 0; margin: 12px 0 0; border: 0; }
.schedule-export legend { float: none; width: auto; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--brand-muted); }
.schedule-export-options { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.schedule-export-options .btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; min-height: 36px; padding: 6px; }
.schedule-export-options .mdi { font-size: 20px; }
.export-hint { position: absolute; top: 100%; left: 0; z-index: 20; width: max-content; max-width: 100%; padding: 8px 12px; border-radius: 4px; background: var(--brand-ink); color: white; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.calendar-toolbar .schedule-export { margin: 0; }
.calendar-toolbar .calendar-actions > .schedule-export { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--brand-border); }
.day-panel-actions { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.day-panel-actions > .btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 36px; padding: 6px 8px; font-size: 13px; flex-shrink: 0; }
.day-panel-actions > .day-export-menu { position: static; margin: 0; }
.day-panel-actions .day-export-menu > summary { justify-content: center; min-height: 36px; width: fit-content; gap: 4px; padding: 6px 8px; font-size: 13px; border-color: var(--brand-muted); color: var(--brand-muted); }
.day-panel-actions .day-export-menu[open] > summary { background: var(--brand-soft); color: var(--brand-primary); }
@media (pointer: coarse) {
    .day-panel-actions > .btn, .day-panel-actions .day-export-menu > summary { min-height: 44px; }
}
.day-export-menu > .settings-links { left: 0; right: auto; width: 100%; }

.day-panel-header .selected-date { font-size: 18px; line-height: 1.45; margin-bottom: 8px; }
.day-panel-header .day-panel-title .selected-date { margin-bottom: 0; }
.day-panel #day-assignment-groups > .assignment-group:first-child .assignment-group-toggle { min-height: 30px; }
.day-panel-location { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--brand-muted); }
.assignment-content { min-width: 0; padding: 10px; border: 1px solid var(--brand-border); border-top: 2px solid var(--assignment-color, var(--brand-border)); border-radius: 4px; background: #fff; }
.assignment-parent { display: block; font-size: 17px; line-height: 1.4; font-weight: 600; color: var(--brand-ink); margin: 0 0 8px; }
.assignment-subduty-row { margin-left: 12px; }
.assignment-subduty { display: block; font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--brand-ink); margin-bottom: 6px; }
.assignment-person-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assignment-person { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font-size: 14px; }
.person-color-icon-circle { display: contents; color: var(--brand-muted); }
.person-color-icon-circle--tagged { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; background: var(--person-color); }
.person-color-icon-circle .mdi { width: 14px; height: 14px; vertical-align: 0; }
.assignment-person-name { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.assignment-person > i { color: var(--brand-muted); flex-shrink: 0; }
.assignment-metadata { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--brand-muted); margin-top: 4px; }
.assignment-metadata > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.assignment-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.assignment-action { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; color: var(--brand-muted); font-size: 16px; border: 0; border-radius: 6px; }
@media (pointer: fine) { .assignment-actions .assignment-action { width: 28px; height: 28px; border-radius: 4px; } }
.assignment-action:hover { background: var(--brand-soft); color: var(--brand-ink); }
.assignment-delete { color: #b42332; }
.assignment-delete:hover { background: #fff0f1; color: #8c1825; }
@media (pointer: coarse) { .assignment-action { width: 44px; height: 44px; } }

.calendar-location-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px; min-width: 0; }
.calendar-location-bar > div { display: flex; align-items: center; gap: 12px; min-width: 0; }
.calendar-location-bar .form-select { width: 280px; max-width: 100%; }
.calendar-location-bar .form-label { font-weight: 600; margin: 0; }
.calendar-day.non-operating { background: #f2f2f2; color: #5f5f5f; }
.calendar-day.non-operating:hover, .selected-week .calendar-day.non-operating { background: #e8e8e8; }
.calendar-day.non-operating.selected { box-shadow: inset 0 0 0 2px #7a7a7a; }
.assignment-location-context { padding: 12px; background: var(--brand-soft); border-radius: 6px; }
@media (max-width: 600px) { .calendar-location-bar { width: 100%; gap: 8px; } .calendar-location-bar > div { width: 100%; } .calendar-location-bar .form-select { flex: 1; width: 0; } }

.schedule-settings { position: relative; }
.schedule-nav > .schedule-settings { margin-left: auto; }
.schedule-settings summary { display: flex; align-items: center; gap: 8px; list-style: none; }
.schedule-settings summary::-webkit-details-marker { display: none; }
.schedule-settings summary:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.schedule-settings summary.settings-active { color: var(--brand-strong); border-color: var(--brand-primary); background: var(--brand-soft); }
.settings-chevron { font-size: 12px; }
.schedule-settings[open] .settings-chevron { transform: rotate(180deg); }
.settings-links { position: absolute; top: calc(100% + 8px); right: 0; z-index: 1100; width: 220px; max-width: calc(100vw - 24px); padding: 6px; margin: 0; list-style: none; background: white; border: 1px solid var(--brand-border); border-radius: 8px; }
.settings-links button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--brand-ink); text-align: left; }
.settings-links button:hover, .settings-links button.settings-current { background: var(--brand-soft); color: var(--brand-strong); }
.settings-links .export-load-error { overflow-wrap: anywhere; white-space: normal; }
.settings-files { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--brand-border); }

.series-deletion-panel { width: min(440px, calc(100% - 24px)); padding: 24px; border: 1px solid var(--brand-border); border-radius: 8px; color: var(--brand-ink); }
.series-deletion-panel::backdrop { background: #20372e30; }
.unsaved-settings-actions { display: grid; gap: 8px; }
.unsaved-settings-actions .btn { width: 100%; }

.general-settings { display: grid; gap: 16px 24px; }
.general-settings fieldset, .settings-identity { min-width: 0; }
.general-settings legend { float: none; margin-bottom: 12px; }
.settings-identity > fieldset, .settings-identity > section { padding: 20px; border: 1px solid var(--brand-border); border-radius: 8px; background: var(--brand-canvas); }
.print-settings { grid-column: 1 / -1; min-width: 0; padding: 20px; border: 1px solid var(--brand-border); border-radius: 8px; background: var(--brand-soft); }
.print-settings-layout { display: grid; gap: 24px; }
.print-label-grid { display: grid; gap: 16px; }
.print-label-group { min-width: 0; }
.print-label-group-title { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.print-label-field + .print-label-field { margin-top: 12px; }
.print-label-field .form-label { margin-bottom: 4px; font-size: 14px; }
.print-label-field .form-control { min-height: 40px; }
.print-label-field .form-text { margin-top: 4px; margin-bottom: 0; font-size: 13px; }
.print-settings-group + .print-settings-group { padding-top: 20px; border-top: 1px solid var(--brand-border); }
.print-settings-group .form-text:last-child { margin-bottom: 0; }
.print-week-options { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--brand-border); }
.print-week-options > .form-text { margin-top: 0; }
.print-settings-group .form-check:last-child, .print-settings-group .form-control:last-child { margin-bottom: 0 !important; }
.settings-identity { display: grid; align-content: start; gap: 24px; }
.settings-time-zone { margin-top: 24px; }
.settings-data, .settings-support { min-width: 0; }
#settings-delete-all-title { color: #842029; }
.settings-data-action { margin-top: 20px; }
.settings-data-action + .settings-data-action { padding-top: 20px; border-top: 1px solid var(--brand-border); }
.settings-data-action .btn { min-height: 44px; max-width: 100%; white-space: normal; }
.settings-support { grid-column: 1 / -1; justify-self: center; width: min(100%, 560px); padding: 20px; border: 1px solid var(--brand-border); border-radius: 8px; background: var(--brand-canvas); text-align: center; }
.support-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.support-link img { flex-shrink: 0; }
.settings-appearance { min-width: 0; padding: 20px; border: 1px solid var(--brand-border); border-radius: 8px; background: var(--brand-canvas); }
.settings-color-options { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--brand-border); }
.settings-color-options .form-check { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 28px; column-gap: 4px; align-items: start; }
.settings-color-suboption { margin-top: 8px; margin-left: 16px; }
.settings-color-options .form-check-input { position: absolute; top: 0; left: 0; margin-left: 0; }
.settings-color-options .field-help { align-self: stretch; }
.accent-picker { position: relative; }
.accent-picker[open] { z-index: 20; }
.accent-picker-trigger { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--brand-border); border-radius: 6px; background: #fff; cursor: pointer; list-style: none; }
.accent-picker-trigger::-webkit-details-marker { display: none; }
.accent-picker-trigger .mdi { margin-left: auto; }
.accent-picker-trigger:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.accent-picker-options { position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 30; padding: 4px; border: 1px solid var(--brand-border); border-radius: 8px; background: #fff; box-shadow: 0 4px 16px #20372e20; }
.accent-picker-option { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.accent-picker-option:hover, .accent-picker-option:focus-within { background: var(--brand-soft); }
.accent-picker-option .form-check-input { margin: 0; }
.accent-swatch { display: block; width: 20px; height: 20px; flex: 0 0 auto; border-radius: 50%; }
.settings-actions { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid var(--brand-border); }
@media (min-width: 768px) {
    .general-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 32px; }
    .settings-identity { display: contents; }
    .print-settings-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
    .print-settings-group + .print-settings-group { padding-top: 0; border-top: 0; }
    .print-settings-group:nth-child(2) { padding-left: 32px; border-left: 1px solid var(--brand-border); }
    .print-settings-group:nth-child(3) { padding-top: 20px; border-top: 1px solid var(--brand-border); }
}
@media (min-width: 480px) {
    .print-label-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .print-label-group + .print-label-group { padding-left: 16px; border-left: 1px solid var(--brand-border); }
}
@media (min-width: 1200px) {
    .general-settings { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .print-settings-layout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .print-settings-group:nth-child(3) { padding-top: 0; border-top: 0; }
    .print-settings-group + .print-settings-group { padding-left: 32px; border-left: 1px solid var(--brand-border); }
}
.settings-logo-preview { display: flex; justify-content: center; padding: 16px; margin-bottom: 12px; background: #fff; border: 1px solid var(--brand-border); border-radius: 8px; }
.settings-logo-preview img, .page-header-brand img { object-fit: contain; }
.default-schedule-logo { display: block; width: 80px; height: 80px; flex: 0 0 auto; background-color: var(--brand-primary); -webkit-mask: url('../images/tendril-icon.svg') center / contain no-repeat; mask: url('../images/tendril-icon.svg') center / contain no-repeat; }
.print-default-logo { width: 48px; height: 48px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }

.calendar-week-number:hover { background: var(--brand-hover); color: var(--brand-strong); }
.selected-week .calendar-week-number { background: var(--brand-primary); color: white; font-weight: 600; }
.selected-week .calendar-day { background: var(--brand-soft); }
.week-schedule { list-style: none; padding: 0; margin: 0; }
.week-schedule-day { padding: 12px 0; border-bottom: 1px solid var(--brand-border); }
.week-schedule-day:first-child { padding-top: 0; }
.week-schedule-day:last-child { border-bottom: 0; }
.week-date { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; padding: 6px 0; margin: 0 0 8px; color: var(--brand-strong); font-size: 14px; font-weight: 600; text-align: left; }
.week-date-label { min-width: 0; overflow-wrap: anywhere; }
.week-date-label::first-letter { text-transform: uppercase; }
.week-date-count { flex-shrink: 0; font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.week-date:hover { background: var(--brand-soft); color: var(--brand-strong); }
.week-schedule .week-date { align-items: center; flex-wrap: wrap; padding: 10px; border-radius: 6px; background: var(--brand-soft); }
.week-schedule .week-date:hover { background: var(--brand-hover); }
.week-schedule .week-date-count { padding: 2px 6px; border: 1px solid var(--brand-border); border-radius: 4px; background: #fff; color: var(--brand-muted); font-size: 11px; }
.week-schedule .assignment-group { padding-block: 8px; }
.week-schedule .assignment-group:first-child { padding-top: 0; }
.week-empty-days { margin-top: 12px; border-top: 1px solid var(--brand-border); padding-top: 12px; }
.week-empty-days summary { cursor: pointer; font-size: 13px; color: var(--brand-muted); padding: 4px 0; }
.week-empty-days ul { list-style: none; margin: 8px 0 0; padding: 0; }
.week-empty-days .week-date { font-weight: 400; margin-bottom: 0; }

.print-document { display: none; }
@media print {
    body { display: block; min-height: 0; }
    .page-footer { display: none !important; }
    body { background: white; color: black; }
    .schedule-shell { max-width: none; padding: 0; }
    .schedule-shell > :not(.print-document) { display: none !important; }
    .print-document { display: block; color: black; }
    .print-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
    .print-heading img { width: 32px; height: 32px; flex-shrink: 0; object-fit: contain; }
    .print-heading > div { min-width: 0; overflow-wrap: anywhere; }
    .print-heading-content { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; align-items: center; }
    .print-heading-content > div { min-width: 0; }
    .print-heading-context { text-align: right; }
    .print-heading h1 { font-size: 14pt; line-height: 1.2; margin: 0 0 3px; }
    .print-heading p { margin: 0 0 2px; font-size: 8pt; line-height: 1.2; }
    .print-heading .print-location-badge { display: inline-block; max-width: 100%; box-sizing: border-box; margin: 0; padding: 5px 10px; border: 1px solid var(--brand-primary); border-radius: 6px; background: var(--brand-soft); color: var(--brand-strong); font-size: 10pt; font-weight: 600; line-height: 1.3; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .print-heading h1::first-letter, .print-schedule-day h2::first-letter { text-transform: uppercase; }
    .print-calendar, .print-detail-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
    .print-calendar { font-size: 8pt; line-height: 1.15; }
    .print-calendar th, .print-calendar td, .print-detail-table th, .print-detail-table td { border: 1px solid #aaa; padding: 6px; vertical-align: top; overflow-wrap: anywhere; }
    .print-calendar tr > :first-child { width: 11mm; text-align: center; white-space: nowrap; overflow-wrap: normal; }
    .print-calendar th, .print-calendar td { padding: 4px; }
    .print-calendar td { height: 20mm; padding: 0; }
    .print-calendar tr { break-inside: avoid; }
    .print-day-number { display: block; box-sizing: border-box; height: 24px; line-height: 15px; font-size: 9pt; font-weight: 700; white-space: nowrap; margin: 0; padding: 4px; background: white; color: #222; }
    .print-assignments { list-style: none; padding: 0; margin: 0; }
    .print-assignments li { margin: 0; break-inside: avoid; }
    .print-assignments li + li { margin-top: 6px; }
    .print-assignments strong, .print-assignments span { display: block; }
    .print-assignments li > strong { padding: 4px 6px 1px; font-size: 8.5pt; font-weight: 600; }
    .print-duty-row { margin: 0; padding: 4px 6px 6px; }
    .print-assignments li > strong + .print-duty-row { padding-top: 2px; }
    .print-subduty-row { margin-left: 12px; padding-left: 6px; }
    .print-duty-row > div { margin-inline-start: 10px; }
    .print-assignments li > strong, .print-assignments .print-subduty, .print-duty-row > div > span:first-child { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; }
    .print-assignments .color-tag { grid-column: 1; grid-row: 1; }
    .print-assignments .print-tag-label { grid-column: 2; min-width: 0; }
    .print-subduty { font-weight: 600; }
    .print-schedule-day { margin-bottom: 18px; }
    .print-schedule-day h2 { font-size: 12pt; margin-bottom: 8px; break-after: avoid; }
    .print-detail-table { font-size: 10pt; }
    .print-detail-table tr { break-inside: avoid; }
    .print-notes { white-space: pre-wrap; }
    .print-pending { color: #555; font-style: italic; }
    .print-harmony { font-family: Georgia, 'Times New Roman', serif; }
    .print-harmony .print-heading { border-bottom: 2px solid var(--brand-primary); padding-bottom: 6px; }
    .print-harmony .print-heading h1 { font-size: 16pt; color: var(--brand-strong); }
    .print-harmony .print-heading p { font-family: Arial, sans-serif; }
    .print-harmony .print-calendar th, .print-harmony .print-detail-table th { background: var(--brand-soft); color: var(--brand-strong); }
    .print-harmony .print-calendar th, .print-harmony .print-calendar td,
    .print-harmony .print-detail-table th, .print-harmony .print-detail-table td { border-color: var(--brand-border); }
    .print-harmony .print-day-number { padding-bottom: 2px; }
    .print-harmony .print-assignments strong { font-family: Arial, sans-serif; font-size: 8pt; }
    .print-harmony .print-schedule-day h2 { border-bottom: 1px solid var(--brand-border); padding-bottom: 6px; color: var(--brand-strong); }
    .print-harmony .print-detail-table tbody tr:nth-child(even) { background: var(--brand-canvas); }
    .print-harmony { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    thead { display: table-header-group; }
}

.feedback { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 20px 60px 20px 20px; border-radius: 8px; }
.feedback.alert-danger { background: #fff2f1; border-color: #e9c8c5; color: #842029; }
.feedback.alert-warning { background: #fff9eb; border-color: #e5d6af; color: #664d03; }
.feedback.alert-success { background: #edf7ef; border-color: #c4ddcc; color: #0f5132; }
.feedback-icon { font-size: 20px; line-height: 1.5; }
.feedback-body { min-width: 0; overflow-wrap: anywhere; }
.feedback-title { display: block; font-size: 16px; margin-bottom: 4px; }
.feedback-body p { margin: 0; line-height: 1.5; white-space: pre-line; }
.feedback-body .feedback-record { font-weight: 600; margin-bottom: 4px; }
.feedback .btn-close { top: 8px; right: 8px; width: 44px; height: 44px; padding: 0; }
.feedback-impact { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 16px 0; }
.feedback-impact > div { display: flex; align-items: baseline; gap: 8px; }
.feedback-impact dt { font-size: 13px; font-weight: 400; }
.feedback-impact dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.feedback-details { font-size: 14px; }
.feedback-details summary { width: fit-content; cursor: pointer; min-height: 32px; }
.feedback-details p { padding: 8px 0; }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.feedback-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; }
.feedback-body .feedback-help { font-size: 13px; margin-top: 12px; }
.impact-review { width: min(560px, calc(100% - 24px)); max-height: min(90dvh, 820px); padding: 0; overflow: hidden; }
.impact-review[open] { display: flex; flex-direction: column; }
.monthly-assignment-review { width: min(920px, calc(100% - 24px)); max-height: min(96dvh, 900px); }
.monthly-assignment-review.has-monthly-proposal { width: min(1180px, calc(100% - 24px)); }
.monthly-assignment-review .impact-review-body { padding-bottom: 32px; scroll-padding-bottom: 32px; }
.monthly-assignment-review.has-monthly-proposal .impact-review-body { display: grid; flex: 1 1 auto; min-height: 0; overflow: hidden; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); grid-template-rows: auto auto auto minmax(0, 1fr) auto auto; align-content: stretch; align-items: start; gap: 0 24px; }
.monthly-assignment-review.has-monthly-proposal .monthly-assignment-scope,
.monthly-assignment-review.has-monthly-proposal .monthly-assignment-scope-meta,
.monthly-assignment-review.has-monthly-proposal .monthly-assignment-summary { grid-column: 1 / -1; }
.monthly-assignment-review.has-monthly-proposal .impact-review-body > .alert { grid-column: 1 / -1; }
.monthly-assignment-review.has-monthly-proposal .impact-review-body > .alert-warning { grid-row: 5; }
.monthly-assignment-review.has-monthly-proposal .impact-review-body > .alert-danger { grid-row: 6; }
.monthly-assignment-review.has-monthly-proposal .monthly-assignment-groups { grid-column: 1; grid-row: 4; align-self: stretch; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 12px; }
.monthly-assignment-review.has-monthly-proposal .monthly-assignment-groups:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.monthly-assignment-distribution { grid-column: 2; grid-row: 4; align-self: start; }
.monthly-assignment-distribution > summary { width: fit-content; margin-bottom: 8px; cursor: pointer; font-size: 17px; font-weight: 600; }
.monthly-assignment-distribution-content > p { margin: 0 0 12px; color: var(--brand-muted); font-size: 13px; }
.monthly-assignment-distribution table { width: 100%; border-collapse: collapse; font-size: 14px; }
.monthly-assignment-distribution th,
.monthly-assignment-distribution td { padding: 9px 6px; border-bottom: 1px solid var(--brand-border); text-align: right; white-space: nowrap; }
.monthly-assignment-distribution thead th { color: var(--brand-muted); font-size: 12px; font-weight: 600; }
.monthly-assignment-distribution th:first-child { text-align: left; white-space: normal; }
.monthly-assignment-distribution tbody th { font-weight: 500; }
.monthly-assignment-distribution .monthly-assignment-after { font-weight: 700; }
.monthly-assignment-scope { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.monthly-assignment-scope label { display: grid; gap: 6px; }
.monthly-assignment-scope-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; margin: 8px 0 12px; }
.monthly-assignment-scope-help { margin: 0; color: var(--brand-muted); font-size: 14px; }
.monthly-assignment-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 8px; padding: 10px 12px; border-radius: 6px; background: var(--brand-soft); font-weight: 600; }
.monthly-assignment-summary-copy { display: grid; flex: 1 1 auto; gap: 3px; min-width: 0; }
.monthly-assignment-summary-main { font-weight: 700; }
.monthly-assignment-summary-details { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.monthly-assignment-summary-detail { color: var(--brand-muted); font-size: 13px; font-weight: 500; }
.monthly-assignment-summary-action { flex: 0 0 auto; min-height: 36px; padding: 4px 8px; border: 0; border-radius: 5px; background: #fff7e8; color: #70490d; font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.monthly-assignment-summary-action:hover { background: #f7edda; }
.monthly-assignment-summary-action:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.monthly-assignment-summary-action:disabled { opacity: .6; cursor: not-allowed; }
.monthly-assignment-summary-separator { color: var(--brand-muted); }
.monthly-assignment-help { margin: 0; font-size: 14px; }
.monthly-assignment-help summary { width: fit-content; color: var(--brand-primary); cursor: pointer; }
.monthly-assignment-help p { margin: 8px 0 0; color: var(--brand-muted); }
.monthly-assignment-help[open] { grid-column: 1 / -1; }
.monthly-assignment-groups { display: grid; gap: 8px; }
.monthly-assignment-group { border: 1px solid var(--brand-border); border-radius: 8px; background: #fff; }
.monthly-assignment-group > summary { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; min-height: 52px; padding: 10px 14px; border-radius: 8px 8px 0 0; background: #fff; cursor: pointer; list-style: none; }
.monthly-assignment-group > summary::-webkit-details-marker { display: none; }
.monthly-assignment-group > summary::before { content: ""; width: 8px; height: 8px; flex: 0 0 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.monthly-assignment-group[open] > summary::before { transform: rotate(45deg); }
.monthly-assignment-group > summary > span:first-child { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; flex: 1; }
.monthly-assignment-group-count, .monthly-assignment-group-issues { font-size: 13px; color: var(--brand-muted); }
.monthly-assignment-group-issues { padding: 3px 8px; border-radius: 999px; background: #f7edda; color: #70490d; font-weight: 600; }
.monthly-assignment-rows { padding: 0 14px 8px; }
.monthly-assignment-category { margin-top: 12px; }
.monthly-assignment-category + .monthly-assignment-category { margin-top: 10px; }
.monthly-assignment-category h3 { margin: 0 0 2px; padding: 4px 0 6px; border-bottom: 1px solid var(--brand-border); font-size: 14px; color: var(--brand-muted); }
.monthly-assignment-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 280px); align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--brand-border); }
.monthly-assignment-category-has-heading .monthly-assignment-row { margin-left: 12px; padding-left: 10px; }
.monthly-assignment-category-has-heading h3 + .monthly-assignment-row { border-top: 0; }
.monthly-assignment-category-has-heading h3 { border-bottom: 0; }
.monthly-assignment-row-needs-review { margin-top: 4px; padding: 10px 8px; border-top-color: transparent; border-radius: 6px; background: #fff7e8; }
.monthly-assignment-row > div { display: grid; gap: 3px; }
.monthly-assignment-row > .form-select { width: 100%; min-width: 0; }
.monthly-assignment-issue { width: fit-content; padding: 2px 7px; border-radius: 999px; background: #f7edda; color: #70490d; font-size: 12px; }
@media (max-width: 600px) {
    .monthly-assignment-scope { grid-template-columns: 1fr; }
    .monthly-assignment-row { grid-template-columns: 1fr; gap: 8px; }
    .monthly-assignment-category-has-heading .monthly-assignment-row { margin-left: 8px; padding-left: 6px; }
}

@media (max-width: 800px) {
    .monthly-assignment-review.has-monthly-proposal .impact-review-body { grid-template-columns: minmax(0, 1fr); }
    .monthly-assignment-review.has-monthly-proposal .impact-review-body { overflow-y: auto; grid-template-rows: auto auto auto auto auto auto auto; align-content: start; }
    .monthly-assignment-scope-meta { grid-template-columns: minmax(0, 1fr); gap: 4px; }
    .monthly-assignment-review.has-monthly-proposal .monthly-assignment-groups { grid-column: 1; grid-row: 4; overflow: visible; }
    .monthly-assignment-review.has-monthly-proposal .monthly-assignment-distribution { grid-column: 1; grid-row: 5; position: static; margin: 12px 0; }
    .monthly-assignment-review.has-monthly-proposal .impact-review-body > .alert-warning { grid-row: 6; }
    .monthly-assignment-review.has-monthly-proposal .impact-review-body > .alert-danger { grid-row: 7; }
}

@media (max-width: 600px) {
    .monthly-assignment-summary-action { min-height: 44px; }
    .monthly-assignment-summary-reassurance { flex-basis: 100%; }
    .monthly-assignment-summary-separator { display: none; }
    .monthly-assignment-distribution table { table-layout: fixed; font-size: 12px; }
    .monthly-assignment-distribution th,
    .monthly-assignment-distribution td { padding: 8px 3px; }
    .monthly-assignment-distribution thead th:not(:first-child) { font-size: 10px; white-space: normal; }
    .monthly-assignment-distribution tbody td { white-space: nowrap; }
    .monthly-assignment-distribution th:first-child { width: 34%; overflow-wrap: anywhere; }
}
.impact-review-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 16px; flex-shrink: 0; }
.impact-review-header h2 { font-size: 20px; font-weight: 600; line-height: 1.3; margin: 0 0 6px; }
.impact-review-header p { margin: 0; color: var(--brand-muted); font-size: 14px; overflow-wrap: anywhere; }
.impact-review-header .btn-close { width: 44px; height: 44px; padding: 0; flex-shrink: 0; margin: -8px -8px 0 0; }
.impact-review-steps { display: flex; list-style: none; gap: 24px; padding: 12px 24px; margin: 0; border-top: 1px solid var(--brand-border); border-bottom: 1px solid var(--brand-border); flex-shrink: 0; font-size: 13px; color: var(--brand-muted); }
.impact-review-steps [aria-current="step"] { color: var(--brand-ink); font-weight: 700; }
.impact-review-body { overflow-y: auto; padding: 20px 24px; min-height: 0; overscroll-behavior: contain; }
.impact-review-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--brand-border); flex-shrink: 0; }
.impact-review-footer > button:first-child { margin-right: auto; }
.impact-review-footer .btn { min-height: 44px; }
.review-notice { display: flex; gap: 12px; padding: 16px; border-radius: 6px; margin-bottom: 20px; }
.review-notice-warning { background: #fff9eb; color: #664d03; }
.review-notice-danger { background: #fff2f1; color: #842029; }
.review-notice > i { font-size: 18px; flex-shrink: 0; }
.review-notice p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; }
.review-scope { padding: 0 0 20px; }
.review-scope .form-check { min-height: 24px; margin: 0; }
.review-scope p { margin: 6px 0 0 24px; font-size: 14px; color: var(--brand-muted); }
.review-section { border-bottom: 1px solid var(--brand-border); }
.review-section summary { display: flex; align-items: center; gap: 10px; padding: 14px 0; min-height: 44px; cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; }
.review-section summary::-webkit-details-marker { display: none; }
.review-section summary > i { font-size: 12px; flex-shrink: 0; }
.review-section[open] > summary > i { transform: rotate(90deg); }
.review-section summary > span:last-child { margin-left: auto; padding-left: 12px; font-weight: 400; color: var(--brand-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.review-action-choice { margin-bottom: 20px; }
.review-action-choice legend { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.review-action-choice .form-check { padding-block: 6px; margin: 0; }
.review-action-choice .form-text { margin: 8px 0 0; }
.review-confirmation-context { margin-bottom: 20px; }
.review-confirmation-context > div { margin-bottom: 12px; }
.review-confirmation-context dt { font-size: 13px; color: var(--brand-muted); font-weight: 400; }
.review-confirmation-context dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.review-section > p { font-size: 14px; color: var(--brand-muted); margin: 0 0 12px; }
.review-list { list-style: none; margin: 0; padding: 0; }
.review-list li { border-top: 1px solid var(--brand-soft); padding: 12px 0; font-size: 14px; overflow-wrap: anywhere; }
.review-list li > strong, .review-list li > span { display: block; }
.review-list li > span { margin-top: 3px; }
.review-list li .review-location { display: flex; align-items: baseline; gap: 6px; color: var(--brand-muted); font-size: 13px; }
.review-description { font-size: 14px; line-height: 1.5; margin: 20px 0 12px; }
@media (max-width: 600px) {
    .feedback { gap: 10px; padding: 16px 48px 16px 16px; }
    .feedback-actions { flex-direction: column; align-items: stretch; }
    .feedback-impact { gap: 8px 16px; }
    .impact-review-header { padding: 20px 20px 12px; }
    .impact-review-body { padding: 16px 20px; }
    .impact-review-steps { padding: 12px 20px; gap: 16px; }
    .impact-review-footer { padding: 16px 20px; }
    .impact-review-footer .btn { flex: 1 1 100px; }
}

.deletion-destination { display: block; width: 100%; max-width: 360px; margin-block: 12px; }
.deletion-destination .form-select { margin-block: 8px; min-height: 44px; }

.person-selection-title { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 10px; font-weight: 600; }
.person-selection-count { font-size: 12px; font-weight: 400; color: var(--brand-muted); }
.management-editor fieldset > .form-text { margin-top: 4px; margin-bottom: 8px; }
.management-editor .hierarchy-choice { margin-bottom: 0; }
.management-editor .hierarchy-root:not(:first-of-type) { margin-top: 4px; }
.management-editor :is(.hierarchy-choice, .operation-day-choices) .form-check { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-bottom: 0; padding: 6px 0; cursor: pointer; }
.management-editor :is(.hierarchy-choice, .operation-day-choices) .form-check-input { float: none; flex-shrink: 0; margin: 0; }
.management-editor :is(.hierarchy-choice, .operation-day-choices) .form-check:hover { color: var(--brand-strong); }

@media (max-width: 600px) {
    .management-editor :is(.hierarchy-choice, .operation-day-choices) .form-check { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
}

.management-editor .hierarchy-child { position: relative; }
.management-editor .hierarchy-child::before { content: ''; position: absolute; left: -12px; top: 0; bottom: 0; border-left: 1px solid var(--brand-border); }
.management-editor .hierarchy-child::after { content: ''; position: absolute; left: -12px; top: 18px; width: 8px; border-top: 1px solid var(--brand-border); }
@media (max-width: 600px) {
    .management-editor .hierarchy-child::after { top: 22px; }
}

.management-property { min-width: 0; border: 1px solid var(--brand-border); border-radius: 6px; padding: 16px; }
.management-property > legend { float: left; }
.management-property > .form-text { clear: both; }

.management-property > div { clear: both; }

.person-form-column { align-self: start; min-width: 0; }

.property-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.property-heading > .form-label { margin-bottom: 0; }
.field-help { position: relative; flex-shrink: 0; }
.field-help-button { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 0; border-radius: 4px; background: transparent; color: var(--brand-muted); padding: 0; }
.field-help-button:hover, .field-help-button:focus-visible { background: var(--brand-soft); color: var(--brand-strong); }
.field-help-button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.field-help-text { position: absolute; right: 0; top: 100%; width: 240px; max-width: calc(100vw - 80px); padding: 12px; border: 1px solid var(--brand-border); border-radius: 6px; background: #fff; color: var(--brand-ink); box-shadow: 0 4px 16px #20372e20; font-size: 14px; font-weight: 400; line-height: 1.5; z-index: 20; }

.field-help-list { display: block; padding-left: 16px; }
.field-help-list > [role="listitem"] { display: list-item; list-style-type: disc; }
.field-help-list > [role="listitem"] + [role="listitem"] { margin-top: 6px; }

.export-menu-heading { padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--brand-muted); }

.assignment-hover { position: relative; }
.assignment-hover:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; border-radius: 3px; }
.assignment-hover-text { position: fixed; z-index: 1060; width: min(320px, calc(100vw - 24px)); max-height: min(250px, calc(100vh - 24px)); overflow: auto; padding: 12px; border: 1px solid var(--brand-border); border-radius: 6px; background: white; color: var(--brand-ink); box-shadow: 0 4px 16px #20372e20; font-size: 14px; font-weight: 400; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }

.success-toast-container { position: fixed; top: max(16px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); z-index: 1090; width: 360px; max-width: calc(100% - 32px); pointer-events: none; }
.success-toast { width: 360px; max-width: 100%; background: #fff; border-color: #c4ddcc; color: #0f5132; pointer-events: auto; }
.success-toast .toast-header { background: #edf7ef; color: inherit; padding: 12px 16px; }
.success-toast .toast-header .btn-close { min-width: 32px; min-height: 32px; margin-left: 12px; }
.success-toast .toast-body { padding: 12px 16px 16px; overflow-wrap: anywhere; }
@media print { .success-toast-container { display: none !important; } }

.color-tag { display: inline-block; width: 0.65em; height: 0.65em; border-radius: 50%; flex: 0 0 auto; margin-right: 0.35em; border: 1px solid transparent; background-clip: border-box; vertical-align: middle; }
.calendar-assignment .color-tag, .print-document .color-tag { box-sizing: border-box; width: 8px; height: 8px; }
.color-tags-hidden :is(.calendar-assignment, .date-preview, .assignment-groups, .people-groups, .duty-groups) .color-tag { visibility: hidden !important; }
.calendar-assignment .color-tag-label { display: inline; }
.date-preview-date, .date-preview-group, .date-preview-row, .date-preview-person { display: block; }
.date-preview-duty, .date-preview-person { padding-left: 10px; }

.color-tag-usage { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 12px; border-radius: 6px; background: #fff3cd; color: #664d03; font-size: 13px; line-height: 1.5; }
.color-tag-usage .mdi { margin-top: 2px; font-size: 16px; }
.color-tag-picker { min-width: 0; }
.color-tag-trigger { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 10px; border: 1px solid var(--brand-border); border-radius: 6px; cursor: pointer; list-style: none; }
.color-tag-trigger::-webkit-details-marker { display: none; }
.color-tag-trigger .mdi { margin-left: auto; }
.color-tag-options { margin-top: 8px; padding: 6px; border: 1px solid var(--brand-border); border-radius: 8px; }
.color-tag-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); overflow: hidden; border-radius: 4px; }
.color-tag-swatch { appearance: none; -webkit-appearance: none; display: block; width: 100%; min-width: 0; height: 26px; margin: 0; border: 0; border-radius: 0; cursor: pointer; }
.color-tag-swatch:checked { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px #182821; }
.color-tag-swatch:focus-visible { position: relative; z-index: 1; outline: 2px solid #182821; outline-offset: -4px; }
.color-tag-trigger:focus-visible { outline: 3px solid var(--brand-strong); outline-offset: 2px; }
.color-tag-empty { display: flex; align-items: center; gap: 8px; min-height: 36px; margin-top: 6px; cursor: pointer; }

.print-document .color-tag { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.print-color-background td { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.print-color-background .color-tag:not(.person-color-tag) { visibility: hidden !important; }
@media print {
    .print-color-background .print-assignments li, .print-color-background .print-duty-row { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
@media print { .print-assignments .print-tag-label { display: inline; } }
