:root {
  color-scheme: light;
  --canvas: #f7f7f4;
  --paper: #fff;
  --paper-warm: #fbfbf8;
  --ink: #17332b;
  --ink-strong: #092b23;
  --soft: #52645b;
  --muted: #7f8981;
  --green: #52734f;
  --green-dark: #3f603d;
  --green-soft: #eaf1e8;
  --sage: #789172;
  --sage-soft: #f1f5ee;
  --line: #e3e8e0;
  --line-soft: #edf0ea;
  --danger: #a25042;
  --danger-soft: #fff2ef;
  --success: #3c7653;
  --success-soft: #edf6ed;
  --shadow: 0 3px 18px rgba(25, 51, 33, .035);
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled, select:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin-top: 0; }

/* 参考布局采用窄顶栏、简洁的步骤侧栏和宽大的卡片区域。 */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-rows: 68px minmax(0, 1fr);
  grid-template-areas: "topbar topbar" "sidebar main";
}
.topbar {
  grid-area: topbar;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  min-width: 0;
  padding: 0 29px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 253, .97);
}
.brand { display: flex; align-items: center; gap: 24px; min-width: 0; }
.topbar > .brand {
  color: var(--ink-strong);
  font: 700 clamp(23px, 2vw, 29px)/1.1 var(--serif);
  letter-spacing: -.035em;
  white-space: nowrap;
}
.brand-mark {
  display: none;
  width: 37px;
  height: 37px;
  flex: none;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
}
.brand strong,
.brand-title {
  display: block;
  margin: 0;
  color: var(--ink-strong);
  font: 700 clamp(23px, 2vw, 29px)/1.1 var(--serif);
  letter-spacing: -.035em;
  white-space: nowrap;
}
.brand div > span:not(.brand-title) { display: none; }
.topbar-week {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #405f42;
  font: 700 16px/1 var(--serif);
  white-space: nowrap;
  margin-left: 6px;
}
.topbar .topbar-week input {
  width: 37px;
  min-height: 31px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid #bdcdb9;
  border-radius: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  text-align: center;
  appearance: textfield;
}
.topbar .topbar-week input::-webkit-inner-spin-button,
.topbar .topbar-week input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.topbar-week .chevron { display: inline-block; width: 7px; height: 7px; margin: -3px 0 0 2px; transform: rotate(45deg); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; margin-left: auto; }
.topbar-actions .button { min-height: 34px; }
.topbar-avatar { display: block; width: 40px; height: 40px; flex: none; border: 1px solid #e2e8da; border-radius: 12px; background: #f4f6ec; object-fit: cover; }

.sidebar {
  grid-area: sidebar;
  min-width: 0;
  padding: 13px 0 24px;
  border-right: 1px solid var(--line-soft);
  background: #fff;
}
.sidebar-nav { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.nav-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  min-height: 82px;
  padding: 18px 16px 14px 25px;
  width: 100%;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  transition: background .18s ease, border-color .18s ease;
}
.nav-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 49px;
  bottom: -15px;
  left: 39px;
  width: 2px;
  background: #e2e6df;
}
.nav-step:hover { background: #f8faf6; }
.nav-step.is-current { border-color: var(--sage); background: #f2f5ef; }
.nav-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #d9ddda;
  color: #4f5e54;
  font: 700 13px/1 var(--serif);
}
.nav-step.is-done .nav-dot { background: #879a7a; color: #fff; }
.nav-step.is-current .nav-dot { background: var(--green-dark); color: #fff; }
.nav-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.nav-copy strong { padding-top: 1px; color: var(--ink); font: 700 15px/1.3 var(--serif); white-space: nowrap; }
.nav-state { color: var(--muted); font-size: 12px; white-space: nowrap; }
.nav-step.is-current .nav-state { color: var(--green-dark); }
.sidebar-footer { display: flex; align-items: center; gap: 8px; margin: 25px 18px 0; padding: 12px 8px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; line-height: 1.5; }
.sidebar-footer-mark { display: grid; place-items: center; flex: none; width: 18px; height: 18px; border: 1px solid #bed0bb; border-radius: 50%; color: var(--green); font: 700 11px/1 var(--serif); }

.workspace { grid-area: main; min-width: 0; width: 100%; margin: 0; padding: 12px 13px 30px; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.19fr) minmax(0, .88fr) minmax(0, 1.08fr);
  align-items: stretch;
  gap: 12px;
}
.dashboard-grid > * { min-width: 0; }
.dashboard-grid > .import-panel,
.dashboard-grid > .roster-panel,
.dashboard-grid > .targets-panel { min-height: 347px; }
.dashboard-grid > .result-panel { grid-column: 1 / 3; }
.results-side { grid-column: 3; display: flex; flex-direction: column; align-self: start; gap: 12px; min-width: 0; }
.results-side > .stats-panel { flex: 0 0 auto; }
.results-side > .word-panel { flex: 0 0 auto; }
.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #eef0ec;
  border-radius: 11px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.panel.is-disabled { opacity: .8; }
.panel.is-disabled .panel-heading h2 { color: #53655b; }
.panel-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 16px 19px 10px;
}
.panel-heading-with-action { flex-wrap: wrap; }
.panel-heading-copy { flex: 1; min-width: 0; }
.panel-heading h2 {
  margin: 0;
  color: var(--ink-strong);
  font: 700 16px/1.3 var(--serif);
  letter-spacing: -.015em;
}
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.section-number,
.panel-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}
.icon-file::before { content: "▤"; }
.icon-people::before { content: "♟"; }
.icon-settings::before { content: "⚙"; }
.icon-calendar::before { content: "▣"; }
.icon-bars::before { content: "▥"; }
.heading-meta { margin-left: auto; color: var(--ink); font: 700 13px/1.2 var(--serif); white-space: nowrap; }
.count-chip { margin-left: auto; color: var(--ink); font: 700 14px/1.2 var(--serif); white-space: nowrap; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 7px;
  line-height: 1.25;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.button:not(:disabled):active { transform: translateY(1px); }
.button-primary { border-color: var(--green); background: var(--green); color: white; box-shadow: 0 2px 5px rgba(39, 79, 45, .11); }
.button-primary:not(:disabled):hover { border-color: var(--green-dark); background: var(--green-dark); box-shadow: 0 4px 10px rgba(39, 79, 45, .17); }
.button-primary:disabled { border-color: #adbea9; background: #adbea9; color: white; box-shadow: none; }
.button-quiet { border-color: #e0e5dc; background: #f7f8f5; color: var(--ink); }
.button-quiet:not(:disabled):hover { border-color: #bfcfba; background: var(--green-soft); }
.button-quiet:disabled { color: #9ba69a; background: #f7f8f5; }
.button-small { min-height: 32px; padding: 5px 10px; font-size: 11px; }
.button-remove { min-height: 30px; padding: 4px 5px; border: 0; background: transparent; color: #869388; font-size: 11px; }
.button-remove:hover { color: var(--danger); background: var(--danger-soft); }
.button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, .dropzone:focus-within, .nav-step:focus-visible {
  outline: 3px solid #b7cfb3;
  outline-offset: 2px;
}
input:not([type="file"]):not([type="checkbox"]), select {
  min-height: 35px;
  padding: 6px 10px;
  border: 1px solid #dfe5dc;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
}
input::placeholder { color: #a0aaa0; }
input:disabled, select:disabled { background: #f6f8f5; color: #8d9a8d; }

.notice {
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px solid #cbdcc9;
  border-radius: 8px;
  background: #f2f8f1;
  color: var(--soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.notice.is-error { border-color: #e7c6bd; background: var(--danger-soft); color: var(--danger); }
.notice.is-success { border-color: #bfdcc8; background: var(--success-soft); color: var(--success); }
.update-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 11px 14px; border: 1px solid #cbdcc9; border-radius: 8px; background: var(--green-soft); }
.update-banner > span { flex: 1 1 220px; overflow-wrap: anywhere; }
.update-banner > .button { flex: none; }
.native-app-update { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcf8; }
.native-app-update > span { color: var(--muted); font-size: 12px; }
.native-app-update > .button { min-height: 44px; font-size: 13px; }

/* 课表导入摘要：突出班级总数，显示三个年级的数量，再排列文件导入控件。 */
.import-hero { padding: 1px 19px 0; }
.import-hero p { margin: 0; }
.import-hero > p:first-child { color: var(--ink-strong); font: 700 17px/1.2 var(--serif); }
.import-hero-line { color: var(--ink-strong); font: 700 21px/1.2 var(--serif); }
.import-hero-number {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 2px 0;
  color: var(--ink-strong);
}
.import-hero-number strong { font: 700 clamp(43px, 4.5vw, 64px)/.98 var(--serif); letter-spacing: -.07em; }
.import-hero-number span { font: 700 23px/1.1 var(--serif); }
#import-summary { margin: 6px 0 13px; color: var(--soft); font-size: 11px; }
.import-hero-sub { margin: 6px 0 13px; color: var(--ink); font: 700 13px/1.5 var(--serif); }
.import-grade-grid,
.settings-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border-radius: 7px;
  background: #f7f8f5;
}
.import-grade-grid { margin: 0 19px 12px; padding: 11px 4px; }
.import-grade { min-width: 0; padding: 0 5px; text-align: center; }
.import-grade + .import-grade,
.settings-summary > * + * { border-left: 1px solid #e1e5dd; }
.import-grade strong { display: block; color: var(--ink); font: 700 13px/1.35 var(--serif); }
.import-grade span { display: block; color: var(--soft); font-size: 11px; }
.import-grade small { display: block; color: var(--muted); font-size: 10px; }
.import-source { display: grid; gap: 6px; margin: 0 19px 12px; min-width: 0; }
.builtin-import-controls { display: grid; gap: 5px; margin-bottom: 4px; }
.builtin-import-controls .button { width: 100%; }
.builtin-import-controls small { color: var(--muted); font-size: 10px; text-align: center; }
.import-source-icon { display: grid; place-items: center; flex: none; width: 30px; height: 31px; border-radius: 5px; background: #e7f3e7; color: var(--success); font-size: 14px; font-weight: 800; }
.import-source-copy { min-width: 0; flex: 1; }
.import-source-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.import-source-copy small { display: block; color: var(--muted); font-size: 10px; }
.import-source .button { flex: none; }
.import-grid { display: grid; gap: 9px; padding: 0 19px 13px; }
.import-fields { display: grid; grid-template-columns: minmax(98px, .36fr) minmax(0, 1fr); gap: 9px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--soft); font-size: 10px; font-weight: 700; }
.field > input { width: 100%; }
.folder-entry { display: flex; gap: 6px; min-width: 0; }
.folder-entry input { flex: 1; min-width: 0; }
.folder-entry .button { flex: none; }
.dropzone {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px dashed #b9c9b7;
  border-radius: 7px;
  background: #fafcf9;
  color: var(--soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.dropzone > span:nth-child(3) { display: grid; gap: 1px; min-width: 0; text-align: left; }
.dropzone small { color: var(--muted); font-size: 10px; }
.dropzone-action { margin-left: auto; color: var(--green-dark) !important; font-size: 10px; font-weight: 700; white-space: nowrap; }
.dropzone:hover, .dropzone.is-over { border-color: var(--green); background: #f0f6ef; }
.dropzone strong { color: var(--ink); font-size: 11px; }
.dropzone > span:not(.upload-icon):not(.button) { color: var(--muted); font-size: 10px; }
.dropzone .button { min-height: 27px; padding: 4px 7px; font-size: 10px; pointer-events: none; }
.upload-icon { position: relative; flex: none; width: 23px; height: 24px; border: 1px solid #b9cfb7; border-radius: 4px; background: #fff; }
.upload-icon::before { content: ""; position: absolute; top: 5px; left: 7px; width: 8px; height: 11px; border: 1px solid var(--green); border-radius: 1px; }
.upload-icon span::before, .upload-icon span::after { content: ""; position: absolute; left: 9px; width: 5px; height: 1px; background: var(--green); }
.upload-icon span::before { top: 10px; }
.upload-icon span::after { top: 13px; }
.import-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 19px 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
.import-foot span:first-child { min-width: 0; overflow: hidden; color: var(--soft); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

/* 检查人员卡片保留原有的名单编辑控件。 */
.roster-block { padding: 0 18px 13px; }
.roster-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 5px; }
.roster-heading h3 { margin: 0; font-size: 12px; }
.roster-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.roster-columns,
.inspector-row { display: grid; grid-template-columns: minmax(80px, .9fr) minmax(103px, 1.2fr) 34px; align-items: center; gap: 5px; }
.roster-columns { padding: 0 0 4px; color: var(--muted); font-size: 10px; }
.inspector-rows { display: grid; align-content: start; gap: 5px; max-height: 236px; overflow-y: auto; scrollbar-color: #cbd8c6 transparent; }
.inspector-row { position: relative; padding: 2px 0 6px; border-bottom: 1px solid var(--line-soft); }
.inspector-row input, .inspector-row select { width: 100%; min-width: 0; min-height: 30px; padding: 4px 7px; border-color: transparent; border-radius: 5px; background: transparent; font-size: 11px; }
.inspector-row input:hover, .inspector-row select:hover { border-color: var(--line); background: #fff; }
.inspector-row input:focus, .inspector-row select:focus { border-color: #a9c2a5; background: #fff; }
.inspector-row.has-invalid-class select { border-color: #dcaaa0; background: var(--danger-soft); }
.inspector-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #eff2e9; color: var(--ink); font-weight: 700; }
.roster-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.roster-hint.has-warning { color: var(--danger); }
.add-inspector { width: 100%; margin: 8px 0 0; }

/* 年级统一设置保持可见，逐班调整放在下方明细区域。 */
.target-grade-list { padding: 1px 19px 9px; }
.target-grade-row {
  display: grid;
  grid-template-columns: minmax(45px, .7fr) minmax(45px, .6fr) minmax(75px, .8fr) 30px;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
}
.target-grade-row:last-child { border-bottom: 0; }
.target-grade-row strong { color: var(--ink); font: 700 13px/1.2 var(--serif); }
.target-grade-row span { color: var(--soft); font-size: 11px; }
.target-grade-row input, .target-grade-row select { width: 100%; min-width: 0; text-align: center; }
.target-grade-row .count-input { width: 100%; }
.settings-summary { margin: 0 19px 12px; padding: 8px 0; }
.settings-summary > * { min-width: 0; padding: 0 5px; text-align: center; }
.settings-summary small, .settings-summary span { display: block; color: var(--muted); font-size: 10px; white-space: nowrap; }
.settings-summary strong { display: block; color: var(--ink); font: 700 17px/1.35 var(--serif); white-space: nowrap; }
.target-actions { display: flex; gap: 8px; margin: 0 19px 14px; }
.target-actions .button-primary { flex: 1; min-height: 44px; font: 700 15px/1.2 var(--serif); }
.target-actions .button-quiet { flex: none; }
.flexible-daily-option { display: flex; align-items: center; gap: 9px; position: relative; margin: 0 19px 14px; padding: 10px 11px; border: 1px solid #e2e9de; border-radius: 7px; background: #f8faf6; cursor: pointer; }
.flexible-daily-option input { position: absolute; width: 34px; height: 20px; margin: 0; opacity: 0; }
.option-switch { flex: none; width: 34px; height: 20px; position: relative; border-radius: 12px; background: #d4ddd0; transition: background .18s ease; }
.option-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .18s ease; }
.flexible-daily-option input:checked + .option-switch { background: var(--green); }
.flexible-daily-option input:checked + .option-switch::after { transform: translateX(14px); }
.flexible-daily-option input:focus-visible + .option-switch { outline: 3px solid #b7cfb3; outline-offset: 2px; }
.flexible-daily-option input:disabled ~ span { opacity: .5; }
.option-copy { min-width: 0; }
.option-copy strong { display: block; color: var(--green-dark); font-size: 11px; font-weight: 600; }
.option-copy small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.config-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 19px; border-top: 1px solid var(--line-soft); }
.grade-three-control { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--soft); font-size: 11px; }
.search-field input { width: 160px; }
.class-settings { margin: 0 19px 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.class-settings summary { padding: 10px 12px; color: var(--green-dark); font-size: 11px; font-weight: 700; cursor: pointer; }
.class-settings[open] summary { border-bottom: 1px solid var(--line); }
.class-settings summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.class-settings .count-chip { font: 500 10px/1.2 var(--sans); color: var(--muted); }
.class-settings-hint { margin: 0; padding: 7px 10px; color: var(--muted); font-size: 10px; }
#config-section .table-scroll { max-height: 242px; overflow-y: auto; }
#config-section .data-table thead { position: sticky; z-index: 2; top: 0; }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 19px 13px; border-top: 1px solid var(--line-soft); }
.panel-footer p { margin: 0; color: var(--muted); font-size: 10px; }

/* 排班结果参考示例布局，采用紧凑的行距和较宽的表格。 */
.result-panel { min-height: 520px; }
.result-panel > .panel-heading { min-height: 52px; }
.result-actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.result-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; padding: 5px 12px 10px; }
.result-toolbar label { display: inline-flex; align-items: center; gap: 5px; color: var(--soft); font-size: 10px; }
.result-toolbar select { min-width: 90px; min-height: 32px; }
.result-summary { display: flex; gap: 7px; padding: 0 12px 10px; }
.summary-metric { flex: 1; min-width: 0; padding: 7px 9px; border-radius: 6px; background: #f6f8f4; }
.summary-metric strong { display: block; color: var(--ink); font: 700 17px/1.2 var(--serif); }
.summary-metric span { color: var(--muted); font-size: 10px; }
.schedule-adoption { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 12px 10px; padding: 10px; border: 1px solid #e7ddbf; border-radius: 7px; background: #fffaf0; }
.schedule-adoption-copy { min-width: 0; }
.schedule-adoption-copy strong { display: block; color: #725b20; font-size: 11px; }
.schedule-adoption-copy span { display: block; margin-top: 2px; color: var(--soft); font-size: 10px; overflow-wrap: anywhere; }
.schedule-adoption.is-adopted { border-color: #cfe1cf; background: var(--success-soft); }
.schedule-adoption.is-adopted .schedule-adoption-copy strong { color: var(--success); }
.schedule-adoption .button { flex: none; min-width: 98px; }
.relaxed-summary { margin: 0 12px 10px; padding: 8px 10px; border: 1px solid #dce7d8; border-radius: 6px; background: #f6f9f3; color: var(--green-dark); font-size: 11px; overflow-wrap: anywhere; }
.table-scroll, .result-table-scroll { min-width: 0; overflow-x: auto; }
.result-table-scroll { max-height: 580px; overflow-y: auto; padding: 0 12px 14px; scrollbar-color: #cdd9c9 transparent; }
.result-table thead th { position: sticky; z-index: 2; top: 0; }
.data-table { width: 100%; border-collapse: collapse; color: #2a3d34; text-align: left; font-size: 11px; }
.data-table th {
  padding: 8px 10px;
  border: 1px solid #edf0e9;
  background: #f4f6f1;
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}
.data-table td { padding: 7px 10px; border: 1px solid #edf0e9; vertical-align: middle; }
.data-table tbody tr:nth-child(even):not(.empty-row) { background: #fafbf9; }
.data-table tbody tr:hover:not(.empty-row) { background: #f1f7ef; }
.data-table .empty-row td { padding: 28px 10px; color: var(--muted); text-align: center; }
.class-table th, .class-table td { padding: 6px 8px; font-size: 10px; }
.class-name { font-weight: 700; }
.grade-label { color: var(--soft); }
.count-input { width: 58px; min-height: 28px !important; text-align: center; }
.status-tag { display: inline-block; padding: 3px 6px; border-radius: 30px; background: var(--success-soft); color: var(--success); font-size: 10px; white-space: nowrap; }
.status-tag.is-off { background: #f0f2ef; color: var(--muted); }
.time-main { display: block; color: var(--ink); font-weight: 700; white-space: nowrap; }
.time-sub { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.shortage-wrap { padding: 0 12px 10px; }
.shortage-wrap h3 { margin: 0 0 5px; color: var(--danger); font-size: 10px; }
.shortage-list { display: flex; flex-wrap: wrap; gap: 5px; }
.shortage-item { padding: 4px 6px; border: 1px solid #efd6d0; border-radius: 5px; background: var(--danger-soft); color: var(--danger); font-size: 10px; }

/* 任务分配统计与 Word 预览共用结果区域的侧栏。 */
.stats-panel { min-height: 278px; }
.stats-panel .panel-heading, .word-panel .panel-heading { min-height: 48px; padding-top: 12px; padding-bottom: 9px; }
.workload-summary { margin: 0 15px 10px; padding: 0; border: 0; background: transparent; }
.workload-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.workload-head h3 { margin: 0; color: var(--soft); font-size: 10px; font-weight: 700; }
.workload-range { color: var(--muted); font-size: 10px; white-space: nowrap; }
.workload-grid { display: grid; gap: 4px; }
.workload-item { display: grid; grid-template-columns: minmax(45px, .45fr) minmax(0, 1.45fr) 39px; align-items: center; gap: 6px; min-height: 22px; border-bottom: 1px solid #f0f2ed; font-size: 10px; }
.workload-item:last-child { border-bottom: 0; }
.workload-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workload-item strong { font-size: 10px; font-weight: 500; text-align: right; white-space: nowrap; }
.workload-track { height: 8px; overflow: hidden; border-radius: 30px; background: #eff1ed; }
.workload-fill { display: block; height: 100%; border-radius: inherit; background: #789b72; }
.stats-foot { display: flex; align-items: center; justify-content: space-around; gap: 7px; margin: 0 14px 12px; padding: 8px; border-radius: 6px; background: #f7f8f5; }
.stats-foot > * { flex: 1; text-align: center; font-size: 10px; }
.stats-foot > * + * { border-left: 1px solid #dce3d8; }
.stats-foot strong { color: var(--ink); font: 700 14px/1.1 var(--serif); }
.word-panel { min-height: 221px; }
.word-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 15px 10px; }
.word-thumbs > .empty-message { grid-column: 1 / -1; }
.word-thumb { min-width: 0; margin: 0; text-align: center; }
.word-thumb img, .word-thumb-frame { display: block; width: 100%; aspect-ratio: .78; object-fit: contain; object-position: top; border: 1px solid #d9dfd7; background: #fff; box-shadow: 0 2px 5px rgba(28, 45, 32, .07); }
.word-thumb span, .word-thumb figcaption { display: block; margin-top: 4px; color: var(--soft); font-size: 10px; white-space: nowrap; }
.word-actions { display: flex; gap: 8px; padding: 0 15px 12px; }
.word-actions .button { flex: 1; min-width: 0; }
.empty-message { display: grid; place-items: center; min-height: 100px; padding: 12px; color: var(--muted); font-size: 11px; text-align: center; }

/* 可展开的排班规则说明和完整的文档页面预览。 */
.rules-details { margin: 13px 0 0; padding: 0 15px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--soft); font-size: 11px; }
.rules-details summary { padding: 11px 0; color: var(--green-dark); font-weight: 700; cursor: pointer; }
.rules-details ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; margin: 0 0 13px; padding-left: 17px; }
.preview-dialog { width: min(1100px, calc(100vw - 40px)); height: min(89vh, 950px); max-width: none; max-height: none; padding: 0; border: 1px solid #d8e4d8; border-radius: 14px; background: var(--paper); box-shadow: 0 22px 70px rgba(17, 42, 28, .22); color: var(--ink); }
.preview-dialog[open] { display: flex; flex-direction: column; }
.preview-dialog::backdrop { background: rgba(25, 42, 31, .63); backdrop-filter: blur(3px); }
.preview-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.preview-eyebrow { color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.preview-header h2 { margin: 3px 0 0; font: 700 17px/1.3 var(--serif); }
.preview-actions { display: flex; align-items: center; gap: 8px; }
.preview-stage { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; background: #e9ece6; scrollbar-gutter: stable; }
#word-preview-body { display: flex; flex-direction: column; align-items: center; gap: 20px; width: 100%; min-height: 100%; }
.preview-sheet { display: flex; flex-direction: column; gap: 8px; width: min(100%, 850px); margin: 0; }
.preview-page { display: block; width: 100%; height: auto; flex: none; border: 1px solid #cbd5ca; background: #fff; box-shadow: 0 5px 20px rgba(30, 49, 35, .11); }
.preview-page-label { align-self: center; margin: 0; color: #596a5e; font-size: 11px; font-weight: 700; }
.mobile-nav-label, .mobile-action-bar, .mobile-result-carousel, .mobile-result-list { display: none; }

/* 页面刷新加载新结构前，旧版页面结构仍保持可读。 */
.intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 14px; padding: 20px; border-radius: 10px; background: #edf3e9; }
.eyebrow { margin: 0 0 4px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .1em; }
h1 { margin: 0 0 3px; color: var(--ink-strong); font: 700 26px/1.3 var(--serif); }
.lead { margin: 0; color: var(--soft); font-size: 11px; }
.progress { display: flex; align-items: center; gap: 6px; }
.progress-step { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.progress-step b { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #bdccba; border-radius: 50%; }
.progress-step.is-current b { border-color: var(--green); background: var(--green); color: white; }
.progress-line { width: 17px; height: 1px; background: #cbd7c7; }
.layout, .main-column { display: grid; gap: 12px; min-width: 0; }

@media (max-width: 1350px) {
  .app-shell { grid-template-columns: 195px minmax(0, 1fr); }
  .topbar { padding: 0 21px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(0, .95fr); }
  .dashboard-grid > .targets-panel { grid-column: 1 / 3; min-height: auto; }
  .dashboard-grid > .result-panel { grid-column: 1 / 3; }
  .results-side { grid-column: 1 / 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .results-side > .stats-panel, .results-side > .word-panel { min-height: 250px; }
}
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-top: 12px; }
  .nav-step { display: flex; justify-content: center; min-height: 67px; padding: 14px 0; }
  .nav-step:not(:last-child)::after { top: 43px; bottom: -14px; left: calc(50% - 1px); }
  .nav-copy { display: none; }
  .topbar-week { font-size: 13px; }
}
@media (max-width: 700px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "topbar" "sidebar" "main"; }
  .topbar { min-height: 63px; padding: 10px 14px; gap: 10px; }
  .brand { gap: 10px; }
  .brand strong, .brand-title { font-size: 21px; }
  .topbar-week { font-size: 12px; }
  .sidebar { padding: 0; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sidebar-footer { display: none; }
  .sidebar-nav { display: flex; min-width: max-content; padding: 0 8px; }
  .nav-step { display: flex; align-items: center; justify-content: flex-start; gap: 5px; min-height: 49px; padding: 8px 11px; border-left: 0; border-bottom: 3px solid transparent; }
  .nav-step.is-current { border-color: var(--sage); }
  .nav-step:not(:last-child)::after { display: none; }
  .nav-dot { width: 23px; height: 23px; font-size: 11px; }
  .nav-copy { display: flex; }
  .nav-copy strong { font: 700 11px/1.2 var(--sans); }
  .nav-state { display: none; }
  .workspace { padding: 11px 9px 30px; }
  .dashboard-grid { display: flex; flex-direction: column; gap: 10px; }
  .dashboard-grid > .import-panel, .dashboard-grid > .roster-panel, .dashboard-grid > .targets-panel, .result-panel { min-height: 0; }
  .results-side { display: flex; flex-direction: column; align-self: stretch; width: 100%; gap: 10px; }
  .results-side > .stats-panel, .results-side > .word-panel { width: 100%; min-height: 0; }
  .result-table-scroll { max-height: 480px; }
  .rules-details ul { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .topbar { flex-wrap: wrap; }
  .topbar-week { order: 0; width: auto; margin-left: auto; }
  .topbar-actions { order: 3; width: 100%; margin-left: 0; justify-content: flex-end; }
  .topbar-actions .button { min-height: 30px; padding: 5px 8px; font-size: 10px; }
  .topbar > .brand, .brand strong, .brand-title { font-size: 19px; }
  .panel-heading { padding: 12px 13px 9px; }
  .panel-heading h2 { font-size: 15px; }
  .import-hero { padding-left: 13px; padding-right: 13px; }
  .import-grade-grid, .import-source, .settings-summary, .flexible-daily-option { margin-left: 13px; margin-right: 13px; }
  .import-grid { padding-left: 13px; padding-right: 13px; }
  .import-fields { grid-template-columns: 1fr; }
  .folder-entry { flex-wrap: wrap; }
  .folder-entry .button { flex: 1; }
  .dropzone small { display: none; }
  .import-foot { padding-left: 13px; padding-right: 13px; }
  .roster-block { padding-left: 13px; padding-right: 13px; }
  .roster-columns { display: none; }
  .inspector-row { grid-template-columns: minmax(80px, .8fr) minmax(100px, 1.2fr) 28px; }
  .target-grade-list { padding-left: 13px; padding-right: 13px; }
  .target-actions { margin-left: 13px; margin-right: 13px; }
  .target-actions { flex-wrap: wrap; }
  .target-actions .button-primary, .target-actions .button-quiet { flex: 1 1 100%; }
  .result-toolbar { justify-content: flex-start; }
  .result-heading { flex-wrap: wrap; }
  .result-heading .result-toolbar { order: 3; width: 100%; padding: 3px 0 2px 34px; }
  .result-heading h2 { flex: 1; }
  .result-table { min-width: 610px; }
  .result-table .empty-row td { text-align: left; }
  .result-actions { width: 100%; margin-left: 0; }
  .result-actions .button { flex: 1; }
  .preview-dialog { width: calc(100vw - 14px); height: calc(100dvh - 18px); border-radius: 9px; }
  .preview-header { padding: 12px; }
  .preview-header h2 { font-size: 14px; }
  .preview-header .button { min-height: 31px; padding: 5px 7px; font-size: 10px; }
  .preview-stage { padding: 8px 5px; }
}
/* 手机采用分步页面和固定主操作，避免把桌面表格和多列面板压缩到小屏幕。 */
@media (max-width: 700px) {
  body { font-size: 14px; background: #f5f6f0; }
  .app-shell { display: flex; flex-direction: column; min-height: 100dvh; }
  .topbar { display: flex; flex-wrap: wrap; gap: 10px; min-height: 74px; padding: max(14px, env(safe-area-inset-top)) 16px 12px; background: #fdfefa; border: 0; }
  .topbar > .brand { order: 0; font: 700 18px/1.2 var(--sans); letter-spacing: -.04em; }
  .topbar-week { order: 1; width: auto; margin-left: auto; gap: 5px; font: 600 12px/1 var(--sans); }
  .topbar .topbar-week input { width: 40px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 17px; }
  .topbar-week .chevron { display: none; }
  .topbar-actions { display: contents; }
  .topbar-avatar { order: 2; width: 38px; height: 38px; }
  .sidebar { position: sticky; top: 0; z-index: 19; overflow: visible; padding: 0 12px 10px; border: 0; background: #fdfefa; box-shadow: 0 5px 12px #233f2810; }
  .sidebar-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-width: 0; gap: 5px; padding: 0; }
  .nav-step { display: flex; justify-content: center; width: 100%; min-height: 64px; padding: 8px 3px; border: 1px solid transparent; border-radius: 12px; background: transparent; transition: none; }
  .nav-step.is-current { border-color: transparent; background: transparent; }
  .nav-step.is-selected { border-color: #cfddc9; background: var(--green-soft); }
  .nav-step[data-progress="generate"], .nav-step .nav-dot, .nav-step .nav-copy { display: none; }
  .nav-step:not(:last-child)::after { display: none; }
  .mobile-nav-label { display: flex; flex-direction: column; align-items: center; gap: 5px; color: #75816d; font-size: 12px; font-weight: 600; white-space: nowrap; }
  .mobile-nav-label::before { content: attr(data-number); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #6c7d62; background: #edf0e8; font-size: 12px; }
  .is-selected .mobile-nav-label { color: var(--green-dark); }
  .is-selected .mobile-nav-label::before { color: #fff; background: var(--green); }
  .is-done .mobile-nav-label::before { background: #d4e2cb; color: #3f603d; }
  .nav-step.is-selected.is-done .mobile-nav-label::before { background: var(--green); color: #fff; }
  .workspace { flex: 1; padding: 18px 12px calc(128px + env(safe-area-inset-bottom)); }
  .dashboard-grid { display: flex; flex-direction: column; gap: 14px; }
  .dashboard-grid > .panel, .dashboard-grid > .results-side { display: none; }
  body[data-mobile-step="import"] .dashboard-grid > .import-panel,
  body[data-mobile-step="roster"] .dashboard-grid > .roster-panel,
  body[data-mobile-step="targets"] .dashboard-grid > .targets-panel,
  body[data-mobile-step="result"] .dashboard-grid > .result-panel { display: block; }
  body[data-mobile-step="result"] .dashboard-grid > .results-side { display: flex; }
  .panel { border: 1px solid #e3e9dd; border-radius: 18px; box-shadow: 0 4px 16px #314b2f06; }
  .panel-heading { min-height: 64px; padding: 18px 16px 12px; }
  .panel-heading h2 { font: 700 17px/1.3 var(--sans); }
  .heading-meta { font: 600 12px/1.4 var(--sans); }
  .button, input:not([type="checkbox"]):not([type="file"]), select { min-height: 46px; border-radius: 11px; font-size: 15px; }
  .button { padding: 11px 14px; font-weight: 600; }
  .import-hero { padding: 4px 16px 0; }
  .import-hero > p:first-child { font: 600 16px/1.4 var(--sans); }
  .import-hero-number { margin: 5px 0; }
  .import-hero-number strong { font-size: 66px; }
  .import-hero > p:last-child { margin-bottom: 18px; font-size: 13px; }
  .import-grade-grid { margin: 0 16px 20px; padding: 16px 0; border-radius: 12px; }
  .import-grade strong { font: 600 15px/1.3 var(--sans); }
  .import-grade span { margin-top: 5px; font-size: 12px; }
  .import-source { margin: 0 16px 20px; }
  .builtin-import-controls { margin-bottom: 18px; }
  .builtin-import-controls .button { min-height: 50px; }
  .builtin-import-controls small { margin-top: 8px; font-size: 12px; }
  .dropzone { min-height: 90px; padding: 16px 12px; border-radius: 12px; background: #fafcf7; gap: 9px; }
  .dropzone strong { font-size: 14px; line-height: 1.5; }
  .dropzone small { display: block; font-size: 11px; line-height: 1.5; }
  .dropzone .dropzone-action { display: none; }
  .roster-block { padding: 0 16px 18px; }
  .roster-columns { display: none; }
  .inspector-rows { max-height: none; gap: 12px; overflow: visible; }
  .inspector-row { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 9px; padding: 14px 12px; border: 1px solid #e6ebdf; border-radius: 14px; background: #fbfcf8; }
  .inspector-row input, .inspector-row select { min-height: 46px; padding: 10px 11px; border: 1px solid #dde5d5; background: #fff; border-radius: 10px; font-size: 15px; }
  .inspector-row input { grid-column: 1; grid-row: 1; }
  .inspector-row select { grid-column: 1 / 3; grid-row: 2; }
  .inspector-row .button-remove { grid-column: 2; grid-row: 1; min-height: 46px; padding: 8px 4px; color: #8a6155; font-size: 13px; background: #f5eee8; }
  .add-inspector { margin-top: 14px; }
  .roster-hint { margin: 14px 0 0; font-size: 12px; line-height: 1.7; }
  .target-grade-list { padding: 0 16px; }
  .target-grade-row { min-height: 76px; gap: 8px; grid-template-columns: 42px minmax(0, 1fr) 88px 20px; }
  .target-grade-row strong { font: 600 16px/1.4 var(--sans); }
  .target-grade-row span { font-size: 12px; }
  .settings-summary { margin: 16px; padding: 14px 0; border-radius: 12px; background: #f4f7ef; }
  .settings-summary span { font-size: 11px; }
  .settings-summary strong { margin-top: 5px; font: 600 18px/1.4 var(--sans); }
  .target-actions { margin: 0 16px 16px; flex-direction: column; gap: 10px; }
  .target-actions .button-primary, .target-actions .button-quiet { flex: none; min-height: 48px; font: 600 15px/1.4 var(--sans); }
  .flexible-daily-option { margin: 0 16px 16px; padding: 15px 12px; min-height: 72px; border-radius: 12px; }
  .option-copy strong { font-size: 13px; line-height: 1.5; }
  .option-copy small { font-size: 11px; line-height: 1.5; }
  .class-settings { margin: 0 16px 16px; border-radius: 12px; }
  .class-settings > summary { padding: 16px 12px; min-height: 52px; font-size: 14px; }
  .class-table { min-width: 0; width: 100%; font-size: 12px; }
  .class-table th, .class-table td { padding: 10px 7px; }
  .class-table .count-input { width: 58px; min-height: 44px; padding: 5px; }
  .class-table th:last-child, .class-table td:last-child { display: none; }
  .class-settings-hint { font-size: 11px; line-height: 1.7; padding: 10px 12px; }
  .result-heading { flex-wrap: wrap; gap: 10px; }
  .result-heading .result-toolbar { order: 3; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; padding: 4px 0 0; gap: 8px; }
  .result-toolbar select { min-width: 0; width: 100%; font-size: 13px; padding: 10px; }
  .schedule-adoption { align-items: stretch; flex-direction: column; margin: 0 16px 14px; padding: 13px; border-radius: 12px; }
  .schedule-adoption-copy strong { font-size: 13px; }
  .schedule-adoption-copy span { margin-top: 4px; font-size: 12px; line-height: 1.6; }
  .schedule-adoption .button { width: 100%; min-height: 46px; }
  .result-table-scroll { display: none; }
  .mobile-result-carousel { display: block; min-width: 0; }
  .mobile-result-list { display: grid; gap: 12px; padding: 0 16px 18px; outline: 0; }
  .mobile-result-list.is-carousel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: calc(var(--mobile-carousel-card-height, 218px) + 76px);
    gap: 10px;
    padding: 38px 16px;
    overflow-x: clip;
    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-padding-block: 38px;
    scroll-snap-type: y mandatory;
    overscroll-behavior-y: auto;
    touch-action: pan-y pinch-zoom;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mobile-result-list.is-carousel::-webkit-scrollbar { display: none; }
  .mobile-result-list:focus-visible { outline: 2px solid #8da887; outline-offset: -2px; border-radius: 13px; }
  .mobile-result-list.is-empty { padding-bottom: 18px; }
  .mobile-task-card {
    padding: 14px;
    border: 1px solid #e0e8d8;
    border-radius: 13px;
    background: #fcfdf9;
    transform-origin: center;
    transition: transform 210ms cubic-bezier(.22, .8, .32, 1), opacity 180ms ease, border-color 210ms ease, box-shadow 210ms ease;
  }
  .mobile-result-list.is-carousel .mobile-task-card {
    flex: 0 0 var(--mobile-carousel-card-height, 218px);
    height: var(--mobile-carousel-card-height, 218px);
    min-height: 0;
    scroll-snap-align: center;
    scroll-snap-stop: normal;
    opacity: .72;
    transform: scale(.975);
    box-shadow: none;
    cursor: pointer;
  }
  .mobile-result-list.is-carousel .mobile-task-card.is-active {
    z-index: 1;
    border-color: #c9d9c3;
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 10px 28px rgba(39, 73, 43, .1);
  }
  .mobile-carousel-status { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 27px; padding: 5px 16px 11px; color: var(--muted); font-size: 11px; }
  .mobile-carousel-status strong { color: var(--green-dark); font-size: 11px; font-variant-numeric: tabular-nums; }
  .mobile-task-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; color: var(--green-dark); }
  .mobile-task-day { font-size: 12px; font-weight: 600; }
  .mobile-task-head strong { font-size: 20px; line-height: 1.3; }
  .mobile-task-card h3 { margin: 0 0 11px; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
  .mobile-task-details { display: grid; gap: 5px; font-size: 13px; color: #445b41; overflow-wrap: anywhere; }
  .mobile-task-course { margin: 11px 0 0; padding-top: 9px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
  .mobile-task-meta { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
  .results-side { gap: 14px; }
  .stats-panel { order: 2; }
  .word-panel { order: 1; }
  .word-actions { gap: 10px; }
  .workload-head h3, .workload-range, .workload-item, .workload-item strong { font-size: 12px; }
  .workload-item { min-height: 32px; }
  .workload-track { height: 10px; }
  .mobile-action-bar { display: block; position: fixed; right: 0; bottom: 0; left: 0; z-index: 25; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #dce5d2; background: #fdfefa; box-shadow: 0 -6px 20px #2c442b0a; }
  .mobile-step-caption { margin-bottom: 7px; color: #849077; font-size: 11px; }
  .mobile-action-buttons { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; }
  .mobile-action-buttons .button { min-height: 48px; }
  .notice, .update-banner { font-size: 13px; padding: 12px; border-radius: 12px; line-height: 1.65; }
  .rules-details { margin-top: 18px; }
  .rules-details summary { min-height: 44px; padding: 12px; font-size: 13px; }
  .preview-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .preview-header { flex-wrap: wrap; gap: 10px; padding: max(14px, env(safe-area-inset-top)) 14px 12px; }
  .preview-header h2 { font: 600 16px/1.4 var(--sans); }
  .preview-actions { width: 100%; display: flex; }
  .preview-header .button { min-height: 44px; font-size: 13px; padding: 10px 12px; }
  .preview-stage { padding: 12px 6px calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
