@font-face {
  font-family: 'Allo';
  src: url('/fonts/Allo-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Allo';
  src: url('/fonts/Allo-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Flap';
  src: url('/fonts/BarlowCondensed-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: block;
}

:root {
  color-scheme: light;
  --ground: #e9ecee;
  --surface: #ffffff;
  --surface-2: #f3f5f6;
  --ink: #121416;
  --ink-2: #444c53;
  --ink-3: #59626a;
  --line: #dde1e4;
  --line-strong: #7a838a;
  --board: #121314;
  --board-edge: #121314;
  --btn-dark-edge: #121314;
  --flap-top: #222426;
  --flap-bot: #1c1e20;
  --flap-ink: #f3efe6;
  --board-label: #a3a59f;
  --lit: #ffc629;
  --lit-hover: #ffd04f;
  --lit-edge: #b08600;
  --lit-ink: #1c1600;
  --hatch: rgba(255, 190, 20, 0.55);
  --danger: #b3261e;
  --focus: #121416;
  --shadow: 0 1px 2px rgba(18, 20, 22, 0.06), 0 6px 16px -8px rgba(18, 20, 22, 0.18);
  --radius: 12px;
  --radius-sm: 10px;
  --ui: 'Allo', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --flap: 'Flap', 'Arial Narrow', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --ground: #0d0e0f;
    --surface: #17191b;
    --surface-2: #1f2224;
    --ink: #f0f1f1;
    --ink-2: #bcc2c6;
    --ink-3: #959da3;
    --line: #2a2e31;
    --line-strong: #6b7379;
    --board-edge: #2b2e31;
    --btn-dark-edge: #6b7379;
    --lit-edge: #ffc629;
    --hatch: rgba(255, 198, 41, 0.28);
    --danger: #ff8a80;
    --focus: #ffc629;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px -10px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --ground: #0d0e0f;
  --surface: #17191b;
  --surface-2: #1f2224;
  --ink: #f0f1f1;
  --ink-2: #bcc2c6;
  --ink-3: #959da3;
  --line: #2a2e31;
  --line-strong: #6b7379;
  --board-edge: #2b2e31;
  --btn-dark-edge: #6b7379;
  --lit-edge: #ffc629;
  --hatch: rgba(255, 198, 41, 0.28);
  --danger: #ff8a80;
  --focus: #ffc629;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 20px -10px rgba(0, 0, 0, 0.7);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* Keyboard focus and scrollIntoView stop above the sticky save bar. */
  scroll-padding-bottom: 120px;
  scroll-padding-top: 12px;
  scrollbar-color: var(--line-strong) transparent;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  caret-color: var(--ink);
}

::selection {
  background: var(--lit);
  color: var(--lit-ink);
}

a {
  color: inherit;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

p {
  margin: 0;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  max-width: 34rem;
  margin: 0 auto;
  padding: 16px 16px calc(112px + env(safe-area-inset-bottom));
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- the board ---------- */

.board {
  background: var(--board);
  border: 1px solid var(--board-edge);
  border-radius: 14px;
  padding: 12px 12px 14px;
  display: grid;
  gap: 10px;
  box-shadow: var(--shadow);
}
.board :focus-visible {
  outline-color: var(--lit);
}

.board-label {
  display: block;
  font: 600 11px/1 var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--board-label);
  margin: 0 0 6px 1px;
}

.flaps {
  display: block;
  container-type: inline-size;
}

.cells {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 3px;
}

.cell {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: 3px;
  perspective: 260px;
  font-family: var(--flap);
  font-weight: 600;
  font-size: calc((100cqw - 42px) / 15 * 1.22);
  color: var(--flap-ink);
  font-variant-numeric: tabular-nums;
}
.cell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 0.5px);
  height: 1px;
  background: rgba(0, 0, 0, 0.7);
  z-index: 3;
}
.is-lit .cell {
  color: var(--lit);
}

.h {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
}
.h.top {
  top: 0;
  background: var(--flap-top);
  border-radius: 3px 3px 0 0;
}
.h.bot {
  bottom: 0;
  background: var(--flap-bot);
  border-radius: 0 0 3px 3px;
}
.g {
  position: absolute;
  left: 0;
  right: 0;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.top .g {
  top: 0;
}
.bot .g {
  bottom: 0;
}
.leaf {
  z-index: 2;
  backface-visibility: hidden;
  will-change: transform;
}
.leaf.top {
  transform-origin: 50% 100%;
}
.leaf.bot {
  transform-origin: 50% 0;
}

.board-note {
  margin: 10px 2px 0;
  font-size: 14px;
  color: var(--ink-2);
}

/* ---------- shared controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 600 15px/1.2 var(--ui);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, transform 0.1s ease-out;
  -webkit-user-select: none;
  user-select: none;
}
.btn:hover {
  border-color: var(--ink-3);
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: default;
  transform: none;
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn-primary {
  background: var(--lit);
  border-color: var(--lit-edge);
  color: var(--lit-ink);
}
.btn-primary:hover {
  background: var(--lit-hover);
  border-color: var(--lit-edge);
}
.btn-dark {
  background: var(--board);
  border-color: var(--btn-dark-edge);
  color: var(--flap-ink);
}
.btn-dark:hover {
  border-color: var(--btn-dark-edge);
  background: #2a2c2f;
}
.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
  padding: 0 10px;
}
.btn-quiet:hover {
  border-color: transparent;
  color: var(--ink);
  background: var(--surface-2);
}
.btn-danger {
  color: var(--danger);
}
.btn-block {
  width: 100%;
}
.btn.is-busy {
  pointer-events: none;
  opacity: 0.7;
}

.field {
  display: grid;
  gap: 6px;
}
.field + .field {
  margin-top: 16px;
}
.label {
  font: 600 14px/1.3 var(--ui);
  color: var(--ink);
}
.hint {
  font-size: 14px;
  color: var(--ink-3);
}
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 400 16px/1.2 var(--ui);
  accent-color: var(--lit-edge);
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
.input::placeholder {
  color: var(--ink-3);
}
.input:hover {
  border-color: var(--ink-3);
}
.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lit) 55%, transparent);
}
.input[aria-invalid='true'] {
  border-color: var(--danger);
}

.error {
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
}

/* segmented control: tabs and the date-range picker */
.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.seg button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: 600 15px/1.1 var(--ui);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.seg button:hover {
  color: var(--ink);
}
.seg button[aria-selected='true'],
.seg button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.seg .count {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--board);
  color: var(--flap-ink);
  font: 600 12px/20px var(--ui);
  font-variant-numeric: tabular-nums;
}

/* toggle chips: selection is board-black; yellow stays for "free" and the main action */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 600 15px/1 var(--ui);
  cursor: pointer;
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}
.chip:hover {
  border-color: var(--ink-3);
}
.chip[aria-pressed='true'] {
  background: var(--board);
  border-color: var(--board);
  color: var(--flap-ink);
}
.chips-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.chips-5 .chip {
  padding: 0 2px;
  font-size: 14px;
}
.chips-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.chips-4 .chip {
  padding: 0 4px;
  font-size: 14px;
}
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.weekdays .chip {
  padding: 0;
}

/* ---------- page structure ---------- */

.stack > * + * {
  margin-top: 24px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: 17px;
}
.section-head .meta {
  font-size: 14px;
  color: var(--ink-3);
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.panel.empty {
  margin-top: 16px;
}
.panel.empty h1 {
  font-size: 22px;
  margin-bottom: 8px;
}
.panel.empty p + p {
  margin-top: 16px;
}
.loading {
  margin-top: 24px;
  color: var(--ink-3);
}
.tabs {
  margin-top: 16px;
}
.banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--board);
  color: var(--flap-ink);
  display: grid;
  gap: 4px;
}
.banner strong {
  font-weight: 600;
}
.banner p {
  color: #c9c6bd;
  font-size: 15px;
}

/* ---------- your times ---------- */

.respond-intro {
  margin-top: 20px;
}
.quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 4px;
}
.quick p {
  font-size: 14px;
  color: var(--ink-2);
}
.quick-actions {
  display: flex;
  gap: 4px;
  flex: none;
}
.week-head {
  font: 600 13px/1 var(--ui);
  color: var(--ink-2);
  margin: 20px 2px 8px;
}
.days {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
}
.col-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  background: var(--ground);
  /* Match .days: 1px border + 10px padding on each side, so labels sit over their columns. */
  padding: 8px 11px 6px;
  margin: 12px 0 -12px;
}
.col-head .cols {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 6px;
}
.col-head span {
  font: 600 12px/1.1 var(--ui);
  color: var(--ink-2);
  text-align: center;
}
.day {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  align-items: center;
  min-height: 56px;
}
.day + .day {
  border-top: 1px solid var(--line);
}
.day-date {
  display: grid;
  gap: 1px;
}
.day-date .dow {
  font: 600 15px/1.2 var(--ui);
}
.day-date .dm {
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.day-slots {
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  gap: 6px;
  padding: 6px 0;
}
.slot {
  position: relative;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-3);
  font: 600 14px/1 var(--ui);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out, transform 0.1s ease-out;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.slot:hover {
  border-color: var(--ink-3);
}
.slot:active {
  transform: scale(0.97);
}
.slot svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.slot[data-state='y'] {
  background: var(--lit);
  border-color: var(--lit-edge);
  color: var(--lit-ink);
}
.slot[data-state='m'] {
  background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 8px), var(--surface);
  border-color: var(--lit-edge);
  border-style: dashed;
  color: var(--ink);
}
.slot[data-state='n'] svg {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}
.slot .others {
  position: absolute;
  top: 4px;
  right: 5px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font: 600 11px/1 var(--ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.slot .others svg,
.key-others svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.4;
}
.slot[data-state='y'] .others {
  color: rgba(28, 22, 0, 0.72);
}
.slot[data-state='m'] .others {
  color: var(--ink-2);
}
/* Multi-column cells are taller so the corner count never meets the centred glyph. */
.day-slots:not(.is-single) .slot {
  min-height: 52px;
}
.slot-key {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 2px 2px 0;
  font-size: 13px;
  color: var(--ink-3);
}
.slot-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-3);
}
.swatch svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.4;
}
.swatch.y {
  color: var(--lit-ink);
}
.swatch.m {
  color: var(--ink);
}
.key-others {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font: 600 11px/1 var(--ui);
  font-style: normal;
  color: var(--ink-3);
}
.swatch.y {
  background: var(--lit);
  border-color: var(--lit-edge);
}
.swatch.m {
  background: repeating-linear-gradient(135deg, var(--hatch) 0 2px, transparent 2px 5px), var(--surface);
  border-color: var(--lit-edge);
  border-style: dashed;
}

.savebar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.savebar-inner {
  max-width: 34rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.savebar-summary {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.3;
}
.savebar-summary strong {
  color: var(--ink);
  font-weight: 600;
}
.savebar .btn {
  flex: none;
  min-height: 48px;
}
.savebar .confirm {
  display: grid;
  gap: 10px;
  width: 100%;
}
.savebar .confirm-actions {
  display: flex;
  gap: 8px;
}
.savebar .confirm-actions .btn {
  flex: 1;
}

/* ---------- results ---------- */

.best {
  margin-top: 20px;
}
.best-slot {
  font: 600 26px/1.15 var(--ui);
  letter-spacing: -0.01em;
}
.best-meta {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 15px;
}
.best-warn {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}
.people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.person {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font: 600 14px/1 var(--ui);
  border: 1.5px solid var(--line-strong);
  color: var(--ink-2);
}
.person svg {
  width: 14px;
  height: 14px;
}
.person.y {
  background: var(--lit);
  border-color: var(--lit-edge);
  color: var(--lit-ink);
}
.person.m {
  background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 8px), var(--surface);
  border-color: var(--lit-edge);
  border-style: dashed;
  color: var(--ink);
}
.person.n {
  color: var(--ink-3);
  border-color: var(--line-strong);
}
.best-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.best-actions .btn {
  flex: 1 1 auto;
}

.lock-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
.lock-form .row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 10px;
}
.lock-form .field + .field {
  margin-top: 0;
}

.ranks {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.rank {
  border-top: 1px solid var(--line);
}
.rank:first-child {
  border-top: 0;
}
.rank > summary {
  list-style: none;
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  cursor: pointer;
}
.rank > summary::-webkit-details-marker {
  display: none;
}
.rank > summary:hover {
  background: var(--surface-2);
}
.rank-no {
  font: 600 17px/1 var(--flap);
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.rank-slot {
  font: 600 15px/1.25 var(--ui);
}
.rank-count {
  font: 600 14px/1 var(--ui);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.rank .bar {
  grid-column: 2 / 4;
}
.rank.is-cancelled .rank-slot {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: var(--ink-3);
}
.rank.is-cancelled .bar {
  opacity: 0.45;
}
.rank.is-on .rank-no {
  color: var(--ink);
}
.rank-body {
  padding: 0 14px 14px calc(14px + 1.75rem + 10px);
}
.rank-body .people {
  margin-top: 0;
}
.rank-body .btn {
  margin-top: 12px;
}
.bar {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--line);
}
.bar-y {
  background: var(--lit);
}
.bar-m {
  background: repeating-linear-gradient(135deg, var(--lit) 0 2px, transparent 2px 5px);
}

.more {
  margin-top: 12px;
}
.more > summary {
  cursor: pointer;
  font: 600 15px/1 var(--ui);
  color: var(--ink-2);
  min-height: 44px;
  padding: 10px 2px;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.more > summary::-webkit-details-marker {
  display: none;
}
.more > summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease-out;
}
.more[open] > summary svg {
  transform: rotate(90deg);
}

.who {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
}
.who-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 0;
}
.who-row + .who-row {
  border-top: 1px solid var(--line);
}
.who-name {
  flex: 1;
  min-width: 0;
}
.who-name strong {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.who-name .tag {
  margin-left: 0;
  margin-right: 4px;
}
.who-name strong > .tag:first-of-type {
  margin-left: 6px;
}
.who-name span {
  font-size: 13px;
  color: var(--ink-3);
}
.who-row .btn {
  min-height: 44px;
  padding: 0 10px;
  font-size: 14px;
}
.icon-btn {
  width: 44px;
  min-height: 44px;
  padding: 0;
}
.icon-btn[aria-pressed='true'] {
  background: var(--board);
  border-color: var(--board);
  color: var(--lit);
}
.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font: 600 11px/1.2 var(--ui);
  color: var(--ink-2);
  vertical-align: 1px;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.share-grid .wide {
  grid-column: 1 / -1;
}
.small-print {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-3);
}
.linkish {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* ---------- home ---------- */

.home-form {
  margin-top: 20px;
}
.home-form .group + .group {
  margin-top: 22px;
}
.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dates-custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.create {
  margin-top: 26px;
}
.create .btn {
  min-height: 52px;
  font-size: 16px;
}
.create .hint {
  margin-top: 10px;
  text-align: center;
}
.how {
  margin-top: 32px;
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
  counter-reset: how;
}
.how li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 15px;
  color: var(--ink-2);
  counter-increment: how;
}
.how li::before {
  content: counter(how);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--board);
  color: var(--flap-ink);
  font: 600 17px/1 var(--flap);
}
.how strong {
  color: var(--ink);
  font-weight: 600;
}
.mine {
  margin-top: 32px;
}
.mine-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 14px;
  margin: 0;
  list-style: none;
}
.mine-list li + li {
  border-top: 1px solid var(--line);
}
.mine-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  text-decoration: none;
}
.mine-list a span:first-child {
  font-weight: 600;
}
.mine-list .role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-3);
}
.mine-list .role svg {
  width: 16px;
  height: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 20;
  transform: translate(-50%, 8px);
  opacity: 0;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: var(--board);
  color: var(--flap-ink);
  font: 600 15px/1.3 var(--ui);
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease-out, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.footer {
  margin-top: 40px;
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
}

/* ---------- added in the UX pass ---------- */

.plan-head {
  margin: 14px 2px 0;
}
.plan-head h1 {
  font: 600 22px/1.2 var(--ui);
  overflow-wrap: anywhere;
}
.plan-head p {
  margin-top: 4px;
  font-size: 15px;
  color: var(--ink-2);
}
.banner .banner-actions {
  margin-top: 10px;
}
.banner .btn:not(.btn-primary) {
  border-color: transparent;
}
.panel.warn {
  margin-top: 16px;
  border-color: var(--lit-edge);
  display: grid;
  gap: 6px;
}
.panel.proxy {
  margin-top: 20px;
  display: grid;
  gap: 4px;
  justify-items: start;
}
.name-hint {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}
.name-hint .linkish {
  font-weight: 600;
  color: var(--ink);
}
.key-block {
  margin-left: auto;
  color: var(--ink-2);
  font-weight: 600;
}
.best-why {
  margin-top: 6px;
  font-size: 15px;
  color: var(--ink-2);
}

/* the calendar for one part of the day */
.cal {
  margin-top: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  display: grid;
  gap: 4px;
}
.cal-head,
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-head span {
  text-align: center;
  font: 600 12px/1 var(--ui);
  color: var(--ink-2);
  padding: 4px 0 2px;
}
.cal-head .is-weekend {
  color: var(--ink);
}
.cal-off {
  display: grid;
  place-items: start center;
  padding-top: 7px;
  min-height: 56px;
  border-radius: var(--radius-sm);
  font: 400 13px/1 var(--ui);
  color: var(--line-strong);
}
.cal-off.is-weekend {
  background: var(--surface-2);
}
.slot.slot-cal {
  min-height: 56px;
  min-width: 0;
  padding: 6px 2px 5px;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
}
.slot-cal.is-weekend[data-state='n'] {
  background: var(--surface-2);
}
.slot-cal .cal-day {
  align-self: flex-start;
  margin-left: 4px;
  font: 600 15px/1 var(--ui);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.slot-cal .cal-day small {
  font: 600 11px/1 var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.slot-cal[data-state='y'] .cal-day {
  color: var(--lit-ink);
}
.slot-cal.is-today .cal-day {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.slot-cal svg {
  width: 16px;
  height: 16px;
}
.slot-cal .others {
  top: 5px;
  right: 3px;
}
.slot-cal .others svg {
  width: 9px;
  height: 9px;
}

/* ranking rows */
.rank.no-rank > summary {
  grid-template-columns: 1fr auto;
}
.rank-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rank-count svg {
  width: 14px;
  height: 14px;
  color: var(--ink-3);
  transition: transform 0.2s ease-out;
}
.rank[open] .rank-count svg {
  transform: rotate(90deg);
}
.rank-maybe {
  color: var(--ink-3);
  font-weight: 400;
}
.who-foot {
  margin-top: 8px;
}
.who-foot .btn-quiet {
  padding-left: 4px;
}

/* the locked view */
.cal-actions {
  margin-top: 8px;
}
.rsvp {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.rsvp .btn {
  min-height: 52px;
  padding: 0 6px;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.rsvp .rsvp-y[aria-pressed='true'] {
  background: var(--lit);
  border-color: var(--lit-edge);
  color: var(--lit-ink);
}
.rsvp .rsvp-m[aria-pressed='true'] {
  background: repeating-linear-gradient(135deg, var(--hatch) 0 3px, transparent 3px 8px), var(--surface);
  border-color: var(--lit-edge);
  border-style: dashed;
}
.rsvp .rsvp-n[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--surface-2);
}
.locked .field {
  margin-top: 12px;
}

@media (min-width: 640px) {
  .wrap {
    padding-top: 32px;
  }
}

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

.when-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.when-summary > span {
  display: grid;
  gap: 2px;
}
.when-summary .hint {
  color: var(--ink-2);
}

.cal-caption {
  margin: 2px 4px 2px;
  font: 600 13px/1.2 var(--ui);
  color: var(--ink-2);
}
.slot-cal .cal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  align-self: stretch;
  padding: 0 4px 0 5px;
  min-height: 16px;
}
.slot-cal .cal-foot:only-child,
.slot-cal .cal-foot svg:only-child {
  margin: 0;
}
.slot-cal .others {
  position: static;
  font-size: 11px;
}
#panel.stack {
  margin-top: 20px;
}
.share-grid > :last-child:nth-child(2) {
  grid-column: 1 / -1;
}

.day-shortcut {
  min-height: 44px;
  margin-right: -10px;
}
.group-head:has(.day-shortcut) {
  align-items: center;
  margin-bottom: 4px;
}
.proxy-cancel {
  margin-left: -10px;
}
@media (max-width: 359px) {
  .weekdays {
    grid-template-columns: repeat(4, 1fr);
  }
}
