/* Name Draw 2.0
   Layout: festive header band + one centred column of panels. Two skins share the markup:
   .skin-xmas (default: red/green band, gold trim, gift tags, snow) and .skin-clean (set THEME = 'clean' in config.php). */

:root {
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #edf2ef; --ink: #16221e; --ink-2: #56655f; --line: #d9e2de;
  --primary: #1e5a44; --primary-hover: #174937; --primary-ink: #ffffff;
  --accent: #b02a40; --accent-soft: #f8e6e9; --gold: #a97a1f; --gold-soft: #f6edd8;
  --ok: #2c7a4d; --ok-soft: #e2f1e7; --warn: #9a5b0c; --warn-soft: #fbefdc;
  --band: #ffffff; --band-ink: #16221e; --band-line: #d9e2de;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgb(18 40 32 / .06), 0 6px 20px rgb(18 40 32 / .06);
  --pattern: none;
  --snow: rgba(150, 170, 190, .55);
}
.skin-xmas {
  --bg: #f6ecdc; --surface: #fffaf1; --surface-2: #f3e6d0; --ink: #2b1612; --ink-2: #6f5047; --line: #e3cfb2;
  --primary: #a3172d; --primary-hover: #85111f; --primary-ink: #fff8ea;
  --accent: #165c37; --accent-soft: #e1efe4; --gold: #b8862a; --gold-soft: #f6e7c4;
  --ok: #165c37; --ok-soft: #e1efe4; --warn: #9a5b0c; --warn-soft: #fbe9cf;
  --band: #0f4a2c; --band-ink: #fff3d6; --band-line: #c9972c;
  --font-display: "Berkshire Swash", Georgia, serif;
  --font-body: "Nunito", "Segoe UI", system-ui, sans-serif;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 2px 0 rgb(120 70 20 / .12), 0 10px 24px rgb(90 30 10 / .12);
  --pattern:
    repeating-linear-gradient(90deg, rgb(163 23 45 / .07) 0 22px, transparent 22px 44px),
    repeating-linear-gradient(0deg, rgb(22 92 55 / .07) 0 22px, transparent 22px 44px);
  --snow: rgba(150, 170, 190, .65);
}
/* Dark palette. Applies when the device is in dark mode (Theme: Auto, the default) unless the
   visitor picked Light, and always when they picked Dark. The footer button sets data-theme on <html>. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1614; --surface: #16201d; --surface-2: #1c2925; --ink: #e6eeea; --ink-2: #98aaa3; --line: #2a3934;
    --primary: #62c095; --primary-hover: #7dd1aa; --primary-ink: #0a1913;
    --accent: #f0788a; --accent-soft: #3a1d23; --gold: #e2b75c; --gold-soft: #33291a;
    --ok: #6fcf97; --ok-soft: #173326; --warn: #f0b45a; --warn-soft: #3a2a12;
    --band: #16201d; --band-ink: #e6eeea; --band-line: #2a3934;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
    --snow: rgba(255, 255, 255, .7);
  }
  :root:not([data-theme="light"]) .skin-xmas {
    --bg: #0a1a14; --surface: #122a20; --surface-2: #183427; --ink: #f7ecd6; --ink-2: #c2ae8e; --line: #2b4a3a;
    --primary: #e04459; --primary-hover: #ef6074; --primary-ink: #1c0507;
    --accent: #58c486; --accent-soft: #163a28; --gold: #f0c35a; --gold-soft: #3a2f14;
    --ok: #58c486; --ok-soft: #163a28; --warn: #f0b45a; --warn-soft: #3a2a12;
    --band: #5e0c19; --band-ink: #ffeec8; --band-line: #f0c35a;
    --shadow: 0 2px 0 rgb(0 0 0 / .35), 0 10px 26px rgb(0 0 0 / .35);
    /* a dark green tartan made of shadow: darker bands both ways (darkest where they cross) and a thin red line through each, so lighter cards always stand out (same as Gift List) */
    --pattern:
      radial-gradient(circle at 20% 0%, rgb(240 195 90 / .08), transparent 40%),
      repeating-linear-gradient(90deg, transparent 0 51px, rgb(224 68 89 / .07) 51px 53px, transparent 53px 72px),
      repeating-linear-gradient(0deg, transparent 0 51px, rgb(224 68 89 / .07) 51px 53px, transparent 53px 72px),
      repeating-linear-gradient(90deg, rgb(0 0 0 / .16) 0 36px, transparent 36px 72px),
      repeating-linear-gradient(0deg, rgb(0 0 0 / .16) 0 36px, transparent 36px 72px);
    --snow: rgba(255, 255, 255, .85);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1614; --surface: #16201d; --surface-2: #1c2925; --ink: #e6eeea; --ink-2: #98aaa3; --line: #2a3934;
  --primary: #62c095; --primary-hover: #7dd1aa; --primary-ink: #0a1913;
  --accent: #f0788a; --accent-soft: #3a1d23; --gold: #e2b75c; --gold-soft: #33291a;
  --ok: #6fcf97; --ok-soft: #173326; --warn: #f0b45a; --warn-soft: #3a2a12;
  --band: #16201d; --band-ink: #e6eeea; --band-line: #2a3934;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 20px rgb(0 0 0 / .25);
  --snow: rgba(255, 255, 255, .7);
}
:root[data-theme="dark"] .skin-xmas {
  --bg: #0a1a14; --surface: #122a20; --surface-2: #183427; --ink: #f7ecd6; --ink-2: #c2ae8e; --line: #2b4a3a;
  --primary: #e04459; --primary-hover: #ef6074; --primary-ink: #1c0507;
  --accent: #58c486; --accent-soft: #163a28; --gold: #f0c35a; --gold-soft: #3a2f14;
  --ok: #58c486; --ok-soft: #163a28; --warn: #f0b45a; --warn-soft: #3a2a12;
  --band: #5e0c19; --band-ink: #ffeec8; --band-line: #f0c35a;
  --shadow: 0 2px 0 rgb(0 0 0 / .35), 0 10px 26px rgb(0 0 0 / .35);
  /* a dark green tartan made of shadow: darker bands both ways (darkest where they cross) and a thin red line through each, so lighter cards always stand out (same as Gift List) */
  --pattern:
    radial-gradient(circle at 20% 0%, rgb(240 195 90 / .08), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 51px, rgb(224 68 89 / .07) 51px 53px, transparent 53px 72px),
    repeating-linear-gradient(0deg, transparent 0 51px, rgb(224 68 89 / .07) 51px 53px, transparent 53px 72px),
    repeating-linear-gradient(90deg, rgb(0 0 0 / .16) 0 36px, transparent 36px 72px),
    repeating-linear-gradient(0deg, rgb(0 0 0 / .16) 0 36px, transparent 36px 72px);
  --snow: rgba(255, 255, 255, .85);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); background-image: var(--pattern); background-attachment: fixed;
  color: var(--ink); font: 16px/1.5 var(--font-body);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
.inline { display: inline; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; font: inherit; opacity: .85; }
.muted { color: var(--ink-2); }
.hint { font-size: .85rem; color: var(--ink-2); margin: 0; }
.js .js-hide { display: none !important; }

#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

/* ---------- header band ---------- */
.band { background: var(--band); color: var(--band-ink); border-bottom: 1px solid var(--band-line); position: relative; z-index: 2; }
.skin-xmas .band { border-bottom: 4px solid var(--band-line); }
.band-inner { max-width: 1040px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px)); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: inherit; text-decoration: none; }
.skin-xmas .brand { font-weight: 400; font-size: 1.6rem; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-mark-stroke { stroke: var(--accent); }
.skin-xmas .brand-mark-stroke { stroke: var(--gold); }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: var(--radius-sm); color: inherit; opacity: .8; font-weight: 700; text-decoration: none; }
.nav a:hover { opacity: 1; }
.nav a[aria-current="page"] { opacity: 1; background: var(--surface-2); color: var(--ink); }
.skin-xmas .nav a[aria-current="page"] { background: rgb(255 255 255 / .14); color: var(--band-ink); box-shadow: inset 0 -2px 0 var(--gold); }
.nav-right { display: flex; gap: 8px; align-items: center; font-size: .92rem; }
.nav-right a { color: inherit; opacity: .85; }

.lights { display: none; }
.skin-xmas .lights { display: flex; justify-content: space-between; padding: 0 10px; height: 14px; position: absolute; left: 0; right: 0; bottom: -13px; overflow: hidden; }
.lights i { width: 9px; height: 13px; border-radius: 50% 50% 45% 45%; display: block; flex: none; animation: twinkle 2.4s ease-in-out infinite; }
.lights i:nth-child(4n+1) { background: #e8394f; }
.lights i:nth-child(4n+2) { background: #f0c35a; animation-delay: .6s; }
.lights i:nth-child(4n+3) { background: #4fc27f; animation-delay: 1.2s; }
.lights i:nth-child(4n+4) { background: #6fb6ff; animation-delay: 1.8s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ---------- page column ---------- */
main.screen {
  max-width: 1000px; margin: 0 auto; position: relative; z-index: 1;
  padding: 36px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 24px;
}
.skin-xmas main.screen { padding-top: 44px; }
.site-foot { max-width: 1000px; margin: 0 auto; padding: 0 16px 32px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: .85rem; color: var(--ink-2); }

h1.title, h2.title { font-family: var(--font-display); font-size: clamp(1.9rem, 4.5vw, 2.7rem); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
.skin-xmas .title { font-weight: 400; color: var(--primary); letter-spacing: 0; }
h3 { font-family: var(--font-display); font-size: 1.15rem; margin: 0; text-wrap: balance; }
.skin-xmas h3 { font-weight: 400; font-size: 1.4rem; color: var(--accent); }
.eyebrow { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); font-weight: 800; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: .95rem; }
.meta b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.divider { height: 1px; background: var(--line); border: 0; margin: 0; }
.skin-xmas .divider { height: 8px; border-radius: 4px; background: repeating-linear-gradient(-45deg, var(--primary) 0 9px, var(--surface) 9px 18px); opacity: .85; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.skin-xmas .panel { outline: 1px dashed var(--gold); outline-offset: -7px; padding: 24px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.crumb { color: var(--ink-2); font-weight: 700; text-decoration: none; align-self: flex-start; }
.crumb:hover { color: var(--ink); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 700; cursor: pointer; transition: background .15s, transform .1s; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-green { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn-green:hover { background: var(--accent); filter: brightness(1.08); }
.btn-big { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.skin-xmas .btn-primary, .skin-xmas .btn-green { box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18), 0 0 0 2px var(--gold); }
.btn-danger { color: var(--accent); }
.skin-xmas .btn-danger { color: var(--primary); }
.btn-ghost { border-color: transparent; background: none; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 38px; min-height: 38px; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 700; font-size: .9rem; }
.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.row-form .field { flex: 1 1 220px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-wait { background: var(--gold-soft); color: var(--gold); }
.fam { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }

/* ---------- checklist (shared) ---------- */
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; }
.fam-col { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
.fam-col h4 { margin: 0 0 4px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fam-col h4 > span { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.fam-all { border: 1px solid var(--line); background: var(--surface-2); color: var(--primary); font: inherit; font-size: .72rem; cursor: pointer; padding: 3px 10px; border-radius: 999px; letter-spacing: .06em; min-width: 52px; }
.fam-all:hover { border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 10px; min-height: 34px; cursor: pointer; border-radius: 6px; padding: 0 6px; margin: 0 -6px; }
.check:hover { background: var(--surface-2); }
.check input, .opt input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.sel-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opt { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.opt input { margin-top: 3px; }
.opt small { display: block; color: var(--ink-2); font-size: .85rem; }
.dirty-note { color: var(--warn); font-weight: 700; font-size: .9rem; }

.feas { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: .93rem; }
.feas svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.feas-ok { background: var(--ok-soft); color: var(--ok); }
.feas-bad { background: var(--warn-soft); color: var(--warn); }
.feas strong { display: block; }
.feas span { color: var(--ink); opacity: .85; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.actions .spacer { flex: 1; }
.callout { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--gold-soft); color: var(--ink); }
.callout-warn { background: var(--warn-soft); }

/* ---------- public page ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.hero-text { display: flex; flex-direction: column; gap: 8px; }
.viewbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.toggle a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 800; color: var(--ink-2); text-decoration: none; }
.toggle a[aria-current="true"] { background: var(--primary); color: var(--primary-ink); }
.search { position: relative; flex: 1 1 220px; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; stroke: var(--ink-2); pointer-events: none; }
.search .input { padding-left: 40px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .88rem; }
.jump a { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font-weight: 800; color: var(--ink); text-decoration: none; }
.jump a:hover { border-color: var(--primary); }
.picker { border: 2px dashed var(--gold); display: block; }
.skin-xmas .picker { padding: 16px 22px; outline: 0; }
.picker summary { min-height: 28px; }
.picker summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 8px; }
.picker summary::-webkit-details-marker { display: none; }
.picker summary::before { content: "▸"; color: var(--gold); transition: rotate .15s; }
.picker[open] summary::before { rotate: 90deg; }
.picker .picker-body { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }

.fam-sec { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 16px; }
.fam-sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fam-sec-head h3 { font-size: 1.4rem; }
.skin-xmas .fam-sec-head h3 { font-size: 1.85rem; }
.fam-sec-head span { color: var(--ink-2); font-size: .9rem; font-variant-numeric: tabular-nums; }
.fam-sec-head::after { content: ""; flex: 1; height: 1px; background: var(--line); align-self: center; min-width: 40px; }

.pairs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.pair { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: grid; gap: 2px; box-shadow: var(--shadow); position: relative; }
/* Reads top to bottom as a sentence: "Damara / → buys a gift for / Brittany". Giver first, because people look for their own name. */
.pair .giver { font-weight: 800; font-size: 1.1rem; line-height: 1.25; overflow-wrap: anywhere; }
.pair .verb { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--ink-2); font-weight: 600; }
.pair .verb svg { width: 15px; height: 15px; flex: none; color: var(--gold); }
.pair { align-content: start; }
.pair .recv-line { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pair .recv { font-family: var(--font-display); font-size: 1.4rem; color: var(--primary); line-height: 1.2; overflow-wrap: anywhere; }
.pair.hit { outline: 2px solid var(--gold); background: var(--gold-soft); }
.skin-xmas .pair { border-radius: 6px 14px 14px 6px; padding: 14px 16px 14px 40px; clip-path: polygon(22px 0, 100% 0, 100% 100%, 22px 100%, 0 50%); border: 0; box-shadow: none; filter: drop-shadow(0 3px 6px rgb(60 20 5 / .18)); }
.skin-xmas .pair::before { content: ""; position: absolute; left: 14px; top: 50%; width: 10px; height: 10px; translate: 0 -50%; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--gold); }
.skin-xmas .pair::after { content: ""; position: absolute; left: 28px; top: 8px; bottom: 8px; border-left: 2px dashed var(--line); }
.skin-xmas .pair .recv { font-size: 1.7rem; font-weight: 400; }
.skin-xmas .pair.hit { outline: none; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.footer-note { font-size: .85rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; }

/* ---------- admin: draws ---------- */
.draw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.draw-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.draw-card:hover { border-color: var(--primary); }
.draw-card b { font-family: var(--font-display); font-size: 1.15rem; }
.skin-xmas .draw-card b { font-weight: 400; font-size: 1.4rem; }
.draw-card .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--ink-2); font-size: .9rem; }
.draw-card.new { border-style: dashed; box-shadow: none; background: transparent; justify-content: center; align-items: center; color: var(--ink-2); font-weight: 700; min-height: 110px; }

.results-wrap { overflow-x: auto; }
table.results { width: 100%; border-collapse: collapse; font-size: .95rem; }
.results th { text-align: left; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.results td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.results tr:last-child td { border-bottom: 0; }
.results td.arrow { color: var(--primary); width: 30px; text-align: center; }
.results td.n { font-variant-numeric: tabular-nums; color: var(--ink-2); width: 36px; }
.results tr.loop-break td { border-top: 2px dashed var(--line); }


.loop-note { font-size: .88rem; color: var(--ink-2); margin: 0; }

.email { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.email-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.email textarea { font-family: var(--font-mono); font-size: .84rem; line-height: 1.55; min-height: 280px; background: var(--surface-2); }

.danger-zone { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; }
details.rename summary { cursor: pointer; color: var(--ink-2); font-weight: 700; font-size: .9rem; }
details.rename[open] { flex-basis: 100%; }
details.rename form { margin-top: 10px; }

/* ---------- wizard ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: s; }
.steps li { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--ink-2); counter-increment: s; }
.steps li::before { content: ""; height: 5px; border-radius: 3px; background: var(--line); }
.steps li span::before { content: counter(s) ". "; }
.steps li.done::before, .steps li.on::before { background: var(--primary); }
.steps li.on { color: var(--ink); }
.wiz-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.fam-assign { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 16px; }
.fam-assign label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 10px; align-items: center; font-weight: 700; }
.fam-assign select { min-height: 38px; padding: 6px 10px; }

/* ---------- people / families ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.people-list { display: flex; flex-direction: column; }
.person-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 6.5rem auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.person-row:last-child { border-bottom: 0; }
.person-row form.edit { display: contents; }
.person-row .input { min-height: 38px; padding: 6px 10px; }
.person-row input.input { border-color: transparent; background: transparent; font-weight: 700; }
.person-row input.input:hover { border-color: var(--line); }
.person-row .uses { font-size: .82rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.person-row .row-btns { display: flex; gap: 4px; }

.fam-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: start; }
.fam-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.fam-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fam-card header b { font-family: var(--font-display); font-size: 1.15rem; }
.skin-xmas .fam-card header b { font-weight: 400; font-size: 1.4rem; color: var(--accent); }
.members { display: flex; flex-wrap: wrap; gap: 6px; }
.member { display: inline-flex; align-items: center; gap: 2px; padding: 4px 4px 4px 12px; background: var(--surface-2); border-radius: 999px; font-weight: 700; font-size: .9rem; }
.member button { border: 0; background: none; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--ink-2); line-height: 1; font-size: 1.1rem; }
.member button:hover { background: var(--line); color: var(--ink); }
.fam-card.unassigned { background: transparent; border-style: dashed; box-shadow: none; }
.fam-card .row-form { align-items: center; }
.fam-card .row-form select { flex: 1 1 160px; }

/* ---------- login ---------- */
.login-wrap { display: grid; place-items: center; min-height: 50vh; }
.login { width: min(400px, 100%); }
.login .panel { gap: 18px; }
.login h1 { font-family: var(--font-display); margin: 0; font-size: 1.7rem; }
.skin-xmas .login h1 { font-weight: 400; font-size: 2.1rem; color: var(--primary); }
.err { font-size: .92rem; color: var(--accent); background: var(--accent-soft); padding: 8px 12px; border-radius: var(--radius-sm); margin: 0; }
.skin-xmas .err { color: var(--primary); }

/* ---------- toasts + confirm ---------- */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; gap: 8px; max-width: min(440px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: var(--bg); padding: 10px 10px 10px 16px; border-radius: var(--radius-sm); font-weight: 700; font-size: .93rem; box-shadow: var(--shadow); animation: toastIn .25s both; }
.toast span { flex: 1; padding-top: 2px; }
.toast-error { background: var(--primary); color: var(--primary-ink); }
.toast-x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 2px 6px; opacity: .8; }
@keyframes toastIn { from { opacity: 0; translate: 0 8px; } }
dialog.confirm { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; max-width: min(440px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgb(0 0 0 / .3); }
dialog.confirm::backdrop { background: rgb(10 20 15 / .45); }
dialog.confirm p { margin: 0 0 18px; font-weight: 700; line-height: 1.45; }
dialog.confirm .actions { justify-content: flex-end; }

@media (max-width: 720px) {
  .two-col { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  .person-row .uses { display: none; }
  .steps li span { font-size: .72rem; }
  .actions .spacer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lights i, .toast { animation: none; }
}
