/* Hallmark · shape: app screen · genre: editorial · theme: Carnival (deal 1/3, seed family-secret-santa-gift-92b0·4888b94d·2026-11-28·r0) · redesign: full
 * nav: top bar, the event's name as wordmark, log out on the organizer's screens · signature: the gift tag, the match's name in poster capitals on a mustard tag · states: empty, waiting, drawn, gift ready, email off, error · carnival: cold-snap
 * axes: light/display-heavy/chromatic-yellow · posture: full-palette · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S4 R4 V4 · weakest: E, many small forms on one organizer screen; one filled action per screen, the rest outlined, and each form its own ruled section */
/* Hallmark · kept the display capitals on buttons and the figures row, against flow.md § App screens (no display face on buttons or data): Carnival sets its controls and figures in the display capitals and the theme wins on controls; list names moved to Golos */
/* Hallmark · reworded headings to the theme's voice (capitals, a full stop, no emoji): "Hi Maria!" to "Hi Maria.", "1. Event details" to "Event details.", "2. Invite people" to "Invite people.", "3. Names are drawn ✓" to "Names are drawn.", "People (5)" to "The list.", "Keep apart (optional)" to "Keep apart.", "Organizer" to the figures row · 30a, 38 */
/* Hallmark · moved onclick="this.select()" to app.js (data-select) so the page runs under a strict script policy · the behaviour is kept */
@import url("./fonts.css");
@import url("./tokens.css");
@import url("./base.css");

:root {
  --text-poster: 3.583rem;
  --text-head: 2.488rem;
  --measure-app: 880px;
  --measure-narrow: 640px;
  --control-h: 44px;
  --control-h-s: 36px;
  --shadow-press: 1px 1px 0 var(--color-ink);
}
@media (max-width: 40rem) { :root { --text-poster: 2.488rem; --text-head: 2.074rem; } }

/* ---------- shell ---------- */
.bar { border-bottom: var(--rule-bar) solid var(--color-accent-2); background: var(--color-paper); }
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: 64px; }
.wordmark { font: var(--display-weight) var(--text-xl)/1.1 var(--font-display); text-transform: uppercase; letter-spacing: var(--tracking-display); text-decoration: none; color: var(--color-ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-block: var(--space-xs); }
.wordmark:hover { color: var(--color-accent-2); }
.bar__side { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; white-space: nowrap; }
.bar__role { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.page { width: 100%; max-width: var(--measure-app); margin-inline: auto; padding: var(--space-xl) var(--gutter) var(--space-3xl); display: grid; gap: var(--space-xl); }
.page--narrow { max-width: var(--measure-narrow); }
.page > * { min-width: 0; }

/* ---------- type ---------- */
h1 { font-size: var(--text-head); text-transform: uppercase; line-height: 1; max-width: none; }
h2 { font-size: var(--text-2xl); text-transform: uppercase; line-height: 1; max-width: none; }
.poster { font-size: var(--text-poster); line-height: 0.95; }
.lead { font-size: var(--text-lg); }
.muted { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
.stack { display: grid; gap: var(--space-md); }
.stack-s { display: grid; gap: var(--space-xs); }
a:hover { text-decoration-color: var(--color-accent-2); }
p a, .link { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent-2); text-decoration-thickness: 2px; }

/* ---------- facts ---------- */
.facts { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-xl); margin: 0; }
.facts div { display: grid; gap: var(--space-3xs); }
.facts dt { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.facts dd { margin: 0; font-weight: 500; }

.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: var(--rule-bar) solid var(--color-ink); }
.figures div { display: grid; gap: var(--space-2xs); padding: var(--space-md) var(--space-md) 0; border-left: var(--rule-bar) solid var(--color-ink); }
.figures div:first-child { border-left: 0; padding-left: 0; }
.figures dt { order: 2; font-size: var(--text-sm); font-weight: 500; }
.figures dd { order: 1; margin: 0; font: var(--display-weight) var(--text-head)/1 var(--font-display); text-transform: uppercase; font-variant-numeric: tabular-nums; }

/* ---------- surfaces ---------- */
.well { grid-template-columns: minmax(0, 1fr); background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--space-lg); display: grid; gap: var(--space-md); }
.section { display: grid; gap: var(--space-md); padding-top: var(--space-lg); border-top: var(--rule-bar) solid var(--color-accent-2); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-xs) var(--space-md); }

/* The gift tag: the screen's one loud object. */
.tag { position: relative; background: var(--color-accent); color: var(--color-accent-ink); border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: var(--space-xl) var(--space-lg) var(--space-lg); display: grid; gap: var(--space-md); }
.tag::before { content: ""; position: absolute; top: var(--space-md); right: var(--space-md); width: 18px; height: 18px; border: var(--rule-bar) solid var(--color-ink); border-radius: 50%; background: var(--color-paper); }
.tag__label { font-weight: 500; }
.tag .facts dt { color: var(--color-ink-2); }

/* ---------- notices ---------- */
.notice { border: var(--rule-bar) solid var(--color-ink); background: var(--color-paper); padding: var(--space-sm) var(--space-md); font-weight: 500; }
.notice--error { border-color: var(--color-error); }
.notice--error::before { content: "Heads up: "; color: var(--color-error); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--control-h); padding: 0 var(--space-lg); border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-pill); box-shadow: var(--shadow-card); background: var(--color-paper); color: var(--color-ink); font: var(--display-weight) var(--text-lg)/1 var(--font-display); text-transform: uppercase; letter-spacing: var(--tracking-display); white-space: normal; text-align: center; text-wrap: balance; max-width: 100%; text-decoration: none; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
@media (hover: hover) { .btn:hover { background: var(--color-paper-3); } .btn--primary:hover { background: var(--color-paper); } }
.btn:active { box-shadow: var(--shadow-press); transform: translate(3px, 3px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: var(--shadow-card); }
.btn[aria-busy="true"] { cursor: progress; }
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
.btn--s { position: relative; min-height: var(--control-h-s); padding: 0 var(--space-sm); font-size: var(--text-md); box-shadow: 2px 2px 0 var(--color-ink); }
.btn--s::before { content: ""; position: absolute; inset: -4px; }
.btn--s:active { box-shadow: none; transform: translate(2px, 2px); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: center; }
.linkbtn { background: none; border: 0; padding: var(--space-xs) 0; color: var(--color-ink); font: 500 var(--text-sm)/1.2 var(--font-body); text-decoration: underline; text-decoration-color: var(--color-accent-2); text-decoration-thickness: 2px; text-underline-offset: 0.2em; cursor: pointer; white-space: nowrap; }
.linkbtn:hover { color: var(--color-accent-2); }
.linkbtn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.inline-form { display: inline; margin: 0; }

/* ---------- fields ---------- */
.form { display: grid; gap: var(--space-md); }
.field { display: grid; gap: var(--space-2xs); min-width: 0; align-content: start; }
.field label, .label { font-weight: 500; font-size: var(--text-sm); }
.field .hint { font-size: var(--text-sm); color: var(--color-muted); min-height: 1lh; }
.input { width: 100%; min-height: var(--control-h); padding: var(--space-xs) var(--space-sm); border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card); background: var(--color-paper); color: var(--color-ink); outline: 2px solid transparent; outline-offset: -5px; transition: background-color var(--dur-micro) var(--ease-out); }
.input::placeholder { color: var(--color-muted); }
@media (hover: hover) { .input:hover { background: var(--color-paper-2); } }
.input:focus-visible { outline-color: var(--color-focus); }
.input[readonly] { background: var(--color-paper-2); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--color-error); }
textarea.input { min-height: 8rem; resize: vertical; line-height: 1.5; }
select.input { cursor: pointer; height: var(--control-h); padding-block: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
@media (max-width: 40rem) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xs); align-items: center; }
.copy .input { font-size: var(--text-sm); }

/* ---------- rows: wish lists, people, log ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: var(--rule-bar) solid var(--color-accent-2); }
.rows > li { padding: var(--space-sm) 0; border-bottom: var(--rule-bar) solid var(--color-accent-2); overflow-wrap: anywhere; }
.wish > li { font-size: var(--text-lg); font-weight: 500; }
.tag .rows, .tag .rows > li { border-color: var(--color-ink); }

.person { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: var(--space-xs) var(--space-md); align-items: start; }
.person__name { font-weight: 500; font-size: var(--text-lg); line-height: 1.3; }
.person__email { font-size: var(--text-sm); color: var(--color-muted); }
.person__status { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.person__acts { display: flex; flex-wrap: wrap; gap: var(--space-xs); justify-content: flex-end; }
.person__link { grid-column: 1 / -1; }
@media (max-width: 40rem) { .person { grid-template-columns: minmax(0, 1fr); } .person__acts { justify-content: flex-start; } }

.chip { display: inline-block; padding: var(--space-3xs) var(--space-xs); border: 1px solid var(--color-ink); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 500; line-height: 1.4; background: var(--color-paper); white-space: nowrap; }
.chip--ok { background: var(--color-ink); color: var(--color-paper); }
.chip--bad { border-color: var(--color-error); color: var(--color-error); }

.log { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.log th { text-align: left; font-weight: 500; color: var(--color-muted); padding: 0 var(--space-xs) var(--space-xs) 0; white-space: nowrap; border-bottom: var(--rule-bar) solid var(--color-accent-2); }
.log td { padding: var(--space-xs) var(--space-xs) var(--space-xs) 0; border-bottom: 1px solid var(--color-accent-2); vertical-align: top; overflow-wrap: anywhere; }
.log td.num { white-space: nowrap; }
@media (max-width: 40rem) {
  .log thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .log tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3xs) var(--space-sm); padding: var(--space-xs) 0; border-bottom: 1px solid var(--color-accent-2); }
  .log td { display: block; padding: 0; border: 0; }
  .log td[data-label]::before { content: attr(data-label) ": "; color: var(--color-muted); }
}

details > summary { cursor: pointer; font-size: var(--text-sm); font-weight: 500; text-decoration: underline; text-decoration-color: var(--color-accent-2); text-decoration-thickness: 2px; text-underline-offset: 0.2em; width: max-content; padding: var(--space-xs) 0; }
details[open] > summary { margin-bottom: var(--space-xs); }

.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--space-sm); align-items: end; }
@media (max-width: 40rem) { .pair { grid-template-columns: minmax(0, 1fr); } }
.foot { font-size: var(--text-sm); color: var(--color-muted); }
.steps { margin: 0; padding-left: var(--space-lg); display: grid; gap: var(--space-2xs); }
