:root {
  --bg: #ecf5f9;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-soft: rgba(245, 250, 252, 0.96);
  --text: #122638;
  --muted: #557285;
  --line: rgba(18, 38, 56, 0.12);
  --line-strong: rgba(18, 38, 56, 0.2);
  --primary: #d13346;
  --primary-dark: #b72638;
  --accent: #0d789f;
  --accent-soft: #d9eef5;
  --success: #0f7d54;
  --warning: #bf6518;
  --danger: #8a1f2a;
  --shadow: 0 20px 55px rgba(18, 38, 56, 0.12);
  --shadow-soft: 0 10px 28px rgba(18, 38, 56, 0.08);
  --radius: 8px;
  --content: 1180px;
  --gutter: clamp(0.75rem, 2vw, 1.5rem);
  --section-gap: clamp(1rem, 2vw, 1.4rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #f8fbfd;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: Arial, sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(13, 120, 159, 0.16), transparent 28rem),
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
}

body,
button,
input,
select,
textarea {
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

strong {
  font-weight: 700;
}

h1,
h2,
h3,
p,
small,
label,
th,
td,
a,
button,
span {
  overflow-wrap: anywhere;
}

main,
.site-header,
.flash,
.admin-topbar,
.admin-main {
  width: min(100%, calc(var(--content) + (var(--gutter) * 2)));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem var(--gutter);
  backdrop-filter: blur(18px);
  background: rgba(248, 252, 254, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.header-top,
.header-panel,
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  font-size: 1.18rem;
  font-weight: 800;
}

.brand img {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.brand span {
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 0.82rem 1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle-icon {
  position: relative;
  width: 1rem;
  height: 2px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transition: transform 160ms ease, top 160ms ease, opacity 160ms ease;
}

.nav-toggle-icon::before {
  top: -0.35rem;
}

.nav-toggle-icon::after {
  top: 0.35rem;
}

.site-header.nav-open .nav-toggle-icon {
  box-shadow: none;
  background: transparent;
}

.site-header.nav-open .nav-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.site-header.nav-open .nav-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.header-panel {
  gap: 1rem;
}

.main-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.nav-link,
.nav-group-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.72rem 1.05rem;
  border-radius: var(--radius);
  border: 1px solid rgba(18, 38, 56, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-group-trigger:hover,
.nav-group.is-active > .nav-group-trigger,
.nav-group.is-open > .nav-group-trigger {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(13, 120, 159, 0.24);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.nav-group {
  position: static;
  min-width: 0;
}

.nav-group-trigger {
  gap: 0.7rem;
}

.nav-group-caret {
  width: 0.65rem;
  height: 0.65rem;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 160ms ease;
}

.nav-group.is-open .nav-group-caret {
  transform: rotate(225deg) translateY(-1px);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  left: 0;
  right: 0;
  width: auto;
  max-width: 100%;
  max-height: min(32rem, calc(100svh - 8rem));
  overflow-y: auto;
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(18, 38, 56, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.5rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.nav-group.is-open .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-intro {
  display: grid;
  gap: 0.85rem;
  align-content: start;
  padding: 1rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 120, 159, 0.12), rgba(13, 120, 159, 0.04));
  border: 1px solid rgba(13, 120, 159, 0.12);
}

.nav-dropdown-label,
.nav-dropdown-copy {
  margin: 0;
}

.nav-dropdown-label {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
}

.nav-dropdown-copy {
  color: var(--muted);
  line-height: 1.6;
}

.nav-dropdown-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.72rem 1rem;
  width: fit-content;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.nav-dropdown-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.nav-dropdown-link {
  display: grid;
  gap: 0.35rem;
  min-height: 100%;
  padding: 0.9rem 0.95rem;
  border-radius: var(--radius);
  border: 1px solid rgba(18, 38, 56, 0.08);
  background: rgba(248, 252, 254, 0.94);
  transition: 160ms ease;
}

.nav-dropdown-link:hover,
.nav-dropdown-link.is-active {
  transform: translateY(-2px);
  border-color: rgba(13, 120, 159, 0.28);
  box-shadow: var(--shadow-soft);
}

.nav-dropdown-link strong,
.nav-dropdown-link small {
  display: block;
}

.nav-dropdown-link small {
  color: var(--muted);
  line-height: 1.5;
}

.flash {
  padding: 1rem var(--gutter) 0;
}

.flash .section-inner {
  padding: 1rem 1.15rem;
}

.flash-success .section-inner {
  border-left: 4px solid var(--success);
}

.hero,
.page-hero,
.quick-links,
.page-main,
.admin-main {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.hero {
  position: relative;
  min-height: clamp(22rem, 42vw, 29rem);
  display: flex;
  align-items: center;
  padding-top: 0.6rem;
  padding-bottom: 1.2rem;
}

.page-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(16rem, 42vw, 24rem);
  padding-top: 0.6rem;
  padding-bottom: 2.5rem;
}

.hero-media,
.page-hero::before {
  position: absolute;
  inset: 0.75rem var(--gutter) 0.75rem var(--gutter);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, rgba(8, 24, 37, 0.78) 0%, rgba(8, 24, 37, 0.34) 55%, rgba(8, 24, 37, 0.18) 100%),
    linear-gradient(180deg, rgba(13, 120, 159, 0.14) 0%, rgba(8, 24, 37, 0.2) 100%),
    url("/public/img/illustration.jpg") center center / cover no-repeat;
  box-shadow: var(--shadow);
}

.page-hero::before {
  content: "";
}

.hero-content,
.page-copy {
  position: relative;
  z-index: 1;
  width: min(44rem, 100%);
  padding: clamp(1.5rem, 4vw, 3rem);
  color: white;
}

.hero-content {
  display: grid;
  gap: 0.95rem;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(16rem, 0.8fr);
  gap: clamp(1rem, 3vw, 2rem);
  width: 100%;
  align-items: end;
}

.home-hero .hero-content {
  width: min(40rem, 100%);
}

.hero-rail {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.9rem;
  align-content: start;
  padding: 1.35rem;
  color: white;
  background: rgba(8, 24, 37, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

.hero-rail-list {
  display: grid;
  gap: 0.8rem;
}

.hero-rail-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.9rem;
  align-items: start;
}

.hero-rail-item strong,
.hero-rail-item p,
.hero-rail-empty {
  margin: 0;
}

.hero-rail-item p,
.hero-rail-empty {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.hero-rail-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  min-height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 0.88rem;
  font-weight: 700;
}

.eyebrow,
.section-label,
.page-label {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero h1,
.page-hero h1,
.admin-topbar h1 {
  margin: 0;
  line-height: 0.98;
}

.hero h1 {
  max-width: 12ch;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.page-hero h1,
.admin-topbar h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.hero-text,
.page-intro,
.page-note,
.info-card p,
.section-copy,
.document-note,
.empty-state,
.form-helper,
.summary-card span {
  line-height: 1.65;
}

.hero-text,
.page-intro {
  margin: 0;
  max-width: 36rem;
  font-size: clamp(1rem, 2vw, 1.14rem);
  color: rgba(255, 255, 255, 0.92);
}

.page-note,
.section-copy,
.document-note,
.card-meta,
.empty-state,
.form-helper {
  margin: 0;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-highlights span {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  font-size: 0.95rem;
  font-weight: 700;
}

.hero-actions,
.card-actions,
.form-actions,
.placeholder-actions,
.admin-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-actions {
  margin-top: 0.2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: min(100%, 11rem);
  min-height: 3rem;
  padding: 0.86rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.nav-link:focus-visible,
.nav-group-trigger:focus-visible,
.nav-dropdown-home:focus-visible,
.nav-toggle:focus-visible,
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(13, 120, 159, 0.26);
  outline-offset: 2px;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 10px 22px rgba(209, 51, 70, 0.24);
}

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

.button-secondary {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.button-ghost {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

.button-ghost:hover {
  border-color: rgba(13, 120, 159, 0.25);
}

.button-danger {
  background: var(--danger);
  color: white;
}

.button-small {
  min-width: auto;
  min-height: 2.3rem;
  padding: 0.55rem 0.86rem;
  font-size: 0.94rem;
}

.section-inner,
.page-panel,
.admin-panel,
.admin-login-panel {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.section-inner,
.page-panel,
.admin-panel,
.admin-login-panel {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.section-inner h2,
.page-panel h2,
.admin-panel h2,
.competition-form-wrap h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

.quick-links {
  padding-bottom: 1.35rem;
}

.link-grid,
.card-grid,
.placeholder-actions,
.detail-panel,
.summary-grid {
  display: grid;
  gap: 1rem;
}

.link-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
  margin-top: 1.35rem;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  margin-top: 1.35rem;
}

.placeholder-actions,
.detail-panel,
.summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.link-grid a,
.placeholder-actions a,
.info-card,
.summary-card {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  transition: 160ms ease;
}

.link-grid a,
.placeholder-actions a,
.info-card {
  display: grid;
  gap: 0.65rem;
  align-content: start;
  padding: 1.15rem;
}

.summary-card {
  display: grid;
  gap: 0.25rem;
}

.link-grid a:hover,
.placeholder-actions a:hover,
.info-card:hover,
.summary-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 120, 159, 0.28);
  box-shadow: var(--shadow-soft);
}

.link-grid span,
.placeholder-actions span,
.info-card h2,
.info-card h3 {
  display: block;
  font-weight: 700;
}

.link-grid small,
.placeholder-actions small {
  color: var(--muted);
  line-height: 1.55;
}

.info-card h2,
.info-card h3 {
  margin: 0;
}

.card-meta {
  color: var(--accent);
  font-weight: 700;
}

.card-actions {
  margin-top: auto;
}

.card-actions > *,
.form-actions > *,
.hero-actions > *,
.admin-topbar-actions > * {
  flex: 1 1 11rem;
}

.page-main {
  position: relative;
  z-index: 2;
  margin-top: clamp(-1.75rem, -3vw, -0.8rem);
  padding-bottom: 2rem;
}

.page-panel {
  display: grid;
  gap: 1.5rem;
}

.page-link-group {
  display: grid;
  gap: 1rem;
}

.page-link-head {
  display: grid;
  gap: 0.45rem;
}

.tide-layout,
.tide-section,
.weather-layout,
.weather-section {
  display: grid;
  gap: 1rem;
}

.tide-event-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.tide-event-card {
  text-align: center;
}

.tide-event-card p {
  margin: 0;
}

.tide-graph-frame {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  padding: 0.75rem;
}

.tide-graph-frame img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 2px);
}

.tide-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.tide-chart-bg {
  fill: rgba(236, 245, 249, 0.72);
  stroke: rgba(18, 38, 56, 0.1);
}

.tide-grid-line {
  stroke: rgba(18, 38, 56, 0.08);
  stroke-width: 1;
}

.tide-grid-line-horizontal {
  stroke: rgba(18, 38, 56, 0.1);
}

.tide-area {
  fill: url(#tideArea);
  stroke: none;
}

.tide-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tide-point {
  stroke: white;
  stroke-width: 2;
}

.tide-point-pm {
  fill: var(--primary);
}

.tide-point-bm {
  fill: var(--accent);
}

.tide-axis-label,
.tide-point-label {
  fill: var(--muted);
  font-family: Arial, sans-serif;
}

.tide-axis-label {
  font-size: 13px;
  font-weight: 700;
}

.tide-point-label {
  font-size: 13px;
  font-weight: 700;
}

.embed-frame {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.weather-embed-frame {
  min-height: min(70rem, 78svh);
}

.weather-embed-frame iframe {
  display: block;
  width: 100%;
  min-height: min(70rem, 78svh);
  border: 0;
  background: white;
}

.competition-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 56rem;
  margin: 0 auto;
}

.competition-copy,
.competition-form-wrap {
  min-width: 0;
}

.competition-form-wrap > .section-label,
.competition-form-wrap > h2 {
  text-align: center;
}

.competition-copy {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
}

.summary-grid {
  margin-top: 0.2rem;
  width: 100%;
}

.summary-card {
  padding: 1rem;
  background: var(--surface-soft);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.06rem;
}

.form-helper {
  padding: 0.95rem 1rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #18435a;
}

.empty-state {
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px dashed rgba(18, 38, 56, 0.18);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
}

.meta-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.8;
}

.error-panel {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(191, 101, 24, 0.25);
  background: rgba(255, 245, 238, 0.94);
}

.error-panel h3 {
  margin: 0 0 0.8rem;
}

.error-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.6;
}

.registration-form {
  display: grid;
  gap: 1.3rem;
}

.form-section {
  display: grid;
  gap: 1rem;
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.section-heading {
  display: grid;
  gap: 0.35rem;
}

.form-section-heading {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.form-section-heading > .section-step {
  grid-row: 1 / span 2;
}

.form-section-heading > .section-label,
.form-section-heading > div {
  grid-column: 2;
}

.section-heading .section-label {
  color: var(--muted);
  margin-bottom: 0;
}

.section-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  min-height: 2.2rem;
  border-radius: 999px;
  background: rgba(13, 120, 159, 0.12);
  color: var(--accent);
  font-weight: 800;
}

.form-grid,
.person-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  padding: 0.9rem 0.95rem;
  font: inherit;
  color: var(--text);
}

.field input[type="file"] {
  padding: 0.75rem;
}

.field textarea {
  resize: vertical;
}

.field small,
.document-note {
  color: var(--muted);
}

.checkbox {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
}

.checkbox input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.crew-list {
  display: grid;
  gap: 1rem;
}

.crew-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(244, 249, 252, 0.96);
  padding: 1rem;
}

.person-block {
  display: grid;
  gap: 1rem;
}

.person-block-head {
  display: grid;
  gap: 0.3rem;
}

.person-block-head h3,
.person-block-head p {
  margin: 0;
}

.person-block-head p {
  color: var(--muted);
}

.crew-card-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.crew-card-head h3,
.panel-head h2,
.info-card h2,
.info-card h3 {
  margin: 0;
}

.add-crew {
  width: fit-content;
}

.conditional-upload.is-hidden,
.is-hidden {
  display: none;
}

.admin-page {
  background:
    radial-gradient(circle at top right, rgba(209, 51, 70, 0.12), transparent 24rem),
    linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
}

.admin-topbar {
  align-items: flex-start;
  padding: 1rem var(--gutter) 1.25rem;
}

.admin-main {
  display: grid;
  gap: 1.5rem;
  padding-top: 0;
  padding-bottom: 2rem;
}

.admin-form-panel {
  max-width: 1100px;
}

.admin-login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.admin-login-panel {
  width: min(32rem, 100%);
}

.admin-login-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.site-footer {
  width: min(100%, calc(var(--content) + (var(--gutter) * 2)));
  margin: 0 auto;
  padding: 0 var(--gutter) 1.5rem;
}

.site-footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1rem 2rem;
  align-items: end;
  padding: 1.1rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer-copy {
  display: grid;
  gap: 0.2rem;
}

.site-footer-copy p,
.site-footer-credits span {
  margin: 0;
}

.site-footer-nav,
.site-footer-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.site-footer-nav a:hover,
.site-footer-credits a:hover {
  color: var(--text);
}

.site-footer-credits {
  justify-content: flex-end;
  font-size: 0.92rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

tbody tr:last-child td {
  border-bottom: 0;
}

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

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.table-actions a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .site-header {
    position: relative;
    top: auto;
    gap: 0.7rem;
  }

  .site-header.nav-open {
    position: relative;
    top: auto;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .header-panel {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    overflow: visible;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(18, 38, 56, 0.08);
    box-shadow: var(--shadow-soft);
    padding: 0.8rem;
  }

  .site-header.nav-open .header-panel {
    display: flex;
  }

  .main-nav {
    justify-content: flex-start;
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
  }

  .nav-link,
  .nav-group {
    width: 100%;
  }

  .nav-group {
    position: relative;
  }

  .nav-link,
  .nav-group-trigger {
    width: 100%;
    justify-content: space-between;
  }

  .nav-group {
    display: grid;
    gap: 0.75rem;
  }

  .nav-dropdown {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    display: none;
    grid-template-columns: 1fr;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    transform: none;
  }

  .nav-group.is-open .nav-dropdown {
    display: grid;
  }

  .nav-dropdown-links {
    grid-template-columns: 1fr;
  }

  .nav-dropdown-intro {
    padding: 0.95rem;
  }

  .page-main {
    margin-top: -1rem;
  }

  .hero-layout {
    grid-template-columns: 1fr;
  }

  .hero-rail {
    max-width: 30rem;
  }
}

@media (max-width: 820px) {
  .form-grid,
  .person-grid {
    grid-template-columns: 1fr;
  }

  .card-actions > *,
  .form-actions > *,
  .hero-actions > *,
  .admin-topbar-actions > * {
    flex-basis: 100%;
  }

  .hero h1 {
    max-width: 100%;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .site-footer-credits {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  table,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 0.9rem;
  }

  tbody tr {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
  }

  td {
    display: grid;
    grid-template-columns: minmax(6rem, 38%) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.4rem 0;
    border: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  td.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-top: 0.65rem;
  }

  td.table-actions::before {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .hero,
  .page-hero,
  .quick-links,
  .page-main,
  .admin-main,
  .flash,
  .site-header,
  .admin-topbar {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .hero {
    min-height: auto;
    padding-bottom: 1rem;
  }

  .page-hero {
    min-height: 15rem;
    padding-bottom: 1.5rem;
  }

  .home-hero .hero-rail {
    padding: 1rem;
  }

  .hero-media,
  .page-hero::before {
    inset: 0.6rem 0.75rem 0.6rem 0.75rem;
  }

  .hero-content,
  .page-copy {
    width: 100%;
    padding: 1.15rem;
  }

  .hero-highlights,
  .hero-actions,
  .card-actions,
  .form-actions,
  .admin-topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .add-crew {
    width: 100%;
  }

  .summary-grid,
  .detail-panel,
  .link-grid,
  .card-grid,
  .placeholder-actions {
    grid-template-columns: 1fr;
  }

  .crew-card-head,
  .panel-head,
  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .form-section-heading {
    grid-template-columns: 1fr;
  }

  .form-section-heading > .section-step,
  .form-section-heading > .section-label,
  .form-section-heading > div {
    grid-column: auto;
    grid-row: auto;
  }

  .checkbox {
    padding: 0.85rem;
  }

  .page-main {
    margin-top: -0.65rem;
  }

  .tide-graph-frame {
    padding: 0.45rem;
  }

  .tide-axis-label,
  .tide-point-label {
    font-size: 11px;
  }
}

@media print {
  .admin-topbar-actions,
  .button,
  .flash,
  .site-header {
    display: none !important;
  }

  body {
    background: white;
  }

  .admin-panel,
  .page-panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
