  :root {
    --bg: #F6F8FC;
    --surface: #FFFFFF;
    --surface-2: #EEF2F8;
    --ink: #111827;
    --ink-soft: #6B7280;
    --border: #E3E8F2;
    --brand: #2563EB;
    --brand-soft: #E6EEFF;
    --brand-ink: #FFFFFF;
    --font-body: 'IBM Plex Sans KR', 'Noto Sans KR', system-ui, sans-serif;
    --font-head: 'IBM Plex Sans KR', 'Noto Sans KR', sans-serif;
    --danger: #E24C4C;
    --success: #22B573;

    --cat-classroom: #3E7BFA;
    --cat-classroom-bg: #E9F0FE;
    --cat-hall: #FF7A45;
    --cat-hall-bg: #FFEEE5;
    --cat-field: #22B573;
    --cat-field-bg: #E6F8EF;
    --cat-special: #9B5DE5;
    --cat-special-bg: #F3EAFD;
    --cat-cafeteria: #D9A400;
    --cat-cafeteria-bg: #FBF3DA;
    --cat-none: #8A93A6;
    --cat-none-bg: #EDEFF4;

    --shadow: 0 8px 24px rgba(35, 43, 61, 0.08);
    --shadow-soft: 0 2px 8px rgba(35, 43, 61, 0.06);
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #14161F;
      --surface: #1D2030;
      --surface-2: #262A3D;
      --ink: #F0F2F8;
      --ink-soft: #9AA1B4;
      --border: #323752;
      --brand: #60A5FA;
      --brand-soft: #1E2F4D;
      --brand-ink: #14161F;
      --cat-classroom-bg: #1E2C4D;
      --cat-hall-bg: #402A20;
      --cat-field-bg: #1B3A2C;
      --cat-special-bg: #33224D;
      --cat-cafeteria-bg: #3A3016;
      --cat-none-bg: #2A2E3F;
      --shadow: 0 8px 24px rgba(0,0,0,0.35);
      --shadow-soft: 0 2px 8px rgba(0,0,0,0.25);
    }
  }
  :root[data-theme="dark"] {
    --bg: #14161F;
    --surface: #1D2030;
    --surface-2: #262A3D;
    --ink: #F0F2F8;
    --ink-soft: #9AA1B4;
    --border: #323752;
    --brand: #60A5FA;
    --brand-soft: #1E2F4D;
    --brand-ink: #14161F;
    --cat-classroom-bg: #1E2C4D;
    --cat-hall-bg: #402A20;
    --cat-field-bg: #1B3A2C;
    --cat-special-bg: #33224D;
    --cat-cafeteria-bg: #3A3016;
    --cat-none-bg: #2A2E3F;
    --shadow: 0 8px 24px rgba(0,0,0,0.35);
    --shadow-soft: 0 2px 8px rgba(0,0,0,0.25);
  }

  * { box-sizing: border-box; }
  html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    -webkit-tap-highlight-color: transparent;
  }
  body { min-height: 100vh; }

  .display { font-family: var(--font-head); }

  .app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
  }

  .topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 10px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 5;
  }
  .topbar .back-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 18px;
  }
  .topbar .back-btn:active { transform: scale(0.94); }
  .topbar .crumb {
    font-size: 14px;
    color: var(--ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar .crumb b { color: var(--ink); font-weight: 700; }
  .topbar .home-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: inherit;
  }
  .topbar .home-btn:active { transform: scale(0.94); }

  .screen {
    flex: 1;
    padding: 8px 20px 40px;
    display: none;
    flex-direction: column;
    gap: 16px;
  }
  .screen.active { display: flex; }

  /* ---- 관리자 화면: 상단 탭 + 메뉴별 화면 (PC는 넓게) ---- */
  .admin-tabs { display: flex; gap: 6px; overflow-x: auto; position: sticky; top: 64px; z-index: 4; background: var(--bg); padding: 6px 0 8px; margin: 0 -2px; scrollbar-width: none; }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tabs button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
  .admin-tabs button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
  .admin-pane { display: none; flex-direction: column; gap: 16px; min-width: 0; }
  .admin-pane.on { display: flex; }
  #user-students, #user-teachers { display: flex; flex-direction: column; gap: 10px; }
  .user-seg { display: flex; gap: 8px; }
  .user-seg .toggle-chip { padding: 9px 22px; font-size: 13.5px; }
  .user-filter { display: flex; gap: 8px; }
  .user-filter select, .user-filter input { min-height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; padding: 0 10px; min-width: 0; }
  .user-filter input { flex: 1; }
  .user-list { display: flex; flex-direction: column; gap: 6px; }
  .u-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 9px 12px; font-size: 13.5px; }
  .u-row .cls { color: var(--ink-soft); font-size: 12px; min-width: 64px; }
  .u-row .nm { font-weight: 700; }
  .u-tap { cursor: pointer; }
  .u-tap:hover { border-color: var(--accent, #4f8cff); }
  .u-detail { margin: 4px 0 2px 12px; padding: 6px 10px; border-left: 3px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
  .ud-row { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
  .ud-row b { font-weight: 700; }
  .ud-row span { color: var(--ink-soft); }
  .ud-row.bad b { color: #d33; }
  .u-row .meta { margin-left: auto; color: var(--ink-soft); font-size: 12px; }
  .t-bulk { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
  .t-bulk textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; padding: 10px; resize: vertical; }
  .t-bulk-actions { display: flex; gap: 8px; align-items: center; }
  .t-bulk-actions .btn { flex: 1; width: auto; }
  .t-preview { max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; display: none; }
  .t-preview.show { display: block; }
  .t-preview table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
  .t-preview th, .t-preview td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
  .t-preview th { position: sticky; top: 0; background: var(--surface-2); font-size: 11.5px; color: var(--ink-soft); }
  .t-preview .st-new { color: var(--success); font-weight: 700; }
  .t-preview .st-dup { color: var(--ink-soft); }
  .t-preview .st-bad { color: var(--danger); font-weight: 700; }
  .t-preview .nm-bad { color: var(--danger); font-weight: 800; }
  .t-preview td.cs { min-width: 200px; }
  .cs-ok { display: inline-block; font-size: 12px; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; }
  .cs-bad { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; padding: 2px 4px 2px 8px; border-radius: 10px; border: 1px solid var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); font-size: 12px; font-weight: 700; }
  .cs-bad select { max-width: 150px; font: inherit; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink); padding: 2px 4px; }
  .cs-bad .cs-x { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 13px; padding: 0 3px; }
  .t-head .tn-bad { color: var(--danger); }
  .t-tags { display: flex; flex-wrap: wrap; align-items: center; flex: 1; min-width: 0; }
  .t-picker { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
  .tp-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; }
  .tp-row + .tp-row { border-top: 1px solid var(--border); }
  .tp-g { flex: 0 0 132px; font-size: 12.5px; font-weight: 700; color: var(--brand); padding-top: 6px; }
  .tp-cs { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
  @media (min-width: 768px) { body.admin-wide .tp-g { flex-basis: 170px; } }
  @media (max-width: 767px) { .t-head { flex-wrap: wrap; } .t-head .t-tags { flex: 1 1 100%; order: 5; } .tp-g { flex-basis: 96px; } }
  .t-add { display: flex; gap: 8px; }
  .t-add input, .t-search { min-width: 0; min-height: 40px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; padding: 0 10px; }
  .t-add input { flex: 1; }
  .t-search { width: 100%; }
  .t-phone { min-width: 0; width: 140px; min-height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; padding: 0 8px; }
  .t-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
  .t-head { display: flex; align-items: center; gap: 8px; }
  .t-head b { font-size: 14.5px; }
  .t-head .mini-btn { margin-left: 0; }
  .t-card:not(.open) .t-head .t-toggle { margin-left: auto; }
  .t-card.open .t-head .t-tags { flex: 0 1 auto; }
  .t-card.open .t-head .t-done { margin-left: auto; background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
  .t-head .t-toggle.on { border-color: var(--brand); color: var(--brand); }
  .t-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  @media (min-width: 768px) {
    body.admin-wide .app { max-width: 1640px; }
    body.admin-wide .screen { padding: 8px 36px 56px; }
    body.admin-wide .topbar { padding: 18px 36px 10px; }
    body.admin-wide .admin-tabs { top: 66px; }
    body.admin-wide .admin-tabs button { font-size: 14px; padding: 10px 18px; }
    body.admin-wide .admin-pane { max-width: 820px; }
    body.admin-wide .admin-pane[data-pane="table"] { max-width: 1240px; }
    body.admin-wide .admin-pane[data-pane="table"] table.pt { min-width: 0 !important; }
    body.admin-wide .admin-pane[data-pane="table"] .pt td, body.admin-wide .admin-pane[data-pane="table"] .pt th { padding-left: 2px; padding-right: 2px; }
    body.admin-wide .topbar .crumb { font-size: 15px; }
    body.admin-wide .admin-pane[data-pane="courses"] { max-width: 1560px; }
    .course-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
    .course-split .cs-list { order: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
    body.admin-wide .course-split .sumpc { gap: 8px; min-width: 0; }
    body.admin-wide .course-split .sumpc .gc { min-width: 0; }
    body.admin-wide .course-split .sumpc .pbs { min-width: 0; gap: 3px; }
    body.admin-wide .course-split .sumpc .pl { min-width: 0; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    body.admin-wide .course-split .course-head .nm { min-width: 0; flex: 0 1 auto; }
    .course-split .cs-reg { order: 2; position: sticky; top: 130px; min-width: 0; }
    body.admin-wide .course-head .sum { display: none; }
    body.admin-wide .course-head .nm { min-width: 130px; }
    body.admin-wide .sumpc { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 12.5px; }
    body.admin-wide .sumpc .gc { min-width: 150px; font-weight: 700; color: var(--brand); }
    body.admin-wide .sumpc .pbs { display: flex; gap: 6px; min-width: calc(var(--np, 4) * 62px); }
    body.admin-wide .sumpc .pl { min-width: 110px; text-align: right; color: var(--ink); }
    body.admin-wide .admin-pane[data-pane="users"] { max-width: 1000px; }
  }

  /* ---- 홈 ---- */
  .hero {
    padding: 22px 4px 6px;
  }
  .hero .eyebrow {
    color: var(--brand);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
  }
  .hero h1 {
    font-family: var(--font-head);
    font-size: 34px;
    font-weight: 400;
    margin: 0 0 4px;
    line-height: 1.2;
    white-space: nowrap;
  }
  .hero p {
    color: var(--ink-soft);
    font-size: 14.5px;
    margin: 0;
    line-height: 1.6;
  }

  .action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    text-align: left;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
  }
  .action-card:active { transform: scale(0.98); }
  .action-card.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-ink);
    box-shadow: var(--shadow);
  }
  .action-card .icon {
    width: 52px; height: 52px;
    border-radius: 16px;
    background: var(--brand-soft);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
  }
  .action-card.primary .icon {
    background: rgba(255,255,255,0.18);
  }
  .action-card .txt h3 {
    margin: 0 0 4px;
    font-size: 17px;
    font-family: var(--font-head);
  }
  .action-card .txt p {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
  }
  .action-card .chev { margin-left: auto; opacity: 0.5; }

  .admin-link {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
  }
  .admin-link button {
    background: none; border: none;
    color: var(--ink-soft);
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  /* ---- 선택 단계 (칩) ---- */
  .step-title {
    font-family: var(--font-head);
    font-size: 19px;
    margin: 4px 0 2px;
  }
  .step-sub {
    color: var(--ink-soft);
    font-size: 13.5px;
    margin: 0 0 4px;
  }
  .chip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .chip-grid.wide { grid-template-columns: repeat(4, 1fr); }
  .chip {
    padding: 16px 8px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
  }
  .chip:active { transform: scale(0.95); }

  .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
  }
  .search-box input {
    border: none; outline: none; background: transparent;
    font-size: 14.5px; color: var(--ink); width: 100%;
    font-family: inherit;
  }
  .search-box input::placeholder { color: var(--ink-soft); }

  .name-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 2px;
  }
  .name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 15.5px;
    font-weight: 600;
  }
  .name-row:active { transform: scale(0.98); }
  .name-row .avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
    flex-shrink: 0;
  }
  .empty-hint {
    text-align: center;
    color: var(--ink-soft);
    font-size: 13.5px;
    padding: 24px 0;
  }

  /* ---- 결과 화면 공통 ---- */
  .who-badge {
    display: inline-flex;
    align-items: center;
    gap: 0;
    align-self: flex-start;
    background: var(--surface-2);
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
  }
  .mask-o {
    display: inline-block;
    width: 0.82em;
    height: 0.82em;
    border: 0.12em solid currentColor;
    border-radius: 50%;
    vertical-align: -0.06em;
    box-sizing: border-box;
  }

  .now-card {
    border-radius: 24px;
    padding: 26px 22px;
    text-align: center;
    box-shadow: var(--shadow);
  }
  .now-card .period-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.25);
    margin-bottom: 14px;
  }
  .now-card .go-icon { font-size: 46px; margin-bottom: 6px; }
  .now-card .go-label {
    font-size: 13.5px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 4px;
  }
  .now-card .go-place {
    font-family: var(--font-head);
    font-size: 27px;
    margin: 0 0 6px;
    line-height: 1.3;
  }
  .now-card .go-activity {
    font-size: 14.5px;
    opacity: 0.9;
  }

  .up-next {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .up-next .tag {
    font-size: 12px; font-weight: 700;
    color: var(--ink-soft);
    flex-shrink: 0;
  }
  .up-next .content { font-size: 14px; font-weight: 600; }
  .up-next .content span { color: var(--ink-soft); font-weight: 500; }

  .test-clock {
    margin-top: auto;
    background: var(--surface-2);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
  }
  .test-clock select {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
  }
  .test-clock input[type="time"] {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px 8px;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
  }
  .test-clock button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--ink);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
  }

  /* 시간표 리스트 */
  .tt-list { display: flex; flex-direction: column; gap: 10px; }

  .week-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 11px;
    color: var(--ink-soft);
  }
  .week-legend .item { display: flex; align-items: center; gap: 4px; }
  .week-legend .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

  .week-grid {
    display: grid;
    grid-template-columns: 30px repeat(5, minmax(0, 1fr));
    gap: 4px;
  }
  .week-grid .head-cell {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-soft);
    padding: 4px 0 6px;
  }
  .week-grid .head-cell.today {
    color: var(--brand);
  }
  .week-grid .head-cell .today-dot {
    display: block;
    font-size: 9px;
    font-weight: 700;
    margin-top: 1px;
  }
  .week-grid .period-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--ink-soft);
    padding: 4px 2px;
    text-align: center;
    line-height: 1.3;
  }
  .week-grid .period-label b { font-size: 13px; color: var(--ink); }
  .week-grid .cell {
    border-radius: 10px;
    padding: 5px 1px;
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 66px;
    line-height: 1.25;
    word-break: keep-all;
    border: 1.5px solid transparent;
  }
  .week-grid .cell .cell-name { font-size: 10.5px; font-weight: 800; letter-spacing: -0.4px; overflow-wrap: anywhere; max-width: 100%; }
  .week-grid .cell .cell-time { font-size: 9px; font-weight: 600; opacity: 0.85; letter-spacing: -0.3px; white-space: nowrap; }
  .week-grid .cell .cell-place { font-size: 9px; font-weight: 600; opacity: 0.8; letter-spacing: -0.2px; }
  .week-grid .cell.today-col { border-color: var(--brand); }
  .week-grid .cell.now-cell { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft) inset; }
  .tt-row {
    display: grid;
    grid-template-columns: auto 118px minmax(0, 1fr) auto 40px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
  }
  .tt-row.is-now { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft) inset; }
  .tt-row .period-chip {
    padding: 7px 10px; border-radius: 10px;
    font-size: 14px; font-weight: 800; white-space: nowrap; text-align: center; min-width: 48px;
    font-family: var(--font-body);
  }
  .tt-row .time { font-size: 15.5px; font-weight: 800; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--font-body); }
  .tt-row .name { font-size: 16px; font-weight: 700; font-family: var(--font-body); color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
  .tt-row .place { font-size: 14px; color: var(--ink-soft); white-space: nowrap; font-family: var(--font-body); }
  .tt-row.empty .name { color: var(--ink-soft); font-weight: 400; }
  .tch-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; cursor: pointer; padding: 0; }
  .tch-btn:active { transform: scale(.94); }
  @media (max-width: 420px) {
    .tt-row { grid-template-columns: auto auto minmax(0, 1fr) 40px; grid-template-areas: "c n n t" "c m p t"; row-gap: 2px; column-gap: 10px; }
    .tt-row .period-chip { grid-area: c; } .tt-row .name { grid-area: n; }
    .tt-row .time { grid-area: m; font-size: 14px; } .tt-row .place { grid-area: p; font-size: 13px; }
    .tt-row .tch { grid-area: t; }
  }
  #tch-pop { position: fixed; inset: 0; background: rgba(15, 30, 50, .45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
  #tch-pop.show { display: flex; }
  #tch-pop .tp-box { background: var(--surface); color: var(--ink); border-radius: 18px; padding: 20px; width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; }
  #tch-pop .tp-course { font-family: var(--font-head); font-size: 18px; }
  #tch-pop .tp-row { display: flex; flex-direction: column; gap: 4px; }
  #tch-pop .tp-row a { font-size: 22px; font-weight: 800; color: var(--brand); text-decoration: none; font-variant-numeric: tabular-nums; }
  #tch-pop .tp-close { border: 0; background: var(--brand); color: var(--brand-ink); border-radius: 12px; padding: 12px; font: inherit; font-weight: 700; cursor: pointer; }

  /* 카테고리 색 */
  .cat-classroom { color: var(--cat-classroom); background: var(--cat-classroom-bg); }
  .cat-hall { color: var(--cat-hall); background: var(--cat-hall-bg); }
  .cat-field { color: var(--cat-field); background: var(--cat-field-bg); }
  .cat-special { color: var(--cat-special); background: var(--cat-special-bg); }
  .cat-cafeteria { color: var(--cat-cafeteria); background: var(--cat-cafeteria-bg); }
  .cat-none { color: var(--cat-none); background: var(--cat-none-bg); }
  .now-card.cat-classroom { background: var(--cat-classroom); color: #fff; }
  .now-card.cat-hall { background: var(--cat-hall); color: #fff; }
  .now-card.cat-field { background: var(--cat-field); color: #fff; }
  .now-card.cat-special { background: var(--cat-special); color: #fff; }
  .now-card.cat-cafeteria { background: var(--cat-cafeteria); color: #fff; }
  .now-card.cat-none { background: var(--cat-none); color: #fff; }

  /* ---- 관리자 ---- */
  .admin-login-box {
    margin-top: 30px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
  }
  .admin-login-box input {
    width: 100%;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    font-size: 16px;
    text-align: center;
    letter-spacing: 4px;
    font-family: inherit;
    background: var(--bg);
    color: var(--ink);
  }
  .btn {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
  }
  .btn:active { transform: scale(0.98); }
  .btn.ghost {
    background: var(--surface);
    border: 1.5px solid var(--border);
    color: var(--ink);
  }
  .err-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }

  .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
  }
  .stat-box .num {
    font-family: var(--font-head);
    font-size: 24px;
    color: var(--brand);
  }
  .stat-box .lbl { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }

  .section-title {
    font-size: 14px; font-weight: 700;
    margin: 6px 0 -4px;
    display: flex; align-items: center; justify-content: space-between;
  }
  .section-title .note { font-size: 11.5px; color: var(--ink-soft); font-weight: 500; }

  .tt-panel { display: flex; flex-direction: column; gap: 10px; }
  .tt-panel input[type=text] { width: 100%; min-height: 44px; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
  .tt-sum { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
  .ts-row { display: flex; gap: 12px; align-items: baseline; padding: 9px 12px; font-size: 13px; }
  .ts-row + .ts-row { border-top: 1px solid var(--border); }
  .ts-g { flex: 0 0 150px; font-weight: 700; color: var(--brand); }
  .ts-n { flex: 0 0 36px; font-weight: 700; text-align: right; }
  .ts-c { flex: 1; min-width: 0; color: var(--ink); line-height: 1.5; }
  .ts-c i { color: var(--ink-soft); font-style: normal; }
  .ts-row.warn .ts-g, .ts-row.warn .ts-n { color: var(--danger); }
  @media (max-width: 600px) { .ts-row { flex-wrap: wrap; gap: 4px 10px; } .ts-g { flex-basis: auto; } .ts-n { flex-basis: auto; text-align: left; } .ts-c { flex-basis: 100%; } }
  .tt-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .tt-actions .btn { min-width: 100%; }
  .pt-export { position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; padding: 16px; background: #fff; color: #232B3D; --surface: #fff; --surface-2: #EEF1F9; --ink: #232B3D; --ink-soft: #6B7383; --border: #CBD2E3; }
  .pt-export .pt-scroll { overflow: visible; }
  .pt-export td.na { background: #EEF1F9; }
  .pt-wrap { display: flex; flex-direction: column; gap: 14px; }
  .pt-title { font-size: 15px; font-weight: 800; text-align: center; margin: 2px 0 0; }
  .pt-scroll { overflow-x: auto; }
  table.pt { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; background: var(--surface); color: var(--ink); }
  .pt th, .pt td { border: 1px solid var(--border); padding: 3px 4px; text-align: center; vertical-align: top; word-break: keep-all; }
  .pt th { vertical-align: middle; }
  .pt th.k { width: 72px; background: var(--surface-2); font-weight: 700; }
  .pt th.k small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 10.5px; line-height: 1.3; }
  .pt th.days { font-size: 13px; background: var(--surface-2); }
  .pt th.g0 { background: rgba(255, 200, 0, .24); } .pt th.g1 { background: rgba(34, 181, 115, .22); }
  .pt th.g2 { background: rgba(62, 123, 250, .20); } .pt th.g3 { background: rgba(255, 122, 69, .22); }
  .pt td .ln { height: 26px; line-height: 1.2; display: flex; flex-direction: column; justify-content: center; padding: 0; white-space: nowrap; }
  .pt.pl td .ln { height: 36px; }
  .pt td .ln + .ln { border-top: 1px dotted var(--border); }
  .pt td .ln small { font-size: 10px; color: var(--ink-soft); }
  .pt td.na { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 8px); }
  .pt td.tm { font-size: 10.5px; color: var(--ink-soft); padding: 2px 4px; background: var(--surface-2); }
  .pt-note { font-size: 11.5px; color: var(--danger); }

  .log-table { display: flex; flex-direction: column; gap: 6px; }
  .log-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12.5px;
  }
  .log-row .who { font-weight: 700; }
  .log-row .page {
    margin-left: auto;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-soft);
    flex-shrink: 0;
  }
  .log-row .t { color: var(--ink-soft); flex-shrink: 0; }

  .map-table { display: flex; flex-direction: column; gap: 8px; }
  .map-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
  }
  .map-row b { width: 36px; font-size: 13.5px; flex-shrink: 0; }
  .map-row input[type="time"] {
    flex: 1;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 4px 6px 8px;
    font-family: inherit;
    background: var(--bg);
    color: var(--ink);
    min-width: 0;
  }
  .map-row span.sep { color: var(--ink-soft); font-size: 12px; }

  .csv-drop {
    display: block;
    border: 1.5px dashed var(--border);
    border-radius: 16px;
    padding: 24px 16px;
    text-align: center;
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.6;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .15s ease, background .15s ease;
  }
  .csv-drop:hover, .csv-drop.drag { border-color: var(--brand); background: var(--brand-soft); }
  .csv-drop .big { font-size: 22px; margin-bottom: 6px; }
  .csv-drop b { color: var(--ink); }

  .info-box {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.75;
  }
  .info-box.show { display: block; }
  .info-box .ok { color: var(--success); font-weight: 700; }
  .info-box .warn { color: var(--cat-hall); font-weight: 700; }
  .info-box .bad { color: var(--danger); font-weight: 700; }
  .info-box .muted { color: var(--ink-soft); font-size: 12px; }
  .info-box ul { margin: 4px 0 0; padding-left: 18px; }

  .data-source {
    font-size: 12px;
    color: var(--ink-soft);
    background: var(--surface-2);
    border-radius: 10px;
    padding: 8px 12px;
    line-height: 1.5;
  }

  .data-source .link-btn {
    margin-left: 6px;
    background: none;
    border: none;
    padding: 0;
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    font-family: inherit;
  }

  /* 강좌 설정 */
  .course-tools { display: flex; gap: 8px; align-items: stretch; }
  .course-tools .search-box { flex: 1; min-width: 0; }
  .toggle-chip {
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--ink-soft);
    border-radius: 12px;
    padding: 0 12px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
  }
  .toggle-chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

  .course-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 64vh;
    overflow-y: auto;
    padding-right: 2px;
  }
  .course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    flex-shrink: 0;
  }
  .course-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    text-align: left;
    color: var(--ink);
    font-family: inherit;
    cursor: pointer;
  }
  .course-head .nm { font-weight: 700; font-size: 14.5px; }
  .course-head .cnt { font-size: 11.5px; color: var(--ink-soft); }
  .course-head .sum {
    margin-left: auto;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
    background: var(--cat-hall-bg);
    color: var(--cat-hall);
  }
  .course-card.is-set .course-head .sum { background: var(--brand-soft); color: var(--brand); }
  .sumpc { display: none; }
  .pbox { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px 3px 6px; border: 1px solid var(--border); border-radius: 8px; color: var(--ink-soft); white-space: nowrap; }
  .pbox i { width: 15px; height: 15px; border: 1.5px solid var(--border); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px; line-height: 1; }
  .pbox.on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
  .pbox.on i { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
  .pc-warn { color: var(--cat-hall); font-weight: 700; font-size: 12px; }
  .course-body {
    display: none;
    flex-direction: column;
    gap: 10px;
    padding: 0 14px 14px;
  }
  .course-card.open .course-body { display: flex; }
  .field-row { display: flex; gap: 8px; }
  .field-row input, .field-row select {
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg);
    color: var(--ink);
    min-width: 0;
  }
  .field-row input { flex: 1; }
  .field-row select { flex-shrink: 0; }
  .unit-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
  .unit-row select, .unit-row input {
    border: 1.5px solid var(--border); border-radius: 10px; padding: 7px 10px;
    font-size: 14px; font-family: inherit; background: var(--bg); color: var(--ink); min-width: 0;
  }
  .unit-row input { width: 90px; }
  .group-list { display: flex; flex-direction: column; gap: 10px; }
  .group-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px;
  }
  .group-head { display: flex; gap: 6px; align-items: center; }
  .group-head .g-name {
    flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 10px;
    padding: 8px 10px; font-size: 14.5px; font-weight: 700; font-family: inherit;
    background: var(--bg); color: var(--ink);
  }
  .g-pre {
    border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 13px;
    font-family: inherit; background: var(--bg); color: var(--ink); min-width: 0; width: 100%; box-sizing: border-box;
  }
  .mini-btn {
    border: 1.5px solid var(--border); background: var(--bg); color: var(--ink); border-radius: 10px;
    padding: 7px 11px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap;
  }
  .mini-btn.danger { color: var(--danger); }
  .mini-btn:active { transform: scale(0.96); }
  .f-label { font-size: 12px; font-weight: 700; color: var(--ink); }
  .f-label .opt { font-weight: 500; color: var(--ink-soft); margin-left: 4px; }
  .day-chips { display: flex; gap: 6px; }
  .day-chip {
    flex: 1; height: 38px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg);
    color: var(--ink-soft); font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  }
  .day-chip.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
  .part-rows { display: flex; flex-direction: column; gap: 6px; }
  .part-row { padding: 7px 8px; gap: 6px; }
  .map-row input[type="time"]::-webkit-calendar-picker-indicator { padding: 0; margin-left: 2px; width: 14px; }
  .part-row.bad { border-color: var(--danger); }
  .x-btn { border: none; background: none; color: var(--ink-soft); font-size: 15px; cursor: pointer; padding: 4px 6px; font-family: inherit; }
  .group-tools { display: flex; gap: 6px; }
  .auto-box { font-size: 12.5px; border: 1px dashed var(--border); border-radius: 10px; padding: 8px 10px; }
  .auto-box summary { cursor: pointer; font-weight: 700; color: var(--ink-soft); }
  .auto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
  .auto-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-soft); font-weight: 700; }
  .auto-grid input {
    border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 8px; font-size: 14px;
    font-family: inherit; background: var(--bg); color: var(--ink); min-width: 0;
  }
  .group-sum { font-size: 12px; color: var(--brand); font-weight: 700; }

  .course-top { display: flex; align-items: center; }
  .course-top .course-head { flex: 1; min-width: 0; padding-left: 2px; }
  .sel-box { display: flex; align-items: center; justify-content: center; width: 40px; align-self: stretch; cursor: pointer; flex-shrink: 0; }
  .sel-box input { width: 18px; height: 18px; accent-color: var(--brand); }
  .course-head .nm { white-space: nowrap; }
  .course-head .sum { max-width: 52%; overflow: hidden; text-overflow: ellipsis; }
  .c-info { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
  .f-group {
    width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 10px; font-size: 14px;
    font-family: inherit; background: var(--bg); color: var(--ink);
  }
  .part-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .part-chip {
    display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 58px; padding: 6px 10px;
    border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--ink-soft);
    cursor: pointer; font-family: inherit;
  }
  .part-chip b { font-size: 13.5px; color: var(--ink); }
  .part-chip small { font-size: 10.5px; }
  .part-chip.on { background: var(--brand); border-color: var(--brand); }
  .part-chip.on b, .part-chip.on small { color: var(--brand-ink); }
  .warn-line { color: var(--cat-hall); font-weight: 700; }
  .edit-wrap { display: flex; flex-direction: column; gap: 16px; }
  .done-box {
    display: none; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; font-size: 13.5px; line-height: 1.7;
  }
  .done-box.show { display: block; }
  .done-box .done-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
  .done-box .done-head b { color: var(--success); font-size: 14px; }
  .done-box .done-head .mini-btn { margin-left: auto; }
  .done-box ul { margin: 0; padding-left: 18px; }
  .done-box .u { color: var(--ink-soft); font-size: 12px; }
  .seg { display: flex; border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; }
  .seg-btn {
    flex: 1; padding: 8px 6px; border: none; background: var(--bg); color: var(--ink-soft);
    font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
  }
  .seg-btn + .seg-btn { border-left: 1.5px solid var(--border); }
  .seg-btn.on { background: var(--brand); color: var(--brand-ink); }
  .each-rows { display: flex; flex-direction: column; gap: 6px; }
  .each-row { display: flex; align-items: center; gap: 6px; }
  .each-row b { width: 36px; font-size: 13px; flex-shrink: 0; }
  .each-row small { width: 38px; font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }
  .each-row input, .each-row select {
    border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 9px; font-size: 14px;
    font-family: inherit; background: var(--bg); color: var(--ink); min-width: 0;
  }
  .each-row input { flex: 1; }
  .each-row select { flex-shrink: 0; width: 112px; padding-left: 6px; padding-right: 4px; font-size: 13px; }
  .reg-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px; display: flex; flex-direction: column; gap: 10px;
  }
  .reg-title { font-size: 14.5px; font-weight: 800; }
  .reg-panel textarea {
    width: 100%; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px 10px;
    font-size: 14px; font-family: inherit; background: var(--bg); color: var(--ink); resize: vertical; line-height: 1.5;
  }
  .reg-panel #reg-make { align-self: flex-start; }
  .reg-draft { display: none; flex-direction: column; gap: 10px; border-top: 1px dashed var(--border); padding-top: 12px; }
  .reg-draft.show { display: flex; }
  .reg-rows { display: flex; flex-direction: column; gap: 8px; }
  .reg-head, .reg-row {
    display: grid; grid-template-columns: 82px min(var(--pw, 124px), 144px) minmax(0, 1fr) 22px; gap: 6px; align-items: center;
  }
  .reg-head { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
  .reg-head span:nth-child(2) { padding-left: 2px; }
  .reg-row .rname { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .reg-row .reg-name { font-size: 13px; font-weight: 700; padding: 8px 6px; }
  .reg-row.dup .reg-name { border-color: var(--cat-hall); }
  .reg-row .rp { display: flex; flex-wrap: wrap; gap: 4px; }
  .rp-btn {
    width: 28px; height: 36px; padding: 0; border-radius: 8px; border: 1.5px solid var(--border);
    background: var(--bg); color: var(--ink-soft); font-size: 13px; font-weight: 800; cursor: pointer; font-family: inherit;
  }
  .rp-btn.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
  .reg-row input {
    min-width: 0; border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 9px;
    font-size: 14px; font-family: inherit; background: var(--bg); color: var(--ink);
  }
  .reg-row .dup-tag { display: none; font-size: 10.5px; color: var(--cat-hall); font-weight: 700; line-height: 1.2; }
  .reg-row.dup .dup-tag { display: block; }
  .reg-actions { display: flex; gap: 8px; align-items: center; }
  .reg-actions .btn { flex: 1; }
  .c-save { padding: 11px; font-size: 14px; }
  .add-row { display: flex; gap: 8px; }
  .add-row input {
    flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px;
    font-size: 14px; font-family: inherit; background: var(--surface); color: var(--ink);
  }
  .add-row .mini-btn { padding: 0 16px; }
  .bulk-bar {
    display: none; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--brand-soft);
    border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; font-size: 12.5px;
  }
  .bulk-bar.show { display: flex; }
  .bulk-bar b { color: var(--brand); }
  .bulk-bar select, .bulk-bar input {
    flex: 1; min-width: 90px; border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 8px;
    font-size: 13px; font-family: inherit; background: var(--bg); color: var(--ink);
  }
  .week-grid .cell.na {
    background: repeating-linear-gradient(135deg, transparent 0 5px, var(--border) 5px 6px);
    border: 1.5px dashed var(--border); opacity: .7;
  }
  .week-grid .cell.na.today-col { border-color: var(--brand); }
  .hint-line { font-size: 11.5px; color: var(--ink-soft); }

  .toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 50;
    white-space: nowrap;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

  a, button { -webkit-tap-highlight-color: transparent; }
  :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
  }

  /* ---- 3분할 추가 스타일 ---- */
  .test-clock { display: none; }
  body.show-test .test-clock { display: flex; }
  .hub { max-width: 520px; margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; gap: 12px; }
  .hub a { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; }
  .hub a b { display: block; font-size: 16px; }
  .hub a span { font-size: 13px; color: var(--ink-soft); }
  /* 강사 화면 */
  body.page-teacher .app { max-width: 920px; }
  .tc-login { max-width: 360px; margin: 40px auto; text-align: center; display: flex; flex-direction: column; gap: 10px; }
  .tc-login input { padding: 12px; font-size: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--ink); }
  .tc-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
  .tc-head .who { font-weight: 800; font-size: 16px; }
  .tc-head button { margin-left: auto; }
  .tc-days { display: flex; gap: 6px; padding: 8px 16px; }
  .tc-days button { flex: 1; padding: 9px 0; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; font-family: inherit; }
  .tc-days button.on { background: var(--brand); color: #fff; border-color: transparent; }
  .tc-days button.today::after { content: '•'; margin-left: 3px; }
  .tc-card { margin: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
  .tc-card h3 { margin: 0 0 2px; font-size: 16px; }
  .tc-card .sub { color: var(--ink-soft); font-size: 12.5px; margin-bottom: 8px; }
  .tc-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
  .tc-sum span { background: var(--bg); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12.5px; }
  .tc-sum span.home { color: var(--ink-soft); }
  .tc-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
  .tc-tbl th { text-align: left; font-size: 12px; color: var(--ink-soft); padding: 4px 6px; border-bottom: 1px solid var(--border); }
  .tc-tbl td { padding: 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
  .tc-tbl .go b { font-weight: 800; }
  .tc-tbl .go.none { color: var(--ink-soft); }
  .tc-empty { padding: 18px 16px; color: var(--ink-soft); text-align: center; font-size: 14px; }
  .tc-clock { margin: 4px 16px; font-size: 12px; color: var(--ink-soft); }

  .tc-tbl .muted { color: var(--ink-soft); font-size: 12px; }

.course-split { display: flex; flex-direction: column; gap: 12px; }
.course-split .cs-list { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 768px) { .course-split { display: grid; } }

/* ---- 학생용 테마: 하늘 놀이터 (항상 밝은 화면) ---- */
body.page-student {
  --bg: #EAF6FF; --surface: #FFFFFF; --surface-2: #DDF0FF; --ink: #0F2C4A; --ink-soft: #5A7690;
  --border: #C9E6FB; --brand: #2B8DF0; --brand-soft: #FFF3C4; --brand-ink: #FFFFFF;
  --cat-classroom-bg: #E3F1FF; --cat-hall-bg: #FFEEE5; --cat-field-bg: #E6F8EF; --cat-special-bg: #F3EAFD; --cat-cafeteria-bg: #FBF3DA; --cat-none-bg: #EEF3F8;
  --shadow: 0 8px 24px rgba(15, 44, 74, 0.08); --shadow-soft: 0 2px 8px rgba(15, 44, 74, 0.06);
  --font-body: 'Nanum Gothic', 'Noto Sans KR', sans-serif;
  --font-head: 'Jua', 'Noto Sans KR', sans-serif;
  color-scheme: light;
}
body.page-student .action-card { border-radius: 20px; }
body.page-student .action-card h3 { font-weight: 400; font-size: 20px; }
.tc-head button { border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }

.tc-tbl .go .gap { display: inline-block; background: #FFF1D6; color: #9A5B00; border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; margin-right: 2px; }
.tc-tbl .go .pt { display: inline-block; background: var(--brand-soft); color: var(--brand); border-radius: 6px; padding: 1px 7px; font-size: 12px; font-weight: 700; }

/* ---- 학생 주간 시간표: 크레파스 블록 ---- */
body.page-student .app { max-width: 760px; }
.wk-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.wk-h { text-align: center; font-family: var(--font-head); font-size: 20px; padding: 4px 0 6px; color: var(--ink); }
.wk-h.today { color: var(--brand); }
.wk-h small { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 800; }
.wk-c { min-height: 92px; border-radius: 14px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; background: #F4F8FC; color: var(--ink-soft); }
.wk-c .tm { font-size: 12.5px; font-weight: 800; opacity: .85; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-c .s { font-family: var(--font-head); font-size: 19px; line-height: 1.15; word-break: keep-all; overflow-wrap: anywhere; }
.wk-c .pt { font-size: 16px; font-weight: 800; padding: 2px 14px; border-radius: 999px; background: rgba(255, 255, 255, .8); }
.wk-c .r { font-size: 12.5px; font-weight: 700; opacity: .85; }
.wk-c.e .tm, .wk-c.e .pt { opacity: .5; }
.wk-c.e .pt { background: transparent; }
.wk-c.none { background: repeating-linear-gradient(45deg, #F3F7FB, #F3F7FB 6px, #E9F0F6 6px, #E9F0F6 12px); min-height: 48px; }
.wk-c.today { outline: 3px solid var(--brand); outline-offset: -3px; }
.wk-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-chip { font-size: 13px; font-weight: 800; padding: 4px 11px; border-radius: 999px; }
@media (max-width: 520px) {
  .wk-c { min-height: 84px; padding: 6px 2px; }
  .wk-c .s { font-size: 15px; } .wk-c .tm { font-size: 12px; } .wk-c .tm .t2 { display: none; } .wk-c .pt { font-size: 13px; padding: 1px 9px; } .wk-c .r { font-size: 11px; }
}

/* ---- 설문용 시연판 ---- */
.demo-chip { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #FFF1D6; color: #9A5B00; font-family: var(--font-body); }
.demo-note { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin: 4px 2px 0; }
.demo-reset { align-self: flex-start; border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.tc-pick { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tc-pick-btn { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; border: 1px solid var(--border); background: var(--surface); color: var(--ink); border-radius: 12px; padding: 12px 14px; font: inherit; cursor: pointer; }
.tc-pick-btn b { font-size: 15.5px; white-space: nowrap; }
.tc-pick-btn span { font-size: 13px; color: var(--ink-soft); text-align: right; }
.tc-pick-btn:hover { border-color: var(--brand); }
body.page-teacher .tc-login { max-width: 420px; }
.demo-notice { display: flex; flex-direction: column; gap: 4px; background: #FFF6E0; border: 1px solid #F3DDA6; color: #6B4A00; border-radius: 14px; padding: 14px 16px; margin-bottom: 4px; }
.demo-notice b { font-size: 15px; }
.demo-notice span { font-size: 13.5px; line-height: 1.6; }

#tt-banner{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);background:#1F2A24;color:#fff;padding:10px 16px;border-radius:12px;font-size:14px;z-index:50}
.tt-row.leave .period-chip{background:#FDE7D3;color:#9A4A12}
.tt-row.leave .time{font-weight:700}
.tc-go{padding:12px;font-size:16px;border:0;border-radius:10px;background:var(--brand);color:#fff;font-weight:700;cursor:pointer}
.tc-go:disabled{opacity:.6}
.tc-err{color:#B42318;font-size:14px;min-height:20px}
