:root {
  --pine: #14342c;
  --ink: #1c2b27;
  --muted: #5d6f69;
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.16);
  --clay: #b85c38;
  --line: rgba(20, 52, 44, 0.12);
  --card: rgba(255, 252, 247, 0.88);
  --shadow: 0 24px 60px rgba(20, 52, 44, 0.08);
  color-scheme: light;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.45;
  background-color: #e7f1ee;
  background-image:
    radial-gradient(900px 480px at 0% -10%, rgba(15, 118, 110, 0.28), transparent 58%),
    radial-gradient(720px 420px at 110% 0%, rgba(184, 92, 56, 0.18), transparent 52%),
    radial-gradient(860px 520px at 50% 120%, rgba(176, 214, 204, 0.72), transparent 60%),
    linear-gradient(165deg, #f4f7f4 0%, #e7f1ee 48%, #f6f0e6 100%);
  background-size: 140% 140%;
  animation: drift 32s ease-in-out infinite alternate;
}

body[data-location="conroe"] {
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.16);
  --slot-open: #e7f5f2;
}

body[data-location="new-caney"] {
  --accent: #1d4e89;
  --accent-soft: rgba(29, 78, 137, 0.14);
  --slot-open: #e7eef6;
}

body[data-location="spring"] {
  --accent: #b85c38;
  --accent-soft: rgba(184, 92, 56, 0.16);
  --slot-open: #f8eee8;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: rgba(15, 118, 110, 0.22);
}

/* ECG divider. Set display to block to show it again. */
.atmosphere {
  display: none;
  height: 36px;
  margin: 8px 0 2px;
  pointer-events: none;
  opacity: 0.55;
}

.ecg path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 160 520;
  animation: trace 7.5s linear infinite;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  flex: 1 1 280px;
}

.logo,
.tagline {
  width: 460px;
  max-width: 100%;
}

.logo {
  display: block;
  height: auto;
}

.tagline {
  text-align: center;
}

.mark {
  width: 64px;
  height: 64px;
  flex: none;
  filter: drop-shadow(0 10px 16px rgba(15, 118, 110, 0.25));
}

h1,
h2,
h3 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-weight: 560;
  letter-spacing: -0.03em;
  color: var(--pine);
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.15rem);
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
}

h3 {
  margin: 0;
  font-size: 1.7rem;
}

.eyebrow {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.tagline,
.summary,
.colophon,
.loc-meta,
.quiet {
  color: var(--muted);
}

.tagline,
.summary,
.colophon {
  margin: 4px 0 0;
}

.ghost,
.primary,
.danger,
.icon-button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.ghost,
.primary,
.danger {
  padding: 10px 16px;
  font-weight: 700;
}

.ghost:hover,
.danger:hover,
.icon-button:hover {
  background: white;
}

.primary {
  background: var(--accent);
  color: white;
  border-color: transparent;
  padding: 12px 18px;
}

.primary:hover {
  filter: brightness(1.08);
}

.primary:disabled,
.danger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

.danger {
  color: #8c3d22;
  border-color: rgba(184, 92, 56, 0.45);
  background: #fff6f1;
}

.icon-nav {
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
}

.staff-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--pine);
  color: #f4fbf8;
}

.staff-bar .ghost {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}

.identity {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 22px 0 18px;
}

.loc {
  background: #fffdf9;
  border: 1px solid rgba(20, 52, 44, 0.08);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(20, 52, 44, 0.05);
}

.name-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  font-weight: 700;
  color: #f7fbf9;
  background: #123f38;
  border: 2px solid #0f766e;
  border-radius: 20px;
  box-shadow: 0 16px 34px rgba(15, 118, 110, 0.24);
}

.name-field span {
  color: #f3d7c4;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.name-field .name-note {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.name-field input {
  background: #ffffff;
  color: #14342c;
  border: 2px solid #ffffff;
  border-radius: 14px;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 14px 16px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: white;
}

.locations {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.loc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 78px;
  padding: 14px 14px 14px 28px;
  text-align: left;
}

.loc::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 20px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--loc, var(--accent));
}

.loc-name {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  color: var(--pine);
}

.loc-meta {
  font-size: 0.92rem;
  font-weight: 600;
}

.loc[aria-pressed="true"] {
  background: white;
  border-color: var(--loc, var(--accent));
  box-shadow: 0 14px 32px rgba(20, 52, 44, 0.1);
}

.board {
  position: relative;
  margin-top: 132px;
  padding: 26px 18px 16px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(255, 252, 247, 0.78));
  border: 1px solid rgba(20, 52, 44, 0.06);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.bezel {
  position: absolute;
  left: 42px;
  right: 42px;
  top: -16px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #123f38 55%, var(--accent));
  box-shadow: 0 8px 16px rgba(20, 52, 44, 0.16);
}

.perch {
  position: absolute;
  left: 50%;
  bottom: -8px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  transform: translateX(-42%);
}

.bobble {
  width: 86px;
  flex: none;
}

.bobble-art {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.noggin {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: nod 1.7s ease-in-out infinite;
}

.scully .noggin {
  animation-duration: 2.15s;
  animation-delay: -0.85s;
}

.whisper {
  margin: 0 0 28px 8px;
  max-width: 9.5rem;
  color: rgba(47, 42, 36, 0.38);
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.02rem;
  font-weight: 560;
  line-height: 1.15;
}

.board-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.month-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dow,
.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.dow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.dow span:first-child,
.dow span:last-child {
  color: #8aa099;
}

.grid.enter {
  animation: rise 240ms ease;
}

.pad,
.day {
  min-height: 108px;
  border-radius: 16px;
}

.day {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 8px 10px;
  text-align: left;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.62);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.day:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: white;
}

.day.partial {
  background: linear-gradient(180deg, var(--accent-soft), rgba(255, 255, 255, 0.82));
}

.day.full {
  background: linear-gradient(180deg, var(--accent), #123f38);
  color: white;
}

.day.full .num,
.day.full .who,
.day.full .fraction,
.day.full .quiet {
  color: white;
}

.day.full .badge {
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.day.full.today {
  box-shadow: inset 0 0 0 2px #f4e2d4;
}

.day:disabled,
.day.closed {
  cursor: default;
  background: rgba(255, 255, 255, 0.28);
  color: #6d7f78;
}

.day.closed {
  cursor: pointer;
}

.day.waiting {
  border-color: #b85c38;
}

.wait {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8d3b32;
}

.day.full .wait {
  color: #f3d7c4;
}

.num {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--pine);
}

.who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 1.2em;
  overflow: hidden;
  font-size: 0.84rem;
  font-weight: 600;
}

.who span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 700;
}

.day-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

.pips {
  display: flex;
  gap: 4px;
}

.pip {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: rgba(20, 52, 44, 0.16);
}

.day.full .pip {
  background: rgba(255, 255, 255, 0.28);
}

.pip.on {
  background: var(--accent);
}

.day.full .pip.on {
  background: white;
}

.fraction {
  margin-left: auto;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-weight: 700;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-block;
}

.swatch.open {
  background: white;
  box-shadow: inset 0 0 0 1px var(--line);
}

.swatch.partial {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.swatch.full {
  background: var(--accent);
}

.swatch.shut {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px var(--line);
}

.colophon {
  font-size: 0.95rem;
}

.sheet {
  border: none;
  padding: 0;
  background: #fffdf9;
  color: inherit;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(20, 52, 44, 0.28);
}

.sheet::backdrop {
  background: rgba(16, 36, 32, 0.62);
}

.sheet[open] {
  animation: pop 200ms ease;
}

.sheet-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: #fffdf9;
  border-top: 6px solid var(--accent);
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
}

.slot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.slot-open {
  background: var(--slot-open, #e7f5f2);
}

.slot-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.slot-heading h4 {
  margin: 0;
  font-size: 1rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.slot-status {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.slot-name {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  color: var(--pine);
}

.day-banner {
  margin: 0;
  font-weight: 700;
}

.day-actions,
.row-actions,
.pending-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pending-list {
  flex-direction: column;
}

.pending-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(184, 92, 56, 0.1);
}

.pending-name {
  margin: 0;
  font-weight: 700;
  color: var(--pine);
}

.assign {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.assign input {
  flex: 1 1 160px;
  min-width: 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.hint,
.form-error {
  margin: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.95rem;
}

.form-error {
  color: #8c3d22;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  transform: translateX(-50%) translateY(12px);
  max-width: min(440px, calc(100% - 24px));
  margin: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--pine);
  color: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.noscript {
  display: block;
  width: min(720px, calc(100% - 32px));
  margin: 12px auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff4ec;
}

.load-error {
  grid-column: 1 / -1;
  margin: 12px 0;
  color: #8c3d22;
  font-weight: 700;
}

@keyframes drift {
  from { background-position: 0% 0%; }
  to { background-position: 80% 40%; }
}

@keyframes trace {
  to { stroke-dashoffset: -680; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes nod {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(9deg); }
}

@media (max-width: 720px) {
  .wrap {
    width: min(100% - 20px, 1080px);
    padding-top: 16px;
  }

  .locations {
    grid-template-columns: 1fr;
  }

  .board {
    margin-top: 108px;
    padding: 24px 10px 12px;
  }

  .bezel {
    left: 22px;
    right: 22px;
  }

  .perch {
    transform: translateX(-36%);
  }

  .bobble {
    width: 62px;
  }

  .whisper {
    margin-bottom: 18px;
    font-size: 0.82rem;
    max-width: 6.4rem;
  }

  .dow,
  .grid {
    gap: 4px;
  }

  .loc {
    min-height: 0;
    padding: 10px 12px 10px 28px;
  }

  .identity {
    margin: 12px 0;
  }

  .pad,
  .day {
    min-height: 64px;
    border-radius: 12px;
    padding: 6px;
  }

  .who {
    font-size: 0.68rem;
  }

  .who span:last-child {
    display: none;
  }

  .num {
    font-size: 0.95rem;
  }

  .dow {
    font-size: 0.66rem;
    letter-spacing: 0.04em;
  }

  .atmosphere {
    height: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
