:root {
  --navy-950: #071b2c;
  --navy-900: #0b263d;
  --navy-800: #123a57;
  --navy-700: #1c5275;
  --blue-500: #2f7ea8;
  --blue-100: #dcecf3;
  --white: #ffffff; --foam: #f5f9fa;
  --sand-100: #f4eddf;
  --sand-300: #d9c49b;
  --sand-500: #b79862;
  --ink: #17232c; --muted: #60717d;
  --border: #ccd8de; --success: #237552;
  --warning: #9b5c08; --danger: #a33b35;
  --shadow: 0 12px 32px rgba(7, 27, 44, 0.12); --radius: 0.75rem;
  --radius-small: 0.4rem; --container: 72rem;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  min-height: 100%; background: var(--foam);
}
body {
  min-height: 100vh; margin: 0;
  color: var(--ink); background: var(--foam);
  line-height: 1.5;
}
img {
  display: block; max-width: 100%;
}
a {
  color: var(--navy-700); text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--blue-500);
}
h1,
h2,
h3 {
  margin-top: 0; color: var(--navy-950);
  line-height: 1.15;
}
h1 {
  margin-bottom: 0.75rem; font-size: clamp(1.75rem, 5vw, 2.7rem);
}
h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
}
p {
  margin-top: 0;
}
.site-header {
  position: sticky; z-index: 10;
  top: 0; color: var(--white);
  background: var(--navy-950); box-shadow: 0 3px 12px rgba(7, 27, 44, 0.2);
}
.header-inner {
  width: min(100% - 2rem, var(--container)); margin: 0 auto;
  padding: 0.8rem 0;
}
.brand {
  display: inline-block; color: var(--white);
  font-size: 1.08rem; font-weight: 750;
  text-decoration: none; letter-spacing: 0.01em;
}
.brand:hover {
  color: var(--sand-300);
}
.primary-nav {
  display: flex; gap: 0.3rem 0.9rem;
  align-items: center; padding-top: 0.65rem;
  overflow-x: auto; white-space: nowrap;
  scrollbar-width: thin;
}
.primary-nav a,
.nav-button {
  color: var(--white); font: inherit;
  font-size: 0.9rem;
}
.primary-nav a {
  text-decoration: none;
}
.primary-nav a:hover,
.nav-button:hover {
  color: var(--sand-300);
}
.logout-form {
  margin-left: auto;
}
.nav-button {
  margin: 0; padding: 0;
  border: 0; background: transparent;
  cursor: pointer;
}
.page-container {
  width: min(100% - 2rem, var(--container)); margin: 0 auto;
  padding: 1.5rem 0 3rem;
}
.page-container-guest {
  width: 100%; padding: 0;
}
.eyebrow {
  margin-bottom: 0.3rem; color: var(--blue-500);
  font-size: 0.75rem; font-weight: 800;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.muted,
.optional {
  color: var(--muted);
}
.optional {
  font-size: 0.85em; font-weight: 400;
}
.card,
.panel {
  padding: 1.1rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--white);
  box-shadow: 0 3px 14px rgba(7, 27, 44, 0.06);
}
.card-grid {
  display: grid; gap: 1rem;
}
.card > :last-child,
.panel > :last-child {
  margin-bottom: 0;
}
.boat-context {
  display: flex; flex-direction: column;
  gap: 1rem; margin-bottom: 1.5rem;
  padding: 1rem; border-left: 0.3rem solid var(--sand-500);
  border-radius: var(--radius); background: var(--white);
  box-shadow: 0 3px 14px rgba(7, 27, 44, 0.07);
}
.boat-context-identity {
  display: flex; gap: 0.9rem;
  align-items: center; min-width: 0;
}
.boat-context h1 {
  margin-bottom: 0.15rem; font-size: 1.45rem;
}
.boat-context-photo {
  width: 4.5rem; height: 4.5rem;
  flex: 0 0 auto; border-radius: var(--radius-small);
  object-fit: cover;
}
.boat-meta {
  margin: 0; color: var(--muted);
  font-size: 0.9rem;
}
.boat-switcher-label {
  margin: 0; font-size: 0.8rem;
}
.login-shell {
  display: grid; min-height: 100vh;
  place-items: center; padding: 1rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(217, 196, 155, 0.28), transparent 25rem),
    linear-gradient(145deg, var(--navy-950) 0%, var(--navy-700) 56%, #3b8fae 100%);
}
.login-card {
  width: min(100%, 28rem); padding: clamp(1.4rem, 5vw, 2.5rem);
  border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 1rem;
  background: rgba(255, 255, 255, 0.96); box-shadow: var(--shadow);
}
.login-mark {
  display: grid; width: 3.2rem;
  height: 3.2rem; margin-bottom: 1.25rem;
  place-items: center; border-radius: 50%;
  color: var(--white); background: var(--navy-900);
  font-size: 0.75rem; font-weight: 850;
  letter-spacing: 0.08em;
}
.login-intro {
  margin-bottom: 1.5rem; color: var(--muted);
}
.stacked-form {
  display: flex; flex-direction: column;
  gap: 0.55rem;
}
label {
  color: var(--navy-900); font-size: 0.9rem;
  font-weight: 700;
}
input,
select,
textarea {
  width: 100%; min-height: 2.75rem;
  padding: 0.65rem 0.75rem; border: 1px solid #aebdc5;
  border-radius: var(--radius-small); color: var(--ink);
  background: var(--white); font: inherit;
}
textarea {
  min-height: 7rem; resize: vertical;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
.sortable-heading:focus-visible {
  outline: 3px solid rgba(47, 126, 168, 0.35); outline-offset: 2px;
}
.form-row {
  display: grid; gap: 1rem;
}
.form-divider {
  display: flex; gap: 0.7rem;
  align-items: center; margin: 0.5rem 0;
  color: var(--muted); font-size: 0.75rem;
}
.form-divider::before,
.form-divider::after {
  height: 1px; flex: 1;
  background: var(--border); content: "";
}
.button,
button {
  display: inline-flex; min-height: 2.6rem;
  padding: 0.6rem 1rem; border: 1px solid transparent;
  border-radius: var(--radius-small); align-items: center;
  justify-content: center; font: inherit;
  font-weight: 750; text-decoration: none;
  cursor: pointer;
}
.button-primary {
  color: var(--white); background: var(--navy-800);
}
.button-primary:hover {
  color: var(--white); background: var(--navy-700);
}
.button-secondary {
  border-color: var(--navy-700); color: var(--navy-800);
  background: var(--white);
}
.button-danger {
  color: var(--white); background: var(--danger);
}
.button-block {
  width: 100%; margin-top: 0.75rem;
}
.button-row {
  display: flex; flex-wrap: wrap;
  gap: 0.6rem;
}
.alert {
  margin-bottom: 1rem; padding: 0.75rem 0.9rem;
  border-radius: var(--radius-small);
}
.alert-error {
  border: 1px solid #e2aaa6; color: #792a26;
  background: #fbeceb;
}
.badge {
  display: inline-flex; padding: 0.18rem 0.55rem;
  border-radius: 999px; color: var(--navy-800);
  background: var(--blue-100); font-size: 0.75rem;
  font-weight: 750; line-height: 1.45;
}
.badge-success {
  color: #15563a; background: #dcefe6;
}
.badge-warning {
  color: #744303; background: #f8e6c5;
}
.badge-danger {
  color: #792a26; background: #f5d9d7;
}
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--white);
}
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  padding: 0.75rem; border-bottom: 1px solid var(--border);
  text-align: left; vertical-align: top;
}
th {
  color: var(--navy-900); background: #edf4f6;
  font-size: 0.78rem; letter-spacing: 0.025em;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #f7fafb;
}
.sortable-heading {
  cursor: pointer; user-select: none;
}
.sortable-heading[data-direction="asc"]::after {
  content: " ▲";
}
.sortable-heading[data-direction="desc"]::after {
  content: " ▼";
}
.done {
  color: var(--muted); text-decoration: line-through;
}
dialog {
  width: min(calc(100% - 2rem), 40rem); max-height: calc(100vh - 2rem);
  padding: 0; overflow: auto;
  border: 0; border-radius: var(--radius);
  color: var(--ink); background: var(--white);
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: rgba(7, 27, 44, 0.72); backdrop-filter: blur(2px);
}
.dialog-content {
  padding: 1.25rem;
}
.dialog-header {
  display: flex; gap: 1rem;
  align-items: start; justify-content: space-between;
  margin-bottom: 1rem;
}
.dialog-header h2 {
  margin: 0;
}
.icon-button {
  width: 2.5rem; min-height: 2.5rem;
  padding: 0; border: 1px solid var(--border);
  color: var(--navy-900); background: var(--white);
}
.empty-state {
  padding: 2rem 1rem; color: var(--muted);
  text-align: center;
}
[hidden] {
  display: none !important;
}
@media (min-width: 42rem) {
  .header-inner {
    display: flex;
    gap: 1.5rem;
    align-items: center;
  }
  .primary-nav {
    flex: 1;
    padding-top: 0;
  }
  .page-container {
    padding-top: 2rem;
  }
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .boat-context {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .boat-switcher-label {
    width: min(15rem, 40%);
  }
  .dialog-content {
    padding: 1.75rem;
  }
}
@media (min-width: 68rem) {
  .card-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
