:root {
  color-scheme: light;
  --bg: #f3f8f7;
  --panel: rgba(255, 255, 255, 0.94);
  --surface: #ffffff;
  --ink: #18332d;
  --text: var(--ink);
  --muted: #667b75;
  --line: #d7e5e1;
  --accent: #0f8a68;
  --accent-dark: #0a5f4d;
  --accent-soft: #e3f4ee;
  --accent-ring: rgba(15, 138, 104, 0.18);
  --info: #26658f;
  --info-soft: #e8f2f8;
  --warn: #956100;
  --warn-soft: #fff4d9;
  --bad: #b3463b;
  --sky: #0ea5e9;
  --sun: #f59e0b;
  --shadow: 0 16px 44px rgba(28, 61, 52, 0.11);
  --shadow-soft: 0 8px 22px rgba(28, 61, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 0%, rgba(14, 165, 233, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(15, 138, 104, 0.1), rgba(38, 101, 143, 0.05) 45%, transparent),
    var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 16px;
  max-width: 1460px;
  margin: 0 auto;
  padding: 16px;
}

.panel,
.map-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls-panel,
.result-panel,
.table-panel {
  padding: 18px;
}

.result-panel {
  display: grid;
  gap: 14px;
}

.controls-panel {
  grid-row: span 2;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 253, 251, 0.94)),
    var(--panel);
}

.map-panel {
  position: relative;
  min-height: 480px;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 480px;
}

.map-layer-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  display: flex;
  gap: 4px;
  border: 1px solid rgba(24, 51, 45, 0.14);
  border-radius: 6px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(24, 51, 45, 0.16);
  backdrop-filter: blur(8px);
}

.map-layer-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  white-space: nowrap;
}

.map-layer-button:hover,
.map-layer-button:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.map-layer-button.active {
  background: var(--accent);
  color: #ffffff;
}

.title-row,
.table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.table-header {
  flex-wrap: wrap;
}

.title-row {
  align-items: center;
}

.title-row > div:nth-child(2) {
  flex: 1 1 auto;
  min-width: 0;
}

.table-header > div:first-child {
  flex: 1 1 220px;
  min-width: min(100%, 220px);
}

.app-mark {
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(15, 138, 104, 0.22);
  background: #f7fffc;
  color: var(--accent);
  box-shadow: none;
}

.app-mark svg {
  width: 28px;
  height: 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  line-height: 1.25;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(1.48rem, 2vw, 1.66rem);
  white-space: nowrap;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

.section-heading h2,
.modal-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtitle,
.section-heading p,
.best-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.control-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.form-section {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.section-heading {
  display: grid;
  gap: 2px;
}

.coordinate-grid,
.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.field-help {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
}

.full-field,
.compact-field,
.date-field {
  max-width: 100%;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: #fbfefc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-ring);
}

.map-search {
  display: grid;
  gap: 8px;
}

.map-search-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1200;
  width: min(382px, calc(100% - 190px));
  pointer-events: auto;
}

.map-search-overlay > .field,
.map-search-overlay > .field-help {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
}

.compact-button {
  width: auto;
  min-width: 92px;
  white-space: nowrap;
}

.map-search-overlay .compact-button {
  min-width: 70px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(24, 51, 45, 0.14);
}

.map-search-overlay input {
  min-height: 44px;
  border: 2px solid rgba(24, 51, 45, 0.72);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 22px rgba(24, 51, 45, 0.14);
}

.map-search-overlay input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(15, 138, 104, 0.2);
}

.search-results {
  display: grid;
  max-height: 240px;
  overflow: auto;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  background: #f8fafc;
}

.map-search-overlay .search-results {
  width: calc(100% - 76px);
  min-width: 220px;
  margin-top: 4px;
  gap: 0;
  border: 2px solid rgba(24, 51, 45, 0.72);
  border-radius: 7px;
  padding: 6px 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(24, 51, 45, 0.2);
}

.search-results-hint {
  margin: 0 12px 6px;
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.search-results.notice {
  border-color: rgba(38, 101, 143, 0.2);
  background: var(--info-soft);
}

.search-results.error {
  border-color: rgba(179, 70, 59, 0.26);
  background: #fff1f0;
}

.map-search-overlay .search-results.notice,
.map-search-overlay .search-results.error {
  padding: 10px 12px;
}

.search-message {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.search-results.error .search-message {
  color: var(--bad);
}

.search-result {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.map-search-overlay .search-result {
  border: 0;
  border-radius: 0;
  padding: 11px 18px;
  background: transparent;
}

.map-search-overlay .search-result:hover,
.map-search-overlay .search-result:focus-visible,
.map-search-overlay .search-result.active {
  background: var(--accent-soft);
}

.map-search-overlay .search-result.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.map-search-overlay .search-result strong {
  font-size: 0.9rem;
}

.map-search-overlay .search-result span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result:hover,
.search-result:focus-visible,
.search-result.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.search-result strong,
.search-result span,
.search-result small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.search-result strong {
  font-size: 0.92rem;
}

.search-result span,
.search-result small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segmented legend {
  grid-column: 1 / -1;
}

.segmented-option {
  display: block;
}

.segmented-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-option span {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fbfefc;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.segmented-option input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.segmented-option input:focus-visible + span {
  outline: 3px solid rgba(15, 138, 104, 0.2);
}

.segmented-option span:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

button,
.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
}

button svg,
.download-link svg,
.section-heading svg,
.map-layer-button svg,
.timeline-toggle svg {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
}

button:not([disabled]):hover,
.download-link:not(.disabled):hover {
  transform: translateY(-1px);
}

.primary {
  width: 100%;
  background: var(--accent);
  color: white;
  box-shadow: 0 10px 22px rgba(15, 138, 104, 0.18);
}

.primary[disabled] {
  cursor: wait;
  opacity: 0.78;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  width: 100%;
  border: 1px solid rgba(38, 101, 143, 0.18);
  background: var(--info-soft);
  color: var(--info);
}

.secondary:hover {
  border-color: rgba(38, 101, 143, 0.35);
  background: #dcedf6;
}

.secondary[disabled] {
  cursor: wait;
  opacity: 0.72;
}

.download-link {
  border: 1px solid rgba(38, 101, 143, 0.18);
  background: var(--info-soft);
  color: var(--info);
  box-shadow: none;
  min-width: 58px;
  padding-inline: 12px;
}

.download-link:not(.disabled):hover {
  border-color: rgba(38, 101, 143, 0.35);
  background: #dcedf6;
  color: #075985;
}

.download-link.disabled {
  pointer-events: none;
  opacity: 0.38;
}

.csv-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.export-actions {
  margin-top: 10px;
}

.csv-actions .download-link {
  min-height: 44px;
  font-size: 0.86rem;
}

.leaflet-control-zoom a {
  width: 44px !important;
  height: 44px !important;
  line-height: 44px !important;
  font-size: 1.28rem !important;
}

.raw-download-link {
  background: #f8fafc;
  color: var(--muted);
  border-color: rgba(100, 116, 139, 0.2);
}

.raw-download-link:not(.disabled):hover {
  background: #eef2f7;
  color: #334155;
  border-color: rgba(100, 116, 139, 0.34);
}

.status,
.warnings {
  margin-top: 14px;
  border-radius: 6px;
  padding: 11px 12px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.status {
  border: 1px solid rgba(15, 138, 104, 0.16);
  background: linear-gradient(135deg, var(--accent-soft), #f0fdfa);
  color: var(--accent-dark);
}

.status.loading {
  border: 1px solid rgba(15, 138, 104, 0.22);
}

.warnings {
  background: var(--warn-soft);
  color: var(--warn);
}

.button-spinner,
.inline-spinner {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.72s linear infinite;
}

.button-spinner {
  margin-right: 8px;
  vertical-align: -0.12em;
}

.inline-spinner {
  margin-right: 8px;
  vertical-align: -0.1em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.best-card {
  display: grid;
  gap: 12px;
}

.best-card.empty {
  color: var(--muted);
}

.moon-phase-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: linear-gradient(135deg, #eef2ff, #f8fffc);
  padding: 10px 12px;
}

.moon-phase-card > div:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.moon-phase-card b {
  color: var(--muted);
  font-size: 0.74rem;
}

.moon-phase-card strong {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.moon-phase-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.moon-phase-orb {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.moon-phase-image {
  display: block;
  width: 54px;
  height: 54px;
  filter: drop-shadow(0 8px 14px rgba(15, 23, 42, 0.16));
}

.moon-phase-small {
  width: 30px;
  height: 30px;
  filter: none;
}

.moon-rim {
  fill: #dbeafe;
}

.moon-base,
.moon-shadow {
  fill: #0f172a;
}

.moon-light {
  fill: #fde68a;
}

.moon-unknown {
  opacity: 0.42;
}

.moon-detail-chip {
  align-items: center;
}

.moon-detail-content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.moon-detail-content .moon-phase-image {
  flex: 0 0 30px;
}

.moon-detail-content > span {
  min-width: 0;
}

.angler-decision-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 8px;
}

.angler-decision-summary article {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(15, 138, 104, 0.14);
  border-radius: 7px;
  padding: 10px;
  background: #f8fffc;
  min-width: 0;
}

.angler-decision-summary b {
  color: var(--muted);
  font-size: 0.72rem;
}

.angler-decision-summary span {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.28;
}

.angler-decision-summary small {
  line-height: 1.35;
}

.supporting-details {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  overflow: hidden;
}

.supporting-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--accent-dark);
  font-weight: 900;
  list-style-position: inside;
}

.supporting-details[open] summary {
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.supporting-details-body {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.water-body-card {
  display: grid;
  gap: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 11px 12px;
  background: linear-gradient(135deg, #eff6ff, #f0fdfa);
}

.water-body-card.empty,
.water-body-card.loading {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.water-body-card h2 {
  margin-bottom: 0;
}

.water-body-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.water-body-audit {
  font-size: 0.78rem;
  font-weight: 800;
}

.point-context-card {
  display: grid;
  gap: 8px;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 9px 10px;
  background: #f0f9ff;
}

.point-context-card strong {
  color: #075985;
}

.point-context-card > span {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
  line-height: 1.35;
}

.point-context-card > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 6px;
}

.point-context-card small {
  display: grid;
  gap: 2px;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 7px 8px;
  background: #ffffff;
  color: var(--text);
  font-weight: 900;
}

.point-context-card b {
  color: var(--muted);
  font-size: 0.72rem;
}

.point-context-card.compact > div {
  grid-template-columns: repeat(6, minmax(90px, 1fr));
}

.water-body-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 7px;
}

.water-body-grid span {
  display: grid;
  gap: 2px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 8px 9px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 900;
}

.water-body-grid b {
  color: var(--muted);
  font-size: 0.72rem;
}

.site-context-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid rgba(15, 138, 104, 0.16);
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(236, 253, 245, 0.78);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.45;
}

.site-context-note b {
  flex: 0 0 auto;
  color: var(--accent-dark);
}

.site-context-note span {
  min-width: 0;
}

.loading-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 86px;
}

.best-score {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.best-score strong {
  color: var(--accent-dark);
  font-size: 2.8rem;
  line-height: 1;
}

.best-score span {
  color: var(--muted);
  font-weight: 800;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.meta {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fbfefc;
}

.meta span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.meta strong {
  display: block;
  margin-top: 2px;
}

.meta,
.water-body-grid span,
.point-context-card small,
.prediction-detail span,
.water-condition span,
.water-relationship span,
.target-summary article,
.target-activity span,
.fish-species span,
.species-summary span,
.bait-summary span,
.bait-recommendation span,
.condition-index-summary span,
.condition-indices span,
.fishing-technique-summary span,
.fishing-technique span {
  min-width: 0;
}

.meta strong,
.water-body-grid span,
.point-context-card small,
.prediction-detail span,
.water-condition span,
.water-relationship span,
.target-summary strong,
.target-activity span,
.fish-species span,
.species-summary span,
.bait-summary span,
.bait-recommendation span,
.condition-index-summary span,
.condition-indices span,
.fishing-technique-summary span,
.fishing-technique span {
  overflow-wrap: anywhere;
}

.badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 138, 104, 0.14);
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge {
  max-width: min(560px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
}

.timeline-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex: 1 1 520px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: min(720px, 100%);
}

.timeline-actions .badge {
  flex: 1 1 260px;
}

.timeline-toggle {
  width: auto;
  min-width: 126px;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.table-panel {
  grid-column: 2;
}

.table-wrap {
  width: 100%;
  margin-top: 12px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.82rem;
}

td {
  font-size: 0.92rem;
  line-height: 1.45;
}

small {
  color: var(--muted);
}

.score-pill {
  display: inline-block;
  min-width: 42px;
  border-radius: 999px;
  padding: 5px 8px;
  text-align: center;
  color: white;
  font-weight: 900;
}

.score-good {
  background: var(--accent);
}

.score-excellent {
  background: var(--accent-dark);
}

.score-mid {
  background: #b7791f;
}

.score-low {
  background: var(--bad);
}

.score-unavailable {
  background: var(--muted);
}

.water-level-chip {
  border-color: rgba(38, 101, 143, 0.18);
  background: #eff6ff;
  color: var(--info);
  font-weight: 900;
}

.water-level-rising {
  border-color: rgba(15, 138, 104, 0.25);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.water-level-falling {
  border-color: rgba(38, 101, 143, 0.22);
  background: var(--info-soft);
  color: var(--info);
}

.water-level-stable {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.water-level-unknown {
  border-color: var(--line);
  background: #f8fafc;
  color: var(--muted);
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.data-note {
  display: grid;
  gap: 3px;
  border-radius: 6px;
  padding: 9px 10px;
  line-height: 1.45;
}

.data-note strong {
  display: block;
}

.data-note span {
  color: var(--muted);
}

.data-note.missing {
  border: 1px solid rgba(149, 97, 0, 0.22);
  background: var(--warn-soft);
}

.data-note.ready {
  border: 1px solid rgba(15, 138, 104, 0.18);
  background: var(--accent-soft);
}

.gate-impact {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(38, 101, 143, 0.2);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--info-soft);
  color: var(--info);
  line-height: 1.45;
}

.gate-impact span {
  color: var(--muted);
}

.water-condition {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(15, 138, 104, 0.18);
  border-radius: 6px;
  padding: 9px 10px;
  background: #f4fbf7;
  line-height: 1.45;
}

.water-condition > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 6px;
}

.water-condition span {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 7px 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.water-condition b {
  color: var(--text);
  font-size: 0.72rem;
}

.water-relationship {
  display: grid;
  gap: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 9px 10px;
  background: #eff6ff;
  line-height: 1.45;
}

.water-relationship > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 6px;
}

.water-relationship span {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  padding: 7px 8px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.water-relationship b,
.water-relationship small {
  color: var(--muted);
  font-size: 0.72rem;
}

.direction-summary {
  display: grid;
  gap: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  padding: 9px 10px;
  background: #f0fdf4;
  line-height: 1.45;
}

.direction-summary.missing {
  border-color: var(--line);
  background: #f8fafc;
}

.direction-summary span {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.direction-summary em,
.direction-summary small {
  color: #047857;
  font-style: normal;
  font-weight: 800;
  font-size: 0.82rem;
}

.direction-change-list {
  display: grid;
  gap: 6px;
}

.direction-change-list article {
  display: grid;
  gap: 3px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #bbf7d0;
  padding: 8px 9px;
}

.direction-change-list b {
  color: var(--accent-dark);
}

.direction-change-list span {
  display: grid;
  gap: 2px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 900;
}

.target-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
}

.target-summary article,
.target-activity,
.fish-species,
.species-summary,
.bait-summary,
.bait-recommendation,
.condition-index-summary,
.condition-indices,
.fishing-plan-summary,
.fishing-plan,
.fishing-technique-summary,
.fishing-technique {
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
  padding: 9px 10px;
}

.target-summary article {
  display: grid;
  gap: 4px;
}

.target-summary span,
.target-summary em,
.target-activity small {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.target-summary strong {
  font-size: 1.3rem;
}

.target-summary small {
  color: var(--muted);
  font-size: 0.8rem;
}

.target-activity {
  display: grid;
  gap: 8px;
}

.fish-species,
.species-summary,
.bait-summary,
.bait-recommendation,
.condition-index-summary,
.condition-indices,
.fishing-plan-summary,
.fishing-plan,
.fishing-technique-summary,
.fishing-technique {
  display: grid;
  gap: 8px;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.target-activity > div,
.fish-species > div,
.species-summary > div,
.bait-summary > div,
.bait-grid,
.bait-analysis,
.bait-species,
.condition-index-summary > div,
.condition-indices > div,
.fishing-plan-summary > div,
.fishing-plan-grid,
.fishing-technique-summary > div,
.technique-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
}

.target-activity span,
.fish-species span,
.species-summary span,
.bait-summary span,
.bait-recommendation span,
.condition-index-summary span,
.condition-indices span,
.fishing-plan-summary span,
.fishing-plan span,
.fishing-technique-summary span,
.fishing-technique span {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #fed7aa;
  padding: 7px 8px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 900;
}

.fish-species span,
.species-summary span,
.bait-summary span,
.bait-recommendation span,
.condition-index-summary span,
.condition-indices span,
.fishing-plan-summary span,
.fishing-plan span,
.fishing-technique-summary span,
.fishing-technique span {
  border-color: #bfdbfe;
}

.target-activity b,
.fish-species b,
.species-summary b,
.bait-summary b,
.bait-recommendation b,
.condition-index-summary b,
.condition-indices b,
.fishing-plan-summary b,
.fishing-plan b,
.fishing-technique-summary b,
.fishing-technique b {
  color: var(--muted);
  font-size: 0.72rem;
}

.fish-species small,
.species-summary small,
.fish-species em,
.species-summary em,
.bait-summary small,
.bait-recommendation small,
.condition-index-summary small,
.condition-indices small,
.fishing-plan-summary small,
.fishing-plan small,
.fishing-technique-summary small,
.fishing-technique small,
.bait-summary em,
.bait-recommendation em,
.condition-index-summary em,
.condition-indices em,
.fishing-plan-summary em,
.fishing-plan em,
.fishing-technique-summary em,
.fishing-technique em,
.bait-summary p,
.bait-recommendation p,
.condition-index-summary p,
.condition-indices p,
.fishing-plan-summary p,
.fishing-plan p,
.fishing-technique-summary p,
.fishing-technique p {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.bait-summary,
.bait-recommendation {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.bait-summary span,
.bait-recommendation span {
  border-color: #c7d2fe;
}

.bait-color-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: inherit;
  font-style: normal;
  font-weight: 900;
  line-height: 1.15;
  vertical-align: -0.08em;
}

.bait-color-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    0 1px 2px rgba(15, 23, 42, 0.12);
}

.bait-analysis {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  margin-top: 8px;
}

.bait-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.bait-category-card {
  display: grid;
  gap: 6px;
  align-content: start;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
}

.bait-category-card > b {
  color: var(--muted);
  font-size: 0.74rem;
}

.bait-category-card > strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.1;
}

.bait-category-card > div {
  display: grid;
  gap: 5px;
}

.bait-category-live_bait {
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.bait-category-fermented_bait {
  border-color: #fde68a;
  background: #fffbeb;
}

.bait-category-mixed_bait {
  border-color: #fbcfe8;
  background: #fdf2f8;
}

.bait-category-artificial_lure {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.bait-analysis article {
  display: grid;
  gap: 5px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid #c7d2fe;
  padding: 8px;
}

.bait-analysis article > b {
  color: var(--muted);
  font-size: 0.72rem;
}

.bait-summary p,
.bait-recommendation p {
  margin: 0;
}

.fishing-technique-summary,
.fishing-technique {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.fishing-technique-summary span,
.fishing-technique span {
  border-color: #a7f3d0;
}

.fishing-technique-summary p,
.fishing-technique p {
  margin: 0;
}

.condition-index-summary,
.condition-indices {
  border-color: #bae6fd;
  background: #f0f9ff;
}

.condition-index-summary span,
.condition-indices span {
  border-color: #bae6fd;
}

.condition-index-summary p,
.condition-indices p {
  margin: 0;
}

.fishing-plan-summary,
.fishing-plan {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.fishing-plan-summary span,
.fishing-plan span {
  border-color: #99f6e4;
}

.fishing-plan-summary p,
.fishing-plan p {
  margin: 0;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.prediction-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.timeline-scope-note {
  border: 1px solid rgba(15, 138, 104, 0.14);
  border-radius: 8px;
  background: #f7fcf9;
  color: var(--muted);
  padding: 9px 11px;
  font-size: 0.86rem;
  font-weight: 800;
}

.prediction-item {
  display: grid;
  grid-template-columns: 84px minmax(170px, 0.8fr) minmax(220px, 1.2fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(28, 61, 52, 0.05);
  min-width: 0;
}

.prediction-item.best-item {
  border-color: rgba(245, 158, 11, 0.38);
  background: linear-gradient(135deg, #fffbeb, #ecfdf5);
}

.prediction-list.timeline-compact .prediction-item {
  grid-template-columns: minmax(96px, 0.6fr) auto minmax(190px, 1fr);
  align-items: center;
  padding: 10px 12px;
}

.prediction-list.timeline-full-compact {
  gap: 6px;
}

.prediction-list.timeline-full-compact .prediction-item {
  grid-template-columns: 86px minmax(96px, 0.55fr) minmax(200px, 1fr);
  padding: 8px 10px;
}

.prediction-list.timeline-compact .prediction-time {
  gap: 2px;
}

.prediction-list.timeline-compact .prediction-point-chip,
.prediction-list.timeline-compact .time-context,
.prediction-list.timeline-compact .prediction-time strong,
.prediction-list.timeline-compact .prediction-score div,
.prediction-list.timeline-compact .prediction-detail,
.prediction-list.timeline-compact .prediction-item > p,
.prediction-list.timeline-compact .data-note,
.prediction-list.timeline-compact .water-condition,
.prediction-list.timeline-compact .target-activity,
.prediction-list.timeline-compact .fish-species,
.prediction-list.timeline-compact .species-summary,
.prediction-list.timeline-compact .bait-summary,
.prediction-list.timeline-compact .bait-recommendation,
.prediction-list.timeline-compact .condition-index-summary,
.prediction-list.timeline-compact .condition-indices,
.prediction-list.timeline-compact .fishing-plan-summary,
.prediction-list.timeline-compact .fishing-plan,
.prediction-list.timeline-compact .fishing-technique-summary,
.prediction-list.timeline-compact .fishing-technique,
.prediction-list.timeline-compact .water-relationship,
.prediction-list.timeline-compact .gate-impact,
.prediction-list.timeline-compact .source-list {
  display: none;
}

.prediction-list.timeline-expanded .prediction-compact-status {
  display: none;
}

.prediction-list.timeline-expanded .prediction-item {
  align-items: start;
}

.prediction-list.timeline-expanded .prediction-detail,
.prediction-list.timeline-expanded .prediction-item > p,
.prediction-list.timeline-expanded .data-note,
.prediction-list.timeline-expanded .water-condition,
.prediction-list.timeline-expanded .target-activity,
.prediction-list.timeline-expanded .fish-species,
.prediction-list.timeline-expanded .bait-recommendation,
.prediction-list.timeline-expanded .fishing-technique,
.prediction-list.timeline-expanded .fishing-plan,
.prediction-list.timeline-expanded .condition-indices,
.prediction-list.timeline-expanded .water-relationship,
.prediction-list.timeline-expanded .gate-impact,
.prediction-list.timeline-expanded .source-list {
  grid-column: 1 / -1;
}

.prediction-compact-reason {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.prediction-compact-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.fish-compact-chip,
.direction-change-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 6px 9px;
  font-size: 0.82rem;
  font-weight: 900;
}

.fish-compact-chip b {
  color: var(--muted);
  font-size: 0.72rem;
}

.direction-change-chip {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #92400e;
}

.prediction-time {
  display: grid;
  gap: 4px;
}

.prediction-time span {
  font-size: 1.15rem;
  font-weight: 900;
}

.prediction-time small {
  color: var(--muted);
  font-weight: 800;
}

.prediction-point-chip {
  display: -webkit-box;
  width: fit-content;
  max-width: 170px;
  border-radius: 6px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #075985 !important;
  padding: 4px 7px;
  font-size: 0.7rem;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.prediction-time strong {
  width: fit-content;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  padding: 3px 8px;
  font-size: 0.72rem;
}

.time-context {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 900;
}

.time-context-past {
  background: #f8fafc;
}

.time-context-current {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #047857;
}

.time-context-future {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.prediction-score {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.prediction-score div {
  display: grid;
  gap: 2px;
}

.prediction-score strong {
  line-height: 1.25;
}

.prediction-graph-button {
  width: auto;
  min-width: 88px;
  min-height: 44px;
  padding: 7px 10px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #075985;
  font-size: 0.78rem;
  white-space: nowrap;
  justify-self: stretch;
}

.prediction-graph-button:hover,
.prediction-graph-button:focus-visible {
  border-color: #7dd3fc;
  background: #e0f2fe;
  color: #075985;
}

.prediction-graph-button[disabled] {
  cursor: not-allowed;
  opacity: 0.56;
}

.prediction-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 6px;
}

.prediction-detail span {
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.prediction-item p {
  grid-column: 2 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.prediction-item .data-note {
  grid-column: 2 / -1;
}

.prediction-item .water-condition {
  grid-column: 2 / -1;
}

.prediction-item .target-activity,
.prediction-item .fish-species,
.prediction-item .species-summary,
.prediction-item .bait-summary,
.prediction-item .bait-recommendation,
.prediction-item .fishing-technique-summary,
.prediction-item .fishing-technique {
  grid-column: 2 / -1;
}

.prediction-item .water-relationship {
  grid-column: 2 / -1;
}

.prediction-item .gate-impact {
  grid-column: 2 / -1;
}

.prediction-item .source-list {
  grid-column: 2 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.52);
}

.modal-card {
  width: min(860px, calc(100vw - 48px));
  max-height: min(680px, calc(100vh - 48px));
  overflow: auto;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.modal-close-button {
  width: 44px;
  min-width: 44px;
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border-radius: 8px;
}

.water-graph-content {
  padding: 18px;
  overflow-x: auto;
}

.water-graph-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  color: #475569;
}

.water-graph-focus {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eff6ff;
  color: #075985;
}

.water-graph-focus span {
  color: #334155;
  font-weight: 800;
}

.water-graph {
  min-width: 680px;
  width: 100%;
  height: auto;
}

.water-graph line {
  stroke: #cbd5e1;
  stroke-width: 1.5;
}

.water-graph path {
  fill: none;
  stroke: #0f766e;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.water-graph circle {
  fill: #0f766e;
  stroke: #ffffff;
  stroke-width: 2;
}

.water-graph circle.is-focused {
  fill: #f59e0b;
  stroke: #78350f;
  stroke-width: 3;
}

.water-graph circle.is-suspicious {
  fill: #f97316;
  stroke: #9a3412;
  stroke-width: 3;
  stroke-dasharray: 2 2;
}

.water-graph text {
  fill: #64748b;
  font-size: 13px;
}

.water-graph-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.water-graph-list span {
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.35;
}

.water-graph-list span.is-focused {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #78350f;
}

.water-graph-list span.is-suspicious {
  border-color: #fdba74;
  background: #fff7ed;
  color: #9a3412;
}

.water-graph-list span.is-suspicious small {
  color: #9a3412;
  font-weight: 900;
}

.graph-quality-note {
  margin-top: 12px;
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 10px 12px;
  font-weight: 900;
  line-height: 1.4;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1060px) {
  .app-shell {
    grid-template-columns: 1fr;
    max-width: 960px;
    padding: 14px;
  }

  .controls-panel,
  .map-panel,
  .result-panel,
  .table-panel {
    grid-column: 1;
  }

  .controls-panel {
    grid-row: auto;
  }

  .controls-panel {
    order: 1;
  }

  .map-panel {
    order: 2;
  }

  .result-panel {
    order: 3;
  }

  .table-panel {
    order: 4;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .angler-decision-summary {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .map-panel {
    min-height: min(54svh, 520px);
  }

  #map {
    min-height: min(54svh, 520px);
  }

  .prediction-item {
    grid-template-columns: 86px minmax(170px, 0.7fr) minmax(220px, 1.3fr);
  }
}

@media (min-width: 721px) and (max-width: 1060px) {
  .control-stack {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: start;
  }

  .control-stack > .primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .control-stack {
    grid-template-columns: 1fr;
  }

  .table-header,
  .title-row {
    flex-wrap: wrap;
  }

  .timeline-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: 100%;
    max-width: none;
    padding: 8px;
    gap: 10px;
  }

  .controls-panel,
  .map-panel,
  .result-panel,
  .table-panel {
    width: 100%;
    min-width: 0;
  }

  .map-panel {
    order: 1;
  }

  .controls-panel {
    order: 2;
  }

  .result-panel {
    order: 3;
  }

  .table-panel {
    order: 4;
  }

  .controls-panel,
  .result-panel,
  .table-panel {
    padding: 12px;
  }

  .panel,
  .map-panel {
    border-radius: 8px;
  }

  h1 {
    font-size: 1.42rem;
    white-space: normal;
  }

  h2 {
    font-size: 1rem;
  }

  .subtitle,
  .section-heading p,
  .best-card p,
  .water-body-card p {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  .control-stack {
    gap: 12px;
    margin-top: 14px;
  }

  .form-section {
    gap: 10px;
    padding-top: 12px;
  }

  .title-row,
  .modal-header,
  .table-header {
    flex-direction: column;
  }

  .table-header > div:first-child {
    width: 100%;
    flex: 0 1 auto;
    min-width: 0;
  }

  .timeline-actions {
    align-items: stretch;
    width: 100%;
    flex: 0 1 auto;
    flex-direction: column;
  }

  .timeline-actions .badge {
    flex: 0 1 auto;
    width: 100%;
    max-width: 100%;
  }

  .timeline-toggle {
    width: 100%;
  }

  .export-actions .download-link {
    flex: 1 1 140px;
  }

  input,
  button,
  .download-link,
  .primary,
  .secondary {
    min-height: 44px;
  }

  .coordinate-grid,
  .range-grid,
  .segmented {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .compact-button {
    width: 100%;
  }

  .map-search-overlay {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
  }

  .map-search-overlay .search-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .map-search-overlay .compact-button {
    width: auto;
    min-width: 66px;
    padding: 0 11px;
  }

  .map-search-overlay .search-results {
    width: 100%;
    min-width: 0;
    max-height: min(44svh, 260px);
  }

  .prediction-item {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 10px;
  }

  .prediction-list.timeline-compact .prediction-item {
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    gap: 8px;
  }

  .prediction-list.timeline-full-compact .prediction-item {
    grid-template-columns: minmax(78px, 0.65fr) minmax(0, 1fr);
  }

  .prediction-list.timeline-compact {
    max-height: min(70svh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
  }

  .prediction-list.timeline-compact .prediction-time {
    min-width: 0;
  }

  .prediction-list.timeline-compact .prediction-score {
    justify-content: flex-end;
  }

  .prediction-list.timeline-compact .prediction-compact-status {
    grid-column: 1 / -1;
  }

  .prediction-time span {
    font-size: 1rem;
  }

  .prediction-score {
    align-items: flex-start;
  }

  .prediction-detail {
    grid-template-columns: repeat(2, minmax(110px, 1fr));
  }

  .prediction-item p,
  .prediction-item .data-note,
  .prediction-item .water-condition,
  .prediction-item .target-activity,
  .prediction-item .fish-species,
  .prediction-item .species-summary,
  .prediction-item .bait-summary,
  .prediction-item .bait-recommendation,
  .prediction-item .condition-index-summary,
  .prediction-item .condition-indices,
  .prediction-item .fishing-technique-summary,
  .prediction-item .fishing-technique,
  .prediction-item .water-relationship,
  .prediction-item .gate-impact,
  .prediction-item .source-list {
    grid-column: 1;
  }

  .water-condition > div,
  .angler-decision-summary,
  .target-summary,
  .target-activity > div,
  .fish-species > div,
  .species-summary > div,
  .bait-summary > div,
  .bait-grid,
  .bait-category-grid,
  .bait-analysis,
  .bait-species,
  .condition-index-summary > div,
  .condition-indices > div,
  .fishing-technique-summary > div,
  .technique-grid,
  .point-context-card > div,
  .point-context-card.compact > div,
  .water-relationship > div,
  .water-body-grid {
    grid-template-columns: 1fr;
  }

  .prediction-point-chip {
    max-width: 100%;
  }

  .map-panel,
  #map {
    min-height: min(62svh, 430px);
  }

  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal-card {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .modal-header {
    flex-direction: row;
    align-items: center;
    padding: 14px;
  }

  .modal-close-button {
    width: 44px;
    min-width: 44px;
    flex: 0 0 44px;
  }

  .water-graph-content {
    padding: 14px;
  }

  .water-graph-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .water-graph-list {
    grid-template-columns: 1fr;
  }

  .map-layer-switch {
    top: auto;
    right: 10px;
    bottom: 28px;
  }

  .map-layer-button {
    padding: 8px 9px;
    font-size: 0.8rem;
  }

  .best-score {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .moon-phase-card {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: 100%;
    padding: 6px;
  }

  .controls-panel,
  .result-panel,
  .table-panel {
    padding: 10px;
  }

  .map-panel,
  #map {
    min-height: min(58svh, 390px);
  }

  .map-search-overlay .compact-button {
    min-width: 58px;
    padding: 0 9px;
  }

  .prediction-detail,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .prediction-list.timeline-compact .prediction-item {
    grid-template-columns: minmax(68px, 0.7fr) minmax(0, 1fr);
    padding: 8px;
  }

  .fish-compact-chip,
  .direction-change-chip {
    width: auto;
    justify-content: flex-start;
  }
}
