:root {
  color-scheme: light;
  --ink: #25143e;
  --primary: #930f54;
  --line: #e7d8e5;
  --paper: #fff9ed;
  --muted: #574963;
  --route: #087074;
  --meal: #8a420a;
  font: 16px/1.5 system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(165deg, #fff0cf, transparent 31rem),
    linear-gradient(345deg, #fce7ef, transparent 30rem), var(--paper);
  color: var(--ink);
}
.shell { max-width: 1160px; margin: auto; padding-inline: clamp(16px, 4vw, 42px); }
.toolbar, .row-actions { display: flex; align-items: center; gap: 12px; }

.hero {
  overflow: hidden;
  margin-top: 24px;
  background: #342237;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgb(70 34 60 / 14%);
}
.hero img { display: block; width: 100%; height: auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.toolbar { margin: 24px 0 20px; justify-content: space-between; flex-wrap: wrap; }
.switch { display: flex; gap: 3px; background: #f2dff4; padding: 4px; border-radius: 10px; }
.switch button { background: transparent; color: #4e2464; border-color: transparent; }
.switch button[aria-pressed=true] { color: #fff; background: #622680; border-color: #622680; }
button, select, input, textarea { font: inherit; border-radius: 8px; }
button { cursor: pointer; padding: 9px 13px; background: var(--primary); border: 1px solid var(--primary); color: white; font-weight: 750; font-size: .88rem; }
button:hover { filter: brightness(.9); }
button:disabled { opacity: .55; cursor: default; }
.plain, .secondary { background: white; color: var(--primary); border-color: #d9bfd3; }
:focus-visible { outline: 3px solid #137b80; outline-offset: 3px; }

.trip-picker { max-width: 25rem; }
.trip-picker label { color: #572471; text-transform: uppercase; letter-spacing: .08em; }
.trip-picker select { border-color: #c7a3cd; font-weight: 700; }
.card {
  background: #fffdfb;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(15px, 2.5vw, 24px);
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgb(70 34 60 / 6%);
}
.summary { margin-block: 12px 8px; }
.card h2 { line-height: 1.1; margin: 0 0 8px; font-size: 1.5rem; font-weight: 850; letter-spacing: -.04em; }
.trip-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 2.5vw, 24px);
  padding: 4px 0;
}
.trip-date, .trip-heading h2, .trip-profile { position: relative; isolation: isolate; }
.trip-date::before, .trip-heading h2::before, .trip-profile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  mask: url("brush-stroke.svg") center / 100% 100% no-repeat;
}
.trip-heading h2 {
  justify-self: start;
  margin: 0;
  color: #25143e;
  font-size: clamp(1.22rem, 3.5vw, 2.25rem);
  font-weight: 950;
  font-style: italic;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.trip-heading h2::before {
  inset: auto -.08em -.12em -.14em;
  height: .52em;
  background: linear-gradient(90deg, #ffd56a, #ffe8a2);
  transform: rotate(-2deg);
}
.trip-date {
  display: grid;
  min-width: 76px;
  padding: 10px 11px;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.05;
}
.trip-date::before {
  inset: -3px -2px;
  background: linear-gradient(145deg, #742398, #a51462);
  transform: rotate(-7deg);
}
.trip-date strong { font-size: 2.12rem; font-weight: 950; font-style: italic; }
.trip-date span { font-size: .67rem; letter-spacing: .05em; font-weight: 800; margin-top: 4px; }
.trip-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: #0c4949;
  text-align: right;
}
.trip-profile::before {
  inset: -1px -6px;
  background: linear-gradient(120deg, #c9efdc, #8bdcca);
  transform: rotate(-5deg) scaleX(-1);
}
.trip-profile .activity-icon { width: 36px; height: 36px; padding: 0; background: none; }
.trip-profile-type { display: block; font-size: .8rem; font-weight: 850; text-transform: uppercase; }
.trip-profile strong { display: block; font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.05; font-weight: 950; font-style: italic; white-space: nowrap; }
.trip-history { margin: 16px 0 0; color: var(--muted); font-size: .86rem; }
.summary-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 12px; margin-top: 14px; }
.count { padding: clamp(9px, 2vw, 16px); border-radius: 10px; border-top: 4px solid var(--activity); }
.count--route, .capacity--route { --activity: var(--route); background: #d9f4ee; }
.count--meal, .capacity--meal { --activity: var(--meal); background: #ffebba; }
.count--event, .capacity--event { --activity: #602a80; background: #f1e3f9; }
.count-heading { display: flex; align-items: center; gap: 4px 10px; flex-wrap: wrap; }
.activity-title { display: inline-flex; align-items: center; gap: 6px; color: var(--activity); }
.activity-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 4px;
  background: rgb(255 255 255 / 65%);
  border-radius: 7px;
}
.activity-label { text-transform: uppercase; letter-spacing: .075em; font-size: .77rem; font-weight: 850; }
.count strong { display: block; font-size: clamp(1rem, 2.2vw, 1.4rem); line-height: 1.2; margin: 6px 0 4px; }
.count small { display: block; color: #473951; }
.muted, .aside-note, small, footer { color: var(--muted); }
.aside-note, small { font-size: .83rem; }
.aside-note { margin: 0 0 17px; padding: 7px 11px; border-left: 3px solid #d59b26; background: #fff2d5; border-radius: 0 6px 6px 0; }

#workspace > .card:first-child { border-top: 4px solid #b22573; }
#workspace > .card + .card { border-top: 4px solid var(--route); }
.rosters { display: grid; grid-template-columns: 1fr; gap: 12px; }
.roster-hint { grid-column: 1 / -1; font-size: .82rem; margin: -5px 0 0; }
.roster-legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 15px;
  color: var(--muted);
  font-size: .82rem;
  margin: 0 0 3px;
}
.roster-legend > span, .roster-entry { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.roster-badge {
  display: inline-flex;
  vertical-align: middle;
  color: #0c4949;
  background: #d9f4ee;
  border-radius: 6px;
}
.roster-badge--meal { color: var(--meal); background: #ffebba; }
.roster-badge--event { color: #602a80; background: #f1e3f9; }
.roster-badge--member { color: #72410b; background: #ffe49c; }
.roster-badge--member svg { fill: currentColor; }
.roster-badge--paid { color: #1f5c3b; background: #dff3df; }
.roster-badge .activity-icon { width: 24px; height: 24px; padding: 4px; background: none; }
.roster { border-top: 4px solid var(--roster-color, var(--route)); }
.roster--meal { --roster-color: var(--meal); }
.roster--event { --roster-color: #602a80; }
.roster h2 { display: flex; align-items: center; gap: 8px; }
.roster h2 svg { color: var(--roster-color, var(--route)); }
.roster h3 { font-size: .95rem; margin: 8px 0; }
.roster-group + .roster-group { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 5px; }
.roster-count { padding: 3px 7px; border-radius: 6px; background: #d9f4ee; color: #0c4949; font-size: .85rem; letter-spacing: 0; }
.roster-group--waiting .roster-count { background: #ffebba; color: var(--meal); }
.roster ol { margin: 0; padding: 0 8px 0 2rem; }
.roster li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.roster li:last-child { border-bottom: 0; }
.roster li::marker { font-size: .85rem; color: var(--muted); }
.roster-name { font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }

label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: 5px; }
input, select, textarea { width: 100%; border: 1px solid #d8c7d8; padding: 9px; background: white; color: var(--ink); }
input:disabled { background: #f6f2f5; }
input[type=checkbox] { width: auto; accent-color: var(--primary); }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: 8px; background: #fbf3fb; }
legend { font-size: .88rem; font-weight: 750; }
.capacity { padding: 10px; border-left: 3px solid var(--activity); border-radius: 8px; }
.capacity input + label { margin-block: 5px 0; }
form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 15px; }
form .wide { grid-column: 1 / -1; }
form button { justify-self: start; }
.row { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 5px; }
.row:first-of-type { margin-top: 15px; }
.row:last-child { padding-bottom: 0; }
.row-head { display: flex; justify-content: space-between; align-items: start; gap: 6px; flex-wrap: wrap; }
.row-actions { flex-wrap: wrap; gap: 6px; }
.reservation-editor {
  margin-top: 4px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff9fd;
}
.reservation-editor summary { width: fit-content; cursor: pointer; color: var(--primary); font-weight: 750; font-size: .86rem; }
.reservation-editor label input, .reservation-editor label select, #signup-menu-field select { display: block; margin-top: 4px; }
.tag { font-size: .72rem; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: #f0e4f8; }
.tag.hold, .tag.waiting, .tag.cancel { background: #fff0ca; color: #654909; }
.tag.cancelled, .tag.rejected { background: #f1edf3; color: #51475d; }
.tag.confirmed { background: #daf2e8; color: #24533c; }
#notice:not(:empty) { padding: 10px 14px; margin: -8px 0 15px; background: #f9e3f3; border-radius: 8px; }
footer { font-size: .8rem; padding-block: 18px 24px; }
p { margin: 0 0 8px; }
[hidden] { display: none !important; }

@media (max-width: 680px) {
  .hero { border-radius: 10px; margin-top: 16px; }
  .toolbar { gap: 8px; }
}
@media (max-width: 620px) {
  .trip-heading { grid-template-columns: auto minmax(0, 1fr); }
  .trip-profile { grid-column: 1 / -1; justify-self: end; }
  .rosters { grid-template-columns: 1fr; gap: 0; }
  .roster-legend { margin-bottom: 8px; }
  .roster-hint { margin-bottom: 10px; }
}
@media (max-width: 390px) {
  form { grid-template-columns: 1fr; }
  .summary-counts { gap: 8px; }
}

.roster--unified .roster-hint { margin: 10px 0; }
.roster--unified .roster-entry { display: flex; width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 10px; }
.roster--unified .roster-name { min-width: 0; }
.roster-marks { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }
.roster--unified .roster-marks { max-width: 140px; justify-content: flex-end; }
