/* --- tokens --- */
:root {
  color-scheme: light dark;
  --cream: #FFF6E5;
  --white: #FFFFFF;
  --ink: #2B1B10;
  --muted: #6B5646;
  --orange: #FF8A3D;
  --orange-deep: #B8480B;
  --line: #2B1B10;
  --yes: #1F7A3E;
  --maybe: #8A5A00;
  --no: #B3261E;

  --slot-0: #FFD9C2;
  --slot-1: #CDEFD8;
  --slot-2: #E0D7FA;
  --slot-3: #CFE8FB;
  --slot-4: #FFF0B3;
  --slot-5: #FFD3DC;
  --slot-6: #E3F3B8;
  --slot-7: #C5F0EE;

  --vote-yes: var(--slot-1);
  --vote-maybe: var(--slot-4);
  --vote-no: var(--slot-5);
  --vote-yes-on: #9EDDB3;
  --vote-maybe-on: #FFDC66;
  --vote-no-on: #FFA9B8;

  --on-orange: #2B1B10;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --surface-dim: rgba(0, 0, 0, 0.08);

  --font-heading: 'Fredoka', 'Baloo 2', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  --font-body: system-ui, sans-serif;

  --border-width: 2px;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-pill: 9999px;
  --shadow: 4px 4px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
}

/* --- dark theme: follows the OS. Contrast of these tokens is computed in tests/timewise-static.test.mjs.
   Keep this block to plain "--token: #hex;" lines so the test can parse it. The print block at the end
   of this file re-asserts the light tokens, because the cards and the review view are paper. --- */
@media (prefers-color-scheme: dark) {
  :root {
    --cream: #1C1510;
    --white: #281E17;
    --ink: #FFF6E5;
    --muted: #C9B3A3;
    --orange: #FF8A3D;
    --orange-deep: #FFB078;
    --line: #FFF6E5;
    --yes: #5CD682;
    --maybe: #F7C948;
    --no: #FF8A82;

    --slot-0: #4A2B1D;
    --slot-1: #1E3F2B;
    --slot-2: #31274B;
    --slot-3: #1E364A;
    --slot-4: #473A18;
    --slot-5: #4A222B;
    --slot-6: #303F1B;
    --slot-7: #1B3E3D;

    --vote-yes-on: #1B4A2E;
    --vote-maybe-on: #665117;
    --vote-no-on: #561F2B;

    --on-orange: #1C1510;
    --surface-glass: rgba(28, 21, 16, 0.82);
    --surface-dim: rgba(255, 246, 229, 0.12);
  }
}

/* --- base --- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(255, 138, 61, 0.2) 2px, transparent 2px);
  background-size: 24px 24px;
  background-position: 0 0;
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  margin: 0 0 1rem;
  color: var(--ink);
  line-height: 1.2;
}

#tw-root {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

*:focus-visible {
  outline: 3px solid var(--orange-deep);
  outline-offset: 2px;
}

/* --- buttons --- */
.tw-btn, button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  background-color: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
  user-select: none;
}

.tw-btn:active, button:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.tw-btn:disabled, button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--shadow);
}

.tw-btn--primary {
  background-color: var(--orange);
  color: var(--on-orange);
}

.tw-btn--secondary {
  background-color: var(--white);
  color: var(--ink);
}

.tw-btn--remove {
  background-color: var(--white);
  color: var(--no);
  border-radius: var(--radius-sm);
}

.tw-btn--deep {
  background-color: var(--orange-deep);
  color: var(--white);
}

/* --- forms --- */
.tw-field {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.tw-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.tw-input {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-body);
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  background: var(--white);
  color: var(--ink);
  width: 100%;
  appearance: none;
}

.tw-input::placeholder {
  color: var(--muted);
}

.tw-error {
  color: var(--no);
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 1.25rem;
}

/* --- home --- */
.tw-home {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: center;
  text-align: center;
  margin-top: 2rem;
}

.tw-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.tw-mark {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 1rem;
}

.tw-mark-ball {
  position: absolute;
  top: 15px;
  left: 20px;
  width: 45px;
  height: 45px;
  background-color: var(--orange);
  border: var(--border-width) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.tw-mark-fence {
  position: absolute;
  bottom: 15px;
  left: 10px;
  right: 10px;
  height: 60px;
  background-color: var(--slot-3);
  background-image: repeating-linear-gradient(90deg, transparent, transparent 10px, var(--ink) 10px, var(--ink) 14px);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1;
}

.tw-wordmark {
  font-size: 3.5rem;
  margin: 0;
  color: var(--orange-deep);
  text-shadow: 2px 2px 0 var(--white), 4px 4px 0 var(--ink);
  letter-spacing: -0.02em;
}

.tw-tagline {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 320px;
  margin: 0;
}

.tw-actions {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 320px;
}

.tw-join-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 2rem;
  border-top: 2px dashed var(--muted);
}

.tw-join-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.tw-join-char {
  width: 3.5rem;
  min-width: 0;
  flex: 0 1 3.5rem;
  height: 4.5rem;
  font-size: 2.25rem;
  text-align: center;
  text-transform: uppercase;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  background: var(--white);
  padding: 0;
}

.tw-recent {
  width: 100%;
  max-width: 320px;
  text-align: left;
}

.tw-recent-title {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.tw-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-recent-item {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 44px;
}
.tw-recent-item:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

/* --- create --- */
.tw-create {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.tw-create-header {
  font-size: 2.25rem;
  margin-bottom: 2rem;
}

.tw-invitees {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.25rem 0.75rem;
  background: var(--slot-4);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
}

.tw-chip-remove {
  width: 44px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  border: var(--border-width) solid var(--ink);
  background: var(--white);
  color: var(--no);
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 1px 1px 0 var(--ink);
  transition: transform 0.1s, box-shadow 0.1s;
}
.tw-chip-remove:active {
  transform: translate(1px, 1px);
  box-shadow: 0 0 0 var(--ink);
}

.tw-invitee-add {
  display: flex;
  gap: 0.5rem;
}

.tw-slotrow-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.tw-slotrow {
  background: var(--cream);
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-slotrow-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tw-input--date, .tw-input--time {
  flex: 1;
  min-width: 140px;
}

.tw-duration-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.tw-duration-chip {
  background: var(--white);
  color: var(--ink);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: none;
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.tw-duration-chip--active {
  background: var(--ink);
  color: var(--white);
}

/* --- room mode + coverage fields (create) --- */
/* Meeting and Coverage are two stand-alone pill buttons, not one joined control. */
.tw-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
  max-width: 28rem;
  border: 0;
  background: none;
  border-radius: 0;
  overflow: visible;
}

.tw-mode-btn {
  flex: 1 1 9rem;
  min-height: 48px;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.tw-mode-btn--active {
  background: var(--orange);
  color: var(--on-orange);
  box-shadow: var(--shadow-sm);
  transform: translate(2px, 2px);
}

.tw-mode-btn--active::before {
  content: '\2713\00a0';
}

.tw-mode-hint {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.tw-need-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.tw-need-field {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.tw-need-input {
  width: 5rem;
  min-height: 44px;
  padding: 0.25rem 0.5rem;
  font-weight: 700;
}

.tw-dayonly-chip {
  min-height: 44px;
  padding: 0.25rem 0.75rem;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.tw-dayonly-chip--active {
  background: var(--ink);
  color: var(--white);
}

.tw-summary {
  font-size: 1rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

/* --- join --- */
.tw-join {
  max-width: 440px;
  width: 100%;
  margin: 3rem auto;
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.tw-join-header {
  margin-bottom: 2rem;
}

.tw-join-title {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.tw-join-code {
  font-size: 2.75rem;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--orange-deep);
  background: var(--cream);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--orange);
  display: inline-block;
}

.tw-seat-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.tw-seat-btn {
  width: 100%;
  font-size: 1.1rem;
  background: var(--slot-3);
  border-radius: var(--radius-sm);
  border: var(--border-width) solid var(--ink);
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, box-shadow 0.1s;
  min-height: 44px;
}
.tw-seat-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.tw-divider {
  position: relative;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  margin: 1.5rem 0;
}

.tw-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 2px dashed var(--muted);
  z-index: 1;
}

.tw-divider::after {
  content: 'or';
  background: var(--white);
  display: inline-block;
  padding: 0 1rem;
  position: relative;
  z-index: 2;
}

.tw-join-input-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tw-join-input-wrap .tw-input {
  flex: 1;
  min-width: 180px;
}

.tw-already-here {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 600;
}

.tw-full-msg {
  color: var(--no);
  font-weight: 700;
  font-size: 1.25rem;
  padding: 1rem;
  background: var(--slot-5);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
}

/* --- room --- */
.tw-room {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.tw-room-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.tw-room-title {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.tw-room-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.tw-room-code {
  font-size: 2.5rem;
  letter-spacing: 0.1em;
  margin: 0;
  background: var(--white);
  padding: 0.25rem 1.25rem;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.tw-btn-copy {
  min-height: 44px;
  font-size: 0.95rem;
}

.tw-room-rally {
  font-size: 1rem;
  font-weight: 700;
  color: var(--orange-deep);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tw-room-zone {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
  margin-top: 0.25rem;
}

.tw-room-kind {
  align-self: flex-start;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--cream);
  color: var(--ink);
}

.tw-leave-link {
  align-self: flex-start;
  min-height: 44px;
}

/* --- slots --- */
.tw-lob-composer {
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.tw-lob-toggle {
  width: 100%;
  font-size: 1.1rem;
}

.tw-lob-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tw-lob-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.tw-slots {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tw-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--white);
  border: 2px dashed var(--muted);
  border-radius: var(--radius);
}

.tw-slot-card {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.2s, filter 0.2s;
  background: var(--white);
  container-type: inline-size;
}

.tw-slot-color-0 { background-color: var(--slot-0); }
.tw-slot-color-1 { background-color: var(--slot-1); }
.tw-slot-color-2 { background-color: var(--slot-2); }
.tw-slot-color-3 { background-color: var(--slot-3); }
.tw-slot-color-4 { background-color: var(--slot-4); }
.tw-slot-color-5 { background-color: var(--slot-5); }
.tw-slot-color-6 { background-color: var(--slot-6); }
.tw-slot-color-7 { background-color: var(--slot-7); }

.tw-slot-card:has(.tw-slot-ribbon--vetoed) {
  opacity: 0.85;
  filter: saturate(0.5);
}

.tw-slot-best-bet {
  position: absolute;
  top: -16px;
  right: 16px;
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  z-index: 2;
  transform: rotate(3deg);
  color: var(--ink);
}

.tw-slot-ribbon {
  align-self: flex-start;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  border: var(--border-width) solid var(--ink);
  background: var(--white);
}

.tw-slot-ribbon--perfect { color: var(--yes); background: var(--white); }
.tw-slot-ribbon--wiggle { color: var(--maybe); background: var(--white); }
.tw-slot-ribbon--vetoed { color: var(--no); background: var(--white); }
.tw-slot-ribbon--pending { background: var(--cream); color: var(--ink); }

.tw-coverage-meter {
  align-self: flex-start;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
}

.tw-coverage-meter--met {
  border-color: var(--yes);
  color: var(--yes);
}

.tw-coverage-meter--short {
  border-color: var(--no);
  color: var(--no);
}

.tw-slot-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.tw-slot-date {
  font-size: 1.25rem;
  font-weight: 700;
}

.tw-slot-time-range {
  font-size: 1.25rem;
  font-weight: 700;
}

.tw-slot-dur {
  background: var(--surface-dim);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 700;
}

.tw-slot-hint {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  margin-left: auto;
}

.tw-slot-meta {
  font-size: 0.95rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw-slot-creator {
  font-weight: 600;
  /* shrinkable, so a long "countering ..." line wraps inside itself instead of pushing Delete onto its own row */
  flex: 1 1 10rem;
  min-width: 0;
}

.tw-slot-delete {
  flex: none;
  margin-left: auto;
  min-height: 44px;
  padding: 0.1rem 0.75rem;
  font-size: 0.85rem;
}

.tw-slot-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.tw-slot-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: var(--border-width) solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--white);
  box-shadow: 1px 1px 0 var(--ink);
}

.tw-slot-avatar--yes { background: var(--yes); color: var(--white); }
.tw-slot-avatar--maybe { background: var(--maybe); color: var(--white); }
.tw-slot-avatar--no { background: var(--no); color: var(--white); }
.tw-slot-avatar--none { background: var(--white); color: var(--ink); }
.tw-slot-avatar--unclaimed {
  background: transparent;
  border: 2px dashed var(--muted);
  color: var(--muted);
  box-shadow: none;
}

.tw-slot-avatar--priority {
  box-shadow: 0 0 0 3px var(--orange), var(--shadow-sm);
}

.tw-slot-nudge {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--orange-deep);
  background: var(--surface-glass);
  border: 2px dashed var(--orange-deep);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

/* Vote row: three equal columns, secondary row (Priority / Clear) beneath.
   No fixed heights or widths and no overflow clipping, so big text wraps
   instead of being cut. The em media query below scales with the user's
   text-size setting and drops to one column before a label can clip. */
.tw-vote-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tw-vote-btn {
  min-width: 0;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 0.4rem;
  font-size: clamp(0.8rem, 0.72rem + 0.35vw, 0.95rem);
  font-weight: 700;
  font-family: var(--font-body);
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
  color: var(--ink);
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.tw-vote-btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.tw-vote-btn::before {
  display: inline-block;
  font-size: 1.25rem;
  line-height: 1;
  margin: 0;
}

.tw-vote-yes { background: var(--vote-yes); }
.tw-vote-yes::before { content: '👍'; }
.tw-vote-yes[aria-pressed="true"] { background: var(--vote-yes-on); border-width: 4px; padding: calc(0.5rem - 2px) calc(0.4rem - 2px); }
.tw-vote-yes[aria-pressed="true"]::before { content: '✓ 👍'; color: var(--ink); font-weight: 900; }

.tw-vote-maybe { background: var(--vote-maybe); }
.tw-vote-maybe::before { content: '🤔'; }
.tw-vote-maybe[aria-pressed="true"] { background: var(--vote-maybe-on); border-width: 4px; padding: calc(0.5rem - 2px) calc(0.4rem - 2px); }
.tw-vote-maybe[aria-pressed="true"]::before { content: '✓ 🤔'; color: var(--ink); font-weight: 900; }

.tw-vote-no { background: var(--vote-no); }
.tw-vote-no::before { content: '🙅'; }
.tw-vote-no[aria-pressed="true"] { background: var(--vote-no-on); border-width: 4px; padding: calc(0.5rem - 2px) calc(0.4rem - 2px); }
.tw-vote-no[aria-pressed="true"]::before { content: '✓ 🙅'; color: var(--ink); font-weight: 900; }

.tw-vote-priority,
.tw-vote-clear {
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.25rem 0.5rem;
  font-size: 0.9rem;
}

@media (max-width: 22.5em) {
  .tw-vote-controls { grid-template-columns: 1fr; }
  .tw-vote-btn { flex-direction: row; gap: 0.5rem; min-height: 48px; }
  .tw-vote-priority,
  .tw-vote-clear { grid-row: auto; }
}

/* The same collapse keyed to the card's own width. em in a container query follows the root font size, so a text
   size set in the page (or the browser) raises the 3-column threshold in real pixels, like the media query does for
   the browser setting. 18em: three columns need about 90px each at the default size. */
@container (max-width: 18em) {
  .tw-vote-controls { grid-template-columns: 1fr; }
  .tw-vote-btn { flex-direction: row; gap: 0.5rem; min-height: 48px; }
  .tw-vote-priority,
  .tw-vote-clear { grid-row: auto; }
}

.tw-vote-priority--active {
  background: var(--orange);
  color: var(--on-orange);
  border-width: 4px;
}

.tw-note-form {
  margin-top: 0.75rem;
  background: var(--surface-glass);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw-note-chip {
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.tw-note-chip:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.tw-note-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tw-note-wrap .tw-note-inp {
  flex: 1;
  min-width: 200px;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: var(--font-body);
  min-height: 44px;
  box-shadow: var(--shadow-sm);
  background: var(--white);
  color: var(--ink);
  appearance: none;
}

.tw-move-toggle {
  align-self: flex-start;
  margin-top: 0.75rem;
}

.tw-move-form {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px dashed var(--ink);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tw-move-title {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tw-move-hint {
  font-size: 0.9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tw-move-tweaks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw-move-tweak-btn {
  font-size: 0.9rem;
  padding: 0.25rem 0.75rem;
  min-height: 44px;
}

.tw-move-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.tw-reconfirm-ring {
  box-shadow: 0 0 0 3px var(--vote-maybe-on), var(--shadow-sm);
}

.tw-reconfirm-ribbon {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--orange-deep);
  background: var(--surface-glass);
  border: 2px dashed var(--orange-deep);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  overflow-wrap: anywhere;
}

.tw-lock-btn {
  margin-top: 1.5rem;
  width: 100%;
  font-size: 1.25rem;
  padding: 0.75rem;
}

/* --- people --- */
.tw-strip {
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tw-strip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tw-strip-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cream);
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border-radius: var(--radius-pill);
  border: var(--border-width) solid var(--ink);
}

.tw-strip-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  border: var(--border-width) solid var(--ink);
}

.tw-strip-avatar--claimed {
  background: var(--orange);
  color: var(--on-orange);
}

.tw-strip-avatar--unclaimed {
  background: transparent;
  border: 2px dashed var(--muted);
  color: var(--muted);
}

.tw-strip-name {
  font-weight: 700;
  font-size: 0.95rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tw-strip-ping, .tw-strip-remove {
  min-height: 44px;
  padding: 0.1rem 0.75rem;
  font-size: 0.85rem;
  margin-left: 0.25rem;
}

.tw-strip-add-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tw-strip-add-inp {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.75rem;
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-body);
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

/* --- log --- */
.tw-log {
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.tw-log-toggle {
  width: 100%;
}

.tw-log-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.tw-log-item {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem;
  background: var(--cream);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--orange);
  border-top: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

/* --- ticket --- */
.tw-locked-ticket {
  background: var(--white) !important;
  border: 4px solid var(--orange-deep);
  box-shadow: 8px 8px 0 var(--orange-deep);
  transform: scale(1.02);
  z-index: 10;
  position: relative;
}

.tw-locked-title {
  text-align: center;
  font-size: 2.25rem;
  color: var(--orange-deep);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 2px 2px 0 var(--white);
}

.tw-locked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

/* --- toast --- */
#tw-toast {
  position: fixed;
  bottom: env(safe-area-inset-bottom, 20px);
  left: 50%;
  transform: translate(-50%, 150%);
  background: var(--ink);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 20px;
  white-space: nowrap;
}

#tw-toast:not(:empty) {
  transform: translate(-50%, 0);
}

/* --- motion --- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes tw-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
  }
  .tw-shake { animation: tw-shake 0.4s ease-in-out; }

  @keyframes tw-lob {
    0% { transform: translateY(40px) scale(0.95); opacity: 0; }
    60% { transform: translateY(-10px) scale(1.02); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
  }
  .tw-lob { animation: tw-lob 0.5s cubic-bezier(0.25, 1, 0.5, 1); }

  @keyframes tw-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.1) translateY(-4px); }
    100% { transform: scale(1); }
  }
  .tw-vote-yes[aria-pressed="true"] { animation: tw-pop 0.3s ease; }

  @keyframes tw-wiggle {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
  }
  .tw-vote-maybe[aria-pressed="true"] { animation: tw-wiggle 0.3s ease; }
  
  .tw-vote-no[aria-pressed="true"] { animation: tw-shake 0.4s ease; }

  @keyframes tw-confetti {
    0% { transform: translateY(0) rotate(0) scale(1); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(250px) rotate(720deg) scale(0); opacity: 0; }
  }

  .tw-locked-ticket::before, .tw-locked-ticket::after {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 
      -120px 20px 0 var(--orange),
      -60px 50px 0 var(--yes),
      0px 10px 0 var(--maybe),
      60px 40px 0 var(--no),
      120px 60px 0 var(--slot-3),
      -90px 90px 0 var(--slot-5),
      90px 100px 0 var(--slot-7);
    animation: tw-confetti 2.5s ease-out forwards;
    pointer-events: none;
    z-index: 100;
  }
  .tw-locked-ticket::after {
    left: 40%;
    box-shadow: 
      -140px 40px 0 var(--slot-1),
      -50px 20px 0 var(--orange-deep),
      20px 80px 0 var(--yes),
      80px 30px 0 var(--slot-6),
      140px 50px 0 var(--maybe);
    animation-delay: 0.1s;
  }
}

/* --- responsive --- */
@media (min-width: 900px) {
  .tw-room {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 1.5rem 2.5rem;
    align-items: start;
  }
  
  .tw-room-header {
    grid-column: 1 / -1;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 2rem;
  }
  
  .tw-room-title { margin-bottom: 0; }
  .tw-room-code-wrap { margin-bottom: 0; margin-left: auto; }
  .tw-room-rally { width: 100%; margin-top: 0.5rem; }
  
  .tw-strip { grid-column: 2; grid-row: 2; }
  .tw-lob-composer { grid-column: 1; grid-row: 2; }
  .tw-slots { grid-column: 1; grid-row: 3; }
  .tw-log { grid-column: 2; grid-row: 3; position: sticky; top: 1.5rem; }
}

@media (max-width: 899px) {
  /* Phone order: the time slots are the point of the page, so they come right after the header; the sticky Lob button
     follows them (sticky-bottom only pins while its natural spot is below the fold), then people, then the log. */
  .tw-room > .tw-slots { order: 1; }
  .tw-room > .tw-lob-composer { order: 2; }
  .tw-room > .tw-strip { order: 3; }
  .tw-room > .tw-log { order: 4; }
  .tw-lob-composer {
    position: sticky;
    bottom: 1rem;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1), var(--shadow);
  }
}

@media (prefers-contrast: more) {
  :root { --border-width: 4px; }
  body { background-image: none; }
  .tw-slot-card { border-color: var(--ink); }
}

/* footer link in index.html: a comfortable 44px tap target */
footer a { display: inline-block; padding: 0.75rem 0.5rem; min-height: 44px; box-sizing: border-box; }

/* --- host actions (assign / consensus / print) --- */
.tw-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 0.5rem;
}

@media (min-width: 900px) {
  .tw-room-actions { width: 100%; justify-content: flex-start; }
}

/* the copy-summary fallback: shown only when the clipboard and execCommand both failed */
.tw-summary-fallback {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tw-summary-fallback-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.tw-summary-text {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 1rem; /* 16px keeps iOS from zooming on focus */
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}
.tw-summary-close { align-self: flex-start; }

/* --- modals: the assignment plan, the consensus summary, the printable cards --- */
.tw-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(43, 27, 16, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.tw-modal {
  background: var(--white);
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: min(760px, 100%);
  margin: auto;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.tw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: var(--border-width) solid var(--ink);
}

.tw-modal-title { margin: 0; font-size: 1.5rem; }

.tw-modal-close {
  min-height: 44px;
  min-width: 44px;
  padding: 0.25rem 0.75rem;
}

.tw-modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tw-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: var(--border-width) solid var(--ink);
}

/* --- assignment plan (coverage) --- */
.tw-plan { display: flex; flex-direction: column; gap: 1rem; }

.tw-plan-summary { font-weight: 700; }

.tw-plan-state { font-weight: 700; color: var(--orange-deep); }

.tw-plan-warning {
  font-weight: 700;
  color: var(--no);
  background: var(--slot-5);
  border: 2px dashed var(--no);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.tw-plan-slot {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tw-plan-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tw-plan-slot-label { font-weight: 700; }

.tw-plan-slot-need { font-weight: 700; font-size: 0.9rem; color: var(--muted); }

.tw-plan-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.tw-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.25rem 0.15rem 0.75rem;
  font-weight: 700;
}

.tw-plan-chip-remove {
  min-height: 32px;
  min-width: 32px;
  padding: 0 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  line-height: 1;
}

.tw-plan-empty { color: var(--muted); font-weight: 600; }

.tw-plan-adds { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.tw-plan-adds-label { font-size: 0.9rem; font-weight: 700; color: var(--muted); }

.tw-plan-add {
  min-height: 36px;
  padding: 0.15rem 0.75rem;
  font-size: 0.9rem;
}

.tw-plan-note { font-size: 0.85rem; font-weight: 600; color: var(--muted); }

/* --- consensus summary (meeting) --- */
.tw-consensus { display: flex; flex-direction: column; gap: 1rem; }

.tw-consensus-summary { font-weight: 700; }

.tw-consensus-best {
  border: var(--border-width) solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--slot-4);
}

.tw-consensus-best--none { background: var(--cream); }

.tw-consensus-best-label { font-weight: 700; font-size: 1.15rem; }

.tw-consensus-best-meta { font-weight: 600; color: var(--muted); }

.tw-consensus-lines {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tw-consensus-line { font-weight: 600; }

.tw-consensus-ranked { display: flex; flex-direction: column; gap: 0.35rem; }

.tw-consensus-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem;
}

.tw-consensus-row--best { border-width: 3px; background: var(--slot-4); font-weight: 700; }

.tw-consensus-rank { font-weight: 700; color: var(--muted); }

.tw-consensus-row-label { font-weight: 700; }

.tw-consensus-row-meta { font-size: 0.9rem; color: var(--muted); }

/* the plan a locked or saved coverage shift carries */
.tw-slot-assigned { font-weight: 700; font-size: 0.95rem; }

/* a locked coverage room: one plan, many shifts, so the lock reads as a banner not a ticket */
.tw-plan-locked {
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--orange-deep);
  background: var(--white);
  border: var(--border-width) solid var(--orange-deep);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  padding: 0.5rem 1rem;
}

@media (min-width: 900px) {
  .tw-plan-locked { grid-column: 1 / -1; }
  .tw-plan-locked-actions { grid-column: 1 / -1; }
}

/* the participant's own "Add my shifts (.ics)" button under the banner */
.tw-plan-locked-actions { display: flex; justify-content: center; }

/* --- printable cards --- */
.tw-cards-root { display: flex; flex-direction: column; gap: 1rem; }

/* The sheet is a sibling above .tw-room inside #tw-root (the column already caps at 1100px), so it
   takes the same width rule as .tw-room. While printing it lives in <body>, so this does not apply. */
#tw-root > .tw-cards-root { width: 100%; margin-bottom: 1.5rem; }

.tw-cards-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }

.tw-cards-title { margin: 0; }

.tw-cards-note { font-size: 0.9rem; font-weight: 600; color: var(--muted); }

.tw-cards-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.tw-card {
  border: 2px dashed var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 180px;
}

.tw-card-name { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 700; }

.tw-card-date { font-weight: 700; font-size: 1.15rem; }

.tw-card-time { font-weight: 700; }

.tw-card-title { font-family: var(--font-heading); font-size: 1.25rem; font-weight: 700; }

.tw-card-sub {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.tw-card-shifts { display: flex; flex-direction: column; gap: 0.25rem; }

.tw-card-shift {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px dotted var(--muted);
  padding-bottom: 0.15rem;
}

.tw-card-shift--none { color: var(--muted); font-weight: 600; }

.tw-card-shift-day { font-weight: 700; }

.tw-card-shift-time { font-weight: 600; }

.tw-card-people-line { font-size: 0.9rem; font-weight: 600; }

.tw-card-badge {
  align-self: flex-start;
  border: 2px solid var(--ink);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.6rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--slot-4);
}

.tw-card-badge--locked { background: var(--orange); }

.tw-card-foot {
  margin-top: auto;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
}

/* --- print: 3x5" cards, 2-up per row / 4 per US Letter sheet, everything else hidden ---
   views-room.js moves .tw-cards-root to <body> and flags <body> with .tw-printing for the duration of
   the print dialog, so the first rule below hides the app, the nav, the footer and the toast in one
   shot. A plain Ctrl+P on the room view (no cards open) prints the page normally. Cards are 5in x 3in
   (a 3x5 index card in landscape) in two columns of a landscape Letter sheet, touching, so each dashed
   border doubles as a cut line. */
@media print {
  @page { size: letter landscape; margin: 0.5in; }

  /* Paper is always light: re-assert the light tokens so an OS in dark mode cannot leak into the cards
     or the review view (this block comes after the dark block, so it wins). */
  :root {
    color-scheme: light;
    --cream: #FFF6E5;
    --white: #FFFFFF;
    --ink: #2B1B10;
    --muted: #6B5646;
    --orange: #FF8A3D;
    --orange-deep: #B8480B;
    --line: #2B1B10;
    --yes: #1F7A3E;
    --maybe: #8A5A00;
    --no: #B3261E;

    --slot-0: #FFD9C2;
    --slot-1: #CDEFD8;
    --slot-2: #E0D7FA;
    --slot-3: #CFE8FB;
    --slot-4: #FFF0B3;
    --slot-5: #FFD3DC;
    --slot-6: #E3F3B8;
    --slot-7: #C5F0EE;

    --vote-yes-on: #9EDDB3;
    --vote-maybe-on: #FFDC66;
    --vote-no-on: #FFA9B8;

    --on-orange: #2B1B10;
    --surface-glass: rgba(255, 255, 255, 0.82);
    --surface-dim: rgba(0, 0, 0, 0.08);
  }

  html, body {
    margin: 0;
    padding: 0;
    background: #fff !important;
    background-image: none !important;
    color: #000;
  }

  body.tw-printing > *:not(.tw-cards-root) { display: none !important; }

  .tw-cards-root {
    display: block;
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }

  .tw-cards-toolbar,
  .tw-cards-note { display: none !important; }

  .tw-cards-sheet {
    display: grid;
    grid-template-columns: repeat(2, 5in);
    grid-auto-rows: 3in;
    gap: 0;
  }

  .tw-card {
    width: 5in;
    height: 3in;
    min-height: 0;
    padding: 0.2in;
    border: 1px dashed #999;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff !important;
  }

  .tw-card-badge { border-color: #000; }
}

/* Coverage only: the short-handed strip above the shift cards (pinch hit). */
.tw-pinch { border: var(--border-width) solid var(--ink); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.tw-pinch-title { margin: 0; font-size: 1.15rem; }
.tw-pinch-hint { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.tw-pinch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.5rem 0; border-top: 1px dotted var(--muted); }
.tw-pinch-when { font-weight: 700; flex: 1 1 10rem; overflow-wrap: anywhere; }
.tw-pinch-need { font-weight: 700; color: var(--orange-deep); }
.tw-pinch-btn { flex: 0 0 auto; min-height: 44px; }
.tw-pinch-more { font-size: 0.9rem; font-weight: 600; color: var(--muted); }
