/* ==========================================================================
   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;

  --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;
}

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 .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; }

.hero__lead {
  margin-top: 14px;
  max-width: 34ch;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.65;
}

.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; }
.examples__label { color: var(--muted); font-size: 13px; }
.examples--desktop { 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; }

/* -- 카드 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; }

/* 경로 지도 — 모바일/데스크톱 공통으로 보여준다. */
.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); }

.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__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; }

/* 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; }
  .hero__lead { margin-top: 12px; max-width: none; font-size: 13px; line-height: 1.62; }

  .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; }
  .map { height: 200px; margin-top: 14px; }
  .card { padding: 20px; }

  .hero__lead { max-width: 42ch; font-size: 15px; }
  .askbar { max-width: 560px; }

  .filters { grid-template-columns: 1fr 180px 180px auto; align-items: center; }
  .facility-grid { grid-template-columns: repeat(2, 1fr); }
  .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--desktop { display: flex; }
  .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 추천 */
.assistant__shell { max-width: 760px; }

/* 인트로: 첫 화면에서만 크게, 대화가 시작되면 접는다(.is-chatting) */
.assistant__intro { margin-bottom: 22px; }
.assistant__mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue) 0%, #5b9bff 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(26, 109, 240, .28);
}
.assistant__mark svg { width: 24px; height: 24px; }
.assistant__intro .eyebrow { margin-bottom: 6px; }
.assistant__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 6px 12px;
  border-radius: var(--pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
}
.assistant__status span { width: 7px; height: 7px; border-radius: 50%; background: #f5a524; }

.is-chatting .assistant__mark,
.is-chatting .assistant__intro .eyebrow,
.is-chatting .assistant__intro .page__lead { display: none; }
.is-chatting .assistant__intro { margin-bottom: 4px; }
.is-chatting .assistant__intro .page__title { font-size: 20px; }

/* 추천 질문: 길이가 제각각인 알약 대신 같은 폭의 행으로 */
.assistant__empty-title { margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.suggest { display: grid; gap: 8px; }
.suggest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: left;
  transition: border-color .16s ease, transform .16s ease;
}
.suggest__item:hover { border-color: var(--blue); }
.suggest__item:active { transform: scale(.99); }
.suggest__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
}
.suggest__icon svg { width: 16px; height: 16px; }
.suggest__text { flex: 1; min-width: 0; color: var(--ink); font-size: 14.5px; font-weight: 500; }
.suggest__go { width: 16px; height: 16px; color: var(--muted); }

/* 대화 */
.thread { display: grid; gap: 18px; padding: 8px 0 18px; }
.thread:empty { display: none; }
.bubble { scroll-margin-top: calc(var(--header-h) + 16px); scroll-margin-bottom: 120px; }
.bubble--user { display: flex; justify-content: flex-end; }
.bubble--user .bubble__text {
  max-width: 82%;
  padding: 10px 15px;
  border-radius: 18px 18px 4px 18px;
  background: var(--blue);
  color: #fff;
  font-size: 15px;
  line-height: 1.55;
}
.bubble--ai { display: grid; gap: 8px; }
.bubble__who { display: flex; align-items: center; gap: 8px; }
.bubble__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
}
.bubble__avatar svg { width: 16px; height: 16px; }
.bubble__name { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.bubble__body {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 4px 18px 18px 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.bubble--ai .bubble__text { font-size: 15px; line-height: 1.75; white-space: pre-line; word-break: keep-all; }
.bubble--error .bubble__body { border-color: #f4cdcf; background: #fdf6f6; }
.bubble--error .bubble__text { color: #b93b40; }
.bubble__meta { margin-top: 12px; color: var(--muted); font-size: 12px; }

.typing { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: typing 1s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
.typing em { margin-left: 6px; font-style: normal; }
@keyframes typing {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* 추천 시설 카드 */
.picks { display: grid; gap: 10px; margin-top: 16px; }
.pick {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--soft);
}
.pick__head { display: flex; gap: 11px; }
.pick__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--blue);
}
.pick__icon svg { width: 18px; height: 18px; }
.pick__title { min-width: 0; }
.pick__name { font-size: 15.5px; font-weight: 700; line-height: 1.4; letter-spacing: -.02em; word-break: keep-all; }
.pick__title .tags { margin-top: 5px; gap: 4px; }
.pick__title .tag { padding: 2px 8px; background: var(--surface); font-size: 11.5px; }
.pick__reason { margin-top: 10px; color: var(--ink-2); font-size: 14px; line-height: 1.65; }
.pick__address { margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pick__actions { display: flex; gap: 6px; margin-top: 12px; }
.pick__actions .btn { height: 38px; padding-inline: 14px; font-size: 13px; }
.pick__actions .btn--primary { margin-left: auto; }

.follow-ups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.follow-ups .chip { padding: 8px 13px; font-size: 13px; }

/* 입력창 */
.composer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding: 12px 0 calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(243, 246, 250, 0), var(--bg) 35%);
}
.assistant__askbar { max-width: none; margin-top: 0; }
.assistant__askbar input:disabled { background: none; }
.assistant__disclaimer { margin-top: 8px; color: var(--muted); font-size: 11.5px; text-align: center; }
.assistant.page { padding-bottom: 0; }

@media (max-width: 767px) {
  .assistant.page { padding-top: 20px; }
  .assistant__intro .page__title { font-size: 24px; }
  .assistant__intro .page__lead { font-size: 14px; }

  /* 입력창을 화면 하단에 고정 (채팅 앱처럼) */
  .composer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding-top: 18px; }
  .assistant.page { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
  /* iOS는 16px 미만 입력창에 포커스하면 화면을 확대한다 */
  .assistant__askbar .askbar__input { font-size: 16px; }
  .assistant__askbar { padding: 6px 6px 6px 8px; box-shadow: 0 6px 24px rgba(15, 26, 44, .10); }
  .is-assistant .site-footer { display: none; }

  .bubble__body { padding: 14px; }
  /* 이어서 물어볼 질문은 한 줄 가로 스크롤 */
  .follow-ups { flex-wrap: nowrap; overflow-x: auto; margin-inline: -14px; padding-inline: 14px; scrollbar-width: none; }
  .follow-ups::-webkit-scrollbar { display: none; }
  .follow-ups .chip { flex: none; }
  .pick__actions .btn { flex: 1; padding-inline: 8px; }
  .pick__actions .btn--primary { flex: 1.4; margin-left: 0; }
}

/* -- 내 루틴 */
.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__label { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }

.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; }
}
