/* ==========================================================================
   내 저장 — 관심 학교 비교표 + D-Day 체크리스트
   ========================================================================== */

.saved { padding-top: var(--space-3); }
.saved__section + .saved__section { margin-top: var(--space-5); }

.saved__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.saved__head h2 { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink-900); }
.saved__meta { font-size: var(--fs-small); color: var(--ink-600); }
.saved__dday { font-size: var(--fs-small); font-weight: 800; color: var(--sky-500); white-space: nowrap; }
.saved__note { margin-top: var(--space-2); font-size: var(--fs-micro); line-height: 1.5; color: var(--ink-400); }
.saved__note a { color: var(--sky-500); font-weight: 700; }

/* ---- 비교표 ----
   표 태그 대신 줄마다 같은 칸 나눔(grid)을 쓴다. 학교가 한 곳이든 세 곳이든
   grid-template-columns 만 바꾸면 되고(js/saved.js 가 줄마다 넣는다),
   세로 구분선은 칸의 왼쪽 테두리로 긋는다. */
.compare { padding: 0; overflow: hidden; }
.compare__row { display: grid; align-items: stretch; min-height: 46px; border-top: 1px solid var(--line-100); }
.compare__row--head { border-top: 0; }
.compare__label { display: flex; align-items: center; padding-left: var(--space-3); font-size: var(--fs-micro); color: var(--ink-600); }
.compare__cell {
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border-left: 1px solid var(--line-100);
  font-size: var(--fs-small); font-weight: 700; color: var(--ink-900);
  text-align: center; word-break: keep-all;
}
/* 그 줄에서 가장 유리한 칸 */
.compare__cell.is-best { background: var(--key-100); font-weight: 800; }

.compare__school {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--space-3) 6px;
  border: 0; border-left: 1px solid var(--line-100);
  background: none; font: inherit; color: inherit; cursor: pointer;
  text-align: center; min-width: 0;
}
.compare__flag { font-size: 1.125rem; line-height: 1.2; }
/* 학교 이름은 앱 어디서나 Pretendard (app.css 맨 아래 규칙과 같은 이유) */
.compare__name {
  font-family: var(--font-body);
  font-size: var(--fs-micro); font-weight: 700; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
}
.compare__tag { font-size: 10px; font-weight: 700; color: var(--ink-400); }

/* ---- D-Day 체크리스트 ---- */
.checklist-dday { list-style: none; margin: 0; padding: 0 var(--space-3); }
.checklist-dday__item { display: flex; align-items: center; gap: var(--space-2); min-height: 54px; border-top: 1px solid var(--line-100); }
.checklist-dday__item:first-child { border-top: 0; }
.checklist-dday__item label { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--space-2); min-height: 54px; cursor: pointer; }
.checklist-dday__item input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--sky-500); }
.checklist-dday__title { font-size: var(--fs-body); color: var(--ink-900); word-break: keep-all; }
.checklist-dday__item.is-done .checklist-dday__title { color: var(--ink-400); text-decoration: line-through; }

.dday {
  flex: none; display: inline-flex; align-items: center;
  height: 24px; padding: 0 9px; border-radius: var(--radius-pill);
  background: var(--sky-100); color: var(--sky-700);
  font-size: var(--fs-micro); font-weight: 800; white-space: nowrap;
}
.dday--soon { background: var(--coral-100); color: var(--coral-600); }
.dday--late { background: var(--coral-500); color: #fff; }
.dday--none, .dday--done { background: var(--cloud-50); color: var(--ink-600); }

/* ---- 빈 상태 ---- */
.saved-empty {
  padding: var(--space-5) var(--space-4);
  border: 1.5px dashed var(--line-200); border-radius: var(--radius-row, 14px);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.saved-empty__title { font-size: var(--fs-body); font-weight: 700; color: var(--ink-900); }
.saved-empty__sub { font-size: var(--fs-small); line-height: 1.5; color: var(--ink-600); word-break: keep-all; }
.saved-empty__btn { margin-top: var(--space-2); align-self: stretch; height: 46px; }

/* ---- 희망대학표 ----
   한 줄 = 한 학교. 순위 · 이름(+국가·학과·기간 한 줄) · 위아래/고치기. 세로를 아끼려고
   학과·기간 입력은 고치기를 눌렀을 때만 그 줄 아래로 연다(app_ui.md 1장). */
.wish-note { font-size: var(--fs-micro); color: var(--ink-600); line-height: 1.5; margin: calc(-1 * var(--space-2)) 0 var(--space-2); word-break: keep-all; }
.wish-warn { word-break: keep-all; font-size: var(--fs-micro); color: var(--amber-700); background: var(--amber-100); border-radius: 10px; padding: 7px 10px; margin-bottom: var(--space-2); }
.wish-warn a { color: inherit; font-weight: 800; }
.wish-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.wish-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; border-top: 1px solid var(--line-100); }
.wish-row:first-child { border-top: 0; }
.wish-row.is-off { background: var(--coral-100); }
.wish-row__rank { text-align: center; font-size: var(--fs-small); font-weight: 800; color: var(--sky-500); }
.wish-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 9px 4px; background: none; border: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; }
/* 좁은 화면에서 학교 이름·국가가 "…"로 잘려 줄을 바꿔 다 보이게 */
.wish-row__name { font-size: var(--fs-small); font-weight: 700; color: var(--ink-900); line-height: 1.35; overflow-wrap: anywhere; }
.wish-row__meta { font-size: var(--fs-micro); color: var(--ink-400); line-height: 1.4; word-break: keep-all; }
.wish-row__elig { font-weight: 700; margin-left: 4px; }
.wish-row__elig.is-go { color: var(--mint-600); }
.wish-row__elig.is-warn, .wish-row__elig.is-off { color: var(--coral-600); }
.wish-row__ctrl { display: flex; padding-right: 4px; }
.wish-row__ctrl button { width: 30px; height: 30px; border: 0; background: none; color: var(--ink-600); font-size: 15px; cursor: pointer; border-radius: 8px; }
.wish-row__ctrl button:disabled { opacity: .25; cursor: default; }
.wish-edit { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px; padding: 0 var(--space-3) var(--space-3); }
.wish-edit input { height: 40px; border: 1px solid var(--line-200); border-radius: 10px; padding: 0 12px; font: inherit; font-size: var(--fs-input); }
.wish-edit__len { display: flex; gap: 6px; }
.wish-edit__actions { display: flex; justify-content: space-between; align-items: center; }
.wish-edit__remove { color: var(--coral-600); font-size: var(--fs-micro); }

/* 희망대학표 — 학교 바로 추가 */
.wish-add { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.wish-add__label { flex: none; font-size: var(--fs-micro); font-weight: 700; color: var(--ink-700); }
.wish-add__mount { flex: 1; min-width: 0; }
.wish-edit__pick:empty { display: none; }
.wish-edit__pick { margin-top: 6px; }

/* 순위 숫자 — 누르면 1~N 고르기(투명한 select를 숫자 위에 덮는다) */
.wish-row__rank { position: relative; display: grid; place-items: center; height: 100%; cursor: pointer; }
.wish-row__rank select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.wish-row__rank span { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--sky-100, #EAF1F7); }
/* 손잡이로 끌어 순서 바꾸기 */
.wish-row__grip { touch-action: none; cursor: grab; color: var(--ink-400) !important; }
.wish-row__grip:active { cursor: grabbing; }
.wish-row { position: relative; transition: transform 160ms ease; background: var(--surface, #fff); }
.wish-row.is-dragging { transition: none; z-index: 2; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.14); border-radius: 12px; }
/* 순위 숫자가 카드 왼쪽 끝에 붙어 보였다 — 왼쪽에 여백을 두고 이름과도 띄운다 */
.wish-row { grid-template-columns: 44px 1fr auto; padding-left: 6px; }
.wish-row__rank span { min-width: 26px; height: 26px; border-radius: 13px; }
.wish-row__main { padding-left: 6px; }
