:root {
  --canvas: #f3f5f4;
  --surface: #ffffff;
  --ink: #18201f;
  --muted: #65706d;
  --line: #d8dedb;
  --sea: #086f73;
  --sea-dark: #064f52;
  --yellow: #f0c84b;
  --red: #b73535;
  --red-soft: #fff0ee;
  --amber: #8b6100;
  --amber-soft: #fff7dd;
  --green: #176b46;
  --green-soft: #e9f6ef;
  --focus: #1261a0;
  --shadow: 0 4px 16px rgba(24, 32, 31, 0.08);
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; letter-spacing: 0; }
a { color: var(--sea-dark); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -48px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
}
.skip-link:focus { top: 12px; }

.masthead {
  position: relative;
  min-height: 210px;
  display: flex;
  align-items: end;
  background: #445f5d url("/assets/west-coast-dawn.webp") center 53% / cover no-repeat;
  color: white;
}

.masthead__shade {
  position: absolute;
  inset: 0;
  background: rgba(10, 26, 25, 0.56);
}

.masthead__inner {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 40px 18px 24px;
}

.masthead__eyebrow,
.kicker {
  margin: 0 0 4px;
  color: var(--sea);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.masthead__eyebrow { color: #d7efea; }

.masthead h1 {
  margin: 0;
  max-width: 620px;
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.masthead__copy {
  margin: 9px 0 0;
  max-width: 560px;
  color: #eef7f5;
  font-size: 0.96rem;
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 14px 40px;
}

.safety {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 22px;
  padding: 13px 14px;
  border: 1px solid;
  border-radius: 8px;
}

.safety--clear { border-color: #add8c1; background: var(--green-soft); color: var(--green); }
.safety--caution { border-color: #e1c977; background: var(--amber-soft); color: var(--amber); }
.safety--stop { border-color: #e0aaa5; background: var(--red-soft); color: var(--red); }

.safety__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.safety__title { display: block; font-size: 0.95rem; }
.safety__text { margin: 2px 0 0; color: var(--ink); font-size: 0.84rem; }

.controls { margin-bottom: 30px; }

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  min-width: 0;
  margin-bottom: 12px;
}

.section-heading h2,
.detail-title,
.document-header h1,
.document-main h2 {
  margin: 0;
  letter-spacing: 0;
}

.section-heading h2 { font-size: 1.25rem; line-height: 1.25; }

.data-state,
.result-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.data-state::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--green);
}
.data-state[data-mode="fallback"]::before { background: var(--amber); }

.date-tabs {
  display: flex;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}

.date-tab,
.period-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 750;
}

.date-tab {
  flex: 0 0 auto;
  min-width: 64px;
  padding: 8px 11px;
  font-size: 0.82rem;
}

.date-tab[aria-selected="true"],
.period-tab[aria-pressed="true"] {
  border-color: var(--sea-dark);
  background: var(--sea-dark);
  color: white;
}

.period-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.period-tab { padding: 8px 12px; }

.period-tabs .period-tab:only-child { grid-column: 1 / -1; }

.period-note,
.ranking-note {
  margin: 9px 2px 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.ranking-heading { margin-bottom: 3px; }
.ranking-note { margin-bottom: 13px; }

.rank-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 5px solid #858d8a;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(24, 32, 31, 0.02);
}
.rank-item[data-grade="5"] { border-left-color: #16734c; }
.rank-item[data-grade="4"] { border-left-color: #659b28; }
.rank-item[data-grade="3"] { border-left-color: #c29413; }
.rank-item[data-grade="2"] { border-left-color: #cf6c2e; }
.rank-item[data-grade="1"] { border-left-color: var(--red); }

.rank-button {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 13px 11px 13px 9px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.rank-button:hover { background: #f8faf9; }
.rank-number { color: var(--muted); font-size: 0.86rem; font-weight: 850; text-align: center; }
.rank-body { min-width: 0; }
.rank-topline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.rank-name { min-width: 0; font-size: 0.98rem; overflow-wrap: anywhere; }
.rank-facts { display: block; margin-top: 3px; color: var(--muted); font-size: 0.77rem; overflow-wrap: anywhere; }
.grade { color: var(--ink); font-size: 0.86rem; white-space: nowrap; }

.access-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid #bfd6d3;
  border-radius: 4px;
  background: #edf7f5;
  color: var(--sea-dark);
  font-size: 0.68rem;
  font-weight: 750;
  white-space: nowrap;
}
.access-badge--island { border-color: #d5c67d; background: #fff9db; color: #665312; }
.access-badge--boat { border-color: #d7b4ac; background: #fff0ed; color: #8b382d; }

.loading,
.empty-state {
  margin: 0;
  padding: 36px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.detail {
  scroll-margin-top: 16px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 2px solid var(--ink);
}

.detail-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.detail-title { max-width: 560px; font-size: 1.42rem; overflow-wrap: anywhere; }

.icon-button,
.back-link {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.verdict {
  margin-top: 16px;
  padding: 15px 16px;
  border-left: 5px solid;
  background: var(--surface);
}
.verdict--good { border-color: var(--green); }
.verdict--caution { border-color: var(--yellow); }
.verdict--stop { border-color: var(--red); }
.verdict--muted { border-color: var(--muted); }
.verdict__title { display: block; font-size: 1.04rem; }
.verdict__detail { margin: 3px 0 0; color: var(--muted); font-size: 0.84rem; }

.slot-grid { display: grid; gap: 7px; margin-top: 14px; }
.slot-item {
  display: grid;
  grid-template-columns: 46px 76px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.slot-item__period, .slot-item__facts { color: var(--muted); font-size: 0.8rem; }
.slot-item__grade { font-size: 0.85rem; }
.slot-item__facts { text-align: right; overflow-wrap: anywhere; }

.facts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
}
.fact-key, .fact-value { margin: 0; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.fact-key { color: var(--muted); }
.fact-value { font-weight: 750; text-align: right; }

.access-note,
.source-note,
.notice-box {
  margin: 14px 0 0;
  padding: 12px 13px;
  border: 1px solid #d8c982;
  background: #fff9df;
  color: #5e501b;
  font-size: 0.82rem;
}
.access-note--boat { border-color: #dcaaa2; background: var(--red-soft); color: #81342c; }
.source-note { border-color: var(--line); background: #edf1ef; color: var(--muted); }

.footer { border-top: 1px solid var(--line); background: #e9edeb; }
.footer__inner { width: min(100%, 720px); margin: 0 auto; padding: 24px 16px calc(28px + env(safe-area-inset-bottom)); }
.footer p { margin: 0 0 7px; color: var(--muted); font-size: 0.76rem; }
.footer nav { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.footer a { font-size: 0.8rem; font-weight: 750; }

.document-page { background: var(--surface); }
.document-header {
  display: flex;
  gap: 14px;
  align-items: center;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 24px 16px 18px;
  border-bottom: 1px solid var(--line);
}
.document-header h1 { font-size: 1.42rem; }
.document-main { width: min(100%, 720px); margin: 0 auto; padding: 14px 18px 44px; }
.document-main section { padding: 18px 0; border-bottom: 1px solid var(--line); }
.document-main h2 { font-size: 1rem; }
.document-main p { margin: 7px 0 0; color: #3f4947; font-size: 0.9rem; }

@media (max-width: 420px) {
  .masthead { min-height: 194px; }
  .masthead h1 { font-size: 1.72rem; }
  .masthead__copy { font-size: 0.88rem; }
  .rank-button { grid-template-columns: 25px minmax(0, 1fr); }
  .grade { grid-column: 2; justify-self: start; margin-top: -2px; }
  .slot-item { grid-template-columns: 42px 70px minmax(0, 1fr); padding-inline: 5px; }
}

@media (min-width: 760px) {
  .masthead { min-height: 240px; }
  .masthead h1 { font-size: 2.35rem; }
  .shell { padding-inline: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .rank-button { transition: background-color 120ms ease; }
}

/* =========================================================================
   2026-08-25 Claude 수정 — 사용자 검수 결함 2건
   원본 백업: styles.css.bak-20260825

   [결함 1] 휴대폰에서 순위 1위가 625px/812px(77%) 지점 → 첫 화면에 답이 없었다.
            장식(히어로 높이·kicker)만 줄이고 설명 문장은 남긴다.
            "뭘 만든 건지 모르겠다"는 지적이 있었으므로 설명을 없애면 안 된다.
            특보 배너는 안전 항목이라 건드리지 않는다.
   [결함 2] max-width:420px 에서 등급이 3번째 줄 왼쪽으로 강등 → 같은 줄 오른쪽으로 복귀.
   ========================================================================= */

@media (max-width: 420px) {
  /* [결함 2] 등급을 3열 오른쪽 정렬로 되돌린다 */
  .rank-button { grid-template-columns: 25px minmax(0, 1fr) auto; }
  .grade {
    grid-column: 3;
    justify-self: end;
    align-self: center;
    margin-top: 0;
    font-size: 0.92rem;
    font-weight: 800;
  }
}

@media (max-width: 560px) {
  /* [결함 1] 장식 축소 — 설명 문장은 유지 */
  .masthead { min-height: 0; }
  .masthead__inner { padding: 16px 16px 14px; }
  .masthead__eyebrow { font-size: 0.68rem; margin-bottom: 2px; }
  .masthead__copy { font-size: 0.82rem; margin-top: 4px; }

  .controls { margin-bottom: 14px; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 1.06rem; }

  /* kicker 는 순수 장식 라벨(조건 선택 / 바다낚시지수 순)이라 모바일에서 숨긴다 */
  .kicker { display: none; }

  .period-note { font-size: 0.75rem; margin-top: 6px; }
  .ranking-note { font-size: 0.75rem; margin-top: 4px; }
}

/* 2026-08-25 Codex: 모바일 날짜 선택의 발견성과 주말 구분 보완 */
.date-tabs-wrap { position: relative; }
.date-tabs__hint { display: none; }
.date-tab[data-weekend="true"] {
  border-color: #dfb5ad;
  background: #fff8f5;
  color: #9f463a;
}
.date-tab[data-weekend="true"][aria-selected="true"] {
  border-color: var(--sea-dark);
  background: var(--sea-dark);
  color: #fff;
}

@media (max-width: 560px) {
  .date-tabs-wrap::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 10px;
    width: 36px;
    background: linear-gradient(to right, transparent, var(--surface) 78%);
    content: "";
    pointer-events: none;
  }
  .date-tabs__hint {
    position: absolute;
    top: 2px;
    right: 2px;
    display: grid;
    width: 24px;
    height: 42px;
    place-items: center;
    color: var(--sea-dark);
    font-size: 1.3rem;
    font-weight: 800;
    pointer-events: none;
  }
}
