:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f9fafc;
  --ink: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --nav: #0b1020;
  --nav-2: #111936;
  --accent: #4f46e5;
  --accent-2: #6d5dfc;
  --accent-soft: #eef2ff;
  --good: #11845b;
  --good-soft: #e8f7f0;
  --warn: #b7791f;
  --warn-soft: #fff7e6;
  --bad: #c93636;
  --bad-soft: #fff0f0;
  --shadow: 0 10px 30px rgba(18, 25, 45, .07);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--nav), #10172c); color: white; padding: 26px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand-wrap { padding: 0 8px 28px; }
.brand-lockup { display: grid; gap: 8px; }
.brand-logo { display: block; height: auto; max-width: 100%; }
.sidebar-brand-lockup { gap: 10px; }
.sidebar-logo { width: 170px; }
.brand-sub { color: #9ba5c3; font-size: 12px; margin-top: 2px; }
.sidebar-brand-subtitle { padding-left: 4px; }
.brand { font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.nav { display: grid; gap: 6px; }
.nav-item { appearance: none; border: 0; color: #aeb8d2; background: transparent; text-align: left; border-radius: 11px; padding: 11px 12px; transition: .18s ease; }
.nav-item:hover { color: white; background: rgba(255,255,255,.06); }
.nav-item.active { color: white; background: var(--nav-2); box-shadow: inset 3px 0 0 #7c6cff; }
.sidebar-bottom { margin-top: auto; padding: 14px 10px 0; color: #aeb8d2; }
.status-dot-row { font-size: 12px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.main { min-width: 0; padding: 28px 34px 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.topbar h1 { margin: 3px 0 0; font-size: 27px; letter-spacing: -.03em; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.topbar-actions { display: flex; gap: 10px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 13px; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 7px 16px rgba(79,70,229,.18); }
.btn-secondary { color: #29324a; background: white; border-color: var(--border); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-danger { color: white; background: #c93636; }
.btn-small { padding: 6px 9px; font-size: 12px; }
.btn-large { padding: 13px 20px; font-size: 15px; }
.view { display: none; }
.view.active { display: block; }
.hero-card { background: radial-gradient(circle at 80% 20%, rgba(124,108,255,.18), transparent 34%), linear-gradient(135deg, #101833 0%, #0b1020 55%, #151c38 100%); color: white; border-radius: 24px; padding: 38px; display: grid; grid-template-columns: 1.5fr .8fr; align-items: center; box-shadow: var(--shadow); overflow: hidden; }
.hero-card h2 { font-size: clamp(28px, 3.1vw, 44px); line-height: 1.04; letter-spacing: -.045em; margin: 14px 0; max-width: 780px; }
.hero-card p { color: #c8d0e6; max-width: 680px; line-height: 1.6; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; }
.pill { display: inline-flex; background: rgba(124,108,255,.13); color: #7769ee; border: 1px solid rgba(124,108,255,.22); border-radius: 999px; padding: 6px 9px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.hero-card .pill { color: #d5d1ff; background: rgba(124,108,255,.16); border-color: rgba(255,255,255,.1); }
.hero-visual { display: grid; place-items: center; }
.mini-grid { width: 250px; aspect-ratio: 1.2; display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; transform: rotate(-4deg); }
.mini-grid span { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); border-radius: 9px; }
.mini-grid .fill { background: linear-gradient(135deg, rgba(124,108,255,.8), rgba(124,108,255,.3)); }
.mini-grid .fill2 { background: linear-gradient(135deg, rgba(45,212,191,.75), rgba(45,212,191,.2)); }
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 15px; margin: 18px 0; }
.stat-card, .panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 18px rgba(20,30,50,.035); }
.stat-card { padding: 18px 20px; }
.stat-card span { color: var(--muted); font-size: 12px; }
.stat-card strong { display: block; font-size: 29px; margin: 7px 0 2px; letter-spacing: -.04em; }
.stat-card small { color: #9aa1ad; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.three-col { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.panel { padding: 21px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.panel-head h3, .panel h3 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.panel-head p, .panel p { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.check-list { display: grid; gap: 11px; }
.check-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.check-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; flex: 0 0 auto; }
.check-icon.ok { background: var(--good-soft); color: var(--good); }
.check-icon.wait { background: #f2f3f7; color: #8d94a3; }
.check-item strong { display: block; font-size: 13px; }
.check-item span { color: var(--muted); font-size: 12px; }
.section-grid { display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 18px; align-items: start; }
.section-grid.wide-form { grid-template-columns: 410px minmax(0,1fr); }
.form-panel { display: grid; gap: 14px; position: sticky; top: 24px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: #41495d; }
input, select { width: 100%; border: 1px solid #dfe3ea; background: #fff; color: var(--ink); border-radius: 10px; padding: 10px 11px; outline: none; }
input:focus, select:focus { border-color: #8d83ef; box-shadow: 0 0 0 3px rgba(79,70,229,.09); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.table-panel { min-width: 0; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: #7b8291; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 10px 9px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 13px 9px; border-bottom: 1px solid #eff1f4; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 700; background: #f1f3f7; color: #5a6272; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.empty-state { border: 1px dashed #d8dde7; border-radius: 12px; padding: 20px; color: #818897; text-align: center; font-size: 13px; }
.constraint-card { padding: 13px 0; border-bottom: 1px solid #eef0f4; }
.constraint-card:last-child { border-bottom: 0; }
.constraint-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.constraint-title strong { font-size: 13px; }
.period-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.period-chip { border: 1px solid #dfe3ea; background: white; border-radius: 8px; min-width: 34px; height: 30px; padding: 0 8px; font-weight: 800; font-size: 11px; color: #5f6674; }
.period-chip.active { border-color: #f1b9b9; color: var(--bad); background: var(--bad-soft); }
.constraint-fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.constraint-fields label { font-size: 10px; }
.quick-rule-panel { margin-top: 18px; }
.quick-rule-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.beta { font-size: 9px; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 3px 6px; vertical-align: middle; }
.generator-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.generator-card { text-align: center; padding: 40px 30px; }
.generator-card h2 { font-size: 30px; letter-spacing: -.035em; margin: 14px 0 8px; }
.generator-card > p { max-width: 640px; margin: 0 auto; }
.generator-icon { width: 58px; height: 58px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 18px; background: linear-gradient(135deg, #ede9fe, #dffaf5); color: var(--accent); font-size: 28px; font-weight: 900; }
.generator-summary { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 22px 0; }
.generator-summary .badge { padding: 7px 10px; }
.feature-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.feature-list li { padding: 11px 12px 11px 38px; border: 1px solid var(--border); border-radius: 11px; position: relative; font-size: 13px; line-height: 1.4; }
.feature-list li:before { content: "✓"; position: absolute; left: 13px; top: 10px; color: var(--good); font-weight: 900; }
.schedule-head > div:last-child { display: flex; gap: 8px; }
.schedule-wrap { overflow: auto; }
.schedule-grid { min-width: 1050px; display: grid; grid-template-columns: 155px repeat(8, minmax(115px,1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.schedule-cell { min-height: 84px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 7px; background: white; }
.schedule-header { min-height: auto; padding: 9px; background: #f7f8fb; color: #6b7280; font-size: 11px; font-weight: 800; text-align: center; }
.teacher-cell { background: #fbfcfe; font-size: 12px; font-weight: 800; display: flex; align-items: center; }
.section-block { background: var(--accent-soft); border: 1px solid #d9dcff; border-radius: 9px; padding: 7px; margin-bottom: 5px; }
.section-block:last-child { margin-bottom: 0; }
.section-block strong { display: block; font-size: 11px; color: #3933a1; line-height: 1.25; }
.section-block span { display: block; color: #747a89; font-size: 9px; margin-top: 3px; }
.unscheduled-panel { margin-top: 18px; }
.unscheduled-item { display: flex; justify-content: space-between; gap: 15px; padding: 11px 0; border-bottom: 1px solid #eef0f4; font-size: 13px; }
.unscheduled-item:last-child { border-bottom: 0; }
.validation { padding: 10px 12px; border-radius: 11px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }
.validation.good { color: var(--good); background: var(--good-soft); }
.validation.bad { color: var(--bad); background: var(--bad-soft); }
.data-card { display: flex; flex-direction: column; gap: 12px; }
.file-label { border: 1px dashed #cfd5df; border-radius: 10px; padding: 10px; text-align: center; cursor: pointer; color: #5c6473; }
.file-label input { display: none; }
.note-panel { margin-top: 18px; }
.danger-zone { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: #f0caca; }
.flash { border-radius: 12px; padding: 12px 14px; margin: -8px 0 18px; font-size: 13px; font-weight: 700; }
.flash.good { color: var(--good); background: var(--good-soft); border: 1px solid #c8eadc; }
.flash.bad { color: var(--bad); background: var(--bad-soft); border: 1px solid #f3caca; }
.hidden { display: none !important; }
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 200px 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .section-grid, .section-grid.wide-form { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .three-col { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 16px; }
  .brand-wrap { padding-bottom: 14px; }
  .nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .nav-item { white-space: nowrap; }
  .sidebar-bottom { display: none; }
  .main { padding: 20px 15px 40px; }
  .topbar { align-items: flex-start; }
  .topbar-actions { flex-direction: column; }
  .hero-card { grid-template-columns: 1fr; padding: 28px 22px; }
  .hero-visual { display: none; }
  .stats-grid, .two-col, .generator-layout { grid-template-columns: 1fr; }
  .form-row, .constraint-fields { grid-template-columns: 1fr; }
  .quick-rule-row { grid-template-columns: 1fr; }
}
.label-help { font-weight: 500; color: var(--muted); }
.field-help { font-size: 10px; line-height: 1.35; color: var(--muted); font-weight: 500; }
.group-badge { margin: 2px 3px 2px 0; background: #eef0ff; color: #4a45a8; }
.individual-panel { margin-top: 18px; }
.individual-schedule-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.schedule-export-card { border: 1px solid var(--border); border-radius: 14px; padding: 15px; background: #fbfcfe; min-width: 0; }
.schedule-export-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 14px; }
.export-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.export-note { margin-top: 12px; line-height: 1.45; }
.individual-preview { min-width: 0; }
.mini-schedule-title { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 10px 0; }
.mini-schedule-title strong { font-size: 16px; letter-spacing: -.02em; }
.mini-schedule-title span { font-size: 10px; color: var(--muted); }
.mini-schedule-table { display: grid; grid-template-columns: 78px minmax(135px, 1fr) minmax(135px, 1fr); border-top: 1px solid var(--border); border-left: 1px solid var(--border); background: white; }
.mini-schedule-table > div { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 9px; min-height: 48px; display: flex; flex-direction: column; justify-content: center; }
.mini-table-head { min-height: auto !important; background: #f5f6fa; color: #717887; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.mini-period { color: var(--accent); font-size: 11px; font-weight: 800; align-items: center; }
.mini-course strong { font-size: 11px; line-height: 1.25; }
.mini-course span, .mini-detail span { display: block; font-size: 9px; color: var(--muted); margin-top: 3px; }
.mini-detail { font-size: 10px; line-height: 1.35; color: #4f5767; }
.empty-slot { color: #9299a7; font-style: italic; font-size: 10px; }
@media (max-width: 1150px) {
  .individual-schedule-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .schedule-head { align-items: flex-start; flex-direction: column; }
  .schedule-head > div:last-child { flex-wrap: wrap; }
  .schedule-export-controls { grid-template-columns: 1fr; }
  .export-actions { justify-content: flex-start; }
  .mini-schedule-table { grid-template-columns: 66px minmax(110px, 1fr) minmax(110px, 1fr); font-size: 10px; }
}
.table-input { min-width: 150px; padding: 7px 8px; font-size: 11px; border-radius: 8px; }

.lunch-slot { background: #f4f5fa; }
.lunch-slot strong { letter-spacing: .08em; }
.lunch-fields { grid-template-columns: minmax(180px, 320px); }

/* Manual drag-and-drop scheduler */
.manual-intro-panel { margin-bottom: 18px; }
.manual-head { align-items: flex-start; }
.manual-head h3 { margin-top: 10px; font-size: 20px; }
.manual-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.manual-tip { border: 1px solid #e2e5ec; background: #fafbfe; border-radius: 12px; padding: 11px 13px; color: #626a7a; font-size: 12px; line-height: 1.55; }
.manual-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 18px; align-items: start; }
.section-bank-panel { position: sticky; top: 24px; min-width: 0; }
.manual-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.manual-filters label { font-size: 10px; }
.manual-selection-status { padding: 10px 11px; border-radius: 10px; background: #f5f6f9; color: #777f8e; font-size: 11px; line-height: 1.4; margin-bottom: 10px; }
.manual-selection-status.active { color: #3933a1; background: var(--accent-soft); border: 1px solid #d9dcff; }
.manual-section-bank { display: grid; gap: 8px; max-height: 650px; overflow: auto; padding-right: 2px; }
.manual-section-card, .manual-scheduled-card { position: relative; border: 1px solid #dfe3ea; border-radius: 11px; background: white; padding: 10px; color: var(--ink); cursor: grab; outline: none; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.manual-section-card:hover, .manual-scheduled-card:hover { border-color: #bbbff4; box-shadow: 0 5px 14px rgba(35,42,76,.07); }
.manual-section-card:focus-visible, .manual-scheduled-card:focus-visible, .manual-drop-cell:focus-visible { box-shadow: 0 0 0 3px rgba(79,70,229,.14); border-color: #8d83ef; }
.manual-section-card.selected, .manual-scheduled-card.selected { border-color: #7971df; box-shadow: 0 0 0 3px rgba(79,70,229,.10); }
.manual-section-card.is-scheduled { background: #fafbfc; opacity: .78; }
.manual-section-card.dragging, .manual-scheduled-card.dragging { opacity: .45; transform: scale(.98); }
.manual-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 4px; }
.manual-section-card strong, .manual-scheduled-card strong { display: block; font-size: 11px; color: #3530a0; line-height: 1.25; }
.manual-section-card > span, .manual-scheduled-card > span { display: block; color: #747c8c; font-size: 9px; margin-top: 3px; line-height: 1.35; }
.manual-board-panel { min-width: 0; }
.manual-board-wrap { overflow: auto; padding-bottom: 2px; }
.manual-grid { min-width: 1040px; display: grid; grid-template-columns: 110px repeat(8, minmax(112px,1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.manual-grid-head { background: #f6f7fa; color: #697182; text-align: center; font-size: 10px; font-weight: 800; padding: 9px 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2; }
.manual-class-head { left: 0; z-index: 3; }
.manual-class-label { min-height: 92px; padding: 10px; background: #fafbfc; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: sticky; left: 0; z-index: 1; display: flex; flex-direction: column; justify-content: center; }
.manual-class-label strong { font-size: 13px; }
.manual-class-label span { color: var(--muted); font-size: 9px; margin-top: 4px; }
.manual-drop-cell { min-height: 92px; padding: 7px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: white; position: relative; outline: none; transition: background .12s ease, box-shadow .12s ease; }
.manual-drop-cell.drag-over { background: #f0f1ff; box-shadow: inset 0 0 0 2px #756be8; }
.manual-empty-label { display: grid; place-items: center; min-height: 74px; color: #a3a9b4; font-size: 9px; border: 1px dashed #e1e4eb; border-radius: 8px; text-align: center; padding: 5px; }
.manual-lunch-cell { background: #f3f4f7; color: #5e6675; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.manual-lunch-cell strong { font-size: 11px; letter-spacing: .08em; }
.manual-lunch-cell span { margin-top: 4px; font-size: 9px; color: #8a91a0; }
.manual-target-hint { display: block; border-radius: 6px; margin-bottom: 5px; padding: 3px 5px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.manual-teacher-conflict { background: #fffaf0; }
.manual-teacher-conflict .manual-target-hint, .manual-teacher-conflict .manual-empty-label { color: var(--warn); border-color: #edd39b; }
.manual-class-conflict { background: #fff7f4; }
.manual-class-conflict .manual-target-hint, .manual-class-conflict .manual-empty-label { color: #b45309; border-color: #efc4aa; }
.manual-hard-blocked { background: #fff6f6; }
.manual-hard-blocked .manual-target-hint, .manual-hard-blocked .manual-empty-label { color: var(--bad); border-color: #efb8b8; }
.manual-scheduled-card { min-height: 72px; padding-right: 28px; background: var(--accent-soft); border-color: #d9dcff; }
.manual-unschedule { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border: 0; border-radius: 7px; background: rgba(255,255,255,.82); color: #747b8a; font-size: 15px; line-height: 1; padding: 0; }
.manual-unschedule:hover { color: var(--bad); background: #fff; }
.modal-backdrop { position: fixed; inset: 0; z-index: 1000; background: rgba(8,12,24,.54); display: grid; place-items: center; padding: 22px; }
.modal-card { width: min(560px,100%); max-height: calc(100vh - 44px); overflow: auto; background: white; border-radius: 18px; border: 1px solid #e0e3ea; box-shadow: 0 30px 80px rgba(8,12,24,.28); padding: 24px; }
.modal-card h3 { margin: 12px 0 8px; font-size: 21px; letter-spacing: -.025em; }
.modal-card > p { color: #666f80; font-size: 13px; line-height: 1.55; margin: 0 0 16px; }
.conflict-details { display: grid; gap: 8px; margin: 14px 0 20px; }
.conflict-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px; border: 1px solid #ebd7af; background: #fffbf3; border-radius: 11px; }
.conflict-item strong { display: block; font-size: 12px; }
.conflict-item span:not(.badge) { display: block; color: #777f8e; font-size: 9px; margin-top: 3px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1080px) {
  .manual-layout { grid-template-columns: 1fr; }
  .section-bank-panel { position: static; }
  .manual-section-bank { max-height: none; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .manual-head { flex-direction: column; }
  .manual-actions { justify-content: flex-start; }
  .manual-filters, .manual-section-bank { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .modal-card { padding: 18px; }
  .conflict-item { align-items: flex-start; flex-direction: column; }
}
.manual-place-selected { width: 100%; border: 1px solid #e0c27d; background: #fff8e8; color: #9a6818; border-radius: 7px; padding: 5px 6px; margin-bottom: 5px; font-size: 8px; line-height: 1.2; font-weight: 800; cursor: pointer; }
.manual-class-conflict .manual-place-selected { border-color: #efc4aa; background: #fff3ec; color: #a6531b; }

/* Built-in mandatory Lunch course section */
.builtin-lunch-row td { background: #fafbfc; }
.lunch-bank-card { border-style: dashed; }
.manual-lunch-cell .lunch-scheduled-card { width: 100%; background: #f8f9fb; border-style: dashed; text-align: left; }

/* v7 Classes + Course Section multi-select */
.class-multi-field{border:1px solid var(--border);border-radius:12px;padding:12px;margin:0;min-width:0}.class-multi-field legend{font-size:12px;font-weight:700;padding:0 6px}.multi-choice-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin:4px 0 6px}.multi-choice{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:10px;padding:9px 10px;background:var(--panel);cursor:pointer;min-height:42px}.multi-choice input{width:auto;margin:0}.multi-choice:hover{border-color:var(--accent)}.multi-choice-empty{font-size:12px;color:var(--muted);padding:8px 0}.table-input-number{max-width:105px}

/* v8 Course Sections simplification + Class Groups terminology */
.course-page-layout { display: grid; grid-template-columns: 390px minmax(0,1fr); gap: 18px; align-items: start; }
.course-create-panel { display: grid; gap: 14px; position: sticky; top: 24px; }
.label-help { color: var(--muted); font-size: 10px; font-weight: 600; }
.class-picker-field { display: grid; gap: 8px; }
.class-picker-details { border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden; }
.class-picker-details > summary, .advanced-options > summary { cursor: pointer; list-style: none; padding: 10px 12px; font-size: 12px; font-weight: 800; color: #343b4e; }
.class-picker-details > summary::-webkit-details-marker, .advanced-options > summary::-webkit-details-marker, .course-group-card > summary::-webkit-details-marker { display: none; }
.class-picker-details > summary:after, .advanced-options > summary:after { content: '▾'; float: right; color: var(--muted); transition: transform .15s ease; }
.class-picker-details[open] > summary:after, .advanced-options[open] > summary:after { transform: rotate(180deg); }
.class-picker-details .multi-choice-list { padding: 0 10px 10px; max-height: 250px; overflow: auto; }
.selected-class-chips { min-height: 34px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.class-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent-soft); color: #4338a8; border: 1px solid #d9dcff; padding: 5px 8px; font-size: 11px; font-weight: 800; }
.advanced-options { border: 1px solid var(--border); border-radius: 11px; background: #fafbfc; }
.advanced-options-body { padding: 2px 12px 12px; display: grid; gap: 10px; }
.course-list-panel { min-width: 0; }
.course-list-head { margin-bottom: 12px; }
.course-toolbar { display: grid; grid-template-columns: minmax(180px,1.5fr) repeat(3,minmax(130px,1fr)); gap: 8px; align-items: end; margin-bottom: 10px; }
.course-toolbar label { font-size: 10px; }
.course-search { min-width: 0; }
.show-required-toggle { display: flex; align-items: center; gap: 7px; width: fit-content; margin: 5px 0 14px; font-weight: 700; }
.show-required-toggle input { width: auto; margin: 0; }
.course-groups-list { display: grid; gap: 10px; }
.course-group-card { border: 1px solid var(--border); border-radius: 13px; background: #fff; overflow: hidden; }
.course-group-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; cursor: pointer; background: #fafbfc; }
.course-group-card > summary > div { min-width: 0; }
.course-group-card > summary strong { display: block; font-size: 13px; }
.course-group-card > summary span:not(.course-section-count) { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.course-section-count { flex: 0 0 auto; display: inline-flex; border-radius: 999px; background: #f1f3f7; color: #5c6474; padding: 5px 8px; font-size: 10px; font-weight: 800; }
.course-group-rows { border-top: 1px solid var(--border); }
.course-section-row { display: grid; grid-template-columns: minmax(100px,1fr) minmax(140px,1.35fr) minmax(105px,.85fr) minmax(105px,.9fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #eff1f4; }
.course-section-row:last-child { border-bottom: 0; }
.course-section-row > div { min-width: 0; }
.course-section-row > div > strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.course-section-main span, .course-row-label { display: block; color: var(--muted); font-size: 9px; margin-bottom: 3px; }
.required-group > summary { background: #f7faf8; }
.required-row { background: #fbfdfc; }
.course-edit-card { display: grid; gap: 13px; }
.course-edit-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.course-edit-actions > div { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 1180px) {
  .course-page-layout { grid-template-columns: 1fr; }
  .course-create-panel { position: static; }
  .course-toolbar { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .course-toolbar { grid-template-columns: 1fr; }
  .course-section-row { grid-template-columns: 1fr 1fr; }
  .course-section-row .edit-course { justify-self: start; }
  .course-section-main { grid-column: 1 / -1; }
  .course-edit-actions { align-items: stretch; flex-direction: column-reverse; }
  .course-edit-actions > div { width: 100%; }
  .course-edit-actions .btn { flex: 1; }
}

/* Overview tutorial */
.tutorial-panel { margin: 18px 0; padding: 22px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); display: grid; grid-template-columns: minmax(250px,.72fr) minmax(0,1.28fr); gap: 24px; align-items: center; box-shadow: 0 6px 18px rgba(20,30,50,.035); }
.tutorial-copy { min-width: 0; }
.tutorial-copy h3 { margin: 12px 0 8px; font-size: 24px; letter-spacing: -.03em; }
.tutorial-copy p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tutorial-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; color: #8a91a0; font-size: 11px; font-weight: 700; }
.tutorial-video-wrap { min-width: 0; overflow: hidden; border-radius: 16px; background: #0b1020; box-shadow: 0 10px 26px rgba(11,16,32,.14); }
.tutorial-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0b1020; object-fit: contain; }
@media (max-width: 900px) {
  .tutorial-panel { grid-template-columns: 1fr; }
}

/* Reliable tutorial poster overlay */
.tutorial-video-wrap { position: relative; }
.tutorial-poster-button { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; margin: 0; background: #0b1020; cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.tutorial-poster-button.hidden { display: none; }
.tutorial-poster-button img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tutorial-play-button { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; padding-left: 4px; background: rgba(11,16,32,.84); color: #fff; font-size: 25px; box-shadow: 0 10px 30px rgba(0,0,0,.3); border: 2px solid rgba(255,255,255,.85); }
@media (max-width: 640px) { .tutorial-play-button { width: 54px; height: 54px; font-size: 21px; } }

/* Navigation labels never display underlines */
.nav-item, .nav-item:hover, .nav-item:focus, .nav-item:active, .nav-item:visited, .nav a { text-decoration: none !important; text-decoration-line: none !important; }

/* Public feature overview (separate from dashboard counters) */
html{scroll-behavior:smooth}
#features{scroll-margin-top:24px}
#features:focus{outline:none;box-shadow:none}
.sidebar .brand-sub{color:#9eb5d2;font-size:13px;font-weight:600;letter-spacing:.015em;line-height:1.4;margin-top:-22px}
.ed-features{padding:34px 0 40px;max-width:1200px;margin:0 auto;color:inherit}
.ed-features-intro{max-width:730px;margin-bottom:24px}
.ed-features-intro h2{font-size:clamp(1.7rem,3vw,2.45rem);line-height:1.13;letter-spacing:-.035em;margin:14px 0 12px}
.ed-features-intro>p{font-size:1rem;line-height:1.7;color:#667085;margin:0}
.ed-features-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.ed-feature{border-radius:18px;background:#fff;border:1px solid #e4e8f0;padding:24px;box-shadow:0 10px 28px rgba(25,50,87,.045)}
.ed-feature-index{font-size:.69rem;letter-spacing:.1em;font-weight:750;color:#2964a4}
.ed-feature h3{font-size:1.1rem;margin:12px 0 9px;line-height:1.25}
.ed-feature p{font-size:.91rem;color:#667085;line-height:1.65;margin:0}
.ed-features-footer{margin-top:18px;padding:22px 26px;border:1px solid #dfe7f1;border-radius:18px;background:#eef4fb;display:flex;align-items:center;justify-content:space-between;gap:20px}
.ed-features-footer p{color:#637286;margin:6px 0 0;line-height:1.5}
.ed-features-footer .btn{white-space:nowrap;text-decoration:none!important}
@media(max-width:750px){.ed-features{padding:28px 0}.ed-features-grid{grid-template-columns:1fr}.ed-feature{padding:20px}.ed-features-footer{align-items:flex-start;flex-direction:column}}
