/* 바다체크 — 모바일 우선 스타일
   디자인 토큰은 :root 에 모아 두었다. 색·간격·글꼴을 바꿀 때는 여기만 고치면 된다. */
:root {
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;

  --bg: #eef5fb;
  --surface: #ffffff;
  --surface-2: #f3f8fc;
  --text: #0f172a;
  --text-2: #3d4b5f;
  --text-3: #5b6b80;
  --border: #dbe7f1;
  --border-strong: #c2d3e3; /* 입력창·버튼 테두리 */

  --primary: #0b4f8a;        /* 흰 글자 대비 8:1 */
  --primary-hover: #093f6e;
  --primary-text: #0b5ea8;   /* 링크·강조 글자 */
  --primary-soft: #e3f0fb;
  --on-primary: #ffffff;
  --accent: #f59e0b;         /* 해·별 (글자색으로 쓰지 않음) */
  --high: #be123c;           /* 만조 고유색 (카드 글자·그래프 점 공통) */
  --low: #0f766e;            /* 간조 고유색 */
  --danger: #c2410c;
  --danger-bg: #fff1e8;
  --ok: #166534;

  --hero-1: #0a2a52;
  --hero-2: #0d5a91;
  --hero-3: #3aa3d6;

  /* 모서리: 시트 20 / 카드 16 / 버튼·사진·안쪽 상자 10 / 배지 6 / 탭·칩·검색창은 알약(999) */
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --pill: 999px;
  --map-water: #a8d5f2; /* 지도 바다색 (지도가 뜨기 전 바탕) */
  --card-line: #d3e5f4;
  --card-shadow: 0 4px 16px rgba(30, 90, 150, .08);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 18px rgba(14, 50, 90, .07);
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08111e; --surface: #0f1b2c; --surface-2: #15243a; --text: #e8eef6; --text-2: #b8c6d6; --text-3: #94a6ba; --border: #22344b; --border-strong: #33496a;
    --primary: #1f6fb0; --primary-hover: #2a7cc0; --primary-text: #7cc4f2; --primary-soft: #14304d; --on-primary: #ffffff;
    --high: #fb7185; --low: #5fd4c4; --danger: #fb923c; --danger-bg: #3a1d10; --ok: #4ade80;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    --card-line: #22344b; --card-shadow: none; --map-water: #0a1c30;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #08111e; --surface: #0f1b2c; --surface-2: #15243a; --text: #e8eef6; --text-2: #b8c6d6; --text-3: #94a6ba; --border: #22344b; --border-strong: #33496a;
  --primary: #1f6fb0; --primary-hover: #2a7cc0; --primary-text: #7cc4f2; --primary-soft: #14304d; --on-primary: #ffffff;
  --high: #fb7185; --low: #5fd4c4; --danger: #fb923c; --danger-bg: #3a1d10; --ok: #4ade80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  --card-line: #22344b; --card-shadow: none; --map-water: #0a1c30;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--primary-text); outline-offset: 2px; border-radius: var(--radius-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 8px; }
.ic { flex: none; display: block; }
.muted { color: var(--text-3); }
.small { font-size: 14px; }

/* 앱 틀: 폰에서는 꽉 차고, 큰 화면에서는 가운데 폰 폭으로 */
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--bg); position: relative; }
@media (min-width: 520px) { body { background: #d9e6f1; } :root[data-theme="dark"] body { background: #050b14; } .app { box-shadow: 0 0 40px rgba(0, 0, 0, .12); } }
@media (min-width: 520px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { background: #050b14; } }
main { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); outline: none; }
body.no-tabs main { padding-bottom: calc(var(--safe-b) + 16px); }
/* 간격: 섹션 사이 16, 카드 안 12, 요소 사이 8 (4/8 배수) */
.page-body, .stack { display: flex; flex-direction: column; gap: 16px; }
.page-body { padding: 16px; }
/* 흰 시트: 머리 사진·상단 바 아래에 둥근 윗모서리로 얹는다 */
main > .page-body, .detail-sheet { background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.hero + .page-body { position: relative; margin-top: -20px; }
/* 홈(폰): 상자 없이 흰 시트 위에 바로 놓고, 현재 지역 아래만 구분선으로 나눈다.
   PC 는 현재 지역 카드가 머리 사진 위로 겹쳐 올라가므로 상자를 그대로 둔다 */
@media (max-width: 1023px) {
  .home-body .card, .home-body .card.soft { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
  .home-body > .now-card { padding-bottom: 16px; border-bottom: 1px solid var(--border); }
  .home-body .tide-pair { background: none; padding: 4px 0; }
}

/* 상단 바 */
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; min-height: 52px; padding: var(--safe-t) 4px 0; }
.appbar-solid { background: var(--bg); }
.appbar-clear { position: absolute; left: 0; right: 0; top: 0; background: none; }
.appbar-title { flex: 1; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; padding-left: 8px; }
.appbar-actions { display: flex; }
.small-title { font-size: 17px; opacity: 0; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--radius-sm); color: var(--text); transition: background .15s var(--ease); }
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.on-dark, .on-dark { color: #fff; }
.icon-btn.on-dark:hover { background: rgba(255, 255, 255, .16); }
.text-btn { min-height: 36px; padding: 0 8px; color: var(--primary-text); font-weight: 600; font-size: 15px; }
.text-btn.small { font-size: 14px; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--primary-text); font-weight: 600; font-size: 14px; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 14px; white-space: nowrap; border-radius: var(--radius-sm); font-weight: 700; font-size: 16px; transition: background .15s var(--ease); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: var(--surface); color: var(--primary-text); border: 1px solid var(--card-line); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 14px; }

/* 검색창 */
/* 알약 모양 36px. 누르는 범위는 위아래로 넓혀 44px 를 맞춘다 */
.search-field { position: relative; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 16px; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--pill); color: var(--text-3); }
a.search-field::after { content: ""; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
.search-field > .ic { flex: none; width: 20px; height: 20px; }
.search-field input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); height: 40px; padding: 0; outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field:focus-within { border-color: var(--primary-text); }
.search-ph { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.search-field.compact { flex: 1; }
.clear-btn { width: 30px; height: 30px; display: grid; place-items: center; color: var(--text-3); }
.clear-btn[hidden] { display: none; }
.search-bar { gap: 0; padding-right: 4px; }
.search-bar .text-btn { flex: none; white-space: nowrap; }
.search-bar .search-field { min-width: 0; }

/* 홈 머리: 로고 + 검색. 상세 머리(.detail-hero)와 같은 200px 로 맞추고 검색창은 아래에 붙인다 */
.hero { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: 200px; padding: var(--safe-t) 16px 36px; color: #fff; background: var(--hero-1); overflow: hidden; }
.hero-bg { display: none; }
/* 배경 사진(원산도해수욕장). 위쪽만 살짝 어둡게 해 흰 로고를 읽히게 하고 바다색은 살린다 */
.hero-img { position: absolute; inset: 0; z-index: -2; }
.hero-img img, .hero-img svg { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 45%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(4, 30, 60, .55) 0%, rgba(4, 30, 60, .35) 55%, rgba(4, 30, 60, .35) 100%); }
.brand, .hero .icon-btn { text-shadow: 0 1px 4px rgba(0, 0, 0, .35); }

.hero-top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
/* 로고 그림은 흰 바탕 둥근 사각이라 사진 위에서도 그대로 보인다 */
.brand-logo { flex: none; display: block; border-radius: 7px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.hero-actions { display: flex; margin-right: -8px; }
.hero .search-field { margin-top: auto; border-color: transparent; box-shadow: 0 2px 10px rgba(4, 30, 60, .18); }
.hero-copy { margin: 10px 0 14px; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.hero-m-title { font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; }
.hero-m-sub { margin-top: 4px; font-size: 14px; font-weight: 500; opacity: .95; }

/* 카드: 옅은 하늘색 선 + 아주 옅은 그림자 */
.card { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--card-shadow); }
.card.soft { background: var(--surface-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h2.small, h2.small { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

.now-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chip-tag { display: block; font-size: 14px; font-weight: 600; color: var(--text-3); }
.now-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.now-name .ic { color: var(--primary-text); }
.now-weather, .detail-weather { display: flex; align-items: center; gap: 6px; text-align: right; white-space: nowrap; flex: none; }
.now-weather strong, .detail-weather strong { display: block; font-size: 20px; line-height: 1.15; }
.now-weather small, .detail-weather small { display: block; font-size: 14px; color: var(--text-3); }
.sun-ic { color: var(--accent); }
.now-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 -8px; }

/* 만조·간조 */
.tide-pair { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.tide-pair .tide-item { flex: 1; text-align: center; }
.tide-item { display: block; line-height: 1.3; }
.tide-item small { display: block; font-size: 14px; color: var(--text-3); }
.tide-item .tide-type { font-weight: 700; }
.tide-item.high .tide-type { color: var(--high); }
.tide-item.low .tide-type { color: var(--low); }
.tide-item strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.row-chev { color: var(--text-3); }
/* 하루 3~4번을 두 칸씩 (시각 순서대로 읽히게) */
/* 카드 안 첫 줄: 간조 ▼ · 1.2m / 둘째 줄: 시각 */

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.stat-row.two { grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-row > div { text-align: center; }
.stat-row.two > div { text-align: left; }
.stat-row dt { font-size: 14px; color: var(--text-3); display: flex; align-items: center; justify-content: center; gap: 2px; }
.stat-row.two dt { justify-content: flex-start; }
.stat-row dt .ic { color: var(--primary-text); width: 16px; height: 16px; }
.stat-row dd { margin: 0; font-size: 16px; font-weight: 700; }
.stat-row dd small.block { display: block; margin: 0; }
.stat-row dd small { font-size: 14px; font-weight: 500; color: var(--text-3); margin-left: 2px; }
.mulddae-wrap { position: relative; display: inline-flex; align-items: center; }
.help-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-right: -6px; border-radius: 50%; color: var(--text-3); }
.help-btn[aria-expanded="true"] { color: var(--primary-text); }
/* 물때 설명 미니팝업: ? 버튼 바로 아래, 오른쪽 끝을 맞춰 띄운다 */
.mulddae-help { position: absolute; top: calc(100% + 6px); right: -6px; z-index: 20; width: min(300px, calc(100vw - 48px)); padding: 12px 14px; border-radius: var(--radius-sm); background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary-text) 35%, transparent); box-shadow: 0 10px 28px rgba(14, 50, 90, .28); text-align: left;font-size: 14px; line-height: 1.55; color: var(--text-2); }
.mulddae-help strong { color: var(--primary-text); margin-right: 2px; }
.mulddae-help p { margin: 0; }
.mulddae-help small { display: block; margin-top: 6px; font-size: 13px; color: var(--text-3); }
.mulddae-help small.mulddae-close { margin-top: 8px; padding-top: 6px; border-top: 1px solid color-mix(in srgb, var(--primary-text) 20%, transparent); text-align: center; }
.mulddae-tips { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.mulddae-tips li { display: flex; gap: 8px; }
.mulddae-tips b { flex: none; min-width: 2.6em; font-weight: 700; color: var(--text); }
.mulddae-tips li.warn b, .mulddae-tips li.warn span { color: var(--danger); }
.mulddae { font-size: 14px; font-weight: 700; color: var(--primary-text); background: var(--primary-soft); padding: 2px 8px; border-radius: var(--radius-xs); }

/* 배지 */
.badge { display: inline-flex; align-items: center; font-size: 14px; font-weight: 700; line-height: 1.4; padding: 0 6px; border-radius: var(--radius-xs); vertical-align: middle; }
.badge-fcst { background: var(--primary-soft); color: var(--primary-text); }
.badge-obs { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge-sample { background: var(--danger-bg); color: var(--danger); }

/* 섹션 머리 */
.section-head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 4px; }
.section-head h2 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.more-link { display: inline-flex; align-items: center; font-size: 14px; color: var(--text-3); min-height: 40px; margin-right: -4px; }

/* 썸네일 타일 */
.tile-scroll { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
.tile-scroll::-webkit-scrollbar { display: none; }
.tile-scroll .tile { flex: 0 0 100px; scroll-snap-align: start; }
.tile { display: flex; flex-direction: column; gap: 4px; }
.tile-img { display: block; aspect-ratio: 1 / 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.tile-lg .tile-img { aspect-ratio: 4 / 3; }
.tile-img svg, .row-thumb svg, .promo-img svg, .detail-hero-img svg { width: 100%; height: 100%; display: block; }
.tile-img img, .row-thumb img, .promo-img img, .detail-hero-img img { width: 100%; height: 100%; display: block; object-fit: cover; }
.tile-name { font-size: 14px; font-weight: 600; text-align: center; line-height: 1.3; }
.tile:hover .tile-img { filter: brightness(1.05); }
.tile-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; }
.tile-grid.three { grid-template-columns: repeat(3, 1fr); }
.tile-wrap { position: relative; }
.tile-del { position: absolute; top: -8px; right: -8px; width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--surface); display: grid; place-items: center; }
.editing .tile { pointer-events: none; opacity: .8; }

/* 지역 요약 카드: 사진 + 이름·기온 + 다음 간조·만조 + 밀물/썰물·파고·바람 + 특보 */
.rcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.rcard { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.rcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rcard-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.rcard-img img, .rcard-img svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.rcard-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.rcard-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rcard-title strong { font-size: 17px; }
.rcard-weather { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; }
.rcard-tides { display: flex; gap: 16px; font-size: 15px; }
.rcard-tide small { font-size: 14px; font-weight: 700; }
.rcard-tide.high small { color: var(--high); }
.rcard-tide.low small { color: var(--low); }
.rcard-tide b { font-size: 17px; }
.rcard-meta { font-size: 14px; color: var(--text-3); }
.rcard-warn { display: inline-flex; align-self: flex-start; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-xs); background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 700; }
.rcard-line { display: block; height: 16px; border-radius: var(--radius-xs); }
.rcard-line.short { width: 60%; }

/* 칩 */
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; margin: 0; padding: 0; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 14px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--card-line); font-size: 14px; font-weight: 600; color: var(--text-2); transition: background .15s, color .15s; }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip-del { padding: 0 2px 0 12px; gap: 0; }
.chip-del > button:first-child { min-height: 32px; }
.chip-del .del { width: 28px; height: 28px; display: grid; place-items: center; color: var(--text-3); }

/* 세그먼트 탭: 선택된 칸만 흰 바탕 */
.segmented { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border); }
.segmented button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 40px; border-radius: 6px; font-size: 15px; font-weight: 600; color: var(--text-3); transition: background .15s var(--ease), color .15s; }
.segmented button.on { background: var(--surface); color: var(--primary-text); font-weight: 700; box-shadow: 0 0 0 1px var(--border-strong); }
.segmented.small { margin-top: 8px; max-width: 280px; }
.segmented.small button { min-height: 36px; font-size: 14px; }

/* 지도 */
/* isolation: 지도 안의 핀·버튼이 지도 상자 밖의 메뉴·탭 위로 올라오지 않게 */
.map-card { position: relative; isolation: isolate; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.map-full { isolation: isolate; }
.map { height: 240px; background: var(--map-water); }
.map-full .map { height: 46vh; min-height: 300px; }
.map-expand { position: absolute; right: 8px; bottom: 8px; z-index: 500; background: var(--surface); border: 1px solid var(--border-strong); }
.map-fallback { padding: 24px; text-align: center; color: var(--text-2); }
.pin { position: relative; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, -100%); }
.pin-dot { width: 20px; height: 20px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--primary); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.pin-active .pin-dot { background: #f59e0b; width: 26px; height: 26px; }
.pin-label { margin-bottom: 4px; padding: 0 6px; border-radius: var(--radius-xs); background: #fff; color: #0f172a; font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
/* 핀: 크기 0 인 버튼을 좌표에 두고, 안쪽 .pin 이 그 점을 아래 끝으로 서게 한다 */
.map-pin { width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.map-pin:focus-visible { outline: none; }
/* 멀리서 볼 때: 고르지 않은 핀은 이름표 없이 작은 점으로, 점의 가운데가 좌표에 오게 */
.map-far .pin:not(.pin-active) { transform: translate(-50%, -50%); }
.map-far .pin:not(.pin-active) .pin-label { display: none; }
.map-far .pin:not(.pin-active) .pin-dot { width: 12px; height: 12px; border-radius: 50%; border-width: 2px; transform: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
/* 가까이 볼 때 다른 이름표와 겹쳐 숨긴 이름표 */
.pin-label.lbl-off { visibility: hidden; }
.map-pin:focus-visible .pin-dot { outline: 3px solid var(--primary-text); outline-offset: 2px; }
.maplibregl-map { font-family: var(--font); }
.maplibregl-ctrl-attrib { font-size: 12px; }
/* '크게 보기' 버튼이 있는 작은 지도: 출처 (i) 버튼을 그 왼쪽으로 */
.map-card:has(.map-expand) .maplibregl-ctrl-bottom-right { right: 52px; }

.cta-card, .selected-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius); background: var(--primary-soft); color: var(--text); }
.selected-card { background: var(--surface); border: 1px solid var(--border); }
.cta-card > span:nth-child(2), .selected-card .row-text { flex: 1; }
.cta-card strong { display: block; font-size: 16px; }
.cta-card small { display: block; font-size: 14px; color: var(--text-3); }
.cta-ic { width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }

/* 목록 행 */
.rows { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--border); }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 64px; }
.row:hover { background: var(--surface-2); }
.row-thumb { width: 56px; height: 42px; border-radius: var(--radius-sm); overflow: hidden; flex: none; }
.row-text { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 700; }
.row-sub { display: block; font-size: 14px; color: var(--text-3); }
.plain-list li + li { border-top: 1px solid var(--border); }
.list-btn { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 48px; text-align: left; font-size: 15px; justify-content: flex-start; }
.card .list-btn { min-height: 44px; font-size: 14px; color: var(--primary-text); font-weight: 600; justify-content: space-between; margin-bottom: -8px; }
.rank { width: 22px; font-weight: 800; color: var(--primary-text); }

/* 빈 화면 */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 8px; color: var(--text-3); }
.empty .ic { color: var(--primary-text); opacity: .7; }
.empty-title { font-weight: 700; color: var(--text); }
.empty-body { font-size: 14px; }
.empty .btn { margin-top: 8px; }

/* 상세 */
.detail-hero { position: relative; height: 200px; color: #fff; }
.detail-hero-img { position: absolute; inset: 0; }
.detail-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 25, 50, .55) 0%, rgba(5, 25, 50, .05) 35%, rgba(5, 25, 50, .7) 100%); }
.detail-hero-body { position: absolute; left: 16px; right: 16px; bottom: 32px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.detail-name { font-size: 26px; font-weight: 800; line-height: 1.25; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.detail-addr { display: flex; align-items: center; gap: 4px; font-size: 14px; opacity: .95; }
.detail-weather small { color: rgba(255, 255, 255, .9); }
.star-btn.on { color: #fbbf24; }
.detail-sheet { position: relative; margin-top: -20px; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
/* 상세 안 항목은 상자로 감싸지 않고 구분선으로만 나눈다 */
.detail-sheet .card { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.detail-sheet .card + .card { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
/* 특보가 없으면 빈 칸이 gap 을 한 번 더 먹지 않게 */
.detail-sheet > [data-alerts]:empty { display: none; }
.date-nav { display: flex; align-items: center; gap: 0; padding: 0 2px; background: var(--surface-2); border-radius: var(--radius-sm); }
.date-nav .icon-btn { width: 36px; height: 36px; }
.date-nav .text-btn { min-height: 32px; }
.date-label { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; min-height: 36px; cursor: pointer; }
.date-label input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.date-label .ic { color: var(--primary-text); }
.tide-chart { margin: 0 -4px; }
.tide-chart svg { width: 100%; height: auto; display: block; }
.tide-chart .grid { stroke: var(--border); stroke-width: 1; }
.tide-chart .curve { fill: none; stroke: var(--primary-text); stroke-width: 2.5; }
.tide-chart .fill-top { stop-color: var(--primary-text); stop-opacity: .22; }
.tide-chart .fill-bottom { stop-color: var(--primary-text); stop-opacity: .02; }
/* SVG 글자는 화면 폭에 맞춰 줄어든다: 360 단위가 폰에서 약 310px 이므로 16.5 단위 ≈ 14px */
.tide-chart .ax { font-size: 16.5px; fill: var(--text-3); }
.tide-chart .mark { stroke: var(--surface); stroke-width: 2; }
.tide-chart .mark-high { fill: var(--high); }
.tide-chart .mark-low { fill: var(--low); }
.bottom-actions { position: sticky; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 16px calc(8px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--card-line); }

.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-xs); }
.trend-rising { background: color-mix(in srgb, var(--high) 12%, transparent); color: var(--high); }
.trend-falling { background: color-mix(in srgb, var(--low) 14%, transparent); color: var(--low); }
.big-num { font-size: 28px; font-weight: 800; line-height: 1.2; }
.grade { display: inline-block; font-size: 14px; font-weight: 700; padding: 0 6px; border-radius: var(--radius-xs); margin-left: 4px; }
.grade.g1 { background: #dbeafe; color: #1e40af; } .grade.g2 { background: #dcfce7; color: #166534; } .grade.g3 { background: #ffedd5; color: #9a3412; } .grade.g4 { background: #fee2e2; color: #991b1b; }
.warn-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 0; }
.warn-list li + li { border-top: 1px solid var(--border); }
.warn-list small { flex-basis: 100%; color: var(--text-3); font-size: 14px; }
.warn-level { font-size: 14px; font-weight: 800; padding: 0 6px; border-radius: var(--radius-xs); background: var(--danger-bg); color: var(--danger); }
.ok-text { color: var(--ok); font-weight: 600; font-size: 15px; }
.error-text { color: var(--danger); font-weight: 600; }
.alert-box { display: flex; gap: 8px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); }
.alert-box strong { display: block; }
.alert-box small { display: block; font-size: 14px; color: var(--text-2); }
.alert-strip { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-weight: 700; font-size: 14px; }
.note { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--text-3); line-height: 1.5; }
.note .ic { margin-top: 3px; }
.note-warn { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.info-list li { display: grid; grid-template-columns: 88px 1fr; gap: 8px; padding: 8px 0; font-size: 14px; }
.info-list li + li { border-top: 1px solid var(--border); }
.info-k { color: var(--text-3); }

/* 즐겨찾기 배너 */
.promo { position: relative; display: block; height: 112px; border-radius: var(--radius); overflow: hidden; color: #fff; }
.promo-img { position: absolute; inset: 0; }
.promo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 40, 80, .85), rgba(8, 40, 80, .15)); }
.promo-text { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 1; }
.promo-text strong { display: block; font-size: 18px; line-height: 1.35; }

/* 더보기 */
.menu { padding: 0; gap: 0; }
.menu li + li { border-top: 1px solid var(--border); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; text-align: left; }
.menu-item > .ic:first-child, .menu-item summary > .ic:first-child { color: var(--primary-text); }
.menu-item > span, .menu-item summary > span { flex: 1; }
.menu-item strong { display: block; font-size: 16px; }
.menu-item small { display: block; font-size: 14px; color: var(--text-3); }
.menu-item > .ic:last-child { color: var(--text-3); }
.details { display: block; padding: 0; }
.details summary { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 56px; cursor: pointer; list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details[open] .det-chev { transform: rotate(90deg); }
.source-list { padding: 0 16px 12px 52px; font-size: 14px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; list-style: disc; }

/* 하단 탭 */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--surface); border-top: 1px solid var(--border); }
.tabbar[hidden] { display: none; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; font-size: 14px; font-weight: 600; color: var(--text-3); }
.tabbar a.active { color: var(--primary-text); }
.tabbar a.active [data-icon="star"] { color: var(--accent); }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); transform: translate(-50%, 12px); max-width: calc(100% - 32px); padding: 10px 14px; border-radius: var(--radius-sm); background: #0f172a; color: #fff; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 1000; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 로딩 */
/* 사진 자리: 받기 전에는 반짝이는 회색, 받으면(.img-done) 멈춘다 */
.tile-img:has(> img):not(.img-done), .row-thumb:has(> img):not(.img-done), .rrow-thumb:has(> img):not(.img-done), .map-pick-img:has(> img):not(.img-done), .promo-img:has(> img):not(.img-done), .rcard-img:has(> img):not(.img-done) {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear;
}
.row-thumb { background: var(--surface-2); }
.detail-hero { background: var(--hero-1); }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 360px) {
  .tile-grid { grid-template-columns: repeat(3, 1fr); }
  .tide-item strong { font-size: 20px; }
  .bottom-actions .btn { font-size: 15px; gap: 4px; }
  /* 좁은 폰에서는 그래프가 더 줄어드므로 SVG 글자를 키워 14px 이상 유지 */
  .tide-chart .ax, .tide-chart .now-lbl { font-size: 20px; }
  .tide-chart .ev-lbl { font-size: 16px; }
}

/* PC 메뉴의 로고·검색·테마 버튼과 바닥글: 모바일에서는 숨김 */
.nav-brand, .nav-search, .nav-theme { display: none !important; }
.site-footer { display: none; }

/* ── PC (1024px 이상) ──────────────────────────────
   하단 탭 → 상단 메뉴, 아래에 바닥글. 모든 화면이 같은 내용선을 쓴다:
   내용 폭 --page-w(1200px), 좌우 여백은 --page-pad (화면이 좁으면 --gutter, 넓으면 가운데 정렬).
   메뉴·머리 사진·본문·바닥글 모두 왼쪽 끝이 이 선에 맞는다. 카드(흰 상자)는 바깥 테두리를 이 선에 맞춘다. */
@media (min-width: 1024px) {
  :root { --nav-h: 64px; --page-w: 1200px; --gutter: 32px; --page-pad: max(var(--gutter), calc((100% - var(--page-w)) / 2)); }
  body, :root[data-theme="dark"] body, :root:not([data-theme="light"]) body { background: var(--bg); }
  .app { max-width: none; box-shadow: none; display: flex; flex-direction: column; }
  main, body.no-tabs main { flex: 1 0 auto; padding: var(--nav-h) 0 56px; }

  /* 모바일 전용 요소: 뒤로 버튼(상단 메뉴가 있음), 더보기 탭(테마는 상단 버튼, 정보·고객센터는 바닥글) */
  [data-action="back"] { display: none !important; }
  .tabbar a[data-tab="more"] { display: none; }

  .tabbar, .tabbar[hidden] {
    display: flex; align-items: center; gap: 4px; top: 0; bottom: auto; left: 0; transform: none; max-width: none;
    height: var(--nav-h); padding: 0 var(--page-pad); border-top: 0; border-bottom: 1px solid var(--border);
  }
  .tabbar a { flex-direction: row; gap: 8px; height: 44px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
  .tabbar a:hover, .tabbar a.active { background: var(--primary-soft); }
  .tabbar .nav-brand { display: flex !important; margin-right: auto; padding-left: 0; font-size: 20px; font-weight: 800; color: var(--text); background: none; }
  .tabbar .nav-brand .ic { color: var(--primary-text); }
  /* 로고는 메뉴 칸처럼 바탕을 칠하지 않는다 (왼쪽 여백이 0이라 칠하면 한쪽으로 쏠려 보임) */
  .tabbar .nav-brand:hover { background: none; opacity: .8; }
  .tabbar .nav-brand:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 4px; border-radius: 8px; }
  .tabbar .nav-search { display: flex !important; min-width: 220px; margin-left: 12px; border: 1.5px solid var(--border); border-radius: 999px; font-weight: 500; }
  .tabbar .nav-search.active { border-color: var(--primary-text); color: var(--primary-text); }
  .tabbar .nav-theme { display: inline-grid !important; flex: none; margin-left: 4px; color: var(--text-2); }
  .toast { bottom: 24px; }

  .page-body, main > .page-body { max-width: none; margin: 0; padding: 24px var(--page-pad) 0; gap: 28px; background: none; border-radius: 0; box-shadow: none; }
  .hero + .page-body { margin-top: 0; }
  .appbar-solid { position: static; min-height: 0; padding: 32px var(--page-pad) 0; }
  .appbar-title { padding-left: 0; font-size: 26px; font-weight: 800; }
  .appbar-solid .appbar-actions { display: none; } /* 검색·메뉴 버튼은 상단 메뉴에 있음 */

  .chips, .tile-scroll, .hstrip { margin: 0; padding-left: 0; padding-right: 0; }
  .tile-scroll { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; overflow: visible; }
  .tile-scroll .tile { flex: none; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
  .tile-grid.three { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .row:hover, .tile:hover .tile-img { cursor: pointer; }

  /* 홈: 가운데 큰 검색 → 내 지역 넓은 패널(머리 사진에 걸침) → 즐겨찾기 + 특보 현황 → 인기 바다 카드 */
  body[data-route="home"] .tabbar .nav-search { display: none !important; } /* 머리에 큰 검색창이 있음 */
  .hero-desk { min-height: 0; padding: 56px var(--page-pad) 88px; align-items: center; text-align: center; }
  .hero-desk::before { background: linear-gradient(180deg, rgba(4, 30, 60, .55) 0%, rgba(4, 30, 60, .3) 100%); }
  .hero-desk-inner { width: 100%; max-width: 720px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
  .hero-title { font-size: 40px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
  .hero-sub { font-size: 17px; opacity: .95; margin-bottom: 16px; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
  .hero-desk .search-field { width: 100%; max-width: 560px; margin-top: 0; text-align: left; }
  .hero-note { margin: -10px 0 14px; font-size: 14px; opacity: .85; text-shadow: 0 1px 6px rgba(0, 0, 0, .3); }
  .desk-home { gap: 36px; }
  .now-panel { position: relative; margin-top: -56px; padding: 24px 28px; gap: 16px; }
  .np-grid { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr .8fr; gap: 24px; align-items: start; }
  .np-grid > * + * { padding-left: 24px; border-left: 1px solid var(--border); }
  .np-name { display: flex; align-items: center; gap: 6px; margin: 2px 0 4px; font-size: 26px; font-weight: 800; }
  .np-name .ic { color: var(--primary-text); }
  .np-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
  .np-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; color: var(--text-3); }
  .np-tides { display: flex; gap: 28px; }
  .np-tides .tide-item strong { font-size: 30px; }
  .np-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 15px; color: var(--text-2); }
  .np-weather { display: flex; align-items: center; gap: 10px; }
  .np-weather strong { font-size: 32px; font-weight: 800; line-height: 1.1; }
  .np-weather small { font-size: 15px; color: var(--text-3); }
  .np-sun { display: flex; flex-direction: column; gap: 10px; margin: 0; }
  .np-sun div { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .np-sun dt { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text-3); }
  .np-sun dt .ic { color: var(--primary-text); }
  .np-sun dd { margin: 0; font-size: 20px; font-weight: 700; }
  .desk-home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .desk-home-grid .section-head { margin-top: -8px; }
  .warn-panel { gap: 12px; padding: 20px; }
  .warn-panel h2 .ic { color: var(--danger); }
  .warn-sum { display: flex; flex-direction: column; gap: 12px; }
  .warn-sum li { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
  .warn-places { font-size: 15px; line-height: 1.6; }
  .warn-places a { font-weight: 600; }
  .warn-places a:hover { color: var(--primary-text); text-decoration: underline; }

  /* 검색 (PC): 검색 전에는 왼쪽 최근·인기 검색어, 오른쪽 권역 바로가기·인기 바다 카드 */
  .search-desk { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; }
  .search-desk .card .list-btn { justify-content: flex-start; margin-bottom: 0; color: var(--text); font-size: 15px; font-weight: 500; }
  .search-desk .card .list-btn:hover { color: var(--primary-text); }
  body[data-route="search"] .page-body > .segmented { max-width: 420px; }

  /* 즐겨찾기 (PC): 카드로 비교. 홍보 배너는 폰에서만 */
  body[data-route="favorites"] .page-body > .segmented { max-width: 420px; }
  body[data-route="favorites"] .promo { display: none; }
  .rcard-grid .tile-wrap > .rcard { height: 100%; }
  .rcard-grid.editing .rcard { pointer-events: none; opacity: .8; }

  /* 정보·출처 (PC): 문서처럼 두 단, 사진 출처는 아래 넓게 */
  body[data-route="about"] .page-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  body[data-route="about"] .page-body > section:nth-of-type(3), body[data-route="about"] .about-version { grid-column: 1 / -1; }
  body[data-route="about"] .page-body > section:nth-of-type(3) .info-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  body[data-route="about"] .page-body > section:nth-of-type(3) .info-list li + li { border-top: 0; }
  body[data-route="about"] .page-body > section:nth-of-type(3) .info-list li { border-bottom: 1px solid var(--border); }
  /* 더보기 (PC 메뉴에서는 빠졌지만 주소로 들어오면) */
  body[data-route="more"] .menu { max-width: 640px; }

  /* 지역 선택 (PC): 왼쪽 목록, 오른쪽 지도, 지도 위 고른 지역 요약 */
  .regions-desk { gap: 16px; }
  .regions-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .regions-cols { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; height: calc(100dvh - var(--nav-h) - 200px); min-height: 520px; }
  .region-list { gap: 0; padding: 8px; overflow-y: auto; }
  .region-group { position: sticky; top: -8px; z-index: 1; padding: 12px 8px 4px; background: var(--surface); font-size: 14px; font-weight: 800; color: var(--text-3); }
  .rrow { width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); text-align: left; }
  .rrow:hover { background: var(--surface-2); }
  .rrow.on { background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary-text); }
  .rrow-thumb { flex: none; width: 48px; height: 48px; border-radius: var(--radius-xs); overflow: hidden; background: var(--surface-2); }
  .rrow-thumb img, .rrow-thumb svg { width: 100%; height: 100%; display: block; object-fit: cover; }
  .rrow-text { flex: 1; min-width: 0; }
  .rrow-text b { display: block; font-size: 15px; }
  .rrow-text small { display: block; overflow: hidden; font-size: 13px; color: var(--text-3); white-space: nowrap; text-overflow: ellipsis; }
  .rrow-brief { flex: none; display: flex; align-items: center; gap: 8px; font-size: 14px; }
  .rrow-brief.skeleton { width: 72px; height: 20px; border-radius: var(--radius-xs); }
  .rrow-temp { min-width: 2.5em; text-align: right; font-weight: 700; }
  .rrow-warn { display: inline-flex; color: var(--danger); }
  .map-desk { height: 100%; }
  .map-desk .map { height: 100%; }
  .map-pick { position: absolute; left: 16px; bottom: 16px; z-index: 1000; display: flex; align-items: center; gap: 14px; width: min(620px, calc(100% - 32px)); padding: 12px; background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); }
  .map-pick-img { flex: none; width: 88px; height: 66px; border-radius: var(--radius-xs); overflow: hidden; background: var(--surface-2); }
  .map-pick-img img, .map-pick-img svg { width: 100%; height: 100%; display: block; object-fit: cover; }
  .map-pick-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .map-pick-body strong { font-size: 17px; }

  /* 지도 */
  .map { height: 440px; }
  .map-full .map { height: calc(100dvh - var(--nav-h) - 300px); min-height: 440px; }

  /* 지역 상세: 머리(이름·주소·즐겨찾기·지도 버튼·지금 날씨) → 물때 | 날씨·미세먼지·특보 → 시간별 예보(오늘·내일) */
  .detail-hero { height: 280px; }
  .detail-hero-body { left: var(--page-pad); right: var(--page-pad); bottom: 56px; align-items: flex-end; }
  .detail-name { font-size: 36px; }
  .hero-actions-desk { display: flex; gap: 8px; margin-top: 14px; }
  .hero-actions-desk .btn { min-height: 40px; font-size: 15px; }
  .hero-actions-desk .btn-outline { background: rgba(255, 255, 255, .92); border-color: transparent; color: #0b4f8a; }
  .hero-actions-desk .btn-outline[aria-pressed="true"] .ic { color: #f59e0b; fill: #f59e0b; }
  .detail-weather strong { font-size: 28px; }
  .detail-sheet { margin: -28px var(--page-pad) 0; padding: 24px; border: 1px solid var(--card-line); border-radius: var(--radius-lg); gap: 18px; box-shadow: var(--card-shadow); }
  .detail-sheet .segmented { display: none; }
  .date-nav { max-width: 520px; }
  .desk-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .desk-col { display: flex; flex-direction: column; gap: 16px; }
  .desk-info { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; margin-top: 20px; }
  .desk-info > .note { grid-column: 1 / -1; }
  .chart-slot { min-height: 240px; }
  .tide-chart.fixed { margin: 0; }
  .tide-chart.fixed svg { width: 100%; height: auto; }
  .tide-chart.fixed .ax { font-size: 13px; }
  .tide-chart.fixed .ev-lbl { font-size: 14px; }
  .tide-chart.fixed .now-lbl { font-size: 14px; }
  .desk-hours { margin-top: 20px; }

  /* 바닥글 */
  .site-footer { display: block; padding: 32px var(--page-pad) 40px; background: var(--surface); border-top: 1px solid var(--border); color: var(--text-3); font-size: 14px; line-height: 1.6; }
  .footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
  .footer-logo { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; color: var(--text); }
  .footer-brand p { margin-top: 6px; }
  .footer-links { display: flex; flex-wrap: wrap; gap: 4px 28px; }
  .footer-links a, .footer-links button { display: inline-flex; align-items: center; min-height: 32px; font-size: 15px; font-weight: 600; color: var(--text-2); }
  .footer-links a:hover, .footer-links button:hover { color: var(--primary-text); text-decoration: underline; }
  .footer-safety { display: flex; gap: 8px; margin-top: 20px; color: var(--text-2); }
  .footer-safety .ic { width: 18px; height: 18px; margin-top: 3px; color: var(--danger); }
  .footer-sources { margin-top: 8px; }
  .footer-copy { margin-top: 12px; }
}

/* 정보·출처 */
.about-list { display: flex; flex-direction: column; font-size: 14px; color: var(--text-2); }
.about-list li { padding: 8px 0; }
.about-version { text-align: center; }

/* 갈 곳: 체험별 색 (갯벌 갈색 / 낚시 파랑 / 어촌체험 보라 / 자연휴양림 초록). 썸네일·칩 아이콘용 */
:root { --pk-mudflat: #8a5a1f; --pk-park: #1d5fa8; --pk-village: #7e22ce; --pk-forest: #3b7a2a; }
:root[data-theme="dark"] { --pk-mudflat: #e0b07a; --pk-park: #7cc4f2; --pk-village: #d8b4fe; --pk-forest: #8fd17a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pk-mudflat: #e0b07a; --pk-park: #7cc4f2; --pk-village: #d8b4fe; --pk-forest: #8fd17a; } }
.pk-mudflat { --pk: var(--pk-mudflat); }
.pk-park, .pk-fishing { --pk: var(--pk-park); }
.pk-village { --pk: var(--pk-village); }
.pk-forest { --pk: var(--pk-forest); }
/* 거르기 칩 아이콘은 지도 핀과 같은 색 (범례 역할). 고른 칩은 글자색 */
.chip .ic[class*="pk-"] { color: var(--pk); }
.chip.on .ic[class*="pk-"] { color: currentColor; }
/* 사진 대신 쓰는 종류 아이콘 상자 */
.pthumb { display: grid; place-items: center; width: 100%; height: 100%; color: var(--pk); background: color-mix(in srgb, var(--pk) 14%, var(--surface)); }
.place-head .pthumb { flex: none; width: 56px; height: 56px; border-radius: var(--radius-sm); }
/* 장소 핀: 지역 핀보다 작게, 체험 색으로. 밝은·어두운 지도 모두에서 서로 갈리도록 색상(hue)을 크게 벌린다 */
.pin-place .pin-dot { width: 16px; height: 16px; border-width: 2px; }
.pin-place.pk-mudflat .pin-dot { background: #a0612b; }
.pin-place.pk-park .pin-dot, .pin-place.pk-fishing .pin-dot { background: #2563eb; }
.pin-place.pk-village .pin-dot { background: #9333ea; }
.pin-place.pk-forest .pin-dot { background: #16a34a; }
.pin-place .pin-active .pin-dot { background: #f59e0b; width: 24px; height: 24px; border-width: 3px; }

.places-intro { font-size: 14px; }
.places-tools { display: flex; align-items: center; gap: 12px; }
.places-find { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface); color: var(--text-3); }
.places-find:focus-within { border-color: var(--primary-text); }
.places-find input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); outline: none; }
.places-more { width: 100%; margin-top: 12px; }
.places-loading { padding: 16px 4px; }

.place-head { display: flex; align-items: center; gap: 12px; }
.place-kind { font-weight: 700; }
.place-cols { display: flex; flex-direction: column; gap: 16px; }
.place-info li { grid-template-columns: 96px 1fr; }
.place-info a.link { color: var(--primary-text); font-weight: 600; }
.dot-list { list-style: disc; padding-left: 18px; }
.info-list .dot-list li { display: list-item; padding: 0; border: 0; font-size: inherit; }
.place-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.place-actions .btn { flex: 1 1 140px; }
.place-note { display: flex; gap: 6px; align-items: flex-start; }
.place-note .ic { margin-top: 3px; }
.place-map-card { gap: 8px; }
.place-map { height: 220px; }

@media (min-width: 1024px) {
  .places-desk .regions-cols { height: calc(100dvh - var(--nav-h) - 270px); }
  .places-bar { display: flex; flex-direction: column; gap: 8px; }
  .places-list { padding-top: 0; }
  .places-list .places-tools { position: sticky; top: 0; z-index: 2; padding: 8px 0; background: var(--surface); }
  .places-list .region-group { top: 56px; }
  .rrow-thumb .pthumb { border-radius: var(--radius-xs); }
  .map-pick-img .pthumb { border-radius: var(--radius-xs); }
  .place-cols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .place-map { height: 340px; }
  .place-around { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .place-around li + li { border-top: 0; }
  .place-around li { border-bottom: 1px solid var(--border); }
}

/* ───── 지역 상세: 물때 그래프 꼬리표 · 한눈에 · 주간 물때표 · 시간별 예보 띠 ───── */
:root { --now: #1e293b; --temp-line: #f59e0b; --sat: #2563eb; --sun: #dc2626; }
:root[data-theme="dark"] { --now: #f1f5f9; --temp-line: #fbbf24; --sat: #93c5fd; --sun: #fca5a5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --now: #f1f5f9; --temp-line: #fbbf24; --sat: #93c5fd; --sun: #fca5a5; } }

/* 머리: 지역 이름 옆 밀물·썰물 */
.detail-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.hero-tide { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px 3px 7px; border-radius: 999px; background: rgba(255, 255, 255, .94); font-size: 15px; font-weight: 800; line-height: 1.3; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
.hero-tide.rising { color: #be123c; }
.hero-tide.falling { color: #0f766e; }
.hero-tide small { margin-left: 4px; font-size: 13px; font-weight: 600; color: #475569; }

/* 물때 그래프: 만조·간조 꼬리표, '지금'은 짙은 무채색으로 만조(붉은색)와 구분 */
.tide-chart .tag rect { stroke-width: 1.5; }
.tide-chart .tag text { font-size: 13.5px; font-weight: 700; }
.tide-chart .tag-high rect { fill: color-mix(in srgb, var(--high) 10%, var(--surface)); stroke: var(--high); }
.tide-chart .tag-high text { fill: var(--high); }
.tide-chart .tag-low rect { fill: color-mix(in srgb, var(--low) 10%, var(--surface)); stroke: var(--low); }
.tide-chart .tag-low text { fill: var(--low); }
.tide-chart .tag-now rect { fill: var(--now); stroke: var(--now); }
.tide-chart .tag-now text { fill: var(--surface); }
.tide-chart .stem { stroke-width: 1; stroke-dasharray: 2 3; }
.tide-chart .stem-high { stroke: var(--high); }
.tide-chart .stem-low { stroke: var(--low); }
.tide-chart .now { stroke: var(--now); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tide-chart .now-dot { fill: var(--now); stroke: var(--surface); stroke-width: 2.5; }
.tide-facts { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; color: var(--text-2); }
.tide-facts li { display: inline-flex; align-items: center; gap: 6px; }
.tide-facts .ic { color: var(--primary-text); }
.tide-facts b { color: var(--text); }

/* 한눈에 보기 칸 (바람·파고·미세먼지·일출일몰 / 기온·습도·바람·강수) */
.cond-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.cond-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cond { min-width: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.cond dt { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--text-3); }
.cond dt .ic { flex: none; color: var(--primary-text); }
.cond dd { margin: 4px 0 0; }
.cond strong { display: flex; align-items: center; gap: 3px; font-size: 20px; font-weight: 800; line-height: 1.25; }
.cond strong small { font-size: 13px; font-weight: 600; color: var(--text-3); }
.cond dd > small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-2); }
.cond-grid.four .cond { padding: 9px 4px; text-align: center; }
.cond-grid.four dt, .cond-grid.four strong { justify-content: center; }
.cond-grid.four strong { font-size: 17px; }
.cond-sun strong small { margin: 0 2px; }
.wind-arrow { display: inline-flex; color: var(--primary-text); }
.grade-txt.g1 { color: #1d4ed8; } .grade-txt.g2 { color: #15803d; } .grade-txt.g3 { color: #c2410c; } .grade-txt.g4 { color: #b91c1c; }
:root[data-theme="dark"] .grade-txt.g1 { color: #93c5fd; } :root[data-theme="dark"] .grade-txt.g2 { color: #86efac; } :root[data-theme="dark"] .grade-txt.g3 { color: #fdba74; } :root[data-theme="dark"] .grade-txt.g4 { color: #fca5a5; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grade-txt.g1 { color: #93c5fd; } :root:not([data-theme="light"]) .grade-txt.g2 { color: #86efac; } :root:not([data-theme="light"]) .grade-txt.g3 { color: #fdba74; } :root:not([data-theme="light"]) .grade-txt.g4 { color: #fca5a5; } }

/* 주간 물때표 */
.week-wrap { overflow-x: auto; }
.week-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.week-table th, .week-table td { padding: 6px 4px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--border); }
.week-table thead th { padding-top: 0; font-size: 13px; font-weight: 700; color: var(--text-3); }
.week-table thead th.hi { color: var(--high); }
.week-table thead th.lo { color: var(--low); }
.week-table tbody tr.is-sel { background: var(--primary-soft); }
.week-day { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-width: 48px; min-height: 44px; border-radius: 8px; line-height: 1.2; color: var(--text); }
.week-day:hover { background: var(--surface-2); }
.week-day b { font-size: 15px; font-weight: 800; }
.is-sel .week-day b { color: var(--primary-text); }
.week-day .dow { font-size: 12.5px; color: var(--text-3); }
.week-day .dow.sat { color: var(--sat); }
.week-day .dow.sun { color: var(--sun); }
.week-table .md { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.week-table .md.spring { background: color-mix(in srgb, var(--high) 12%, transparent); color: var(--high); }
.week-table .md.neap { color: var(--text-3); }
.week-table .wt { display: block; font-weight: 700; white-space: nowrap; }
.week-table .wt + .wt { margin-top: 2px; }
.week-table .wt small { margin-left: 4px; font-size: 12.5px; font-weight: 500; color: var(--text-3); }
.week-more { width: 100%; margin-top: 10px; }
.week-card .muted.small { margin-top: 8px; }
.week-card .card-head .muted.small { margin-top: 0; }

/* 시간별 예보 띠: 칸을 나누지 않고 이어서, 기온은 꺾은선 */
.hstrip { overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: thin; }
.hstrip:focus-visible { outline: 2px solid var(--primary-text); outline-offset: -2px; }
.hs-row { display: flex; }
.hs-row > span { flex: 0 0 58px; display: flex; align-items: center; justify-content: center; gap: 2px; }
.hs-row > span.ds { box-shadow: inset 1px 0 0 var(--border-strong); }
.hs-days > span { justify-content: flex-start; min-height: 18px; padding-left: 6px; white-space: nowrap; font-size: 12.5px; font-weight: 800; color: var(--primary-text); }
.hs-time > span { min-height: 24px; font-size: 14px; font-weight: 600; color: var(--text-3); }
.hs-time b { color: var(--text); }
.hs-sky > span { min-height: 34px; color: var(--primary-text); }
.hs-temp { display: block; overflow: visible; }
.hs-line { fill: none; stroke: var(--temp-line); stroke-width: 2.5; }
.hs-dot { fill: var(--surface); stroke: var(--temp-line); stroke-width: 2; }
.hs-tv { font-size: 15px; font-weight: 800; fill: var(--text); }
.hs-sep { stroke: var(--border-strong); stroke-width: 1; }
.hs-pop > span, .hs-wind > span, .hs-wave > span { min-height: 24px; font-size: 13.5px; color: var(--text-2); }
.hs-pop .ic { color: #3b82f6; }
.hs-pop .wet { font-weight: 800; color: var(--sat); }
.hs-wind .wind-arrow, .hs-wind .ic { color: var(--text-3); }
.hs-wave .ic { color: var(--primary-text); }
.hs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.hs-legend .ic { color: var(--text-3); }
@media (max-width: 360px) { .cond-grid.four { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .hstrip { margin: 0; padding-left: 0; padding-right: 0; } }

/* 검색 전 화면(폰): 인기 검색어 아래로 인기 바다·권역·갈 곳 바로가기 */
.search-idle { display: flex; flex-direction: column; gap: 24px; }

/* 서버가 넣는 검색용 본문 (앱이 그려지면 바로 바뀐다). 스크립트가 늦거나 안 될 때만 잠시 뒤 보인다 */
.seo-shell { padding: 24px 16px; opacity: 0; animation: seo-show .2s 1.5s forwards; }
.seo-shell h1 { font-size: 22px; font-weight: 800; }
.seo-shell p { margin: 6px 0 14px; color: var(--text-2); }
.seo-shell ul { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; list-style: none; }
.seo-shell a { color: var(--primary-text); }
@keyframes seo-show { to { opacity: 1; } }

/* 자외선 단계 색 (기상청 5단계). 칸 수가 홀수면 마지막 칸(일출·일몰)을 한 줄로 */
.cond-grid:not(.four) > .cond:last-child:nth-child(odd) { grid-column: 1 / -1; }
.uv-txt.u1 { color: #15803d; } .uv-txt.u2 { color: #a16207; } .uv-txt.u3 { color: #c2410c; } .uv-txt.u4 { color: #b91c1c; } .uv-txt.u5 { color: #7e22ce; }
:root[data-theme="dark"] .uv-txt.u1 { color: #86efac; } :root[data-theme="dark"] .uv-txt.u2 { color: #fde047; } :root[data-theme="dark"] .uv-txt.u3 { color: #fdba74; } :root[data-theme="dark"] .uv-txt.u4 { color: #fca5a5; } :root[data-theme="dark"] .uv-txt.u5 { color: #d8b4fe; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .uv-txt.u1 { color: #86efac; } :root:not([data-theme="light"]) .uv-txt.u2 { color: #fde047; } :root:not([data-theme="light"]) .uv-txt.u3 { color: #fdba74; } :root:not([data-theme="light"]) .uv-txt.u4 { color: #fca5a5; } :root:not([data-theme="light"]) .uv-txt.u5 { color: #d8b4fe; } }

/* 개인정보처리방침 */
.privacy-page .card { gap: 8px; max-width: 760px; }
.privacy-page h2.small { margin-top: 12px; }
.privacy-page p, .privacy-page li { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.privacy-page .dot-list li + li { margin-top: 4px; }
