:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app: #121212; --surface: #1e1e1e; --surface-2: #2a2a2a; --elevated: #333333;
  --text: #ffffff; --muted: #b0b0b0; --hint: #797979; --border: #333333; --border-light: #444444;
  --primary: #4a90b8; --primary-dark: #2e6e94; --success: #5b8a6a; --warning: #d4924d; --error: #c75450;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--app); color: var(--text); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); border: 1px solid var(--border-light); border-radius: 12px; padding: 32px; background: var(--surface); }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--primary); border-radius: 12px; color: var(--primary); font-size: 28px; }
.brand-mark.small { width: 36px; height: 36px; font-size: 20px; border-radius: 8px; }
.eyebrow, .nav-label { margin: 0; color: var(--hint); font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 6px 0 0; font-size: 24px; line-height: 1.2; }
h2 { margin: 0 0 16px; font-size: 18px; }
h3 { margin: 0; font-size: 16px; }
.muted { color: var(--muted); line-height: 1.5; }
.form-stack { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
input, textarea, select { width: 100%; min-height: 44px; border: 1px solid var(--border-light); border-radius: 8px; padding: 10px 12px; background: var(--surface-2); color: var(--text); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { min-height: 120px; resize: vertical; }
.inline-error { margin: 0; color: var(--error); font-size: 13px; }
.share-position { margin-top: 24px; border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface-2); }
.share-position dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.share-position dt { color: var(--hint); }
.share-position dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.button, .icon-button { min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 10px 14px; cursor: pointer; }
.button.primary { background: var(--primary); color: #ffffff; }
.button.primary:hover { background: var(--primary-dark); }
.button.outline { border-color: var(--primary); background: transparent; color: var(--primary); }
.button.ghost, .icon-button { background: transparent; color: var(--muted); }
.button.danger { background: var(--error); color: #ffffff; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.locale-row, .button-row { display: flex; gap: 8px; align-items: center; }
.locale-row { margin-top: 16px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 256px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); z-index: 300; }
.sidebar-head { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.sidebar-head .icon-button { margin-left: auto; }
.boat-switcher { margin: 12px; min-height: 64px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.boat-switcher span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.boat-switcher strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.boat-switcher small { color: var(--hint); }
.presence-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--success); }
nav { padding: 4px 12px 20px; overflow: auto; }
nav a { min-height: 44px; display: flex; align-items: center; margin: 2px 0; border-radius: 8px; padding: 0 12px; color: var(--muted); text-decoration: none; font-size: 14px; }
nav a:hover { background: var(--surface-2); color: var(--text); }
nav a.active { border-left: 2px solid var(--primary); background: var(--surface-2); color: var(--text); }
.nav-label { padding: 22px 12px 6px; }
.sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); }
.sidebar-foot > .button { width: 100%; }
.sidebar-foot .locale-row { justify-content: center; }
.workspace { min-width: 0; }
.topbar { min-height: 72px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); padding: 12px clamp(16px, 3vw, 32px); background: var(--app); position: sticky; top: 0; z-index: 200; }
.topbar .status-pill { margin-left: auto; }
.status-pill { border: 1px solid var(--border-light); border-radius: 999px; padding: 6px 10px; color: var(--muted); font-size: 12px; }
.status-pill.online { border-color: var(--success); color: var(--success); }
.data-loss-warning { margin: 16px clamp(16px, 3vw, 32px) 0; border-left: 2px solid var(--warning); padding: 8px 12px; color: var(--warning); font-size: 13px; line-height: 1.5; }
.content { width: min(1180px, 100%); padding: 24px clamp(16px, 3vw, 32px) 48px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 10px; }
.section-head:first-child { margin-top: 0; }
.section-head h2 { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card, .list { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.card { padding: 16px; }
.card p { color: var(--muted); line-height: 1.5; }
.card .value { margin: 12px 0 0; font-size: 32px; font-weight: 700; color: var(--text); }
.card .value small { color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-card { min-height: 148px; display: flex; align-items: end; justify-content: space-between; gap: 24px; color: var(--text); text-decoration: none; transition: border-color 150ms ease, background-color 150ms ease; }
.nav-card:hover { border-color: var(--primary); background: var(--surface-2); }
.nav-card > span { max-width: 45%; overflow: hidden; color: var(--primary); font-size: 24px; font-weight: 700; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.overview-grid .nav-card { min-height: 190px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.support-grid { grid-template-columns: minmax(320px, 1.1fr) minmax(280px, .9fr); align-items: start; }
.page-intro { max-width: 680px; margin: 0 0 24px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.list { overflow: hidden; }
.list-row { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; }
.list-row[href] { text-decoration: none; }
.list-row[href]:hover { background: var(--surface-2); }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { min-width: 0; flex: 1; }
.list-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.skeleton { height: 64px; border-bottom: 1px solid var(--border); background: var(--surface-2); opacity: .55; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.toggle { width: 51px; height: 31px; border: 0; border-radius: 16px; padding: 2px; background: var(--elevated); cursor: pointer; }
.toggle::after { content: ""; display: block; width: 27px; height: 27px; border-radius: 50%; background: var(--text); transition: transform 150ms ease; }
.toggle[aria-checked="true"] { background: var(--primary); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }
.command-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.command-grid .button { width: 100%; }
.command-stack, .section-stack { display: grid; gap: 16px; margin-top: 16px; }
.notice { border: 1px solid var(--warning); border-radius: 8px; padding: 12px; color: var(--warning); }
.back-link { display: inline-flex; margin-bottom: 20px; color: var(--primary); text-decoration: none; }
.detail-hero { margin-bottom: 16px; border-left: 2px solid var(--primary); padding: 18px 20px; background: var(--surface); }
.detail-hero h2 { margin: 6px 0 0; font-size: 24px; }
.boat-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.boat-hero .detail-actions { justify-content: end; margin-top: 0; }
.detail-list { display: grid; grid-template-columns: minmax(130px, .65fr) minmax(0, 1.35fr); gap: 0; margin: 0; }
.detail-list dt, .detail-list dd { margin: 0; border-bottom: 1px solid var(--border); padding: 10px 0; overflow-wrap: anywhere; }
.detail-list dt { padding-right: 16px; color: var(--hint); font-size: 12px; }
.detail-list dd { color: var(--text); text-align: right; }
.detail-list dt:nth-last-of-type(1), .detail-list dd:nth-last-of-type(1) { border-bottom: 0; }
.timeline { position: relative; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.timeline-row { position: relative; min-height: 72px; display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 16px; border-bottom: 1px solid var(--border); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-row p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.timeline-mark { width: 10px; height: 10px; margin-top: 4px; border: 2px solid var(--primary); border-radius: 50%; background: var(--surface); }
.segmented { display: flex; gap: 8px; margin: 16px 0; }
.danger-zone { border-color: var(--error); }
.profile-card { max-width: 680px; }
.sheet-backdrop, .nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; }
.sheet-backdrop { display: flex; align-items: end; justify-content: center; }
.sheet { width: min(560px, 100%); max-height: 90vh; overflow: auto; border: 1px solid var(--border-light); border-radius: 16px 16px 0 0; padding: 12px 20px 24px; background: var(--surface); animation: sheet-in 150ms ease-out; }
.sheet-handle { width: 44px; height: 4px; border-radius: 999px; margin: 0 auto 18px; background: var(--border-light); }
@keyframes sheet-in { from { transform: translateY(20px); opacity: 0; } }
.sheet .button-row { margin-top: 20px; }
.sheet .button-row .button { flex: 1; }
.mobile-only { display: none; }
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); width: min(320px, calc(100vw - 48px)); transition: transform 150ms ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-grid; place-items: center; }
  .grid, .two-column, .stats-grid, .support-grid { grid-template-columns: 1fr; }
  .nav-card, .overview-grid .nav-card { min-height: 132px; }
  .boat-hero { align-items: start; flex-direction: column; }
  .boat-hero .detail-actions { justify-content: start; }
  .nav-backdrop { display: block; z-index: 299; }
}
@media (prefers-color-scheme: light) {
  :root { color-scheme: light; --app:#f2f2f7; --surface:#ffffff; --surface-2:#f5f5f5; --elevated:#eeeeee; --text:#333333; --muted:#666666; --hint:#797979; --border:#e0e0e0; --border-light:#d0d0d0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
