:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --surface-strong: #f3f4f6;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --muted-strong: #4b5563;
  --sidebar: #18181b;
  --sidebar-soft: #222226;
  --sidebar-border: #2b2b30;
  --blue: #4f6df5;
  --blue-dark: #3f5de4;
  --blue-soft: #eef2ff;
  --green: #16a34a;
  --green-soft: #ecfdf3;
  --amber: #d97706;
  --amber-soft: #fff7ed;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --sidebar-collapsed: 72px;
  --sidebar-expanded: 240px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-collapsed);
  height: 100vh;
  padding: 20px 12px;
  overflow: hidden;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-border);
  color: #ffffff;
  transition:
    width 0.2s ease,
    box-shadow 0.2s ease;
}

.sidebar:hover,
.sidebar:focus-within {
  width: var(--sidebar-expanded);
  box-shadow: 22px 0 44px rgba(15, 23, 42, 0.2);
}

.brand-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 56px;
  padding: 0 8px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  transition: gap 0.2s ease;
}

.sidebar:hover .brand-block,
.sidebar:focus-within .brand-block {
  justify-content: flex-start;
  gap: 12px;
}

.brand-mark,
.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--blue);
  color: #ffffff;
  font-weight: 850;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 16px;
}

.brand-copy,
.footer-copy,
.nav-label {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  white-space: nowrap;
  transform: translateX(-4px);
  transition:
    max-width 0.2s ease,
    opacity 0.16s ease,
    transform 0.2s ease;
}

.sidebar:hover .brand-copy,
.sidebar:focus-within .brand-copy,
.sidebar:hover .footer-copy,
.sidebar:focus-within .footer-copy,
.sidebar:hover .nav-label,
.sidebar:focus-within .nav-label {
  max-width: 150px;
  opacity: 1;
  transform: translateX(0);
}

.brand-block strong,
.sidebar-footer strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
}

.brand-block span,
.sidebar-footer span {
  display: block;
  margin-top: 3px;
  color: #9ca3af;
  font-size: 12px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 56px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #d1d5db;
  font-weight: 750;
  text-decoration: none;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    gap 0.2s ease,
    justify-content 0.2s ease;
}

.sidebar:hover .sidebar-nav a,
.sidebar:focus-within .sidebar-nav a {
  justify-content: flex-start;
  gap: 10px;
}

.nav-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: #a1a1aa;
  font-size: 10px;
  font-weight: 850;
}

.sidebar-nav a:hover {
  background: var(--sidebar-soft);
  color: #ffffff;
}

.sidebar-nav a.active {
  background: var(--blue);
  color: #ffffff;
}

.sidebar-nav a.active span {
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid var(--sidebar-border);
  transition: gap 0.2s ease;
}

.sidebar:hover .sidebar-footer,
.sidebar:focus-within .sidebar-footer {
  justify-content: flex-start;
  gap: 12px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #3f3f46;
  font-size: 12px;
}

.main-shell {
  min-width: 0;
  margin-left: var(--sidebar-collapsed);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 24px 14px;
}

.eyebrow,
.page-subtitle {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 750;
}

.page-subtitle {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.35;
  letter-spacing: 0;
}

.top-actions,
.result-toolbar,
.with-action {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.icon-button,
.segmented button,
.danger-button,
.remove-teacher {
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.primary-button {
  min-width: 124px;
  padding: 0 16px;
  border-color: var(--blue);
  background: var(--blue);
  color: #ffffff;
  font-weight: 850;
}

.primary-button:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  box-shadow: 0 10px 22px rgba(79, 109, 245, 0.24);
}

.ghost-button {
  padding: 0 13px;
  font-weight: 750;
}

.ghost-button:hover,
.file-button:hover {
  border-color: #c7d2fe;
  background: var(--blue-soft);
  color: #3045c7;
}

.icon-button {
  width: 38px;
  padding: 0;
  color: var(--blue);
  font-size: 20px;
  font-weight: 850;
}

.remove-teacher {
  padding: 0 10px;
  color: var(--red);
}

.danger-button {
  color: var(--red);
}

.workspace {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 10px 24px 24px;
}

.setup-pane,
.result-pane,
.diagnostic-pane {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.setup-pane,
.diagnostic-pane {
  padding: 16px;
}

.result-pane {
  order: 1;
  min-height: 640px;
  padding: 18px;
}

.setup-pane {
  order: 2;
}

.diagnostic-pane {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  width: min(420px, calc(100vw - 44px));
  max-height: min(420px, calc(100vh - 120px));
  display: block;
  overflow: auto;
  border-color: rgba(220, 38, 38, 0.28);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22);
}

.diagnostic-pane h2 {
  margin-bottom: 10px;
  color: #991b1b;
}

.diagnostic-pane-highlight {
  box-shadow: 0 0 0 2px rgba(79, 109, 245, 0.22), 0 22px 56px rgba(15, 23, 42, 0.22);
}

.legacy-list-fields {
  display: none;
}

.state-store-section {
  display: none !important;
}

.teacher-section,
.fixed-section,
.import-section,
.math-level-section,
.period-section,
.day-period-section,
.room-section,
.publisher-section,
.rule-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pane-header,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.pane-header span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #334acb;
  font-size: 12px;
  font-weight: 800;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-grid,
.compact-grid {
  display: grid;
  gap: 10px;
}

.field-grid {
  grid-template-columns: 1fr;
}

.field-grid.legacy-list-fields {
  display: none;
}

.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin-top: 10px;
}

label,
fieldset {
  min-width: 0;
}

label {
  display: grid;
  gap: 6px;
  color: #374151;
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 38px;
  padding: 0 10px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  padding: 9px 10px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 109, 245, 0.14);
}

.choice-row,
.option-row,
.teacher-fields fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 12px 0 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.choice-row label,
.option-row label,
.teacher-fields fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.rule-table-wrap,
.math-level-table-wrap,
.publisher-table-wrap,
.room-table-wrap,
.day-period-table-wrap,
.teacher-list,
.fixed-list,
.period-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.rule-table,
.math-level-table,
.period-table,
.day-period-table,
.room-table,
.teacher-table,
.fixed-table,
.publisher-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.rule-table th,
.rule-table td,
.math-level-table th,
.math-level-table td,
.period-table th,
.period-table td,
.day-period-table th,
.day-period-table td,
.room-table th,
.room-table td,
.teacher-table th,
.teacher-table td,
.fixed-table th,
.fixed-table td,
.publisher-table th,
.publisher-table td {
  padding: 9px;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.rule-table tr:last-child td,
.math-level-table tr:last-child td,
.period-table tr:last-child td,
.day-period-table tr:last-child td,
.room-table tr:last-child td,
.teacher-table tr:last-child td,
.fixed-table tr:last-child td,
.publisher-table tr:last-child td {
  border-bottom: 0;
}

.rule-table th,
.math-level-table th,
.period-table th,
.day-period-table th,
.room-table th,
.teacher-table th,
.fixed-table th,
.publisher-table th {
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.rule-table input {
  min-width: 76px;
}

.rule-table .rule-action {
  width: 72px;
}

.rule-table input[readonly] {
  color: var(--muted-strong);
  background: var(--surface-soft);
}

.locked-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rule-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.math-level-table {
  min-width: 680px;
}

.math-level-table input {
  min-width: 120px;
}

.math-level-table .math-action {
  width: 72px;
}

.period-table {
  min-width: 420px;
}

.day-period-table {
  min-width: 0;
  table-layout: auto;
}

.day-period-table-wrap {
  padding: 10px;
}

.day-period-add-row {
  display: grid;
  grid-template-columns: minmax(96px, 150px) auto;
  justify-content: end;
  gap: 8px;
  margin-bottom: 10px;
}

.day-period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 10px;
}

.day-period-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.day-period-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-bottom: 1px solid #eef0f3;
  background: var(--surface-soft);
}

.day-period-card-header strong {
  font-size: 13px;
  font-weight: 900;
}

.day-period-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tiny-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #ffffff;
  color: var(--blue);
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.tiny-remove-day-button {
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff5f5;
  color: var(--red);
  font-size: 11px;
  font-weight: 850;
}

.day-period-table th,
.day-period-table td {
  padding: 5px 7px;
  overflow: hidden;
}

.day-period-table th {
  font-size: 11px;
}

.day-period-table .period-name {
  width: 54px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.day-period-table th:nth-child(2),
.day-period-table th:nth-child(3),
.day-period-table td:nth-child(2),
.day-period-table td:nth-child(3) {
  width: 126px;
}

.day-period-table input {
  width: 100%;
  min-width: 116px;
  height: 30px;
  padding: 4px 6px;
  font-size: 12px;
}

.day-period-action {
  width: 58px;
}

.day-period-action button {
  padding: 4px 7px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff5f5;
  color: #dc2626;
  font-size: 11px;
  font-weight: 850;
}

.room-table {
  min-width: 360px;
}

.room-table .row-number,
.room-table .room-action {
  width: 72px;
}

.publisher-table {
  min-width: 720px;
}

.teacher-table {
  min-width: 980px;
}

.teacher-table .row-number {
  width: 64px;
}

.publisher-table input {
  min-width: 120px;
}

.spreadsheet-wrap table input {
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
}

.spreadsheet-wrap table input:focus {
  background: #ffffff;
}

.publisher-add-row,
.day-period-add-row,
.import-actions,
.version-toolbar {
  display: grid;
  gap: 8px;
}

.publisher-add-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  align-items: end;
}

.import-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.version-toolbar {
  display: flex;
  flex-wrap: wrap;
  margin: 12px 0 0;
  align-items: center;
}

.version-toolbar input,
.version-toolbar select {
  flex: 1 1 150px;
}

.version-toolbar button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.remove-publisher-row,
.remove-period-row,
.remove-subject-rule,
.remove-teacher,
.remove-fixed {
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(220, 38, 38, 0.26);
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.teacher-list,
.fixed-list {
  background: #ffffff;
}

.fixed-list {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.fixed-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.fixed-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #eef0f3;
  background: var(--surface-soft);
}

.fixed-card-head strong {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: #334acb;
  font-size: 12px;
}

.fixed-badge {
  margin-right: auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: #334acb;
  font-size: 11px;
  font-weight: 850;
}

.fixed-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 10px;
  align-items: end;
  padding: 11px;
}

.fixed-fields .wide-field {
  grid-column: span 2;
}

.teacher-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border-bottom: 1px solid var(--border);
}

.teacher-name {
  font-weight: 850;
}

.teacher-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
  padding: 11px;
}

.teacher-fields fieldset {
  grid-column: 1 / -1;
  margin: 0;
}

.result-toolbar {
  flex-wrap: wrap;
  justify-content: space-between;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  overflow: visible;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segmented button {
  min-width: 76px;
  border: 0;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 800;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.active {
  background: var(--blue);
  color: #ffffff;
}

.style-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.style-switcher button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.style-switcher button.active {
  background: #111827;
  color: #ffffff;
}

.auto-edit-button {
  min-height: 38px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
}

.auto-edit-button.active {
  border-color: rgba(217, 119, 6, 0.3);
  background: var(--amber-soft);
  color: #92400e;
}

#filterSelect {
  max-width: 220px;
}

.group-filter-panel {
  display: flex;
  flex: 1 1 520px;
  flex-wrap: wrap;
  gap: 8px;
  min-width: min(100%, 420px);
}

.filter-toggle-group {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(110px, 1fr);
  align-items: center;
  gap: 8px;
  min-width: min(100%, 190px);
  padding: 5px 6px 5px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  z-index: 1;
}

.filter-toggle-group.open {
  z-index: 20;
  border-color: rgba(44, 91, 255, 0.42);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
}

.filter-toggle-group > span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.filter-toggle-trigger {
  position: relative;
  width: 100%;
  min-height: 32px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.filter-toggle-trigger::after {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.16s ease;
}

.filter-toggle-group.open .filter-toggle-trigger {
  border-color: rgba(44, 91, 255, 0.38);
  background: #eef4ff;
  color: var(--blue);
}

.filter-toggle-group.open .filter-toggle-trigger::after {
  transform: translateY(-35%) rotate(225deg);
}

.filter-toggle-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 220px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.16);
}

.filter-toggle-options[hidden] {
  display: none;
}

.filter-toggle-options button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.filter-toggle-options button.active {
  background: var(--blue);
  color: #ffffff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 10px;
  margin: 14px 0;
}

.metric {
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.message-area {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.color-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.legend-title {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.slot-palette-button {
  width: 20px;
  height: 20px;
  min-height: 20px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 180px;
  min-height: 24px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--lesson-border, var(--border));
  border-radius: 999px;
  background: var(--lesson-bg, #ffffff);
  color: var(--lesson-text, var(--text));
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.legend-chip i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--lesson-border, var(--blue));
}

.legend-empty {
  color: var(--muted);
  font-size: 12px;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 1.45;
}

.message.success {
  border-color: rgba(22, 163, 74, 0.26);
  background: var(--green-soft);
  color: #166534;
}

.message.warning {
  border-color: rgba(217, 119, 6, 0.3);
  background: var(--amber-soft);
  color: #92400e;
}

.message.error {
  border-color: rgba(220, 38, 38, 0.28);
  background: var(--red-soft);
  color: #991b1b;
}

.schedule-grid {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.schedule-issue-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 12px 0;
}

.schedule-issue-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.schedule-issue-chip.warning {
  border-color: rgba(217, 119, 6, 0.24);
  background: var(--amber-soft);
  color: #92400e;
}

.schedule-issue-chip.error {
  border-color: rgba(220, 38, 38, 0.24);
  background: var(--red-soft);
  color: #991b1b;
}

.timetable {
  width: 100%;
  min-width: 820px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.timetable th,
.timetable td {
  border-right: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
  vertical-align: top;
}

.timetable th:last-child,
.timetable td:last-child {
  border-right: 0;
}

.timetable tr:last-child td {
  border-bottom: 0;
}

.timetable th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 42px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 850;
}

.time-cell {
  width: 84px;
  padding: 9px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.slot-cell {
  min-height: 64px;
  padding: 7px;
  overflow: visible;
}

.slot-cell.selected-slot {
  background: #eef2ff;
  box-shadow: inset 0 0 0 2px rgba(79, 109, 245, 0.28);
}

.slot-cell.empty-focus-slot {
  background: linear-gradient(135deg, #f8fafc, #ffffff);
}

.empty-slot-label {
  display: inline-flex;
  margin-bottom: 5px;
  padding: 2px 6px;
  border: 1px dashed #cbd5e1;
  border-radius: 999px;
  color: #64748b;
  font-size: 10px;
  font-weight: 850;
}

.slot-cell.editing-fixed-slot {
  background: #f8fbff;
  box-shadow: inset 0 0 0 2px rgba(79, 109, 245, 0.16);
}

.slot-cell.drop-target {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
  background: var(--blue-soft);
}

.slot-cell.disabled-slot {
  background: repeating-linear-gradient(135deg, #fafafa, #fafafa 8px, #f3f4f6 8px, #f3f4f6 16px);
}

.lesson-block {
  display: grid;
  gap: 3px;
  position: relative;
  min-width: 0;
  min-height: 46px;
  margin-bottom: 6px;
  padding: 8px 8px 8px 10px;
  overflow: hidden;
  border-left: 4px solid var(--lesson-border, #0f766e);
  border-radius: 8px;
  background: var(--lesson-bg, #ecfdf5);
  color: var(--lesson-text, #134e4a);
  line-height: 1.25;
}

.lesson-block.has-issue {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.lesson-block.issue-warning {
  outline: 2px solid rgba(217, 119, 6, 0.24);
  outline-offset: -1px;
}

.lesson-block.issue-error {
  outline: 2px solid rgba(220, 38, 38, 0.28);
  outline-offset: -1px;
}

.lesson-block.conflict-peer {
  border-style: dashed;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.lesson-block.virtual-conflict {
  background: repeating-linear-gradient(135deg, var(--lesson-bg, #ecfdf5), var(--lesson-bg, #ecfdf5) 10px, rgba(255, 255, 255, 0.45) 10px, rgba(255, 255, 255, 0.45) 20px);
  opacity: 0.96;
}

.lesson-block.palette-open {
  overflow: visible;
  z-index: 25;
}

.lesson-block[draggable="true"] {
  cursor: grab;
}

.lesson-block.dragging {
  opacity: 0.55;
}

.lesson-block.math {
  --lesson-border: var(--blue);
  --lesson-bg: var(--blue-soft);
  --lesson-text: #24378f;
}

.lesson-block.english {
  --lesson-border: #0f766e;
}

.lesson-block.korean {
  --lesson-border: var(--amber);
  --lesson-bg: var(--amber-soft);
  --lesson-text: #7c2d12;
}

.lesson-block.manual {
  --lesson-border: #7c3aed;
  --lesson-bg: #f3e8ff;
  --lesson-text: #4c1d95;
}

.schedule-style-modern .lesson-block {
  border-left-width: 0;
  border-top: 4px solid var(--lesson-border, #0f766e);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.schedule-style-modern .lesson-block.math {
  border-top-color: var(--lesson-border, var(--blue));
}

.schedule-style-modern .lesson-block.korean {
  border-top-color: var(--lesson-border, var(--amber));
}

.schedule-style-compact .slot-cell {
  padding: 5px;
}

.schedule-style-compact .lesson-block {
  min-height: 34px;
  margin-bottom: 4px;
  padding: 6px 7px;
  border-left-width: 3px;
  border-radius: 5px;
  background: var(--lesson-bg, #ffffff);
}

.schedule-style-compact .lesson-meta {
  font-size: 10px;
}

.schedule-style-band .lesson-block {
  border-left: 0;
  border-radius: 4px;
  background: var(--lesson-bg, #e8f7f1);
}

.schedule-style-band .lesson-block.math {
  background: var(--lesson-bg, #e9edff);
}

.schedule-style-band .lesson-block.english {
  background: var(--lesson-bg, #e4f8f4);
}

.schedule-style-band .lesson-block.korean {
  background: var(--lesson-bg, #fff0d9);
}

.lesson-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.lesson-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 11px;
  opacity: 0.82;
}

.lesson-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 2px;
}

.lesson-issue-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}

.lesson-issue-badge.warning {
  border-color: rgba(217, 119, 6, 0.24);
  background: rgba(255, 247, 237, 0.96);
  color: #9a3412;
}

.lesson-issue-badge.error {
  border-color: rgba(220, 38, 38, 0.24);
  background: rgba(254, 242, 242, 0.98);
  color: #991b1b;
}

.lesson-conflict-peer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px dashed rgba(15, 23, 42, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.lesson-conflict-peer-badge.virtual {
  border-style: solid;
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(254, 242, 242, 0.96);
  color: #991b1b;
}

.lesson-color-control {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 4px;
}

.lesson-color-trigger {
  width: 24px;
  height: 22px;
  min-height: 22px;
  padding: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.lesson-color-trigger::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: var(--selected-color, var(--lesson-border, var(--blue)));
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.lesson-color-trigger:hover,
.lesson-color-trigger[aria-expanded="true"] {
  border-color: rgba(15, 23, 42, 0.28);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.74);
}

.lesson-actions button:not(.lesson-color-trigger) {
  min-height: 22px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  font-size: 10px;
  font-weight: 900;
}

.lesson-palette-popover {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 80;
  width: 214px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.lesson-palette-popover[hidden] {
  display: none;
}

.lesson-picker-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.lesson-picker-spectrum {
  position: relative;
  height: 124px;
  border-radius: 9px;
  background:
    linear-gradient(to top, #000000, transparent),
    linear-gradient(to right, #ffffff, hsl(var(--picker-hue, 180) 100% 50%));
  cursor: crosshair;
}

.lesson-picker-thumb {
  position: absolute;
  left: var(--picker-x, 50%);
  top: var(--picker-y, 50%);
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.lesson-picker-controls {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.lesson-picker-tools {
  display: grid;
  gap: 6px;
}

.lesson-picker-eyedropper,
.lesson-picker-preview {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
}

.lesson-picker-eyedropper {
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffffff, #eef2f7);
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.lesson-picker-eyedropper svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.lesson-picker-eyedropper:hover:not(:disabled) {
  border-color: rgba(15, 23, 42, 0.24);
  background: linear-gradient(180deg, #f8fafc, #e2e8f0);
}

.lesson-picker-eyedropper:active:not(:disabled) {
  transform: translateY(1px);
}

.lesson-picker-hue::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ef4444 0%,
    #f59e0b 16%,
    #eab308 32%,
    #22c55e 48%,
    #06b6d4 64%,
    #3b82f6 80%,
    #a855f7 100%
  );
}

.lesson-picker-hue::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -4px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.lesson-picker-hue::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #ef4444 0%,
    #f59e0b 16%,
    #eab308 32%,
    #22c55e 48%,
    #06b6d4 64%,
    #3b82f6 80%,
    #a855f7 100%
  );
}

.lesson-picker-hue::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.lesson-picker-hue {
  line-height: 1;
  width: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
}

.lesson-picker-eyedropper:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.lesson-picker-preview {
  background: var(--selected-color, var(--lesson-border, var(--blue)));
}

.lesson-rgb-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lesson-rgb-row label {
  display: grid;
  gap: 4px;
}

.lesson-rgb-row input {
  width: 100%;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid #d7dce5;
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.lesson-rgb-row span {
  text-align: center;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
}

.lesson-palette-grid {
  display: grid;
  grid-template-columns: repeat(6, 18px);
  justify-content: space-between;
  gap: 8px 6px;
}

.lesson-palette-swatch {
  width: 100%;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  background: var(--chip-color);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.lesson-palette-swatch.active {
  box-shadow: 0 0 0 2px var(--lesson-border, var(--blue));
}

.lesson-action-delete {
  color: var(--red) !important;
}

.slot-tools {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 2px;
}

.slot-select-toggle,
.add-slot-fixed {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  min-height: 24px;
  border: 1px dashed #c7d2fe;
  border-radius: 7px;
  background: #f8faff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  opacity: 0.62;
}

.slot-select-toggle {
  color: #64748b;
  font-size: 12px;
}

.slot-select-toggle.active {
  border-style: solid;
  background: var(--blue);
  color: #ffffff;
  opacity: 1;
}

.slot-cell:hover .add-slot-fixed,
.slot-cell:hover .slot-select-toggle,
.add-slot-fixed:focus {
  opacity: 1;
  background: var(--blue-soft);
}

.slot-fixed-form {
  display: grid;
  gap: 7px;
  position: fixed;
  top: 94px;
  right: 22px;
  z-index: 70;
  width: min(390px, calc(100vw - 44px));
  max-height: calc(100vh - 116px);
  margin-top: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.slot-form-head,
.slot-preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.slot-form-head .ghost-button,
.slot-preset-row .ghost-button {
  min-width: 0;
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.slot-fixed-form strong {
  color: #24378f;
  font-size: 12px;
}

.slot-fixed-form input,
.slot-fixed-form select {
  height: 31px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
}

.slot-fixed-color {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.slot-fixed-color input {
  width: 100%;
  padding: 2px;
}

.slot-palette-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.slot-palette-button {
  background: var(--chip-color);
}

.slot-palette-button.active {
  box-shadow: 0 0 0 2px var(--blue);
}

.slot-conflict-preview {
  min-height: 28px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

.slot-conflict-preview.success {
  border-color: rgba(22, 163, 74, 0.24);
  background: #ecfdf3;
  color: #166534;
}

.slot-conflict-preview.warning {
  border-color: rgba(217, 119, 6, 0.26);
  background: var(--amber-soft);
  color: #92400e;
}

.slot-conflict-preview.error {
  border-color: rgba(220, 38, 38, 0.24);
  background: var(--red-soft);
  color: #991b1b;
}

.slot-fixed-checks {
  display: grid;
  gap: 5px;
}

.slot-fixed-checks > span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.slot-fixed-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.slot-fixed-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  min-height: 26px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 11px;
  font-weight: 850;
}

.slot-fixed-options input {
  width: 13px;
  height: 13px;
  padding: 0;
}

.slot-fixed-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.slot-fixed-actions .primary-button,
.slot-fixed-actions .ghost-button {
  min-width: 0;
  min-height: 31px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
}

.diagnostic-list {
  display: grid;
  gap: 8px;
}

.diagnostic-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  line-height: 1.4;
}

.diagnostic-item strong {
  display: block;
  margin-bottom: 3px;
}

.diagnostic-item.warning {
  border-color: rgba(217, 119, 6, 0.3);
  background: var(--amber-soft);
}

.diagnostic-item.error {
  border-color: rgba(220, 38, 38, 0.28);
  background: var(--red-soft);
}

.diagnostic-item.success {
  border-color: rgba(22, 163, 74, 0.24);
  background: #ecfdf3;
  color: #166534;
}

.lesson-detail-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 72;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 44px));
  padding: 14px;
  border: 1px solid var(--lesson-border, var(--border));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
  color: var(--lesson-text, var(--text));
}

.lesson-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lesson-detail-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lesson-detail-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--lesson-border, var(--blue));
}

.lesson-detail-close {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted-strong);
  font-weight: 900;
}

.lesson-detail-panel dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.lesson-detail-panel dl div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
}

.lesson-detail-panel dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.lesson-detail-panel dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 800;
}

.empty-state {
  padding: 30px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

@media (max-width: 1260px) {
  .diagnostic-pane {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .slot-fixed-form {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: 76vh;
  }

  .lesson-detail-panel {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }

  .slot-form-head,
  .slot-preset-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    padding: 14px;
    overflow: visible;
  }

  .sidebar:hover,
  .sidebar:focus-within {
    width: auto;
    box-shadow: none;
  }

  .brand-block {
    justify-content: flex-start;
    gap: 12px;
    padding-bottom: 12px;
  }

  .brand-copy,
  .footer-copy,
  .nav-label {
    max-width: none;
    opacity: 1;
    transform: none;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
    margin-top: 14px;
  }

  .sidebar-nav a,
  .sidebar:hover .sidebar-nav a,
  .sidebar:focus-within .sidebar-nav a {
    justify-content: flex-start;
    gap: 10px;
  }

  .sidebar-footer {
    display: none;
  }

  .main-shell {
    margin-left: 0;
  }

  .topbar,
  .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 10px 14px 18px;
  }

  .setup-pane,
  .result-pane,
  .diagnostic-pane {
    max-height: none;
  }

  .field-grid,
  .compact-grid,
  .fixed-fields,
  .import-actions,
  .publisher-add-row,
  .version-toolbar,
  .teacher-fields,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    min-width: 0;
    flex: 1;
  }

  #filterSelect {
    max-width: none;
  }

  .group-filter-panel,
  .filter-toggle-group {
    width: 100%;
    min-width: 0;
  }

  .fixed-fields .wide-field {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .sidebar-nav {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    padding: 20px 14px 10px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
