/* ==========================================================================
   MoveFit AI — 모바일 우선 반응형 스타일
   1. 토큰 / 리셋   2. 공통 컴포넌트   3. 헤더   4. 히어로
   5. 대시보드 카드 6. 인증 화면      7. 서브 페이지  8. 반응형
   ========================================================================== */

/* 1. 토큰 / 리셋 --------------------------------------------------------- */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --ink: #0d1520;
  --ink-2: #44505f;
  --muted: #8892a0;
  --line: #e8edf4;
  --line-strong: #dbe3ec;
  --blue: #1a6df0;
  --blue-dark: #145bd0;
  --blue-soft: #e9f1fe;
  --soft: #f4f6f9;
  --star: #f5a623;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --pill: 999px;

  --shadow-sm: 0 1px 2px rgba(15, 26, 44, .04);
  --shadow-md: 0 2px 6px rgba(15, 26, 44, .04), 0 14px 34px rgba(15, 26, 44, .06);
  --shadow-pop: 0 10px 30px rgba(15, 26, 44, .14);

  --header-h: 60px;
  --shell: 1320px;
  --gutter: 16px;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-script: "Nanum Pen Script", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* 하단 영역(푸터)이 내용이 짧은 페이지에서도 화면 맨 아래에 붙도록:
     본문(main)이 남는 높이를 채우고 푸터는 그 아래에 온다. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
#main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }

svg { width: 20px; height: 20px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
}

/* 2. 공통 컴포넌트 ------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 20px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: none;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-dark); }

.btn--ghost { border-color: var(--line-strong); background: var(--surface); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--muted); }

.btn--soft {
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--ink-2);
}
.btn--soft:hover { background: #ebeff5; }

.btn--sm { height: 38px; padding-inline: 16px; font-size: 14px; }
.btn--block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--soft); }

.chip {
  padding: 9px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color .16s ease, color .16s ease;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }

.toasts { display: grid; gap: 8px; padding-top: 14px; }
.toast {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.toast--error { border-left-color: #e5484d; }
.toast--success { border-left-color: #22a06b; }

/* 3. 헤더 ---------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-h);
}

.brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
}
.brand span { color: var(--blue); }
.brand--sm { font-size: 17px; }

.nav { display: none; }
.nav__link {
  padding: 6px 2px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  transition: color .16s ease;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); }

.header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header__actions .icon-btn:not(.icon-btn--menu) { display: none; }
/* 알림 종은 휴대폰에서도 보인다 */
.header__actions .notif .icon-btn { display: inline-grid; }
.notif { position: relative; }
.notif__toggle { position: relative; }
.notif__dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: #f0453a;
  box-sizing: content-box;
}
.notif__dot[hidden] { display: none; }
.notif__panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -6px;
  z-index: 50;
  width: 340px;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.notif__panel[hidden] { display: none; }
.notif__head {
  position: sticky;
  top: 0;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.notif__list { display: grid; padding: 6px; }
.notif__item { display: flex; gap: 11px; padding: 10px; border-radius: var(--radius-sm); }
.notif__item:hover { background: var(--soft); }
.notif__item.is-new { background: var(--blue-soft); }
.notif__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--soft);
  color: var(--ink-2);
}
.notif__icon svg { width: 16px; height: 16px; }
.notif__icon--routine, .notif__icon--login { background: var(--blue); color: #fff; }
.notif__icon--check { background: #e7f7ee; color: #1fb26b; }
.notif__icon--notice { background: #fff4e0; color: #d98a00; }
.notif__text { display: grid; gap: 2px; min-width: 0; }
.notif__text b { color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.notif__text span { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.notif__empty { padding: 22px 12px; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 767px) {
  /* 휴대폰: 헤더 아래 화면 폭 전체 */
  .notif { position: static; }
  .notif__panel { position: fixed; top: calc(var(--header-h) + 6px); left: 10px; right: 10px; width: auto; }
}
.header__actions .btn { display: none; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--blue-soft);
}
.avatar--initial {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.user { position: relative; display: none; }
.user__button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border: 0;
  border-radius: var(--pill);
  background: none;
}
.user__button:hover { background: var(--soft); }
.user__name { font-size: 14px; font-weight: 600; }
.user__caret { width: 16px; height: 16px; color: var(--muted); }

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.menu__item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-size: 14px;
}
.menu__item:hover { background: var(--soft); }
.menu__item--danger { color: #d43f45; }

.drawer {
  padding: 8px var(--gutter) 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer__nav { display: grid; }
.drawer__nav a { padding: 12px 2px; font-size: 15px; font-weight: 600; }
.drawer__auth { display: grid; gap: 8px; margin-top: 10px; }

/* 4. 히어로 -------------------------------------------------------------- */
/* overflow-x: clip — 사진·손글씨가 화면 밖으로 나가 가로 스크롤이 생기는 것을 막는다(iOS Safari는 body의 overflow-x를 무시한다) */
.hero { position: relative; padding: 18px 0 26px; overflow-x: clip; }

.hero__media {
  position: absolute;
  top: -10px;
  right: -8%;
  width: 66%;
  height: 300px;
  z-index: 0;
  pointer-events: none;
}
.hero__media picture { display: block; height: 100%; }
.hero__media img { width: 100%; height: 100%; object-fit: contain; object-position: right bottom; }
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 4%, rgba(243, 246, 250, .55) 34%, rgba(243, 246, 250, 0) 66%),
    linear-gradient(180deg, rgba(243, 246, 250, 0) 62%, var(--bg) 99%);
}

.hero__script {
  position: absolute;
  top: 14px;
  right: 6px;
  z-index: 1;
  color: #4a5666;
  font-family: var(--font-script);
  font-size: 19px;
  line-height: 1.45;
  transform: rotate(-3deg);
}
.hero__tagline { display: none; }

.hero__inner { position: relative; z-index: 1; }

.hero__title {
  font-size: clamp(27px, 7.4vw, 34px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -.025em;
}
.hero__title em { color: var(--blue); font-style: normal; }


.askbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding: 7px 7px 7px 16px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.askbar__spark {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue);
}
.askbar__spark svg { width: 18px; height: 18px; }
.askbar__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 14px;
  outline: none;
}
.askbar__input::placeholder { color: var(--muted); }
.askbar__input::-webkit-search-cancel-button { display: none; }
.askbar__go {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  transition: background-color .16s ease;
}
.askbar__go:hover { background: var(--blue-dark); }
.askbar__go svg { width: 18px; height: 18px; }

.examples {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.examples::-webkit-scrollbar { display: none; }

/* 5. 대시보드 카드 -------------------------------------------------------- */
.dash { padding-bottom: 40px; }
.dash__grid { display: grid; gap: 14px; align-items: start; }

.card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.card__icon { width: 22px; height: 22px; }
.card__icon--blue { color: var(--blue); }
.card__more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.card__more svg { width: 15px; height: 15px; }
.card__more:hover { color: var(--ink); }
.card__note { display: none; }
.card__cta { display: none; }

/* -- 카드 1: 추천 프로그램 */
.program { display: grid; grid-template-columns: 96px 1fr auto; gap: 14px; align-items: center; }
.program__thumb {
  width: 96px;
  height: 92px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--blue-soft);
}
.program__facility { color: var(--muted); font-size: 12.5px; }
.program__title { margin: 1px 0 7px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.program__arrow { width: 18px; height: 18px; color: var(--muted); align-self: center; }

.meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  font-size: 13px;
}
.meta svg { width: 15px; height: 15px; color: var(--muted); }
.meta + .meta { margin-top: 3px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  padding: 4px 10px;
  border-radius: var(--pill);
  background: var(--soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}
.tag--accent { background: var(--blue-soft); color: var(--blue); font-weight: 600; }

.amenity-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.amenity-badge { padding: 4px 10px; border-radius: var(--pill); background: var(--soft); color: var(--muted); font-size: 11.5px; font-weight: 500; }
.amenity-badge--yes { background: #e8f7f0; color: #1a8a5c; font-weight: 600; }
.amenity-badge--no { background: #fdecec; color: #c23a40; font-weight: 600; }

/* -- 카드 2: AI 추천 요약 */
.ai__headline {
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -.02em;
}
.ai__headline em { color: var(--blue); font-style: normal; }

.route {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}
.route__node {
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: var(--soft);
  text-align: center;
}
.route__icon { width: 26px; height: 26px; margin: 0 auto 6px; color: var(--ink-2); }
.route__icon--blue { color: var(--blue); }
.route__label { font-size: 13px; font-weight: 600; line-height: 1.35; }
.route__time { color: var(--muted); font-size: 11.5px; }

/* 회사 ── 🚗 ──→ 체육센터 */
.route__link { --route-line: var(--line-strong); display: flex; align-items: center; gap: 6px; }
.route__line {
  position: relative;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--route-line);
}
.route__line--arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--route-line);
  border-right: 2px solid var(--route-line);
  transform: translateY(-50%) rotate(45deg);
}
.route__mid { display: grid; justify-items: center; gap: 2px; }
.route__car { width: 24px; height: 24px; color: var(--ink-2); }
.route__duration { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* 이동 시간 근거(실시간/추정) + 경로 등록·수정 */
.ai__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ai__basis { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 500; }
.ai__basis::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #1fb26b; box-shadow: 0 0 0 3px rgba(31, 178, 107, .16); }
.ai__basis.is-estimate { color: var(--muted); }
.ai__basis.is-estimate::before { background: #c3cdd9; box-shadow: none; }
.ai__edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
}
.ai__edit svg { width: 14px; height: 14px; }
.ai__edit:hover { border-color: var(--blue); }
.navi-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  margin-top: 10px;
  border-radius: var(--radius-md);
  background: #03c75a;            /* 네이버 지도 초록 */
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.navi-link:hover { background: #02b351; }
.navi-link[hidden] { display: none; }
.navi-link svg { width: 16px; height: 16px; }

/* 경로 지도 — 모바일/데스크톱 공통으로 보여준다. */
.map {
  position: relative;
  height: 180px;
  margin-top: 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.map > svg { width: 100%; height: 100%; }   /* 키 없을 때 쓰는 목업 그림 */

/* 목업 그림 위에 얹는 시간 배지와 양끝 라벨 */
.map__badge {
  position: absolute;
  top: 42%;
  left: 44%;
  padding: 4px 12px;
  border-radius: var(--pill);
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.map__marker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.map__marker svg { width: 13px; height: 13px; color: var(--blue); }
.map__marker--start { left: 10px; bottom: 16px; }
.map__marker--end { right: 10px; bottom: 16px; }

/* -- 실제 네이버 지도 (.map--live). 목업 SVG를 대체한다. */
.map__canvas { width: 100%; height: 100%; background: var(--soft); }
.map__fallback {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  background: var(--soft);
  color: var(--muted);
  font-size: 12.5px;
}
/* display:grid 가 hidden 속성을 덮지 않도록 */
.map__fallback[hidden] { display: none; }
/* 마커: 크기 0짜리 래퍼를 좌표에 두고 말풍선을 transform으로 중앙 정렬한다.
   (래퍼에는 네이버가 position:absolute를 인라인으로 걸므로 건드리지 않는다) */
.map-anchor { width: 0; height: 0; }
.map-dot,
.map-pin,
.map-badge { position: absolute; left: 0; top: 0; white-space: nowrap; }

/* 끝점: 좌표 위의 작은 점. 라벨은 점에서 위/아래로 비켜 둬서 경로를 가리지 않는다. */
.map-dot {
  width: 14px;
  height: 14px;
  border: 3.5px solid var(--blue);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 26, 44, .25);
  transform: translate(-50%, -50%);
}
.map-dot--start { border-color: var(--ink-2); }

.map-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 26, 44, .12);
}
.map-pin--above { transform: translate(-50%, calc(-100% - 11px)); }
.map-pin--below { transform: translate(-50%, 11px); }
.map-pin svg { width: 13px; height: 13px; color: var(--ink-2); }
.map-pin--end svg { color: var(--blue); }

.map-badge {
  padding: 4px 12px;
  border-radius: var(--pill);
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(26, 109, 240, .35);
  transform: translate(10px, -50%);
}

/* -- 카드 3: 주간 루틴 */
.routine { display: grid; }
.routine__row {
  display: grid;
  grid-template-columns: 34px 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.routine__row:last-child { border-bottom: 0; }
.routine__row.is-rest .routine__title { color: var(--muted); }

.routine__day { display: grid; font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.routine__date { color: var(--muted); font-size: 11px; font-weight: 500; }

.tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1.6px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.tick svg { width: 12px; height: 12px; }
.tick:hover:not(:disabled) { border-color: var(--blue); }
.tick.is-done { border-color: var(--blue); background: var(--blue); color: #fff; }
.tick:disabled { opacity: .4; cursor: default; }

.routine__title { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.routine__time { color: var(--muted); font-size: 12.5px; }
.routine__place { display: none; }
.routine__chev { display: none; }

/* 화면 크기별 줄바꿈: br-m = 휴대폰에서만, br-d = 태블릿 이상에서만 */
.br-m { display: none; }

/* 모바일 고정 CTA */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243, 246, 250, 0), var(--bg) 40%);
}
.mobile-cta .btn { height: 50px; box-shadow: 0 8px 24px rgba(26, 109, 240, .32); }
body.has-mobile-cta { padding-bottom: 76px; }

/* 6. 인증 화면 ----------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: 28px 0 56px; }
.auth__card {
  width: 100%;
  max-width: 440px;
  padding: 28px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.auth__title { font-size: 24px; font-weight: 800; letter-spacing: -.025em; }
.auth__lead { margin-top: 8px; color: var(--ink-2); font-size: 14px; }
.auth__form { display: grid; gap: 14px; margin-top: 24px; }
.auth__foot { margin-top: 18px; color: var(--ink-2); font-size: 14px; text-align: center; }
.auth__foot a { color: var(--blue); font-weight: 600; }

.field { display: grid; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field__input {
  width: 100%;
  height: 46px;
  padding-inline: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 15px;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field__input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.field__error { color: #d43f45; font-size: 12.5px; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.check input { width: 17px; height: 17px; accent-color: var(--blue); }
.check { align-items: flex-start; line-height: 1.5; }
.check input { flex: none; margin-top: 2px; }
.check a, .auth__legal a { color: var(--blue); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.auth__legal { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; text-align: center; }

.auth__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.link-muted { color: var(--muted); font-size: 13px; }
.link-muted:hover { color: var(--blue); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font-size: 12.5px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.alert {
  padding: 11px 14px;
  border: 1px solid #f4cdcf;
  border-radius: var(--radius-sm);
  background: #fdf2f2;
  color: #b93b40;
  font-size: 13.5px;
}
.notice {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--soft);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.6;
}
.notice code { font-size: 12px; color: var(--ink); }

/* 7. 서브 페이지 --------------------------------------------------------- */
.page { padding: 26px 0 56px; }
.page__title { font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.page__lead { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }

.filters { display: grid; gap: 10px; margin: 20px 0; }
.filters select, .filters input {
  height: 46px;
  padding-inline: 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 14px;
  outline: none;
}

.result-count { color: var(--muted); font-size: 13px; }
.facility-grid { display: grid; gap: 12px; margin-top: 14px; }
.facility {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.facility__name { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.facility { transition: border-color .16s ease, box-shadow .16s ease; }
.facility.is-active { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.facility__locate {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
}
.facility__locate svg { width: 14px; height: 14px; }
.facility__locate:hover { border-color: var(--blue); }

.facility__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.facility__foot .facility__locate { margin-top: 0; }
.facility__review-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
}
.facility__review-btn:hover { border-color: var(--star); color: var(--ink); }
.facility__review-btn svg { width: 14px; height: 14px; color: var(--muted); }
.facility__review-btn .i-star-filled { color: var(--star); }
.facility__review-btn strong { color: var(--ink); font-weight: 700; }
.facility__review-count { color: var(--muted); font-weight: 500; }

/* 프로그램 찾기 지도 */
.facility-map {
  position: relative;
  height: 320px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--soft);
  scroll-margin-top: calc(var(--header-h) + 12px);
}
.facility-map__canvas { width: 100%; height: 100%; }
.facility-map .map__fallback { height: 100%; }
.facility-map__hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 5;
  padding: 5px 11px;
  border-radius: var(--pill);
  background: rgba(13, 21, 32, .72);
  color: #fff;
  font-size: 11.5px;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: nowrap;
}
.facility-map__hint[hidden] { display: none; }
@media (hover: none) { .facility-map__hint { display: none; } }   /* 터치 기기는 두 손가락으로 확대 */

.fmap-pin {
  display: block;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 1px 4px rgba(15, 26, 44, .35);
  cursor: pointer;
}
.fmap-pin--approx { background: #8aa4c8; }
.fmap-info {
  display: grid;
  gap: 3px;
  min-width: 200px;
  max-width: 260px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-size: 12.5px;
  line-height: 1.5;
}
.fmap-info__name { font-size: 14.5px; letter-spacing: -.02em; }
.fmap-info__kinds { color: var(--blue); font-weight: 600; }
.fmap-info__addr { color: var(--ink-2); }
.fmap-info__addr em { color: var(--muted); font-style: normal; }
.fmap-info__links { display: flex; gap: 12px; margin-top: 4px; }
.fmap-info__links a { color: var(--blue); font-weight: 600; }
.facility__alias { margin-top: 2px; color: var(--muted); font-size: 12.5px; }
.empty {
  padding: 48px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  text-align: center;
}

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__inner { display: grid; gap: 6px; padding-block: 24px; }
.site-footer p { color: var(--muted); font-size: 12.5px; }
.site-footer__links { display: flex; gap: 14px; font-size: 12.5px; }
.site-footer__links a { color: var(--ink-2); }
.site-footer__links a:hover { color: var(--blue); }

/* -- 식단 */
.diet__shell { max-width: 1080px; }
.diet__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.diet__actions { display: flex; gap: 8px; }
.day-nav { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.day-nav__label { min-width: 120px; color: var(--ink-2); font-size: 14.5px; font-weight: 600; text-align: center; }
.day-nav__step {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 18px;
}
.day-nav__step:hover { background: var(--surface); }
.day-nav__step.is-disabled { color: var(--line-strong); }

.diet-setup {
  display: grid;
  gap: 4px;
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: var(--surface);
}
.diet-setup strong { color: var(--ink); font-size: 15px; }
.diet-setup span { color: var(--ink-2); font-size: 13.5px; }
.diet-setup:hover { border-color: var(--blue); }

.diet__grid { display: grid; gap: 14px; margin-top: 22px; }
.diet__section-title { margin-bottom: 12px; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.ledger, .burn, .meals {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.ledger__figure { display: flex; align-items: baseline; gap: 8px; }
.ledger__figure b { color: var(--ink); font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ledger__figure span { color: var(--muted); font-size: 15px; font-weight: 600; }
.meter { height: 8px; margin-top: 14px; overflow: hidden; border-radius: 4px; background: var(--soft); }
.meter span { display: block; height: 100%; border-radius: 4px; background: var(--ink); }
.meter.is-over span { background: #d43f45; }
.ledger__balance { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.ledger__balance b { color: var(--ink); }
.ledger__balance.is-over b { color: #c0353b; }
.macros { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0 0; border-top: 1px solid var(--line); }
.macros div { padding-top: 12px; }
.macros div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.macros dt { color: var(--muted); font-size: 12px; }
.macros dd { margin: 2px 0 0; color: var(--ink); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger__basis { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ledger__basis a { color: var(--blue); }

.burn__lead { color: var(--ink-2); font-size: 13.5px; line-height: 1.65; }
.burn__list { margin-top: 12px; border-top: 1px solid var(--line); }
.burn__list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.burn__name { color: var(--ink); font-size: 14.5px; }
.burn__time { color: var(--ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.burn__find { color: var(--blue); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }

.meals { margin-top: 14px; }
.meal-group + .meal-group { margin-top: 18px; }
.meal-group__head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 700;
}
.meal { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meal__items { flex: 1; display: grid; gap: 4px; }
.meal__items li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); font-size: 14px; }
.meal__amount { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.meal__delete { padding: 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-decoration: underline; }
.meal__delete:hover { color: #c0353b; }
.meals__empty { padding: 26px 0; color: var(--muted); font-size: 14px; text-align: center; }

/* 기록 창 */
.record {
  width: min(720px, calc(100vw - 32px));
  max-height: min(92vh, 960px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15, 26, 44, .28);
  overflow: hidden;
}
.record[open] { display: flex; flex-direction: column; }
.record::backdrop { background: rgba(13, 21, 32, .55); }
.record__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.record__title { font-size: 17px; font-weight: 800; }
.record__close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); }
.record__close:hover { background: var(--soft); }
.record__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; overscroll-behavior: contain; }
.record__note { margin: 12px 0 0; color: var(--ink-2); font-size: 13.5px; }
.record__note.is-error { color: #c0353b; }
.record__note[hidden] { display: none; }

.photo { position: relative; margin: 0; border-radius: 6px; overflow: hidden; background: var(--soft); }
.photo[hidden] { display: none; }
.photo__img { display: block; width: 100%; height: auto; }
/* 라벨 좌표(0~1)는 사진 크기 기준이라, 사진과 같은 크기의 틀 위에 겹친다 */
.photo__frame { position: relative; }
.photo__labels { position: absolute; inset: 0; }
.photo.is-busy .photo__img { filter: saturate(.6) brightness(.85); }
.photo__mark {
  position: absolute;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .95);
  border-radius: 6px;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(13, 21, 32, .35);
  cursor: pointer;
}
.photo__label {
  position: absolute;
  left: -2px;
  top: -2px;
  max-width: 160px;
  padding: 3px 8px;
  border-radius: 6px 0 6px 0;
  background: rgba(13, 21, 32, .82);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo__mark.is-linked { z-index: 2; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(26, 109, 240, .35); }
.photo__mark:hover, .photo__mark:focus-visible { z-index: 2; }
.photo__mark.is-linked .photo__label { background: var(--blue); }
.photo__status { padding: 10px 12px; color: var(--ink-2); font-size: 13px; background: var(--surface); border-top: 1px solid var(--line); }
.photo__status:empty { display: none; }
.photo.is-busy .photo__status::after { content: ""; display: inline-block; width: 1.2em; animation: consult-wait 1.2s steps(4) infinite; overflow: hidden; vertical-align: bottom; }

.items { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 14px; }
.items[hidden] { display: none; }
.items th { padding: 6px 4px; border-bottom: 2px solid var(--ink); color: var(--muted); font-size: 12px; font-weight: 700; text-align: left; }
.items td { padding: 4px; border-bottom: 1px solid var(--line); }
.items tr.is-linked td { background: var(--blue-soft); }
.items th:nth-child(2), .items th:nth-child(3) { width: 84px; }
.items th:nth-child(4) { width: 36px; }
.items__input {
  width: 100%;
  height: 36px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
}
.items__input:hover { border-color: var(--line-strong); }
.items__input:focus { border-color: var(--blue); background: var(--surface); outline: none; }
.items__input--num { text-align: right; font-variant-numeric: tabular-nums; }
.items__remove { width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 18px; }
.items__remove:hover { background: #fdecec; color: #c0353b; }
.record__add { margin-top: 10px; padding: 6px 0; border: 0; background: none; color: var(--blue); font-size: 13.5px; font-weight: 600; }

.record__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)) 20px;
  border-top: 1px solid var(--line);
}
.record__type .field__input { height: 40px; padding: 0 10px; }
.record__total { flex: 1; color: var(--muted); font-size: 13px; text-align: right; }
.record__total b { color: var(--ink); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
body:has(.record[open]) { overflow: hidden; }

/* 신체 정보 */
.diet-profile__shell { max-width: 560px; }
.diet-profile__shell .page__title { margin-top: 10px; }
.diet-profile__form { display: grid; gap: 22px; margin-top: 24px; }
.diet-profile__numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.choice { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.choice legend { padding: 0; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.choice__row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice__stack { display: grid; gap: 6px; }
.choice__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
}
.choice__item:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.choice__item input { accent-color: var(--ink); }
.diet-profile__consent { padding: 12px 14px; border-radius: 6px; background: var(--soft); }

@media (min-width: 900px) {
  .diet__grid { grid-template-columns: 1fr 1fr; align-items: stretch; }
}
@media (max-width: 767px) {
  .diet__actions { width: 100%; }
  .diet__actions .btn { flex: 1; }
  .ledger, .burn, .meals { padding: 16px; }
  .ledger__figure b { font-size: 34px; }
  .record { width: 100vw; max-width: none; max-height: 94vh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .items__input { font-size: 16px; }
  .diet-profile__numbers { grid-template-columns: 1fr 1fr; }
  /* 작은 사진에서 라벨끼리 덜 겹치게 */
  .photo__label { max-width: 96px; padding: 2px 5px; font-size: 10.5px; }
  .photo__mark { border-width: 1.5px; }
}

/* -- 이동 설정 */
.commute__shell { max-width: 620px; }
.commute__card {
  margin-top: 20px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.commute__form { display: grid; gap: 16px; }
.commute__group {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.commute__step small { color: var(--muted); font-size: 12px; font-weight: 500; }
legend.commute__step { padding: 0; margin-bottom: 6px; }

/* 출발지 검색 + 지도 */
.place-search { display: flex; gap: 8px; }
.place-search .field__input { flex: 1; min-width: 0; }
.place-search .btn { flex: none; height: 46px; }
.place-results {
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.place-results[hidden] { display: none; }
.place-results li + li { border-top: 1px solid var(--line); }
.place-results__item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  background: none;
  text-align: left;
}
.place-results__item:hover, .place-results__item:focus-visible { background: var(--soft); }
.place-results__item b { color: var(--ink); font-size: 14px; font-weight: 600; }
.place-results__item span { color: var(--muted); font-size: 12.5px; }
.place-results__empty { padding: 14px; color: var(--muted); font-size: 13px; }
.place-results__credit { padding: 6px 14px; color: var(--muted); font-size: 11px; text-align: right; }
.picker-map {
  height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--soft);
}
.picker-map[hidden] { display: none; }
.picker-pin {
  display: block;
  width: 22px;
  height: 22px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 2px 6px rgba(15, 26, 44, .4);
  cursor: grab;
}
.picker-pin--center { background: var(--ink); cursor: default; }
.picker-selected {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--muted);
  font-size: 13.5px;
}
.picker-selected.is-set { color: var(--ink); font-weight: 600; }

/* 검색되는 드롭다운 */
.combo { position: relative; }
.combo__input { width: 100%; padding-right: 44px; }
.combo__toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 46px;
  border: 0;
  background: none;
  color: var(--muted);
}
.combo__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.combo__list[hidden] { display: none; }
.combo__option { display: grid; gap: 1px; padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; }
.combo__option.is-active { background: var(--blue-soft); }
.combo__name { color: var(--ink); font-size: 14px; font-weight: 600; }
.combo__sub { color: var(--muted); font-size: 12px; }
.combo__empty { padding: 12px; color: var(--muted); font-size: 12.5px; }
.commute__group:last-of-type { border-bottom: 0; padding-bottom: 0; }
.commute__step { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14.5px; font-weight: 700; }
.commute__step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}
.commute__row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.commute__help { color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.commute__more summary { width: fit-content; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.commute__more[open] summary { margin-bottom: 8px; }
.commute__actions { display: flex; gap: 8px; margin-top: 4px; }
.commute__actions .btn--primary { flex: 1; }
.commute__delete { margin-top: 14px; text-align: center; }
.commute__delete button { border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; }
@media (max-width: 767px) { .commute__row { grid-template-columns: 1fr; } }

/* -- 이용약관 · 개인정보 처리방침 */
.legal-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(84vh, 900px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15, 26, 44, .28);
  overflow: hidden;
}
.legal-modal[open] { display: flex; flex-direction: column; }
.legal-modal::backdrop { background: rgba(13, 21, 32, .5); }
.legal-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px 22px;
  border-bottom: 1px solid var(--line);
}
.legal-modal__title { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.legal-modal__x {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
}
.legal-modal__x:hover { background: var(--soft); }
/* 본문 스타일은 .legal__body 를 그대로 쓰고, 테두리·여백만 창에 맞춘다 */
.legal-modal__body.legal__body {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 18px 22px 22px;
  border: 0;
  border-radius: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.legal-modal__body .legal__meta { margin: 0 0 14px; }
.legal-modal__body .legal__meta + h2 { margin-top: 0; }
.legal-modal__foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
body:has(.legal-modal[open]) { overflow: hidden; }   /* 창이 떠 있는 동안 뒤 페이지는 스크롤하지 않는다 */
@media (max-width: 767px) {
  /* 휴대폰: 아래에서 올라오는 시트 */
  .legal-modal {
    width: 100vw;
    max-width: none;
    max-height: 90vh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .legal-modal__body.legal__body { padding: 16px; }
}

/* -- 별점 (평균 표시 · 선택기 · 리뷰 카드에서 공통으로 쓴다) */
.stars { display: inline-flex; gap: 2px; }
.star { display: inline-grid; place-items: center; padding: 0; border: 0; background: none; color: var(--line-strong); }
.star svg { width: 20px; height: 20px; }
.star.is-filled { color: var(--star); }
button.star { cursor: pointer; transition: transform .1s ease; }
button.star:hover { transform: scale(1.12); }
.stars--sm .star svg { width: 15px; height: 15px; }

/* -- 시설 리뷰 창 (별점 1~5 + 후기, 네이버 지도 리뷰 탭과 같은 형태) */
.review-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 820px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(15, 26, 44, .28);
  overflow: hidden;
}
.review-modal[open] { display: flex; flex-direction: column; }
.review-modal [hidden] { display: none; }   /* .btn 등 display 유틸리티가 [hidden]을 덮어쓰는 것을 막는다 */
.review-modal::backdrop { background: rgba(13, 21, 32, .5); }
body:has(.review-modal[open]) { overflow: hidden; }

.review-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px 22px;
  border-bottom: 1px solid var(--line);
}
.review-modal__eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.review-modal__title { margin-top: 2px; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.review-modal__address { margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.review-modal__x {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
}
.review-modal__x:hover { background: var(--soft); }

.review-modal__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}
.review-modal__avg { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.review-modal__count { margin-left: auto; color: var(--muted); font-size: 12.5px; }

.review-modal__body { flex: 1; min-height: 0; padding: 18px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
.review-modal__section-label { margin: 22px 0 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; }

/* -- 작성 / 수정 폼 */
.review-form { display: grid; gap: 10px; }
.review-form__stars { display: inline-flex; gap: 6px; }
.review-form__stars .star svg { width: 26px; height: 26px; }
.review-form__text {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.review-form__text:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.review-form__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.review-form__count { color: var(--muted); font-size: 12px; }
.review-form__actions { display: flex; gap: 8px; }
.review-form .field__error { margin-top: -2px; }

/* -- 로그인 안내 */
.review-compose__login {
  padding: 14px 16px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--ink-2);
  font-size: 13.5px;
  text-align: center;
}
.review-compose__login a { color: var(--blue); font-weight: 700; }

/* -- 리뷰 한 건 (목록 / 내 리뷰 카드 공통) */
.review-list { display: grid; gap: 14px; }
.review-item { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.review-list .review-item:last-child { border-bottom: 0; padding-bottom: 0; }
.review-item--mine {
  padding: 14px;
  border: 1px solid var(--blue-soft);
  border-radius: var(--radius-md);
  background: var(--blue-soft);
}
.review-item__head { display: flex; align-items: center; gap: 8px; }
.review-item__author { font-size: 13px; font-weight: 700; }
.review-item__badge {
  padding: 2px 8px;
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
}
.review-item__date { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.review-item__comment { margin-top: 8px; color: var(--ink); font-size: 13.5px; line-height: 1.6; white-space: pre-line; }
.review-item__actions { display: flex; gap: 8px; margin-top: 12px; }
.review-item__delete { color: #d43f45; }

.review-empty {
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

/* -- 근처 체육용품점 (review-item/meta/tag 재사용 + 이 둘만 추가) */
.shop-item__name { font-size: 14.5px; font-weight: 700; }
.shop-item__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* -- 시설 프로그램 시간표 (review-item/meta/tag 재사용 + 검색칸만 추가) */
.program-filter { margin-bottom: 14px; }

@media (max-width: 767px) {
  /* 휴대폰: 아래에서 올라오는 시트 */
  .review-modal {
    width: 100vw;
    max-width: none;
    max-height: 90vh;
    /* vh는 주소창·툴바가 숨었을 때 높이라, 툴바가 보이는 평소엔 시트가 화면 밖으로 잘린다 */
    max-height: 90dvh;
    margin: auto 0 0;
    border-radius: 20px 20px 0 0;
  }
  .review-modal__body { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }  /* 아이폰 홈 표시줄 */
  .program-filter { font-size: 16px; }   /* iOS 는 16px 미만 입력칸에 포커스하면 화면을 확대한다 */
  .review-modal__head { padding: 16px 16px 12px 18px; }
  .review-modal__summary { padding: 12px 18px; }
}

.legal__shell { max-width: 820px; }
.legal__tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
}
.legal__tabs a { padding: 7px 16px; border-radius: var(--pill); color: var(--ink-2); font-size: 13.5px; font-weight: 500; }
.legal__tabs a strong { font-weight: inherit; }
.legal__tabs a.is-active { background: var(--ink); color: #fff; font-weight: 700; }
.legal__meta { margin-top: 6px; color: var(--muted); font-size: 13px; }
.legal__body {
  margin-top: 22px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.8;
  word-break: keep-all;
}
.legal__body h2 {
  margin: 34px 0 10px;
  padding-top: 4px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.legal__body h2:first-child { margin-top: 0; }
.legal__body p + p { margin-top: 10px; }
.legal__body ul, .legal__body ol { display: grid; gap: 6px; margin: 10px 0; padding-left: 20px; }
.legal__body ul { list-style: disc; }
.legal__body ol { list-style: decimal; }
.legal__body b { color: var(--ink); }
.legal__body a { color: var(--blue); }
.legal__body small { color: var(--muted); font-size: 12.5px; }
.legal__lead { color: var(--ink); }
.legal__toc { margin: 18px 0 6px; padding: 14px 18px; border-radius: var(--radius-md); background: var(--soft); }
.legal__toc ol { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 16px; margin: 0; font-size: 13.5px; }
.legal__toc a { color: var(--ink-2); }
.legal__table { margin: 12px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.legal__table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 13.5px; line-height: 1.6; }
.legal__table th, .legal__table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal__table tr:last-child th, .legal__table tr:last-child td { border-bottom: 0; }
.legal__table thead th { background: var(--soft); color: var(--ink); font-weight: 700; white-space: nowrap; }
.legal__table tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; }
.legal__card { margin: 12px 0; padding: 14px 16px; border-radius: var(--radius-md); background: var(--soft); }
.legal__card p + p { margin-top: 4px; }
@media (max-width: 767px) {
  .legal__body { padding: 20px 16px; font-size: 14px; }
  .legal__toc ol { grid-template-columns: 1fr; }

  /* 표는 휴대폰에서 행마다 카드로 쌓는다(가로 스크롤 없이 읽히게) */
  .legal__table { border: 0; overflow: visible; }
  .legal__table table { min-width: 0; }
  .legal__table thead { display: none; }
  .legal__table tr { display: block; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
  .legal__table th, .legal__table td { display: block; border-bottom: 1px solid var(--line); }
  .legal__table tr > :last-child { border-bottom: 0; }
  .legal__table tbody th { background: var(--soft); white-space: normal; }
  .legal__table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
  }
}

/* 8. 반응형 -------------------------------------------------------------- */

/* 휴대폰 (~767px) — 모바일 목업 배치 */
@media (max-width: 767px) {
  :root { --header-h: 56px; }
  .brand { font-size: 20px; }

  .br-m { display: inline; }
  .br-d { display: none; }

  /* 히어로: 왼쪽 문구 + 오른쪽 사진이 겹쳐 보이게 */
  .hero { padding: 20px 0 16px; }
  .hero__media {
    top: 0;
    right: 0;
    width: 62%;
    height: 250px;
  }
  /* 인물을 왼쪽에 붙여 오른쪽 위에 손글씨 자리를 남긴다 */
  .hero__media img { object-position: 12% bottom; }
  .hero__media::after {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgba(243, 246, 250, .6) 22%, rgba(243, 246, 250, 0) 52%),
      linear-gradient(180deg, rgba(243, 246, 250, 0) 70%, var(--bg) 100%);
  }
  .hero__script {
    top: 14px;
    right: -4px;
    font-size: 15.5px;
    line-height: 1.35;
    transform: rotate(-12deg);
    transform-origin: right top;
  }
  .hero__script::after {
    content: "";
    display: block;
    width: 86px;
    height: 1.5px;
    margin-top: 2px;
    border-radius: 2px;
    background: #5b84c4;
  }

  .eyebrow { margin-bottom: 10px; font-size: 9.5px; letter-spacing: .1em; }
  .hero__title { font-size: 26px; line-height: 1.26; }

  .askbar { margin-top: 20px; padding: 6px 6px 6px 7px; }
  .askbar__go { width: 40px; height: 40px; }

  /* 칩 5개가 한 줄을 꽉 채우게 (좁은 기기에선 가로 스크롤) */
  .examples--mobile { gap: 6px; margin-top: 12px; }
  .examples--mobile .chip { flex: 1 0 auto; padding: 8px 9px; font-size: 12px; text-align: center; }

  /* 카드 공통 */
  .dash__grid { gap: 10px; }
  .card { padding: 14px 14px 16px; border-radius: 18px; }
  .card__head {
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .card__title { font-size: 15.5px; }
  .card__more { font-size: 12.5px; }

  /* 카드 1: 큰 썸네일 + 오른쪽 화살표, 태그 한 줄 */
  .program { position: relative; grid-template-columns: 112px 1fr; gap: 14px; align-items: stretch; }
  .program__thumb { width: 112px; height: 100%; min-height: 106px; }
  .program__body { min-width: 0; }
  .program__facility { line-height: 1.5; }
  .program__title { margin: 1px 0 5px; font-size: 18px; line-height: 1.3; }
  .program .meta { line-height: 1.5; }
  .program__arrow { position: absolute; top: 36%; right: 0; }
  .tags { gap: 5px; margin-top: 9px; }
  .tag { padding: 4px 8px; font-size: 11px; white-space: nowrap; }

  /* 카드 2: 회사 ── 🚗 31분 ──→ 체육센터 (파란 연결선) */
  .ai__headline { margin-bottom: 14px; font-size: 16.5px; }
  .route { gap: 6px; }
  .route__node { padding: 10px 6px; }
  .route__icon { width: 24px; height: 24px; margin-bottom: 4px; }
  .route__icon:not(.route__icon--blue) { color: #6b7f9e; }
  .route__label { font-size: 12.5px; }
  .route__time { font-size: 11px; }
  .route__link { --route-line: var(--blue); gap: 7px; }
  .route__line { width: 22px; }

  /* 카드 3: '월 3.11'을 가로로, 행 끝에 > */
  .routine__row { grid-template-columns: 62px 22px 1fr auto 14px; gap: 10px; padding: 10px 0; }
  .routine__day { display: flex; align-items: baseline; gap: 14px; font-size: 13.5px; }
  .routine__date { font-size: 12px; }
  .routine__title { font-size: 14px; }
  .routine__time { font-size: 12px; }
  .routine__chev { display: block; width: 14px; height: 14px; color: var(--muted); }
}

@media (min-width: 768px) {
  :root { --gutter: 28px; --header-h: 68px; }
  body { font-size: 15.5px; }

  .dash__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: stretch; }
  /* 같은 줄 카드 높이를 맞추고, 카드 안 하단 버튼은 바닥에 붙인다 */
  .dash__grid > .card { display: flex; flex-direction: column; }
  .dash__grid > .card > .card__cta { margin-top: auto; }
  .dash__grid > .card > .program { margin-bottom: 18px; }
  .map { height: 200px; margin-top: 14px; }
  .card { padding: 20px; }

  .askbar { max-width: 560px; }

  .filters { grid-template-columns: 1fr 180px 180px auto; align-items: center; }
  .facility-grid { grid-template-columns: repeat(2, 1fr); }
  .facility-map { height: 540px; }
  .site-footer__inner { grid-template-columns: auto 1fr; align-items: center; gap: 16px; }
  .auth__card { padding: 34px 32px; }
}

@media (min-width: 1080px) {
  :root { --gutter: 40px; --header-h: 76px; }

  /* 헤더 */
  .nav { display: flex; gap: 30px; margin-left: 34px; }
  .header__actions { gap: 10px; }
  .header__actions .icon-btn:not(.icon-btn--menu) { display: inline-grid; }
  .header__actions .btn { display: inline-flex; }
  .icon-btn--menu { display: none; }
  .user { display: block; }
  .drawer { display: none !important; }

  /* 히어로 */
  .hero { padding: 0 0 34px; min-height: 430px; }
  .hero__media {
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    height: auto;
  }
  .hero__media img { object-position: 38% bottom; }
  .hero__media::after {
    background:
      linear-gradient(90deg, var(--bg) 0%, rgba(243, 246, 250, .72) 16%, rgba(243, 246, 250, 0) 44%),
      linear-gradient(180deg, rgba(243, 246, 250, 0) 72%, var(--bg) 100%);
  }
  .hero__script {
    top: 52px;
    right: clamp(40px, 6vw, 130px);
    font-size: 27px;
  }
  .hero__tagline {
    display: block;
    position: absolute;
    right: var(--gutter);
    bottom: 42px;
    z-index: 1;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .12em;
    line-height: 1.55;
    text-align: left;
  }
  .hero__inner { padding-block: 58px 0; max-width: var(--shell); }
  .hero__title { font-size: clamp(38px, 3.5vw, 50px); line-height: 1.26; }
  .eyebrow { font-size: 12px; }
  .askbar { margin-top: 30px; max-width: 610px; padding: 8px 8px 8px 20px; }
  .askbar__input { font-size: 15px; }
  .askbar__go { width: 46px; height: 46px; }
  .examples { margin-top: 16px; overflow: visible; }
  .examples--mobile { display: none; }

  /* 카드 그리드 */
  .dash { padding-bottom: 56px; }
  .dash__grid { grid-template-columns: 1fr 1.16fr 1.16fr; gap: 18px; }
  .card { padding: 22px; }
  .card__title { font-size: 17px; }

  /* 카드 1 */
  .program { grid-template-columns: 112px 1fr; align-items: start; }
  .program__thumb { width: 112px; height: 108px; }
  .program__arrow { display: none; }
  .card__cta { display: flex; height: 46px; margin-top: 18px; }

  /* 카드 2 */
  .card__note { display: block; margin-left: auto; color: var(--muted); font-size: 12.5px; }
  .card__more--mobile { display: none; }
  .ai__headline { font-size: 19px; }
  .route__node { padding: 14px 10px; }

  /* 카드 3 */
  .routine__row { grid-template-columns: 36px 24px minmax(72px, 1fr) auto minmax(0, 118px); gap: 10px; padding: 12.5px 0; }
  .routine__place {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 12px;
  }
  .routine__place svg { width: 13px; height: 13px; }
  .routine__time { font-size: 12px; text-align: right; white-space: nowrap; }

  /* 모바일 전용 요소 정리 */
  .mobile-cta { display: none; }
  body.has-mobile-cta { padding-bottom: 0; }

  .facility-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 9. AI 추천 · 내 루틴 ---------------------------------------------------- */
.routine__place span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__hint { margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.card__hint a { color: var(--blue); font-weight: 600; }
.flip { transform: scaleX(-1); }

/* -- 운동 상담(AI 추천)
   말풍선·아이콘 대신 '상담 기록' 문서처럼: 왼쪽은 안내, 오른쪽은 질문과 답이 차례로 쌓이는 종이 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 운동 상담: 가운데 한 줄짜리 대화 화면 (대화가 없을 땐 인사 + 예시 질문) */
.is-assistant { background: var(--surface); }
/* 본문이 헤더와 푸터 사이 높이를 다 채워서, 입력칸이 늘 화면 아래(푸터 바로 위)에 온다 */
.is-assistant #main { display: flex; flex-direction: column; }
.consult { display: flex; flex: 1 0 auto; }

.consult__column {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  max-width: 768px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 대화 전: 인사 + 예시 질문을 입력칸 위 빈 공간 가운데에 */
.consult__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
  padding: 40px 0 28px;
  text-align: center;
}
.consult__hero[hidden] { display: none; }
.consult__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--blue);
}
.consult__mark svg { width: 22px; height: 22px; }
.consult__title { font-size: 28px; font-weight: 700; letter-spacing: -.03em; }
.consult__lead { max-width: 460px; margin-top: 10px; color: var(--ink-2); font-size: 15px; line-height: 1.7; word-break: keep-all; }
.consult__status { margin-top: 10px; color: #b7791f; font-size: 13px; }
.consult__examples {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 30px;
}
.consult__examples button {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  word-break: keep-all;
  transition: background .15s ease, border-color .15s ease;
}
.consult__examples button:hover { border-color: #c9d3df; background: var(--soft); color: var(--ink); }

/* 대화 */
.transcript { display: grid; gap: 34px; padding-top: 32px; }
.transcript:empty { display: none; }
.turn { display: grid; gap: 22px; scroll-margin-top: calc(var(--header-h) + 20px); }

.turn__q { display: flex; justify-content: flex-end; }
.turn__question {
  max-width: 78%;
  padding: 10px 16px;
  border-radius: 20px;
  background: #eef1f5;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.turn__a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; align-items: start; }
.turn__avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--blue);
}
.turn__avatar svg { width: 15px; height: 15px; }
.turn__body { min-width: 0; padding-top: 3px; }
.turn__answer { color: var(--ink); font-size: 15.5px; line-height: 1.8; white-space: pre-line; word-break: keep-all; }
.turn__answer[hidden] { display: none; }

/* 답변 준비 중: 점 세 개 */
.turn__pending { display: flex; gap: 5px; height: 24px; align-items: center; }
.turn__pending i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  animation: consult-dot 1.2s ease-in-out infinite;
}
.turn__pending i:nth-child(2) { animation-delay: .15s; }
.turn__pending i:nth-child(3) { animation-delay: .3s; }
@keyframes consult-dot {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes consult-wait { to { width: 1.2em; } }   /* 식단 사진 분석 중 표시에서 쓴다 */

.turn.is-error .turn__answer { color: #b93b40; }
.turn__meta { margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.turn__meta[hidden] { display: none; }

/* 추천 시설 카드 */
.picks { display: grid; gap: 10px; margin-top: 18px; }
.picks[hidden] { display: none; }
.pick {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.pick__no {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.pick__name { color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: -.02em; word-break: keep-all; }
.pick__meta { margin-top: 3px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.pick__reason { margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 1.65; word-break: keep-all; }
.pick__meta[hidden], .pick__reason[hidden] { display: none; }
.pick__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pick__links a {
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color .15s ease, color .15s ease;
}
.pick__links a:hover { border-color: var(--blue); color: var(--blue); }
.pick__links a[hidden] { display: none; }

/* 이어서 물어보기: 칩 */
.turn__more { margin-top: 16px; }
.turn__more[hidden] { display: none; }
.turn__more-list { display: flex; flex-wrap: wrap; gap: 8px; }
.turn__more-list button {
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.turn__more-list button:hover { background: var(--soft); color: var(--ink); }

/* 입력칸: 아래에 붙은 둥근 상자 */
.composer-dock {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  padding: 18px 0 12px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface) 18px);
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 10px 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 2px 6px rgba(15, 26, 44, .04), 0 10px 28px rgba(15, 26, 44, .07);
  transition: border-color .15s ease;
}
.composer:focus-within { border-color: #c4cfdc; }
.composer__input {
  flex: 1;
  min-height: 36px;
  max-height: 200px;
  padding: 7px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15.5px;
  line-height: 1.5;
  resize: none;
  outline: none;
}
.composer__input::placeholder { color: var(--muted); }
.composer__send {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  transition: background .15s ease, opacity .15s ease;
}
.composer__send svg { width: 18px; height: 18px; }
.composer__send:hover { background: #26303d; }
.composer__send:disabled { background: #c9d1db; cursor: default; }
.consult__note { margin-top: 10px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 767px) {
  .consult__hero { padding-top: 28px; }
  .consult__title { font-size: 23px; }
  .consult__lead { font-size: 14.5px; }
  .consult__examples { grid-template-columns: 1fr; margin-top: 22px; }
  .transcript { gap: 28px; padding-top: 22px; }
  .turn__question { max-width: 88%; }
  .turn__a { grid-template-columns: 1fr; gap: 10px; }
  .turn__avatar { display: none; }
  .composer-dock { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .composer__input { font-size: 16px; }   /* iOS 는 16px 미만 입력칸에 포커스하면 화면을 확대한다 */
  .consult__note { font-size: 11.5px; }
}

/* -- 내 루틴 */
.routines__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
}
.week-nav__center { position: relative; display: flex; align-items: center; gap: 8px; }
.week-nav__label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.week-nav__label:hover, .week-nav__label[aria-expanded="true"] { background: var(--soft); }
.week-nav__label svg { width: 16px; height: 16px; color: var(--muted); }

/* 주 선택 달력 */
.week-picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  z-index: 30;
  width: 292px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  transform: translateX(-50%);
}
.week-picker[hidden] { display: none; }
.week-picker__head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.week-picker__select {
  flex: 1;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 600;
}
.week-picker__nav {
  flex: none;
  width: 32px;
  height: 34px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-2);
  font-size: 18px;
}
.week-picker__nav:hover { background: var(--soft); }
.week-picker__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.week-picker__weekday { display: grid; place-items: center; height: 26px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
/* 한 줄 = 한 주. contents 로 풀어 날짜가 격자에 바로 놓이게 하고, 줄 단위로 강조한다 */
.week-picker__week { display: contents; }
.week-picker__week:hover .week-picker__day { background: var(--soft); }
.week-picker__day {
  display: grid;
  place-items: center;
  height: 34px;
  color: var(--ink);
  font-size: 13.5px;
}
.week-picker__day.is-outside { color: var(--line-strong); }
.week-picker__day.is-today { box-shadow: inset 0 0 0 1.5px var(--blue); font-weight: 700; }
.week-picker__week.is-selected .week-picker__day { background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.week-picker__week:hover .week-picker__day:hover { background: var(--blue); color: #fff; border-radius: 8px; }
.week-picker__day:first-child { border-radius: 8px 0 0 8px; }
.week-picker__day:last-child { border-radius: 0 8px 8px 0; }
.week-picker__foot { display: flex; justify-content: flex-end; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.week-picker__foot a { color: var(--blue); font-size: 13px; font-weight: 600; }

.week { display: grid; gap: 8px; }
.day {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.day.is-today { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.day__label { display: grid; line-height: 1.3; }
.day__weekday { font-size: 15px; font-weight: 800; }
.day__date { color: var(--muted); font-size: 12px; }
.day.is-today .day__weekday { color: var(--blue); }
.day__rest { padding-top: 6px; color: var(--muted); font-size: 13.5px; }
.day__items { display: grid; gap: 10px; }

.entry { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; }
.entry__title { font-size: 14.5px; font-weight: 600; }
.entry__meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: 12.5px; }
.entry__meta span { display: inline-flex; align-items: center; gap: 4px; }
.entry__meta svg { width: 13px; height: 13px; }
.entry__delete { width: 32px; height: 32px; color: var(--muted); }
.entry__delete svg { width: 16px; height: 16px; }
.entry__delete:hover { color: #d43f45; }

.routine-form { margin-top: 18px; }
.routine-form summary { list-style: none; width: fit-content; }
.routine-form summary::-webkit-details-marker { display: none; }
.routine-form[open] summary { margin-bottom: 12px; }
.routine-form__body {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.routine-form__grid { display: grid; gap: 12px; }
.routine-form__body > .btn { justify-self: start; }

@media (min-width: 768px) {
  .routine-form__grid { grid-template-columns: 120px 1fr 130px 130px; }
  .field--place { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
