@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

/* 글꼴: Pretendard(한글 UI에 많이 쓰는 글꼴)를 쓰고, 못 불러오면 기기 기본 글꼴 */
:root, body, button, input, select, textarea {
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

/* =====================================================================
   style.css  —  화면별·부품별 스타일 (UI/CSS 담당)
   common.css(변수·헤더·탭 바·버튼) 다음에 불러옵니다.
   ※ 맨 아래 "JS 담당 참고"에 JS가 붙여 줄 클래스 이름을 적어 두었습니다.
   ===================================================================== */

/* ---------- 제목·설명 ---------- */
.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.section-description {
  margin-top: 4px;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* 한 화면 안의 덩어리(섹션)들: 제목 아래 내용이 세로로 쌓임 */
.main-content > section,
.preview-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- 상태 안내 글 (로딩 중·실패·없음 등을 알려주는 줄) ---------- */
.list-status, .result-status, .search-status, .schedule-status,
.favorite-status, .theme-status, .destination-status {
  padding: 10px 12px;
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  background: var(--color-primary-soft);
  color: var(--color-text);
  font-size: 13px;
}

/* ---------- '화면 이동 확인용' 임시 안내 (개발 끝나면 HTML에서 지우면 됨) ---------- */
.preview-notice {
  color: var(--color-text-muted);
  font-size: 12px;
}
.preview-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  padding: 0 14px;
  border: 1.5px dashed var(--color-input-border);
  border-radius: var(--radius-input);
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}
.preview-card { opacity: 0.92; }

.result-status:empty, .section-description:empty, .favorite-status:empty,
.map-status:empty, .map-notice:empty { display: none; }

/* ---------- 카드 · 정보 줄 (강의실 카드에서 가장 많이 씀) ---------- */
.classroom-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--color-card-border);
  border-left: 5px solid var(--color-input-border);   /* 왼쪽 띠: 상태에 따라 색이 바뀜 */
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: 0 2px 8px var(--color-shadow);
}
.classroom-card:has(.is-available)   { border-left-color: var(--color-available); }
.classroom-card:has(.is-unavailable) { border-left-color: var(--color-unavailable); }

.classroom-card .classroom-name,
h3.classroom-name {
  font-size: 18px;
  font-weight: 800;
}

.classroom-info,
.building-summary,
.route-summary,
.route-metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.info-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.info-label {
  flex: none;
  color: var(--color-text-muted);
  font-size: 13px;
}
.info-value {
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}

/* 건물 요약·길찾기 요약은 흰 카드 안에 */
.building-summary,
.route-summary {
  padding: 14px 16px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
/* 예상 거리·소요시간은 나란한 두 칸 */
.route-metrics { flex-direction: row; gap: 10px; }
.route-metrics .info-item {
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: var(--radius-card);
  background: var(--color-primary-soft);
  text-align: center;
}
.route-metrics .info-value { font-size: 18px; text-align: center; }

/* 목록들 */
.classroom-list,
.classroom-name-list,
.building-list,
.favorites-shortcut-list { display: flex; flex-direction: column; gap: 12px; }

/* 같은 층 강의실 이름: 칩 모양으로 줄바꿈하며 나열 */
.classroom-name-list { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.classroom-select-button {
  min-height: var(--touch-min);
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--color-chip-bg);
  font-size: 14px;
}
.classroom-select-button[aria-pressed="true"],
.classroom-select-button.is-selected { background: var(--color-primary); color: var(--color-primary-text); }

/* 즐겨찾기 표시 */
.favorite-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 700;
}
.favorite-button { flex: 1; }
.classroom-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.classroom-actions .button { flex: 1 1 140px; }

/* 상세 화면으로 가는 링크: 오른쪽 화살표 */
.classroom-detail-link,
.search-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--touch-min);
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}
.classroom-detail-link::after,
.search-link::after { content: "›"; margin-left: 6px; font-size: 20px; line-height: 1; }

/* ---------- 사용 가능 / 사용 불가 표시 (알약 모양) ---------- */
.classroom-availability.is-available,
.classroom-availability.is-unavailable {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}
.classroom-availability.is-available   { background: var(--color-available-bg);   color: var(--color-available); }
.classroom-availability.is-unavailable { background: var(--color-unavailable-bg); color: var(--color-unavailable); }

/* ---------- 홈(지도) 화면 ---------- */
.map-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: var(--color-map-grass);
  overflow: hidden;
  position: relative;
}
.map-container .empty-message { color: var(--color-text); opacity: 0.7; }

/* Leaflet 지도 내부 레이어가 하단 메뉴 위로 올라오지 않도록 범위를 제한합니다. */
.page-home #campus-map {
  display: block;
  isolation: isolate;
  /* 실제 캠퍼스 이미지 뒤에 임시 지도 배경이 겹치지 않도록 합니다. */
  background: var(--color-surface);
}
.campus-building-area { cursor: pointer; }
.campus-building-area:focus-visible {
  outline: none;
  stroke: var(--color-primary);
  stroke-width: 2px;
}
.campus-building-label,
.campus-building-popup .leaflet-popup-content-wrapper,
.campus-building-popup .leaflet-popup-tip {
  background: var(--color-surface);
  color: var(--color-text);
}
.campus-building-label { border-color: var(--color-card-border); }
.campus-building-label.leaflet-tooltip-top::before { border-top-color: var(--color-surface); }
.campus-building-label.leaflet-tooltip-bottom::before { border-bottom-color: var(--color-surface); }
.campus-building-popup .leaflet-popup-content { margin: 12px 18px; }
.campus-building-popup .campus-building-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  color: var(--color-primary);
}

.favorite-shortcut-link,
.building-list a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: var(--touch-min);
  padding: 14px 16px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}
.favorite-building { color: var(--color-text-muted); font-size: 13px; }
.favorite-shortcut-link .classroom-name { font-size: 17px; font-weight: 800; }
.classroom-availability { font-size: 13px; }

.building-list a {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.building-list a::after { content: "›"; color: var(--color-text-muted); font-size: 22px; }

.usage-section {
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--color-primary-soft);
}
.usage-section .section-title { font-size: 14px; }
.usage-notice { color: var(--color-text-muted); font-size: 13px; }

/* ---------- 홈(메인) 화면: 들어가면 지도가 화면을 꽉 채우고, 즐겨찾기·건물 목록은 아래로 스크롤해서 봅니다 ----------
   HTML에는 즐겨찾기가 위에 있지만, CSS의 order로 지도를 맨 위로 올렸습니다(HTML은 그대로). */
.page-home .main-content { gap: 24px; padding-top: 8px; }
.page-home .map-section {
  order: -1;                           /* 지도 영역을 맨 위로 */
  /* 화면 높이 - 상단 제목 줄 - 하단 탭 바 = 지도가 보이는 영역 */
  min-height: calc(100vh - 64px - var(--tab-bar-height) - env(safe-area-inset-bottom, 0px) - 8px);
  min-height: calc(100dvh - 64px - var(--tab-bar-height) - env(safe-area-inset-bottom, 0px) - 8px);
}
.page-home .map-section .map-container { flex: 1; min-height: 360px; }
.page-home .map-section .section-title { font-size: 16px; }
.page-home .map-section .section-description { margin-top: 0; font-size: 13px; }
.page-home .site-header { padding-bottom: 8px; }
.page-home .site-header .site-title { font-size: 18px; }
.page-home .main-nav { /* 홈에서도 하단 탭은 그대로 */ }

/* ---------- 검색 · 길찾기 입력 화면 ---------- */
.search-mode-list,
.section-nav-list { display: flex; gap: 8px; }
.search-mode-list li,
.section-nav-list li { flex: 1; }
.search-mode-link,
.section-nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  border-radius: 999px;
  background: var(--color-chip-bg);
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
}
.search-mode-link:hover, .section-nav-link:hover { background: var(--color-primary-soft); color: var(--color-primary); }

.search-form { display: flex; flex-direction: column; gap: 14px; }
.form-fieldset {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.form-legend { padding: 0 6px; font-size: 14px; font-weight: 800; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 14px; font-weight: 700; }
.form-actions { display: flex; }
.form-actions .button { flex: 1; }

/* ---------- 표(시간표) ---------- */
.table-container {
  overflow-x: auto;                    /* 칸이 많아 좁은 화면에선 옆으로 밀어서 봅니다 */
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  -webkit-overflow-scrolling: touch;
}
.schedule-table { width: 100%; min-width: 420px; font-size: 13px; }
.schedule-table th {
  padding: 10px 10px;
  background: var(--color-table-head-bg);
  color: var(--color-table-head-text);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}
.schedule-table td { padding: 12px 10px; border-top: 1px solid var(--color-line); vertical-align: top; }
.timetable-section .schedule-table { min-width: 560px; }   /* 6칸짜리 개인 시간표 */
.timetable-actions { display: flex; }
.timetable-actions .button { flex: 1; }

/* ---------- 설정 화면 ---------- */
.theme-options { gap: 6px; }
.theme-option {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: var(--touch-min);
}
.form-radio { width: 22px; height: 22px; accent-color: var(--color-primary); }
.theme-option .form-label { flex: 1; padding: 10px 0; }

/* ---------- 길찾기 결과 ---------- */
.route-path {
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.route-map-section .map-container { min-height: 240px; }
/* 건물 정보가 유효하지 않을 때는 공통 링크 display 스타일보다 hidden을 우선합니다. */
#route-destination-building-link[hidden] { display: none; }
.page-route-result #route-map {
  display: block;
  width: 100%;
  height: clamp(320px, 55vh, 480px);
  isolation: isolate;
  background: var(--color-surface);
}
.page-route-result #route-map > .empty-message { padding: 20px; text-align: center; }

/* ---------- 시작(로딩) 화면: 파란 그라데이션 바탕 가운데에 이름 ---------- */
.page-loading { padding-bottom: 0; }
.page-loading .main-content { padding: 0; }
.page-loading {
  background: linear-gradient(170deg, var(--color-splash-from), var(--color-splash-to));
  background-attachment: fixed;
}
.loading-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 32px;
  color: #ffffff;
  text-align: center;
}
.loading-section::before {             /* 흰 둥근 아이콘 칸 */
  content: "";
  width: 92px; height: 92px;
  margin-bottom: 10px;
  border-radius: 26px;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V9.5L12 4l8 5.5V20'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3Cpath d='M12 4v3'/%3E%3C/svg%3E");
  background-size: 56px;
  background-position: center;
  background-repeat: no-repeat;
}
.loading-section .site-title { font-size: 24px; color: #ffffff; }
.loading-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  font-size: 14px;
  opacity: 0.92;
}
.loading-status::before {              /* 빙글빙글 도는 표시 */
  content: "";
  width: 28px; height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
.loading-notice { color: #ffffff; font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .loading-status::before { animation: none; }
}

/* =====================================================================
   JS 담당 참고
   - 강의실 사용 가능 여부 글자(.classroom-availability)에 JS가 아래 클래스를 붙이면 색과 카드 왼쪽 띠가 자동으로 바뀝니다.
       사용 가능 → class="is-available"     사용 불가 → class="is-unavailable"
   - 다크 모드 토글을 만들면 <html data-theme="dark"> 또는 data-theme="light"를 붙이면 됩니다(없으면 기기 설정을 따라감).
   - 선택된 같은 층 강의실 버튼에는 .is-selected 또는 aria-pressed="true"를 붙이세요.
   ===================================================================== */

/* ---------- 요일 칩 (월 화 수 목 금) ----------
   HTML에서 요일 선택을 <select> 대신 아래 모양(라디오 버튼 + 라벨)으로 바꾸면 시안처럼 칩으로 보입니다.
   <div class="day-chips" role="radiogroup" aria-label="요일">
     <input class="day-chip-input" type="radio" id="time-weekday-mon" name="weekday" value="mon">
     <label class="day-chip" for="time-weekday-mon">월</label>
     ... (화 tue, 수 wed, 목 thu, 금 fri)
   </div> */
.day-chips { display: flex; gap: 8px; }
.day-chip-input {                      /* 동그란 라디오 버튼은 화면에서 숨기고, 라벨을 칩으로 씁니다 */
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}
.day-chip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1.5px solid var(--color-input-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.day-chip-input:checked + .day-chip {  /* 선택된 요일: 파란 칩 */
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: var(--color-primary-text);
}
.day-chip-input:focus-visible + .day-chip { outline: 3px solid var(--color-primary); outline-offset: 2px; }


/* =====================================================================
   2차 보정: 지도 영역 그림 · 검색 방식 선택 줄 · 개발용 안내 정리
   ===================================================================== */

/* 지도 영역: 아직 지도 구현 전이라, 시안의 캠퍼스 배치 그림을 배경으로 깔아 둡니다.
   (지도를 구현하면 .map-container 안에 건물 버튼을 올리면 되고, 이 배경은 그대로 쓰거나 교체하세요.) */
.map-container {
  background-color: var(--color-map-grass);
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 440 760%22 preserveAspectRatio=%22xMidYMid slice%22 aria-hidden=%22true%22%3E %3Crect width=%22440%22 height=%22760%22 fill=%22%23c9e5bd%22/%3E  %3Cellipse cx=%2246%22 cy=%22395%22 rx=%2240%22 ry=%2234%22 fill=%22%23bfe0ff%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E  %3Cpath d=%22M80 170 H318 Q335 170 335 187 V348 Q335 365 318 365 H82 Q65 365 65 348 V187 Q65 170 80 170 Z%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M200 365 C 205 480 150 600 40 745%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M65 280 C 40 400 30 560 40 745%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M335 290 C 380 300 410 320 440 330%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M200 170 V 165%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M150 60 C 120 100 100 140 80 170%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M80 170 H318 Q335 170 335 187 V348 Q335 365 318 365 H82 Q65 365 65 348 V187 Q65 170 80 170 Z%22 fill=%22none%22 stroke=%22%23cdd5e2%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M200 365 C 205 480 150 600 40 745%22 fill=%22none%22 stroke=%22%23cdd5e2%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M65 280 C 40 400 30 560 40 745%22 fill=%22none%22 stroke=%22%23cdd5e2%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M335 290 C 380 300 410 320 440 330%22 fill=%22none%22 stroke=%22%23cdd5e2%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M200 170 V 165%22 fill=%22none%22 stroke=%22%23cdd5e2%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M150 60 C 120 100 100 140 80 170%22 fill=%22none%22 stroke=%22%23cdd5e2%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E  %3Crect x=%2295%22 y=%22185%22 width=%22205%22 height=%22150%22 rx=%2212%22 fill=%22%23f3ecd2%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E  %3Crect x=%22355%22 y=%22190%22 width=%2252%22 height=%2256%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%22355%22 y=%22262%22 width=%2252%22 height=%2250%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%22370%22 y=%22440%22 width=%2250%22 height=%2260%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%22150%22 y=%22600%22 width=%2250%22 height=%2244%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%2285%22 y=%22430%22 width=%2246%22 height=%2250%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%2220%22 y=%22185%22 width=%2234%22 height=%2256%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%2295%22 y=%2270%22 width=%2240%22 height=%2244%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%22360%22 y=%2270%22 width=%2244%22 height=%2250%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Crect x=%22300%22 y=%22470%22 width=%2240%22 height=%2240%22 rx=%226%22 fill=%22%23e7eaf0%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E  %3Cellipse cx=%22250%22 cy=%2295%22 rx=%22100%22 ry=%2272%22 fill=%22%23cfd4dc%22 stroke=%22%23c9d0dc%22 stroke-width=%221.5%22/%3E %3Cellipse cx=%22250%22 cy=%2295%22 rx=%2276%22 ry=%2250%22 fill=%22%23d5e8d0%22 stroke=%22%237a9a74%22 stroke-width=%221.5%22 stroke-dasharray=%226 5%22/%3E %3Cpath d=%22M250 45 V145%22 stroke=%22%237a9a74%22 stroke-width=%221.5%22/%3E %3Ctext x=%22250%22 y=%22100%22 text-anchor=%22middle%22 font-size=%2215%22 font-weight=%22800%22 fill=%22%234b5d49%22%3E%EB%8C%80%EC%9A%B4%EB%8F%99%EC%9E%A5%3C/text%3E  %3Ccircle cx=%2230%22 cy=%2290%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%2240%22 cy=%22690%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22120%22 cy=%22700%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22190%22 cy=%22640%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22270%22 cy=%22610%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22380%22 cy=%22400%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22405%22 cy=%22210%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22400%22 cy=%22640%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%2225%22 cy=%22300%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22130%22 cy=%22470%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22300%22 cy=%22690%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3Ccircle cx=%22400%22 cy=%22120%22 r=%227%22 fill=%22%23b9d8b0%22/%3E %3C/svg%3E");
  background-size: cover;
  background-position: center;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map-container { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 440 760%22 preserveAspectRatio=%22xMidYMid slice%22 aria-hidden=%22true%22%3E %3Crect width=%22440%22 height=%22760%22 fill=%22%2326382b%22/%3E  %3Cellipse cx=%2246%22 cy=%22395%22 rx=%2240%22 ry=%2234%22 fill=%22%231f3b5c%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E  %3Cpath d=%22M80 170 H318 Q335 170 335 187 V348 Q335 365 318 365 H82 Q65 365 65 348 V187 Q65 170 80 170 Z%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M200 365 C 205 480 150 600 40 745%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M65 280 C 40 400 30 560 40 745%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M335 290 C 380 300 410 320 440 330%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M200 170 V 165%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M150 60 C 120 100 100 140 80 170%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M80 170 H318 Q335 170 335 187 V348 Q335 365 318 365 H82 Q65 365 65 348 V187 Q65 170 80 170 Z%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M200 365 C 205 480 150 600 40 745%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M65 280 C 40 400 30 560 40 745%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M335 290 C 380 300 410 320 440 330%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M200 170 V 165%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M150 60 C 120 100 100 140 80 170%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E  %3Crect x=%2295%22 y=%22185%22 width=%22205%22 height=%22150%22 rx=%2212%22 fill=%22%233a3a30%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E  %3Crect x=%22355%22 y=%22190%22 width=%2252%22 height=%2256%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22355%22 y=%22262%22 width=%2252%22 height=%2250%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22370%22 y=%22440%22 width=%2250%22 height=%2260%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22150%22 y=%22600%22 width=%2250%22 height=%2244%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%2285%22 y=%22430%22 width=%2246%22 height=%2250%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%2220%22 y=%22185%22 width=%2234%22 height=%2256%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%2295%22 y=%2270%22 width=%2240%22 height=%2244%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22360%22 y=%2270%22 width=%2244%22 height=%2250%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22300%22 y=%22470%22 width=%2240%22 height=%2240%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E  %3Cellipse cx=%22250%22 cy=%2295%22 rx=%22100%22 ry=%2272%22 fill=%22%234a5058%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Cellipse cx=%22250%22 cy=%2295%22 rx=%2276%22 ry=%2250%22 fill=%22%232a3b2e%22 stroke=%22%236a8a70%22 stroke-width=%221.5%22 stroke-dasharray=%226 5%22/%3E %3Cpath d=%22M250 45 V145%22 stroke=%22%236a8a70%22 stroke-width=%221.5%22/%3E %3Ctext x=%22250%22 y=%22100%22 text-anchor=%22middle%22 font-size=%2215%22 font-weight=%22800%22 fill=%22%23b4c7b6%22%3E%EB%8C%80%EC%9A%B4%EB%8F%99%EC%9E%A5%3C/text%3E  %3Ccircle cx=%2230%22 cy=%2290%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%2240%22 cy=%22690%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22120%22 cy=%22700%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22190%22 cy=%22640%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22270%22 cy=%22610%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22380%22 cy=%22400%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22405%22 cy=%22210%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22400%22 cy=%22640%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%2225%22 cy=%22300%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22130%22 cy=%22470%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22300%22 cy=%22690%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22400%22 cy=%22120%22 r=%227%22 fill=%22%232f4a35%22/%3E %3C/svg%3E"); }
}
:root[data-theme="dark"] .map-container { background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 440 760%22 preserveAspectRatio=%22xMidYMid slice%22 aria-hidden=%22true%22%3E %3Crect width=%22440%22 height=%22760%22 fill=%22%2326382b%22/%3E  %3Cellipse cx=%2246%22 cy=%22395%22 rx=%2240%22 ry=%2234%22 fill=%22%231f3b5c%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E  %3Cpath d=%22M80 170 H318 Q335 170 335 187 V348 Q335 365 318 365 H82 Q65 365 65 348 V187 Q65 170 80 170 Z%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M200 365 C 205 480 150 600 40 745%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M65 280 C 40 400 30 560 40 745%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M335 290 C 380 300 410 320 440 330%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M200 170 V 165%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M150 60 C 120 100 100 140 80 170%22 fill=%22none%22 stroke=%22%233d4a40%22 stroke-width=%2224%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22/%3E %3Cpath d=%22M80 170 H318 Q335 170 335 187 V348 Q335 365 318 365 H82 Q65 365 65 348 V187 Q65 170 80 170 Z%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M200 365 C 205 480 150 600 40 745%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M65 280 C 40 400 30 560 40 745%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M335 290 C 380 300 410 320 440 330%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M200 170 V 165%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E %3Cpath d=%22M150 60 C 120 100 100 140 80 170%22 fill=%22none%22 stroke=%22%235c6c60%22 stroke-width=%222%22 stroke-dasharray=%228 8%22 stroke-linecap=%22round%22/%3E  %3Crect x=%2295%22 y=%22185%22 width=%22205%22 height=%22150%22 rx=%2212%22 fill=%22%233a3a30%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E  %3Crect x=%22355%22 y=%22190%22 width=%2252%22 height=%2256%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22355%22 y=%22262%22 width=%2252%22 height=%2250%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22370%22 y=%22440%22 width=%2250%22 height=%2260%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22150%22 y=%22600%22 width=%2250%22 height=%2244%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%2285%22 y=%22430%22 width=%2246%22 height=%2250%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%2220%22 y=%22185%22 width=%2234%22 height=%2256%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%2295%22 y=%2270%22 width=%2240%22 height=%2244%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22360%22 y=%2270%22 width=%2244%22 height=%2250%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Crect x=%22300%22 y=%22470%22 width=%2240%22 height=%2240%22 rx=%226%22 fill=%22%232a2f38%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E  %3Cellipse cx=%22250%22 cy=%2295%22 rx=%22100%22 ry=%2272%22 fill=%22%234a5058%22 stroke=%22%23444c5a%22 stroke-width=%221.5%22/%3E %3Cellipse cx=%22250%22 cy=%2295%22 rx=%2276%22 ry=%2250%22 fill=%22%232a3b2e%22 stroke=%22%236a8a70%22 stroke-width=%221.5%22 stroke-dasharray=%226 5%22/%3E %3Cpath d=%22M250 45 V145%22 stroke=%22%236a8a70%22 stroke-width=%221.5%22/%3E %3Ctext x=%22250%22 y=%22100%22 text-anchor=%22middle%22 font-size=%2215%22 font-weight=%22800%22 fill=%22%23b4c7b6%22%3E%EB%8C%80%EC%9A%B4%EB%8F%99%EC%9E%A5%3C/text%3E  %3Ccircle cx=%2230%22 cy=%2290%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%2240%22 cy=%22690%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22120%22 cy=%22700%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22190%22 cy=%22640%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22270%22 cy=%22610%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22380%22 cy=%22400%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22405%22 cy=%22210%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22400%22 cy=%22640%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%2225%22 cy=%22300%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22130%22 cy=%22470%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22300%22 cy=%22690%22 r=%227%22 fill=%22%232f4a35%22/%3E %3Ccircle cx=%22400%22 cy=%22120%22 r=%227%22 fill=%22%232f4a35%22/%3E %3C/svg%3E"); }

/* 지도 위 '준비 중' 글자는 아래쪽 작은 알약으로 */
.map-container { align-items: flex-end; }
.map-container .empty-message {
  margin: 0 0 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 13px;
  opacity: 0.95;
  box-shadow: 0 2px 8px var(--color-shadow);
}

/* 검색 방식(시간별/강의실별) 선택 줄: 시안처럼 회색 바 안에 나란히 */
.search-mode-list,
.section-nav-list {
  padding: 4px;
  gap: 4px;
  border-radius: 999px;
  background: var(--color-chip-bg);
}
.search-mode-link,
.section-nav-link { background: transparent; }
.search-mode-link:hover, .section-nav-link:hover { background: var(--color-surface); color: var(--color-primary); }

/* 개발 단계 안내 문구('현재는 HTML 기본 구조를 작성하는 단계입니다')는 화면에서 숨김 */
.preview-notice { display: none; }

/* =====================================================================
   3차 다듬기 (시안에 더 가깝게)
   ===================================================================== */

/* '준비 중입니다' 같은 상태 안내: 파란 상자 대신 조용한 보조 글자로(시안은 안내 상자가 거의 없음).
   JS가 오류를 알릴 때는 클래스 is-error를 붙이면 빨간 상자로 눈에 띄게 보입니다. */
.list-status, .result-status, .search-status, .schedule-status,
.favorite-status, .theme-status, .destination-status {
  padding: 0 2px;
  border-left: 0;
  border-radius: 0;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
}
.list-status.is-error, .result-status.is-error, .search-status.is-error, .schedule-status.is-error,
.favorite-status.is-error, .theme-status.is-error, .destination-status.is-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-unavailable-bg);
  color: var(--color-unavailable);
  font-weight: 700;
}

/* 검색 조건 카드: 시작 교시 / 종료 교시를 시안처럼 나란히(2칸), 나머지는 한 줄씩 */
.search-form .form-fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}
.search-form .form-fieldset > * { grid-column: 1 / -1; }
.search-form .form-fieldset > .form-field:has([name="start-period"]),
.search-form .form-fieldset > .form-field:has([name="end-period"]) { grid-column: auto; }

/* 설정 화면 테마 선택: 동그란 선택 표시를 앱 스타일로, 줄 사이에 구분선 */
.theme-options { gap: 0; }
.theme-option { padding: 2px 0; }
.theme-option + .theme-option { border-top: 1px solid var(--color-line); }
.form-radio {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 24px; height: 24px;
  margin: 0;
  border: 2px solid var(--color-input-border);
  border-radius: 50%;
  background: var(--color-surface);
}
.form-radio::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: scale(0);
  transition: transform 0.12s;
}
.form-radio:checked { border-color: var(--color-primary); }
.form-radio:checked::before { transform: scale(1); }
.form-radio:focus-visible { outline: 3px solid var(--color-primary-soft); outline-offset: 2px; }

/* 주요 버튼(파랑)에 은은한 그림자: 시안처럼 눌러지는 느낌 */
.search-button:not(:disabled),
.route-link,
.timetable-add-button:not(:disabled) { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }

/* 건물 요약 같은 정보 카드의 글자 정리 */
.page-title { font-size: 22px; }
.main-content > section > .section-title { margin-bottom: 0; }

/* =====================================================================
   4차: 두 영역을 한 화면에 쌓지 않고, 탭을 누르면 해당 영역만 보이게 (JS 없이 CSS만)
   - 검색: [시간별 검색] [강의실별 검색]   - 시간표 및 즐겨찾기: [시간표] [즐겨찾기]
   원리: 주소 끝의 #이름(탭 링크가 붙여 주는 값)을 CSS가 읽어서 보여줄 영역을 고릅니다.
   처음 들어오면 첫 번째 영역(시간별 검색 / 시간표)이 보입니다.
   ※ 나중에 JS로 탭 전환을 만들게 되면 이 블록을 지우면 됩니다.
   ===================================================================== */

/* 선택된 탭: 회색 바 안에서 흰 알약 + 파란 글자 */
.search-mode-link,
.section-nav-link { transition: background 0.12s, color 0.12s; }

.search-mode-list li:first-child .search-mode-link,
.section-nav-list li:first-child .section-nav-link {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: 0 1px 4px var(--color-shadow);
}

/* --- 검색 화면 --- */
.page-search .main-content > #classroom-search { display: none; }
.page-search .main-content:has(#classroom-search:target) > #classroom-search { display: flex; }
.page-search .main-content:has(#classroom-search:target) > #time-search { display: none; }
.page-search .main-content:has(#classroom-search:target) .search-mode-list li:first-child .search-mode-link {
  background: transparent; color: var(--color-text); box-shadow: none;
}
.page-search .main-content:has(#classroom-search:target) .search-mode-list li:last-child .search-mode-link {
  background: var(--color-surface); color: var(--color-primary); box-shadow: 0 1px 4px var(--color-shadow);
}

/* --- 시간표 및 즐겨찾기 화면 --- */
.page-timetable .main-content > #favorites-section { display: none; }
.page-timetable .main-content:has(#favorites-section:target) > #favorites-section { display: flex; }
.page-timetable .main-content:has(#favorites-section:target) > #timetable-section { display: none; }
.page-timetable .main-content:has(#favorites-section:target) .section-nav-list li:first-child .section-nav-link {
  background: transparent; color: var(--color-text); box-shadow: none;
}
.page-timetable .main-content:has(#favorites-section:target) .section-nav-list li:last-child .section-nav-link {
  background: var(--color-surface); color: var(--color-primary); box-shadow: 0 1px 4px var(--color-shadow);
}

/* 탭을 눌렀을 때 화면이 아래로 튀지 않도록 */
.search-section, #timetable-section, #favorites-section { scroll-margin-top: 200px; }

/* =====================================================================
   5차: 길찾기 입력 화면을 더 짧게 — 건물/강의실을 한 줄에 나란히(2칸)
   (출발지·목적지 입력이 한 화면에 들어오도록 세로 길이를 줄임)
   ===================================================================== */
.route-search-form .form-fieldset { gap: 12px 10px; }
.route-search-form .form-fieldset > .form-field { grid-column: auto; min-width: 0; }
.route-search-form .form-label { font-size: 13px; }
.route-search-form .form-select { padding-left: 12px; font-size: 15px; text-overflow: ellipsis; }
@supports (appearance: base-select) {
  .route-search-form .form-select { padding: 0 10px 0 12px; }
}
.route-search-form .form-select { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-search-form .form-select { min-height: 44px; height: 44px; }
.page-route .route-search-section > .section-description { margin-bottom: 0; }

/* =====================================================================
   6차: 표가 옆으로 잘리지 않고 화면 폭에 맞게 들어오도록
   ===================================================================== */
.schedule-table, .timetable-section .schedule-table { min-width: 0; table-layout: auto; font-size: 12px; }
.schedule-table th, .schedule-table td { padding: 10px 6px; word-break: keep-all; overflow-wrap: anywhere; }
.schedule-table th { white-space: nowrap; }

/* =====================================================================
   7차(수정): 길찾기 — 출발/도착이 한 장의 카드로 이어진 모양(시안 5-1)
   제목(출발지/목적지)은 카드 안쪽 위에 점+글자로, 가운데 구분선만 둡니다.
   ===================================================================== */
.page-route .route-search-section > .section-description { display: none; }
.page-route .route-search-section > .search-status { font-size: 12px; }

.route-search-form { display: flex; flex-direction: column; gap: 0; }
.route-search-form .form-fieldset {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  margin: 0;
  padding: 46px 16px 16px;            /* 위쪽은 제목 자리 */
  border: 1px solid var(--color-card-border, var(--color-line));
  background: var(--color-surface);
  box-shadow: none;
}
.route-search-form .form-fieldset:nth-of-type(1) { border-radius: 14px 14px 0 0; }
.route-search-form .form-fieldset:nth-of-type(2) { border-radius: 0 0 14px 14px; border-top: 0; }
.route-search-form .form-fieldset:nth-of-type(1) { border-bottom-color: var(--color-line); }

/* 제목: 테두리에 걸치지 않고 카드 안쪽 위에 */
.route-search-form .form-legend {
  position: absolute; top: 16px; left: 0;
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 0; background: none;
  font-size: 15px; font-weight: 800; color: var(--color-text);
}
.route-search-form .form-legend::before { content: ""; width: 12px; height: 12px; border-radius: 50%; }
.route-search-form .form-fieldset:nth-of-type(1) .form-legend::before { background: #16a34a; }
.route-search-form .form-fieldset:nth-of-type(2) .form-legend::before { background: #2563eb; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .route-search-form .form-fieldset:nth-of-type(1) .form-legend::before { background: #4ade80; }
  :root:not([data-theme="light"]) .route-search-form .form-fieldset:nth-of-type(2) .form-legend::before { background: #60a5fa; }
}
:root[data-theme="dark"] .route-search-form .form-fieldset:nth-of-type(1) .form-legend::before { background: #4ade80; }
:root[data-theme="dark"] .route-search-form .form-fieldset:nth-of-type(2) .form-legend::before { background: #60a5fa; }

.route-search-form .form-select { width: 100%; min-width: 0; }
.route-search-form .form-actions { margin-top: 16px; }
.route-search-form .form-actions .button {
  min-height: 52px; width: 100%; font-size: 16px; font-weight: 700; border-radius: 14px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .30);
}
.route-search-form .form-actions .button:disabled {
  background: var(--color-chip-bg, var(--color-primary-soft)); color: var(--color-text-muted);
  box-shadow: none; opacity: 1; border: 0;
}

/* 필수 표시: HTML에서 <span class="required" aria-label="필수">*</span> 로 쓰면 빨간 별표 */
.required { margin-left: 2px; color: #dc2626; font-weight: 800; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .required { color: #f87171; } }
:root[data-theme="dark"] .required { color: #f87171; }

/* =====================================================================
   8차: 건물별 강의실 현황 — 층별 칩 · 강의실 카드 · 사용 가능/불가(ON·OFF) 버튼
        + 즐겨찾기(시간표 화면 즐겨찾기 탭, 별 표시, 상세 화면 버튼)
   ===================================================================== */

/* ---- 층별 보기 칩 (건물 화면) ---- */
.floor-filter { min-width: 0; margin: 0; padding: 0; border: 0; }
.floor-filter .form-legend {
  padding: 0; margin-bottom: 8px;
  color: var(--color-text-muted); font-size: 13px; font-weight: 700;
}
/* 층 정보를 불러오는 중일 때만 안내 문구를 보여주고, 다 불러오면 숨깁니다 */
.floor-filter > .section-description { margin: 0 0 8px; font-size: 12px; }
.floor-filter:not(:disabled) > .section-description { display: none; }

.floor-chip-list {
  display: flex; flex-wrap: nowrap; gap: 8px;
  margin: 0 -20px; padding: 2px 20px 8px;       /* 화면 끝까지 밀어서 옆으로 넘기기 */
  overflow-x: auto;
  scrollbar-width: none;
}
.floor-chip-list::-webkit-scrollbar { display: none; }
.floor-chip { position: relative; flex: 0 0 auto; cursor: pointer; }
.floor-chip-input {                                /* 동그란 라디오는 숨기고 라벨을 칩으로 씁니다 */
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); opacity: 0;
}
.floor-chip-label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; min-height: 44px; padding: 0 18px;
  border: 1.5px solid var(--color-input-border);
  border-radius: 999px;
  background: var(--color-surface); color: var(--color-text);
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.floor-chip-input:checked + .floor-chip-label {    /* 선택된 층: 파란 칩 */
  border-color: var(--color-primary); background: var(--color-primary); color: var(--color-primary-text);
}
.floor-chip-input:focus-visible + .floor-chip-label { outline: 3px solid var(--color-primary); outline-offset: 2px; }
.floor-filter:disabled .floor-chip { opacity: .5; cursor: default; }

/* ---- 강의실 카드 (건물 화면): 이름 + 사용 가능/불가 버튼을 한 줄에 ---- */
.page-building {
  --on-bg: #15803d;  --on-text: #ffffff;       /* 사용 가능: 초록 */
  --off-bg: #b91c1c; --off-text: #ffffff;      /* 사용 불가: 빨강 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-building { --on-bg: #4ade80; --on-text: #052e16; --off-bg: #f87171; --off-text: #450a0a; }
}
:root[data-theme="dark"] .page-building { --on-bg: #4ade80; --on-text: #052e16; --off-bg: #f87171; --off-text: #450a0a; }

.page-building .classroom-card {
  display: grid; grid-template-columns: minmax(0, 1fr) fit-content(55%); column-gap: 12px; row-gap: 0; align-items: center;
}
.page-building .classroom-info,
.page-building .classroom-info .info-item { display: contents; }          /* 항목들을 카드 안에서 직접 배치 */
.page-building .classroom-info .info-label {                                /* 항목 이름은 화면에서만 숨김(읽어주기는 유지) */
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0);
}
.page-building .classroom-card .classroom-name { grid-column: 1; grid-row: 1; margin: 0; font-size: 18px; min-width: 0; overflow-wrap: anywhere; }
.page-building .classroom-card .classroom-name .classroom-detail-link {
  min-height: 0; color: var(--color-text); text-decoration: none;
}
.page-building .classroom-card .classroom-name .classroom-detail-link::after { content: none; }
.page-building .classroom-card .info-value.classroom-availability { grid-column: 2; grid-row: 1; justify-self: end; }
.page-building .classroom-card .favorite-badge { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin: 8px 0 0; }
.page-building .classroom-card .info-value.classroom-floor {
  grid-column: 1; grid-row: 3; justify-self: start; margin-top: 10px; padding: 2px 10px; border-radius: 999px;
  background: var(--color-chip-bg); color: var(--color-text-muted); font-size: 13px; font-weight: 700;
}
.page-building .classroom-card .info-value.classroom-next-class-time {
  grid-column: 2; grid-row: 3; min-width: 0; margin-top: 10px; color: var(--color-text-muted); font-size: 13px; font-weight: 500; text-align: right;
}
.page-building .classroom-card > .button.classroom-detail-link {
  grid-column: 1 / -1; grid-row: 4; justify-self: stretch; justify-content: center; margin-top: 12px;
}

/* ---- 사용 가능 / 사용 불가 : ON · OFF AIR 같은 버튼 ---- */
.classroom-availability.is-available,
.classroom-availability.is-unavailable,
.classroom-availability.is-unknown {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 11.5rem; padding: 6px 12px 6px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 800; line-height: 1.25; text-align: left;
}
.classroom-availability.is-available::before,
.classroom-availability.is-unavailable::before,
.classroom-availability.is-unknown::before {
  content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: currentColor;
}
.classroom-availability.is-available   { background: var(--on-bg, var(--color-available));        color: var(--on-text, #fff); }
.classroom-availability.is-unavailable { background: var(--off-bg, var(--color-unavailable));     color: var(--off-text, #fff); }
.classroom-availability.is-unknown     { background: var(--color-chip-bg); color: var(--color-text-muted); }
.classroom-availability.is-available::before   { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.classroom-availability.is-unavailable::before { box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
@media (prefers-reduced-motion: no-preference) {
  .classroom-availability.is-available::before { animation: wonway-on 1.8s ease-in-out infinite; }
}
@keyframes wonway-on { 50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, .08); } }

/* ---- 즐겨찾기 ---- */
.favorite-badge {                                  /* ★ 즐겨찾기 표시 (노란 알약) */
  background: #fef3c7; color: #92400e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .favorite-badge { background: #3a2a05; color: #fbbf24; }
}
:root[data-theme="dark"] .favorite-badge { background: #3a2a05; color: #fbbf24; }
.classroom-card:has(.favorite-badge) { box-shadow: 0 2px 8px var(--color-shadow), 0 0 0 1px rgba(245, 158, 11, .35); }

.favorites-list, #favorites-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.favorite-card {                                   /* 시간표 화면의 즐겨찾기 카드 */
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid var(--color-card-border); border-left: 5px solid #f59e0b;
  border-radius: var(--radius-card); background: var(--color-surface);
  box-shadow: 0 2px 8px var(--color-shadow); list-style: none;
}
.favorite-card > a {
  display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; min-height: var(--touch-min);
  color: var(--color-text); font-size: 17px; font-weight: 800; text-decoration: none;
}
.favorite-card > a::before { content: "★"; color: #f59e0b; font-size: 16px; }
.favorite-card > a::after { content: "›"; margin-left: 2px; color: var(--color-primary); font-size: 20px; line-height: 1; }
.favorite-card > p { margin: 0; color: var(--color-text-muted); font-size: 13px; }
.favorite-card > p:nth-of-type(1) { color: var(--color-text); font-weight: 700; }

/* 상세 화면·길찾기 결과 화면 즐겨찾기 버튼
   → 10차 아래쪽에서 "빈 별(☆) ↔ 채운 별(★)"로 바뀌도록 다시 정의했습니다. */


/* =====================================================================
   9차 (요청하신 3가지만)
   ① 메인 화면 건물 선택: 길게 나열 → 2열 칩 + 안에서 스크롤
   ② 선택 목록(요일 등)은 항상 아래로 펼쳐지게
   ③ 시간표 '강의 추가' 입력창 꾸미기
   ===================================================================== */

/* ① 메인 화면 건물 선택 ---------------------------------------------- */
.page-home .building-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  max-height: 296px; margin: 0; padding: 2px;           /* 약 4줄까지만 보이고 나머지는 안에서 넘겨 보기 */
  overflow-y: auto; overscroll-behavior: contain; list-style: none;
}
.page-home .building-item {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 64px; padding: 10px 12px;
  border: 1px solid var(--color-card-border); border-radius: var(--radius-card);
  background: var(--color-surface);
}
.page-home .building-item .building-link {              /* 글자 줄만이 아니라 칩 전체가 눌리게 */
  display: block; min-height: 0; padding: 0; border: 0; background: none;
  color: var(--color-text); font-size: 15px; font-weight: 800; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere;
}
.page-home .building-item .building-link::after { content: ""; position: absolute; inset: 0; margin: 0; }
.page-home .building-item .building-classroom-count { color: var(--color-text-muted); font-size: 12px; font-weight: 500; }
.page-home .building-item:has(.building-link:focus-visible) { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* ② 선택 목록은 항상 아래로 펼치기 (위로 뒤집히지 않게) ------------------ */
@supports (appearance: base-select) {
  .form-select::picker(select),
  .timetable-registration-form select::picker(select) {
    position-area: block-end span-inline-end;
    position-try-fallbacks: none;
    max-height: min(280px, 45dvh);
  }
}

/* ③ 시간표 '강의 추가' 입력창 -------------------------------------------- */
.timetable-registration-form:not([hidden]) {
  display: flex; flex-wrap: wrap; gap: 14px 12px;
  margin: 12px 0; padding: 16px;
  border: 1px solid var(--color-card-border); border-radius: var(--radius-card);
  background: var(--color-surface); box-shadow: 0 2px 8px var(--color-shadow);
}
.timetable-registration-form > label {
  display: flex; flex-direction: column; gap: 6px; flex: 1 1 100%; min-width: 0;
  color: var(--color-text); font-size: 14px; font-weight: 700;
}
.timetable-registration-form > label:nth-of-type(2),
.timetable-registration-form > label:nth-of-type(3) { flex: 1 1 calc(50% - 6px); }      /* 요일 · 교시는 나란히 */
.timetable-registration-form button {
  flex: 1 1 0; min-height: 48px; padding: 0 16px; border-radius: var(--radius-input);
  font-size: 16px; font-weight: 700; cursor: pointer;
}
.timetable-registration-form button[type="submit"] {
  flex-grow: 2; border: 1px solid var(--color-primary); background: var(--color-primary); color: var(--color-primary-text);
}
.timetable-registration-form button[type="button"] {
  border: 1.5px solid var(--color-input-border); background: var(--color-surface); color: var(--color-text);
}

.timetable-registration-form select,
.timetable-registration-form input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--color-input-border);
  border-radius: var(--radius-input);
  background-color: var(--color-surface);
  color: var(--color-text);
  font-size: 16px;                   /* 16px 미만이면 아이폰이 입력 때 화면을 확대합니다 */
}
.timetable-registration-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
}
.timetable-registration-form select:disabled,
.timetable-registration-form input:disabled { opacity: 0.6; }
.timetable-registration-form select:focus,
.timetable-registration-form input:focus { border-color: var(--color-primary); outline: 3px solid var(--color-primary-soft); outline-offset: 0; }


@supports (appearance: base-select) {
  .timetable-registration-form select,
  .timetable-registration-form select::picker(select) { appearance: base-select; }

  .timetable-registration-form select {
    background-image: none;            /* 기존 화살표 그림은 끄고 아래 ::picker-icon을 씁니다 */
    padding: 0 14px;
    display: flex;
    align-items: center;
  }
  .timetable-registration-form select::picker-icon {
    content: "";
    width: 18px; height: 18px;
    margin-left: auto;
    background: var(--color-text-muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.15s;
  }
  .timetable-registration-form select:open::picker-icon { transform: rotate(180deg); }

  /* 펼쳐진 목록 상자 */
  .timetable-registration-form select::picker(select) {
    margin-top: 6px;
    padding: 6px;
    width: anchor-size(width);         /* 선택칸과 같은 폭 */
    max-height: 280px;
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: 0 12px 28px var(--color-shadow);
  }

  /* 목록 한 줄 */
  .timetable-registration-form select option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--touch-min);
    padding: 0 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--color-text);
    font-size: 15px;
  }
  .timetable-registration-form select option:hover,
  .timetable-registration-form select option:focus-visible { background: var(--color-primary-soft); outline: none; }
  .timetable-registration-form select option:checked { color: var(--color-primary); font-weight: 800; }
  .timetable-registration-form select option::checkmark { content: "✓"; order: 1; margin-left: auto; color: var(--color-primary); }
  .timetable-registration-form select option:disabled { color: var(--color-text-muted); opacity: 0.6; }
}


/* ③-보정: '강의 추가' 버튼과 입력창이 세로로 쌓이게 (버튼이 옆으로 늘어나지 않게) */
.timetable-actions { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.timetable-actions > .timetable-add-button { width: 100%; }


/* =====================================================================
   10차: 요청 반영
   ① 시간표 '삭제' 버튼 → 작은 빨간 버튼
   ② 메인 '즐겨찾는 강의실': 즐겨찾기가 없으면 안내 한 줄로
   ③ 즐겨찾기 별: 등록 전 빈 별(☆) → 등록 후 노란 채운 별(★)
   ④ 마우스를 올리면(hover) / 누르면(active) 색이 진해지게 (모든 버튼·탭·칩·카드)
   ⑤ 길찾기 결과 '캠퍼스 이동 경로' 글씨·모양 정리
   ===================================================================== */

/* ---- 공통 색 약속: 파란색을 검정 쪽으로 조금(올리면) / 많이(누르면) 섞어 더 진하게 ---- */
:root {
  --color-primary-hover: color-mix(in srgb, var(--color-primary) 82%, #000);
  --color-primary-press: color-mix(in srgb, var(--color-primary) 66%, #000);
  --color-neutral-hover: color-mix(in srgb, var(--color-chip-bg) 88%, var(--color-text));
  --color-neutral-press: color-mix(in srgb, var(--color-chip-bg) 74%, var(--color-text));
  --color-danger: #dc2626;           /* 삭제 버튼 빨강 */
  --color-danger-text: #ffffff;
  --color-star: #f59e0b;             /* 즐겨찾기 별 노랑 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --color-danger: #f87171; --color-danger-text: #450a0a; }
}
:root[data-theme="dark"] { --color-danger: #f87171; --color-danger-text: #450a0a; }

/* ---- ① 시간표 '삭제' 버튼 ---- */
.schedule-table td button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; margin-left: 6px; padding: 0 10px;
  border: 0; border-radius: 8px;
  background: var(--color-danger); color: var(--color-danger-text);
  font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.schedule-table td button:hover  { background: color-mix(in srgb, var(--color-danger) 84%, #000); }
.schedule-table td button:active { background: color-mix(in srgb, var(--color-danger) 68%, #000); transform: scale(0.96); }

/* ---- ② 메인 '즐겨찾는 강의실': 즐겨찾기가 없을 때(목록이 비었을 때) 안내 한 줄만 ---- */
.page-home .home-favorites-section:has(#home-favorites-list:empty) { gap: 0; }
.page-home .home-favorites-section:has(#home-favorites-list:empty) > .section-title { display: none; }
.page-home .home-favorites-section:has(#home-favorites-list:empty) > #home-favorites-list { display: none; }
.page-home .home-favorites-section:has(#home-favorites-list:empty) > .home-favorites-status,
.page-home .home-favorites-section:has(#home-favorites-list:empty) > #home-favorites-status {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-input);
  background: var(--color-chip-bg); color: var(--color-text-muted);
  font-size: 13px; font-weight: 600;
}
.page-home .home-favorites-section:has(#home-favorites-list:empty) > #home-favorites-status::before {
  content: ""; flex: none; width: 16px; height: 16px;
  background: var(--color-star);
  -webkit-mask: var(--icon-star-outline) center / contain no-repeat;
          mask: var(--icon-star-outline) center / contain no-repeat;
}

/* ---- ③ 즐겨찾기 별: 별 그림(SVG)을 변수로 두고, 상태에 따라 바꿔 끼움 ---- */
:root {
  --icon-star-outline: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l2.9 5.9 6.5.95-4.7 4.6 1.1 6.5L12 17.7l-5.8 3.05 1.1-6.5-4.7-4.6 6.5-.95z'/%3E%3C/svg%3E");
  --icon-star-filled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l2.9 5.9 6.5.95-4.7 4.6 1.1 6.5L12 17.7l-5.8 3.05 1.1-6.5-4.7-4.6 6.5-.95z'/%3E%3C/svg%3E");
}
/* 상세 화면(#favorite-toggle-btn)·길찾기 결과(#route-favorite-toggle-btn)의 즐겨찾기 버튼.
   JS가 버튼에 aria-pressed="true"(등록됨) / "false"(미등록)를 붙여 줍니다. */
#favorite-toggle-btn::before,
#route-favorite-toggle-btn::before {
  content: ""; flex: none; width: 20px; height: 20px;
  background: var(--color-star);
  -webkit-mask: var(--icon-star-outline) center / contain no-repeat;
          mask: var(--icon-star-outline) center / contain no-repeat;
  transition: transform 0.15s;
}
#favorite-toggle-btn[aria-pressed="true"]::before,
#route-favorite-toggle-btn[aria-pressed="true"]::before {
  -webkit-mask-image: var(--icon-star-filled);
          mask-image: var(--icon-star-filled);
}
#favorite-toggle-btn:disabled::before,
#route-favorite-toggle-btn:disabled::before { background: currentColor; opacity: 0.5; }
/* 즐겨찾기 목록 카드의 별은 '등록된 것만' 모인 곳이라 항상 채운 별 */
.favorite-card > a::before {
  content: ""; width: 16px; height: 16px;
  background: var(--color-star);
  -webkit-mask: var(--icon-star-filled) center / contain no-repeat;
          mask: var(--icon-star-filled) center / contain no-repeat;
}

/* ---- ④ 마우스를 올리면 / 누르면 색이 진해지게 ---- */
/* (손가락 터치 화면에서 hover가 '눌린 채 남는' 일을 막으려고 hover는 마우스 기기에서만) */
.button, .classroom-select-button, .day-chip, .floor-chip, .back-link, .main-nav-link,
.search-mode-link, .section-nav-link, .timetable-registration-form button { cursor: pointer; }
.button:disabled, .timetable-registration-form button:disabled { cursor: not-allowed; }

/* 흰 버튼(강의실 즐겨찾기, 취소 등) */
@media (hover: hover) {
  .button:not(:disabled):not([aria-disabled="true"]):hover,
  .timetable-registration-form button[type="button"]:hover { background: var(--color-neutral-hover); }
}
.button:not(:disabled):not([aria-disabled="true"]):active,
.timetable-registration-form button[type="button"]:active { background: var(--color-neutral-press); }

/* 파란 버튼(검색·길찾기·강의 추가·등록) */
@media (hover: hover) {
  .search-button:not(:disabled):hover,
  .route-link:not([aria-disabled="true"]):hover,
  .timetable-add-button:not(:disabled):hover,
  .route-search-form .form-actions .button:not(:disabled):hover,
  .timetable-registration-form button[type="submit"]:hover {
    border-color: var(--color-primary-hover); background: var(--color-primary-hover);
  }
}
.search-button:not(:disabled):active,
.route-link:not([aria-disabled="true"]):active,
.timetable-add-button:not(:disabled):active,
.route-search-form .form-actions .button:not(:disabled):active,
.timetable-registration-form button[type="submit"]:active {
  border-color: var(--color-primary-press); background: var(--color-primary-press);
}
.button:not(:disabled):active, .timetable-registration-form button:active { transform: scale(0.98); }

/* 상단 '뒤로가기' · 하단 메뉴 탭 */
@media (hover: hover) {
  .back-link:hover { background: var(--color-neutral-hover); border-radius: 50%; }
  .main-nav-link:hover { background: var(--color-primary-soft); color: var(--color-primary); }
}
.back-link:active { background: var(--color-neutral-press); border-radius: 50%; }
.main-nav-link:active { background: var(--color-primary-soft); color: var(--color-primary-hover); }

/* 같은 층 강의실 칩 · 요일 칩 · 층 칩 */
@media (hover: hover) {
  .classroom-select-button:hover { background: var(--color-neutral-hover); }
  .classroom-select-button[aria-pressed="true"]:hover,
  .classroom-select-button.is-selected:hover { background: var(--color-primary-hover); }
  .day-chip:hover, .floor-chip-label:hover { border-color: var(--color-primary); background: var(--color-primary-soft); }
  .day-chip-input:checked + .day-chip:hover,
  .floor-chip-input:checked + .floor-chip-label:hover { border-color: var(--color-primary-hover); background: var(--color-primary-hover); }
}
.classroom-select-button:active { background: var(--color-neutral-press); }
.classroom-select-button[aria-pressed="true"]:active,
.classroom-select-button.is-selected:active { background: var(--color-primary-press); }
.day-chip:active, .floor-chip-label:active { border-color: var(--color-primary); background: var(--color-primary-soft); }
.day-chip-input:checked + .day-chip:active,
.floor-chip-input:checked + .floor-chip-label:active { border-color: var(--color-primary-press); background: var(--color-primary-press); }

/* 카드처럼 생긴 링크(메인 건물 칸, 즐겨찾기 바로가기, 즐겨찾기 카드) */
.page-home .building-item, .favorite-shortcut-link, .favorite-card, .building-list a {
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
@media (hover: hover) {
  .page-home .building-item:hover, .favorite-shortcut-link:hover, .favorite-card:hover, .building-list a:hover {
    border-color: var(--color-primary); background: var(--color-primary-soft);
  }
}
.page-home .building-item:active, .favorite-shortcut-link:active, .favorite-card:active, .building-list a:active {
  border-color: var(--color-primary); background: color-mix(in srgb, var(--color-primary-soft) 80%, var(--color-primary));
}

/* 글자 링크(상세 보기 ›, 시간표의 강의실명, 점선 미리보기 링크) */
@media (hover: hover) {
  .classroom-detail-link:hover, .search-link:hover { color: var(--color-primary-hover); text-decoration: underline; }
  .schedule-table td a:hover { color: var(--color-primary-hover); text-decoration: underline; }
  .preview-link:hover { background: var(--color-primary-soft); }
}
.classroom-detail-link:active, .search-link:active, .schedule-table td a:active { color: var(--color-primary-press); }

/* 설정 화면 테마 선택 줄 · 입력칸 */
@media (hover: hover) {
  .theme-option:hover { background: var(--color-primary-soft); }
  .form-select:not(:disabled):hover, .form-input:not(:disabled):hover,
  .timetable-registration-form select:not(:disabled):hover,
  .timetable-registration-form input:not(:disabled):hover {
    border-color: color-mix(in srgb, var(--color-input-border) 55%, var(--color-text));
  }
}

/* 위쪽 탭([시간별 검색][강의실별 검색] · [시간표][즐겨찾기]) ----------------
   예전에는 '선택 안 된 탭'에 마우스를 올려도 색이 안 바뀌는 곳이 있었습니다
   (4차의 탭 전환 규칙이 hover 규칙보다 우선순위가 높아서). 같은 우선순위로 hover를 다시 적었습니다. */
.search-mode-link:active, .section-nav-link:active { background: var(--color-primary-soft); color: var(--color-primary-hover); }
@media (hover: hover) {
  /* 처음 보이는 화면(첫 탭 선택됨) → 두 번째 탭이 '선택 안 된 탭' */
  .search-mode-list li:last-child .search-mode-link:hover,
  .section-nav-list li:last-child .section-nav-link:hover { background: var(--color-surface); color: var(--color-primary-hover); box-shadow: 0 1px 4px var(--color-shadow); }
  /* 두 번째 화면(#classroom-search / #favorites-section 이 열림) → 첫 번째 탭이 '선택 안 된 탭' */
  .page-search .main-content:has(#classroom-search:target) .search-mode-list li:first-child .search-mode-link:hover,
  .page-timetable .main-content:has(#favorites-section:target) .section-nav-list li:first-child .section-nav-link:hover {
    background: var(--color-surface); color: var(--color-primary-hover); box-shadow: 0 1px 4px var(--color-shadow);
  }
}
.page-search .main-content:has(#classroom-search:target) .search-mode-list li:first-child .search-mode-link:active,
.page-timetable .main-content:has(#favorites-section:target) .section-nav-list li:first-child .section-nav-link:active,
.search-mode-list li:last-child .search-mode-link:active,
.section-nav-list li:last-child .section-nav-link:active { background: var(--color-primary-soft); color: var(--color-primary-press); }

/* ---- ⑤ 길찾기 결과: 캠퍼스 이동 경로 (CSS만으로 글씨·상자 정리) ---- */
.route-path {
  display: flex; align-items: center; justify-content: center;
  min-height: 72px; padding: 16px 18px;
  border: 1px solid var(--color-card-border); border-radius: var(--radius-card);
  background: var(--color-primary-soft); color: var(--color-text);
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 17px; font-weight: 800; line-height: 1.6; letter-spacing: -0.01em;
  text-align: center; overflow-wrap: anywhere; word-break: keep-all;
}
.route-path .empty-message { color: var(--color-text-muted); font-size: 14px; font-weight: 600; }

/* ---- ⑥ 시작(로딩) 화면: 직접 만든 앱 아이콘(assets/icons/icon.svg) 사용 ---- */
.loading-section::before {
  background-color: transparent;
  background-image: url("../assets/icons/icon.svg");
  background-size: cover;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}


/* =====================================================================
   11차: 내 시간표를 눈에 잘 띄게 (.timetable-section 안의 표에만 적용 — 강의실 상세의 표는 그대로)
   ===================================================================== */
.timetable-section > .section-title { font-size: 20px; }
.timetable-section .table-container {
  border-color: color-mix(in srgb, var(--color-primary) 25%, var(--color-card-border));
  box-shadow: 0 4px 16px var(--color-shadow);
  overflow-x: auto;
}
.timetable-section .schedule-table { font-size: 13px; }

/* 머리줄: 연한 파랑 바탕 + 파란 글자 */
.timetable-section .schedule-table th {
  padding: 12px 6px;
  background: var(--color-primary-soft); color: var(--color-primary);
  font-size: 12px; font-weight: 800;
  border-bottom: 2px solid color-mix(in srgb, var(--color-primary) 35%, transparent);
}

/* 줄: 한 칸 건너 연한 배경(줄무늬) + 마우스 올리면 파랗게 */
.timetable-section .schedule-table td { padding: 14px 6px; vertical-align: middle; }
.timetable-section .schedule-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--color-chip-bg) 45%, var(--color-surface));
}
@media (hover: hover) {
  .timetable-section .schedule-table tbody tr:hover { background: var(--color-primary-soft); }
}

/* 칸마다 역할 구분: 요일·교시는 굵은 파랑/검정, 시간·건물은 연한 글자, 강의실은 링크, 강의명은 굵게 */
.timetable-section .schedule-table td:first-child:not([colspan]) {
  box-shadow: inset 4px 0 0 var(--color-primary);
  padding-left: 12px; color: var(--color-primary);
  font-size: 15px; font-weight: 800; white-space: nowrap;
}
.timetable-section .schedule-table td:nth-child(2) { font-weight: 800; white-space: nowrap; }
.timetable-section .schedule-table td:nth-child(3),
.timetable-section .schedule-table td:nth-child(4) { color: var(--color-text-muted); font-size: 12px; }
.timetable-section .schedule-table td:nth-child(5) a { font-weight: 800; text-decoration: none; }
.timetable-section .schedule-table td:nth-child(6) { font-weight: 800; }
/* 삭제 버튼은 강의명 아래 줄로 */
.timetable-section .schedule-table td:nth-child(6) button { display: flex; margin: 8px 0 0; }

/* 시간표가 비어 있을 때 한 줄 안내 */
.timetable-section .schedule-table td[colspan] {
  padding: 28px 12px; color: var(--color-text-muted); font-size: 14px; font-weight: 600; text-align: center;
}


/* =====================================================================
   12차: 눈에 더 잘 들어오게 (강약 주기)
   ① 섹션 제목 왼쪽 파란 막대  ③ 카드 깊이·이름 강조  ④ 안내 글 작고 연하게  ⑤ 중요한 버튼 하나만 크게
   ===================================================================== */

/* ① 섹션 제목: 왼쪽에 파란 세로 막대 */
.main-content .section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 800;
}
.main-content .section-title::before {
  content: ""; flex: none; width: 4px; height: 1.05em; border-radius: 3px;
  background: var(--color-primary);
}
.page-home .map-section .section-title { font-size: 17px; }

/* ④ 제목 아래 안내 글: 작고 연하게 */
.section-description {
  margin-top: 2px; padding-left: 12px;
  color: var(--color-text-muted); font-size: 12.5px; line-height: 1.5; opacity: 0.85;
}

/* ③ 카드: 그림자를 조금 진하게 + 이름은 크고 굵게, 부가 정보는 연하게 */
.classroom-card, .building-summary, .route-summary, .favorite-card,
.page-home .building-item, .favorite-shortcut-link, .form-fieldset, .table-container {
  box-shadow: 0 4px 14px var(--color-shadow);
}
.classroom-card:has(.favorite-badge) { box-shadow: 0 4px 14px var(--color-shadow), 0 0 0 1px rgba(245, 158, 11, .45); }
.classroom-card .classroom-name, h3.classroom-name,
.page-building .classroom-card .classroom-name { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.favorite-shortcut-link .classroom-name, .favorite-card > a { font-size: 18px; }
.page-home .building-item .building-link { font-size: 16px; }
.info-label, .favorite-building, .building-classroom-count, .favorite-card > p { color: var(--color-text-muted); }
.building-summary, .route-summary { border-left: 5px solid var(--color-primary); }

/* ⑤ 중요한 버튼(파랑) 하나만 크고 진하게, 나머지(흰 버튼)는 차분하게 */
.search-button, .route-link, .timetable-add-button {
  min-height: 52px; font-size: 16px; font-weight: 800;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}
.button:not(.search-button):not(.route-link):not(.timetable-add-button) {
  font-weight: 600; box-shadow: none;
}


/* =====================================================================
   13차: 메인 화면 왼쪽 위 'WON-WAY' 글자 → 가로 로고 (assets/icons/logo.svg · logo-dark.svg)
   글자(h1)는 화면 읽기용으로 남겨 두고 눈에는 로고만 보이게 합니다.
   ===================================================================== */
.page-home .site-header .site-title {
  width: 160px; height: 40px;
  font-size: 0; color: transparent; overflow: hidden;
  background: url("../assets/icons/logo.svg") left center / contain no-repeat;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-home .site-header .site-title { background-image: url("../assets/icons/logo-dark.svg"); }
}
:root[data-theme="dark"] .page-home .site-header .site-title { background-image: url("../assets/icons/logo-dark.svg"); }


/* =====================================================================
   12차: 달력형 주간 시간표 (.weekly-timetable) — 시안의 '요일 머리글 + 교시 칸 + 색 있는 수업 블록'
   · 시간표 영역(.timetable-section)의 주간 표와 '등록된 강의 목록'만 건드립니다.
   · 수업 블록 색은 '요일 열'마다 정해집니다(월 파랑·화 초록·수 보라·목 주황·금 파랑).
     (CSS는 강의를 구분할 수 없어서입니다. 강의마다 색을 다르게 하려면 JS가 클래스를 붙여야 합니다.)
   ===================================================================== */
:root {
  --tt-blue-bg: #dbeafe;   --tt-blue-text: #1e3a8a;
  --tt-green-bg: #dcfce7;  --tt-green-text: #166534;
  --tt-purple-bg: #ede9fe; --tt-purple-text: #5b21b6;
  --tt-orange-bg: #ffedd5; --tt-orange-text: #9a3412;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tt-blue-bg: #1e3a5f;   --tt-blue-text: #bfdbfe;
    --tt-green-bg: #14532d;  --tt-green-text: #bbf7d0;
    --tt-purple-bg: #3b2a6b; --tt-purple-text: #ddd6fe;
    --tt-orange-bg: #5a2e0e; --tt-orange-text: #fed7aa;
  }
}
:root[data-theme="dark"] {
  --tt-blue-bg: #1e3a5f;   --tt-blue-text: #bfdbfe;
  --tt-green-bg: #14532d;  --tt-green-text: #bbf7d0;
  --tt-purple-bg: #3b2a6b; --tt-purple-text: #ddd6fe;
  --tt-orange-bg: #5a2e0e; --tt-orange-text: #fed7aa;
}

/* 바깥 틀 */
.weekly-timetable-container {
  overflow: hidden;
  border: 1px solid var(--color-card-border);
  border-radius: 14px;
  background: var(--color-surface);
  box-shadow: 0 4px 16px var(--color-shadow);
}
.weekly-timetable {
  width: 100%; table-layout: fixed; border-collapse: collapse;
  font-size: 11px;
}
.weekly-timetable caption {                 /* 화면에는 숨기고 스크린리더만 읽음 */
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.weekly-timetable col, .weekly-timetable-corner, .weekly-timetable-period { width: 40px; }

/* 요일 머리글 / 교시 칸 */
.weekly-timetable thead th {
  height: 32px; padding: 0;
  background: var(--color-table-head-bg); color: var(--color-table-head-text);
  font-size: 12px; font-weight: 800; text-align: center; white-space: nowrap;
}
.weekly-timetable-corner { font-size: 11px !important; color: var(--color-text-muted) !important; }
.weekly-timetable-period {
  padding: 0; background: var(--color-table-head-bg); color: var(--color-table-head-text);
  font-size: 11px; font-weight: 700; text-align: center; vertical-align: middle;
  border-top: 1px solid var(--color-card-border);
}

/* 칸 */
.weekly-timetable-cell {
  height: 44px; padding: 0; vertical-align: top;
  border-top: 1px solid var(--color-card-border);
  border-left: 1px solid var(--color-card-border);
}
.timetable-event-list { display: flex; flex-direction: column; gap: 2px; height: 100%; margin: 0; padding: 0; list-style: none; }
.timetable-event-item { display: flex; flex: 1 1 auto; margin: 0; padding: 0; }

/* 수업 블록 */
.weekly-timetable .timetable-event {
  position: relative; display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  flex: 1 1 auto; min-height: 40px; margin: 2px; padding: 5px 5px 6px;
  border-radius: 8px; background: var(--cls-bg); color: var(--cls-text);
  overflow: hidden; overflow-wrap: anywhere; word-break: keep-all;
}
.weekly-timetable-cell[data-weekday="mon"], .weekly-timetable-cell[data-weekday="fri"] { --cls-bg: var(--tt-blue-bg);   --cls-text: var(--tt-blue-text); }
.weekly-timetable-cell[data-weekday="tue"] { --cls-bg: var(--tt-green-bg);  --cls-text: var(--tt-green-text); }
.weekly-timetable-cell[data-weekday="wed"] { --cls-bg: var(--tt-purple-bg); --cls-text: var(--tt-purple-text); }
.weekly-timetable-cell[data-weekday="thu"] { --cls-bg: var(--tt-orange-bg); --cls-text: var(--tt-orange-text); }

.weekly-timetable .timetable-event-course-name { margin: 0; font-size: 11px; font-weight: 800; line-height: 1.3; }
.weekly-timetable .timetable-event-period,
.weekly-timetable .timetable-event-building {      /* 칸이 좁아서 교시·건물명은 숨김(표의 줄이 교시를 알려줌) */
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.weekly-timetable .timetable-event-classroom {
  display: inline; min-height: 0; padding: 0; border: 0; background: none;
  color: inherit; font-size: 10px; font-weight: 600; line-height: 1.3;
  text-decoration: underline; text-underline-offset: 2px; opacity: .9;
}
.weekly-timetable .timetable-event-classroom::before,
.weekly-timetable .timetable-event-classroom::after { content: none; }

/* 삭제 버튼: 작은 빨간 버튼 */
.timetable-event-remove {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 22px; margin-top: 2px; padding: 0 7px;
  border: 0; border-radius: 6px;
  background: var(--color-danger); color: var(--color-danger-text);
  font-size: 10px; font-weight: 800; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: background 0.12s, transform 0.08s;
}
.timetable-event-remove:hover  { background: color-mix(in srgb, var(--color-danger) 84%, #000); }
.timetable-event-remove:active { background: color-mix(in srgb, var(--color-danger) 68%, #000); transform: scale(0.96); }
.timetable-event-remove:focus-visible { outline: 3px solid var(--color-primary-soft); outline-offset: 2px; }

/* 연속 수업(2교시 이상): 이어지는 칸은 글자 없이 색만 이어서 하나의 큰 블록처럼 */
.weekly-timetable .timetable-event.is-continuation {
  margin-top: 0; border-top-left-radius: 0; border-top-right-radius: 0;
}
.weekly-timetable .timetable-event.is-continuation > * {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
/* 아래 칸에 이어지는 블록이 있으면 아래 모서리를 각지게 해서 이음새가 안 보이게 */
.weekly-timetable-row:has(+ .weekly-timetable-row > td:nth-child(2) .is-continuation) > td:nth-child(2) .timetable-event,
.weekly-timetable-row:has(+ .weekly-timetable-row > td:nth-child(3) .is-continuation) > td:nth-child(3) .timetable-event,
.weekly-timetable-row:has(+ .weekly-timetable-row > td:nth-child(4) .is-continuation) > td:nth-child(4) .timetable-event,
.weekly-timetable-row:has(+ .weekly-timetable-row > td:nth-child(5) .is-continuation) > td:nth-child(5) .timetable-event,
.weekly-timetable-row:has(+ .weekly-timetable-row > td:nth-child(6) .is-continuation) > td:nth-child(6) .timetable-event {
  margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0;
}

/* 주간 표 위 안내 글은 작게 */
#weekly-timetable-notice { font-size: 12px; line-height: 1.5; color: var(--color-text-muted); }

/* '등록된 강의 목록' 접이식 */
.timetable-list-fallback {
  border: 1px solid var(--color-card-border); border-radius: var(--radius-card);
  background: var(--color-surface); overflow: hidden;
}
.timetable-list-fallback > summary {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--touch-min); padding: 0 16px;
  font-size: 15px; font-weight: 800; cursor: pointer; list-style: none;
}
.timetable-list-fallback > summary::-webkit-details-marker { display: none; }
.timetable-list-fallback > summary::after { content: "⌄"; font-size: 18px; color: var(--color-text-muted); transition: transform 0.15s; }
.timetable-list-fallback[open] > summary::after { transform: rotate(180deg); }
.timetable-list-fallback[open] > summary { border-bottom: 1px solid var(--color-line); }
.timetable-list-fallback > .section-description { margin: 12px 16px 8px; font-size: 12px; }
.timetable-list-fallback .table-container { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
@media (hover: hover) {
  .timetable-list-fallback > summary:hover { background: var(--color-primary-soft); color: var(--color-primary); }
}
