/* PaperSafeAI Drop: the "Warm Event Vault" design (see DESIGN.md, "Look and feel"): a warm canvas,
   white cards with soft shadows, royal blue with tangerine and teal accents, Plus Jakarta Sans.
   No cards inside cards, results as toasts. Light, dark, or the device's setting (js/theme.js). */

@font-face {
  font-family: 'Plus Jakarta Sans Variable'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans Variable'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(/fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* --- Tokens: "Warm Event Vault" (warm canvas, white cards, royal blue with tangerine accents) --- */
:root {
  /* Light */
  --bg: #fafaf7; --bg-raise: #ffffff; --bg-sunk: #f3f4f6;
  --line: #e5e7eb; --line-strong: #d1d5db;
  --ink: #111827; --ink-soft: #6b7280; --ink-mid: #4b5563;
  --accent: #225fe6; --accent-hover: #1b4fc4; --accent-ink: #ffffff; --accent-soft: #eff4ff;
  --warm: #f97316; --warm-ink: #9a3412; --warm-soft: #fff1e6;
  --teal: #0d9488; --teal-ink: #0f766e; --teal-soft: #e6f6f4;
  --ok: #15803d; --ok-ink: #166534; --ok-soft: #e8f6ec;
  --alarm: #dc2626; --alarm-soft: #fdecec;
  --shadow: 0 1px 3px rgba(17, 24, 39, 0.04), 0 12px 28px -4px rgba(17, 24, 39, 0.06);
  --shadow-2: 0 20px 35px -5px rgba(34, 95, 230, 0.07), 0 8px 16px -4px rgba(17, 24, 39, 0.04);
  --shadow-3: 0 25px 50px -12px rgba(17, 24, 39, 0.18);
  --focus: 0 0 0 4px rgba(34, 95, 230, 0.14);
  /* Background: low ambient glows of amber and blue behind the page. */
  --glow-1: rgba(34, 95, 230, 0.07); --glow-2: rgba(249, 115, 22, 0.07); --glow-3: rgba(13, 148, 136, 0.04);
  --head-bg: rgba(250, 250, 247, 0.82);

  --font-display: 'Plus Jakarta Sans Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Plus Jakarta Sans Variable', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-16: 64px;
  --radius-sm: 8px; --radius-control: 12px; --radius-md: 16px; --radius-lg: 20px; --radius-xl: 24px; --radius-pill: 999px;
  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem; --text-xl: 1.25rem; --text-2xl: 2rem;
  --page: 1200px;
  color-scheme: light;
}
/* Dark: the same hierarchy on deep slate; depth from surface steps more than shadows.
   The theme is chosen in public/js/theme.js (the visitor's pick, or the device's setting). */
:root[data-theme="dark"] {
  --bg: #111318; --bg-raise: #1a1d23; --bg-sunk: #22262d;
  --line: #2c3139; --line-strong: #3d434d;
  --ink: #f3f4f6; --ink-soft: #a3a9b4; --ink-mid: #c4c9d2;
  --accent: #7aa2ff; --accent-hover: #a3bfff; --accent-ink: #0b1020; --accent-soft: rgba(122, 162, 255, 0.14);
  --warm: #fb923c; --warm-ink: #fdba74; --warm-soft: rgba(251, 146, 60, 0.14);
  --teal: #2dd4bf; --teal-ink: #5eead4; --teal-soft: rgba(45, 212, 191, 0.12);
  --ok: #4ade80; --ok-ink: #86efac; --ok-soft: rgba(74, 222, 128, 0.12);
  --alarm: #f87171; --alarm-soft: rgba(248, 113, 113, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-2: 0 18px 36px -12px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  --focus: 0 0 0 4px rgba(122, 162, 255, 0.3);
  --glow-1: rgba(122, 162, 255, 0.10); --glow-2: rgba(251, 146, 60, 0.06); --glow-3: rgba(45, 212, 191, 0.05);
  --head-bg: rgba(17, 19, 24, 0.82);
  color-scheme: dark;
}

/* --- Base --- */
* { box-sizing: border-box; }
/* `hidden` always wins over a class's display, on every page. */
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 400 var(--text-base)/1.6 var(--font-body); -webkit-font-smoothing: antialiased; }
main { max-width: 720px; margin: 0 auto; padding: var(--space-10) var(--space-5) var(--space-16); }
h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 3.6vw, 2.5rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; margin-bottom: var(--space-3); }
h2 { font-size: var(--text-xl); line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; margin-bottom: var(--space-3); }
h3 { font-size: var(--text-lg); line-height: 1.45; font-weight: 600; letter-spacing: -0.005em; margin-bottom: var(--space-2); }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent); text-underline-offset: 3px; }
.muted { color: var(--ink-soft); }
.error { color: var(--alarm); }
.done { color: var(--ok); }
.failed { color: var(--alarm); }

/* --- Background: soft ambient glows behind everything (the slideshow keeps its black). --- */
body:not(.show-body) { position: relative; }
body:not(.show-body)::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48rem 36rem at 88% -8%, var(--glow-1), transparent 65%),
    radial-gradient(40rem 32rem at -6% 18%, var(--glow-2), transparent 62%),
    radial-gradient(40rem 30rem at 60% 108%, var(--glow-3), transparent 62%);
}

/* --- Header and footer --- */
.site-head { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: var(--head-bg); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.site-head .inner { position: relative; max-width: var(--page); margin: 0 auto; padding: 0 var(--space-5); min-height: 64px; display: flex; align-items: center; gap: var(--space-4); }
.mobile-menu-toggle { display: inline-flex; width: 40px; height: 40px; flex: none; padding: 0; margin-left: auto; }
.mobile-menu-toggle sp-icon-menu-hamburger { width: 20px; height: 20px; }
.mobile-header-menu { position: absolute; z-index: 20; top: calc(100% + 8px); right: var(--space-5); width: min(320px, calc(100vw - 2 * var(--space-5))); display: flex; flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raise); box-shadow: var(--shadow-lg); }
.mobile-header-menu[hidden] { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 var(--text-base)/1 var(--font-display); letter-spacing: -0.01em; }
/* The mark is inline SVG, so it shows however the file would be served. */
.brand .brand-mark { width: 32px; height: 32px; display: block; flex: none; }
.brand span { padding: 3px 9px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font: 650 var(--text-xs)/1.2 var(--font-body); letter-spacing: 0.01em; }
.head-link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 600; text-decoration: none; }
.head-link:hover { text-decoration: underline; }
.head-link .head-icon { display: none; }
.product-switch { display: inline-flex; align-items: center; min-height: 34px; padding: 0 var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--bg-raise); color: var(--ink); font-size: var(--text-sm); font-weight: 600; text-decoration: none; white-space: nowrap; }
.product-switch sp-icon-building { width: 16px; height: 16px; margin-right: 6px; }
.product-switch:hover { border-color: var(--accent); color: var(--accent); }
.mobile-header-menu .product-switch, .mobile-header-menu .head-link { width: 100%; min-height: 44px; justify-content: flex-start; padding: 0 var(--space-3); margin: 0; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--ink); font-size: var(--text-base); }
.mobile-header-menu .product-switch:hover, .mobile-header-menu .head-link:hover { background: var(--bg-sunk); text-decoration: none; }
.mobile-header-menu .product-switch sp-icon-building, .mobile-header-menu .head-link .head-icon { width: 18px; height: 18px; flex: none; margin-right: 8px; }
.mobile-header-menu .head-link .label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
.mobile-header-menu .head-link .head-icon { display: block; }
.mobile-header-menu .head-link .head-arrow { display: none; }
.account-content { display: grid; gap: var(--space-6); }
.account-content[hidden] { display: none; }
.account-layout { grid-template-columns: minmax(180px, 220px) minmax(0, 1fr); align-items: start; }
.account-navigation { position: sticky; top: 80px; min-width: 0; }
.account-navigation > summary { display: none; }
.account-navigation sp-sidenav { display: block; width: 100%; }
.account-pages { display: grid; gap: var(--space-8); min-width: 0; }
.account-section[id] { scroll-margin-top: 88px; }
.account-overview { padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raise); }
.account-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.account-summary-card { display: grid; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg); }
.account-summary-card strong { color: var(--ink); font-size: var(--text-xl); line-height: 1.2; }
.account-summary-card span { color: var(--ink-soft); font-size: var(--text-sm); }
.account-section { display: grid; gap: var(--space-4); }
.purchase-filters { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2) var(--space-3); }
.purchase-filters > label { margin: 0; }
.purchase-filters > sp-picker { width: min(100%, 280px); }
.purchase-date-range { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2); }
.purchase-date-range[hidden] { display: none; }
.purchase-date-range ps-date-picker { display: block; flex: 1 1 220px; min-width: 0; }
.purchase-filter-status { flex-basis: 100%; margin: 0; }
.account-section > h2, .account-section-heading h2 { margin: 0; }
.account-section-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.account-section-heading #refresh { flex: none; }
.account-signout { min-height: 36px; padding: 0 var(--space-4); margin-left: var(--space-3); }
.account-dashboard-link { margin-left: auto; }
.account-signin-link { margin-left: var(--space-3); }
@media (max-width: 760px) {
  .account-layout { grid-template-columns: minmax(0, 1fr); }
  .account-navigation { top: 72px; z-index: 8; padding: 0; }
  .account-navigation > summary { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: 0 var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-raise); color: var(--ink); cursor: pointer; list-style: none; font-size: var(--text-base); }
  .account-navigation > summary::after { content: ""; width: 10px; height: 10px; margin: -5px 3px 0 auto; border: solid var(--ink-soft); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 160ms ease; }
  .account-navigation[open] > summary::after { margin-top: 5px; transform: rotate(225deg); }
  .account-navigation-label { color: var(--ink-soft); font-size: var(--text-base); }
  .account-navigation-current { font-size: var(--text-lg); font-weight: 650; }
  .account-navigation > summary::-webkit-details-marker { display: none; }
  .account-navigation[open] > summary { margin-bottom: var(--space-2); }
  .account-navigation sp-sidenav { padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-raise); box-shadow: var(--shadow-2); }
  .account-navigation sp-sidenav-item { min-height: 48px; padding-block: var(--space-2); font-size: var(--text-base); }
  .account-pages { gap: var(--space-6); }
}
/* Theme control: three icon buttons at the right of the header. */
.theme-switch { margin-left: auto; display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-raise); box-shadow: var(--shadow); }
.head-link:not([hidden]) + .theme-switch { margin-left: 0; }
.theme-switch sp-action-button { min-height: 0; width: 32px; height: 32px; padding: 0; border-radius: 9px; color: var(--ink-soft); }
.theme-switch sp-action-button::part(button) { width: 100%; height: 100%; padding: 0; border: 0; border-radius: 9px; }
.theme-switch sp-action-button:hover::part(button) { background: var(--bg-sunk); color: var(--ink); }
.theme-switch sp-action-button[aria-pressed="true"]::part(button) { background: var(--accent-soft); color: var(--accent); }
.mobile-header-menu .theme-switch { width: 100%; margin: var(--space-2) 0 0; padding: var(--space-2) 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-1); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.mobile-header-menu .theme-switch-heading { grid-column: 1 / -1; padding: var(--space-2) var(--space-1); color: var(--ink-soft); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mobile-header-menu .theme-switch sp-action-button { display: flex; width: auto; height: 40px; min-width: 0; gap: 6px; border-radius: var(--radius-control); font-size: var(--text-sm); }
.mobile-header-menu .theme-switch sp-action-button::part(button) { border: 1px solid var(--line); border-radius: var(--radius-control); }
.mobile-header-menu .theme-switch sp-action-button svg { width: 16px; height: 16px; flex: none; }
.footer { max-width: var(--page); margin: var(--space-10) auto 0; padding: var(--space-8) var(--space-5) var(--space-10); font-size: var(--text-sm); color: var(--ink-soft); border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: var(--space-2) var(--space-3); text-align: center; }
.footer a { color: inherit; text-decoration: none; transition: color 0.15s; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.foot-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 650; }
.foot-brand svg { color: var(--accent); }

/* --- Surfaces: a card is a discrete object on the page; never a card inside a card. --- */
.card { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-6); margin: var(--space-6) 0; box-shadow: var(--shadow); }
.notice { border: 1px solid var(--line); border-radius: var(--radius-control); padding: var(--space-3) var(--space-4); background: var(--accent-soft); }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
/* Shared native accordion treatment. Details keeps keyboard and screen-reader behavior built in. */
details.accordion { overflow: hidden; }
details.accordion > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-4) var(--space-5); border-radius: inherit; font-weight: 650; color: var(--ink); transition: background 0.15s, color 0.15s; }
details.accordion > summary::-webkit-details-marker { display: none; }
details.accordion > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-left: auto; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.2s ease; color: var(--ink-soft); }
details.accordion[open] > summary::after { transform: translateY(2px) rotate(225deg); }
details.accordion > summary:hover { background: var(--bg-sunk); }
details.accordion > summary:focus-visible { position: relative; z-index: 1; outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
details.accordion > summary .panel-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--accent); }
details.accordion > summary .panel-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
details.accordion > summary .panel-title { font: 600 var(--text-base)/1.35 var(--font-display); color: var(--ink); }
details.accordion > summary .panel-sub { font-size: var(--text-sm); color: var(--ink-mid); line-height: 1.4; font-weight: 400; }
details.accordion > summary .chevron { display: none; }
details.accordion[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
details.accordion > .panel-body { padding: 0 var(--space-6) var(--space-6); border-top: 1px solid var(--line); }
details.accordion > .panel-body > :first-child { margin-top: var(--space-4); }
details.accordion > .panel-body > :last-child { margin-bottom: 0; }
details.accordion:not(.card) { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raise); }
details.accordion:not(.card)[open] > summary { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
details.accordion:not(.card) > :not(summary) { margin-left: var(--space-5); margin-right: var(--space-5); }
details.accordion:not(.card) > :last-child { margin-bottom: var(--space-5); }
details.accordion:not(.card) > summary + :not(summary) { margin-top: 0; }
details.card.accordion { padding: 0; }
details.card.accordion > summary .chevron { display: none; }

/* --- Controls --- */
label { display: block; font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.01em; margin: var(--space-5) 0 var(--space-2); }
label .muted { font-weight: 400; letter-spacing: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[inputmode], textarea, select {
  width: 100%; min-height: 48px; padding: 11px var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--bg-raise); color: var(--ink); font: 400 var(--text-base)/1.4 var(--font-body);
  transition: border-color 0.15s, box-shadow 0.15s;
}
::placeholder { color: #9ca3af; opacity: 1; }
:root[data-theme="dark"] ::placeholder { color: #6b7280; }
input[type=file] { font: inherit; color: var(--ink-soft); max-width: 100%; width: 100%; padding: var(--space-3); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-control); background: var(--bg-raise); cursor: pointer; }
input[type=file]:hover { border-color: var(--accent); }
input[type=file]::file-selector-button { margin-right: var(--space-3); padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-sunk); color: var(--ink); font: 600 var(--text-sm)/1.2 var(--font-body); cursor: pointer; }
textarea { resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
.hint { margin: 6px 0 0; font-size: var(--text-xs); color: var(--ink-soft); }
.icon-button { min-height: 0; width: 40px; height: 40px; padding: 0; border-radius: var(--radius-pill); color: var(--ink); }
.icon-button::part(button) { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink); border: 1px solid var(--line); }
.icon-button:hover::part(button) { background: var(--bg-sunk); }
.button svg, sp-button svg, sp-action-button svg { flex: none; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
sp-button:focus-visible::part(button), sp-action-button:focus-visible::part(button), .button:focus-visible, a:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
select.needed { border-color: var(--alarm); box-shadow: 0 0 0 4px var(--alarm-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: var(--radius-control);
  background: var(--accent); color: var(--accent-ink); font: 600 0.95rem/1.2 var(--font-body);
  cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.button:hover { background: var(--accent-hover); box-shadow: 0 4px 14px rgba(34, 95, 230, 0.3); }
.button.secondary, .button.secondary-button { background: var(--bg-raise); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.button.secondary:hover, .button.secondary-button:hover { background: var(--bg-sunk); box-shadow: var(--shadow); }
.big { width: 100%; min-height: 52px; font-size: var(--text-base); margin-top: var(--space-6); }
#createSubmit { width: 100%; }
.big::part(button), sp-button.big::part(button) { width: 100%; min-height: 52px; }
.row { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.row input { flex: 1; min-width: 0; }
.linklike { min-height: 0; background: none; border: 0; padding: 0; color: var(--ink-soft); text-decoration: underline; font: 400 var(--text-sm)/1.4 var(--font-body); box-shadow: none; }
.linklike:hover { background: none; color: var(--ink); }
sp-button.linklike { min-height: 0; padding: 0; }
sp-button.linklike::part(button) { min-height: 0; padding: 0; border: 0; background: transparent; color: var(--ink-soft); box-shadow: none; font: 400 var(--text-sm)/1.4 var(--font-body); text-decoration: underline; }
sp-button.linklike:hover::part(button) { background: transparent; color: var(--ink); box-shadow: none; }
.link { word-break: break-all; padding: var(--space-3) var(--space-4); background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius-control); font: 400 var(--text-sm)/1.5 var(--font-mono); color: var(--ink); }
.turnstile { display: flex; align-items: flex-start; width: 100%; min-height: 65px; margin: var(--space-5) 0 0; }
.turnstile > div { max-width: 100%; }
/* Chips: suggestions to add, and pills for status. */
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 5px 12px 5px 9px; border: 1px solid transparent; border-radius: var(--radius-pill); background: var(--bg-sunk); color: var(--ink); font: 600 var(--text-xs)/1.2 var(--font-body); letter-spacing: 0.02em; }
.chip:hover { background: var(--accent-soft); color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.chip-strong { background: transparent; border-color: var(--line-strong); }
sp-button.chip { min-height: 32px; padding: 0; }
sp-button.chip::part(button) { min-height: 32px; padding: 5px 12px 5px 9px; border-color: transparent; border-radius: var(--radius-pill); background: var(--bg-sunk); color: var(--ink); font: 600 var(--text-xs)/1.2 var(--font-body); letter-spacing: 0.02em; }
sp-button.chip:hover::part(button), sp-button.chip[aria-pressed="true"]::part(button) { background: var(--accent-soft); color: var(--accent); }
sp-button.chip[aria-pressed="true"]::part(button) { border-color: var(--accent); }
sp-button.chip-strong::part(button) { background: transparent; border-color: var(--line-strong); }

/* --- Lists --- */
.queue { list-style: none; padding: 0; margin: var(--space-3) 0 0; }
.queue li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.queue li:last-child { border-bottom: 0; }
.queue progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--accent); }
.queue .state sp-button { min-height: 32px; padding: 0; font-size: var(--text-xs); margin-left: var(--space-2); }
.queue .state sp-button::part(button) { min-height: 32px; padding: 4px 10px; font-size: var(--text-xs); }

/* --- Progress bars --- */
progress { appearance: none; -webkit-appearance: none; border: 0; height: 6px; border-radius: var(--radius-pill); background: var(--bg-sunk); overflow: hidden; color: var(--accent); }
progress::-webkit-progress-bar { background: var(--bg-sunk); border-radius: var(--radius-pill); }
progress::-webkit-progress-value { background: var(--accent); border-radius: var(--radius-pill); transition: width 0.2s ease; }
progress::-moz-progress-bar { background: var(--accent); border-radius: var(--radius-pill); }

/* --- Guest upload page --- */
main.guest { max-width: 640px; }
.hero { margin-bottom: var(--space-6); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 var(--space-3); padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--bg-raise); color: var(--ink); font-size: var(--text-xs); font-weight: 650; }
.eyebrow svg { color: var(--accent); }
.hero h1 { font-size: clamp(1.9rem, 6vw, 2.5rem); }
.lead { font-size: var(--text-lg); margin: 0; }
.upload-card { padding: var(--space-6); }
.fields { display: grid; gap: var(--space-1); }
.fields label { margin-top: var(--space-3); }
.fields > div:first-child label { margin-top: 0; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: var(--space-5);
  padding: var(--space-6) var(--space-4); min-height: 0; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--bg-raise); color: var(--ink); text-align: center; transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.dropzone::part(button) { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; min-height: 0; padding: var(--space-6) var(--space-4); border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg-raise); color: var(--ink); text-align: center; white-space: normal; }
/* Hover only marks the border, so the hint keeps its contrast; a file dragged over tints it. */
.dropzone:hover::part(button) { background: var(--bg-raise); border-color: var(--accent); }
.dropzone.over::part(button) { background: var(--accent-soft); border-color: var(--accent); }
.dropzone.over { transform: scale(1.01); }
.dz-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); margin-bottom: var(--space-1); box-shadow: 0 8px 20px -8px var(--accent); }
.dz-title { font: 650 var(--text-lg)/1.3 var(--font-display); }
.dz-hint { font: 400 var(--text-sm)/1.4 var(--font-body); color: var(--ink-soft); }
.dz-drag { display: none; }
@media (hover: hover) and (pointer: fine) { .dz-drag { display: inline; } }
.progress-head { margin-top: var(--space-5); display: grid; gap: var(--space-2); }
.progress-head p { margin: 0; font-weight: 650; font-size: var(--text-sm); }
.progress-head progress { width: 100%; height: 8px; }
.uploads { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(130px, 40%), 1fr)); gap: var(--space-3); }
.upload { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg-raise); overflow: hidden; font-size: var(--text-xs); }
.upload .thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; min-height: 0; padding: 0; border-radius: 0; color: var(--ink-soft); cursor: zoom-in; overflow: hidden; }
.upload .thumb::part(button) { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: var(--bg-sunk); color: var(--ink-soft); }
.upload .thumb:hover::part(button) { background: var(--bg-sunk); }
.upload .thumb img, .upload .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.upload .thumb:hover img, .upload .thumb:hover video { transform: scale(1.04); }
.upload .badge { position: absolute; left: 8px; bottom: 8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--radius-pill); background: rgba(15, 23, 42, 0.72); color: #fff; }
.upload .meta { display: grid; grid-template-columns: 1fr auto; gap: 2px var(--space-2); padding: var(--space-2) var(--space-3) var(--space-3); }
.upload .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--ink); }
.upload .size { color: var(--ink-soft); text-align: right; }
.upload .state { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-weight: 600; }
.upload .state sp-button { min-height: 28px; padding: 0; font-size: var(--text-xs); }
.upload .state sp-button::part(button) { min-height: 28px; padding: 2px 10px; font-size: var(--text-xs); }
.upload progress { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 4px; border-radius: 0; }
.upload[data-state="done"] progress, .upload[data-state="failed"] progress { display: none; }
.upload[data-state="done"]::after { content: ''; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: var(--radius-pill); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); }
.upload[data-state="failed"] { border-color: var(--alarm); }
.report-line { text-align: center; margin-top: var(--space-6); }

/* --- Full preview (guest) --- */
.viewer { width: min(960px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raise); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); overflow: hidden; }
.viewer::backdrop { background: rgba(10, 12, 16, 0.72); backdrop-filter: blur(4px); }
.viewer[open] { display: flex; flex-direction: column; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: 1px solid var(--line); }
.viewer-bar > div { min-width: 0; }
.viewer-name { margin: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-state { margin: 0; font-size: var(--text-sm); color: var(--ink-soft); }
.viewer-media { display: grid; place-items: center; background: #0b0c0e; min-height: 240px; }
.viewer-media img, .viewer-media video { display: block; max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.viewer-empty { color: #cbd5e1; padding: var(--space-8); text-align: center; margin: 0; }
.chips { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-pill); font-size: var(--text-sm); line-height: 1.2; background: var(--bg-raise); }
/* Remove button: a round icon button, its × centred. */
.chips .chip-remove { display: inline-grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; border-radius: var(--radius-pill); color: var(--ink-soft); }
.chips .chip-remove::part(button) { display: grid; place-items: center; width: 24px; height: 24px; min-height: 0; padding: 0; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--ink-soft); box-shadow: none; }
.chips .chip-remove:hover::part(button) { background: var(--bg-sunk); color: var(--alarm); box-shadow: none; }

/* --- QR codes and share cards. Inside a panel a share card is flat (no card inside a card). --- */
.qr { background: #fff; padding: var(--space-3); border-radius: var(--radius-sm); display: block; width: fit-content; border: 1px solid var(--line); }
.qr img { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
#shareCards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.share { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: var(--space-3); }
.share h3, .share .link { margin: 0; }
/* The QR code, title and buttons sit on the card's centre line; the link spans the width. */
.share { align-items: center; text-align: center; }
.share .link { align-self: stretch; text-align: left; }
.share .row { justify-content: center; }
.card .share { background: transparent; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; padding: var(--space-4) 0 0; }

/* --- Host gallery --- */
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-5) 0; }
.filters .tabs { margin: 0; }
.uploader-filter { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.uploader-filter label { margin: 0; white-space: nowrap; color: var(--ink-soft); }
.uploader-filter select { width: auto; min-width: 180px; min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: var(--space-4) 0; }
.tabs sp-button { min-height: 36px; padding: 0; border-radius: var(--radius-pill); font-size: var(--text-sm); }
.tabs sp-button::part(button) { min-height: 36px; padding: 6px 14px; border-radius: var(--radius-pill); font-size: var(--text-sm); }
.tabs sp-button[aria-pressed="false"]::part(button) { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.tabs sp-button[aria-pressed="false"]:hover::part(button) { background: var(--bg-sunk); }
.group { margin: var(--space-6) 0; }
.group-head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-3); }
.avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font: 700 var(--text-sm)/1 var(--font-display); }
.group-head .who-text { display: grid; gap: 0; }
.group-head h2 { margin: 0; }
.group-head .who-text span { font-size: var(--text-sm); }
.group .more { margin-top: var(--space-3); width: 100%; }
.group-head sp-button { margin-left: auto; min-height: 36px; padding: 0; font-size: var(--text-sm); }
.group-head sp-button::part(button) { min-height: 36px; padding: 6px 14px; font-size: var(--text-sm); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-2); }
.gallery-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: var(--space-6) 0 var(--space-3); }
.gallery-header h2 { margin: 0; }
.gallery-header p { margin: 4px 0 0; color: var(--ink-soft); font-size: var(--text-sm); }
.gallery-header > span { font-size: var(--text-sm); }
.tile { position: relative; aspect-ratio: 1; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius-control); overflow: hidden; cursor: zoom-in; transition: box-shadow 0.2s, transform 0.2s; }
.tile:hover { box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.45); transform: translateY(-1px); }
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.tile:hover img { transform: scale(1.04); }
.tile .kind { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; color: var(--ink-soft); font-size: var(--text-sm); }
.tile .who { position: absolute; left: 0; right: 0; bottom: 0; padding: 20px 8px 6px; font-size: var(--text-xs); color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.6)); }
.tile .del, .tile .mod { position: absolute; min-height: 0; border: 0; color: #fff; background: rgba(15, 23, 42, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: 11px; font-weight: 650; transition: opacity 0.15s, background 0.15s; }
.tile .del { top: 8px; right: 8px; width: 30px; height: 30px; padding: 0; border-radius: var(--radius-pill); }
.tile .del:hover { background: var(--alarm); }
.tile .mod { bottom: 8px; right: 8px; padding: 4px 10px; border-radius: var(--radius-pill); }
.tile .mod:hover { background: rgba(15, 23, 42, 0.88); }
.tile .kind svg { opacity: 0.7; }
/* On a mouse, a tile's buttons appear on hover or focus; touch screens always show them. */
@media (hover: hover) and (pointer: fine) {
  .tile .del, .tile .mod { opacity: 0; }
  .tile:hover .del, .tile:hover .mod, .tile:focus-within .del, .tile:focus-within .mod { opacity: 1; }
}
.tile.off-show img, .tile.off-show .kind { opacity: 0.45; }
.tile.off-show::after { content: 'Not on slideshow'; position: absolute; top: 50%; left: 0; right: 0; text-align: center; font-size: 12px; color: #fff; text-shadow: 0 1px 4px #000; pointer-events: none; }
.photo-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); gap: var(--space-4); align-items: stretch; }
.host-photo-item.tile { display: grid; width: 100%; min-width: 0; align-content: start; gap: var(--space-2); aspect-ratio: auto; overflow: visible; border: 0; border-radius: var(--radius-md); background: transparent; cursor: default; transition: none; }
.host-photo-item.tile:hover { box-shadow: none; transform: none; }
.host-photo-card { width: 100%; min-width: 0; --mod-card-minimum-width: 0; --mod-card-preview-minimum-height: 180px; }
.host-photo-card img.host-photo-preview { display: block; width: 100%; height: 100%; min-height: 0; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-control); background: var(--bg-sunk); cursor: zoom-in; transform: none; transition: none; }
.host-photo-item .host-photo-placeholder { display: grid; width: 100%; min-height: 0; aspect-ratio: 4 / 3; place-items: center; overflow: hidden; border-radius: var(--radius-control); color: var(--ink-soft); font-size: var(--text-sm); background: var(--bg-sunk); cursor: zoom-in; }
.host-photo-details { display: grid; gap: 3px; color: var(--ink-soft); font-size: var(--text-xs); }
.host-photo-item .host-photo-details .who { position: static; padding: 0; color: var(--ink); background: none; font-size: var(--text-sm); font-weight: 650; }
.host-photo-actions { display: flex; width: 100%; flex-wrap: wrap; gap: 6px; }
.host-photo-item .host-photo-actions .fav, .host-photo-item .host-photo-actions .mod, .host-photo-item .host-photo-actions .del { position: static; width: auto; height: auto; min-height: 36px; padding: 0; border: 0; border-radius: var(--radius-control); color: var(--ink); background: transparent; opacity: 1; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; font-size: var(--text-sm); }
.host-photo-item .host-photo-actions .fav[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.host-photo-item .host-photo-actions .del:hover { color: var(--alarm); background: var(--bg-sunk); }
.host-photo-actions sp-button { flex: 1 1 calc(33% - 6px); min-width: 0; }
.host-photo-actions sp-button::part(button) { width: 100%; }
.gallery-empty { display: grid; justify-items: start; gap: var(--space-2); margin: var(--space-6) 0; padding: clamp(24px, 5vw, 48px); border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--bg-raise); }
.gallery-empty h2, .gallery-empty p { margin: 0; }
.gallery-empty p { max-width: 44rem; color: var(--ink-soft); }
.gallery-empty sp-button { margin-top: var(--space-2); }
.host-photo-card.off-show img.host-photo-preview { opacity: .65; }

/* --- Host page --- */
.host-head { margin-bottom: var(--space-5); }
.stats { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0 0; color: var(--ink-soft); }
.stat { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--bg-raise); font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
.stat.live { border-color: var(--ok-soft); }
.stat.live::before { content: ''; width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.stat.closed { color: var(--ink-soft); background: var(--bg-sunk); }
.toolbar-card { padding: var(--space-4); }
.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.toolbar #refresh { margin-left: auto; }
.icon-only { width: 44px; padding: 0; }
sp-button.small { min-height: 34px; padding: 0 12px; font-size: var(--text-sm); }
.toolbar-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.toolbar-card #status:empty { display: none; }
.toolbar-card .notice { margin-top: var(--space-4); }
.section-title { margin: var(--space-8) 0 var(--space-3); font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); font-family: var(--font-body); font-weight: 700; }
.section-title + details.card { margin-top: 0; }
details.card + details.card { margin-top: var(--space-3); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 var(--space-4); margin-bottom: var(--space-3); }

/* A checkbox drawn as a switch: the input itself is the track, and its knob is a background circle. */
.switch { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; font-weight: 500; font-size: var(--text-base); cursor: pointer; }
.switch input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: radial-gradient(circle at 12px 50%, #fff 8.5px, transparent 9.5px), var(--line-strong);
  transition: background-color 0.2s, background-position 0.2s;
}
.switch input[type=checkbox]:checked { background: radial-gradient(circle at 28px 50%, #fff 8.5px, transparent 9.5px), var(--accent); }
.switch input[type=checkbox]:disabled { opacity: 0.5; cursor: default; }
.toolbar-foot .switch { margin: 0; font-size: var(--text-sm); }

/* --- Legal pages --- */
.prose h2 { margin-top: var(--space-8); }
.prose li { margin: 6px 0; }
.prose ul { padding-left: 1.2em; }

/* --- Toasts: results of what the user just did (design doc), never lines in the page --- */
.toasts { position: fixed; left: 50%; bottom: var(--space-6); transform: translateX(-50%); display: flex; flex-direction: column; gap: var(--space-2); z-index: 1000; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; padding: var(--space-3) var(--space-4); border-radius: var(--radius-control); background: var(--ink); color: var(--bg); font-size: var(--text-sm); font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45); border-left: 4px solid var(--accent); }
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--alarm); }

/* --- Slideshow (TV) --- */
.show-body { background: #000; color: #fff; overflow: hidden; cursor: none; font-family: var(--font-body); }
.show-stage { position: fixed; inset: 0; }
.show-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.2s ease; }
.show-slide.shown { opacity: 1; }
/* The one place type follows the screen: it fills a TV across a room. */
.show-title { position: fixed; top: 24px; left: 32px; font: 700 clamp(18px, 2.4vw, 36px)/1.1 var(--font-display); letter-spacing: -0.02em; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.show-caption { position: fixed; bottom: 28px; left: 32px; font-size: clamp(14px, 1.6vw, 24px); font-weight: 600; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
.show-join { position: fixed; bottom: 24px; right: 24px; display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: var(--radius-control); background: rgba(15, 23, 42, 0.7); font-size: clamp(12px, 1.1vw, 18px); }
.show-join .qr { padding: 6px; border: 0; }
.show-join .qr img { width: clamp(72px, 8vw, 140px); height: auto; }
.show-join span { display: block; opacity: 0.8; }
.show-empty { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; padding: 32px; font-size: clamp(18px, 2vw, 32px); opacity: 0.85; }
.show-paused { position: fixed; top: 24px; right: 32px; padding: 6px 12px; border-radius: var(--radius-sm); background: rgba(15, 23, 42, 0.7); }

@media (max-width: 480px) {
  main { padding-top: var(--space-6); }
  .card > .row > button, .card > .row > .button, .card > .row > sp-button { flex: 1 1 auto; }
  .card { padding: var(--space-5); }
  .site-head .inner { padding: 0 var(--space-4); }
  .site-head .inner { flex-wrap: nowrap; justify-content: space-between; min-width: 0; }
  .account-section-heading { align-items: flex-start; flex-wrap: wrap; }
  .account-section-heading #refresh { margin-left: auto; }
  .account-signout { min-height: 36px; padding: 0 var(--space-3); }
  .account-dashboard-link { font-size: var(--text-xs); }
  .brand { font-size: var(--text-sm); }
  .qr img { width: 180px; height: 180px; }
  .upload-card { padding: var(--space-4); }
  .uploads { gap: var(--space-2); }
}

/* --- Home page: a hero, the form beside a process animation, then a privacy note. --- */
main.home { max-width: var(--page); padding-top: var(--space-16); }
.hero { margin-bottom: var(--space-10); }
.hero h1 { font-size: clamp(2.125rem, 5vw, 3rem); line-height: 1.17; }
.trust-pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 var(--space-5); padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--bg-raise); color: var(--ink); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; box-shadow: var(--shadow); }
.trust-pill .dot { width: 8px; height: 8px; border-radius: var(--radius-pill); background: var(--warm); box-shadow: 0 0 0 3px var(--warm-soft); }
.trust-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-5); padding: 0; list-style: none; }
.trust-tag { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 12px; border: 1px solid var(--warm-soft); border-radius: var(--radius-pill); background: var(--bg-raise); color: var(--ink); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; box-shadow: var(--shadow); }
.trust-tag .dot { width: 8px; height: 8px; flex: none; border-radius: var(--radius-pill); background: var(--warm); box-shadow: 0 0 0 3px var(--warm-soft); }
.lead { font-size: var(--text-lg); line-height: 1.6; color: var(--ink-soft); margin: 0 0 var(--space-6); }
.feature-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.feature-chips li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--bg-raise); font-size: var(--text-sm); font-weight: 500; }
.feature-chips svg { color: var(--accent); }
.home-grid { display: grid; gap: var(--space-8); align-items: start; min-width: 0; }
.home-main { min-width: 0; }
/* Desktop: the form takes 60%, the process animation 40%, with a hairline between them. */
@media (min-width: 1024px) {
  .home-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0; }
  .home-main { padding-right: var(--space-10); }
  .preview { padding-left: var(--space-10); border-left: 1px solid var(--line); align-self: stretch; }
}
.form-card { margin: 0; padding: var(--space-8); border-radius: var(--radius-xl); }
.card-head { display: flex; align-items: center; gap: var(--space-3); padding-bottom: var(--space-5); margin-bottom: var(--space-2); border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; font-size: var(--text-xl); }
.card-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--accent); flex: none; }
.step-pill { margin-left: auto; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--bg-sunk); color: var(--ink); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.done-pill { background: var(--ok-soft); color: var(--ok-ink); }
.suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: var(--space-3); }
.suggest-label { font-size: var(--text-xs); color: var(--ink-soft); font-weight: 600; margin-right: 2px; }
.form-card .chips:not(:empty) { margin-top: var(--space-3); }
.form-card .big svg { transition: transform 0.15s; }
.form-card .big:hover svg { transform: translateX(3px); }
#created #shareCards { margin: var(--space-4) 0 var(--space-6); }
.host-box { padding: var(--space-5); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--accent-soft); }
.host-box h3 { display: flex; align-items: center; gap: 8px; font-size: var(--text-base); }
.host-box h3 svg { color: var(--accent); }
.host-box .link { background: var(--bg-raise); }
/* Secondary text on a tinted surface is a step darker, so it keeps its contrast. */
.host-box .muted, .notice, .notice .muted { color: var(--ink-mid); }
.host-box > :last-child { margin-bottom: 0; }
.host-box .row { margin-bottom: var(--space-3); }

.preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.preview-head h2 { margin: 0; font-size: var(--text-xl); }
.preview-head p { margin: 2px 0 0; font-size: var(--text-sm); }
.ready-pill { padding: 4px 10px; border-radius: var(--radius-pill); background: var(--teal-soft); color: var(--teal-ink); font-size: var(--text-xs); font-weight: 650; white-space: nowrap; }
.preview-frame { padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--bg-raise); box-shadow: var(--shadow-2); display: grid; gap: var(--space-4); }

/* The home page process animation: QR scan, shared album, then download and expiry. */
.concept { display: block; width: 100%; margin: 0; }
.concept svg { display: block; width: min(100%, 440px); height: auto; margin: 0 auto; overflow: visible; }
.concept .phone-body { fill: var(--bg-raise); stroke: var(--line-strong); stroke-width: 1.5; }
.concept .phone-screen { fill: var(--bg-sunk); }
.concept .album { fill: var(--bg-raise); stroke: var(--line); stroke-width: 1.5; filter: drop-shadow(0 12px 24px rgba(15, 23, 42, 0.12)); }
.concept .album-title { fill: var(--ink); font: 650 15px var(--font-display); }
.concept .slots rect { fill: none; stroke: var(--line-strong); stroke-width: 1.2; stroke-dasharray: 4 4; }
.concept .photo-a { fill: var(--accent); }
.concept .photo-b { fill: #0891b2; }
.concept .photo-c { fill: #f59e0b; }
.concept .qr-card { fill: #fff; stroke: var(--line); }
.concept .qr-code { fill: #0f172a; }
.concept .qr-pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.concept .scanline { fill: var(--accent); opacity: 0; }
.concept .download-pill { fill: var(--accent); }
.concept .download-arrow { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.concept .download-text { fill: var(--accent-ink); font: 650 13px var(--font-body); }
.concept .download { opacity: 0; }
.concept .fly { opacity: 0; }
.concept .fly1 { --dx: 56px; --dy: 222px; }
.concept .fly2 { --dx: 4px; --dy: 222px; }
.concept .fly3 { --dx: -48px; --dy: 222px; }
.concept .fly4 { --dx: 4px; --dy: 278px; }
.concept .fly5 { --dx: 56px; --dy: 278px; }
.concept .fly6 { --dx: -48px; --dy: 278px; }
.concept-steps { position: relative; height: 56px; margin-top: var(--space-4); text-align: left; }
.concept-steps .step { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; gap: var(--space-3); font: 600 var(--text-base)/1.4 var(--font-body); color: var(--ink); opacity: 0; }
.concept-steps b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font-size: var(--text-sm); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .concept .scanline { animation: concept-scan 10s ease-in-out infinite; }
  .concept .s2 { animation-delay: 0.25s; }
  .concept .s3 { animation-delay: 0.5s; }
  .concept .qr-pulse { animation: concept-pulse 10s ease-out infinite; }
  .concept .fly { animation: concept-fly 10s cubic-bezier(0.45, 0, 0.2, 1) infinite; }
  .concept .fly2 { animation-delay: 0.3s; }
  .concept .fly3 { animation-delay: 0.6s; }
  .concept .fly4 { animation-delay: 0.9s; }
  .concept .fly5 { animation-delay: 1.2s; }
  .concept .fly6 { animation-delay: 1.5s; }
  .concept .download { animation: concept-appear 10s ease-in-out infinite; }
  .concept-steps .step1 { animation: concept-step1 10s ease-in-out infinite; }
  .concept-steps .step2 { animation: concept-step2 10s ease-in-out infinite; }
  .concept-steps .step3 { animation: concept-step3 10s ease-in-out infinite; }
}
@keyframes concept-scan { 0% { opacity: 0; transform: translateY(0); } 4% { opacity: .9; } 26% { opacity: .9; transform: translateY(120px); } 30%,100% { opacity: 0; transform: translateY(120px); } }
@keyframes concept-pulse { 0%,4% { opacity: 0; transform: scale(1); } 10% { opacity: .8; } 28% { opacity: 0; transform: scale(1.35); } 100% { opacity: 0; } }
@keyframes concept-fly { 0%,30% { opacity: 0; transform: translate(0,0); } 33% { opacity: 1; transform: translate(0,0); } 50%,90% { opacity: 1; transform: translate(var(--dx),var(--dy)); } 97%,100% { opacity: 0; transform: translate(var(--dx),var(--dy)); } }
@keyframes concept-appear { 0%,62% { opacity: 0; } 67%,88% { opacity: 1; } 95%,100% { opacity: 0; } }
@keyframes concept-step1 { 0% { opacity: 0; } 3%,27% { opacity: 1; } 31%,100% { opacity: 0; } }
@keyframes concept-step2 { 0%,31% { opacity: 0; } 35%,59% { opacity: 1; } 63%,100% { opacity: 0; } }
@keyframes concept-step3 { 0%,63% { opacity: 0; } 67%,92% { opacity: 1; } 96%,100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .concept .fly { opacity: 1; transform: translate(var(--dx),var(--dy)); }
  .concept .download { opacity: 1; }
  .concept-steps { height: auto; display: grid; gap: var(--space-2); }
  .concept-steps .step { position: static; opacity: 1; }
}

.privacy-banner { margin-top: var(--space-10); display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--accent-soft); }
.privacy-banner > div { flex: 1; min-width: 240px; }
.privacy-banner h2 { font-size: var(--text-lg); margin-bottom: 4px; }
.privacy-banner p { margin: 0; font-size: var(--text-sm); color: var(--ink-mid); }
.banner-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius-control); background: var(--accent); color: var(--accent-ink); flex: none; }

@media (max-width: 600px) {
  main.home { padding-top: var(--space-8); }
  .form-card { padding: var(--space-5); }
  .lead { font-size: var(--text-base); }
}

/* --- Admin --- */
main.wide { max-width: 1120px; }
main.host { max-width: 90%; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-weight: 600; color: var(--ink-soft); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: var(--space-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.table .actions sp-button { min-height: 34px; padding: 0; font-size: var(--text-sm); }
.table .actions sp-button::part(button) { min-height: 34px; padding: 4px 12px; font-size: var(--text-sm); }

/* --- Drop for Studios: dashboard --- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow-text { margin: 0 0 var(--space-2); color: var(--accent); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.dash-head h1 { margin-bottom: 0; }
.dash-grid { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.dash-grid > .card, .dash-side > .card { margin: 0; }
.dash-side { display: grid; gap: var(--space-6); }
.dash-grid .card-head h2 { font-size: var(--text-lg); }
.dash-grid .card-head sp-button { margin-left: auto; min-height: 38px; padding: 0; }
.dash-grid .card-head sp-button::part(button) { min-height: 38px; padding: 6px 14px; }
.sub-form { padding: var(--space-4) var(--space-5) var(--space-5); margin-bottom: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); }
.sub-form > label:first-child { margin-top: 0; }
.big-number { margin: var(--space-2) 0; font: 700 2.25rem/1 var(--font-display); letter-spacing: -0.02em; }
.big-number .muted { font-size: var(--text-sm); font-weight: 500; letter-spacing: 0; }
.buy { display: grid; gap: var(--space-2); margin: var(--space-4) 0 var(--space-2); }
.member-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; }
.member-list li { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.member-list li > :first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.member-list li:last-child { border-bottom: 0; }
.table td b { font-weight: 650; }
.logo-row { display: flex; align-items: center; gap: var(--space-3); }
.logo-row img { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
input[type=color] { width: 48px; height: 48px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--bg-raise); cursor: pointer; flex: none; }
#brandPanel { margin-top: var(--space-6); }

/* --- Drop for Studios: a studio's brand on its events' pages (js/brand.js) --- */
/* The studio's colour applies in light; dark keeps Drop's accent, which is tuned to stay readable there. */
:root[data-theme="light"][data-branded] { --accent: var(--brand-accent); --accent-hover: var(--brand-accent); }
.studio-logo { width: 36px; height: 36px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; }
.studio-name { font: 700 var(--text-base)/1.2 var(--font-display); }
.photos-by { width: 100%; margin: 0 0 var(--space-2); color: var(--ink); font-weight: 600; }
.photos-by a { color: var(--accent); text-decoration: underline; }
.welcome { margin: var(--space-3) 0 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-raise); font-size: var(--text-base); }
.share-invite { margin-top: var(--space-4); min-height: 40px; padding: 8px 14px; background: var(--bg-raise); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow); }
.share-invite:hover { background: var(--bg-sunk); }
.show-title[data-by]::after { content: attr(data-by); display: block; margin-top: 6px; font-size: 0.55em; font-weight: 600; opacity: 0.85; }

/* Favourites and the photographer's files on the host gallery. */
.tile .fav { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: var(--radius-pill); color: #fff; background: rgba(15, 23, 42, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tile .fav[aria-pressed="true"] { color: #facc15; opacity: 1; }
.tile .fav[aria-pressed="true"] path { fill: currentColor; }
@media (hover: hover) and (pointer: fine) { .tile .fav:not([aria-pressed="true"]) { opacity: 0; } .tile:hover .fav, .tile:focus-within .fav { opacity: 1; } }
.tile.from-host::before { content: 'Photographer'; position: absolute; z-index: 1; left: 44px; top: 12px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }
.host-photo-item .host-photo-actions .fav:not([aria-pressed="true"]) { opacity: 1; }

.danger-zone { margin-top: var(--space-6); }
sp-button.danger::part(button) { color: var(--alarm); }
sp-button.danger:hover::part(button) { background: var(--alarm-soft); }

/* Event discovery and studio calls to action share the site's theme tokens. */
.studio-actions,.discovery-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:18px 0}
.studio-actions a{display:inline-flex;padding:12px 18px;border:1px solid currentColor;border-radius:12px;text-decoration:none;font-weight:700}
.discovery-panel{margin:24px 0;padding:24px}.discovery-panel h2{margin-top:0}.discovery-panel details{margin:18px 0}.discovery-panel input[type=file]{display:block;margin:12px 0;max-width:100%}.discovery-panel details.accordion > :not(summary){line-height:1.55}.discovery-panel details.accordion > label{margin-left:var(--space-5);margin-right:var(--space-5)}.discovery-panel details.accordion > sp-button{margin:0 0 var(--space-3) var(--space-5)}.discovery-row input{flex:1;min-width:180px}.discovery-row .muted{flex:1;min-width:200px}
.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:16px}.photo-card{min-width:0;border:1px solid var(--line,#cbd5e1);border-radius:14px;padding:12px;overflow:hidden}.photo-card img{width:100%;height:180px;object-fit:cover;border-radius:8px;background:#dce1e7}.photo-card p{overflow-wrap:anywhere;font-size:14px}.photo-card sp-button{width:100%}.photo-card sp-button::part(button){width:100%}.discovery-panel [hidden],.discovery-row[hidden],.studio-actions[hidden]{display:none}
@media(max-width:520px){.photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.photo-card img{height:130px}.discovery-panel{padding:16px}.discovery-row input{width:100%;flex-basis:100%}}
.studio-comparison{margin:64px auto 32px;max-width:1100px;padding:24px 0}.studio-comparison h2{font-size:clamp(28px,4vw,44px);line-height:1.15;max-width:850px}.comparison-scroll{overflow-x:auto;border:1px solid var(--line,#cbd5e1);border-radius:16px;margin:24px 0}.studio-comparison table{width:100%;min-width:650px;border-collapse:collapse;text-align:left;font-size:15px}.studio-comparison caption{text-align:left;padding:18px;font-weight:700}.studio-comparison th,.studio-comparison td{padding:18px;vertical-align:top;border-top:1px solid var(--line,#cbd5e1)}.studio-comparison th{font-weight:650}.studio-comparison thead{background:var(--bg-sunk);color:var(--ink,#172130)}.comparison-sources{font-size:13px;line-height:1.7}
.studio-demo-video,.studio-demo-graphic{display:block;width:100%;height:auto;border-radius:16px;margin:24px 0}.studio-comparison,.discovery-panel{scroll-margin-top:90px}

/* Studio-first comparison: the buying reasons lead; shared features sit in details. */
.studio-benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;margin:32px 0}
.studio-benefit{padding:26px;border:1px solid var(--line);border-radius:20px;background:var(--bg-raise)}
.benefit-number{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;background:var(--accent-soft);color:var(--accent);border-radius:12px;font-weight:750}
.studio-benefit h3,.studio-choice h3{font-size:23px;line-height:1.3;margin:20px 0 14px}.studio-benefit p{color:var(--ink-mid)}.studio-benefit .benefit-payoff{font-weight:700;color:var(--accent);padding-top:14px;border-top:1px solid var(--line)}
.studio-choice{display:grid;grid-template-columns:1fr 1.25fr;gap:20px;margin:28px 0}.studio-choice article{padding:28px;border-radius:20px;background:var(--bg-sunk)}.studio-choice .studio-choice-drop{background:var(--accent-soft);border:2px solid var(--accent)}.studio-choice ul{padding-left:20px}.studio-choice li{margin:12px 0}
.comparison-detail{margin:28px 0}.comparison-detail .comparison-scroll{margin:0 var(--space-5) var(--space-5)}.comparison-detail > p{margin:0 var(--space-5) var(--space-4)}.studio-comparison-cta{padding:28px 0}.studio-comparison-cta h3{font-size:28px;line-height:1.3}
@media(max-width:760px){.studio-benefits,.studio-choice{grid-template-columns:1fr}.studio-benefit{padding:22px}.studio-choice article{padding:24px}.studio-comparison-cta h3{font-size:24px}}
.package-picker{margin:24px 0;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--bg-raise)}.package-picker h2{line-height:1.2;font-size:26px}.package-picker select,.package-picker sp-picker{display:block;width:100%;margin:8px 0 16px}.package-picker [data-price]{font-size:24px;font-weight:750;color:var(--accent)}

.package-unit-control{display:flex;align-items:center;gap:10px;margin:8px 0 16px;min-width:0}.package-picker .package-unit-control select,.package-picker .package-unit-control sp-picker{flex:1;min-width:0;width:0;margin:0}.package-unit{flex-shrink:0;text-align:right;color:var(--ink-mid);font-size:14px}

/* Keep the comparison film and its controls visible below the sticky header. */
.studio-comparison-video{width:auto;max-width:100%;max-height:calc(100vh - 120px);max-height:min(640px,calc(100svh - 120px));object-fit:contain;margin:24px auto;scroll-margin-top:88px}

/* Host page: keep stacked controls apart (the approval toggle, Revoke album links, and the account link). */
.toolbar-foot { margin-bottom: var(--space-3); }
#claimAccount { margin-top: var(--space-3); }

/* Custom package: one entry per row (storage, uploading devices, hosting, then each search option). */
.package-picker .settings-grid { grid-template-columns: 1fr; }
.package-picker .package-unit-control { width: 100%; }
/* Drop period: the select takes its own row; a custom number of days sits beneath it with its unit. */
.package-picker .package-unit-control--stacked { flex-wrap: wrap; row-gap: var(--space-2); }
.package-picker .package-unit-control--stacked select,.package-picker .package-unit-control--stacked sp-picker { flex: 1 1 100%; width: 100%; }
.package-picker .package-unit-control--stacked input[type=number] { flex: 1 1 auto; width: 0; min-width: 0; margin: 0; }
.package-picker .package-unit-control--stacked .package-unit { flex: 0 0 auto; padding-left: var(--space-2); }
/* Consumer checkout: a clear progress state beside the package being purchased. */
.checkout-page { width: min(960px, calc(100% - 32px)); max-width: 960px; padding: clamp(32px, 6vw, 64px) 0 80px; margin: 0 auto; }
.checkout-page > h1 { max-width: 720px; margin: 0; font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.035em; line-height: 1.08; }
.checkout-intro { max-width: 660px; color: var(--ink-soft); font-size: var(--text-lg); margin: 14px 0 32px; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr); gap: 20px; align-items: start; }
.checkout-card, .checkout-summary { margin: 0; padding: clamp(20px, 3vw, 30px); }
.checkout-card-title { margin: 0 0 24px; font-size: var(--text-lg); }
.checkout-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0 0 28px; padding: 0; position: relative; }
.checkout-progress::before { content: ""; position: absolute; top: 15px; left: 16%; right: 16%; height: 2px; background: var(--line); }
.checkout-progress li { position: relative; display: grid; justify-items: center; gap: 8px; color: var(--ink-soft); text-align: center; }
.checkout-progress li span { width: 32px; height: 32px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 50%; background: var(--bg); font-size: var(--text-sm); font-weight: 700; }
.checkout-progress li small { font-size: var(--text-xs); font-weight: 650; }
.checkout-progress[data-stage="1"] li[data-step="1"], .checkout-progress[data-stage="2"] li[data-step="2"], .checkout-progress[data-stage="3"] li[data-step="3"] { color: var(--accent); }
.checkout-progress[data-stage="1"] li[data-step="1"] span, .checkout-progress[data-stage="2"] li[data-step="2"] span, .checkout-progress[data-stage="3"] li[data-step="3"] span { border-color: var(--accent); color: var(--accent); }
.checkout-progress[data-stage="2"] li[data-step="1"] span, .checkout-progress[data-stage="3"] li[data-step="1"] span, .checkout-progress[data-stage="3"] li[data-step="2"] span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.checkout-state { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: start; gap: 14px; min-height: 100px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-sunk); }
.checkout-state-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--accent-soft); }
.checkout-state-icon::before { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: checkout-spin 0.8s linear infinite; }
.checkout-state[data-state="ready"] .checkout-state-icon::before { content: "↗"; width: auto; height: auto; border: 0; animation: none; font-size: 22px; font-weight: 700; }
.checkout-state[data-state="checking"] .checkout-state-icon::before { width: 12px; height: 20px; border: 0; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; border-radius: 0; animation: none; transform: rotate(45deg) translate(-2px, -2px); }
.checkout-state[data-state="paid"] .checkout-state-icon { color: var(--ok); background: var(--ok-soft); }
.checkout-state[data-state="paid"] .checkout-state-icon::before { content: "✓"; width: auto; height: auto; border: 0; animation: none; font-size: 22px; font-weight: 750; }
.checkout-state[data-state="error"] .checkout-state-icon { color: var(--alarm); background: var(--alarm-soft); }
.checkout-state[data-state="error"] .checkout-state-icon::before { content: "!"; width: auto; height: auto; border: 0; animation: none; font-size: 22px; font-weight: 750; }
.checkout-state h3 { margin: 1px 0 5px; font-size: var(--text-base); }
.checkout-state p { margin: 0; color: var(--ink-soft); line-height: 1.5; }
.checkout-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.checkout-actions sp-button { min-height: 46px; }
.checkout-actions sp-button::part(button) { min-height: 46px; }
.checkout-safe { margin: 18px 0 14px; font-size: var(--text-xs); line-height: 1.55; }
.checkout-back { display: inline-block; font-size: var(--text-sm); }
.checkout-summary .eyebrow-text { margin-bottom: 6px; }
.checkout-summary h2 { margin: 0 0 22px; font-size: var(--text-lg); }
.checkout-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.checkout-line strong { font-size: var(--text-lg); white-space: nowrap; }
.checkout-specs { display: grid; gap: 0; margin: 8px 0 18px; }
.checkout-specs div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: var(--text-sm); }
.checkout-specs dt { color: var(--ink-soft); }
.checkout-specs dd { margin: 0; font-weight: 650; text-align: right; }
.checkout-summary-note { margin: 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--accent-soft); color: var(--ink); font-size: var(--text-xs); line-height: 1.5; }
@keyframes checkout-spin { to { transform: rotate(360deg); } }
@media (max-width: 700px) {
  .checkout-page { margin-top: 28px; }
  .checkout-intro { margin-bottom: 22px; font-size: var(--text-base); }
  .checkout-layout { grid-template-columns: 1fr; gap: 14px; }
  .checkout-summary { order: 0; }
  .checkout-progress { margin-bottom: 22px; }
  .checkout-state { padding: 16px; }
  .checkout-actions { flex-direction: column; }
  .checkout-actions sp-button, .checkout-actions sp-button::part(button) { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .checkout-state-icon::before { animation: none; } }

/* Show a stable handoff screen while a paid order is restored and its drop is created. */
.payment-return-progress { display: none; align-items: center; gap: 18px; margin: 0 0 var(--space-6); padding: clamp(24px, 5vw, 40px); }
.payment-return-progress .eyebrow-text { margin-bottom: var(--space-2); }
.payment-return-progress h2 { margin-bottom: var(--space-2); font-size: clamp(24px, 4vw, 32px); }
.payment-return-progress p:last-child { margin: 0; }
.payment-return-spinner { flex: 0 0 auto; width: 34px; height: 34px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: checkout-spin 0.8s linear infinite; }
html[data-payment-return="true"] #create { display: none !important; }
html[data-payment-return="true"] #paymentReturnProgress { display: flex; }
@media (max-width: 520px) { .payment-return-progress { align-items: flex-start; padding: 22px; } }
@media (prefers-reduced-motion: reduce) { .payment-return-spinner { animation: none; border-right-color: var(--accent); } }

/* Ready state: focus on guest sharing and the private host link, without the explainer animation. */
.home-grid.is-created { grid-template-columns: minmax(0, 1fr); max-width: 1024px; margin-inline: auto; }
.home-grid.is-created .home-main { min-width: 0; padding-right: 0; }
.home-grid.is-created .preview { display: none; }
.ready-card { display: grid; gap: 24px; scroll-margin-top: 104px; }
.ready-card .card-head { margin: 0; }
.ready-section { min-width: 0; }
.guest-ready { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.ready-section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.ready-section-head .eyebrow-text { margin-bottom: 4px; }
.ready-section-head h3 { margin: 0; font-size: var(--text-lg); }
.ready-section-head > .muted { max-width: 380px; margin: 0; text-align: right; }
#created #shareCards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 16px 0 0; }
#created .share { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-areas: "title title" "qr link" "qr actions"; align-items: center; gap: 12px 22px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-raise); box-shadow: var(--shadow); text-align: left; }
#created .share h3 { grid-area: title; justify-self: start; margin: 0; text-align: left; }
#created .share .qr { grid-area: qr; justify-self: center; }
#created .share .link { grid-area: link; align-self: end; min-width: 0; overflow-wrap: anywhere; }
#created .share .row { grid-area: actions; justify-content: flex-start; flex-wrap: wrap; }
#created .share .row > * { flex: 0 1 auto; }
#created .host-box { margin: 0; padding: 22px; }
#created .host-box h3 { margin: 0 0 6px; }
#created .host-box > p.muted:first-of-type { margin: 0 0 14px; }
#created .host-box .link { overflow-wrap: anywhere; margin-bottom: 12px; }
.ready-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.ready-actions > * { flex: 0 1 auto; }
#created .host-box > :last-child { margin-bottom: 0; }
.ready-footer { padding-top: 2px; }
@media (max-width: 680px) {
  .ready-card { gap: 18px; padding: var(--space-5); }
  .ready-section-head { display: block; }
  .ready-section-head > .muted { margin-top: 6px; text-align: left; }
  #created .share { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "qr" "link" "actions"; justify-items: center; gap: 12px; text-align: center; }
  #created .share h3 { justify-self: center; text-align: center; }
  #created .share .link { width: 100%; text-align: left; }
  #created .share .row { justify-content: center; width: 100%; }
  #created .share .row > * { flex: 1 1 140px; }
  #created .host-box { padding: 18px; }
  .ready-actions > * { flex: 1 1 150px; text-align: center; }
}
