:root {
  color: #1c2433;
  background: #f3f0e8;
  font-family: "Segoe UI Variable Text", "Segoe UI", sans-serif;
  font-synthesis: none;
  --green: #0c6e5c;
  --jade-ink: #084c40;
  --jade-soft: #e7f5f0;
  --border: #e4ddd0;
  --muted: #5c6b7e;
  --ink: #1c2433;
  --ink-soft: #3c4a5e;
  --card: #fffdf9;
  --paper: #f3f0e8;
  --amber: #8a5a12;
  --shadow: 0 1px 2px rgba(28, 36, 51, .04), 0 12px 32px rgba(28, 36, 51, .045);
  --sidebar: 244px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-size: 14px;
  background:
    radial-gradient(900px 420px at 100% -80px, rgba(12, 110, 92, .07), transparent 55%),
    var(--paper);
}
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea { outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--green); }
:focus-visible { outline: 2px solid #0c6e5c; outline-offset: 3px; }

.sidebar {
  width: var(--sidebar);
  position: fixed;
  inset: 0 auto 0 0;
  background: linear-gradient(180deg, #152838 0%, #0e1b26 100%);
  color: #b7c5cf;
  padding: 28px 16px 20px;
  display: flex;
  flex-direction: column;
  z-index: 6;
}
.logo {
  text-decoration: none;
  color: white;
  font-size: 26px;
  letter-spacing: -.04em;
  font-weight: 700;
  padding: 0 12px;
  display: flex;
  align-items: baseline;
}
.logo span { font-weight: 400; }
.logo i {
  color: #49d6ae;
  font-style: normal;
  font-size: 16px;
  margin-left: 3px;
  text-shadow: 0 0 10px rgba(73, 214, 174, .75);
}
.workspace-label {
  font-size: 10px;
  letter-spacing: .16em;
  margin: 36px 12px 12px;
  color: #7e93a2;
}
.nav {
  border: 0;
  background: none;
  color: #c5d2db;
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  text-align: left;
  margin: 2px 0;
  font-size: 14px;
}
.nav::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: currentColor;
  opacity: .35;
  flex-shrink: 0;
}
.nav span { font-size: 13.5px; font-weight: 550; }
.nav.active {
  background: rgba(73, 214, 174, .14);
  color: #e8fff6;
  box-shadow: inset 3px 0 0 #49d6ae;
}
.nav.active::before { opacity: 1; background: #49d6ae; }
.nav:hover { background: rgba(255, 255, 255, .06); }
.nav.active:hover { background: rgba(73, 214, 174, .18); }
.sidebar-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 18px 8px 0;
  color: white;
}
.avatar {
  border-radius: 10px;
  background: #1d4a40;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #b7e7d4;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-bottom small { display: block; color: #8ea0ad; margin-top: 3px; font-size: 11px; }
.sidebar-logout { border: 0; background: none; color: #78d9bd; padding: 5px 0 0; font-size: 12px; text-decoration: underline; }

main { margin-left: var(--sidebar); }
.topbar {
  height: 58px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 253, 249, .88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  color: var(--muted);
  font-size: 13px;
  position: sticky;
  top: 0;
  z-index: 4;
}
.topbar b { margin: 0 10px; font-weight: 400; color: #c3baac; }
#breadcrumb { color: var(--ink); font-weight: 650; }
.local-badge {
  background: var(--jade-soft);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--jade-ink);
  font-size: 12px;
  font-weight: 600;
}
.page { padding: 28px 32px 112px; max-width: 1680px; margin: auto; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--green);
  margin-bottom: 8px;
}
h1 {
  font-size: 32px;
  letter-spacing: -.03em;
  margin: 0 0 8px;
  font-weight: 680;
  line-height: 1.15;
}
p { color: var(--ink-soft); line-height: 1.55; margin: 0; }
.version {
  font-size: 12px;
  font-weight: 650;
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--card);
  white-space: nowrap;
  color: var(--ink-soft);
}

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px 16px 20px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #c9d0d8;
}
.stat.warning::before { background: #e0a04a; }
.stat.good::before { background: #1a9b78; }
.stat .label { font-size: 12px; font-weight: 650; color: var(--ink-soft); display: flex; justify-content: space-between; }
.stat .value { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin: 8px 0 6px; font-variant-numeric: tabular-nums; line-height: 1; }
.stat small { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; }
.stat.good .value { color: var(--green); }
.stat.warning .value { color: var(--amber); }

.panel {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 16px; margin: 0 0 4px; font-weight: 680; letter-spacing: -.01em; }
.panel-head p { font-size: 13px; }
.panel-body { padding: 16px 18px; }
.week-switch .panel-head { flex-wrap: wrap; align-items: center; }
.week-switch .toolbar { flex: 1 1 320px; min-width: 0; }
.week-switch .panel-head > label { flex: 1 1 220px; min-width: 0; }
.week-switch .panel-body { padding: 12px 18px; font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }


.button {
  border: 1px solid #ddd4c6;
  border-radius: 9px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  color: #2c3848;
  line-height: 1.2;
}
.button.primary {
  background: linear-gradient(180deg, #14967c 0%, #0c6e5c 100%);
  color: white;
  border-color: #0a5e4e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2);
}
.button.primary:hover { background: #0b6253; }
.button.secondary:hover { background: #f6f1e8; border-color: #d2c7b6; }
.button.small { padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.button.danger { color: #a33b3b; }

.tabs { display: flex; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); overflow: auto; }
.day-tab {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
}
.day-tab small { display: block; font-size: 11px; margin-top: 3px; color: var(--muted); font-weight: 500; }
.day-tab.has-empty small { color: #8a5a12; }
.day-tab.active {
  color: var(--jade-ink);
  background: var(--jade-soft);
  border-color: #b7dfd2;
}
.day-tab:hover { border-color: #b7dfd2; }
.rules-tabs { padding: 12px; }
.rules-tabs .day-tab { display: inline-flex; align-items: center; gap: 6px; }
.rules-tabs .pill { margin-left: 6px; font-weight: 600; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th {
  font-size: 11px;
  color: #5c6b7e;
  font-weight: 700;
  letter-spacing: .04em;
  background: #faf7f1;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { border-bottom: 1px solid #efeae2; padding: 12px 14px; font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
table:not(.schedule-table) tbody tr:hover td { background: #fbf8f3; }

.schedule-table { table-layout: fixed; min-width: 980px; }
.schedule-table th:first-child, .schedule-table td:first-child { width: 76px; position: sticky; left: 0; z-index: 1; }
.schedule-table th:first-child { background: #f7f4ee; }
.schedule-table th { white-space: normal; font-size: 12px; letter-spacing: 0; padding: 14px 10px; text-transform: none; }
.schedule-table td { vertical-align: top; padding: 8px; border-right: 1px solid #efeae2; height: auto; }
.schedule-table td:first-child {
  padding: 16px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: #faf7f1;
}
.schedule-table th:nth-child(2) { background: #e8f6f1; color: #0d5c4c; box-shadow: inset 0 3px 0 #0c6e5c; }
.schedule-table th:nth-child(3) { background: #fff1e8; color: #8a4518; box-shadow: inset 0 3px 0 #d06a2b; }
.schedule-table th:nth-child(4) { background: #eaf3fb; color: #1e5278; box-shadow: inset 0 3px 0 #2f6f9f; }
.schedule-table th:nth-child(5) { background: #fdeff3; color: #7a3148; box-shadow: inset 0 3px 0 #a14d6a; }
.schedule-table th:nth-child(6) { background: #f3f0fa; color: #46386e; box-shadow: inset 0 3px 0 #5b4b8a; }
.schedule-table .slot-cell { cursor: pointer; }
.schedule-table .slot-cell:hover .slot { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(28, 36, 51, .08); }

.slot {
  background: #f3faf7;
  border: 1px solid #cfe4da;
  border-radius: 10px;
  padding: 10px 10px 9px;
  min-height: 84px;
  width: 100%;
  text-align: left;
  color: #243f36;
}
.slot.unassigned { background: #fff; border: 1px dashed #d5d0c6; color: #6b7786; }
.slot.invalid { background: #fff8ee; border-color: #e4b56a; box-shadow: inset 3px 0 0 #d0892b; }
.slot.unassigned.invalid { border-style: dashed; }
.schedule-table td:nth-child(2) .slot.unassigned { border-color: #b7ddd0; }
.schedule-table td:nth-child(3) .slot.unassigned { border-color: #f0c7ae; }
.schedule-table td:nth-child(4) .slot.unassigned { border-color: #c5d8ea; }
.schedule-table td:nth-child(5) .slot.unassigned { border-color: #efc6d1; }
.schedule-table td:nth-child(6) .slot.unassigned { border-color: #d4cce6; }
.schedule-table td:nth-child(2) .slot:not(.unassigned) { background: #f3faf7; border-color: #b7ddd0; }
.schedule-table td:nth-child(3) .slot:not(.unassigned) { background: #fff6f0; border-color: #f0c7ae; }
.schedule-table td:nth-child(4) .slot:not(.unassigned) { background: #f4f8fc; border-color: #c5d8ea; }
.schedule-table td:nth-child(5) .slot:not(.unassigned) { background: #fdf5f7; border-color: #efc6d1; }
.schedule-table td:nth-child(6) .slot:not(.unassigned) { background: #f7f5fb; border-color: #d4cce6; }
.slot-time { display: block; font-size: 11px; letter-spacing: .02em; color: #5c6b7e; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.slot-name { display: block; font-size: 13px; font-weight: 700; line-height: 1.35; }
.slot.unassigned .slot-name { color: var(--green); }
.slot.invalid .slot-name, .slot.invalid .slot-note { color: #6e4710; }
.slot-note { display: block; font-size: 11px; margin-top: 5px; line-height: 1.35; color: #6d7b88; }
.no-slot { color: #d5d0c6; text-align: center; display: block; margin-top: 22px; }
.legend {
  padding: 12px 18px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.legend b { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #7dceae; margin-right: 6px; }
.legend b.orange { background: #e0a04a; }

.bottom-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; }
.item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #efeae2; font-size: 13px; align-items: flex-start; }
.item:last-child { border-bottom: 0; }
.item-icon {
  background: #fff4e4;
  color: #8a5a12;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 13px;
}
.item p { font-size: 12px; margin-top: 4px; color: var(--muted); }
.pill {
  display: inline-block;
  border-radius: 999px;
  background: #e7f5f0;
  color: #14614f;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 700;
}
.pill.orange { background: #fff1dc; color: #8a5a12; }
.pill.gray { background: #eef1f4; color: #5c6b7e; }
.muted { color: var(--muted); font-size: 12px; }
.notice {
  padding: 12px 14px;
  background: #e7f5f0;
  border: 1px solid #c5e4d8;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--jade-ink);
}
.notice.error { background: #fff1ed; border-color: #f0d0c8; color: #8d3d2c; }
.savebar {
  position: fixed;
  bottom: 0;
  right: 0;
  left: var(--sidebar);
  background: rgba(255, 253, 249, .94);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 30px rgba(28, 36, 51, .05);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(12px);
  font-size: 13px;
  color: var(--ink-soft);
  z-index: 5;
}
.savebar > div { display: flex; gap: 8px; }
.savebar .button { min-height: 38px; }
footer { display: flex; justify-content: space-between; color: #8b93a0; font-size: 12px; margin-top: 8px; }

dialog {
  border: 1px solid var(--border);
  border-radius: 18px;
  width: min(680px, 95vw);
  max-height: 90vh;
  padding: 0;
  box-shadow: 0 24px 80px rgba(14, 27, 38, .28);
  color: var(--ink);
}
dialog::backdrop { background: rgba(14, 27, 38, .48); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { margin: 0; font-size: 18px; }
.icon-button { background: none; border: 0; font-size: 26px; line-height: 1; color: var(--muted); border-radius: 8px; }
#editor-body { padding: 18px 20px; }
.dialog-actions { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: #faf7f1; }
.dialog-error { margin: 12px 20px 0; flex-shrink: 0; }

.field { display: block; margin-bottom: 14px; font-size: 13px; }
.field > span { display: block; margin-bottom: 6px; color: var(--ink-soft); font-weight: 650; }
.field input, .field select, .field textarea, input.date-input, #saved-week {
  border: 1px solid #ddd4c6;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  max-width: 100%;
  width: 100%;
  color: var(--ink);
}
.field textarea { min-height: 72px; resize: vertical; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.field:focus-within { outline: none; }
.field input:focus, .field select:focus, .field textarea:focus, input.date-input:focus, #saved-week:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(12, 110, 92, .16);
}
#week-picker, #saved-week { width: auto; min-width: 158px; background: #fff; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-grid > .field { min-width: 0; }
.field select { min-width: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 16px; }
.check { font-size: 13px; display: flex; align-items: center; gap: 7px; padding: 4px 0; }
.check input { accent-color: var(--green); width: 15px; height: 15px; }
.section-title { font-size: 13px; font-weight: 750; margin: 18px 0 8px; letter-spacing: -.01em; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.rule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.callout {
  background: #f7f4ee;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 16px;
}
.rule-card { border-bottom: 1px solid var(--border); padding: 14px 0; }
.rule-card:first-child { padding-top: 0; }
.rule-card strong { font-size: 13px; }
.issue-code { font-family: Consolas, "Segoe UI Mono", monospace; font-size: 11px; color: #8a5a12; }
.person-name { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.person-icon {
  width: 32px;
  height: 32px;
  background: var(--jade-soft);
  color: var(--jade-ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}
.history { max-height: 280px; overflow: auto; }
.report-number { font-variant-numeric: tabular-nums; }
.spacer { margin-top: 16px; }

.setup-guide {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  margin-bottom: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.setup-guide > summary, .resource-options > summary, .technical-detail > summary, .policy-callout summary, .issue-bundle-detail > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.setup-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.setup-step {
  border: 1px solid var(--border);
  background: #fbf8f3;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  color: #24382f;
}
.setup-step:hover { border-color: #9dcebf; background: #fff; }
.setup-step strong, .setup-step span { display: block; line-height: 1.45; }
.setup-step span { color: var(--muted); font-size: 12px; margin-top: 6px; font-weight: 500; }
.setup-guide > p { font-size: 12px; margin-top: 12px; }
.setup-step .pill { display: inline-block; margin-top: 10px; font-size: 11px; }
.setup-guide .policy-callout { margin: 14px 0 0; }
.issue-link { margin-top: 8px; }
.technical-detail { margin-top: 8px; font-size: 12px; color: var(--muted); }
.technical-detail p { overflow-wrap: anywhere; }

.assignment-editor {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(560px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 18px 0 0 18px;
}
.assignment-editor #editor-form { display: flex; flex-direction: column; height: 100%; }
.assignment-editor #editor-body { overflow-y: auto; flex: 1; min-height: 0; }
.assignment-editor .dialog-heading, .assignment-editor .dialog-actions { flex-shrink: 0; }
.assignment-context { background: var(--jade-soft); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.assignment-context strong, .assignment-context span { display: block; }
.assignment-context span { color: #3e6256; font-size: 13px; margin-top: 4px; }
.candidate-group h3 { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin: 16px 0 8px; color: var(--ink-soft); }
.candidate-group h3 > span { color: var(--muted); font-weight: 500; }
.candidate {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 8px 0;
  cursor: pointer;
  background: white;
}
.candidate input { margin-top: 3px; accent-color: var(--green); }
.candidate > span { min-width: 0; }
.candidate strong { display: block; font-size: 14px; }
.candidate small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.candidate:has(input:checked) { border-color: var(--green); background: #f3faf7; }
.candidate.ready { border-left: 3px solid #1a9b78; }
.candidate.review { border-left: 3px solid #d2a257; }
.candidate.blocked, .candidate.failed, .candidate.pending { background: #f7f6f3; cursor: default; }
.candidate.blocked { border-left: 3px solid #e3b4b4; }
.candidate.blocked strong { color: #7d4e4e; }
.candidate-reasons { display: block; margin-top: 6px; font-size: 12px; color: #7a4e2a; line-height: 1.5; overflow-wrap: anywhere; }
.candidate-reasons > span { display: block; }
.candidate-fix { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #fffdf9; border: 1px dashed #e3c9a8; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.candidate-fix > strong { font-size: 12.5px; color: var(--ink); margin-bottom: 2px; }
.candidate-fix > span { display: block; }
.candidate-fix > .toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.resource-options { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin: 16px 0; }
.resource-options > p { margin: 10px 0; }
.resource-options fieldset { border: 0; margin: 0; padding: 0; }
.resource-help { margin-top: 16px; }
.resource-help button { margin-top: 8px; display: flex; }

.issue-section > summary small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.issue-bundle { padding: 14px 0; border-bottom: 1px solid var(--border); }
.issue-bundle:first-child { padding-top: 0; }
.issue-bundle:last-child { border-bottom: 0; padding-bottom: 0; }
.issue-bundle-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.issue-bundle-head > div { min-width: 0; }
.issue-bundle-head h3 { font-size: 15px; line-height: 1.45; margin: 4px 0; }
.issue-bundle-head p { font-size: 13px; overflow-wrap: anywhere; }
.issue-bundle-head > .pill { flex-shrink: 0; white-space: nowrap; }
.issue-bundle-actions:empty { display: none; }
.issue-bundle-actions { margin-top: 8px; }
.issue-bundle-detail { margin-top: 8px; }
.issue-bundle-detail > summary { cursor: pointer; color: var(--green); font-size: 13px; width: fit-content; }
.issue-bundle-detail[open] { background: #faf7f1; border: 1px solid var(--border); border-radius: 10px; padding: 12px; max-height: min(60vh, 480px); overflow: auto; }
.issue-bundle-detail[open] > summary { position: sticky; top: 0; background: #faf7f1; padding: 4px 0; z-index: 1; width: auto; }
.issue-bundle-detail .issue-item { padding: 12px 0; }
.issue-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.issue-summary-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: #faf7f1; }
.issue-summary-card strong { display: block; font-size: 26px; color: #24382f; margin-bottom: 6px; }
.issue-summary-card span { display: block; font-size: 14px; font-weight: 700; }
.issue-summary-card small { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.issue-section { border-top: 1px solid var(--border); }
.issue-section > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 16px 18px;
  background: #faf7f1;
  font-size: 15px;
  font-weight: 700;
  list-style: none;
}
.issue-section > summary::-webkit-details-marker { display: none; }
.issue-section > summary::before { content: "▸"; color: var(--green); }
.issue-section[open] > summary { background: #fff; }
.issue-section[open] > summary::before { content: "▾"; }
.issue-section > summary > span:first-of-type { flex: 1; }
.issue-section > summary > span:last-child { font-size: 12px; font-weight: 600; color: var(--muted); }
.issue-section-hint { margin: 12px 18px 0; font-size: 13px; }
.issue-item { padding: 16px 0; font-size: 14px; }
.issue-item > div:last-child { flex: 1; min-width: 0; }
.issue-item h3 { font-size: 15px; line-height: 1.45; margin: 4px 0; }
.issue-severity { color: #8a5a12; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.issue-item .issue-explanation, .decision-card > p { font-size: 14px; color: var(--ink-soft); line-height: 1.65; overflow-wrap: anywhere; }
.issue-item .issue-guidance, .decision-card .issue-guidance {
  font-size: 13px;
  background: #f7f4ee;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  line-height: 1.6;
  color: #3c4a5e;
}
.issue-actions { margin-top: 8px; }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.decision-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; background: #fff; }
.decision-card h3 { font-size: 15px; line-height: 1.5; margin: 10px 0; }
.decision-card .field { margin: 14px 0 0; }
.decision-card textarea { min-height: 84px; }
.decision-card .technical-detail { margin-top: 10px; }
.decision-status .pill { line-height: 1.5; }

.policy-callout { background: #fff8ee; border-color: #f0dcbc; color: #5c4630; font-size: 13px; }
.policy-callout.ok { background: #eef8f3; border-color: #cde6d9; color: #245443; }
.policy-callout strong { color: inherit; }
.policy-callout p { color: inherit; margin-top: 8px; font-size: 13px; }
.policy-callout .toolbar { margin-top: 12px; }
.policy-callout details { margin-top: 10px; }
.policy-callout summary { cursor: pointer; width: fit-content; }
.policy-callout details .button { margin-top: 8px; }
.policy-list { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }
.rules-panel { max-width: 960px; }
.rules-panel-title { font-size: 16px; margin: 0 0 6px; }
.rules-panel > .muted { margin: 6px 0 14px; display: block; }
.rules-panel .decision-grid { margin-top: 14px; }
.rules-indent { border-left: 3px solid #d7efe6; padding-left: 14px; margin: 4px 0 16px; }
.rules-submit { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.next-step { background: #f7f4ee; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.next-step p { font-size: 14px; color: var(--ink-soft); }
.next-step p + p { margin-top: 6px; font-size: 13px; color: var(--muted); }
.next-step strong { color: var(--ink); }

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .page { padding: 22px 18px 112px; }
  .topbar, .savebar { padding-left: 18px; padding-right: 18px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .bottom-grid, .rule-grid, .decision-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .setup-steps { grid-template-columns: 1fr 1fr; }
  .savebar { gap: 10px; flex-wrap: wrap; }
  .savebar > div { flex-wrap: wrap; }
  .page { padding-bottom: 168px; }
  .issue-summary-grid { grid-template-columns: 1fr; }
  .issue-section > summary { padding: 14px; }
  .issue-section-hint { margin: 12px 14px 0; }
  .decision-card { padding: 14px; }
}
@media (max-width: 720px) {
  .sidebar { position: static; width: auto; padding: 16px; }
  .savebar { align-items: stretch; flex-direction: column; }
  .savebar > div { width: 100%; display: grid; grid-template-columns: 1fr; }
  .savebar .button { min-width: 0; white-space: normal; width: 100%; }
  .page { padding-bottom: 250px; }
  .week-switch .panel-head { display: grid; grid-template-columns: 1fr; }
  .week-switch .toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; }
  .week-switch .toolbar > label { min-width: 0; }
  .week-switch .toolbar .pill { grid-column: 1 / -1; width: max-content; }
  #week-picker, #saved-week { width: 100%; min-width: 0; }
  .logo { font-size: 22px; }
  .workspace-label, .sidebar-bottom { display: none; }
  nav { display: flex; overflow: auto; margin-top: 12px; gap: 6px; }
  .nav { width: auto; white-space: nowrap; padding: 8px 10px; }
  main, .savebar { margin-left: 0; left: 0; }
  .topbar { height: 52px; }
  .local-badge { display: none; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 26px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .panel-head { flex-wrap: wrap; }
  .field-grid { grid-template-columns: 1fr; }
  footer span { display: none; }
}
@media (max-width: 480px) {
  .setup-steps { grid-template-columns: 1fr; }
  .savebar .button { padding: 10px 12px; font-size: 13px; }
  .assignment-editor { border-radius: 0; }
  .assignment-editor #editor-body { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .slot, .button, .nav, .setup-step { transition: none; }
}

/* In-app user guide */
.nav-guide { margin-top: 12px; }
.guide-toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 32px; }
.guide-toc h3 { margin: 0 0 4px; font-size: 13px; color: var(--ink); }
.guide-toc ol { margin: 0; padding-left: 26px; line-height: 1.9; font-size: 14px; }
.guide-part-title { margin: 28px 0 12px; font-size: 18px; color: var(--ink); }
.guide-body h3 { margin: 18px 0 6px; font-size: 15px; color: var(--ink); }
.guide-body h3:first-child { margin-top: 0; }
.guide-body p { margin: 8px 0; }
.guide-body dt .pill { margin-left: 6px; vertical-align: middle; font-weight: 500; }
.guide-toc a { text-decoration: none; }
.guide-toc a:hover { text-decoration: underline; }
.guide-section { scroll-margin-top: 16px; }
.guide-body { font-size: 14px; line-height: 1.7; color: var(--ink-soft); max-width: 920px; }
.guide-body ul, .guide-body ol { margin: 0; padding-left: 22px; }
.guide-body li { margin: 6px 0; }
.guide-body li > ul { margin-top: 4px; }
.guide-body strong, .guide-body dt { color: var(--ink); }
.guide-body code { background: #f3efe6; border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 13px; }
.guide-body li > .button { margin-left: 6px; vertical-align: middle; }
.guide-body dt { font-weight: 650; margin-top: 12px; }
.guide-body dt:first-child { margin-top: 0; }
.guide-body dd { margin: 4px 0 0; }
.guide-tip { margin-top: 12px; font-size: 13px; }
.guide-table { margin: 4px 0 8px; border: 1px solid var(--border); border-radius: 10px; }
.guide-table td { font-size: 14px; vertical-align: top; }
.guide-figure { margin: 0 0 20px; }
.guide-figure img { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 6px 20px rgba(28, 36, 51, .08); background: #fff; }
.guide-figure figcaption { margin-top: 14px; }
.guide-figure figcaption .muted { margin: 8px 0 0; font-size: 12px; }
.guide-figure.side { display: grid; grid-template-columns: minmax(0, 520px) minmax(240px, 1fr); gap: 24px; align-items: start; }
.guide-figure.side figcaption { margin-top: 0; }
.guide-body .guide-callouts { list-style: none; counter-reset: callout; margin: 0; padding-left: 0; }
.guide-callouts li { counter-increment: callout; position: relative; padding-left: 36px; min-height: 24px; }
.guide-callouts li::before { content: counter(callout); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: #d9480f; color: #fff; font-size: 13px; font-weight: 700; line-height: 24px; text-align: center; }
@media (max-width: 1100px) {
  .guide-figure.side { grid-template-columns: 1fr; }
  .guide-figure.side figcaption { margin-top: 14px; }
}
@media (max-width: 720px) {
  .nav-guide { margin-top: 0; }
}
@media print {
  .sidebar, .topbar, .savebar, #notice, footer, .guide-actions, .guide-open, .guide-body .button { display: none !important; }
  body { background: #fff; }
  main { margin-left: 0; }
  .page { padding: 0; max-width: none; }
  .panel { box-shadow: none; border-radius: 0; break-inside: auto; }
  .panel-head h2, .guide-part-title, .guide-body h3, .guide-body dt { break-after: avoid; }
  .guide-body li, .guide-body dd, .guide-figure img { break-inside: avoid; }
  .guide-figure img { box-shadow: none; }
  .guide-toc a { color: inherit; }
}

/* Public login and read-only schedule */
.auth-page, .viewer-page { min-height: 100vh; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; margin: 0; }
.auth-card { width: min(100%, 430px); background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); padding: 32px; }
.auth-logo { display: inline-flex; align-items: baseline; color: var(--ink); text-decoration: none; font-size: 27px; font-weight: 700; letter-spacing: -.04em; margin-bottom: 30px; }
.auth-logo span { font-weight: 400; }
.auth-logo i { color: var(--green); font-size: 15px; margin-left: 3px; font-style: normal; }
.auth-card > p { margin-bottom: 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card input { min-height: 44px; }
.auth-submit { width: 100%; margin-top: 8px; min-height: 44px; }
.auth-card .notice { margin: 8px 0; }

.viewer-header { min-height: 64px; background: #fffdf9; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 12px max(20px, calc((100% - 1100px) / 2)); position: sticky; top: 0; z-index: 3; }
.viewer-header .auth-logo { margin: 0; font-size: 24px; }
.viewer-shell { max-width: 1100px; margin: auto; padding: 30px 20px 56px; }
.viewer-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.viewer-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.viewer-controls .field { min-width: 210px; }
.viewer-days { display: flex; overflow-x: auto; gap: 8px; padding: 14px 0; margin: 8px 0 16px; }
.viewer-days .day-tab { min-width: 110px; display: grid; gap: 3px; }
.viewer-schedule { display: grid; gap: 10px; }
.viewer-shift { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 18px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; }
.viewer-shift-time { color: var(--jade-ink); font-weight: 750; font-size: 16px; }
.viewer-shift h2 { font-size: 16px; margin: 0 0 4px; }
.viewer-shift p { font-size: 13px; }

@media (max-width: 620px) {
  .auth-card { padding: 24px 20px; }
  .viewer-header { padding: 10px 14px; }
  .viewer-shell { padding: 24px 14px 42px; }
  .viewer-controls, .viewer-controls .field { width: 100%; }
  .viewer-shift { grid-template-columns: 1fr; gap: 5px; }
}
