/* シオドキ — デザインシステム
   深海（ダーク）と朝の港（ライト）の 2 テーマ。夜明け前の釣り場でも眩しくない配色を基準にする。 */

:root {
  --bg: #061219;
  --bg-glow: radial-gradient(120% 60% at 50% -10%, #0f3446 0%, rgba(6, 18, 25, 0) 60%);
  --surface: #0b1d27;
  --surface-2: #10283a;
  --surface-3: #163448;
  --line: rgba(160, 205, 225, 0.12);
  --line-strong: rgba(160, 205, 225, 0.22);
  --text: #e7f0f4;
  --text-2: #a3bac6;
  --text-3: #6f8b99;
  --accent: #46d3c3;
  --accent-ink: #032722;
  --accent-soft: rgba(70, 211, 195, 0.14);
  --sea: #2c9fd0;
  --sea-soft: rgba(44, 159, 208, 0.22);
  --dawn: #ffb067;
  --dawn-soft: rgba(255, 176, 103, 0.16);
  --moon: #c9cdf2;
  --night: #0a1630;
  --warn: #f5c451;
  --warn-soft: rgba(245, 196, 81, 0.14);
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.15);
  --good: #7ddc8f;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 68px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-num: "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", "Roboto", var(--font);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef3f5;
  --bg-glow: radial-gradient(120% 60% at 50% -10%, #d6ecf2 0%, rgba(238, 243, 245, 0) 60%);
  --surface: #ffffff;
  --surface-2: #f3f8fa;
  --surface-3: #e5eff3;
  --line: rgba(10, 40, 60, 0.1);
  --line-strong: rgba(10, 40, 60, 0.2);
  --text: #0a2230;
  --text-2: #3f5a68;
  --text-3: #566e7b;
  --accent: #0b8a80;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 138, 128, 0.12);
  --sea: #1677a5;
  --sea-soft: rgba(22, 119, 165, 0.16);
  --dawn: #c8641c;
  --dawn-soft: rgba(200, 100, 28, 0.12);
  --moon: #5a5f9a;
  --night: #dfe6f3;
  --warn: #9a6f00;
  --warn-soft: rgba(200, 150, 0, 0.14);
  --danger: #c93434;
  --danger-soft: rgba(201, 52, 52, 0.1);
  --good: #23864a;
  --shadow: 0 8px 24px rgba(10, 40, 60, 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #eef3f5;
    --bg-glow: radial-gradient(120% 60% at 50% -10%, #d6ecf2 0%, rgba(238, 243, 245, 0) 60%);
    --surface: #ffffff;
    --surface-2: #f3f8fa;
    --surface-3: #e5eff3;
    --line: rgba(10, 40, 60, 0.1);
    --line-strong: rgba(10, 40, 60, 0.2);
    --text: #0a2230;
    --text-2: #3f5a68;
    --text-3: #566e7b;
    --accent: #0b8a80;
    --accent-ink: #ffffff;
    --accent-soft: rgba(11, 138, 128, 0.12);
    --sea: #1677a5;
    --sea-soft: rgba(22, 119, 165, 0.16);
    --dawn: #c8641c;
    --dawn-soft: rgba(200, 100, 28, 0.12);
    --moon: #5a5f9a;
    --night: #dfe6f3;
    --warn: #9a6f00;
    --warn-soft: rgba(200, 150, 0, 0.14);
    --danger: #c93434;
    --danger-soft: rgba(201, 52, 52, 0.1);
    --good: #23864a;
    --shadow: 0 8px 24px rgba(10, 40, 60, 0.12);
    color-scheme: light;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-glow), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }

.i { width: 22px; height: 22px; flex: none; }
.i--sm { width: 16px; height: 16px; }
.i--lg { width: 28px; height: 28px; }

/* ---------- layout ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; max-width: 1180px; margin: 0 auto; }
.main { flex: 1; padding: 0 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); outline: none; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.topbar__right { display: flex; align-items: center; gap: 6px; }
.spot-switch {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 72vw;
  padding: 8px 12px 8px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600;
}
.spot-switch__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
.net { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(560px, calc(100% - 20px)); height: var(--tabbar-h);
  display: grid; grid-template-columns: 1fr 1fr 1.35fr 1fr 1fr; align-items: center;
  padding: 0 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-3); text-decoration: none; font-size: 11px; font-weight: 600; padding: 8px 0;
}
.tab[aria-current="page"] { color: var(--accent); }
.fab {
  justify-self: center; display: inline-flex; align-items: center; gap: 6px;
  height: 50px; padding: 0 16px; border-radius: 16px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 14px;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
  transition: transform .15s ease;
  white-space: nowrap;
}
.fab:active { transform: scale(.96); }
.fab.is-live { background: var(--dawn); color: #1d0e00; box-shadow: 0 6px 18px color-mix(in srgb, var(--dawn) 45%, transparent); }

/* ---------- trip bar（釣行中） ---------- */
.trip-bar {
  position: fixed; z-index: 29; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  width: min(540px, calc(100% - 32px));
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px;
  background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: 13px;
}
.trip-bar__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dawn); box-shadow: 0 0 0 0 var(--dawn); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dawn) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.trip-bar__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- cards & common ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px;
}
.card + .card { margin-top: 12px; }
.card__title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--text-2); letter-spacing: .02em; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 22px 4px 10px; letter-spacing: .02em; }
.h1 { font-size: 22px; font-weight: 800; margin: 6px 4px 14px; letter-spacing: .01em; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 440px) { .grid-2--dates { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.stack > * + * { margin-top: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface-2); font-weight: 700;
  text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn--dawn { background: var(--dawn); color: #1d0e00; border-color: transparent; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.chip--accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip--dawn { background: var(--dawn-soft); color: var(--dawn); border-color: transparent; }
.chip--warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
button.chip { cursor: pointer; min-height: 40px; padding: 8px 13px; font-size: 13.5px; }
button.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px;
}
.notice .i { margin-top: 1px; }
.notice--warn { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.notice--warn .i { color: var(--warn); }
.notice--danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice--danger .i { color: var(--danger); }
.notice strong { display: block; }
.notices { display: grid; gap: 8px; margin-bottom: 12px; }

.empty { text-align: center; padding: 36px 16px; color: var(--text-2); }
.empty__art { width: 120px; margin: 0 auto 10px; opacity: .9; }

/* ---------- today ---------- */
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 4px 4px 12px; }
.today-date { font-size: 20px; font-weight: 800; }
.day-nav { display: inline-flex; gap: 4px; }
.day-nav .icon-btn { width: 44px; height: 44px; }

/* いまの海（ひと目で）：注意情報のすぐ下に、風・波・潮・次の時合 */
.glance { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; margin: 0 0 12px; }
.glance__item { display: grid; gap: 1px; padding: 9px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.glance__k { font-size: 11px; font-weight: 700; color: var(--text-3); }
.glance__v { font-size: 20px; font-weight: 800; line-height: 1.2; white-space: nowrap; }
.glance__v small { font-size: 12px; font-weight: 700; color: var(--text-2); margin-left: 1px; }
.glance__s { font-size: 11px; color: var(--text-2); line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.loading-line { display: flex; align-items: center; gap: 8px; margin: 4px 2px 10px; font-size: 13px; color: var(--text-2); }

.today-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.today-grid > * { min-width: 0; }
.today-grid > div > .card + .card { margin-top: 12px; }
@media (min-width: 900px) {
  .today-grid { grid-template-columns: minmax(380px, 1fr) minmax(0, 1.2fr); align-items: start; }
  .today-grid > .span-2 { grid-column: 1 / -1; }
}

.dial-card { padding: 14px 14px 18px; position: relative; overflow: hidden; }
.dial-wrap { position: relative; width: min(100%, 360px); margin: 0 auto; aspect-ratio: 1; }
.dial-wrap svg { width: 100%; height: 100%; display: block; }
.dial-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none;
}
.dial-score { font-size: 64px; font-weight: 700; line-height: 1; }
.dial-score small { font-size: 18px; color: var(--text-3); font-weight: 600; margin-left: 2px; }
.dial-label { font-size: 12px; color: var(--text-2); margin-top: 4px; letter-spacing: .08em; }
.dial-sub { font-size: 13px; font-weight: 700; margin-top: 8px; }
.dial-legend { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }
.dial-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dial-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.windows { display: grid; gap: 8px; margin-top: 12px; }
.window {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 14px; background: var(--accent-soft);
}
.window__time { font-size: 18px; font-weight: 700; }
.window__why { font-size: 12px; color: var(--text-2); text-align: right; }

/* 数値のマス：スマホでは 2 列（4 列だと「101…」「晴れ…」のように途切れる）。置き場所が広いときだけ 4 列 */
.card:has(> .stats-strip) { container-type: inline-size; }
.stats-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@container (min-width: 540px) { .stats-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  background: var(--surface-2); border-radius: 14px; padding: 10px 10px 9px; min-width: 0;
}
.stat--btn { border: 0; text-align: left; color: inherit; width: 100%; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line); }
.stat--btn:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.stat__label { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-3); font-weight: 600; }
.stat__label .i { width: 14px; height: 14px; }
.stat__value { font-size: 19px; font-weight: 700; line-height: 1.25; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__value small { font-size: 12px; color: var(--text-2); font-weight: 600; margin-left: 1px; }
.stat__sub { font-size: 11.5px; line-height: 1.4; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.tide-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; margin-top: 10px; }
.tide-ev { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--surface-2); }
.tide-ev__type { font-size: 11px; font-weight: 700; }
.tide-ev__type.high { color: var(--sea); }
.tide-ev__type.low { color: var(--text-3); }
.tide-ev__time { font-size: 16px; font-weight: 700; }
.tide-ev__h { font-size: 11px; color: var(--text-2); }

.timeline-scroll { overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.timeline-scroll svg { display: block; }
.source-line { margin-top: 10px; font-size: 11.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 12px; }
/* 圏外の準備（今日の画面） */
.prep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prep-list li { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }
.prep-list li > .i { color: var(--warn); }
.prep-list li.is-ok > .i { color: var(--good); }
.prep-list b { display: block; color: var(--text); font-size: 13px; }
.prep-list .btn { white-space: nowrap; }
.source-details { margin-top: 10px; }
.source-details > summary { cursor: pointer; font-size: 12px; color: var(--text-3); min-height: 32px; display: flex; align-items: center; gap: 6px; list-style: none; }
.source-details > summary::-webkit-details-marker { display: none; }
.source-details > summary::after { content: "▾"; font-size: 11px; }
.source-details[open] > summary::after { content: "▴"; }
.source-details .source-line { margin-top: 4px; }

.why-list { display: grid; gap: 8px; }
.why-item { display: grid; grid-template-columns: 92px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.target-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px 4px; }
.target-row::-webkit-scrollbar { display: none; }

/* ---------- map / spots ---------- */
.map-shell { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); height: min(58dvh, 520px); background: var(--surface-2); }
#map { position: absolute; inset: 0; }
.map-tools { position: absolute; z-index: 500; right: 10px; top: 10px; display: grid; gap: 6px; }
.map-cross { position: absolute; z-index: 450; left: 50%; top: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px; pointer-events: none; }
.map-cross::before, .map-cross::after { content: ""; position: absolute; background: var(--dawn); box-shadow: 0 0 0 1px rgba(0,0,0,.35); border-radius: 2px; }
.map-cross::before { left: 13px; top: 0; width: 2px; height: 28px; }
.map-cross::after { top: 13px; left: 0; height: 2px; width: 28px; }
.map-tools .icon-btn { box-shadow: var(--shadow); }
.map-hint { position: absolute; z-index: 500; left: 10px; bottom: 10px; right: 10px; display: flex; justify-content: center; pointer-events: none; }
.map-hint span { pointer-events: auto; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; }
.leaflet-container { font-family: var(--font); background: var(--surface-2); }
:root[data-theme="dark"] .tiles-map { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.7); }
@media not (prefers-color-scheme: light) {
  :root:not([data-theme]) .tiles-map { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.7); }
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-control-attribution { font-size: 10px; }
.spot-marker { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--accent); border: 2px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.35); display: grid; place-items: center; }
.spot-marker span { transform: rotate(45deg); font-size: 12px; font-weight: 800; color: var(--accent-ink); }
.spot-marker.is-current { background: var(--dawn); }
.catch-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--dawn); border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.station-dot { width: 10px; height: 10px; border-radius: 2px; background: var(--sea); border: 1.5px solid #fff; transform: rotate(45deg); opacity: .85; }

.list { display: grid; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none;
}
.list-item__main { flex: 1; min-width: 0; }
.list-item__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__sub { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item.is-current { border-color: color-mix(in srgb, var(--accent) 60%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- log ---------- */
.seg { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--text-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.trip-card { display: block; text-decoration: none; color: inherit; }
.trip-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.trip-card__date { font-weight: 800; }
.trip-card__result { font-weight: 800; font-size: 18px; }
.trip-card__result.zero { color: var(--text-3); }
.trip-card__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.photo-strip { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; }
.photo-strip img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; }
.month-label { font-size: 12px; font-weight: 800; color: var(--text-3); margin: 18px 4px 8px; letter-spacing: .06em; }

.catch-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.catch-row:first-child { border-top: 0; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { background: var(--surface-2); border-radius: 14px; padding: 12px; }
.kpi__v { font-size: 24px; font-weight: 700; line-height: 1.2; }
.kpi__l { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.chart { width: 100%; max-width: 640px; height: auto; display: block; margin: 0 auto; }
body.has-trip .main { padding-bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom)); }
.insight { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 13.5px; }
.insight strong { color: var(--accent); }

/* ---------- guide ---------- */
.fish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.fish-card { padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.fish-card__name { font-weight: 800; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin-top: 8px; }
.months span { height: 6px; border-radius: 2px; background: var(--surface-3); }
.months span.on { background: var(--accent); }
.months span.now { outline: 1.5px solid var(--dawn); outline-offset: 1px; }

/* ---------- sheet (dialog) ---------- */
.sheet {
  padding: 0; border: 0; margin: auto auto 0; width: min(560px, 100%); max-width: 100%; max-height: 92dvh;
  border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text);
  box-shadow: 0 -10px 40px rgba(0,0,0,.4); overflow: hidden;
}
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 24px; } }
.sheet::backdrop { background: rgba(2, 8, 12, .6); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in .22s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet__inner { display: flex; flex-direction: column; max-height: 92dvh; transition: transform .18s ease-out; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px 8px; touch-action: none; }
.sheet__head h2 { margin: 0; font-size: 18px; }
/* 見出しは押す物ではないので、開いた直後に選択を置いても枠は出さない（読み上げの起点としてだけ使う） */
.sheet__head h2:focus, .sheet__head h2:focus-visible { outline: none; }
/* つまみは指で引きやすいよう、見た目より広い範囲を触れるように */
.grabber { position: relative; touch-action: none; cursor: grab; }
.grabber::before { content: ""; position: absolute; inset: -12px -60px -10px; }
.sheet__body { padding: 6px 16px 16px; overflow-y: auto; }
.sheet__foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet__foot .btn { flex: 1; }
.grabber { width: 40px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 8px auto 0; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .field__label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface-2); outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 80px; resize: vertical; }
.stepper { display: inline-flex; align-items: center; border-radius: 12px; border: 1px solid var(--line-strong); overflow: hidden; }
.stepper button { width: 46px; height: 46px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 700; }
.stepper input { width: 64px; height: 46px; border: 0; text-align: center; background: var(--surface); font-weight: 700; font-size: 18px; }
.size-input { display: flex; align-items: center; gap: 10px; }
.size-input input[type="range"] { flex: 1; accent-color: var(--accent); }
.size-input .input { width: 96px; text-align: center; font-weight: 700; font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-pick {
  display: grid; place-items: center; gap: 6px; height: 120px; border-radius: 16px; border: 1.5px dashed var(--line-strong);
  background: var(--surface-2); color: var(--text-2); font-weight: 700; cursor: pointer; overflow: hidden; position: relative;
}
.photo-pick img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 「写真を選ぶ」「カメラで撮る」は横に並べて、記録のシートを短く（選んだ写真は左に小さく出る） */
.photo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-row .photo-pick { height: 92px; }
.photo-row .photo-pick + .photo-pick { margin-top: 0; }
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.switch input { width: 46px; height: 28px; accent-color: var(--accent); }
.auto-cond { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 12px; }

/* ---------- toast ---------- */
/* 親指の届く下側（記録ボタンの上）に出し、「取り消す」を押しやすくする */
.toast-host { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
body.has-trip .toast-host { bottom: calc(var(--tabbar-h) + 82px + env(safe-area-inset-bottom)); }
.sheet > .toast-host--sheet, body.has-trip .sheet > .toast-host--sheet { bottom: calc(84px + env(safe-area-inset-bottom)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 14px;
  animation: toast-in .25s ease;
}
.toast .i { color: var(--accent); }
.toast__msg { flex: 1; }
.toast__action { border: 0; background: transparent; color: var(--accent); font-weight: 800; padding: 4px 6px; }
/* 地図では下に候補パネル・海図の操作・ルートの結果が並ぶので、通知は上（情報の帯の下）に出す */
body[data-route="map"] .toast-host { top: calc(var(--map-top-h, 128px) + 8px); bottom: auto; }
body[data-route="map"] .toast { animation-name: toast-in-top; }
@keyframes toast-in-top { from { transform: translateY(-10px); opacity: 0; } }

/* 「取り消す」は濡れた手でも押せるように大きく */
.toast--action .toast__action { min-height: 44px; min-width: 64px; padding: 0 14px; margin: -8px -8px -8px 0; border-radius: 12px; background: var(--accent-soft); }

/* 指で触る端末では、よく使う小さなボタン・チップも押せる大きさに（見た目は同じでも高さを確保） */
@media (pointer: coarse) {
  .btn--sm { min-height: 44px; }
  button.chip { min-height: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}

/* 保存中の表示 */
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn[aria-busy="true"] { opacity: .85; }

/* 直す場所の目印 */
.is-invalid { outline: 2.5px solid var(--danger) !important; outline-offset: 3px; border-radius: 12px; animation: shake .35s ease-in-out; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* シートの中の確認（入力中の画面の上に重ねる） */
.sheet-confirm { position: absolute; inset: 0; z-index: 5; display: grid; align-items: end; background: rgba(2, 8, 12, .45); border-radius: inherit; animation: fade-in .15s ease-out; }
.sheet-confirm__card { margin: 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.3); }
.sheet-confirm__card h3 { margin: 0 0 6px; font-size: 17px; }
.sheet-confirm__card p { margin: 0 0 14px; }
.sheet-confirm__btns { display: flex; gap: 8px; }
.sheet-confirm__btns .btn { flex: 1; min-height: 48px; }
@keyframes fade-in { from { opacity: 0; } }
.sheet__inner { position: relative; }

/* シートの下：主な操作を広く、削除などは控えめに */
.sheet__foot .btn--quiet { flex: 0 0 auto; color: var(--text-2); font-size: 13px; }
.sheet__foot .btn--main { flex: 1 1 auto; }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- onboarding ---------- */
.hero { text-align: center; padding: 28px 8px 10px; }
.hero__logo { width: 88px; height: 88px; margin: 0 auto 14px; }
.hero h1 { font-size: 30px; margin: 0; letter-spacing: .04em; }
.hero p { color: var(--text-2); margin: 8px auto 0; max-width: 32em; }
.hero--compact { padding-top: 12px; }
.hero--compact .hero__logo { width: 72px; height: 72px; margin-bottom: 10px; }
.hero--compact h1 { font-size: 28px; }
.hero--compact + .stack { margin-top: 18px; }
.onb-title { font-size: 15px; color: var(--text-2); margin: 8px 0 0; }
.features { display: grid; gap: 10px; margin: 22px 0; }
.onb-title + .features { margin-top: 10px; }
/* 初回の案内では、場所を決めるまで下のタブと「釣行開始」を出さない（押しても進めないため） */
body.is-onboarding .tabbar { display: none; }
.feature { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.feature .i { color: var(--accent); margin-top: 2px; }
.feature strong { display: block; }
.feature span { font-size: 13px; color: var(--text-2); }

/* ---------- misc ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.link-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--text); }
.link-list a:first-child { border-top: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; font-weight: 700; margin: 4px 0 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================================
   v0.6 — 地図・地点情報・ナビ・道具箱・カレンダー・週間
   ===================================================================== */

/* ---------- 地図（全画面） ---------- */
body[data-route="map"] .main { padding: 0; }
body[data-route="map"] .app { max-width: none; }
.mapview { position: relative; isolation: isolate; height: 100dvh; min-height: 420px; overflow: hidden; background: var(--surface-2); }
body[data-route="map"] .mapview__top, body[data-route="map"] .mapview__tools { top: calc(10px + env(safe-area-inset-top)); }
.mapview__map { position: absolute; inset: 0; }
.mapview.is-nobase .leaflet-container { background: #e9e4d8; }
:root[data-theme="dark"] .mapview.is-nobase .leaflet-container { background: #1b2a33; }
.mapview .map-cross { z-index: 450; }

.mapview__top { position: absolute; z-index: 600; top: 10px; left: 10px; right: 66px; display: grid; gap: 8px; pointer-events: none; }
.mapview__top > * { pointer-events: auto; }
.map-search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(10px); color: var(--text-2); }
.map-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--text); }
.map-search__results { border-radius: 16px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); overflow: hidden; max-height: 50dvh; overflow-y: auto; }
.map-search__results button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: var(--text); }
.map-search__results button:first-child { border-top: 0; }
.species-bar { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.species-bar::-webkit-scrollbar { display: none; }
.species-bar .chip { background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 2px 8px rgba(0,0,0,.25); border-color: var(--line-strong); }
.species-bar .chip[aria-pressed="true"] { background: #ff7a45; color: #2a0d00; }
.chip--off { opacity: .6; }

.mapview__tools { position: absolute; z-index: 600; top: 10px; right: 10px; display: grid; gap: 8px; justify-items: end; }
.map-fab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 46px; height: 46px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); color: var(--text); font-weight: 700; font-size: 13px; backdrop-filter: blur(10px); }
.map-fab[aria-pressed="true"] { background: var(--dawn); color: #1d0e00; border-color: transparent; }
.map-fab span { display: none; }
@media (min-width: 560px) { .map-fab span { display: inline; } .mapview__top { right: 134px; max-width: 640px; } }

.mapview__bottom { position: absolute; z-index: 600; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + 20px + var(--trip-h, 0px) + env(safe-area-inset-bottom)); display: grid; gap: 8px; pointer-events: none; }
/* 釣行中は下に「釣行中」の帯が出るので、地図の下の操作をその分だけ上げる（帯と重ねない） */
body.has-trip { --trip-h: 64px; }
.mapview__bottom > * { pointer-events: auto; }
.map-legend { justify-self: start; max-width: min(340px, 100%); padding: 8px 12px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; display: grid; gap: 4px; backdrop-filter: blur(8px); }
.legend-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.map-link { margin-top: 10px; white-space: normal; text-align: center; line-height: 1.4; padding: 10px 14px; }
.legend-dot { border-radius: 50% !important; }
.legend-hatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; background: repeating-linear-gradient(45deg, rgba(140,150,160,.8) 0 2px, transparent 2px 5px); border: 1px solid var(--line-strong); }
.legend-toggle { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; font-weight: 800; font-size: 12px; color: var(--text); }
.legend-body { display: grid; gap: 4px; margin-top: 4px; }
.map-legend.is-collapsed { padding: 6px 12px; }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend-scale { justify-content: space-between; color: var(--text-3); font-size: 10.5px; }
.depth-bar { display: block; width: 180px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, rgb(190,236,245), rgb(100,192,228) 25%, rgb(36,122,190) 55%, rgb(16,58,122) 80%, rgb(10,34,84)); }

.map-hud { width: min(560px, 100%); justify-self: center; display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 10px 12px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 95%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.map-hud__info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.map-hud__depth { font-size: 30px; font-weight: 800; line-height: 1; color: var(--sea); min-width: 64px; }
.map-hud__depth small { font-size: 14px; color: var(--text-2); margin-left: 1px; }
.map-hud__meta { min-width: 0; }
.map-hud__meta div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-hud__actions { display: flex; gap: 6px; }
.map-hud__wind, .map-hud__measure { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.map-hud__wind input { flex: 1; accent-color: var(--accent); }
.map-hud__note { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.map-hud__note .i { color: var(--warn); }
@media (max-width: 420px) { .map-hud { grid-template-columns: 1fr; } .map-hud__actions .btn { flex: 1; } }
.mapview .leaflet-bottom { bottom: calc(var(--hud-h, 120px) + var(--tabbar-h) + 26px + var(--trip-h, 0px) + env(safe-area-inset-bottom)); }
.mapview .leaflet-control-scale-line { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--text); border-color: var(--text-2); }

.wind-arrow { position: relative; width: 44px; height: 44px; display: grid; place-items: center; }
.wind-arrow svg { width: 26px; height: 26px; transform: rotate(var(--rot)); fill: var(--c); filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.wind-arrow span { position: absolute; bottom: -4px; font: 800 11px var(--font-num); color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.wp-marker { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); display: grid; place-items: center; }
.wp-marker span { width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.wp-label { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11px; font-weight: 800; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; pointer-events: none; }
.kind-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---------- レイヤー選択 ---------- */
.seg--wide { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
.layer-list { display: grid; gap: 6px; margin: 12px 0; }
.layer-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.layer-item__text { display: grid; gap: 1px; }
.layer-item input { width: 22px; height: 22px; accent-color: var(--accent); }
.layer-item__icon { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-3); }
.layer-item__icon--depth { background: linear-gradient(135deg, rgb(150,220,238), rgb(24,88,160)); }
.layer-item__icon--fit { background: radial-gradient(circle at 40% 40%, #ff5c38, #ffbe3c 60%, transparent 70%), var(--surface-3); }
.layer-item__icon--bottom { background: linear-gradient(90deg, rgb(146,92,56) 33%, rgb(232,204,128) 33% 66%, rgb(104,120,88) 66%); }
.layer-item__icon--osm { background: repeating-linear-gradient(45deg, #b06a36 0 5px, #e3c069 5px 10px); }
.layer-item__icon--seamark { background: radial-gradient(circle, #ff5c38 25%, transparent 30%), linear-gradient(#2c9fd0, #1677a5); }
.layer-item__icon--wind { background: conic-gradient(from 200deg, #46d3c3, #f5c451, #ff6b6b, #46d3c3); }
.layer-item__icon--waypoints { background: radial-gradient(circle, #fff 18%, #c97a3d 22% 45%, transparent 50%), var(--surface-3); }
.layer-item__icon--spots { background: radial-gradient(circle, #fff 18%, var(--accent) 22% 45%, transparent 50%), var(--surface-3); }
.layer-item__icon--catches { background: radial-gradient(circle, var(--dawn) 35%, transparent 40%), var(--surface-3); }
.layer-item__icon--stations { background: radial-gradient(circle, var(--sea) 30%, transparent 35%), var(--surface-3); }

/* ---------- 地点情報 ---------- */
.coord-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 15px; font-weight: 700; }
.ins-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 8px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--sea-soft), transparent); }
.ins-hero__label { font-size: 12px; color: var(--text-2); font-weight: 700; }
.ins-hero__value { font-size: 44px; font-weight: 800; line-height: 1; color: var(--sea); }
.ins-hero__value small { font-size: 18px; color: var(--text-2); }
.ins-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bottom-bar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; border: 1px solid var(--line-strong); }
.bottom-legend { display: flex; gap: 14px; margin-top: 6px; color: var(--text-2); }
.bottom-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }
.basis { margin: 8px 0 0; padding-left: 1.2em; }
.near-list { display: grid; gap: 4px; }
.near-item { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.near-item:first-child { border-top: 0; }
.near-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); }
.near-dot--rock { background: #b06a36; } .near-dot--sand { background: #e3c069; } .near-dot--gravel { background: #bba98a; } .near-dot--mud { background: #7c8c63; }
.near-dot--structure { background: #e8eef2; border: 2px solid #607d8b; } .near-dot--river { background: #3fa7d6; } .near-dot--fishing { background: var(--accent); }
.fit-list { display: grid; gap: 6px; }
.fit-card { border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.fit-card summary { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; cursor: pointer; list-style: none; }
.fit-card summary::-webkit-details-marker { display: none; }
.fit-card__hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.lv { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px; font-weight: 800; font-size: 13px; }
.lv-high { background: #ff5c38; color: #fff; } .lv-mid { background: #ffbe3c; color: #2a1a00; } .lv-low { background: var(--surface-3); color: var(--text-2); } .lv-none { background: var(--surface-3); color: var(--text-3); }
.reasons { list-style: none; margin: 0; padding: 0 12px 12px; display: grid; gap: 4px; font-size: 13px; }
.reasons li { display: flex; gap: 6px; align-items: flex-start; }
.reasons .good .i { color: var(--good); } .reasons .bad .i { color: var(--danger); } .reasons .miss { color: var(--text-3); }

/* ---------- ナビ ---------- */
body[data-route="nav"] .main { padding-top: calc(10px + env(safe-area-inset-top)); }
.nav-dial { position: relative; width: min(100%, 340px); aspect-ratio: 1; margin: 12px auto 8px; }
.nav-compass { width: 100%; height: 100%; }
.nav-compass [data-ring], .nav-compass [data-arrow], .nav-compass [data-cog] { transition: transform .25s ease-out; }
.nav-dial__center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.nav-dist { font-size: 50px; font-weight: 800; line-height: 1; }
.nav-dist small { font-size: 18px; color: var(--text-2); }
.nav-brg { margin-top: 6px; font-size: 14px; color: var(--text-2); font-weight: 700; }
.nav-status:empty { display: none; }
.nav-status { margin-bottom: 10px; }
.nav-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .nav-grid { grid-template-columns: repeat(3, 1fr); } }
.nav-map, .trip-map { height: 240px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); margin-top: 12px; }
.catch-map { height: min(60dvh, 520px); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.rec-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff4d4d; margin-right: 4px; animation: pulse 1.6s infinite; vertical-align: 1px; }

/* ---------- 道具箱 ---------- */
.box-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.box-tabs button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 12.5px; }
.box-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.podium { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.podium__item { position: relative; display: grid; gap: 2px; padding: 12px 12px 12px 44px; border-radius: 14px; background: var(--surface-2); }
.podium__rank { position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--dawn); color: #1d0e00; font-weight: 800; font-size: 13px; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.checklist { display: grid; gap: 4px; }
.check-item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.check-item input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check-item.is-done span { color: var(--text-3); text-decoration: line-through; }
.method-list { display: grid; gap: 8px; }
.method { padding: 0; }
.method summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; list-style: none; }
.method summary::-webkit-details-marker { display: none; }
.method__body { padding: 0 16px 16px; }
.method__body h4 { margin: 12px 0 4px; font-size: 13px; color: var(--accent); }
.method__body p, .method__body ol, .method__body ul { margin: 0; }
.method__body ol, .method__body ul { padding-left: 1.3em; display: grid; gap: 3px; }
.method__body .notice { margin-top: 12px; }

/* ---------- 潮見カレンダー ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal__wd { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--text-3); padding: 4px 0; }
.cal__wd:first-child { color: var(--danger); } .cal__wd:nth-child(7) { color: var(--sea); }
.cal__day { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 5px; min-height: 86px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.cal__day.is-today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal__day.is-sun .cal__num { color: var(--danger); } .cal__day.is-sat .cal__num { color: var(--sea); }
.cal__num { font-weight: 800; font-size: 14px; }
.cal__moon svg { display: block; }
.cal__tide { font-size: 11px; font-weight: 800; }
.cal__bar { width: 80%; height: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cal__bar span { display: block; height: 100%; }
.cal__sub { font-size: 10.5px; color: var(--text-2); letter-spacing: -.02em; white-space: nowrap; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 4px; color: var(--text-2); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- 週間・ソーラー ---------- */
.week { display: grid; grid-template-columns: repeat(7, minmax(84px, 1fr)); gap: 6px; overflow-x: auto; scrollbar-width: thin; margin: 0 -16px; padding: 0 16px 4px; }
.week-day { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.week-day.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.week-day.is-stop .week-day__score { color: var(--danger); }
.week-day__d { font-weight: 800; font-size: 13px; }
.week-day__d small { margin-left: 2px; color: var(--text-3); font-weight: 700; }
.week-day__tide { font-size: 11px; font-weight: 700; color: var(--text-2); }
.week-day__score { position: relative; display: inline-flex; align-items: center; gap: 2px; font-size: 20px; font-weight: 800; padding-bottom: 6px; }
.week-day__score::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p); max-width: 100%; border-radius: 99px; background: var(--accent); }
.week-day__sub { font-size: 11px; color: var(--text-3); }
.solunar { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.solunar__item { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 12px; color: var(--text-2); }
.solunar__item strong { font-size: 15px; color: var(--text); }
.solunar__item--major { background: color-mix(in srgb, var(--moon) 18%, var(--surface-2)); }
#sst[hidden], #solunar:empty, #sst:empty { display: none; }

/* =====================================================================
   v0.7 — 狙う魚の「条件が合う候補」
   ===================================================================== */
/* 下部の「狙う魚」バー（親指の届く位置で、魚の選択と表示・非表示を一か所に） */
.tbar { width: min(560px, 100%); justify-self: center; display: grid; gap: 8px; padding: 10px 12px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.tbar__fish { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.tbar__fish::-webkit-scrollbar { display: none; }
.tbar__chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 10px; border-radius: 14px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--text); font-weight: 800; font-size: 15px; white-space: nowrap; }
.tbar__chip b { position: absolute; left: -6px; top: -6px; width: 18px; height: 18px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; display: grid; place-items: center; }
.tbar__add { width: 44px; height: 44px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: transparent; color: var(--text-2); display: grid; place-items: center; flex: none; }
.tbar__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tbar__toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-weight: 800; font-size: 13px; }
.tbar__switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background .15s; }
.tbar__switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: transform .15s, background .15s; }
.tbar__toggle[aria-checked="true"] .tbar__switch { background: var(--accent); border-color: transparent; }
.tbar__toggle[aria-checked="true"] .tbar__switch::after { transform: translateX(16px); background: #fff; }
.tbar__status { flex: 1; min-width: 120px; line-height: 1.35; }

/* 地図上の候補の印：魚の形＋魚名＋◎/○（色だけに頼らない）。順位や点滅は付けない */
.cand { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.cand__icon { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 3px solid var(--c); box-shadow: 0 3px 10px rgba(0,0,0,.4); flex: none; }
.cand.is-strong .cand__icon { background: var(--c); border-color: #fff; }
.cand__icon b { position: absolute; right: -5px; top: -5px; width: 17px; height: 17px; border-radius: 50%; background: #fff; color: #111; font-size: 10.5px; font-weight: 900; display: grid; place-items: center; border: 1.5px solid var(--c); }
.cand__label { display: grid; padding: 3px 8px 3px 7px; border-radius: 10px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line-strong); box-shadow: 0 2px 6px rgba(0,0,0,.3); font-size: 12.5px; font-weight: 800; color: var(--text); white-space: nowrap; line-height: 1.2; text-align: left; }
.cand__label small { font-size: 10.5px; font-weight: 700; color: var(--text-2); }
.cand:focus-visible .cand__icon { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 選んだ候補のカード */
.cand-card { width: min(560px, 100%); justify-self: center; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); display: grid; gap: 8px; max-height: 42dvh; overflow-y: auto; }
.cand-card__head { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; }
.cand-card__icon { width: 44px; height: 44px; border-radius: 50%; background: var(--c); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.cand-card__title { display: grid; }
.cand-card__title strong { font-size: 18px; }
.cand-card__title span { font-size: 12.5px; color: var(--text-2); font-weight: 700; }
.cand-card__reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13.5px; }
.cand-card__reasons li { display: flex; gap: 6px; align-items: center; }
.cand-card__reasons .i { color: var(--good); }
.cand-card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cand-card__note { margin: 0; font-size: 11.5px; color: var(--text-3); line-height: 1.5; }

/* 魚を選ぶシート */
.fish-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.fish-pick__item { display: grid; justify-items: center; gap: 2px; padding: 12px 6px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); min-height: 96px; }
.fish-pick__item.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fish-pick__item:disabled { opacity: .45; }

/* 下部を少しでも小さく：十字の情報は 1 行に */
.map-hud { padding: 8px 12px; gap: 6px 10px; }
.map-hud__depth { font-size: 24px; min-width: 52px; }
.map-hud__note { font-size: 10.5px; }
/* v0.7 下部の詰め */
.tbar { padding: 8px 10px; gap: 4px; }
.tbar__row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.tbar__fish { flex: 1; min-width: 0; }
.tbar__toggle { flex: none; }
.tbar__status { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.tbar__status > span { flex: 1; min-width: 0; line-height: 1.35; }
.tbar__status .btn--sm { min-height: 30px; padding: 0 10px; }
.map-hud { grid-template-columns: 1fr auto; }
.map-hud__actions { gap: 6px; }
.icon-btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
@media (max-width: 420px) { .map-hud { grid-template-columns: 1fr auto; } .map-hud__actions .btn { flex: none; } }
.mapview .leaflet-control-attribution { max-width: 70vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* v0.7 候補カードを小さく */
.cand-card { gap: 8px; padding: 10px 12px; }
.cand-card__head { grid-template-columns: 38px 1fr auto; }
.cand-card__icon { width: 38px; height: 38px; }
.cand-card__title strong { font-size: 16px; }
.cand-card__reasons { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 12.5px; }
.cand-card__reasons li { padding: 3px 8px; border-radius: 99px; background: var(--surface-2); gap: 4px; }
.cand-card__reasons li.is-tag { background: transparent; border: 1px solid var(--line-strong); color: var(--text-2); }
.cand-card__note { flex: 1; min-width: 140px; font-size: 10.5px; color: var(--text-3); line-height: 1.35; }
.cand.is-selected .cand__icon { outline: 4px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 45%, transparent), 0 3px 10px rgba(0,0,0,.4); }
.cand.is-selected .cand__label { border-color: var(--c); border-width: 2px; }
.tbar { grid-template-columns: minmax(0, 1fr); }
.tbar__row { min-width: 0; }
.cand.is-compact .cand__label { display: none; }
.cand.is-compact .cand__icon { width: 34px; height: 34px; }
/* v0.7 タップ領域（44px 以上） */
.tbar__toggle { min-height: 44px; }
.cand { padding: 1px; }
.cand.is-compact { padding: 5px; margin: -5px; }
.cand::before { content: ""; position: absolute; left: -2px; top: -2px; width: 46px; height: 46px; }
/* 根拠の一覧 */
.ev-head { display: flex; align-items: baseline; gap: 6px; font-size: 13px; }
.ev-head span { font-size: 11px; color: var(--text-3); }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ev { display: grid; grid-template-columns: 18px 1fr; column-gap: 6px; align-items: center; font-size: 13px; }
.ev .i { color: var(--good); }
.ev--strong .i { color: var(--dawn); }
.ev--strong .ev__label { font-weight: 800; }
.ev__src { grid-column: 2; font-size: 10.5px; color: var(--text-3); line-height: 1.2; }
.ev--base { opacity: .8; }
.ev__pre { font-size: 9.5px; font-weight: 800; color: var(--text-3); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 2px; text-align: center; }

/* ================= v0.8 海図モード ================= */
/* 上：検索と「釣り｜海図」 */
.mapview__toprow { display: flex; gap: 8px; align-items: center; min-width: 0; }
.mapview__toprow .map-search { flex: 1; min-width: 0; }
.mode-seg { flex: none; display: inline-flex; padding: 3px; gap: 2px; height: 46px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.mode-seg button { display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 800; font-size: 13.5px; min-width: 44px; }
.mode-seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.mode-seg button[data-mode="chart"][aria-checked="true"] { background: #0a6cff; color: #fff; }
@media (max-width: 420px) { .mode-seg button { padding: 0 9px; } .mode-seg .i { display: none; } }

/* 海図らしい背景：陸を淡い黄土色に、テーマに関係なく明るく（日中の屋外で見やすい） */
.mapview.is-chart .tiles-map { filter: sepia(.45) saturate(1.25) brightness(1.03) contrast(1.02) !important; }
.mapview.is-chart .leaflet-container { background: #f4f1e6; }
.icon-btn--route { color: #0a6cff; border-color: color-mix(in srgb, #0a6cff 40%, transparent); }
.map-hud__depth.is-shallow { color: #d62454; }
.map-hud__ship { color: #0a6cff; font-weight: 700; }
:root[data-theme="dark"] .map-hud__ship { color: #6fa8ff; }

/* 下のバー（海図の操作） */
.cbar { width: min(560px, 100%); justify-self: center; display: grid; gap: 4px; padding: 6px 8px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.cbar__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.cbar__btn { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; border: 0; border-radius: 13px; background: transparent; color: var(--text); font-weight: 800; font-size: 12px; }
.cbar__btn .i { width: 22px; height: 22px; }
.cbar__btn:active { background: var(--surface-2); }
.cbar__btn[aria-pressed="true"] { background: var(--dawn-soft); color: var(--dawn); }
.cbar__btn--primary { background: #0a6cff; color: #fff; }
.cbar__btn--primary:active { background: #0857c9; }
.cbar__btn.is-rec { background: var(--danger-soft); color: var(--danger); }
.cbar__btn.is-rec .i { animation: none; }
.cbar__badge { position: absolute; top: 3px; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #e0245e; color: #fff; font-size: 10.5px; line-height: 18px; text-align: center; }
.cbar__status { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.cbar__status > span { flex: 1; min-width: 0; line-height: 1.35; }
.cbar__status .icon-btn { width: 40px; height: 40px; }

/* ルートのパネル */
.rpanel { width: min(560px, 100%); justify-self: center; display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); max-height: 56dvh; overflow-y: auto; overscroll-behavior: contain; }
.rp__head { display: flex; align-items: center; gap: 8px; }
.rp__head strong { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.rp__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block !important; }
.rp__ends { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 6px 8px; align-items: center; }
.rp__end { grid-column: 1; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); text-align: left; min-width: 0; }
.rp__end span { flex: 1; min-width: 0; display: grid; }
.rp__end small { font-size: 11px; color: var(--text-3); font-weight: 700; }
.rp__end b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp__swap { grid-column: 2; grid-row: 1 / span 2; }
.rp__dot { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.rp__dot--from { background: #19a463; }
.rp__dot--to { background: #e0245e; }
.rp__opts { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.rp__opts > div { display: contents; }
.rp__opts .seg { justify-self: start; max-width: 100%; overflow-x: auto; }
.rp__opts .seg button { padding: 7px 11px; }
.rp__note { margin: 0; font-size: 11px; line-height: 1.5; color: var(--text-3); }
.rp__sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rp__sum > div { display: grid; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.rp__sum b { font-size: 19px; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp__sum span { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp__good { display: flex; gap: 6px; align-items: flex-start; color: var(--good); line-height: 1.45; }
.rp__warn { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rp__w { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; font-size: 12.5px; line-height: 1.45; padding: 6px 8px; border-radius: 10px; background: var(--warn-soft); }
.rp__w .i { color: var(--warn); margin-top: 1px; }
.rp__w--hazard, .rp__w--land { background: var(--danger-soft); }
.rp__w--hazard .i, .rp__w--land .i { color: var(--danger); }
.rp__hz { display: flex; flex-wrap: wrap; gap: 6px; }
.chip--hz { color: #e0245e; border-color: color-mix(in srgb, #e0245e 40%, transparent); background: color-mix(in srgb, #e0245e 8%, var(--surface)); }
.rp__actions { display: grid; grid-template-columns: 1.5fr 1fr 1fr 44px; gap: 6px; }
.rp__actions .btn { min-height: 44px; padding: 0 6px; white-space: nowrap; }
.rp__legs ol { margin: 6px 0 0; padding-left: 1.6em; display: grid; gap: 3px; font-size: 13px; }
.rp__more { display: grid; gap: 8px; }
.rp__more[open] { display: grid; }
.rp__more > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; }
.rp__more > summary::-webkit-details-marker { display: none; }
.rp__more > summary::after { content: "▾"; margin-left: auto; color: var(--text-3); }
.rp__more[open] > summary::after { content: "▴"; }
.rp__more > * + * { margin-top: 8px; }
.rp__count { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; background: var(--warn-soft); font-weight: 800; font-size: 13px; }
.rp__count .i { color: var(--warn); }
.rp__count.is-serious { background: var(--danger-soft); }
.rp__count.is-serious .i { color: var(--danger); }
.mapview.has-result .rpanel { max-height: 50dvh; }
.rp__keys { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.rp__keys li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; background: var(--warn-soft); font-size: 12px; font-weight: 700; }
.rp__keys li .i { color: var(--warn); }
.rp__keys li.is-serious { background: var(--danger-soft); }
.rp__keys li.is-serious .i { color: var(--danger); }
.rp__lock { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.rp__lock:disabled { opacity: .6; }
.rp__navstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rp__navstats > div { display: grid; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); }
.rp__navstats span { font-size: 11px; color: var(--text-3); }
.rp__navstats b { font-size: 18px; }
.mapview.is-routing .map-legend { display: none; }
.mapview.is-routing:not(.is-picking) .map-hud { display: none; }
.mapview.is-picking .map-cross::before, .mapview.is-picking .map-cross::after { background: #e0245e; }

/* 案内中の上の帯 */
.cnav-wrap { pointer-events: auto; }
.mapview.is-navigating .mapview__toprow, .mapview.is-navigating .map-search__results { display: none; }
.mapview.is-navigating .mapview__top { right: 10px; }
.mapview.is-navigating .mapview__tools { top: 128px; }
.mapview.is-navigating .map-cross, .mapview.is-following:not(.is-picking) .map-cross { display: none; }
.cnav { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 18px; background: #0a3b78; color: #fff; box-shadow: var(--shadow); }
.cnav.is-off { background: #9a5a00; }
.cnav.is-visual { background: #5b4a12; }
.cnav.is-stale { background: #8a1c34; }
.cnav__arrow { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.cnav__arrow .i { width: 30px; height: 30px; transform: rotate(var(--rot)); transition: transform .4s; }
.cnav__main { min-width: 0; display: grid; gap: 2px; }
.cnav__big { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.cnav__big b { font-size: 26px; line-height: 1; }
.cnav__big span { font-size: 14px; font-weight: 700; opacity: .9; }
.cnav__sub, .cnav__xte { font-size: 12px; opacity: .92; line-height: 1.35; }
.cnav__alert { font-size: 13px; font-weight: 800; }
.cnav .btn { background: rgba(255,255,255,.16); color: #fff; border-color: transparent; }

/* 自船 */
.ship { width: 34px; height: 34px; display: grid; place-items: center; }
.ship svg { width: 30px; height: 30px; transform: rotate(var(--rot)); fill: #0a6cff; stroke: #fff; stroke-width: 1.6; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); transition: transform .4s; }
.ship span { width: 18px; height: 18px; border-radius: 50%; background: #0a6cff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(10,108,255,.22), 0 2px 6px rgba(0,0,0,.4); }
.ship.is-stale svg { fill: #8a96a0; }
.ship.is-stale span { background: #8a96a0; }

/* 注意物 */
.hz { position: relative; width: 26px; height: 26px; display: grid; place-items: center; }
.hz svg { width: 24px; height: 24px; overflow: visible; }
.hz svg path:first-child { fill: var(--c); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.45)); }
.hz__label { position: absolute; left: 26px; top: 3px; white-space: nowrap; font-size: 11px; font-weight: 800; color: #7a0f30; background: rgba(255,255,255,.88); padding: 0 4px; border-radius: 4px; pointer-events: none; }
.thumb--hz { color: #e0245e; background: color-mix(in srgb, #e0245e 12%, var(--surface)); width: 44px; height: 44px; }

/* 航跡・ルート */
.trk-arrow { position: relative; width: 14px; height: 14px; transform: rotate(var(--rot)); }
.trk-arrow::before { content: ""; position: absolute; inset: 0; background: var(--c); clip-path: polygon(50% 0, 100% 100%, 50% 72%, 0 100%); }
.rt-end, .rt-turn { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 900; color: #fff; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.rt-end--from { background: #19a463; }
.rt-end--to { background: #e0245e; }
.rt-turn { background: #0a6cff; width: 22px; height: 22px; font-size: 11px; border-width: 2px; }

/* 凡例（海図） */
.legend-chart { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.legend-chart span { display: inline-flex; align-items: center; gap: 4px; }
.legend-chart i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.lg-line { height: 0 !important; border-top: 3px solid; width: 18px !important; border-radius: 0 !important; }
.lg-line--safety { border-color: #d62454; }
.lg-line--contour { border-color: #34608c; border-top-width: 2px; }
.lg-line--route { border-color: #0a6cff; }
.lg-line--track { border-color: #6a3df0; }
.lg-line--vec { border-color: #ff7a1a; border-top-style: dotted; }
.lg-hz { width: 0 !important; height: 0 !important; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid #e0245e; border-radius: 0 !important; }

.list-item--stack { align-items: flex-start; }
.list-item__main > .list-item__title, .list-item__main > .list-item__sub { display: block; }
.list-item__btn { border: 0; background: none; color: inherit; text-align: left; padding: 0; display: grid; }
@media (max-width: 380px) {
  .cbar__btn { font-size: 11px; min-height: 48px; }
  .rp__sum b { font-size: 16px; }
  .cnav__big b { font-size: 22px; }
}

/* v0.8.1: 独立した緊急画面。入力シートより前面に表示 */
.emergency-entry { min-height:44px; min-width:48px; padding:8px 10px; color:#fff; background:#a7273d; border:1px solid #a7273d; flex-shrink:0; }
.sheet__head h2 { margin-right:auto; }
#emergencyDialog { width:min(560px,100%); max-height:100dvh; box-sizing:border-box; margin:auto; padding:0; border:0; border-radius:18px; background:var(--bg, #101d25); color:var(--text, #fff); overflow:auto; }
#emergencyDialog::backdrop { background:#06121ccc; }
.emergency-panel { padding:20px max(18px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left)); }
.emergency-lead { font-size:24px; margin:20px 0 12px; }
.emergency-call { min-height:60px; font-size:22px; color:#fff!important; background:#a7273d!important; }
.emergency-position { white-space:pre-wrap; overflow-wrap:anywhere; font:600 17px/1.7 system-ui,sans-serif; }
#emergencyDialog button, #emergencyDialog summary { min-height:48px; }
#cGps { margin-top:10px; min-height:44px; }
.photo-pick + .photo-pick { margin-top:8px; }
#cPhotoCheck[hidden] { display:none; }
#cCond { flex-wrap:wrap; }
#cCond > .small { flex-basis:100%; }
.log-empty-art { width:min(240px,80%); height:auto; display:block; margin:0 auto 16px; }
@media(max-width:400px) { .topbar { gap:4px; } .topbar__right { gap:4px; } .net { font-size:10px; } }

/* ================= v0.10 スマホ前提の地図 ================= */
/* 上：検索・モード・十字の情報（押すと詳しく）・圏外の帯 */
.mapview__top { gap: 6px; }
.map-hud { width: 100%; justify-self: stretch; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px 6px 12px; border-radius: 16px; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.map-hud:active { transform: scale(.99); }
.map-hud__info { flex: 1; gap: 10px; }
.map-hud__depth { font-size: 24px; min-width: 0; }
.map-hud__meta .small { font-size: 12px; }
.map-hud__more { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: var(--accent); }
.map-net { pointer-events: auto; }
.map-net__row { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 12px; border-radius: 14px; background: #5b4a12; color: #fff; font-size: 12.5px; line-height: 1.35; box-shadow: var(--shadow); }
.map-net__row > span { flex: 1; min-width: 0; }
.map-net__row .btn { background: rgba(255,255,255,.18); color: #fff; border-color: transparent; min-height: 40px; }
.map-net__row .btn--primary { background: #fff; color: #5b4a12; }
/* 圏外表示：保存データの無い所は斜線（未保存）として見せる。普通の海色で埋めない */
.mapview.is-offline .leaflet-container { background: repeating-linear-gradient(45deg, #e9e6dc 0 6px, #d9d4c6 6px 8px) !important; }

/* 右上の道具：緊急（両モードで同じ位置・文字つき）・レイヤー・現在地・距離・一覧・圏外用 */
.mapview__tools { gap: 8px; }
.map-fab { min-width: 48px; height: 48px; }
.map-fab--sos { background: #a7273d; color: #fff; border-color: #a7273d; font-size: 14px; font-weight: 900; margin-bottom: 6px; }
.map-fab--sos:active { background: #8b1d31; }

/* 右下：自船へ戻る（親指の届く所に大きく） */
.mapview__fabs { position: absolute; z-index: 610; right: 12px; bottom: calc(var(--hud-h, 120px) + var(--tabbar-h) + 32px + var(--trip-h, 0px) + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.map-return { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 18px; border-radius: 999px; border: 0; background: #0a6cff; color: #fff; font-weight: 900; font-size: 15px; box-shadow: 0 6px 18px rgba(10,108,255,.4); }
.map-return .i { width: 20px; height: 20px; }
/* まだ自船を出していないとき：同じ位置に控えめな「自船を表示」 */
.map-return.is-idle { background: var(--surface); color: #0a6cff; border: 2px solid #0a6cff; box-shadow: var(--shadow); min-height: 48px; }

/* 下：補助の帯（風・距離）と注意書き */
.map-sub { width: min(560px, 100%); justify-self: center; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 96%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.map-sub input[type="range"] { flex: 1; accent-color: var(--accent); min-height: 32px; }
.map-sub .btn--sm { min-height: 40px; }
.map-note { justify-self: center; display: flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 10.5px; color: var(--text-3); }
.map-note .i { color: var(--warn); }

/* 下：条件が合う候補（畳む／1 枚ずつ開く） */
.rec { width: min(560px, 100%); justify-self: center; display: grid; gap: 6px; padding: 8px 10px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 97%, transparent); border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.rec__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rec__head .tbar__fish { flex: 1; min-width: 0; }
.rec__head .tbar__chip { min-height: 44px; }
.rec__head > .btn--sm { flex: none; min-height: 44px; padding: 0 12px; white-space: nowrap; }
.rec__short { flex: none; max-width: 9em; line-height: 1.3; text-align: right; }
.rec__close { flex: none; width: 44px; height: 44px; }
.rec__why { margin: 0 2px 2px; line-height: 1.4; }
/* 1 行に収めるため、スマホ幅ではスイッチの文字を省く（状態はスイッチの色と読み上げで分かる） */
@media (max-width: 430px) { .rec__head .tbar__toggle { padding: 0 8px; } .rec__head .tbar__toggle-label { display: none; } }
.rec-card { display: grid; gap: 6px; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 9%, var(--surface)); touch-action: pan-y; }
.rec-card__top { display: grid; grid-template-columns: 36px 1fr; gap: 8px; align-items: center; }
.rec-card__icon { width: 36px; height: 36px; border-radius: 50%; background: var(--c); display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.rec-card__title { display: grid; min-width: 0; }
.rec-card__title strong { font-size: 15.5px; line-height: 1.3; }
.rec-card__title span { font-size: 12px; color: var(--text-2); font-weight: 700; }
.rec-card__why { font-size: 13px; line-height: 1.4; }
.rec-card__actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 6px; }
.rec-card__actions .btn { min-height: 44px; padding: 0 8px; white-space: nowrap; }
.rec__nav { display: grid; grid-template-columns: 1fr auto auto 1fr; gap: 6px; }
.rec__nav .btn { min-height: 44px; padding: 0 8px; }
.rec__note { margin: 0; font-size: 10.5px; line-height: 1.3; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mapview.has-card .rec { display: none; }
.cand { pointer-events: auto; }
.cand .cand__icon { background: var(--c); border-color: #fff; } /* 印はすべて同じ形（評価の強弱を見た目で付けない） */
.cand__label { background: var(--surface) !important; }
.lg-zone { width: 18px !important; height: 12px !important; border: 2px dashed #ff6b3d; background: rgba(255,107,61,.2); border-radius: 2px !important; }

/* 海図モードで候補を出しているときは、下のバーの上に候補パネル */
.mapview.is-chart .rec { order: 0; }
.mapview.is-chart.rec-open .cbar { display: none; }
.mapview.is-chart.is-routing .rec, .mapview.is-navigating .rec { display: none; }

/* 圏外に備えて保存のシート */
.off-state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-weight: 800; margin-bottom: 12px; }
.off-state.is-off { background: #5b4a12; color: #fff; }
.off-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13px; line-height: 1.45; }
.off-list li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; align-items: start; }
.off-list .is-ok .i { color: var(--good); }
.off-list .is-part .i { color: var(--warn); }
.off-list .is-no .i { color: var(--danger); }
.area-status { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; }
.area-status li { display: grid; grid-template-columns: 16px auto 1fr; gap: 6px; align-items: baseline; }
.area-status b { white-space: nowrap; }
.area-status span { color: var(--text-2); }
.area-status .is-ok .i { color: var(--good); }
.area-status .is-part .i { color: var(--warn); }
.area-status .is-none .i { color: var(--danger); }
.btn--lg { min-height: 52px; font-size: 16px; }

@media (max-width: 380px) {
  .map-hud__depth { font-size: 20px; }
  .mode-seg button { padding: 0 8px; }
}

/* マイポイント：狭い画面でも名前と操作を分ける */
.point-row {flex-wrap:wrap;gap:8px}.point-row .list-item__main{min-width:140px;overflow-wrap:anywhere}.my-points{padding-bottom:24px}.topbar__right{gap:4px}

/* v0.12: 海域の公開・釣行開始・ホーム。既存の色と書体を保つ。 */
.app-home{display:flex;flex-direction:column;justify-content:center;min-height:44px;flex:none;color:var(--text);font-size:16px;font-weight:800;text-decoration:none;line-height:1.2}
.app-home span{font-size:11px;font-weight:500;color:var(--text-2);margin-top:3px}
.topbar .spot-switch{min-width:0}.topbar__right{flex:none}
.home-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:6px 0 22px}
.home-heading p,.home-place p{font-size:14px;color:var(--text-2);margin:6px 0}
.home-place{display:flex;align-items:center;justify-content:space-between;gap:20px;background:var(--surface);padding:20px;border-radius:var(--radius-sm)}
.home-place h2{font-size:20px;margin:4px 0;overflow-wrap:anywhere}
.home-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0 24px}
.home-links>a{display:flex;gap:12px;align-items:center;text-decoration:none;color:var(--text);background:var(--surface);padding:16px;min-height:88px;border-radius:var(--radius-sm)}
.home-links>a>span{flex:1;min-width:0}.home-links small{display:block;color:var(--text-2);font-size:12px;margin-top:4px}
.home-feed h2{margin-bottom:8px}.community-list{display:grid;gap:0}
.community-row{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:18px 0;border-bottom:1px solid var(--line)}
.community-row>div:first-child{flex:1;min-width:180px}
.community-row p{margin:5px 0 0;font-size:14px}.community-row .small{font-size:12px}
.community-size{display:flex;flex-direction:column;align-items:flex-end;font-variant-numeric:tabular-nums}
.community-size strong{font-size:26px;color:var(--accent)}.community-size small{font-size:14px;margin-left:3px}.community-size span{font-size:13px}
.community-filters{display:flex;align-items:end;gap:16px;flex-wrap:wrap;margin:18px 0}
.community-filters>label:first-child{flex:1;min-width:180px;font-size:13px}.community-filters .select{margin-top:5px}
.community-filters .switch{min-height:44px}.fish-hints-box{padding:16px;background:var(--surface-2);border-radius:var(--radius-sm);margin:14px 0 20px}
.fish-hints{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.fish-hint{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:12px;background:var(--surface);color:var(--text);border:1px solid transparent;border-radius:8px;text-align:left;min-height:92px;font:inherit}
button.fish-hint{cursor:pointer}.fish-hint[aria-pressed=true]{border-color:var(--accent)}
.fish-hint>span{font-size:12px;color:var(--text-2)}.fish-hint>small{font-size:12px;color:var(--text-2);line-height:1.5}
.fish-hints-note{font-size:12px;margin-top:12px;color:var(--text-2)}.fish-hints-note summary{min-height:30px;cursor:pointer}
.point-row{flex-wrap:wrap}.point-row>.list-item__main{min-width:120px}
@media(max-width:700px){.home-links{grid-template-columns:1fr;gap:8px}.home-links>a{min-height:76px;padding:14px}.home-place{display:block}.home-place>.btn{margin-top:12px;display:flex}.home-heading p{max-width:230px}.topbar{gap:10px}.topbar .spot-switch__name{max-width:105px}.topbar .emergency-entry{font-size:12px;padding:8px}.topbar__right{gap:2px}.app-home{font-size:14px}.home-heading{align-items:start}.home-heading>.btn{flex:none}}
@media(max-width:370px){.topbar .spot-switch__name{max-width:72px}.topbar .icon-btn{width:36px}}
