:root {
  color-scheme:light;
  --ink:#183a48;
  --muted:#637a83;
  --teal:#176e7a;
  --teal-dark:#115862;
  --pale:#eaf4f3;
  --line:#dce7e9;
  --page:#f3f7f8;
  --white:#fff;
  --danger:#a33f3f;
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:15px;
  color:var(--ink);
  background:var(--page);
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

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

button,input {
  font:inherit;
}

button,a,summary {
  -webkit-tap-highlight-color:transparent;
}

button,summary {
  cursor:pointer;
}

button {
  color:inherit;
}

button:disabled {
  cursor:wait;
  opacity:.55;
}

a,button,summary {
  touch-action:manipulation;
}

svg {
  display:block;
}

.icon {
  width:18px;
  height:18px;
  flex-shrink:0;
}

h1,h2,h3,h4,p {
  margin:0;
}

a:focus-visible,button:focus-visible,summary:focus-visible,input:focus-visible {
  outline:3px solid #2593ac;
  outline-offset:4px;
}

::selection {
  background:#ceeae7;
}

.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;
}

.skip-link {
  position:fixed;
  top:-100px;
  left:16px;
  background:white;
  padding:12px;
  z-index:20;
}

.skip-link:focus {
  top:10px;
}

.app-header {
  max-width:1440px;
  margin:auto;
  min-height:100px;
  padding:22px 40px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}

.brand {
  display:flex;
  gap:13px;
  align-items:center;
}

.brand-icon {
  width:46px;
  height:46px;
  padding:6px;
  background:var(--teal);
  color:white;
  border-radius:14px;
  box-shadow:0 4px 9px #176e7a13;
}

.brand-icon svg {
  width:100%;
  height:100%;
}

.brand-name {
  display:block;
  font-size:20px;
  font-weight:730;
  letter-spacing:-.65px;
}

.brand-tagline {
  display:block;
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  letter-spacing:.2px;
}

.header-note {
  font-size:13px;
  color:var(--muted);
}

.page-shell {
  max-width:1440px;
  margin:0 auto;
  padding:40px 40px 24px;
}

.planner-intro {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:26px;
}

.eyebrow {
  font-size:10px;
  font-weight:750;
  letter-spacing:1.9px;
  color:var(--teal);
  margin-bottom:10px;
}

h1 {
  font-size:32px;
  line-height:1.2;
  letter-spacing:-1.1px;
  font-weight:720;
}

.intro-copy {
  color:var(--muted);
  margin-top:9px;
  font-size:14px;
}

.today-link {
  font-weight:650;
  font-size:13px;
  color:var(--teal);
  padding:12px 16px;
  min-height:44px;
  border:1px solid #cadde0;
  border-radius:9px;
  display:flex;
  align-items:center;
  gap:8px;
}

.today-link-mobile,.date-short {
  display:none;
}

.today-link:hover {
  background:var(--white);
}

.week-bar {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:40px;
  background:var(--white);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px 18px;
  box-shadow:0 3px 12px #183a4803;
  margin-bottom:28px;
}

.week-label {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  min-width:310px;
}

.week-label strong {
  font-size:16px;
  letter-spacing:-.3px;
}

.week-label>span {
  color:var(--muted);
  font-size:13px;
  padding-left:18px;
  border-left:1px solid var(--line);
}

.icon-button {
  min-width:44px;
  min-height:44px;
  border:none;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  font-size:22px;
  line-height:1;
  font-weight:600;
  list-style:none;
}

.icon-button:hover {
  background:var(--pale);
}

.icon-button::-webkit-details-marker {
  display:none;
}

.week-arrow {
  color:var(--teal);
  background:#f3f8f8;
}

.week-arrow .icon {
  width:22px;
  height:22px;
}

.day-tabs {
  display:none;
}

.days-grid {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:25px;
  align-items:start;
}

.training-day {
  min-width:0;
}

.day-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding:0 5px 18px;
  border-bottom:2px solid #d8e7e9;
  margin-bottom:23px;
}

.day-heading h2 {
  font-size:22px;
  letter-spacing:-.5px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
}

.day-weather {
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
  font-size:13px;
  font-weight:550;
  color:var(--muted);
}

.day-weather.unavailable {
  font-weight:450;
  color:#8a9ea4;
}

.weather-icon {
  width:20px;
  height:20px;
  color:var(--teal);
}

.today-badge {
  font-size:10px;
  padding:3px 7px;
  border-radius:4px;
  background:#dcefeb;
  color:#17645c;
}

.boat-group {
  position:relative;
  margin-bottom:25px;
}

.type-heading {
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  margin-bottom:9px;
  list-style:none;
}

.type-heading::-webkit-details-marker {
  display:none;
}

.type-heading h3 {
  font-size:13px;
  font-weight:700;
}

.capacity {
  font-size:10px;
  color:var(--muted);
  white-space:nowrap;
}

.type-badge,.type-stat,.type-chevron,.label-short {
  display:none;
}

.add-boat {
  color:var(--teal);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:44px;
  font-size:12px;
  font-weight:700;
  padding:0 10px;
  border-radius:8px;
}

.add-boat.add-boat-mobile {
  display:none;
}

.add-boat .icon {
  width:14px;
  height:14px;
}

.add-boat:hover {
  background:#dfeeed;
}

.empty-group {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 16px;
  border:1px dashed #cadbdf;
  border-radius:10px;
  background:#f8fbfb;
  font-size:12px;
  color:var(--muted);
}

.empty-dash {
  color:#a4bcc2;
}

.day-hint {
  font-size:12px;
  line-height:1.8;
  color:var(--muted);
  text-align:center;
  padding:5px 12px 20px;
}

.boat-card {
  background:var(--white);
  border:1px solid var(--line);
  border-radius:13px;
  box-shadow:0 3px 8px #123f5104;
  margin-bottom:12px;
}

.boat-card.collapsible {
  position:relative;
}

.boat-card.collapsible>.boat-menu {
  position:absolute;
  top:4px;
  right:8px;
  z-index:3;
}

.compact-single .single-row {
  display:flex;
  align-items:center;
  gap:8px;
  min-height:53px;
  padding:4px 8px 4px 16px;
}

.compact-single h4 {
  font-size:13px;
  font-weight:700;
  flex:0 0 auto;
  white-space:nowrap;
}

.compact-single .seat-name {
  flex:1;
}

.compact-single .free-seat {
  min-height:44px;
}

.boat-heading {
  display:flex;
  align-items:center;
  padding:4px 9px 4px 17px;
  border-bottom:1px solid #edf2f3;
  gap:8px;
  min-height:53px;
}

.boat-fold>.boat-heading {
  padding-right:52px;
  list-style:none;
  cursor:pointer;
}

.boat-fold>.boat-heading::-webkit-details-marker {
  display:none;
}

.fold-chevron {
  width:18px;
  height:18px;
  color:var(--muted);
}

.boat-fold[open]>.boat-heading {
  border-bottom:1px solid #edf2f3;
}

.boat-fold:not([open])>.boat-heading {
  border-bottom:0;
}

.boat-fold[open]>.boat-heading .fold-chevron {
  transform:rotate(90deg);
}

.boat-heading h4 {
  font-size:13px;
  font-weight:700;
  flex:1;
}

.occupancy {
  font-size:11px;
  letter-spacing:.3px;
  font-weight:650;
  color:var(--muted);
  padding:5px 8px;
  background:#eef3f4;
  border-radius:6px;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.occupancy.full {
  background:#e5f1ec;
  color:#32735d;
}

.overflow {
  position:relative;
  flex-shrink:0;
  z-index:2;
}

.overflow[open] {
  z-index:30;
}

.overflow>summary {
  color:var(--muted);
}

.overflow>summary .icon {
  width:18px;
  height:18px;
}

.overflow[open]>summary {
  background:var(--pale);
  color:var(--teal);
}

.menu {
  position:absolute;
  z-index:40;
  right:0;
  top:calc(100% + 4px);
  padding:5px;
  background:white;
  box-shadow:0 7px 24px #1d414a24;
  border:1px solid var(--line);
  border-radius:10px;
  min-width:166px;
}

.menu.anchored {
  position:fixed;
  left:auto;
}

.menu a,.menu button {
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 12px;
  border:0;
  background:none;
  text-align:left;
  width:100%;
  font-size:13px;
  font-weight:550;
  border-radius:6px;
}

.menu a:hover,.menu button:hover {
  background:var(--page);
}

.danger-text {
  color:var(--danger);
}

.rower-seats {
  padding:4px 9px 5px 16px;
}

.seat-row {
  display:flex;
  align-items:center;
  gap:10px;
  min-height:48px;
}

.seat-row+.seat-row {
  border-top:1px solid #edf2f3;
}

.seat-name {
  flex:1;
  min-width:0;
  overflow-wrap:anywhere;
  font-size:14px;
  font-weight:550;
  padding:9px 0;
  line-height:1.5;
}

.person-mark {
  width:16px;
  height:18px;
  color:#72969c;
}

.free-seat {
  display:flex;
  align-items:center;
  gap:10px;
  flex:1;
  min-height:48px;
  font-size:13px;
  color:var(--teal);
  border-radius:6px;
}

.free-seat:hover {
  background:#f1f8f7;
}

.seat-plus {
  width:16px;
  height:16px;
  color:#719ba2;
}

.seat-number {
  font-size:11px;
  color:#708891;
  width:15px;
  text-align:center;
  flex-shrink:0;
  font-variant-numeric:tabular-nums;
}

.coxswain {
  margin:2px 8px 8px;
  padding:12px 9px 0;
  background:#eef6f5;
  border:1px solid #e2edeb;
  border-radius:8px;
}

.coxswain-label {
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:1px;
  font-weight:700;
  color:var(--teal);
}

.coxswain-label span {
  float:right;
  font-size:10px;
  font-weight:400;
  letter-spacing:0;
  text-transform:none;
  color:var(--muted);
}

.app-footer {
  max-width:1440px;
  margin:0 auto;
  padding:8px 20px 30px;
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  color:var(--muted);
  font-size:11px;
}

dialog {
  border:0;
  border-radius:20px;
  padding:0;
  width:min(460px,calc(100% - 32px));
  max-height:calc(100dvh - 32px);
  color:var(--ink);
  box-shadow:0 24px 80px #13384433;
  overflow:auto;
}

dialog::backdrop {
  background:#16384166;
  backdrop-filter:blur(3px);
}

.dialog-close {
  position:absolute;
  right:12px;
  top:12px;
  color:var(--muted);
}

.dialog-close .icon {
  width:18px;
  height:18px;
}

.editor-body {
  padding:36px 30px 28px;
}

.editor-body .eyebrow {
  padding-right:20px;
  letter-spacing:1.1px;
}

.editor-body h2 {
  font-size:27px;
  letter-spacing:-.7px;
  margin:14px 0 10px;
}

.form-description {
  color:var(--muted);
  font-size:14px;
  line-height:1.7;
  margin-bottom:26px;
}

.editor-body label {
  display:block;
  font-size:13px;
  font-weight:650;
  margin-bottom:9px;
}

.editor-body input:not([type=hidden]) {
  width:100%;
  border:1px solid #b8cdd2;
  border-radius:9px;
  padding:13px 14px;
  font-size:16px;
  background:white;
  color:var(--ink);
  min-height:50px;
}

.editor-body input::placeholder {
  color:#82969c;
}

.editor-body input[aria-invalid] {
  border-color:var(--danger);
}

.form-actions {
  margin-top:22px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.primary-button {
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:9px;
  min-height:48px;
  padding:13px 20px;
  font-size:14px;
  font-weight:650;
  color:white;
  background:var(--teal);
  cursor:pointer;
}

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

.primary-button.destructive {
  background:var(--danger);
}

.primary-button.destructive:hover {
  background:#873535;
}

.cancel-link {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  font-size:13px;
  color:var(--muted);
  border-radius:8px;
}

.cancel-link:hover {
  background:var(--page);
}

.form-error {
  color:var(--danger);
  font-size:12px;
  line-height:1.6;
  margin-top:9px;
}

.standalone-form {
  max-width:460px;
  margin:20px auto;
  background:white;
  border:1px solid var(--line);
  border-radius:18px;
}

.toast {
  position:fixed;
  z-index:20;
  bottom:28px;
  left:50%;
  transform:translateX(-50%);
  padding:13px 21px;
  border-radius:10px;
  background:#214e48;
  color:white;
  font-size:13px;
  box-shadow:0 6px 22px #183a4826;
  max-width:calc(100% - 32px);
  width:max-content;
}

.toast.error {
  background:#873b3b;
}

.htmx-request {
  cursor:progress;
}

.htmx-request button[type=submit] {
  opacity:.55;
}

@media(min-width:1100px) {
  .days-grid:has(>.training-day:nth-child(4)) {
    grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  }
  .type-fold>.type-body {
    display:block !important;
  }
  .type-heading {
    pointer-events:none;
    cursor:default;
    padding-right:110px;
  }
  .add-boat-desktop {
    position:absolute;
    top:-4px;
    right:0;
  }
  .boat-fold>.boat-body {
    display:block !important;
  }
  .boat-fold .fold-chevron {
    display:none;
  }
  .boat-fold>.boat-heading {
    pointer-events:none;
    cursor:default;
    border-bottom:1px solid #edf2f3;
  }
}

@media(max-width:1099px) {
  .app-header {
    min-height:64px;
    padding:10px 20px;
  }
  .brand-icon {
    width:36px;
    height:36px;
    padding:5px;
    border-radius:11px;
  }
  .brand-name {
    font-size:17px;
  }
  .brand-tagline,.header-note,.planner-intro,.today-link-desktop,.date-full {
    display:none;
  }
  .date-short {
    display:inline;
  }
  .page-shell {
    padding:12px 18px 16px;
    max-width:780px;
  }
  .days-grid {
    display:block;
  }
  .training-day {
    display:none;
  }
  .training-day.is-selected {
    display:block;
  }
  .day-tabs {
    display:flex;
    gap:7px;
    background:#e7eff1;
    border:1px solid #dfe9eb;
    padding:4px;
    border-radius:13px;
    margin-bottom:10px;
    overflow-x:auto;
  }
  .day-tab {
    display:flex;
    flex:1;
    min-width:75px;
    align-items:center;
    justify-content:center;
    gap:4px;
    flex-direction:column;
    padding:8px 7px;
    border-radius:9px;
    color:var(--muted);
    font-size:12px;
    min-height:44px;
  }
  .day-tab strong {
    font-size:13px;
  }
  .day-tab.active {
    background:var(--teal);
    color:white;
    box-shadow:0 2px 5px #164d501a;
  }
  .tab-today {
    font-size:10px;
  }
  .week-bar {
    display:grid;
    grid-template-columns:44px minmax(0,1fr) 44px;
    gap:4px 8px;
    margin-bottom:8px;
    padding:6px 8px;
  }
  .week-label {
    min-width:0;
    gap:6px;
  }
  .today-link-mobile {
    display:flex;
    grid-column:1 / -1;
    justify-self:center;
    min-height:44px;
    padding:0 12px;
    border:0;
    font-size:12px;
    gap:6px;
  }
  .today-link-mobile .icon {
    width:15px;
    height:15px;
  }
  .day-heading {
    padding:0 2px 8px;
    margin-bottom:10px;
    border-bottom-width:1px;
  }
  .day-heading>div {
    display:flex;
    align-items:center;
    gap:10px;
    width:100%;
    min-width:0;
  }
  .day-heading h2 {
    font-size:14px;
    letter-spacing:0;
    flex:0 0 auto;
  }
  .day-weather {
    margin:0 0 0 auto;
    font-size:12px;
    gap:6px;
  }
  .weather-icon {
    width:16px;
    height:16px;
  }
  .today-badge {
    font-size:9px;
    padding:2px 6px;
  }
  .label-full,.add-boat-desktop,.capacity {
    display:none;
  }
  .label-short {
    display:inline;
  }
  .type-badge,.type-stat,.type-chevron {
    display:flex;
  }
  .add-boat.add-boat-mobile {
    display:flex;
  }
  .boat-group {
    margin-bottom:12px;
  }
  .type-fold {
    background:var(--white);
    border:1px solid var(--line);
    border-radius:16px;
    box-shadow:0 3px 8px #123f5104;
    overflow:visible;
  }
  .type-heading {
    gap:10px;
    min-height:54px;
    margin:0;
    padding:8px 14px;
    cursor:pointer;
    border-radius:16px;
  }
  .type-fold[open]>.type-heading {
    border-radius:16px 16px 0 0;
  }
  .type-badge {
    width:28px;
    height:28px;
    border-radius:8px;
    background:var(--pale);
    color:var(--teal);
    font-size:13px;
    font-weight:750;
    align-items:center;
    justify-content:center;
    font-variant-numeric:tabular-nums;
  }
  .type-heading h3 {
    font-size:16px;
    font-weight:720;
    min-width:2.4em;
  }
  .type-stat {
    margin-left:auto;
    align-items:center;
    font-size:12px;
    font-weight:550;
    color:var(--muted);
    white-space:nowrap;
  }
  .type-chevron {
    width:18px;
    height:18px;
    color:var(--muted);
    flex-shrink:0;
  }
  .type-fold[open]>.type-heading .type-chevron {
    transform:rotate(90deg);
  }
  .type-fold:not([open])>.type-heading {
    border-bottom:0;
  }
  .type-body {
    padding:4px 10px 12px;
    border-top:1px solid var(--line);
    overflow:visible;
    border-radius:0 0 16px 16px;
  }
  .type-body .boat-card:last-of-type {
    margin-bottom:8px;
  }
  .add-boat-mobile {
    width:100%;
    font-size:13px;
    padding:0 13px;
    background:#e5f0ef;
  }
  .add-boat {
    font-size:13px;
    padding:0 13px;
    background:#e5f0ef;
  }
  .boat-heading h4,.compact-single h4 {
    font-size:14px;
  }
  .boat-heading {
    min-height:55px;
  }
  .seat-row,.free-seat {
    min-height:51px;
  }
  .empty-group {
    padding:20px 17px;
    font-size:13px;
  }
  .day-hint {
    padding-top:5px;
  }
  .app-footer {
    padding-bottom:24px;
  }
}

@media(max-width:599px) {
  .app-header {
    min-height:56px;
    padding:8px 16px;
  }
  .brand-icon {
    width:32px;
    height:32px;
    padding:4px;
    border-radius:10px;
  }
  .brand-name {
    font-size:16px;
  }
  .page-shell {
    padding:10px 14px 14px;
  }
  .week-bar {
    padding:4px 6px;
    border-radius:12px;
  }
  .week-label {
    flex-direction:column;
    gap:2px;
  }
  .week-label strong {
    font-size:14px;
  }
  .week-label>span {
    font-size:11px;
    padding:0;
    border:0;
  }
  .week-arrow {
    background:transparent;
  }
  .day-tabs {
    margin-bottom:8px;
  }
  .boat-group {
    margin-bottom:8px;
  }
  .app-footer {
    font-size:10px;
    gap:7px;
  }
  dialog {
    margin:auto 0 0;
    width:100%;
    max-width:100%;
    max-height:calc(100dvh - 20px);
    border-radius:22px 22px 0 0;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .editor-body {
    padding:32px 24px 22px;
  }
  .editor-body h2 {
    font-size:25px;
  }
  .dialog-close {
    top:12px;
    right:13px;
  }
  .toast {
    bottom:calc(20px + env(safe-area-inset-bottom));
  }
  .standalone-form .editor-body {
    padding:28px 20px;
  }
}

@media(prefers-reduced-motion:no-preference) {
  a,button,summary {
    transition:background-color .15s,color .15s;
  }
  .fold-chevron,.type-chevron {
    transition:transform .15s;
  }
  dialog[open] {
    animation:appear .16s ease-out;
  }
  @keyframes appear {
    from {
      opacity:0;
      transform:translateY(8px);
    }
    to {
      opacity:1;
      transform:translateY(0);
    }
  }
}
