:root {
  /* Page background (the wrapping paper) and what sits directly on it */
  --bg: #0f3b2e;
  --bg-deep: #0a2a20;
  --bg-dot: #154a3a;
  --bg-pattern: radial-gradient(var(--bg-dot) 2px, transparent 2.5px),
    radial-gradient(var(--bg-dot) 2px, transparent 2.5px);
  --bg-size: 28px 28px;
  --bg-position: 0 0, 14px 14px;
  --on-bg: #eef1ec;
  --on-bg-strong: #fbfaf7;
  --on-bg-accent: #e2c393;
  --wordmark: #d9ad3c;
  --ribbon-a: #b3122e;
  --ribbon-b: #fbfaf7;

  /* Sheets (the cards everything sits on) */
  --paper: #fbfaf7;
  --paper-quiet: #eef1ec;
  --field: #fff;
  --field-edge: #c4c8bf;
  --ink: #1c1a17;
  --muted: #5d5a52;
  --line: #d9dcd4;
  --heading: #0f3b2e;

  /* Buttons, links, highlights */
  --accent: #b3122e;
  --accent-deep: #8c0d23;
  --on-accent: #fbfaf7;
  --focus: #d9ad3c;
  --warn-bg: #fdf0d5;

  /* The gift tag */
  --tag: #e2c393;
  --tag-edge: #c9a56d;
  --tag-label: #6b5532;
  --tag-blank: #8a7350;
  --tag-name: #8c0d23;

  --shadow: rgba(4, 22, 16, 0.35);
  --shadow-strong: rgba(4, 22, 16, 0.45);

  --display: 'Grenze Gotisch', 'UnifrakturMaguntia', Georgia, serif;
  --body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 4px;
  --gutter: 16px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  /* Wrapping paper: each theme sets its own pattern */
  background-color: var(--bg);
  background-image: var(--bg-pattern);
  background-size: var(--bg-size);
  background-position: var(--bg-position);
}

/* ---------- masthead ---------- */

.ribbon {
  height: 14px;
  background: repeating-linear-gradient(135deg, var(--ribbon-a) 0 14px, var(--ribbon-b) 14px 28px);
}

.masthead {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px var(--gutter) 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  line-height: 1;
  color: var(--wordmark);
  text-decoration: none;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 var(--bg-deep);
}

.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 4px 16px;
  color: var(--on-bg);
  font-size: 0.95rem;
}

.masthead-nav > * {
  white-space: nowrap;
}

.nav-note {
  color: var(--on-bg-accent);
}

/* ---------- page + sheets ---------- */

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px var(--gutter) 64px;
  outline: none;
}

.sheet {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 26px 28px 28px;
  margin-top: 22px;
  box-shadow: 0 1px 0 var(--bg-deep), 0 10px 24px var(--shadow);
}

.sheet-narrow {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.sheet-quiet {
  background: var(--paper-quiet);
  box-shadow: none;
}

h1,
h2 {
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--heading);
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.25rem;
}

.page-title {
  overflow-wrap: anywhere;
  font-family: var(--display);
  font-weight: 500;
  font-size: 2rem;
  color: var(--on-bg-strong);
  margin: 10px 0 0;
}

.lede {
  color: var(--muted);
  margin: 0 0 18px;
}

.empty {
  color: var(--muted);
  font-style: italic;
  margin: 8px 0 0;
}

.warn {
  background: var(--warn-bg);
  border-left: 4px solid var(--focus);
  padding: 10px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.loading {
  color: var(--on-bg);
  font-style: italic;
  margin-top: 40px;
}

.footnote {
  text-align: center;
  margin-top: 20px;
  color: var(--on-bg);
}

.footnote a {
  color: var(--on-bg-accent);
}

.greeting {
  color: var(--on-bg);
  font-size: 1.1rem;
  margin: 8px 0 0;
}

/* ---------- the gift tag ---------- */

.tag-hang {
  display: flex;
  justify-content: center;
  padding: 34px 0 8px;
  /* On the wrapper: clip-path on .tag would clip its own shadow */
  filter: drop-shadow(0 10px 14px var(--shadow-strong));
}

.tag {
  --notch: 34px;
  position: relative;
  min-width: min(100%, 440px);
  max-width: 100%;
  padding: 30px 40px 34px calc(var(--notch) + 44px);
  background: var(--tag);
  color: var(--ink);
  clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, var(--notch) 100%, 0 50%);
  transform: rotate(-2.5deg);
  transform-origin: 20% 50%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: tag-swing 1.6s cubic-bezier(0.3, 0.7, 0.3, 1) both;
}

/* Reinforced string hole */
.tag::before {
  content: '';
  position: absolute;
  left: calc(var(--notch) - 4px);
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 5px var(--tag-edge);
}

/* Faint inset border, like a printed tag */
.tag::after {
  content: '';
  position: absolute;
  inset: 8px 8px 8px calc(var(--notch) + 6px);
  border: 1.5px dashed rgba(28, 26, 23, 0.25);
  pointer-events: none;
}

.tag-to {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tag-label);
}

.tag-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 11vw, 4.2rem);
  line-height: 1;
  color: var(--tag-name);
  overflow-wrap: anywhere;
}

.tag-blank .tag-name {
  color: var(--tag-blank);
}

@keyframes tag-swing {
  0% {
    transform: rotate(-9deg);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  60% {
    transform: rotate(1deg);
  }
  100% {
    transform: rotate(-2.5deg);
  }
}

/* ---------- wish lists ---------- */

.affiliate-note {
  margin-top: 14px;
}

.wishlist {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.wishlist li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 12px 0 12px 26px;
  border-top: 1px solid var(--line);
  position: relative;
}

.wishlist li:first-child {
  border-top: 0;
}

/* Little holly berry bullet */
.wishlist li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 1.15em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 6px -4px 0 -1px var(--accent-deep);
}

.wish-text {
  flex: 1 1 220px;
}

.wish-link {
  color: var(--heading);
  font-size: 0.92rem;
  font-weight: 600;
}

.wish-search {
  color: var(--muted);
  font-weight: 400;
}

.add-item {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 2px dotted var(--line);
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

/* ---------- rules (rendered markdown) ---------- */

.md h1,
.md h2,
.md h3 {
  font-size: 1.05rem;
  margin: 20px 0 4px;
}

.md > :first-child {
  margin-top: 0;
}

.md ul,
.md ol {
  padding-left: 1.3em;
}

.md li + li {
  margin-top: 4px;
}

.md a {
  color: var(--accent);
}

.md blockquote {
  margin: 12px 0;
  padding: 4px 16px;
  border-left: 4px solid var(--tag);
  color: var(--muted);
}

code {
  font-size: 0.9em;
  background: var(--paper-quiet);
  padding: 1px 5px;
  border-radius: 3px;
}

.rules-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.rules-editor textarea {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9rem;
  min-height: 260px;
  resize: vertical;
}

.preview-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.rules-preview {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-height: 260px;
  max-height: 420px;
  overflow: auto;
  background: var(--field);
}

/* ---------- forms ---------- */

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

input,
select,
textarea {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--field-edge);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--heading);
}

.code-input {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-align: center;
  padding: 10px;
}

.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.hint,
.aside {
  margin: -6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.aside {
  margin-top: 0;
}

.form-error:empty {
  display: none;
}

.form-error {
  margin: 0;
  color: var(--accent);
  font-weight: 600;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.inline-form {
  margin-top: 12px;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline-form label {
  flex: 1 1 240px;
}

.inline-form .form-error {
  flex-basis: 100%;
}

/* .btn aligns itself to the top; in a row of fields it should line up with the inputs' bottom edge. */
.inline-form .btn,
.invite-form .btn,
.exclude-form .btn {
  align-self: flex-end;
}

.invite-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  margin: 14px 0 6px;
}

.invite-form label {
  flex: 1 1 180px;
}

.invite-form .form-error {
  flex-basis: 100%;
}

.draw-form {
  margin-top: 14px;
}

.matches {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 2px dotted var(--line);
}

.matches .hint {
  margin: 0 0 8px;
}

.match-table {
  margin-top: 10px;
}

/* ---------- buttons + links ---------- */

.btn {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  align-self: flex-start;
}

.btn:focus-visible,
.link:focus-visible,
a:focus-visible,
[role='tab']:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-holly {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: inset 0 -3px 0 var(--accent-deep);
}

.btn-holly:hover:not(:disabled) {
  background: var(--accent-deep);
}

.btn-quiet {
  background: transparent;
  color: var(--heading);
  box-shadow: inset 0 0 0 1.5px var(--heading);
}

.btn-quiet:hover {
  background: var(--paper-quiet);
}

.link {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--heading);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-light {
  color: var(--on-bg);
}

.link-danger {
  color: var(--accent);
}

.link:disabled {
  opacity: 0.5;
}

/* Segmented sign-in method switch */
.switch {
  display: flex;
  background: var(--paper-quiet);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 18px;
}

.switch [role='tab'] {
  flex: 1;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
}

.switch [aria-selected='true'] {
  background: var(--field);
  color: var(--heading);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---------- guides ---------- */

.guide {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.guide-switch {
  max-width: 320px;
}

/* Same look as the sign-in tabs, but these are links to two pages. */
.guide-switch a {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px;
  border-radius: 3px;
  color: var(--muted);
  text-decoration: none;
}

.guide-switch [aria-current='page'] {
  background: var(--field);
  color: var(--heading);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.guide-body {
  margin-top: 14px;
}

.guide-body h2 {
  font-size: 1.1rem;
  margin: 26px 0 6px;
}

.guide-next {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 2px dotted var(--line);
}

.guide-links {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 2px dotted var(--line);
  font-size: 0.95rem;
  color: var(--muted);
}

.guide-links .link {
  color: var(--accent);
}

.hero-help {
  color: var(--on-bg);
  margin: 18px 0 0;
}

.hero-help a {
  color: var(--on-bg-accent);
}

/* ---------- people table ---------- */

.people {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}

.people th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 8px 6px 0;
  border-bottom: 2px solid var(--line);
}

.people td {
  padding: 12px 8px 12px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.person-name {
  display: block;
  font-weight: 600;
}

.person-email {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.status {
  color: var(--muted);
  font-size: 0.9rem;
}

.not-invited {
  color: var(--ink);
  font-weight: 600;
}

/* The batch step: everyone on the list who hasn't had an invite gets one. */
.send-invites {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 16px;
}

.send-invites p {
  flex: 1 1 260px;
  margin: 0;
}

.actions {
  text-align: right;
  white-space: nowrap;
}

.actions .link + .link {
  margin-left: 14px;
}

/* In-page confirmation (askConfirm in app.ts). */
.modal {
  width: min(460px, calc(100vw - 2 * var(--gutter)));
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 48px var(--shadow-strong);
}

/* The padding lives here so a click anywhere on the panel isn't taken for a click on the backdrop. */
.modal-body {
  padding: 22px 24px 20px;
}

.modal::backdrop {
  background: rgba(4, 22, 16, 0.6);
}

.modal h2 {
  margin: 0 0 12px;
}

.modal p {
  margin: 0 0 10px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  max-width: calc(100% - 32px);
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: var(--radius);
  border-left: 5px solid var(--focus);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast[data-kind='error'] {
  border-left-color: var(--accent);
}

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

/* ---------- landing ---------- */

.hero {
  padding: 28px 0 8px;
}

.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.1;
  color: var(--on-bg-strong);
  margin: 0 0 14px;
}

.hero-lede {
  color: var(--on-bg);
  font-size: 1.1rem;
  max-width: 34em;
  margin: 0 0 22px;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 24px;
}

.features h2 {
  font-size: 1.05rem;
}

.features p {
  margin: 0;
  color: var(--muted);
}

/* ---------- groups ---------- */

.group-head {
  margin-top: 10px;
}

.group-sub {
  color: var(--on-bg);
  margin: 2px 0 0;
}

.group-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.group-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 1px 0 var(--bg-deep), 0 10px 24px var(--shadow);
}

.group-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.group-name {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--heading);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.group-name:hover {
  text-decoration: underline;
}

/* "(organizer@example.com)" after a group someone else organizes. */
.group-owner {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--muted);
}

.title-owner {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--on-bg);
}

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

.group-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.you {
  font-weight: 400;
  color: var(--muted);
}

/* ---------- theme picker ---------- */

.theme-chips {
  display: inline-flex;
  flex: none;
}

.theme-chips span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--paper), inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.theme-chips span + span {
  margin-left: -5px;
}

/* On group cards: a little stack of wrapping-paper stripes */
.theme-chips-tall {
  flex-direction: column;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.theme-chips-tall span {
  width: 12px;
  height: 14px;
  border-radius: 0;
  box-shadow: none;
}

.theme-chips-tall span + span {
  margin: 0;
}

.theme-picker {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}

.theme-picker legend {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0;
  margin-bottom: 6px;
}

.theme-option {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
  font-weight: 500;
  cursor: pointer;
}

.theme-option input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.theme-option:has(input:checked) {
  border-color: var(--heading);
  box-shadow: inset 0 0 0 1px var(--heading);
}

.theme-option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

/* ---------- exclusions ---------- */

.exclusions {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.exclusions li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.exclusions li:first-child {
  border-top: 0;
}

.exclusions .link {
  margin-left: auto;
}

.excl-and {
  color: var(--muted);
}

.exclude-form {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px dotted var(--line);
}

.exclude-form label {
  flex: 1 1 180px;
}

.exclude-form .form-error {
  flex-basis: 100%;
}

/* ---------- password rules ---------- */

.pw-rules {
  margin: -6px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--line);
  background: var(--paper-quiet);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.pw-rules[data-met] {
  border-left-color: var(--heading);
}

.pw-rules p,
.pw-rules ul {
  margin: 0;
}

.pw-rules ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
}

.pw-or {
  font-style: italic;
  margin: 2px 0 !important;
}

.pw-example {
  white-space: nowrap;
}

.pw-rules li::before,
.pw-option[data-rule]::before {
  content: '○';
  display: inline-block;
  width: 1.2em;
}

.pw-rules [data-ok] {
  color: var(--heading);
  font-weight: 600;
}

.pw-rules [data-ok]::before {
  content: '✓';
}

.done {
  margin: 0;
  padding: 12px 14px;
  background: var(--paper-quiet);
  border-radius: var(--radius);
}

/* ---------- extra buttons ---------- */

.btn-on-bg {
  color: var(--on-bg-strong);
  box-shadow: inset 0 0 0 1.5px var(--on-bg-strong);
}

.btn-on-bg:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: #a3142b;
  color: #fff;
}

.btn-danger:hover {
  background: #7d0f21;
}

select {
  appearance: auto;
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .sheet {
    padding: 20px 18px 22px;
  }

  .tag {
    --notch: 26px;
    padding: 24px 22px 26px calc(var(--notch) + 34px);
    min-width: 0;
    width: 100%;
  }

  .rules-editor {
    grid-template-columns: 1fr;
  }

  .group-card {
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .group-actions {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .people:not(.match-table) thead {
    display: none;
  }

  .people:not(.match-table) tr {
    display: grid;
    grid-template-columns: 1fr;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
  }

  .people:not(.match-table) td {
    border: 0;
    padding: 2px 0;
  }

  .actions {
    text-align: left;
    padding-top: 6px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tag {
    animation: none;
  }

  .toast {
    transition: none;
  }
}

/* ---------- themes ----------
   An organizer picks one per group (shared/themes.ts); the app sets <html data-theme>.
   Spruce & Holly is the default in :root. */

:root[data-theme='candy-cane'] {
  --bg: #fbf3ea;
  --bg-deep: #ead8c6;
  --bg-dot: rgba(200, 16, 46, 0.09);
  --bg-pattern: repeating-linear-gradient(135deg, var(--bg-dot) 0 12px, transparent 12px 34px);
  --bg-size: auto;
  --bg-position: 0 0;
  --on-bg: #6a1e28;
  --on-bg-strong: #8f0b22;
  --on-bg-accent: #c8102e;
  --wordmark: #c8102e;
  --ribbon-a: #c8102e;
  --ribbon-b: #ffffff;
  --paper: #ffffff;
  --paper-quiet: #fdf0f0;
  --field: #ffffff;
  --field-edge: #e0c3c6;
  --ink: #2a1416;
  --muted: #6e5558;
  --line: #f0dadb;
  --heading: #8f0b22;
  --accent: #c8102e;
  --accent-deep: #930c22;
  --on-accent: #ffffff;
  --focus: #2f9a68;
  --warn-bg: #fff1d6;
  --tag: #ffffff;
  --tag-edge: #f3b9c1;
  --tag-label: #8f0b22;
  --tag-blank: #c2959b;
  --tag-name: #c8102e;
  --shadow: rgba(120, 20, 30, 0.14);
  --shadow-strong: rgba(120, 20, 30, 0.25);
  --display: 'Mountains of Christmas', 'Grenze Gotisch', Georgia, serif;
}

:root[data-theme='midnight'] {
  --bg: #0d1830;
  --bg-deep: #060c1c;
  --bg-dot: rgba(217, 230, 242, 0.22);
  --bg-pattern: radial-gradient(var(--bg-dot) 1.4px, transparent 2px),
    radial-gradient(rgba(217, 230, 242, 0.1) 1px, transparent 1.6px);
  --bg-size: 38px 38px, 23px 23px;
  --bg-position: 0 0, 11px 7px;
  --on-bg: #c9d8ea;
  --on-bg-strong: #f2f7fc;
  --on-bg-accent: #9cc3f0;
  --wordmark: #e3edf8;
  --ribbon-a: #3a78d4;
  --ribbon-b: #e3edf8;
  --paper: #f6f9fc;
  --paper-quiet: #e6eef7;
  --field: #ffffff;
  --field-edge: #b9c8d9;
  --ink: #121a2a;
  --muted: #536079;
  --line: #d5dfeb;
  --heading: #13284f;
  --accent: #2b62b8;
  --accent-deep: #1c4688;
  --on-accent: #ffffff;
  --focus: #6fb2ff;
  --warn-bg: #fff3d6;
  --tag: #d9e6f2;
  --tag-edge: #a9c1da;
  --tag-label: #3b5578;
  --tag-blank: #7d93ad;
  --tag-name: #13284f;
  --shadow: rgba(0, 0, 12, 0.45);
  --shadow-strong: rgba(0, 0, 12, 0.6);
  --display: 'Cinzel', Georgia, serif;
}

:root[data-theme='gingerbread'] {
  --bg: #6e3f1d;
  --bg-deep: #4b2911;
  --bg-dot: #f6e2bd;
  --bg-pattern: radial-gradient(var(--bg-dot) 2px, transparent 2.6px),
    radial-gradient(rgba(246, 226, 189, 0.35) 1.5px, transparent 2px);
  --bg-size: 34px 34px;
  --bg-position: 0 0, 17px 17px;
  --on-bg: #f6e2bd;
  --on-bg-strong: #fff8ec;
  --on-bg-accent: #ffd27a;
  --wordmark: #fff8ec;
  --ribbon-a: #c23b22;
  --ribbon-b: #fff8ec;
  --paper: #fff8ec;
  --paper-quiet: #f6ead4;
  --field: #fffdf8;
  --field-edge: #d8c09a;
  --ink: #2b1a0e;
  --muted: #6d5640;
  --line: #ecdcbf;
  --heading: #5a2f12;
  --accent: #c23b22;
  --accent-deep: #962a16;
  --on-accent: #fff8ec;
  --focus: #3f8a3a;
  --warn-bg: #fdeccb;
  --tag: #f6e2bd;
  --tag-edge: #d9b98a;
  --tag-label: #7a4b25;
  --tag-blank: #a07c58;
  --tag-name: #962a16;
  --shadow: rgba(40, 20, 5, 0.4);
  --shadow-strong: rgba(40, 20, 5, 0.5);
  --display: 'Mountains of Christmas', 'Grenze Gotisch', Georgia, serif;
}

:root[data-theme='nordic'] {
  --bg: #8c1c1c;
  --bg-deep: #5e1010;
  --bg-dot: rgba(244, 236, 220, 0.09);
  /* Little diamonds, like a knit sweater */
  --bg-pattern: linear-gradient(45deg, var(--bg-dot) 25%, transparent 25%, transparent 75%, var(--bg-dot) 75%),
    linear-gradient(45deg, var(--bg-dot) 25%, transparent 25%, transparent 75%, var(--bg-dot) 75%);
  --bg-size: 22px 22px;
  --bg-position: 0 0, 11px 11px;
  --on-bg: #f4ecdc;
  --on-bg-strong: #fffaf0;
  --on-bg-accent: #f2c9a0;
  --wordmark: #f4ecdc;
  --ribbon-a: #f4ecdc;
  --ribbon-b: #1d5c63;
  --paper: #fbf7f0;
  --paper-quiet: #f1e9db;
  --field: #ffffff;
  --field-edge: #cdbfa8;
  --ink: #231a17;
  --muted: #65584f;
  --line: #e6dccb;
  --heading: #7a1717;
  --accent: #1d5c63;
  --accent-deep: #134148;
  --on-accent: #fbf7f0;
  --focus: #e0a43a;
  --warn-bg: #fbeed3;
  --tag: #f4ecdc;
  --tag-edge: #d6c6a8;
  --tag-label: #6b4f3a;
  --tag-blank: #9c8670;
  --tag-name: #8c1c1c;
  --shadow: rgba(40, 5, 5, 0.4);
  --shadow-strong: rgba(40, 5, 5, 0.5);
}

:root[data-theme='tinsel'] {
  --bg: #15120c;
  --bg-deep: #070604;
  --bg-dot: rgba(230, 195, 92, 0.4);
  --bg-pattern: radial-gradient(var(--bg-dot) 1.2px, transparent 1.8px),
    radial-gradient(rgba(230, 195, 92, 0.18) 1px, transparent 1.5px);
  --bg-size: 26px 26px, 17px 17px;
  --bg-position: 0 0, 9px 5px;
  --on-bg: #e8dcc0;
  --on-bg-strong: #fff6dc;
  --on-bg-accent: #e6c35c;
  --wordmark: #e6c35c;
  --ribbon-a: #c9971c;
  --ribbon-b: #15120c;
  --paper: #fffaf0;
  --paper-quiet: #f5ecd8;
  --field: #ffffff;
  --field-edge: #d4c39b;
  --ink: #1b160c;
  --muted: #625840;
  --line: #ebdfc3;
  --heading: #15120c;
  --accent: #8a6508;
  --accent-deep: #6a4d05;
  --on-accent: #fffaf0;
  --focus: #b8860b;
  --warn-bg: #fbf0cf;
  --tag: #f1dfa6;
  --tag-edge: #cfb36a;
  --tag-label: #6a5320;
  --tag-blank: #9b8650;
  --tag-name: #15120c;
  --shadow: rgba(0, 0, 0, 0.5);
  --shadow-strong: rgba(0, 0, 0, 0.6);
  --display: 'Cinzel', Georgia, serif;
}
