:root {
  --bg: #edf3ef;
  --card-bg: #ffffff;
  --text: #183028;
  --muted: #4b6359;
  --line: #c9d7cd;
  --brand: #1f5a49;
  --brand-dark: #164435;
  --sand: #f3e8d0;
  --ocean: #1d5f77;
  --low-bg: #e8f4f8;
  --low-border: #9cc4d4;
  --nice: #315749;
  --good: #806312;
  --very-good: #1d5f77;
  --excellent: #0f5132;
  --err-bg: #fde8e8;
  --err-border: #e08080;
  --warn-text: #6b2f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #dce8df 0%, var(--bg) 45%, #e7eee9 100%);
  min-height: 100vh;
}

.app {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0.9rem 0.8rem 1.75rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 3px 10px rgba(18, 40, 33, 0.08);
}

.card--note {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
  background: #f6faf7;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.75rem, 7vw, 2.35rem);
  line-height: 1.1;
}

.hero {
  text-align: center;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #f7fffb;
}

.hero h1 {
  margin: 0 auto 0.45rem;
  max-width: 100%;
}

.tagline {
  margin: 0 auto 1.05rem;
  max-width: 22em;
  padding: 0 0.25rem;
  text-align: center;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-style: italic;
  font-weight: normal;
  font-size: clamp(1.05rem, 4.35vw, 1.52rem);
  line-height: 1.42;
  letter-spacing: 0.04em;
  color: #e9e0c4;
  text-shadow:
    0 1px 2px rgba(8, 32, 28, 0.55),
    0 0 36px rgba(232, 216, 170, 0.18);
}

.data-note {
  margin-top: -0.2rem;
}

.wdfw-btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  color: #1a352c;
  background: var(--sand);
  border: 1px solid #dfd0ae;
  border-radius: 12px;
  padding: 0.82rem 0.85rem;
  min-height: 52px;
  line-height: 1.25;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
}

h2 {
  margin: 0;
  font-size: 1.18rem;
}

.section-lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}

.pill--noaa {
  background: #e8f2fb;
  color: var(--ocean);
  border: 1px solid #b8d4ea;
}

.pill--wdfw {
  background: #eef6f0;
  color: var(--nice);
  border: 1px solid #bcd4c8;
}

label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-bottom: 0.65rem;
}

select,
.date-input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

select:focus,
.date-input:focus,
.wdfw-btn:focus {
  outline: 3px solid rgba(38, 92, 75, 0.28);
  outline-offset: 2px;
}

.status {
  min-height: 1.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
}

.status--loading {
  color: var(--ocean);
}

.status--error {
  color: var(--warn-text);
  background: var(--err-bg);
  border: 1px solid var(--err-border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
}

.status--empty {
  color: var(--muted);
}

.tide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.tide-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  padding: 0.65rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fcfdfc;
}

.tide-row__left {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.tide-row--low {
  background: var(--low-bg);
  border-color: var(--low-border);
}

.tide-row__type {
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tide-row__type--low {
  color: var(--ocean);
}

.tide-row__time {
  font-weight: 700;
  font-size: 1rem;
}

.tide-row__height {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.tide-row__badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  width: fit-content;
}

.badge-nice { background: #e5efe8; color: var(--nice); }
.badge-good { background: #f5edd5; color: var(--good); }
.badge-very-good { background: #dfeaf0; color: var(--very-good); }
.badge-excellent { background: #d4ebe0; color: var(--excellent); }

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.wdfw-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.72rem 0.8rem;
  background: #fcfdfc;
}

.wdfw-card__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  align-items: baseline;
}

.wdfw-card__date {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.wdfw-card__weekday {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  background: #eef2ef;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
}

.wdfw-card__detail {
  margin: 0.45rem 0 0;
  font-size: 0.93rem;
  color: var(--text);
}

.wdfw-card__detail strong {
  color: var(--brand-dark);
}

@media (min-width: 640px) {
  .tide-row {
    flex-wrap: nowrap;
    align-items: center;
  }

  .tide-row__right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: auto;
  }
}
