/* 쭈꾸미 "노려볼 물때" 등급과 시각 요소. 항구 페이지(fable-port)·서해 쭈꾸미 물때표 허브·홈·추천기가 함께 쓴다.
   색 역할(2026-09-07 오너 결정): 물색(민트/틸) = 만조·등급·참고 구간, --tide-low(코랄 오렌지) = 간조, 낮 = 중립 밝기 띠,
   앰버 = 현재 시각 선과 "무난한 물때" 톤. 조위 색 띠는 낮은 물 코랄 → 앰버 → 민트 → 하늘색 높은 물(G2 스펙트럼).
   색은 fable-theme 변수를 우선 쓰고, 테마 변수가 없는 화면을 위해 fallback을 둔다. */
:root {
  --squid-pick: var(--fable-water, #1f766e);
  --squid-pick-strong: var(--fable-water-strong, #075f57);
  --squid-on-pick: var(--fable-on-water, #ffffff);
  --squid-normal: var(--fable-amber, #e0a64e);
  --squid-on-normal: var(--fable-on-amber, #201407);
  --squid-heavy: var(--fable-muted, #405863);
  --squid-on-heavy: var(--fable-surface, #ffffff);
  --squid-closed: #8a4b4b;
  --squid-low: var(--tide-low, #d85a24);
  --squid-ink: var(--fable-ink, #102a33);
  --squid-muted: var(--fable-muted, #405863);
  --squid-line: var(--fable-line, #71858e);
  --squid-surface: var(--fable-surface, #ffffff);
  --squid-soft: color-mix(in srgb, var(--squid-ink) 6%, transparent);
  --squid-bar-off: color-mix(in srgb, var(--squid-ink) 12%, transparent);
  /* 라이트: 밤을 살짝 어둡게. 다크: 낮을 살짝 밝게(아래 재정의). */
  --squid-night: color-mix(in srgb, var(--squid-ink) 7%, transparent);
  --squid-day: transparent;
  --squid-window: color-mix(in srgb, var(--squid-ink) 5%, transparent);
  --squid-strip-l0: #f86b59;
  --squid-strip-l1: #fb9d72;
  --squid-strip-l2: #ffce8a;
  --squid-strip-l3: #bfd8ad;
  --squid-strip-l4: #7be1d1;
  --squid-strip-l5: #61c6e9;
  --squid-strip-l6: #4aa8ff;
}
:root[data-fable-scheme="dark"] {
  --squid-night: transparent;
  --squid-day: rgba(255, 255, 255, .07);
  --squid-window: rgba(255, 255, 255, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-fable-scheme]) {
    --squid-night: transparent;
    --squid-day: rgba(255, 255, 255, .07);
    --squid-window: rgba(255, 255, 255, .06);
  }
}

.squid-visuals { display: grid; gap: .75rem; margin: .75rem 0 1rem; }

/* 배지 — 톤 배경 + 테두리, 마크 개수(3·2·1)로 등급을 함께 읽는다. */
.squid-pick { display: grid; gap: .45rem; }
.squid-grade {
  display: inline-flex; align-items: center; gap: .5rem; max-width: 100%; justify-self: start; width: max-content;
  padding: .4rem .85rem .4rem .6rem; border: 1px solid var(--squid-line); border-radius: 999px; line-height: 1.2;
  background: transparent; color: var(--squid-ink); font-weight: 800;
}
.squid-grade > b { font-size: 1.02rem; white-space: nowrap; }
.squid-grade > small { font-size: .72rem; font-weight: 600; color: var(--squid-muted); white-space: nowrap; }
.squid-grade-marks { display: inline-flex; align-items: center; }
.squid-grade-mark { width: 20px; height: 20px; margin-right: -6px; border-radius: 50%; background: var(--squid-surface); box-shadow: 0 0 0 1.5px var(--squid-surface); }
.squid-grade-mark:last-child { margin-right: 0; }
.squid-grade-pick { background: color-mix(in srgb, var(--squid-pick) 16%, var(--squid-surface)); border-color: color-mix(in srgb, var(--squid-pick) 55%, transparent); color: var(--squid-pick-strong); }
.squid-grade-normal { background: color-mix(in srgb, var(--squid-normal) 14%, var(--squid-surface)); border-color: color-mix(in srgb, var(--squid-normal) 60%, transparent); color: var(--squid-ink); }
.squid-grade-heavy { background: color-mix(in srgb, var(--squid-heavy) 12%, var(--squid-surface)); border-color: color-mix(in srgb, var(--squid-heavy) 50%, transparent); color: var(--squid-muted); }
.squid-grade-closed { background: repeating-linear-gradient(135deg, var(--squid-soft) 0 6px, transparent 6px 12px); color: var(--squid-muted); }
.squid-grade.is-compact { padding: .15rem .55rem; gap: .3rem; }
.squid-grade.is-compact > b { font-size: .8rem; }
.squid-grade-reasons { display: flex; flex-wrap: wrap; gap: .35rem .45rem; margin: 0; padding: 0; list-style: none; }
.squid-grade-reasons li { padding: .2rem .6rem; border-radius: 8px; background: var(--squid-soft); color: var(--squid-muted); font-size: .8rem; }

/* 타임라인 — 해·달 레일 / 낮·밤 띠 / 조위 색 띠 / ▲▼ 마커 / 참고 구간 / 현재선 */
.squid-timeline, .squid-gauge { margin: 0; }
.squid-timeline { max-width: 34rem; }
.squid-timeline svg { display: block; width: 100%; height: auto; }
.squid-timeline-rail-line { stroke: color-mix(in srgb, var(--squid-ink) 30%, transparent); stroke-width: 1; }
.squid-timeline-sun { fill: var(--squid-muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.squid-timeline-night { fill: var(--squid-night); }
.squid-timeline-day { fill: var(--squid-day); }
.squid-timeline-window { fill: var(--squid-window); }
.squid-timeline-window-edge { stroke: var(--squid-pick); stroke-width: 1.5; opacity: .8; }
.squid-timeline-window-label { fill: var(--squid-pick-strong); font-size: 11px; font-weight: 800; }
.squid-strip-l0 { stop-color: var(--squid-strip-l0); }
.squid-strip-l1 { stop-color: var(--squid-strip-l1); }
.squid-strip-l2 { stop-color: var(--squid-strip-l2); }
.squid-strip-l3 { stop-color: var(--squid-strip-l3); }
.squid-strip-l4 { stop-color: var(--squid-strip-l4); }
.squid-strip-l5 { stop-color: var(--squid-strip-l5); }
.squid-strip-l6 { stop-color: var(--squid-strip-l6); }
.squid-timeline-high polygon { fill: var(--squid-pick); }
.squid-timeline-low polygon { fill: var(--squid-low); }
.squid-timeline-high text, .squid-timeline-low text { font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.squid-timeline-high text { fill: var(--squid-pick-strong); }
.squid-timeline-low text { fill: var(--squid-low); }
.squid-timeline-tick { fill: var(--squid-muted); font-size: 10px; }
.squid-timeline-now { stroke: var(--fable-current-marker, #905511); stroke-width: 1.5; stroke-dasharray: 3 2; }
.squid-timeline-legend { display: flex; align-items: center; gap: .5rem; margin: .3rem 0 0; color: var(--squid-muted); font-size: .74rem; }
.squid-timeline-legend i { display: inline-block; width: 7rem; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--squid-strip-l0), var(--squid-strip-l2), var(--squid-strip-l4), var(--squid-strip-l6)); }
.squid-timeline-caption { margin: .3rem 0 0; color: var(--squid-muted); font-size: .8rem; }
.squid-timeline .squid-timeline-details { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.squid-timeline-details > summary { display: flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0; color: var(--squid-muted); font-size: .8rem; cursor: pointer; list-style: none; }
.squid-timeline-details > summary::before { content: '+'; flex: 0 0 auto; }
.squid-timeline-details > summary small { flex: 0 0 auto; margin-left: auto; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.squid-timeline-details[open] > summary::before { content: '−'; }
.squid-timeline-details > summary::-webkit-details-marker { display: none; }
.squid-timeline-details > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }

/* 물흐름 미터 — 막대 7칸(조금 1칸 ~ 사리 7칸) + 관행 봉돌 힌트 */
.squid-gauge { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--squid-muted); font-size: .86rem; }
.squid-gauge-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.squid-gauge-bars i { display: block; width: 9px; border-radius: 2px; background: var(--squid-bar-off); }
.squid-gauge-bars i:nth-child(1) { height: 6px; }
.squid-gauge-bars i:nth-child(2) { height: 8px; }
.squid-gauge-bars i:nth-child(3) { height: 10px; }
.squid-gauge-bars i:nth-child(4) { height: 12px; }
.squid-gauge-bars i:nth-child(5) { height: 14px; }
.squid-gauge-bars i:nth-child(6) { height: 16px; }
.squid-gauge-bars i:nth-child(7) { height: 18px; }
.squid-gauge-bars i.is-on { background: var(--squid-pick); }
.squid-gauge-value { color: var(--squid-ink); font-weight: 800; }
.squid-gauge-hint { font-size: .82rem; }

/* 주간 카드 */
.squid-week { margin: 1rem 0; }
.squid-week h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.squid-week h2 small { margin-left: .4rem; color: var(--squid-muted); font-size: .78rem; font-weight: 600; }
.squid-week-cards, .squid-pick-cards { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.squid-week-cards { grid-template-columns: repeat(auto-fit, minmax(6.4rem, 1fr)); }
.squid-pick-cards { grid-template-columns: repeat(auto-fit, minmax(8.2rem, 1fr)); }
.squid-week-date, .squid-pick-date { white-space: nowrap; }
.squid-week-card a, .squid-pick-card a {
  display: grid; gap: .15rem; min-height: 96px; padding: .6rem .65rem; border-radius: 12px;
  border-left: 5px solid var(--squid-heavy); background: var(--squid-surface); color: var(--squid-ink);
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.squid-week-card.is-pick a, .squid-pick-card.is-pick a { border-left-color: var(--squid-pick); background: color-mix(in srgb, var(--squid-pick) 14%, var(--squid-surface)); }
.squid-week-card.is-normal a, .squid-pick-card.is-normal a { border-left-color: var(--squid-normal); background: color-mix(in srgb, var(--squid-normal) 16%, var(--squid-surface)); }
.squid-week-card.is-heavy a, .squid-pick-card.is-heavy a { border-left-color: var(--squid-heavy); }
.squid-week-card.is-closed a, .squid-pick-card.is-closed a { border-left-color: var(--squid-closed); }
.squid-week-card.is-current a { outline: 2px solid var(--squid-ink); outline-offset: -2px; }
.squid-week-date, .squid-pick-date { color: var(--squid-muted); font-size: .78rem; font-weight: 700; }
.squid-pick-date { color: var(--squid-ink); font-size: .95rem; }
.squid-week-mul { font-size: 1.25rem; font-weight: 850; letter-spacing: -.02em; }
.squid-pick-port { font-size: .82rem; font-weight: 800; }
.squid-pick-mul { font-size: 1.05rem; font-weight: 800; }
.squid-week-grade { font-size: .8rem; font-weight: 800; }
.squid-week-card.is-pick .squid-week-grade { color: var(--squid-pick-strong); }
.squid-week-card.is-normal .squid-week-grade { color: color-mix(in srgb, var(--squid-normal) 70%, var(--squid-ink)); }
.squid-week-tides, .squid-pick-tides { color: var(--squid-muted); font-size: .72rem; }

/* 30일 달력 등급 칩 */
.port-month-grade { display: inline-block; margin-left: .35rem; padding: .05rem .45rem; border: 1px solid transparent; border-radius: 999px; font-size: .68rem; font-weight: 800; vertical-align: middle; }
.port-month-grade.is-pick { background: color-mix(in srgb, var(--squid-pick) 18%, var(--squid-surface)); border-color: color-mix(in srgb, var(--squid-pick) 50%, transparent); color: var(--squid-pick-strong); }
.port-month-grade.is-normal { background: color-mix(in srgb, var(--squid-normal) 16%, var(--squid-surface)); border-color: color-mix(in srgb, var(--squid-normal) 55%, transparent); color: var(--squid-ink); }
.port-month-grade.is-heavy { background: color-mix(in srgb, var(--squid-heavy) 12%, var(--squid-surface)); border-color: color-mix(in srgb, var(--squid-heavy) 45%, transparent); color: var(--squid-muted); }
.port-month-grade.is-closed { background: var(--squid-soft); color: var(--squid-muted); }

/* 허브 표 셀 */
.week-table td.grade { white-space: nowrap; }
.week-table td.grade small { display: block; color: var(--squid-muted); font-size: .72rem; }
.weekend-table .squid-grade.is-compact { margin-top: .2rem; }
.squid-picks { margin: 0 0 1rem; }
.squid-picks h2 small { display: block; margin-top: .15rem; color: var(--squid-muted); font-size: .8rem; font-weight: 500; }

@media (max-width: 480px) {
  .squid-week-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .squid-week-card a { min-height: 84px; padding: .5rem .45rem; }
  .squid-week-mul { font-size: 1.05rem; }
  .squid-week-tides { display: none; }
}

/* 허브 표는 셀을 글자 단위로 접지 않고 .table-scroll 안에서 가로 스크롤한다. */
.week-table th, .week-table td { white-space: nowrap; }
.week-table td a b, .week-table td small { white-space: nowrap; }


/* 홈·추천기 (2단계) */
.calendar-grade { display: block; margin-top: .1rem; font-size: .62rem; font-weight: 800; line-height: 1.2; }
.calendar-grade.is-pick { color: var(--squid-pick-strong); }
.calendar-grade.is-normal { color: color-mix(in srgb, var(--squid-normal) 70%, var(--squid-ink)); }
.calendar-grade.is-heavy { color: var(--squid-heavy); }
.calendar-grade.is-closed { color: var(--squid-closed); }
.calendar-day[data-squid-grade="PICK"] { box-shadow: inset 0 3px 0 var(--squid-pick); }
.trip-dashboard-grade { display: grid; gap: .15rem; justify-items: end; }
.trip-dashboard-grade > small { color: var(--squid-muted); font-size: .68rem; }
.selected-day-grade { margin: .35rem 0 0; }
.condition-grade { margin: .4rem 0 .6rem; }
.condition-grade:empty { display: none; }
.mul-flow { max-width: none; }
.home-port-grade { margin-top: .35rem; font-style: normal; }
.hp-grade { display: inline-block; margin-left: .2rem; font-style: normal; }
.hp-week { margin: 1rem 0 0; }
.hp-day-title + .squid-visuals { margin-top: -.25rem; }
.squid-week-grade { white-space: nowrap; }
@media (max-width: 480px) { .squid-week-grade { font-size: .7rem; letter-spacing: -.02em; } }
