/* Quick Gallery design system components (from the design handoff). Fonts load from the page head. */
body { margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 22px; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
.qg-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-4); }
.qg-col { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.qg-focus:focus-visible, .qg-btn:focus-visible, .qg-tab:focus-visible, .qg-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Button */
.qg-btn { font: inherit; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-md); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.qg-btn:hover { background: var(--sunken); }
.qg-btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-primary); }
.qg-btn-primary:hover { background: var(--ink); opacity: .88; }
.qg-btn-quiet { background: transparent; border-color: transparent; color: var(--ink); }
.qg-btn-quiet:hover { background: var(--sunken); }
.qg-btn-danger { background: var(--live); border-color: var(--live); color: var(--on-live); }
.qg-btn-sm { height: var(--control-sm); padding: 0 var(--space-3); font-size: 13px; }
.qg-btn-lg { height: var(--control-lg); padding: 0 var(--space-6); font-size: 17px; border-radius: var(--radius-md); }
.qg-btn[disabled] { opacity: .45; cursor: not-allowed; }

/* StatusPill */
.qg-pill { font: inherit; font-size: 13px; line-height: 18px; font-weight: 500; display: inline-flex; align-items: center; gap: var(--space-2); height: var(--control-sm); padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); white-space: nowrap; }
button.qg-pill { cursor: pointer; }
.qg-dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--ink-muted); flex: none; }
.qg-pill-live { background: var(--live-soft); border-color: transparent; color: var(--live); }
.qg-pill-live .qg-dot, .qg-pill-error .qg-dot { background: var(--live); }
.qg-pill-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.qg-pill-ok .qg-dot { background: var(--ok); }
.qg-pill-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.qg-pill-warn .qg-dot { background: var(--warn); }
.qg-pill-error { background: var(--live-soft); border-color: var(--live); color: var(--live); }
.qg-pill-off { background: var(--sunken); border-color: transparent; color: var(--ink-muted); }
.qg-pill-off .qg-dot { background: transparent; border: 1.5px solid var(--ink-muted); }
.qg-pulse { animation: qg-pulse 1.6s ease-in-out infinite; }
@keyframes qg-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .qg-pulse { animation: none; } }

/* Tag */
.qg-tag { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 12px; line-height: 16px; font-weight: 500; padding: 2px var(--space-2); border-radius: var(--radius-pill); background: var(--sunken); color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.qg-tag-booked { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); }
.qg-tag-walkin { background: var(--sunken); color: var(--ink-muted); }
.qg-tag-ok { background: var(--ok-soft); color: var(--ok); }
.qg-tag-warn { background: var(--warn-soft); color: var(--warn); }
.qg-tag-live { background: var(--live-soft); color: var(--live); }
.qg-tag-called { background: var(--live); color: var(--on-live); font-weight: 600; }

/* QueueRow */
.qg-queue { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.qg-qrow { display: grid; grid-template-columns: 28px 1fr auto; gap: var(--space-3); align-items: center; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.qg-qrow-called { background: var(--live-soft); border-color: var(--live); }
.qg-qpos { font-family: var(--font-serif); font-size: 24px; line-height: 28px; font-weight: 600; text-align: center; font-variant-numeric: lining-nums; color: var(--ink); }
.qg-qrow-called .qg-qpos { color: var(--live); }
.qg-qpos.qg-qpos-later { color: var(--ink-muted); }
.qg-qmain { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qg-qtop { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.qg-qname { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qg-qmeta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: 12px; line-height: 16px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* StatTile */
.qg-stat { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-4) var(--space-6) var(--space-6) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); min-width: 0; }
.qg-stat-label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.qg-stat-value { font-family: var(--font-serif); font-size: 40px; line-height: 44px; font-weight: 500; font-variant-numeric: lining-nums; color: var(--ink); }
.qg-stat-note { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.qg-stat-delta-up { color: var(--ok); font-weight: 600; }
.qg-stat-delta-down { color: var(--live); font-weight: 600; }

/* Tabs */
/* Horizontal scroll only (phones), with no scrollbar; the underline is an inset shadow so nothing
   pokes below the bar and Windows never shows a stray vertical scrollbar. */
.qg-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); padding: 0 var(--space-4); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.qg-tabs::-webkit-scrollbar { display: none; }
.qg-tab { font: inherit; font-size: 15px; font-weight: 500; background: none; border: 0; box-shadow: inset 0 -2px 0 transparent; padding: var(--space-3) var(--space-3); color: var(--ink-muted); cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.qg-tab:hover { color: var(--ink); }
.qg-tab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); font-weight: 600; }
.qg-tab-count { font-size: 12px; line-height: 16px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--sunken); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
/* Event tabs: "‹ Home" first with a divider after it, Settings pushed to the far end. */
.qg-tab-back::before { content: "‹"; font-size: 18px; line-height: 1; margin-right: -2px; }
.qg-tab-back { position: relative; margin-right: var(--space-2); }
.qg-tab-back::after { content: ""; position: absolute; right: calc(var(--space-1) * -1 - 4px); top: 30%; bottom: 30%; width: 1px; background: var(--line-strong); }
.qg-tab-end { margin-left: auto; }
.qg-tab-live { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--live); }

/* PhotoThumb */
.qg-thumb { position: relative; width: 112px; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); background: var(--sunken); overflow: hidden; border: 1px solid var(--line); }
.qg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qg-thumb-ph { position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--sunken) 0 10px, var(--paper) 10px 20px); }
.qg-thumb-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; box-sizing: border-box; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-pill); border: 1.5px solid var(--ink); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raised); cursor: pointer; opacity: 0; }
.qg-thumb-x svg { display: block; }
.qg-thumb:hover .qg-thumb-x, .qg-thumb:focus-within .qg-thumb-x, .qg-thumb-showx .qg-thumb-x { opacity: 1; }
.qg-thumb-bar { position: absolute; left: 8px; right: 8px; bottom: 8px; height: 4px; border-radius: var(--radius-pill); background: var(--surface); overflow: hidden; }
.qg-thumb-bar > span { display: block; height: 100%; background: var(--ink); }
.qg-thumb-note { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.qg-thumb-failed { border-color: var(--live); }
.qg-thumb-held { border-color: var(--warn); }

/* For Santa (optional): the notes form on booking, check-in, the notes page and Add a walk-in
   (santa-form.js), and the notes as the photographer reads them. Only Santa events show these, so
   they wear the Santa accents (handoff part 17): the evergreen-soft header with the gift, child
   blocks that fold to one line, the dashed Add another child with the gold gift, and the lock line. */
.sn { --qg-gold: var(--gold); border: 1px solid var(--line); border-radius: var(--radius-lg); margin: 0; padding: 0; min-width: 0; background: var(--surface); overflow: hidden; }
.sn-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; }
.sn-head { display: flex; gap: var(--space-4); align-items: flex-start; padding: 20px; background: var(--ever-soft); }
.sn-art { flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.sn-art svg { width: 52px; height: 52px; }
.sn-head-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sn-title { margin: 0; padding: 0; font-family: var(--font-serif); font-weight: 600; font-size: 26px; line-height: 30px; color: var(--ink); }
.sn-optional { font-family: var(--font-sans); font-size: 15px; font-weight: 400; color: var(--ink-muted); }
.sn-lead { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.sn-inner { display: flex; flex-direction: column; gap: var(--space-3); padding: 16px; }
.sn-children { display: flex; flex-direction: column; gap: var(--space-3); }
.sn-child { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.sn-child-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sn-child-title { color: var(--ink-muted); text-transform: uppercase; }
.sn-link { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sn-remove[hidden] { display: none; }
.sn-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: var(--space-3); }
.sn-field textarea { width: 100%; box-sizing: border-box; min-height: 64px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; resize: vertical; }
.gs-field.sn-field textarea { min-height: 72px; padding: 12px 14px; font-size: 17px; }
.sn-field textarea::placeholder { color: var(--ink-muted); }
.sn-field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sn-sum { display: none; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sn-sum-note { color: var(--ink-muted); }
.sn-child.is-collapsed { padding: 14px var(--space-4); background: var(--surface); }
.sn-child.is-collapsed > :not(.sn-sum) { display: none; }
.sn-child.is-collapsed > .sn-sum { display: flex; }
.sn-add { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.sn-add .sn-icon { color: var(--gold); }
.sn-add:hover { background: var(--sunken); }
.sn-add:disabled { opacity: .5; cursor: default; }
.sn-add:focus-visible, .sn-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sn-foot { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sn-foot .sn-icon { flex: none; margin-top: 2px; }
.sn-empty { margin: 0; color: var(--ink-muted); }
.sn-view { --qg-gold: var(--gold); list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sn-view li { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; }
.sn-view li:first-child { padding-top: 0; }
.sn-view li + li { border-top: 1px solid var(--line); }
.sn-view-name { font-family: var(--font-serif); font-weight: 500; font-size: 30px; line-height: 34px; color: var(--ink); }
.sn-avoid { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-left: 3px solid var(--gold); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--gold-soft); }
.sn-avoid .sn-icon { flex: none; color: var(--gold); margin-top: 2px; }
.sn-avoid > div { display: flex; flex-direction: column; gap: 2px; }
.sn-avoid-label { color: var(--gold); text-transform: uppercase; }
.sn-view-row { display: flex; flex-direction: column; gap: 2px; }
.sn-view-label { color: var(--ink-muted); text-transform: uppercase; }
.sn-view-foot { margin-top: 4px; font-size: 13px; line-height: 18px; }
.sn-locked { list-style: none; margin: 0; padding: 0 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.sn-locked li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.sn-locked li + li { border-top: 1px solid var(--line); }
.sn-locked .sn-icon { color: var(--ink); }
@media (max-width: 480px) { .sn-head { padding: 16px; } .sn-art { width: 52px; height: 52px; } .sn-art svg { width: 42px; height: 42px; } .sn-title { font-size: 24px; } }
