/*
 * 今釣れ (いまつれ) — the redesign (docs/web_redesign/site-redesign-instructions.md 6.1).
 * Light gray ground, white cards, navy text. Up = blue, down = orange,
 * flat/終盤 = gray; never red/green. Touch targets >= 44px. Phone-first at
 * 390px, two columns from 1024px. Motion is short and stops under
 * prefers-reduced-motion.
 */
:root {
  --bg: #f4f6f7;
  --card: #ffffff;
  --text: #14202b;
  --sub: #4a5966;
  --line: #c9d1d7;
  --line-soft: #e6e9ec;
  --link: #1f5f8b;
  --link-hover: #14425f;
  --up-text: #12466f;
  --up-bg: #dceaf6;
  --up-line: #1f6fb2;
  --down-text: #8a3a0e;
  --down-bg: #f8e3d5;
  --down-line: #c2571a;
  --flat-text: #3a4652;
  --flat-bg: #e6e9ec;
  --flat-line: #7a8794;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20, 32, 43, 0.04), 0 6px 20px rgba(20, 32, 43, 0.04);
  --shadow-hover: 0 2px 4px rgba(20, 32, 43, 0.06), 0 12px 28px rgba(20, 32, 43, 0.08);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font:
    "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Noto Sans JP", sans-serif;
}

* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  font-feature-settings: "palt" 1;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--link);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--link-hover);
}
h1,
h2,
h3,
p,
ul {
  margin: 0;
}
ul {
  padding: 0;
  list-style: none;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--up-line);
  outline-offset: 2px;
  border-radius: 8px;
}
.sub {
  color: var(--sub);
}
.small {
  font-size: 12px;
}
.num,
.figure .v,
.big-value {
  font-variant-numeric: tabular-nums;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 10px 14px;
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  z-index: 20;
}
.skip:focus {
  top: 12px;
  color: #fff;
}

/* ---------- header ---------- */
.site-header {
  position: relative;
  padding: 24px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.site-header .site-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.site-title rt {
  font-size: 10px;
  font-weight: 500;
  color: var(--sub);
  letter-spacing: 0.2em;
}
/* The sea switcher (相模湾 / 東京湾 準備中). */
.sea-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sea-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
a.sea-link:hover {
  border-color: var(--text);
  color: var(--text);
}
.sea-link[aria-current="page"] {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}
.sea-link[aria-current="page"]:hover {
  color: #ffffff;
}
.sea-link[aria-disabled="true"] {
  border-style: dashed;
  background: transparent;
  color: var(--sub);
  cursor: default;
}
.sea-link small {
  font-size: 11px;
}
/* A sea's one-line note under the header (seas.yaml notice). */
.sea-notice {
  margin: 8px 20px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--flat-bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}
.notice {
  gap: 8px;
  font-size: 14px;
  line-height: 1.8;
}
.as-of {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--sub);
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--up-line);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 111, 178, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(31, 111, 178, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 111, 178, 0);
  }
}
/* The sea line under the title: a slow, quiet swell. */
.swell {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  pointer-events: none;
  overflow: hidden;
}
.swell svg {
  display: block;
  width: 200%;
  height: 14px;
  animation: swell 16s linear infinite;
}
@keyframes swell {
  to {
    transform: translateX(-50%);
  }
}

.area-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 10px 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(244, 246, 247, 0.88);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.area-nav::-webkit-scrollbar {
  display: none;
}
.chip {
  flex: none;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition:
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    transform 0.12s var(--ease);
}
.chip:hover {
  border-color: var(--text);
}
.chip:active {
  transform: scale(0.97);
}
.chip[aria-pressed="true"] {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

/* ---------- cards and labels ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.card h3 {
  font-size: 14px;
  font-weight: 700;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pad {
  padding: 0 12px;
}
.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 4px 0;
}
.label {
  font-size: 12px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.7;
}
.label.up {
  background: var(--up-bg);
  color: var(--up-text);
}
.label.down {
  background: var(--down-bg);
  color: var(--down-text);
}
.label.flat {
  background: var(--flat-bg);
  color: var(--flat-text);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.18s var(--ease);
}
a.pill:hover {
  background: var(--line-soft);
  color: var(--text);
}
.pill strong {
  font-weight: 700;
  margin-right: 6px;
}
.pill .up-note {
  color: var(--up-text);
  font-size: 12px;
}
.move-row {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 8px;
  align-items: start;
}
.move-row > .label {
  text-align: center;
  margin-top: 5px;
}

/* ---------- species list ---------- */
.list-head {
  display: flex;
  flex-direction: column;
  padding: 10px 20px 10px;
  gap: 2px;
}
.list-head h2 {
  font-size: 15px;
}
.species-list {
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.species-item {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  min-height: 44px;
  background: var(--card);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition:
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.species-item:hover {
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}
.species-item:active {
  transform: scale(0.99);
}
.species-item[aria-current="true"] {
  border-color: var(--up-line);
}
.species-item.is-ended {
  background: #fafbfb;
}
.species-item.is-ended .name {
  color: var(--flat-text);
}
.species-item .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.species-item .name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.species-item .lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.seg {
  white-space: nowrap;
}
.species-item .line2 {
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.spark {
  overflow: visible;
}
.group-head {
  font-size: 12px;
  color: var(--sub);
  padding: 10px 6px 0;
  letter-spacing: 0.08em;
}
/* Folded group of species with no sailing in the last 7 days (終盤). */
.others {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.others-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--flat-text);
  text-align: left;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.others-toggle:hover {
  background: var(--card);
  border-color: var(--flat-line);
}
.others-toggle:focus-visible {
  outline: 2px solid var(--up-line);
  outline-offset: 2px;
}
.others-toggle .others-note {
  font-size: 12px;
  font-weight: 400;
  color: var(--sub);
}
.others-toggle .chev {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.2s var(--ease);
}
.others-toggle[aria-expanded="true"] .chev {
  transform: translateY(2px) rotate(-135deg);
}
.species-list.others-list {
  padding: 0;
  list-style: none;
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .others-toggle,
  .others-toggle .chev {
    transition: none;
  }
}
.footer-note {
  padding: 20px 20px 32px;
  font-size: 11px;
  color: var(--sub);
  line-height: 1.8;
}
.footer-note .updated {
  margin: 0 0 6px;
}

/* Server-rendered content (src/pages.ts), replaced by the scripts once they load. */
.ssr-item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--card);
  font-size: 14px;
}
.ssr-trend {
  color: var(--sub);
  font-size: 12px;
}
.page-head {
  padding: 4px 16px 0;
}
.page-h1 {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--sub);
}
.page-h1-trend {
  white-space: nowrap;
}

.empty {
  padding: 20px;
  color: var(--sub);
  font-size: 13px;
}

/* ---------- species overview ---------- */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 12px 16px 4px;
  font-size: 13px;
  text-decoration: none;
}
.overview {
  gap: 12px;
}
.overview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.overview-head h1,
.overview-head .species-name {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.includes {
  font-size: 12px;
  color: var(--sub);
  flex-basis: 100%;
}
.sentence {
  font-size: 15px;
  line-height: 1.8;
}
.tone-up .sentence {
  color: var(--up-text);
}
.tone-down .sentence {
  color: var(--down-text);
}
.figures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.figures.two {
  grid-template-columns: 1fr 1fr;
}
.figures.two .figure .v {
  font-size: 16px;
}
.show-all {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  font-size: 13px;
  color: var(--link);
  transition: background 0.15s var(--ease);
}
.show-all:hover {
  background: var(--bg);
}
.figure {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.figure .k {
  font-size: 11px;
  color: var(--sub);
}
.figure .v {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.figure .n {
  font-size: 11px;
  color: var(--up-text);
}
.more-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 56px;
  padding: 0 18px;
  background: var(--text);
  color: #ffffff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: background 0.18s var(--ease);
}
.more-button:hover {
  color: #ffffff;
  background: #1d2e3d;
}
.more-button svg {
  transition: transform 0.18s var(--ease);
}
.more-button:hover svg {
  transform: translateX(3px);
}
.boat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 6px;
  margin: 0 -6px;
  min-height: 44px;
  border-top: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
  transition: background 0.15s var(--ease);
}
.boat-row:hover {
  color: var(--text);
  background: var(--bg);
}
.card-head + .boat-row {
  border-top: 0;
}
.boat-row .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.boat-row .boat-name {
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.boat-row .ext,
.ext-link svg {
  color: var(--sub);
  display: inline-flex;
}
.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.boat-row .detail {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.7;
}
.later {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

/* ---------- charts ---------- */
.chart-box {
  position: relative;
  touch-action: pan-y;
  border-radius: 8px;
}
.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
}
.chart-tip {
  position: absolute;
  top: 0;
  transform: translate(-50%, -6px);
  background: var(--text);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.12s var(--ease);
  box-shadow: 0 6px 16px rgba(20, 32, 43, 0.18);
}
.chart-tip.on {
  opacity: 1;
}
.chart-tip .tip-head {
  font-weight: 700;
}
.chart-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}
.delta {
  font-size: 12px;
  padding: 1px 8px;
  border-radius: 999px;
}
.delta.up {
  background: var(--up-bg);
  color: var(--up-text);
}
.delta.down {
  background: var(--down-bg);
  color: var(--down-text);
}
.delta.flat {
  background: var(--flat-bg);
  color: var(--flat-text);
}
.legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--sub);
}
.legend i {
  display: inline-block;
  width: 16px;
  border-radius: 2px;
}
.lg-boat {
  height: 2px;
  background: #b8c2ca;
}
.lg-mid {
  height: 4px;
  background: var(--flat-line);
}
.lg-mid.up {
  background: var(--up-line);
}
.lg-mid.down {
  background: var(--down-line);
}
.chart-note {
  font-size: 11px;
  color: var(--sub);
  line-height: 1.7;
}
.note-line {
  display: flex;
  gap: 10px;
  font-size: 13px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 10px;
}
.note-line .sub {
  flex: none;
}
.draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 0.9s var(--ease) 0.1s forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.grow {
  transform-box: fill-box;
  transform-origin: bottom;
  animation: grow 0.6s var(--ease) both;
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
}

/* ---------- detail ---------- */
.big-value {
  font-size: 20px;
  font-weight: 700;
}
.bar-row {
  display: grid;
  grid-template-columns: 36px 1fr 40px;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.share {
  height: 10px;
  border-radius: 999px;
  background: #b8c2ca;
  overflow: hidden;
  display: flex;
  justify-content: flex-end;
}
.share-fill {
  height: 100%;
  background: var(--up-line);
  border-radius: 999px;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
}
.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.plain-list li:last-child {
  border-bottom: 0;
}
.quote-list li {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}
.quote-list .q {
  font-size: 14px;
  font-weight: 500;
}

/* ---------- table (PC) ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}
table.boats {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.boats th {
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--sub);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--card);
}
table.boats td {
  padding: 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  line-height: 1.6;
}
table.boats tbody tr {
  transition: background 0.15s var(--ease);
}
table.boats tbody tr:hover {
  background: #fafbfb;
}
table.boats td.nowrap {
  white-space: nowrap;
}
table.boats td.strong {
  font-weight: 700;
}
table.boats td.num {
  font-variant-numeric: tabular-nums;
}
table.boats td.wide-col {
  min-width: 150px;
}
table.boats td.ground-col {
  min-width: 96px;
}
table.boats th,
table.boats td {
  padding-left: 8px;
  padding-right: 8px;
}

/* ---------- loading / motion ---------- */
.skeleton {
  gap: 12px;
}
.sk-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f3 25%, #f6f8f9 37%, #eef1f3 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.sk-line:nth-child(2) {
  width: 82%;
}
.sk-line:nth-child(3) {
  width: 64%;
}
.sk-head {
  height: 20px;
  width: 40%;
}
.sk-tall {
  height: 120px;
  width: 100% !important;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
.rise {
  animation: rise 0.42s var(--ease) both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.fade {
  animation: fade 0.32s var(--ease) both;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .draw {
    stroke-dashoffset: 0;
  }
}

/* ---------- layout ---------- */
.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.home-main {
  display: none;
}
.pc-only {
  display: none;
}

@media (min-width: 1024px) {
  .page.wide {
    max-width: 1440px;
  }
  .wide .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 32px 18px;
  }
  .wide .site-header .title-block {
    display: flex;
    align-items: baseline;
    gap: 16px;
  }
  .wide .site-header .site-title {
    font-size: 22px;
    letter-spacing: 0.08em;
  }
  .wide .area-nav {
    padding: 10px 32px 14px;
    mask-image: none;
  }
  .home-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 20px;
    padding: 4px 32px 32px;
    align-items: start;
  }
  .home-layout > aside {
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding: 2px 6px 2px 2px;
    scrollbar-width: thin;
  }
  .home-layout .pad,
  .home-layout .species-list {
    padding: 0;
  }
  .home-layout .list-head {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 2px 10px;
  }
  .home-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
  }
  .pc-only {
    display: revert;
  }
  .sp-only {
    display: none !important;
  }
  .figures.four {
    grid-template-columns: repeat(4, 1fr);
  }
  .overview-head h1,
  .overview-head .species-name {
    font-size: 34px;
  }
  .includes {
    flex-basis: auto;
  }
  .pc-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
  .pc-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  .footer-note {
    padding: 16px 2px 8px;
  }
}
