:root {
  color-scheme: light;
  --canvas: #f5f6f2;
  --white: #fff;
  --ink: #192621;
  --muted: #5b6b62;
  --faint: #65756c;
  --line: #dfe6df;
  --line-light: #ebefea;
  --green: #18543e;
  --green-dark: #133e30;
  --green-soft: #e9f3eb;
  --green-line: #c8ddce;
  --amber: #8c4b0b;
  --amber-soft: #fff2df;
  --red: #a43b2d;
  --blue: #405987;
  --blue-soft: #edf1fa;
  --lavender: #655585;
  --lavender-soft: #f1edf8;
  --shadow: 0 1px 2px #142e1e08;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #438668; outline-offset: 3px; }
a { color: var(--green); }
button svg, a svg { flex-shrink: 0; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 19px; font-weight: 750; letter-spacing: .015em; }
h3 { font-size: 15px; font-weight: 750; }
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner, .shell, .site-footer { width: min(100% - 64px, 1264px); margin-inline: auto; }
.header-inner { height: 66px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 780; font-size: 18px; letter-spacing: .04em; }
.brand img { display: block; }
.shell { padding-block: 26px 28px; min-height: calc(100vh - 140px); }
.site-footer { padding: 12px 0 24px; color: var(--faint); font-size: 12px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
.loading { padding: 35px 0; color: var(--muted); }

.button { min-height: 38px; padding: 7px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--white); color: var(--ink); border: 1px solid var(--line); border-radius: 9px; font-size: 13px; line-height: 1.45; font-weight: 680; text-decoration: none; white-space: nowrap; transition: background .14s, border-color .14s; }
.button:hover { background: #f2f6f2; border-color: #c7d8cb; }
.button.primary { background: var(--green); border-color: var(--green); color: var(--white); }
.button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
.button.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.button.subtle:hover { color: var(--green); background: var(--green-soft); }
.button.icon-only { width: 36px; padding: 0; }
.button.secondary { color: var(--green); }
.button.danger { color: var(--red); }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.text-button:hover { color: var(--green-dark); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.subtitle, .muted { color: var(--muted); }
.small { font-size: 12px; }
.subdued { color: var(--faint); font-size: 12px; }
.eyebrow { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 740; letter-spacing: .10em; color: var(--green); }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 19px; }
.hero h1 { font-size: clamp(27px, 3vw, 38px); font-weight: 800; letter-spacing: -.025em; line-height: 1.23; margin: 5px 0 6px; }
.hero .subtitle { font-size: 13px; }
.period-actions { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.month-switch, .segmented { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--white); padding: 3px; box-shadow: var(--shadow); }
.month-switch button, .segmented button { display: flex; justify-content: center; align-items: center; min-height: 34px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; padding: 4px 10px; font-weight: 700; white-space: nowrap; }
.month-switch button:hover, .segmented button:hover { background: #f0f4ef; }
.month-switch .arrow { width: 31px; padding: 0; color: var(--muted); }
.segmented button { min-width: 52px; color: var(--muted); }
.segmented button.active { background: var(--green); color: var(--white); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; background: var(--white); border: 1px solid var(--line); border-radius: 13px; padding: 5px; box-shadow: var(--shadow); margin-bottom: 12px; }
.step { position: relative; border: 1px solid transparent; border-radius: 9px; background: transparent; display: flex; text-align: left; align-items: center; gap: 11px; padding: 9px 12px; min-width: 0; }
.step:hover { background: #f5f8f4; }
.step.active { background: #edf5ee; border-color: #d9e7dc; }
.step-number { flex: 0 0 31px; width: 31px; height: 31px; border-radius: 8px; background: #f0f3ee; color: var(--muted); display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.step.active .step-number { color: var(--white); background: var(--green); }
.step-name { display: block; font-size: 14px; font-weight: 760; }
.step.active .step-name { color: var(--green-dark); }
.step-sub { display: block; margin-top: 1px; color: var(--faint); font-size: 11px; }
.step-icon { margin-left: auto; color: #91a098; }
.step.active .step-icon { color: var(--green); }
.demo-banner, .import-banner, .inline-warning { display: flex; align-items: center; gap: 10px; border: 1px solid var(--green-line); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px; background: #eef5ec; font-size: 12px; color: var(--green-dark); }
.demo-banner strong { font-size: 12px; }
.banner-copy { flex: 1; }
.demo-banner .text-button { white-space: nowrap; }
.demo-banner .button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.inline-warning { background: var(--amber-soft); color: var(--amber); border-color: #f1dbb7; margin: 0 0 14px; }
.inline-warning svg { flex: 0 0 auto; }
.import-banner { padding: 10px 12px; }
.import-banner .button { margin-left: auto; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); min-width: 0; }
.panel-head { padding: 16px 17px 12px; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title { display: flex; align-items: center; gap: 8px; }
.section-title svg { color: var(--green); }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 14px; }
.stat { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 67px; }
.stat-icon, .tile-icon { display: grid; place-items: center; flex: 0 0 39px; width: 39px; height: 39px; border-radius: 10px; background: var(--green-soft); color: var(--green); }
.stat-icon.violet { background: var(--lavender-soft); color: var(--lavender); }
.stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 650; }
.stat-value { font-size: 24px; line-height: 1.15; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-value span { padding-left: 4px; font-size: 11px; font-weight: 650; color: var(--muted); }
.stat-detail { color: var(--faint); font-size: 11px; margin-left: auto; padding-left: 6px; text-align: right; }
.calendar { margin-bottom: 14px; }
.calendar .panel-head { padding: 11px 14px 9px; }
.calendar .section-title h2 { font-size: 15px; }
.calendar-key { display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 11px; }
.calendar-key span { display: flex; align-items: center; gap: 4px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #aab7ad; }
.dot.ok { background: #448968; }
.dot.short { background: #c47d28; }
.date-scroll { overflow-x: auto; scrollbar-width: thin; padding: 0 13px 12px; }
.date-grid { display: grid; grid-template-columns: repeat(var(--days), minmax(0, 1fr)); min-width: calc(var(--days) * 43px); gap: 5px; }
.date { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 59px; gap: 0; border: 1px solid var(--line); background: #fcfdfb; border-radius: 8px; padding: 3px 1px 5px; color: var(--ink); }
.date:hover { border-color: #a6c4ad; background: var(--green-soft); }
.date.active { background: var(--green); color: var(--white); border-color: var(--green); }
.date-num { font-size: 17px; line-height: 1.3; font-weight: 800; font-variant-numeric: tabular-nums; }
.date-weekday { font-size: 11px; color: var(--muted); }
.date.sunday .date-weekday { color: var(--red); }
.date.saturday .date-weekday { color: var(--blue); }
.date.active .date-weekday { color: #e5f2e7; }
.date-status { height: 7px; display: grid; place-items: center; margin-top: 3px; }
.date.active .dot.ok { background: #a8d4b5; }
.date.active .dot.short { background: #ffc179; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(285px, 338px); gap: 14px; align-items: start; }
.editor .section-title h2 { font-size: 20px; }
.editor aside { display: grid; gap: 12px; }
.count-pill { display: inline-flex; align-items: center; white-space: nowrap; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 720; padding: 3px 8px; }
.candidate-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; padding: 0 17px 11px; }
.filters { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.filter { color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font-size: 12px; font-weight: 670; min-height: 30px; }
.filter:hover, .filter.active { background: var(--green-soft); border-color: var(--green-line); color: var(--green-dark); }
.search { position: relative; display: flex; align-items: center; color: var(--faint); }
.search svg { position: absolute; left: 8px; pointer-events: none; }
.search input { width: 135px; padding-left: 27px; min-height: 31px; font-size: 12px; }
.field, .select { width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid #d6dfd6; border-radius: 7px; background-color: var(--white); font-size: 13px; }
.field::placeholder { color: #78867d; }
.field:focus, .select:focus { border-color: #77a387; outline-offset: 1px; }
.select { appearance: none; padding-right: 23px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235b6b62' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-position: right 6px center; background-repeat: no-repeat; overflow: hidden; text-overflow: ellipsis; }
textarea.field { min-height: 62px; resize: vertical; }
.label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 690; }
.label .field, .label .select { font-weight: 500; color: var(--ink); }
.candidate-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.candidate-table col:nth-child(1) { width: 35%; }
.candidate-table col:nth-child(2) { width: 34%; }
.candidate-table col:nth-child(3) { width: 18%; }
.candidate-table col:nth-child(4) { width: 13%; }
.candidate-table thead { background: #f6f8f4; color: var(--muted); font-size: 11px; }
.candidate-table th { text-align: left; padding: 7px 10px; font-weight: 710; }
.candidate-table td { border-top: 1px solid var(--line-light); padding: 7px 10px; vertical-align: middle; }
.candidate-table tr:last-child td:first-child { border-bottom-left-radius: 12px; }
.candidate-table tr:last-child td:last-child { border-bottom-right-radius: 12px; }
.candidate-table th:first-child, .candidate-table td:first-child { padding-left: 17px; }
.candidate-table th:last-child, .candidate-table td:last-child { text-align: center; padding-right: 13px; }
.candidate-table tr.confirmed { background: #fbfdfb; }
.candidate-table tr.stale { background: #fffaf0; }
.candidate-table .select { min-height: 30px; font-size: 12px; }
.candidate-table .select.group-L { background-color: #eef5e7; color: #385532; border-color: #e1ebdc; }
.candidate-table .select.group-D { background-color: var(--blue-soft); color: #3f5279; border-color: #e2e8f4; }
.staff-cell { display: flex; align-items: center; min-width: 0; gap: 8px; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; flex: 0 0 29px; border-radius: 8px; font-size: 12px; background: #e8f2e9; color: #346348; font-weight: 760; }
.avatar.tone-1 { color: #4c5980; background: #eaf0f8; }
.avatar.tone-2 { color: #795230; background: #f7eee1; }
.avatar.tone-3 { color: #785478; background: #f2eaf2; }
.staff-name { display: block; font-weight: 730; overflow-wrap: anywhere; }
.staff-detail { color: var(--muted); font-size: 10px; display: block; overflow-wrap: anywhere; }
.row-hint { font-size: 10px; color: var(--amber); display: block; margin-top: 2px; overflow-wrap: anywhere; }
.wish-list { font-size: 10px; color: var(--faint); margin-top: 2px; overflow-wrap: anywhere; }
.place { display: inline-grid; place-items: center; vertical-align: middle; min-width: 32px; height: 31px; border: 1px solid #cddbd0; border-radius: 7px; background: var(--white); color: var(--green); padding: 0 4px; font-weight: 720; font-size: 11px; }
.place:hover { background: var(--green-soft); }
.place.placed { border-color: var(--green); background: var(--green); color: var(--white); }
.place.placed:hover { background: var(--green-dark); }
.place.remove { border-color: #f1d8c2; color: var(--red); margin-top: 2px; }
.table-note { color: var(--faint); font-size: 11px; padding: 9px 16px; border-top: 1px solid var(--line-light); }
.monthly-person-hint { display: block; margin-top: 3px; color: var(--green); font-size: 11px; font-variant-numeric: tabular-nums; }
.monthly-panel .panel-head { padding: 13px 12px 9px; }
.monthly-panel h3 { font-size: 14px; }
.monthly-panel .count-pill { margin-left: auto; font-size: 10px; }
.monthly-total { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; background: var(--green-soft); color: var(--green-dark); font-size: 11px; font-variant-numeric: tabular-nums; }
.monthly-total strong { font-size: 13px; margin-left: 2px; }
.monthly-scroll { max-height: 280px; overflow: auto; scrollbar-width: thin; border-block: 1px solid var(--line-light); }
.monthly-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; font-variant-numeric: tabular-nums; }
.monthly-table thead th { position: sticky; top: 0; z-index: 1; background: #f6f8f4; color: var(--muted); font-size: 10px; font-weight: 650; white-space: nowrap; }
.monthly-table th, .monthly-table td { padding: 8px 4px; border-bottom: 1px solid var(--line-light); text-align: right; }
.monthly-table th:first-child { width: 43%; text-align: left; padding-left: 12px; }
.monthly-table th:last-child, .monthly-table td:last-child { padding-right: 12px; }
.monthly-table tbody th { font-weight: 650; overflow-wrap: anywhere; }
.monthly-table small { font-size: 10px; margin-left: 2px; }
.monthly-placed { color: var(--green); background: #f6faf5; }
.monthly-note, .monthly-pending, .monthly-empty { font-size: 10px; color: var(--muted); padding: 9px 12px; }
.monthly-pending { padding-top: 0; color: var(--amber); }
.auto-placement { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 15px; }
.auto-placement h3 { color: var(--green-dark); }
.auto-placement p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.auto-preference { margin-top: 6px; width: fit-content; cursor: pointer; }
dialog.auto-dialog { width: min(100% - 24px, 940px); }
.auto-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.auto-rules span { padding: 4px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; font-weight: 700; }
.auto-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.auto-overview > div { display: grid; gap: 3px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf6; }
.auto-overview span { color: var(--muted); font-size: 11px; }
.auto-overview strong { font-size: 18px; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.dialog-body .auto-alert { padding: 8px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); font-size: 12px; }
.auto-alert ul { margin: 4px 0 0; padding-left: 19px; }
.auto-table-scroll { max-height: min(40vh, 340px); overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.auto-table { width: 100%; min-width: 680px; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.auto-table th, .auto-table td { padding: 7px 9px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line-light); }
.auto-table thead th { position: sticky; top: 0; background: #edf4eb; white-space: nowrap; }
.auto-table tbody th, .auto-table td strong { white-space: nowrap; }
.auto-table summary, .auto-monthly-preview > summary { cursor: pointer; color: var(--green); font-size: 12px; font-weight: 700; }
.auto-student-list { margin-top: 6px; display: grid; gap: 4px; min-width: 150px; }
.auto-monthly-preview > .monthly-panel { margin-top: 8px; }
.empty { text-align: center; padding: 25px 15px; color: var(--muted); }
.empty .tile-icon { margin: 0 auto 8px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; }
.empty p { font-size: 12px; }
.empty .button { margin-top: 11px; }

.coverage { padding: 0 14px 12px; }
.coverage-row { border: 1px solid var(--line-light); border-radius: 9px; background: #fcfdfb; padding: 8px 10px; margin-bottom: 7px; }
.coverage-title { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.coverage-title h3 { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.group-mark { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; color: #3d5f39; background: #eaf2e4; font-size: 12px; font-weight: 800; }
.group-mark.D { color: #405987; background: var(--blue-soft); }
.coverage-ratio { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); font-size: 12px; }
.coverage-ratio strong { color: var(--ink); font-size: 18px; }
.meter { margin: 6px 0 7px; width: 100%; height: 4px; border-radius: 999px; background: #e8eee7; overflow: hidden; }
.meter i { display: block; height: 100%; background: #54876a; border-radius: 999px; }
.meter.short i { background: #d39d54; }
.coverage-footer { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.target-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.target-label input { width: 51px; min-height: 28px; padding: 3px 4px; text-align: center; }
.coverage-badge { color: var(--faint); font-size: 10px; text-align: right; }
.coverage-badge .warn { color: var(--amber); font-weight: 740; }
.coverage-badge .good { color: var(--green); font-weight: 740; }
.coverage-footer .chips { display: grid; text-align: right; }
.notes { display: grid; gap: 7px; padding: 0 14px 12px; }
.wash-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 6px; }
.wash-row .button { min-height: 36px; padding-inline: 8px; font-size: 11px; }
.checkbox-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.checkbox-label input { accent-color: var(--green); width: 16px; height: 16px; }

.page-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 19px 0 12px; }
.page-head .subtitle { font-size: 13px; margin-top: 4px; }
.two-up { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.action-card { padding: 17px; }
.action-card .section-title { align-items: flex-start; gap: 10px; }
.action-card .section-title p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.action-card .tile-icon { flex: 0 0 37px; width: 37px; height: 37px; }
.action-card .tile-icon.violet { background: var(--lavender-soft); color: var(--lavender); }
.action-card .fields { margin-top: 15px; display: grid; gap: 12px; }
.form-link { display: flex; gap: 6px; align-items: end; }
.form-link label { flex: 1; min-width: 0; }
.form-link .button { min-height: 36px; }
.callout { background: #f6f8f4; border: 1px solid var(--line-light); border-radius: 9px; padding: 11px; display: grid; gap: 6px; }
.callout p, .callout ol { font-size: 12px; color: var(--muted); }
.callout ol { margin: 0; padding-left: 18px; }
.callout .toolbar { margin-top: 3px; }
.upload-zone { width: 100%; min-height: 120px; display: grid; align-content: center; justify-items: center; gap: 5px; background: #f8fbf7; border: 1px dashed #a5c3ae; border-radius: 10px; color: var(--green); padding: 13px; }
.upload-zone:hover, .upload-zone.dragover { background: var(--green-soft); border-color: var(--green); }
.upload-zone strong { font-size: 14px; }
.upload-zone span { font-size: 11px; color: var(--muted); }
details.paste { border-top: 1px solid var(--line-light); padding-top: 10px; }
details.paste summary { cursor: pointer; color: var(--green); font-weight: 700; font-size: 12px; }
details.paste > div { display: grid; gap: 7px; margin-top: 8px; }
.form-footer { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.form-footer a { text-underline-offset: 3px; }
.export-panel { overflow: hidden; }
.download-result { padding: 8px 11px; margin-bottom: 10px; border: 1px solid var(--green-line); border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-size: 12px; overflow-wrap: anywhere; }
.download-result a { font-weight: 740; text-underline-offset: 3px; }
.export-panel .panel-head { padding-block: 12px; }
.export-scroll { overflow: auto; max-height: min(64vh, 600px); scrollbar-width: thin; border-top: 1px solid var(--line); }
.sheet { border-collapse: separate; border-spacing: 0; width: 100%; min-width: calc(143px + var(--days) * 54px); font-size: 12px; text-align: center; }
.sheet th, .sheet td { border: 0; border-right: 1px solid #c8d1c9; border-bottom: 1px solid #c8d1c9; padding: 4px 3px; min-width: 54px; height: 26px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet .sheet-label { position: sticky; left: 0; z-index: 1; min-width: 139px; max-width: 139px; padding-inline: 8px; text-align: left; background: #f5f7f3; }
.sheet .sheet-staff .sheet-label { background: var(--white); }
.sheet thead th { background: #eff3ed; position: sticky; top: 0; z-index: 2; }
.sheet thead tr:nth-child(2) th { top: 26px; }
.sheet thead .sheet-label { z-index: 3; background: #eff3ed; }
.sheet .sheet-date, .sheet .sheet-weekday, .sheet .sheet-target { background: #eff3ed; font-weight: 700; }
.sheet .sheet-note td { height: 56px; vertical-align: top; }
.sheet .sheet-note td, .sheet .sheet-note-line td { max-width: 72px; }
.sheet .holiday { color: #b02830; }
.sheet .shortage-cell { color: var(--amber); background: var(--amber-soft); font-weight: 740; }

dialog { width: min(100% - 28px, 530px); max-height: 90vh; margin: auto; border: 1px solid var(--line); border-radius: 15px; padding: 0; color: var(--ink); background: var(--white); box-shadow: 0 20px 70px #102a1f36; }
dialog::backdrop { background: #10231b65; }
.dialog-inner { padding: 17px; }
.dialog-head { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.dialog-head .button { min-height: 31px; height: 31px; }
.dialog-body { display: grid; gap: 12px; margin: 9px 0 0; }
.dialog-body p, .dialog-body ol { font-size: 13px; color: var(--muted); }
.dialog-body ol { padding-left: 22px; margin: 0; }
.dialog-body li + li { margin-top: 4px; }
.dialog-footer { display: flex; justify-content: end; gap: 6px; flex-wrap: wrap; margin-top: 15px; }
.dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dialog-code { width: 100%; min-height: 130px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8f4; padding: 7px; resize: vertical; font: 11px/1.45 ui-monospace, monospace; }
.notice { position: fixed; z-index: 20; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); width: fit-content; max-width: calc(100% - 36px); border-radius: 9px; padding: 9px 13px; background: var(--green-dark); color: var(--white); box-shadow: 0 4px 18px #15251c33; font-size: 13px; }
.notice.error { background: #823925; }

@media (max-width: 900px) {
  .header-inner, .shell, .site-footer { width: calc(100% - 36px); }
  .step-icon, .stat-detail { display: none; }
  .editor { grid-template-columns: minmax(0, 1fr) minmax(245px, 285px); gap: 9px; }
  .editor .panel-head, .candidate-toolbar { padding-inline: 12px; }
  .candidate-table th:first-child, .candidate-table td:first-child { padding-left: 10px; }
  .candidate-table th:last-child, .candidate-table td:last-child { padding-right: 8px; }
  .candidate-table th, .candidate-table td { padding-inline: 5px; }
}
@media (max-width: 690px) {
  .auto-placement { flex-wrap: wrap; padding: 10px 12px; margin-bottom: 9px; }
  .auto-placement .button { margin-left: auto; }
  .auto-overview > div { padding: 7px; }
  .auto-overview strong { font-size: 16px; }
  .header-inner, .shell, .site-footer { width: calc(100% - 24px); }
  .header-inner { height: 54px; }
  .brand { font-size: 16px; }
  .brand img { width: 31px; height: 31px; }
  .header-help { font-size: 12px; padding-inline: 5px; }
  .shell { padding-top: 15px; }
  .hero { align-items: start; flex-direction: column; gap: 9px; margin-bottom: 12px; }
  .hero h1 { margin-top: 3px; }
  .period-actions { width: 100%; }
  .period-actions > .button { margin-left: auto; }
  .steps { margin-bottom: 9px; padding: 3px; gap: 2px; }
  .step { padding: 7px 4px; gap: 4px; justify-content: center; }
  .step-number { flex-basis: 23px; width: 23px; height: 23px; font-size: 11px; border-radius: 6px; }
  .step-name { font-size: 11px; white-space: nowrap; }
  .step-sub { display: none; }
  .demo-banner, .import-banner { gap: 6px; padding: 7px; flex-wrap: wrap; margin-bottom: 10px; }
  .demo-banner .banner-copy { min-width: 140px; }
  .demo-banner .banner-copy span { display: block; }
  .demo-banner .text-button { font-size: 11px; }
  .summary { gap: 6px; margin-bottom: 9px; }
  .stat { gap: 5px; padding: 6px; min-height: 54px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 20px; }
  .stat-value span { font-size: 10px; padding-left: 2px; }
  .stat-icon { flex-basis: 26px; width: 26px; height: 26px; border-radius: 7px; }
  .stat-icon svg { width: 14px; height: 14px; }
  .calendar { margin-bottom: 9px; }
  .calendar .panel-head { padding: 8px 9px; }
  .date-scroll { padding: 0 8px 8px; }
  .date-grid { min-width: calc(var(--days) * 46px); }
  .date { min-height: 50px; }
  .date-num { font-size: 15px; }
  .calendar-key { gap: 5px; }
  .editor, .two-up { grid-template-columns: minmax(0, 1fr); }
  .editor aside { display: contents; }
  .editor .coverage-panel { grid-row: 1; }
  .editor .candidates { grid-row: 2; }
  .editor .monthly-panel { grid-row: 3; }
  .editor .notes-panel { grid-row: 4; }
  .editor .section-title h2 { font-size: 18px; }
  .panel-head { padding-top: 12px; }
  .editor .coverage { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .editor .coverage-row { margin: 0; padding: 5px; }
  .editor .coverage > p { grid-column: 1 / -1; }
  .avatar { flex-basis: 23px; width: 23px; height: 23px; font-size: 11px; border-radius: 6px; }
  .staff-cell { gap: 4px; }
  .candidate-table col:nth-child(1) { width: 33%; }
  .candidate-table col:nth-child(2) { width: 33%; }
  .candidate-table col:nth-child(3) { width: 21%; }
  .candidate-table td, .candidate-table th { padding-inline: 4px; }
  .candidate-table .select { padding-left: 4px; padding-right: 16px; background-position: right 2px center; background-size: 12px 12px; }
  .candidate-table .place { min-width: 32px; height: 34px; }
  .search input { width: 110px; }
  .page-head { align-items: start; flex-direction: column; margin-top: 13px; }
  .page-head .toolbar .button { font-size: 12px; }
  .field:not(.search .field), .select { font-size: 16px; }
  .candidate-table .select { font-size: 13px; }
  .action-card { padding: 12px; }
  .site-footer { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }

.sheet .sheet-department th, .sheet .sheet-department td { background: var(--green-soft); color: var(--green-dark); }
.roster-editor { min-height: 200px; }

.response-shell { width: min(100% - 24px, 700px); margin: 28px auto; }
.response-shell h1 { margin: 0 0 6px; }
.response-day { border: 1px solid var(--line); border-radius: 9px; padding: 9px; }
.response-day summary { cursor: pointer; font-weight: 700; }
.day-count { font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.response-times { display: grid; grid-template-columns: repeat(auto-fit,minmax(75px,1fr)); gap: 6px; margin-top: 8px; }
.response-times label { display: flex; align-items: center; gap: 3px; padding: 4px; font-size: 13px; }
#response-error { color: var(--danger, #963526); }
.actual-time { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 5px; font-size: 12px; }
.wish-edit{font-size:10px;margin-top:2px}dialog.photo-dialog{width:min(100% - 20px,1200px)}.photo-columns{display:grid;grid-template-columns:minmax(200px,.8fr) minmax(270px,1fr);gap:20px;align-items:start}.photo-source{margin:0;max-height:58vh;overflow:auto;background:#edf2ec;border:1px solid var(--line);border-radius:8px}.photo-source img{width:100%;display:block}.photo-source figcaption{padding:7px;font-size:11px;color:var(--muted)}.photo-controls{display:grid;gap:14px}.photo-controls details summary,.photo-original summary{font-size:13px;color:var(--green);cursor:pointer;margin-bottom:8px}.photo-error{color:#9b342b!important;min-height:1em}.photo-table-scroll{max-height:50vh;overflow:auto;border:1px solid var(--line);border-radius:8px}.photo-table{border-collapse:separate;border-spacing:0;width:max-content;font-size:12px}.photo-table th{position:sticky;top:0;background:#edf3ed;z-index:2;padding:7px;border-right:1px solid var(--line)}.photo-table th small{display:block;font-weight:400;color:var(--muted)}.photo-table td{padding:3px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:white}.photo-table td:nth-child(2){position:sticky;left:0;z-index:1}.photo-table td:nth-child(2) input{width:145px}.photo-table td:nth-child(3) select,.photo-table td:nth-child(4) select{width:105px}.photo-table td:nth-child(n+5) input{width:83px;min-width:83px}.photo-table input,.photo-table select{font-size:13px;min-height:36px}.photo-table .needs-check{border-color:#d6a144;background:#fff8df}.photo-table tr.excluded{opacity:.45}.photo-dialog progress{width:100%;accent-color:var(--green);height:12px}@media(max-width:690px){.photo-columns{grid-template-columns:minmax(0,1fr);gap:12px}.photo-columns .photo-source{max-height:26vh}.photo-dialog .dialog-inner{padding:12px}.photo-table .field,.photo-table .select{font-size:16px}}
.fixed-groups{font-size:11px;color:var(--green);line-height:1.5;display:block}.fixed-choice{max-width:155px}.off-row .fixed-choice{color:var(--red)}.fixed-preference{margin-top:7px}.photo-table td:nth-child(n+5) select{width:92px;min-width:92px}.response-fixed{display:grid;grid-template-columns:repeat(auto-fit,minmax(135px,1fr));gap:8px}.response-fixed-day{padding:8px;border:1px solid var(--line);border-radius:8px}.fixed-day-choice{display:grid;gap:4px;font-size:13px}.response-fixed-day .checkbox-label{margin-top:8px}

.auto-controls { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.auto-scope { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.auto-scope .label { min-width: 165px; }
.shift-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; }
.shift-lock, .lock-label { font-size: 11px; white-space: nowrap; }
.shift-lock[aria-pressed="true"] { background: var(--green-soft); border-radius: 5px; padding: 1px 4px; text-decoration: none; }
.change-table { min-width: 465px; }
dialog.review-dialog { width: min(100% - 28px, 620px); }
.change-table th, .change-table td { min-width: 98px; }
.change-table td:last-child { color: var(--green-dark); }
.review-list, .advice-list { display: grid; gap: 8px; }
.review-item, .advice-person { border: 1px solid var(--line); border-radius: 9px; padding: 10px; }
.review-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(114px, auto); gap: 8px; align-items: center; }
.source-text { display: block; overflow-wrap: anywhere; margin-top: 3px; color: var(--muted); font-size: 12px; }
.review-status:empty { display: none; }
.review-status { color: var(--green-dark); font-size: 12px; }
.advice-person summary { cursor: pointer; }
.advice-person summary span { display: block; margin: 3px 0 0 15px; color: var(--muted); font-size: 12px; }
.advice-person p { margin-top: 6px; }
.advice-person ul { list-style: none; padding: 0; margin: 7px 0; }
.advice-person li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 5px 0; gap: 5px 10px; border-top: 1px solid var(--line); }
.advice-blocked { margin-top: 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 560px) {
  .auto-scope { width: 100%; }
  .auto-scope .label { flex: 1 0 155px; }
  .auto-scope .button { flex: 1 0 auto; }
}
.photo-table .photo-name-cell { min-width: 178px; vertical-align: top; }
.photo-table td.photo-name-cell > input, .photo-table td.photo-name-cell > select { width: 100%; }
.photo-name-cell > small { display: block; margin: 3px 0; color: var(--muted); overflow-wrap: anywhere; max-width: 180px; }
.photo-name-cell .photo-roster-choice { margin-top: 4px; }
.photo-name-tools { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; padding: 0 2px; font-size: 11px; color: var(--muted); }
.photo-name-tools button { min-height: 28px; }
