:root {
  color-scheme: light;
  --ink: #eff6ff;
  --ink-dark: #0b1220;
  --muted: #a9b8d6;
  --line: rgba(255, 255, 255, 0.12);
  --line-soft: rgba(16, 32, 39, 0.1);
  --paper: rgba(8, 18, 38, 0.9);
  --paper-2: rgba(11, 31, 73, 0.94);
  --surface: rgba(255, 255, 255, 0.96);
  --surface-soft: rgba(245, 249, 251, 0.95);
  --bg: #071225;
  --accent: #3b82f6;
  --accent-dark: #1e3a8a;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #ff8d2f;
  --shadow: 0 20px 56px rgba(0, 0, 0, 0.25);
  font-family: "Pretendard", "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(30, 58, 138, 0.38), transparent 30%),
    linear-gradient(180deg, #071225 0%, #0b1f49 52%, #111827 100%);
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: transparent;
  color: var(--ink);
}

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

.brand-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  z-index: 0;
  background-image: url('/assets/do-sports-logo-mark.png');
  background-repeat: no-repeat;
  background-position: right -80px top 20px, left -120px bottom 40px;
  background-size: 560px auto;
}

.admin-watermark {
  opacity: 0.05;
  background-position: right -120px top 40px;
  background-size: 720px auto;
}

.viewer-page > *,
.admin-page > * {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 48px);
}

.brand-topbar {
  background: linear-gradient(180deg, rgba(6, 17, 44, 0.92), rgba(8, 24, 58, 0.76));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 16px 32px rgba(0, 0, 0, 0.25);
}

.brand-badge img {
  width: 66px;
  height: auto;
  display: block;
}

.admin-badge {
  width: 72px;
  height: 72px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(24px, 3.2vw, 36px);
  letter-spacing: -0.04em;
}

.brand-caption {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.status-card {
  padding: 12px 16px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.16);
}

.dot.offline {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.16);
}

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.viewer-shell {
  display: grid;
  gap: 18px;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(8, 22, 54, 0.97) 0%, rgba(13, 32, 74, 0.92) 58%, rgba(4, 12, 30, 0.96) 100%);
  border: 1px solid rgba(255,255,255,0.09);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -40px;
  width: 280px;
  height: 280px;
  background: url('/assets/do-sports-logo-mark.png') no-repeat center / contain;
  opacity: 0.08;
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 720px;
}

.hero-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.hero-copy h2 {
  margin-bottom: 12px;
}

.hero-copy p:last-child {
  margin: 0;
  color: #c8d7dc;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 600;
}

.hero-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 320px;
}

.cta-button,
button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  cursor: pointer;
  font-weight: 950;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

button:hover,
.ghost-link:hover,
.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.primary-link,
button.primary {
  border-color: rgba(96, 165, 250, 0.42);
  background: linear-gradient(180deg, #2563eb 0%, #1e3a8a 100%);
  color: #ffffff;
}

.secondary-link {
  background: rgba(255,255,255,0.08);
}

.wide-link {
  grid-column: 1 / -1;
}

.settings-group {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #d8e2f0;
  border-radius: 16px;
  background: #f8fbff;
}

.settings-group summary {
  margin: -2px 0 14px;
  cursor: pointer;
  color: #102047;
  font-weight: 950;
}

.settings-group:not([open]) {
  padding-bottom: 10px;
}

.settings-group:not([open]) summary {
  margin-bottom: 0;
}

.notice {
  padding: 16px 18px;
  border-left: 5px solid var(--accent);
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.14);
  color: #effcff;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(23, 105, 224, 0.08);
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.tab-button span {
  font-size: 18px;
}

.tab-button strong {
  min-width: 28px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #daf4f5;
  font-size: 13px;
}

.tab-button.active {
  border-color: rgba(96, 165, 250, 0.58);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.96), rgba(30, 58, 138, 0.98));
  color: #ffffff;
}

.tab-button.active strong {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.schedule-board {
  min-height: 240px;
}

.timetable-scroller {
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 24px;
  background: rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

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

.timetable th,
.timetable td {
  border-right: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  vertical-align: top;
}

.timetable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 16px 10px;
  background: rgba(7, 18, 45, 0.98);
  color: #ffffff;
  text-align: center;
  font-size: 17px;
  font-weight: 950;
}

.timetable thead th:first-child {
  left: 0;
  z-index: 3;
}

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

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

.time-head {
  width: 128px;
}

.time-cell {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 128px;
  padding: 18px 12px;
  background: rgba(8, 18, 44, 0.98);
  text-align: center;
}

.time-cell strong,
.time-cell span {
  display: block;
}

.time-cell strong {
  color: #ffffff;
  font-size: 20px;
  font-weight: 950;
}

.time-cell span {
  margin-top: 4px;
  color: #9db5bd;
  font-size: 14px;
  font-weight: 850;
}

.timetable td {
  min-height: 126px;
  padding: 10px;
  background: rgba(255,255,255,0.97);
}

.timetable tbody tr:nth-child(even) td {
  background: rgba(245, 249, 251, 0.96);
}

.empty-cell {
  color: #b6bfcc;
  text-align: center;
  vertical-align: middle !important;
  font-weight: 900;
}

.cell-stack {
  display: grid;
  gap: 8px;
}

.timetable-lesson {
  display: grid;
  gap: 8px;
  min-height: 98px;
  padding: 12px;
  border: 1px solid #d8e2e8;
  border-left: 5px solid var(--orange);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(23, 32, 51, 0.08);
  color: var(--ink-dark);
}

.lesson-name {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lesson-meta.compact {
  align-content: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3f9;
  color: #33415c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.pill.place {
  max-width: 100%;
  border-radius: 8px;
  background: #fff3e8;
  color: #a34d09;
}

.capacity.full {
  background: #ffeceb;
  color: #a52323;
}

.capacity.open {
  background: #e8f8ef;
  color: #11683f;
}

.empty {
  padding: 36px 20px;
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  text-align: center;
  color: #d7e3e7;
  font-weight: 800;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  width: min(1440px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.editor-panel,
.classes-panel {
  align-self: start;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 22px;
  background: rgba(255,255,255,0.92);
  color: var(--ink-dark);
  padding: 18px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.editor-panel {
  position: sticky;
  top: 18px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: #33415c;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #d8e2e8;
  border-radius: 12px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink-dark);
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.16);
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.toolbar,
.row-actions,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-heading {
  align-items: flex-start;
}

.panel-subtitle {
  margin: 6px 0 0;
  color: #5f7380;
  font-size: 14px;
  font-weight: 700;
}

button,
.ghost-link {
  color: inherit;
}

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

.helper,
.admin-message {
  color: #5f7380;
  font-size: 14px;
  line-height: 1.5;
}

.admin-tabs {
  margin-top: 16px;
  margin-bottom: 16px;
}

.admin-tabs .tab-button {
  min-height: 46px;
  color: var(--ink-dark);
  background: #eff4fb;
  box-shadow: none;
  border-color: #d8e2f0;
}

.admin-tabs .tab-button strong {
  background: #dbeafe;
  color: #345;
}

.admin-tabs .tab-button.active {
  color: #fff;
}

.class-editor-list {
  display: grid;
  gap: 12px;
}

.class-row {
  display: grid;
  grid-template-columns: 110px 86px 112px 112px minmax(180px, 1.2fr) minmax(110px, 0.7fr) 88px 88px minmax(150px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dde7eb;
  border-radius: 14px;
  background: #fbfcff;
}

.class-row label {
  margin: 0;
  font-size: 13px;
}

.editor-empty {
  padding: 28px 16px;
  border: 1px dashed #d9e6eb;
  border-radius: 14px;
  background: #fbfcff;
  color: #5f7380;
  text-align: center;
  font-weight: 800;
}

#passwordDialog {
  width: min(420px, calc(100% - 28px));
  border: 0;
  border-radius: 18px;
  padding: 0;
}

#passwordDialog::backdrop {
  background: rgba(23, 32, 51, 0.45);
}

.password-box {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.password-box p {
  margin: 0;
  color: #5f7380;
}

@media (max-width: 1100px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    position: static;
  }

  .class-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar,
  .brand-block,
  .topbar-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-tabs {
    grid-template-columns: 1fr;
  }

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

  .brand-badge {
    width: 68px;
    height: 68px;
  }

  .brand-badge img {
    width: 54px;
  }

  .shell,
  .admin-layout {
    width: min(100%, calc(100% - 20px));
  }

  .class-row {
    grid-template-columns: 1fr;
  }
}

.connection-warning {
  padding: 14px 16px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-left: 5px solid #ef4444;
  border-radius: 16px;
  background: rgba(127, 29, 29, 0.24);
  color: #fee2e2;
  font-weight: 850;
  line-height: 1.55;
}

@media (min-width: 1000px) {
  .brand-topbar {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .brand-badge {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .brand-badge img {
    width: 56px;
  }

  .shell {
    margin-top: 18px;
  }

  .viewer-shell {
    gap: 14px;
  }

  .hero-panel {
    padding: 20px 24px;
  }

  .hero-copy h2 {
    font-size: clamp(24px, 2.5vw, 34px);
  }
}

@media (min-width: 1101px) {
  .class-row {
    grid-template-columns: 90px 70px 98px 98px minmax(140px, 1fr) 90px 70px 70px 120px 48px;
    gap: 8px;
  }

  .class-row input,
  .class-row select {
    padding: 10px 9px;
    font-size: 13px;
  }

  .class-row .danger {
    padding: 10px 8px;
  }
}

/* v8: mobile-first schedule optimization */
.mobile-schedule-list {
  display: none;
}

@media (max-width: 760px) {
  html {
    background: linear-gradient(180deg, #071225 0%, #0b1f49 55%, #111827 100%);
  }

  .brand-watermark {
    opacity: 0.04;
    background-position: right -140px top 40px;
    background-size: 360px auto;
  }

  .topbar {
    gap: 12px;
    padding: 14px 14px 12px;
  }

  .topbar.brand-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-block {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
  }

  .brand-badge,
  .admin-badge {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .brand-badge img,
  .admin-badge img {
    width: 40px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 11px;
    letter-spacing: 0.06em;
  }

  h1 {
    font-size: 22px;
    line-height: 1.08;
  }

  .brand-caption {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.35;
  }

  .status-card {
    align-self: flex-start;
    padding: 8px 11px;
    font-size: 12px;
  }

  .shell,
  .admin-layout {
    width: min(100%, calc(100% - 18px));
    margin-top: 10px;
    margin-bottom: 28px;
  }

  .viewer-shell {
    gap: 10px;
  }

  .hero-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .hero-panel::after {
    width: 180px;
    height: 180px;
    right: -60px;
    bottom: -60px;
  }

  .hero-kicker {
    font-size: 11px;
    margin-bottom: 7px;
  }

  .hero-copy h2 {
    font-size: 22px;
    line-height: 1.18;
    margin-bottom: 8px;
  }

  .hero-copy p:last-child {
    font-size: 13px;
    line-height: 1.55;
  }

  .hero-actions {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .cta-button,
  button,
  .ghost-link {
    min-height: 44px;
    padding: 10px 11px;
    border-radius: 12px;
    font-size: 14px;
  }

  .wide-link {
    grid-column: 1 / -1;
  }

  .notice,
  .connection-warning {
    padding: 12px 13px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.55;
  }

  .category-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 6px 0;
    background: rgba(7, 18, 37, 0.88);
    backdrop-filter: blur(10px);
  }

  .tab-button {
    min-height: 46px;
    border-radius: 13px;
    gap: 6px;
  }

  .tab-button span {
    font-size: 15px;
  }

  .tab-button strong {
    min-width: 24px;
    padding: 2px 7px;
    font-size: 11px;
  }

  .schedule-board {
    min-height: 0;
  }

  .timetable-scroller {
    display: none;
  }

  .mobile-schedule-list {
    display: grid;
    gap: 10px;
  }

  .mobile-schedule-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    background: rgba(255,255,255,0.08);
    color: #eff6ff;
  }

  .mobile-schedule-heading strong {
    font-size: 16px;
  }

  .mobile-schedule-heading span {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-day-section {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 18px;
    background: rgba(255,255,255,0.06);
  }

  .mobile-day-section h3 {
    margin: 0 0 2px;
    color: #bfdbfe;
    font-size: 15px;
    font-weight: 950;
  }

  .mobile-lesson-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    padding: 11px;
    border-radius: 16px;
    background: #ffffff;
    color: var(--ink-dark);
    box-shadow: 0 10px 22px rgba(0,0,0,0.16);
  }

  .mobile-time {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 13px;
    background: linear-gradient(180deg, #1d4ed8, #172554);
    color: #ffffff;
    text-align: center;
  }

  .mobile-time strong {
    font-size: 17px;
    line-height: 1;
  }

  .mobile-time span {
    color: #bfdbfe;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-lesson-body {
    min-width: 0;
  }

  .mobile-lesson-card .lesson-name {
    margin-bottom: 8px;
    font-size: 16px;
  }

  .pill {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 11px;
  }

  .empty {
    padding: 24px 14px;
    border-radius: 16px;
    font-size: 14px;
  }

  .admin-page .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .admin-layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .editor-panel,
  .classes-panel {
    padding: 12px;
    border-radius: 18px;
  }

  .settings-group {
    padding: 12px;
    border-radius: 14px;
  }

  label {
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    padding: 10px 11px;
    border-radius: 11px;
    font-size: 14px;
  }

  .toolbar {
    position: sticky;
    bottom: 8px;
    z-index: 8;
    padding: 8px;
    margin: 0 -4px;
    border: 1px solid #d8e2f0;
    border-radius: 15px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  }

  .toolbar button {
    flex: 1;
    color: var(--ink-dark);
    background: #ffffff;
  }

  .toolbar button.primary {
    color: #ffffff;
  }

  .helper,
  .admin-message,
  .panel-subtitle {
    font-size: 12px;
  }

  .panel-heading {
    gap: 8px;
  }

  .panel-heading h2 {
    font-size: 23px;
  }

  .admin-tabs {
    position: sticky;
    top: 0;
    z-index: 6;
    margin-top: 12px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.92);
  }

  .class-editor-list {
    gap: 10px;
  }

  .class-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 11px;
    border-radius: 16px;
  }

  .class-row label:nth-child(5),
  .class-row label:nth-child(9),
  .class-row .row-actions {
    grid-column: 1 / -1;
  }

  .class-row .danger {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .hero-actions {
    grid-template-columns: 1fr;
  }

  .mobile-lesson-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .mobile-time strong {
    font-size: 15px;
  }

  .mobile-lesson-card .lesson-name {
    font-size: 15px;
  }
}

/* v9: 잠실점 보드형 시간표 디자인 */
.board-style-page {
  background: #0f1420;
  color: #f8fbff;
}

.board-style-page .brand-watermark {
  opacity: 0.025;
  background-position: right 24px bottom 24px;
  background-size: 420px auto;
}

.schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 24px));
  margin: 10px auto 12px;
  padding: 16px 18px;
  border: 1px solid #353d52;
  border-radius: 12px;
  background: #191e2b;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.schedule-brand h1 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.schedule-brand h1::first-letter {
  color: #f4a517;
}

.schedule-brand p {
  margin: 7px 0 0;
  color: #b8c5dc;
  font-size: 13px;
  font-weight: 750;
}

.schedule-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.compact-status {
  padding: 8px 11px;
  border-color: #334155;
  background: #0f172a;
  color: #d7e3f5;
  font-size: 12px;
  font-weight: 900;
}

.compact-status .dot {
  width: 8px;
  height: 8px;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
}

.edit-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid #46516a;
  border-radius: 10px;
  background: #1c2232;
  color: #ffffff;
  font-weight: 950;
  text-decoration: none;
}

.board-shell {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto 40px;
  display: grid;
  gap: 12px;
}

.board-style-page .connection-warning {
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.26);
}

.notice-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid #353d52;
  border-radius: 10px;
  background: #1a1f2d;
  overflow: hidden;
}

.notice-bar strong {
  flex: 0 0 auto;
  color: #f6aa1c;
  font-size: 16px;
  font-weight: 950;
}

.notice-bar p {
  margin: 0;
  color: #f8b62d;
  font-size: 15px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.quick-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #353d52;
  border-radius: 10px;
  background: #1b2131;
  color: #f2f7ff;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
}

.quick-link.primary {
  border-color: #2c66d9;
  background: linear-gradient(180deg, #2d6cdf, #1f4eb4);
}

.schedule-main-title {
  margin: 2px 0 -2px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.board-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.board-tabs .tab-button {
  min-height: 58px;
  border: 1px solid #3a4359;
  border-radius: 10px;
  background: #1d2232;
  color: #ffffff;
  box-shadow: none;
}

.board-tabs .tab-button span {
  font-size: 17px;
}

.board-tabs .tab-button strong {
  display: none;
}

.board-tabs .tab-button.active {
  border-color: #f3a51a;
  background: #f0a51a;
  color: #1a1203;
}

.board-section {
  display: grid;
  gap: 8px;
}

.board-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 0;
}

.board-section-heading strong {
  color: #ffffff;
  font-size: 16px;
  font-weight: 950;
}

.board-section-heading span {
  color: #aebbd3;
  font-size: 12px;
  font-weight: 900;
}

.board-style-page .timetable-scroller {
  overflow-x: auto;
  border: 1px solid #343b4e;
  border-radius: 8px;
  background: #121722;
  box-shadow: none;
}

.board-style-page .timetable {
  min-width: 780px;
  border-collapse: collapse;
  table-layout: fixed;
}

.board-style-page .timetable th,
.board-style-page .timetable td {
  border: 1px solid #2b3243;
}

.board-style-page .timetable thead th {
  position: static;
  padding: 14px 8px;
  background: #202536;
  color: #ffffff;
  font-size: 14px;
}

.board-style-page .time-head {
  width: 114px;
}

.board-style-page .time-cell {
  position: static;
  width: 114px;
  padding: 10px 6px;
  background: #171c28;
  color: #cce0ff;
  text-align: center;
  vertical-align: middle;
}

.board-style-page .time-cell strong {
  color: #cfe2ff;
  font-size: 14px;
  white-space: nowrap;
}

.board-style-page .time-cell span {
  display: none;
}

.board-style-page .timetable td {
  height: 96px;
  padding: 4px;
  background: #151a25;
  vertical-align: top;
}

.board-style-page .timetable tbody tr:nth-child(even) td {
  background: #151a25;
}

.board-style-page .empty-cell {
  background: #151a25;
}

.board-style-page .cell-stack {
  gap: 4px;
}

.board-style-page .timetable-lesson {
  min-height: 72px;
  gap: 4px;
  align-content: center;
  justify-items: center;
  padding: 8px 6px;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-left: 0;
  border-radius: 6px;
  background: #0b2a55;
  color: #ffffff;
  box-shadow: none;
  text-align: center;
}

.board-style-page .timetable-lesson .lesson-name {
  color: #79bbff;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.15;
}

.board-style-page .grade-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 21px;
  padding: 2px 7px;
  border: 1px solid rgba(96, 165, 250, 0.72);
  border-radius: 6px;
  color: #cde6ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.board-style-page .capacity-text {
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
}

.board-style-page .place-text {
  color: #a8c6ef;
  font-size: 10px;
  font-weight: 800;
}

.board-style-page .variant-basketball {
  background: #09234a;
}

.board-style-page .variant-recruit,
.board-style-page .variant-soccer {
  background: #062815;
}

.board-style-page .variant-recruit .lesson-name,
.board-style-page .variant-soccer .lesson-name {
  color: #34f5a2;
}

.board-style-page .variant-recruit .grade-chip,
.board-style-page .variant-soccer .grade-chip {
  border-color: rgba(52, 245, 162, 0.65);
  color: #9ffacc;
}

.board-style-page .variant-kids,
.board-style-page .variant-special {
  background: #35051c;
}

.board-style-page .variant-kids .lesson-name,
.board-style-page .variant-special .lesson-name {
  color: #ff89c5;
}

.board-style-page .variant-kids .grade-chip,
.board-style-page .variant-special .grade-chip {
  border-color: rgba(255, 137, 197, 0.7);
  color: #ffc9e4;
}

.board-style-page .empty {
  border-color: #343b4e;
  border-radius: 10px;
  background: #171c28;
}

@media (max-width: 760px) {
  .board-style-page .brand-watermark {
    display: none;
  }

  .schedule-header {
    width: min(100%, calc(100% - 12px));
    margin-top: 6px;
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .schedule-brand h1 {
    font-size: 20px;
  }

  .schedule-brand p {
    font-size: 12px;
  }

  .schedule-header-actions {
    justify-content: space-between;
  }

  .edit-link {
    min-height: 38px;
    padding: 0 14px;
  }

  .board-shell {
    width: min(100%, calc(100% - 12px));
    gap: 8px;
    margin-bottom: 26px;
  }

  .notice-bar {
    min-height: 46px;
    padding: 10px 12px;
    gap: 10px;
  }

  .notice-bar strong,
  .notice-bar p {
    font-size: 13px;
  }

  .quick-link-row {
    grid-template-columns: 1fr;
  }

  .quick-link {
    min-height: 40px;
    font-size: 13px;
  }

  .schedule-main-title {
    font-size: 15px;
  }

  .board-tabs {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 5px 0;
    background: rgba(15, 20, 32, 0.94);
    backdrop-filter: blur(10px);
  }

  .board-tabs .tab-button {
    min-height: 48px;
    border-radius: 8px;
  }

  .board-tabs .tab-button span {
    font-size: 14px;
  }

  .board-section-heading strong {
    font-size: 14px;
  }

  .board-section-heading span {
    display: none;
  }

  .board-style-page .timetable-scroller {
    display: block;
    border-radius: 6px;
  }

  .board-style-page .timetable {
    min-width: 720px;
  }

  .board-style-page .time-head,
  .board-style-page .time-cell {
    width: 96px;
  }

  .board-style-page .timetable thead th {
    padding: 11px 6px;
    font-size: 13px;
  }

  .board-style-page .time-cell strong {
    font-size: 12px;
  }

  .board-style-page .timetable td {
    height: 84px;
    padding: 3px;
  }

  .board-style-page .timetable-lesson {
    min-height: 66px;
    padding: 6px 4px;
  }

  .board-style-page .timetable-lesson .lesson-name {
    font-size: 12px;
  }

  .board-style-page .grade-chip {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .board-style-page .capacity-text {
    font-size: 11px;
  }

  .board-style-page .mobile-schedule-list {
    display: none !important;
  }
}

/* v10: 밝은 학원 시간표 보드 + 정확한 수업시간 표시 */
.board-style-page {
  background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 55%, #ffffff 100%);
  color: #0f172a;
}

.board-style-page .brand-watermark {
  opacity: 0.035;
  filter: invert(1);
  background-position: right 24px bottom 24px;
  background-size: 390px auto;
}

.schedule-header {
  border: 1px solid #dbe6f5;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(30, 58, 138, 0.08);
}

.schedule-brand h1 {
  color: #0f172a;
}

.schedule-brand h1::first-letter {
  color: #f59e0b;
}

.schedule-brand p {
  color: #52657d;
}

.compact-status {
  border-color: #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
}

.edit-link {
  border-color: #c7d2fe;
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 8px 18px rgba(30, 58, 138, 0.08);
}

.board-style-page .connection-warning {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.notice-bar {
  border: 1px solid #fde68a;
  background: #fff7d6;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.07);
}

.notice-bar strong,
.notice-bar p {
  color: #a16207;
}

.quick-link {
  border: 1px solid #dbe6f5;
  background: #ffffff;
  color: #1e3a8a;
  box-shadow: 0 8px 18px rgba(30, 58, 138, 0.06);
}

.quick-link.primary {
  border-color: #2563eb;
  background: linear-gradient(180deg, #3b82f6, #1d4ed8);
  color: #ffffff;
}

.schedule-main-title {
  color: #0f172a;
}

.board-tabs {
  gap: 10px;
}

.board-tabs .tab-button {
  border: 1px solid #dbe6f5;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 8px 18px rgba(30, 58, 138, 0.06);
}

.board-tabs .tab-button.active {
  border-color: #f59e0b;
  background: #f8aa1c;
  color: #1a1203;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.22);
}

.board-section-heading strong {
  color: #0f172a;
}

.board-section-heading span {
  color: #64748b;
}

.board-style-page .timetable-scroller {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.board-style-page .timetable th,
.board-style-page .timetable td {
  border: 1px solid #d8e1ee;
}

.board-style-page .timetable thead th {
  background: #eef4ff;
  color: #1e3a8a;
}

.board-style-page .time-cell {
  background: #f8fbff;
  color: #1e3a8a;
}

.board-style-page .time-cell strong {
  color: #1e3a8a;
  font-size: 14px;
}

.board-style-page .time-cell span {
  display: block;
  margin-top: 4px;
  color: #7c8da6;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
}

.board-style-page .timetable td,
.board-style-page .timetable tbody tr:nth-child(even) td,
.board-style-page .empty-cell {
  background: #ffffff;
}

.board-style-page .timetable tbody tr:nth-child(even) .time-cell {
  background: #f4f8ff;
}

.board-style-page .timetable-lesson {
  min-height: 86px;
  padding: 7px 6px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #0f172a;
  box-shadow: 0 6px 14px rgba(30, 58, 138, 0.08);
}

.board-style-page .lesson-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffffff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.board-style-page .timetable-lesson .lesson-name {
  color: #1d4ed8;
}

.board-style-page .grade-chip {
  border-color: #93c5fd;
  background: #ffffff;
  color: #1e40af;
}

.board-style-page .capacity-text {
  color: #0f172a;
}

.board-style-page .place-text {
  color: #64748b;
}

.board-style-page .variant-basketball {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.board-style-page .variant-recruit,
.board-style-page .variant-soccer {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.board-style-page .variant-recruit .lesson-name,
.board-style-page .variant-soccer .lesson-name,
.board-style-page .variant-recruit .lesson-time,
.board-style-page .variant-soccer .lesson-time {
  color: #047857;
}

.board-style-page .variant-recruit .lesson-time,
.board-style-page .variant-soccer .lesson-time,
.board-style-page .variant-recruit .grade-chip,
.board-style-page .variant-soccer .grade-chip {
  border-color: #86efac;
  box-shadow: inset 0 0 0 1px #86efac;
}

.board-style-page .variant-recruit .grade-chip,
.board-style-page .variant-soccer .grade-chip {
  color: #047857;
}

.board-style-page .variant-kids,
.board-style-page .variant-special {
  border-color: #fbcfe8;
  background: #fdf2f8;
}

.board-style-page .variant-kids .lesson-name,
.board-style-page .variant-special .lesson-name,
.board-style-page .variant-kids .lesson-time,
.board-style-page .variant-special .lesson-time {
  color: #be185d;
}

.board-style-page .variant-kids .lesson-time,
.board-style-page .variant-special .lesson-time,
.board-style-page .variant-kids .grade-chip,
.board-style-page .variant-special .grade-chip {
  border-color: #f9a8d4;
  box-shadow: inset 0 0 0 1px #f9a8d4;
}

.board-style-page .variant-kids .grade-chip,
.board-style-page .variant-special .grade-chip {
  color: #be185d;
}

.board-style-page .empty {
  border-color: #cbd5e1;
  background: #ffffff;
  color: #64748b;
}

@media (max-width: 760px) {
  .board-style-page {
    background: linear-gradient(180deg, #f6f9ff 0%, #eef4ff 60%, #ffffff 100%);
  }

  .board-tabs {
    background: rgba(246, 249, 255, 0.94);
  }

  .schedule-header,
  .notice-bar,
  .quick-link,
  .board-style-page .timetable-scroller {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  }

  .board-style-page .timetable {
    min-width: 760px;
  }

  .board-style-page .time-head,
  .board-style-page .time-cell {
    width: 92px;
  }

  .board-style-page .time-cell strong {
    font-size: 12px;
  }

  .board-style-page .time-cell span {
    display: none;
  }

  .board-style-page .timetable td {
    height: 92px;
  }

  .board-style-page .timetable-lesson {
    min-height: 74px;
    padding: 6px 4px;
  }

  .board-style-page .lesson-time {
    min-height: 18px;
    padding: 2px 5px;
    font-size: 9px;
  }
}

/* v11: mobile timetable fit mode - no sideways snap-back */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .schedule-header,
  .board-shell {
    width: calc(100% - 8px);
  }

  .schedule-header {
    margin-top: 4px;
  }

  .board-shell {
    gap: 7px;
  }

  .notice-bar {
    border-radius: 8px;
  }

  .quick-link-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .quick-link {
    min-height: 36px;
    padding: 7px 5px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.15;
  }

  .board-tabs {
    gap: 5px;
  }

  .board-tabs .tab-button {
    min-height: 42px;
    padding: 7px 4px;
    border-radius: 8px;
  }

  .board-tabs .tab-button span {
    font-size: 12px;
    white-space: nowrap;
  }

  .board-section-heading {
    padding: 1px 0;
  }

  .board-section-heading strong {
    font-size: 13px;
  }

  .board-style-page .timetable-scroller {
    overflow-x: hidden;
    border-radius: 7px;
    touch-action: pan-y pinch-zoom;
  }

  .board-style-page .timetable {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  .board-style-page .time-head,
  .board-style-page .time-cell {
    width: 43px;
  }

  .board-style-page .timetable thead th {
    padding: 7px 1px;
    font-size: 10px;
    letter-spacing: -0.03em;
  }

  .board-style-page .time-cell {
    padding: 5px 1px;
  }

  .board-style-page .time-cell strong {
    font-size: 9px;
    letter-spacing: -0.05em;
    white-space: normal;
  }

  .board-style-page .timetable td {
    height: 70px;
    padding: 2px;
  }

  .board-style-page .cell-stack {
    gap: 2px;
  }

  .board-style-page .timetable-lesson {
    min-height: 60px;
    gap: 2px;
    padding: 4px 2px;
    border-radius: 5px;
  }

  .board-style-page .lesson-time {
    min-height: 14px;
    padding: 1px 3px;
    font-size: 7px;
    letter-spacing: -0.04em;
    white-space: nowrap;
  }

  .board-style-page .timetable-lesson .lesson-name {
    font-size: 9px;
    line-height: 1.08;
    letter-spacing: -0.05em;
    word-break: keep-all;
    overflow-wrap: anywhere;
  }

  .board-style-page .grade-chip {
    min-height: 13px;
    max-width: 100%;
    padding: 1px 3px;
    border-radius: 4px;
    font-size: 7px;
    letter-spacing: -0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-style-page .capacity-text {
    font-size: 8px;
    line-height: 1;
  }

  .board-style-page .place-text {
    max-width: 100%;
    font-size: 7px;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .board-style-page .mobile-schedule-list {
    display: none !important;
  }
}

@media (max-width: 390px) {
  .board-style-page .time-head,
  .board-style-page .time-cell {
    width: 38px;
  }

  .board-style-page .timetable thead th {
    font-size: 9px;
  }

  .board-style-page .time-cell strong {
    font-size: 8px;
  }

  .board-style-page .timetable td {
    height: 64px;
    padding: 1px;
  }

  .board-style-page .timetable-lesson {
    min-height: 56px;
    padding: 3px 1px;
  }

  .board-style-page .lesson-time {
    font-size: 6.5px;
    padding: 1px 2px;
  }

  .board-style-page .timetable-lesson .lesson-name {
    font-size: 8px;
  }

  .board-style-page .grade-chip,
  .board-style-page .place-text {
    font-size: 6.5px;
  }
}

/* v12: 관리자 버튼 추가/삭제 편집기 */
.field-helper {
  margin: -4px 0 12px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.link-editor-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.link-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.9fr) minmax(180px, 1.3fr) 90px auto;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid #d8e2f0;
  border-radius: 14px;
  background: #ffffff;
}

.link-row label {
  margin: 0;
  font-size: 13px;
}

.link-actions {
  justify-content: flex-end;
  gap: 6px;
}

.link-actions button {
  min-height: 40px;
  padding: 9px 10px;
}

.secondary-action {
  width: 100%;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.small-empty {
  padding: 16px 12px;
  font-size: 13px;
}

.quick-link-row[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .link-row {
    grid-template-columns: 1fr;
  }

  .link-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* v13: 관리자에서 수업분류 탭을 직접 추가/수정할 수 있도록 보강 */
.category-tabs {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.category-editor-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.category-row {
  display: grid;
  grid-template-columns: 76px minmax(140px, 1fr) 86px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dde7eb;
  border-radius: 14px;
  background: #fbfcff;
}

.category-row label {
  margin: 0;
  font-size: 13px;
}

.category-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #eef4fb;
  color: #33415c;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.category-actions {
  justify-content: flex-end;
}

.category-actions button,
.link-actions button {
  min-width: 42px;
  padding-left: 10px;
  padding-right: 10px;
}

@media (max-width: 720px) {
  .category-row {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .category-count,
  .category-actions {
    grid-column: 1 / -1;
  }

  .category-actions {
    justify-content: stretch;
  }

  .category-actions button {
    flex: 1;
  }
}

/* v14: 실제 수업시간에 맞춰 세로로 이어지는 시간표 */
.board-style-page .schedule-grid-scroller {
  overflow: hidden;
  border-radius: 12px;
}

.duration-timetable {
  --time-col: 94px;
  --slot-height: 108px;
  --header-height: 44px;
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: var(--time-col) repeat(var(--days-count), minmax(0, 1fr));
  grid-template-rows: var(--header-height) repeat(var(--slot-count), var(--slot-height));
  background: #ffffff;
  color: #0f172a;
  overflow: hidden;
}

.duration-timetable .grid-head,
.duration-timetable .grid-time-cell,
.duration-timetable .grid-slot {
  border-right: 1px solid #d8e1ee;
  border-bottom: 1px solid #d8e1ee;
}

.duration-timetable .grid-head:last-of-type,
.duration-timetable .grid-slot:nth-child(6n) {
  border-right: 0;
}

.duration-timetable .grid-head {
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 950;
  text-align: center;
}

.duration-timetable .time-head {
  width: auto;
}

.duration-timetable .grid-time-cell {
  display: grid;
  place-items: center;
  width: auto;
  min-width: 0;
  padding: 0 6px;
  background: #f8fbff;
  text-align: center;
}

.duration-timetable .grid-time-cell strong {
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.1;
  white-space: nowrap;
}

.duration-timetable .grid-time-cell span {
  display: none !important;
}

.duration-timetable .grid-slot {
  background: #ffffff;
}

.duration-timetable .grid-slot:nth-of-type(even) {
  background: #fbfdff;
}

.duration-timetable .day-track {
  position: relative;
  z-index: 4;
  pointer-events: none;
  min-width: 0;
}

.duration-timetable .day-track .timetable-lesson {
  position: absolute;
  top: calc(var(--lesson-top) + 4px);
  left: calc(var(--lesson-left) + 5px);
  width: calc(var(--lesson-width) - 10px);
  height: calc(var(--lesson-height) - 8px);
  min-height: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 7px 5px;
  overflow: hidden;
  pointer-events: auto;
  text-align: center;
}

.duration-timetable .lesson-time {
  align-self: center;
  white-space: nowrap;
}

.duration-timetable .timetable-lesson .lesson-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.13;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.duration-timetable .grade-chip,
.duration-timetable .capacity-text,
.duration-timetable .place-text {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duration-timetable .grade-chip {
  align-self: center;
  min-height: 17px;
  padding: 1px 5px;
  font-size: 9px;
}

.duration-timetable .capacity-text {
  font-size: 10px;
  line-height: 1;
}

.duration-timetable .place-text {
  font-size: 8px;
  line-height: 1;
}

@media (max-width: 760px) {
  .board-style-page .schedule-grid-scroller {
    overflow: hidden;
    touch-action: pan-y pinch-zoom;
  }

  .duration-timetable {
    --time-col: 43px;
    --slot-height: 76px;
    --header-height: 32px;
    width: 100%;
    min-width: 0;
  }

  .duration-timetable .grid-head {
    font-size: 10px;
  }

  .duration-timetable .grid-time-cell {
    padding: 0 1px;
  }

  .duration-timetable .grid-time-cell strong {
    font-size: 8px;
    letter-spacing: -0.06em;
    white-space: normal;
  }

  .duration-timetable .day-track .timetable-lesson {
    top: calc(var(--lesson-top) + 2px);
    left: calc(var(--lesson-left) + 2px);
    width: calc(var(--lesson-width) - 4px);
    height: calc(var(--lesson-height) - 4px);
    min-height: 40px;
    gap: 1px;
    padding: 3px 1px;
    border-radius: 5px;
  }

  .duration-timetable .lesson-time {
    min-height: 12px;
    padding: 1px 2px;
    font-size: 6.5px;
    letter-spacing: -0.05em;
  }

  .duration-timetable .timetable-lesson .lesson-name {
    -webkit-line-clamp: 2;
    font-size: 8px;
    line-height: 1.05;
    letter-spacing: -0.06em;
  }

  .duration-timetable .grade-chip {
    min-height: 11px;
    max-width: 96%;
    padding: 1px 2px;
    border-radius: 4px;
    font-size: 6.5px;
    letter-spacing: -0.05em;
  }

  .duration-timetable .capacity-text {
    font-size: 7px;
  }

  .duration-timetable .place-text {
    font-size: 6.5px;
  }
}

@media (max-width: 390px) {
  .duration-timetable {
    --time-col: 39px;
    --slot-height: 70px;
  }

  .duration-timetable .grid-head {
    font-size: 9px;
  }

  .duration-timetable .grid-time-cell strong {
    font-size: 7.5px;
  }

  .duration-timetable .day-track .timetable-lesson {
    min-height: 36px;
  }

  .duration-timetable .lesson-time {
    font-size: 6px;
  }

  .duration-timetable .timetable-lesson .lesson-name {
    font-size: 7.5px;
  }
}


/* v15: 같은 시간대 수업 카드 겹침/글자 잘림 개선 */
.duration-timetable .day-track .timetable-lesson {
  isolation: isolate;
}

.duration-timetable .lesson-time {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duration-timetable .lesson-subline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

.duration-timetable .lesson-subline .grade-chip,
.duration-timetable .lesson-subline .capacity-text {
  min-width: 0;
}

.duration-timetable .day-track .timetable-lesson.is-overlap {
  z-index: 8;
}

.duration-timetable .day-track .timetable-lesson.is-compact {
  gap: 2px;
  padding: 5px 3px;
}

.duration-timetable .timetable-lesson.is-compact .lesson-time {
  min-height: 17px;
  padding: 2px 5px;
  font-size: 9px;
}

.duration-timetable .timetable-lesson.is-compact .lesson-name {
  -webkit-line-clamp: 1;
  font-size: 11px;
  line-height: 1.08;
}

.duration-timetable .timetable-lesson.is-compact .grade-chip {
  min-height: 15px;
  padding: 1px 4px;
  font-size: 8px;
}

.duration-timetable .timetable-lesson.is-compact .capacity-text {
  font-size: 9px;
}

.duration-timetable .timetable-lesson.is-compact .place-text {
  display: none;
}

.duration-timetable .timetable-lesson.is-mini .lesson-time {
  font-size: 8px;
  padding: 1px 3px;
}

.duration-timetable .timetable-lesson.is-mini .lesson-name {
  font-size: 10px;
}

.duration-timetable .timetable-lesson.is-mini .grade-chip,
.duration-timetable .timetable-lesson.is-mini .place-text {
  display: none;
}

.duration-timetable .day-track .timetable-lesson.expanded {
  z-index: 80;
  left: 5px !important;
  width: calc(100% - 10px) !important;
  height: auto !important;
  min-height: 112px;
  overflow: visible;
  padding: 9px 7px;
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(30, 58, 138, 0.2);
}

.duration-timetable .timetable-lesson.expanded .lesson-name {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  font-size: 13px;
  line-height: 1.2;
}

.duration-timetable .timetable-lesson.expanded .grade-chip,
.duration-timetable .timetable-lesson.expanded .place-text {
  display: inline-flex;
}

.duration-timetable .timetable-lesson.expanded .place-text {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.duration-timetable .timetable-lesson[role="button"] {
  cursor: pointer;
}

@media (max-width: 760px) {
  .duration-timetable .day-track .timetable-lesson.is-compact {
    gap: 1px;
    padding: 3px 1px;
  }

  .duration-timetable .timetable-lesson.is-compact .lesson-time {
    min-height: 10px;
    padding: 1px 2px;
    font-size: 5.8px;
    letter-spacing: -0.08em;
  }

  .duration-timetable .timetable-lesson.is-compact .lesson-name {
    font-size: 7px;
    line-height: 1.03;
    letter-spacing: -0.08em;
  }

  .duration-timetable .timetable-lesson.is-compact .grade-chip {
    display: none;
  }

  .duration-timetable .timetable-lesson.is-compact .capacity-text {
    font-size: 6px;
  }

  .duration-timetable .day-track .timetable-lesson.expanded {
    left: 2px !important;
    width: calc(100% - 4px) !important;
    min-height: 86px;
    padding: 6px 4px;
    gap: 2px;
  }

  .duration-timetable .timetable-lesson.expanded .lesson-time {
    min-height: 14px;
    padding: 1px 3px;
    font-size: 7px;
  }

  .duration-timetable .timetable-lesson.expanded .lesson-name {
    font-size: 9px;
    line-height: 1.12;
  }

  .duration-timetable .timetable-lesson.expanded .grade-chip {
    display: inline-flex;
    font-size: 7px;
  }

  .duration-timetable .timetable-lesson.expanded .capacity-text {
    font-size: 7px;
  }

  .duration-timetable .timetable-lesson.expanded .place-text {
    display: inline-flex;
    font-size: 6.5px;
  }
}

/* v16: 수업이 짧거나 같은 시간대에 겹칠 때 시간대 칸 자체를 키워 가독성 확보 */
.duration-timetable .day-track .timetable-lesson {
  min-height: 72px;
  padding: 10px 7px;
  gap: 5px;
  cursor: default;
}

.duration-timetable .lesson-time {
  min-height: 21px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  overflow: visible;
  text-overflow: clip;
}

.duration-timetable .timetable-lesson .lesson-name {
  -webkit-line-clamp: 2;
  font-size: 14px;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.duration-timetable .grade-chip {
  min-height: 18px;
  padding: 2px 7px;
  font-size: 10px;
}

.duration-timetable .capacity-text {
  font-size: 11px;
}

.duration-timetable .place-text {
  display: inline-flex;
  justify-content: center;
  font-size: 9px;
  line-height: 1.05;
}

.duration-timetable .timetable-lesson.is-overlap:not(.is-compact) {
  padding-left: 5px;
  padding-right: 5px;
}

.duration-timetable .timetable-lesson.is-overlap:not(.is-compact) .lesson-time {
  padding-left: 5px;
  padding-right: 5px;
  font-size: 11px;
}

.duration-timetable .timetable-lesson.is-overlap:not(.is-compact) .lesson-name {
  font-size: 13px;
}

.duration-timetable .timetable-lesson.is-compact .place-text {
  display: inline-flex;
}

.duration-timetable .timetable-lesson.is-mini .grade-chip,
.duration-timetable .timetable-lesson.is-mini .place-text {
  display: inline-flex;
}

.duration-timetable .timetable-lesson[role="button"] {
  cursor: default;
}

@media (max-width: 760px) {
  .duration-timetable .day-track .timetable-lesson {
    min-height: 58px;
    padding: 5px 2px;
    gap: 2px;
    border-radius: 6px;
  }

  .duration-timetable .lesson-time,
  .duration-timetable .timetable-lesson.is-compact .lesson-time,
  .duration-timetable .timetable-lesson.is-mini .lesson-time {
    min-height: auto;
    padding: 2px 2px;
    font-size: 7.8px;
    line-height: 1.05;
    letter-spacing: -0.06em;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .duration-timetable .timetable-lesson .lesson-name,
  .duration-timetable .timetable-lesson.is-compact .lesson-name,
  .duration-timetable .timetable-lesson.is-mini .lesson-name {
    -webkit-line-clamp: 2;
    font-size: 8.8px;
    line-height: 1.08;
    letter-spacing: -0.06em;
  }

  .duration-timetable .lesson-subline {
    flex-wrap: wrap;
    gap: 1px 2px;
  }

  .duration-timetable .grade-chip,
  .duration-timetable .timetable-lesson.is-compact .grade-chip,
  .duration-timetable .timetable-lesson.is-mini .grade-chip {
    display: inline-flex;
    min-height: 12px;
    padding: 1px 2px;
    font-size: 6.8px;
    letter-spacing: -0.05em;
  }

  .duration-timetable .capacity-text,
  .duration-timetable .timetable-lesson.is-compact .capacity-text {
    font-size: 7.2px;
  }

  .duration-timetable .place-text,
  .duration-timetable .timetable-lesson.is-compact .place-text,
  .duration-timetable .timetable-lesson.is-mini .place-text {
    display: inline-flex;
    font-size: 6.8px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* v17: 겹치는 수업은 카드 폭을 줄이지 않고 요일 칸 자체를 오른쪽으로 확장 */
.board-style-page .schedule-grid-scroller {
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  touch-action: pan-x pan-y pinch-zoom;
}

.duration-timetable {
  width: max(100%, var(--grid-min-width, 100%));
  min-width: var(--grid-min-width, 100%);
  overflow: visible;
}

.duration-timetable .grid-head,
.duration-timetable .grid-time-cell,
.duration-timetable .grid-slot,
.duration-timetable .day-track {
  min-width: 0;
}

.duration-timetable .time-head,
.duration-timetable .grid-time-cell {
  position: sticky;
  left: 0;
  z-index: 18;
  box-shadow: 1px 0 0 #d8e1ee;
}

.duration-timetable .time-head {
  z-index: 30;
}

.duration-timetable .day-track .timetable-lesson,
.duration-timetable .day-track .timetable-lesson.is-overlap,
.duration-timetable .day-track .timetable-lesson.is-compact,
.duration-timetable .day-track .timetable-lesson.is-mini {
  top: calc(var(--lesson-top) + 6px);
  left: calc(var(--lesson-left) + 7px);
  width: calc(var(--lesson-width) - 14px);
  height: calc(var(--lesson-height) - 12px);
  min-width: 0;
  min-height: 82px;
  padding: 10px 9px;
  gap: 5px;
  overflow: visible;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.duration-timetable .lesson-time,
.duration-timetable .timetable-lesson.is-compact .lesson-time,
.duration-timetable .timetable-lesson.is-mini .lesson-time {
  max-width: 100%;
  min-height: 22px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.duration-timetable .timetable-lesson .lesson-name,
.duration-timetable .timetable-lesson.is-compact .lesson-name,
.duration-timetable .timetable-lesson.is-mini .lesson-name {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  margin: 0;
  font-size: 14px;
  line-height: 1.18;
  letter-spacing: -0.02em;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.duration-timetable .lesson-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 5px;
  max-width: 100%;
}

.duration-timetable .grade-chip,
.duration-timetable .timetable-lesson.is-compact .grade-chip,
.duration-timetable .timetable-lesson.is-mini .grade-chip,
.duration-timetable .capacity-text,
.duration-timetable .timetable-lesson.is-compact .capacity-text,
.duration-timetable .place-text,
.duration-timetable .timetable-lesson.is-compact .place-text,
.duration-timetable .timetable-lesson.is-mini .place-text {
  display: inline-flex;
  max-width: 100%;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.duration-timetable .grade-chip,
.duration-timetable .timetable-lesson.is-compact .grade-chip,
.duration-timetable .timetable-lesson.is-mini .grade-chip {
  min-height: 18px;
  padding: 2px 7px;
  font-size: 10px;
}

.duration-timetable .capacity-text,
.duration-timetable .timetable-lesson.is-compact .capacity-text {
  font-size: 11px;
  line-height: 1.05;
}

.duration-timetable .place-text,
.duration-timetable .timetable-lesson.is-compact .place-text,
.duration-timetable .timetable-lesson.is-mini .place-text {
  justify-content: center;
  font-size: 9px;
  line-height: 1.08;
}

@media (max-width: 760px) {
  .board-style-page .schedule-grid-scroller {
    overflow-x: auto !important;
    overflow-y: hidden;
    touch-action: pan-x pan-y pinch-zoom;
  }

  .duration-timetable {
    width: max(100%, var(--grid-min-width, 100%));
    min-width: var(--grid-min-width, 100%);
  }

  .duration-timetable .day-track .timetable-lesson,
  .duration-timetable .day-track .timetable-lesson.is-overlap,
  .duration-timetable .day-track .timetable-lesson.is-compact,
  .duration-timetable .day-track .timetable-lesson.is-mini {
    top: calc(var(--lesson-top) + 4px);
    left: calc(var(--lesson-left) + 5px);
    width: calc(var(--lesson-width) - 10px);
    height: calc(var(--lesson-height) - 8px);
    min-height: 72px;
    padding: 7px 6px;
    gap: 4px;
    border-radius: 9px;
  }

  .duration-timetable .lesson-time,
  .duration-timetable .timetable-lesson.is-compact .lesson-time,
  .duration-timetable .timetable-lesson.is-mini .lesson-time {
    min-height: 18px;
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    white-space: nowrap;
  }

  .duration-timetable .timetable-lesson .lesson-name,
  .duration-timetable .timetable-lesson.is-compact .lesson-name,
  .duration-timetable .timetable-lesson.is-mini .lesson-name {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    font-size: 11px;
    line-height: 1.15;
    letter-spacing: -0.03em;
  }

  .duration-timetable .grade-chip,
  .duration-timetable .timetable-lesson.is-compact .grade-chip,
  .duration-timetable .timetable-lesson.is-mini .grade-chip {
    min-height: 15px;
    padding: 1px 5px;
    font-size: 8.5px;
    letter-spacing: -0.02em;
  }

  .duration-timetable .capacity-text,
  .duration-timetable .timetable-lesson.is-compact .capacity-text {
    font-size: 9px;
  }

  .duration-timetable .place-text,
  .duration-timetable .timetable-lesson.is-compact .place-text,
  .duration-timetable .timetable-lesson.is-mini .place-text {
    font-size: 8.5px;
  }
}

/* v18: 가독성 우선 - 요일 칸을 넓히고 전체 시간표 보기 크기 조절 */
.timetable-view-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}

.view-zoom-group,
.day-jump-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.view-zoom-button,
.day-jump-button {
  border: 1px solid #cbdcf5;
  background: #ffffff;
  color: #1e3a8a;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.06);
}

.view-zoom-button.active {
  border-color: #f59e0b;
  background: #facc15;
  color: #111827;
}

.day-jump-button:hover,
.view-zoom-button:hover {
  transform: translateY(-1px);
}

.board-style-page .schedule-grid-scroller {
  overflow: auto !important;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
  touch-action: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  background: #ffffff;
}

.duration-timetable {
  max-width: none !important;
  table-layout: fixed;
  overflow: visible !important;
  transform-origin: top left;
}

.duration-timetable .grid-head,
.duration-timetable .grid-time-cell,
.duration-timetable .grid-slot,
.duration-timetable .day-track {
  overflow: visible !important;
}

.duration-timetable .day-track .timetable-lesson,
.duration-timetable .day-track .timetable-lesson.is-overlap,
.duration-timetable .day-track .timetable-lesson.is-compact,
.duration-timetable .day-track .timetable-lesson.is-mini {
  min-width: 0 !important;
  min-height: 88px;
  overflow: visible !important;
  padding: 11px 10px;
  gap: 5px;
  justify-content: center;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.duration-timetable .lesson-time,
.duration-timetable .timetable-lesson.is-compact .lesson-time,
.duration-timetable .timetable-lesson.is-mini .lesson-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  max-width: 100%;
  min-height: 23px;
  padding: 3px 9px;
  font-size: 12px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
}

.duration-timetable .timetable-lesson .lesson-name,
.duration-timetable .timetable-lesson.is-compact .lesson-name,
.duration-timetable .timetable-lesson.is-mini .lesson-name {
  display: block !important;
  -webkit-line-clamp: unset !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  font-size: 14px;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.duration-timetable .grade-chip,
.duration-timetable .timetable-lesson.is-compact .grade-chip,
.duration-timetable .timetable-lesson.is-mini .grade-chip,
.duration-timetable .capacity-text,
.duration-timetable .timetable-lesson.is-compact .capacity-text,
.duration-timetable .place-text,
.duration-timetable .timetable-lesson.is-compact .place-text,
.duration-timetable .timetable-lesson.is-mini .place-text {
  display: inline-flex !important;
  max-width: 100%;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.duration-timetable .time-head,
.duration-timetable .grid-time-cell {
  position: sticky;
  left: 0;
  z-index: 20;
}

.duration-timetable .time-head {
  z-index: 36;
}

@media (max-width: 760px) {
  .timetable-view-controls {
    align-items: stretch;
    gap: 8px;
  }

  .view-zoom-group,
  .day-jump-group {
    width: 100%;
    gap: 5px;
    font-size: 11px;
  }

  .view-zoom-button,
  .day-jump-button {
    padding: 7px 9px;
    font-size: 11px;
  }

  .board-style-page .schedule-grid-scroller {
    overflow: auto !important;
    touch-action: auto;
  }

  .duration-timetable .day-track .timetable-lesson,
  .duration-timetable .day-track .timetable-lesson.is-overlap,
  .duration-timetable .day-track .timetable-lesson.is-compact,
  .duration-timetable .day-track .timetable-lesson.is-mini {
    min-height: 82px;
    padding: 8px 8px;
    gap: 4px;
  }

  .duration-timetable .lesson-time,
  .duration-timetable .timetable-lesson.is-compact .lesson-time,
  .duration-timetable .timetable-lesson.is-mini .lesson-time {
    min-height: 20px;
    padding: 3px 7px;
    font-size: 10.5px;
    line-height: 1.05;
    letter-spacing: -0.03em;
    white-space: nowrap;
  }

  .duration-timetable .timetable-lesson .lesson-name,
  .duration-timetable .timetable-lesson.is-compact .lesson-name,
  .duration-timetable .timetable-lesson.is-mini .lesson-name {
    font-size: 12px;
    line-height: 1.18;
    letter-spacing: -0.03em;
  }

  .duration-timetable .grade-chip,
  .duration-timetable .timetable-lesson.is-compact .grade-chip,
  .duration-timetable .timetable-lesson.is-mini .grade-chip {
    min-height: 16px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .duration-timetable .capacity-text,
  .duration-timetable .timetable-lesson.is-compact .capacity-text {
    font-size: 9.5px;
  }

  .duration-timetable .place-text,
  .duration-timetable .timetable-lesson.is-compact .place-text,
  .duration-timetable .timetable-lesson.is-mini .place-text {
    font-size: 8.5px;
  }
}

/* v19: 전체 주간 시간표를 한 화면에 넣는 자동 축소/확대 모드 */
.schedule-fit-shell {
  position: relative;
  flex: 0 0 auto;
  transform-origin: top left;
}

.duration-timetable {
  transform-origin: top left !important;
  will-change: transform;
}

.board-style-page .schedule-grid-scroller.fit-mode {
  overflow-x: hidden !important;
  overflow-y: hidden;
}

.board-style-page .schedule-grid-scroller.free-zoom-mode {
  overflow-x: auto !important;
  overflow-y: hidden;
}

.view-zoom-group small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

/* 전체보기에서는 한 화면에 월~금이 들어오므로 불필요한 좌우 흔들림을 줄입니다. */
.board-style-page .schedule-grid-scroller.fit-mode .schedule-fit-shell {
  margin-left: auto;
  margin-right: auto;
}

/* 수업 정보는 100% 기준에서 충분히 읽히도록 유지하고, 전체보기 버튼이 전체를 축소합니다. */
.duration-timetable .day-track .timetable-lesson,
.duration-timetable .day-track .timetable-lesson.is-overlap,
.duration-timetable .day-track .timetable-lesson.is-compact,
.duration-timetable .day-track .timetable-lesson.is-mini {
  min-height: 90px;
}

@media (max-width: 760px) {
  .view-zoom-group {
    display: grid;
    grid-template-columns: auto repeat(5, minmax(0, 1fr));
    align-items: center;
  }

  .view-zoom-group small {
    grid-column: 1 / -1;
  }

  .view-zoom-button {
    padding: 8px 5px;
    font-size: 10.5px;
  }

  .board-style-page .schedule-grid-scroller.fit-mode {
    overflow-x: hidden !important;
    padding-bottom: 2px;
  }

  .board-style-page .schedule-grid-scroller.free-zoom-mode {
    overflow-x: auto !important;
  }

  .duration-timetable .day-track .timetable-lesson,
  .duration-timetable .day-track .timetable-lesson.is-overlap,
  .duration-timetable .day-track .timetable-lesson.is-compact,
  .duration-timetable .day-track .timetable-lesson.is-mini {
    min-height: 84px;
  }
}

/* v20: transform 축소를 제거하고 실제 레이아웃 크기를 축소/확대합니다.
   브라우저가 실제 스크롤 범위를 인식하므로 모바일 손가락 확대 후 스크롤이 자연스럽게 작동합니다. */
.board-style-page .schedule-grid-scroller {
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  overscroll-behavior: auto;
}

.board-style-page .schedule-fit-shell {
  overflow: visible;
  transform: none !important;
}

.duration-timetable {
  transform: none !important;
  width: var(--grid-min-width, 100%) !important;
  min-width: var(--grid-min-width, 100%) !important;
  overflow: visible;
  --card-gap: clamp(1.5px, calc(7px * var(--schedule-zoom, 1)), 7px);
  --card-radius: clamp(4px, calc(12px * var(--schedule-zoom, 1)), 12px);
}

.duration-timetable .day-track .timetable-lesson,
.duration-timetable .day-track .timetable-lesson.is-overlap,
.duration-timetable .day-track .timetable-lesson.is-compact,
.duration-timetable .day-track .timetable-lesson.is-mini {
  top: calc(var(--lesson-top) + var(--card-gap)) !important;
  left: calc(var(--lesson-left) + var(--card-gap)) !important;
  width: calc(var(--lesson-width) - (var(--card-gap) * 2)) !important;
  height: calc(var(--lesson-height) - (var(--card-gap) * 2)) !important;
  min-height: 0 !important;
  padding: clamp(1.5px, calc(9px * var(--schedule-zoom, 1)), 10px) clamp(1.5px, calc(8px * var(--schedule-zoom, 1)), 9px) !important;
  gap: clamp(1px, calc(4px * var(--schedule-zoom, 1)), 5px) !important;
  border-radius: var(--card-radius) !important;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.duration-timetable .lesson-time,
.duration-timetable .timetable-lesson.is-compact .lesson-time,
.duration-timetable .timetable-lesson.is-mini .lesson-time {
  min-height: 0 !important;
  padding: clamp(1px, calc(3px * var(--schedule-zoom, 1)), 3px) clamp(2px, calc(8px * var(--schedule-zoom, 1)), 8px) !important;
  font-size: clamp(4px, calc(12px * var(--schedule-zoom, 1)), 15px) !important;
  line-height: 1.05 !important;
  letter-spacing: -0.03em !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.duration-timetable .timetable-lesson .lesson-name,
.duration-timetable .timetable-lesson.is-compact .lesson-name,
.duration-timetable .timetable-lesson.is-mini .lesson-name {
  display: block !important;
  margin: 0 !important;
  font-size: clamp(4px, calc(14px * var(--schedule-zoom, 1)), 17px) !important;
  line-height: 1.16 !important;
  letter-spacing: -0.03em !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: break-word !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
}

.duration-timetable .lesson-subline {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: clamp(1px, calc(4px * var(--schedule-zoom, 1)), 5px) !important;
  max-width: 100% !important;
}

.duration-timetable .grade-chip,
.duration-timetable .timetable-lesson.is-compact .grade-chip,
.duration-timetable .timetable-lesson.is-mini .grade-chip {
  display: inline-flex !important;
  min-height: 0 !important;
  padding: clamp(1px, calc(2px * var(--schedule-zoom, 1)), 3px) clamp(2px, calc(7px * var(--schedule-zoom, 1)), 7px) !important;
  font-size: clamp(3.5px, calc(10px * var(--schedule-zoom, 1)), 12px) !important;
  line-height: 1.05 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.duration-timetable .capacity-text,
.duration-timetable .timetable-lesson.is-compact .capacity-text {
  display: inline-flex !important;
  font-size: clamp(3.5px, calc(11px * var(--schedule-zoom, 1)), 13px) !important;
  line-height: 1.05 !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.duration-timetable .place-text,
.duration-timetable .timetable-lesson.is-compact .place-text,
.duration-timetable .timetable-lesson.is-mini .place-text {
  display: inline-flex !important;
  justify-content: center !important;
  font-size: clamp(3px, calc(9px * var(--schedule-zoom, 1)), 11px) !important;
  line-height: 1.08 !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.duration-timetable .grid-head,
.duration-timetable .grid-time-cell {
  font-size: clamp(7px, calc(18px * var(--schedule-zoom, 1)), 20px);
}

@media (max-width: 760px) {
  .board-style-page .schedule-grid-scroller {
    overflow-x: auto !important;
    overflow-y: visible !important;
    touch-action: auto;
  }

  .duration-timetable .time-head,
  .duration-timetable .grid-time-cell {
    position: sticky;
    left: 0;
  }
}


/* v21: 학부모용 최종 보기 - 확대/좌우 스크롤 제거, 세로 스크롤 전용 주간 시간표 */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.board-style-page .timetable-view-controls,
.board-style-page .view-zoom-group,
.board-style-page .day-jump-group {
  display: none !important;
}

.board-style-page .schedule-grid-scroller.no-x-scroll-mode,
.board-style-page .schedule-grid-scroller {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: auto;
  touch-action: pan-y !important;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
  scrollbar-gutter: auto;
  background: #ffffff;
}

.stack-timetable.duration-timetable {
  --time-col-stack: 78px;
  display: grid;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  overflow: hidden !important;
  transform: none !important;
  table-layout: fixed;
  background: #ffffff;
  border: 1px solid #d8e1ee;
  border-radius: 18px;
}

.stack-timetable .grid-head,
.stack-timetable .grid-time-cell,
.stack-timetable .grid-slot {
  min-width: 0 !important;
  overflow: visible !important;
  border-right: 1px solid #d8e1ee;
  border-bottom: 1px solid #d8e1ee;
}

.stack-timetable .grid-head {
  min-height: 52px;
  padding: 10px 6px;
  display: grid;
  place-items: center;
  background: #eef4ff;
  color: #1e3a8a;
  font-size: 16px;
  font-weight: 950;
  text-align: center;
}

.stack-timetable .time-head,
.stack-timetable .grid-time-cell {
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
}

.stack-timetable .grid-time-cell {
  min-height: 112px;
  padding: 10px 6px;
  display: grid;
  place-items: start center;
  background: #f8fbff;
  text-align: center;
}

.stack-timetable .grid-time-cell strong {
  color: #1e3a8a;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.15;
  white-space: normal;
  letter-spacing: -0.02em;
}

.stack-timetable .grid-slot {
  min-height: 112px;
  padding: 8px;
  background: #ffffff;
}

.stack-timetable .grid-slot:nth-of-type(even) {
  background: #fbfdff;
}

.stack-timetable .lesson-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.stack-timetable .day-track {
  display: none !important;
}

.stack-timetable .lesson-stack .timetable-lesson,
.stack-timetable .lesson-stack .timetable-lesson.is-overlap,
.stack-timetable .lesson-stack .timetable-lesson.is-compact,
.stack-timetable .lesson-stack .timetable-lesson.is-mini {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 92px !important;
  margin: 0 !important;
  padding: 10px 8px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px !important;
  overflow: visible !important;
  border-radius: 12px !important;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.stack-timetable .lesson-time,
.stack-timetable .timetable-lesson.is-compact .lesson-time,
.stack-timetable .timetable-lesson.is-mini .lesson-time {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  max-width: 100% !important;
  min-height: 22px !important;
  padding: 3px 8px !important;
  font-size: 12px !important;
  line-height: 1.08 !important;
  letter-spacing: -0.02em !important;
  white-space: normal !important;
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow: visible !important;
  text-overflow: clip !important;
}

.stack-timetable .timetable-lesson .lesson-name,
.stack-timetable .timetable-lesson.is-compact .lesson-name,
.stack-timetable .timetable-lesson.is-mini .lesson-name {
  display: block !important;
  margin: 0 !important;
  width: 100%;
  font-size: 14px !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  overflow: visible !important;
  text-overflow: clip !important;
  -webkit-line-clamp: unset !important;
}

.stack-timetable .lesson-subline {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px 5px !important;
  width: 100%;
  max-width: 100% !important;
}

.stack-timetable .grade-chip,
.stack-timetable .timetable-lesson.is-compact .grade-chip,
.stack-timetable .timetable-lesson.is-mini .grade-chip,
.stack-timetable .capacity-text,
.stack-timetable .timetable-lesson.is-compact .capacity-text,
.stack-timetable .place-text,
.stack-timetable .timetable-lesson.is-compact .place-text,
.stack-timetable .timetable-lesson.is-mini .place-text {
  display: inline-flex !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.stack-timetable .grade-chip,
.stack-timetable .timetable-lesson.is-compact .grade-chip,
.stack-timetable .timetable-lesson.is-mini .grade-chip {
  min-height: 18px !important;
  padding: 2px 7px !important;
  font-size: 10px !important;
  line-height: 1.05 !important;
}

.stack-timetable .capacity-text,
.stack-timetable .timetable-lesson.is-compact .capacity-text {
  font-size: 11px !important;
  line-height: 1.05 !important;
}

.stack-timetable .place-text,
.stack-timetable .timetable-lesson.is-compact .place-text,
.stack-timetable .timetable-lesson.is-mini .place-text {
  justify-content: center !important;
  font-size: 9px !important;
  line-height: 1.08 !important;
}

@media (max-width: 760px) {
  .board-style-page .board-shell {
    overflow-x: hidden;
  }

  .board-style-page .schedule-main-title {
    font-size: 21px;
    line-height: 1.28;
  }

  .stack-timetable.duration-timetable {
    --time-col-stack: 42px;
    border-radius: 14px;
  }

  .stack-timetable .grid-head {
    min-height: 34px;
    padding: 6px 2px;
    font-size: 12px;
    letter-spacing: -0.03em;
  }

  .stack-timetable .grid-time-cell {
    min-height: 86px;
    padding: 6px 2px;
  }

  .stack-timetable .grid-time-cell strong {
    font-size: 10px;
    line-height: 1.08;
    letter-spacing: -0.06em;
  }

  .stack-timetable .grid-slot {
    min-height: 86px;
    padding: 3px 2px;
  }

  .stack-timetable .lesson-stack {
    gap: 4px;
  }

  .stack-timetable .lesson-stack .timetable-lesson,
  .stack-timetable .lesson-stack .timetable-lesson.is-overlap,
  .stack-timetable .lesson-stack .timetable-lesson.is-compact,
  .stack-timetable .lesson-stack .timetable-lesson.is-mini {
    min-height: 78px !important;
    padding: 6px 2px !important;
    gap: 3px !important;
    border-radius: 7px !important;
  }

  .stack-timetable .lesson-time,
  .stack-timetable .timetable-lesson.is-compact .lesson-time,
  .stack-timetable .timetable-lesson.is-mini .lesson-time {
    min-height: 15px !important;
    padding: 2px 2px !important;
    font-size: 8.2px !important;
    line-height: 1.05 !important;
    letter-spacing: -0.07em !important;
  }

  .stack-timetable .timetable-lesson .lesson-name,
  .stack-timetable .timetable-lesson.is-compact .lesson-name,
  .stack-timetable .timetable-lesson.is-mini .lesson-name {
    font-size: 9.2px !important;
    line-height: 1.12 !important;
    letter-spacing: -0.06em !important;
  }

  .stack-timetable .lesson-subline {
    gap: 2px 2px !important;
  }

  .stack-timetable .grade-chip,
  .stack-timetable .timetable-lesson.is-compact .grade-chip,
  .stack-timetable .timetable-lesson.is-mini .grade-chip {
    min-height: 13px !important;
    padding: 1px 2px !important;
    font-size: 7px !important;
    letter-spacing: -0.05em;
  }

  .stack-timetable .capacity-text,
  .stack-timetable .timetable-lesson.is-compact .capacity-text {
    font-size: 7.7px !important;
  }

  .stack-timetable .place-text,
  .stack-timetable .timetable-lesson.is-compact .place-text,
  .stack-timetable .timetable-lesson.is-mini .place-text {
    font-size: 7px !important;
  }
}

@media (max-width: 380px) {
  .stack-timetable.duration-timetable {
    --time-col-stack: 39px;
  }

  .stack-timetable .grid-head {
    font-size: 11px;
  }

  .stack-timetable .grid-time-cell strong {
    font-size: 9px;
  }

  .stack-timetable .lesson-time,
  .stack-timetable .timetable-lesson.is-compact .lesson-time,
  .stack-timetable .timetable-lesson.is-mini .lesson-time {
    font-size: 7.5px !important;
  }

  .stack-timetable .timetable-lesson .lesson-name,
  .stack-timetable .timetable-lesson.is-compact .lesson-name,
  .stack-timetable .timetable-lesson.is-mini .lesson-name {
    font-size: 8.4px !important;
  }
}

/* v22: 같은 시간대 수업이 여러 개이면 해당 시간대 행 자체가 아래로 커지는 최종 모바일/PC 보기 */
.board-style-page .schedule-grid-scroller.no-x-scroll-mode,
.board-style-page .schedule-grid-scroller {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  max-width: 100% !important;
  width: 100% !important;
}

.stack-timetable.duration-timetable {
  grid-template-rows: auto repeat(var(--slot-count), minmax(112px, auto));
  overflow: visible !important;
  align-items: stretch;
}

.stack-timetable .grid-slot,
.stack-timetable .grid-time-cell {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.stack-timetable .lesson-stack {
  height: auto !important;
  min-height: 100% !important;
  overflow: visible !important;
}

.stack-timetable .lesson-stack .timetable-lesson,
.stack-timetable .lesson-stack .timetable-lesson.is-overlap,
.stack-timetable .lesson-stack .timetable-lesson.is-compact,
.stack-timetable .lesson-stack .timetable-lesson.is-mini {
  flex: 0 0 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 92px !important;
  overflow: visible !important;
  white-space: normal !important;
  word-break: keep-all !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}

.stack-timetable .lesson-time,
.stack-timetable .timetable-lesson .lesson-name,
.stack-timetable .lesson-subline,
.stack-timetable .grade-chip,
.stack-timetable .capacity-text,
.stack-timetable .place-text {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  max-width: 100% !important;
}

@media (max-width: 760px) {
  .stack-timetable.duration-timetable {
    --time-col-stack: 44px;
    grid-template-rows: auto repeat(var(--slot-count), minmax(92px, auto));
    border-radius: 13px;
  }

  .stack-timetable .grid-head {
    min-height: 36px;
    font-size: 12px;
  }

  .stack-timetable .grid-slot {
    padding: 4px 2px;
  }

  .stack-timetable .grid-time-cell {
    padding: 8px 2px;
    align-items: start;
  }

  .stack-timetable .grid-time-cell strong {
    font-size: 10.2px;
    letter-spacing: -0.055em;
  }

  .stack-timetable .lesson-stack {
    gap: 5px;
  }

  .stack-timetable .lesson-stack .timetable-lesson,
  .stack-timetable .lesson-stack .timetable-lesson.is-overlap,
  .stack-timetable .lesson-stack .timetable-lesson.is-compact,
  .stack-timetable .lesson-stack .timetable-lesson.is-mini {
    min-height: 74px !important;
    padding: 6px 2px !important;
    gap: 3px !important;
    border-radius: 8px !important;
  }

  .stack-timetable .lesson-time,
  .stack-timetable .timetable-lesson.is-compact .lesson-time,
  .stack-timetable .timetable-lesson.is-mini .lesson-time {
    font-size: 8.5px !important;
    line-height: 1.08 !important;
    padding: 2px 2px !important;
  }

  .stack-timetable .timetable-lesson .lesson-name,
  .stack-timetable .timetable-lesson.is-compact .lesson-name,
  .stack-timetable .timetable-lesson.is-mini .lesson-name {
    font-size: 9.6px !important;
    line-height: 1.13 !important;
    letter-spacing: -0.055em !important;
  }

  .stack-timetable .grade-chip,
  .stack-timetable .timetable-lesson.is-compact .grade-chip,
  .stack-timetable .timetable-lesson.is-mini .grade-chip {
    font-size: 7.2px !important;
    min-height: 13px !important;
    padding: 1px 2px !important;
  }

  .stack-timetable .capacity-text,
  .stack-timetable .timetable-lesson.is-compact .capacity-text {
    font-size: 7.9px !important;
  }

  .stack-timetable .place-text,
  .stack-timetable .timetable-lesson.is-compact .place-text,
  .stack-timetable .timetable-lesson.is-mini .place-text {
    font-size: 7.1px !important;
  }
}

/* v23: 카카오톡 인앱 브라우저/모바일 브라우저에서 손가락 확대 허용 */
html,
body {
  touch-action: pan-y pinch-zoom !important;
}

.board-style-page,
.board-style-page .board-shell,
.board-style-page .schedule-board,
.board-style-page .board-section,
.board-style-page .schedule-grid-scroller,
.board-style-page .stack-timetable,
.board-style-page .grid-slot,
.board-style-page .grid-time-cell,
.board-style-page .timetable-lesson {
  touch-action: pan-y pinch-zoom !important;
}

@media (max-width: 760px) {
  .board-style-page .schedule-grid-scroller,
  .board-style-page .schedule-grid-scroller.no-x-scroll-mode {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    touch-action: pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: none;
    overscroll-behavior-y: auto;
  }
}
