/*
 * PhotoUpload Studio: the signed-in interface for Business and Personal customers.
 * Self-contained: never load base.css, admin.css or client.css alongside it.
 * Real CSS sizes only (no zoom). Components use the s- prefix; tokens live on :root.
 */

:root {
  /* Colour */
  --s-ink: #16241f;
  --s-ink-soft: #33423c;
  --s-muted: #56645e;
  --s-faint: #8a9690;
  --s-line: #e1e7e2;
  --s-line-soft: #edf1ed;
  --s-field-line: #cfd9d3;
  --s-paper: #f5f6f3;
  --s-surface: #ffffff;
  --s-surface-soft: #f7f9f7;
  --s-brand: #1d6150;
  --s-brand-strong: #123c33;
  --s-brand-tint: #e3f0ea;
  --s-on-brand: #ffffff;
  --s-nav-text: #d5e3dd;
  --s-gold: #c49a5f;
  --s-gold-ink: #5c3b08;
  --s-gold-tint: #f6ecdc;
  --s-gold-line: #ead9bd;
  --s-danger: #a2302c;
  --s-danger-tint: #fbeceb;
  --s-danger-line: #e5c5c5;
  --s-focus: #c49a5f;

  /* Gallery status: text on tint, shared by pills, trackers and timelines */
  --s-status-draft: #4d5a55;      --s-status-draft-bg: #eceff0;
  --s-status-collecting: #244f7a; --s-status-collecting-bg: #e6eef7;
  --s-status-paused: #4a5568;     --s-status-paused-bg: #e9ecf1;
  --s-status-selecting: #7a4f0e;  --s-status-selecting-bg: #faefdc;
  --s-status-editing: #5b3f86;    --s-status-editing-bg: #efe9f8;
  --s-status-delivered: #1d6150;  --s-status-delivered-bg: #e3f0ea;
  --s-status-closed: #8a4b12;     --s-status-closed-bg: #f8ebdd;
  --s-status-deleted: #a2302c;    --s-status-deleted-bg: #fbeceb;

  /* Type */
  --s-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --s-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --s-text-xs: 11px;
  --s-text-sm: 12px;
  --s-text-md: 13px;
  --s-text: 14px;
  --s-text-lg: 15px;
  --s-text-xl: 16px;
  --s-title-sm: 18px;
  --s-title: 26px;
  --s-title-lg: 32px;

  /* Space, shape, depth */
  --s-gap-1: 4px;
  --s-gap-2: 6px;
  --s-gap-3: 10px;
  --s-gap-4: 14px;
  --s-gap-5: 16px;
  --s-gap-6: 20px;
  --s-gap-8: 26px;
  --s-gap-10: 32px;
  --s-radius-sm: 8px;
  --s-radius: 12px;
  --s-radius-lg: 14px;
  --s-pill: 999px;
  --s-shadow-raised: 0 12px 30px rgba(18, 60, 51, .12);
  --s-shadow-bar: 0 -6px 18px rgba(18, 60, 51, .06);
  --s-tap: 38px;
  --s-control: 40px;
  --s-page-width: 1240px;
  --s-gutter: 28px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.s-app {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--s-paper);
  color: var(--s-ink);
  font: 400 var(--s-text)/1.5 var(--s-body);
  -webkit-font-smoothing: antialiased;
}
/* Base element rules use :where() so every component class outranks them. */
:where(.s-app) :where(h1, h2, h3, h4, p, figure, dl, dd) { margin: 0; }
:where(.s-app) :where(h1, h2, h3) { text-wrap: balance; }
:where(.s-app) :where(img, video) { max-width: 100%; display: block; }
:where(.s-app) a { color: var(--s-brand); }
:where(.s-app) a:hover { color: var(--s-brand-strong); }
:where(.s-app) :where(button, input, select, textarea) { font: inherit; color: inherit; }
.s-app :focus-visible { outline: 2px solid var(--s-focus); outline-offset: 2px; }
.s-app [hidden] { display: none !important; }
.s-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.s-skip-link { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: var(--s-pill); background: var(--s-surface); color: var(--s-ink); font-weight: 700; }
.s-skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */
.s-container { width: 100%; max-width: var(--s-page-width); margin: 0 auto; padding-inline: var(--s-gutter); }
.s-main { flex: 1 0 auto; padding-block: 26px 48px; }
.s-stack { display: flex; flex-direction: column; gap: var(--s-gap-6); }
.s-stack-sm { display: flex; flex-direction: column; gap: var(--s-gap-3); }
.s-row { display: flex; align-items: center; gap: var(--s-gap-3); flex-wrap: wrap; }
.s-spacer { flex: 1 1 auto; }
.s-split { display: flex; gap: var(--s-gap-6); flex-wrap: wrap; align-items: flex-start; }
.s-split > .s-split-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--s-gap-5); }
.s-split > .s-split-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--s-gap-5); }
.s-grid { display: grid; gap: var(--s-gap-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ---------- Header ---------- */
.s-header { background: var(--s-brand-strong); color: var(--s-on-brand); }
.s-header-inner { display: flex; align-items: center; gap: var(--s-gap-8); min-height: 56px; }
.s-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--s-on-brand); text-decoration: none; font-weight: 700; font-size: 17px; white-space: nowrap; }
.s-app .s-brand:hover { color: var(--s-on-brand); }
.s-brand span span { color: var(--s-gold); }
.s-brand svg { width: 26px; height: 26px; }
.s-brand-mark { display: block; width: auto; height: 26px; }
.s-nav { display: flex; gap: var(--s-gap-1); flex: 1 1 auto; }
.s-nav a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: var(--s-pill); color: var(--s-nav-text); text-decoration: none; font-weight: 500; }
.s-app .s-nav a:hover { color: var(--s-on-brand); background: rgba(255, 255, 255, .08); }
.s-app .s-nav a[aria-current="page"] { color: var(--s-on-brand); background: rgba(255, 255, 255, .14); font-weight: 600; }
.s-nav-toggle { display: none; }

.s-menu { position: relative; }
.s-menu > summary { list-style: none; cursor: pointer; }
.s-menu > summary::-webkit-details-marker { display: none; }
.s-account { white-space: nowrap; display: inline-flex; align-items: center; gap: 10px; min-height: var(--s-tap); padding: 4px 6px; border-radius: var(--s-pill); color: var(--s-on-brand); font-size: var(--s-text-md); font-weight: 600; }
.s-account svg { width: 16px; height: 16px; flex: 0 0 auto; }
/* A long business name ends in an ellipsis (the full name is in the summary's title) instead of crowding the menu. */
.s-menu { min-width: 0; }
.s-account { max-width: 100%; }
.s-account > span { min-width: 0; max-width: min(36ch, 26vw); overflow: hidden; text-overflow: ellipsis; }
.s-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--s-gold); color: var(--s-brand-strong); font-weight: 700; font-size: var(--s-text-sm); flex: 0 0 auto; }
/* An uploaded icon shows as it is (most are already a rounded square); a logo sits on white so dark ink still shows. */
.s-avatar-image { overflow: hidden; background: transparent; border-radius: 7px; }
.s-avatar-image img { width: 100%; height: 100%; object-fit: contain; }
/* A logo shows as it is; only a see-through dark logo, which would vanish on the header, gets a
   light backing (studio.js adds .s-avatar-backdrop after looking at the picture). */
.s-avatar-logo { border-radius: 6px; }
.s-avatar-logo.s-avatar-backdrop { background: #fff; }
.s-avatar-logo.s-avatar-backdrop img { padding: 2px; }
.s-menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px;
  padding: 8px; border-radius: var(--s-radius); background: var(--s-surface); color: var(--s-ink);
  border: 1px solid var(--s-line); box-shadow: var(--s-shadow-raised);
  display: flex; flex-direction: column; max-height: calc(100dvh - 80px); overflow-y: auto; overscroll-behavior: contain;
}
.s-menu-panel a, .s-menu-panel button {
  display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--s-radius-sm);
  color: var(--s-ink); text-decoration: none; font-weight: 500; background: none; border: 0; text-align: left; cursor: pointer; width: 100%;
}
.s-app .s-menu-panel a:hover, .s-menu-panel button:hover { background: var(--s-surface-soft); color: var(--s-ink); }
.s-menu-panel hr { border: 0; border-top: 1px solid var(--s-line-soft); margin: 6px 4px; }
.s-menu-label { padding: 8px 12px 4px; font-size: var(--s-text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--s-muted); }

.s-banner { background: var(--s-gold-tint); border-bottom: 1px solid var(--s-gold-line); color: var(--s-gold-ink); font-size: var(--s-text-md); }
.s-banner .s-container { display: flex; align-items: center; gap: var(--s-gap-4); flex-wrap: wrap; padding-block: 10px; }
.s-app .s-banner a { color: var(--s-gold-ink); font-weight: 700; }

/* ---------- Page heading ---------- */
.s-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-gap-5); flex-wrap: wrap; }
.s-page-head > div:first-child { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s-eyebrow { font-size: var(--s-text-sm); color: var(--s-muted); }
.s-title { font: 600 var(--s-title-lg)/1.1 var(--s-display); }
.s-title-sm { font: 600 var(--s-title)/1.1 var(--s-display); }
.s-lede { color: var(--s-muted); max-width: 68ch; }
.s-section-label { font-size: var(--s-text-sm); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--s-muted); }
.s-back { display: inline-flex; align-items: center; gap: 8px; min-height: var(--s-tap); color: var(--s-on-brand); text-decoration: none; font-weight: 600; }
.s-app .s-back:hover { color: var(--s-on-brand); }
.s-back svg { width: 18px; height: 18px; }

/* ---------- Buttons ---------- */
.s-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--s-tap); padding: 0 16px; border-radius: var(--s-pill);
  border: 1px solid transparent; background: var(--s-brand); color: var(--s-on-brand);
  font-size: var(--s-text); font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.s-app a.s-btn:hover, .s-btn:hover { background: var(--s-brand-strong); color: var(--s-on-brand); }
.s-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.s-btn-secondary { background: var(--s-surface); color: var(--s-ink); border-color: var(--s-field-line); font-weight: 600; }
.s-app a.s-btn-secondary:hover, .s-btn-secondary:hover { background: var(--s-surface-soft); color: var(--s-ink); border-color: var(--s-faint); }
.s-btn-outline { background: transparent; color: var(--s-brand); border-color: var(--s-brand); }
.s-app a.s-btn-outline:hover, .s-btn-outline:hover { background: var(--s-brand-tint); color: var(--s-brand-strong); }
.s-btn-ghost { background: transparent; color: var(--s-ink-soft); padding: 0 12px; font-weight: 600; }
.s-app a.s-btn-ghost:hover, .s-btn-ghost:hover { background: var(--s-line-soft); color: var(--s-ink); }
.s-btn-danger { background: var(--s-surface); color: var(--s-danger); border-color: var(--s-danger-line); font-weight: 600; }
.s-app a.s-btn-danger:hover, .s-btn-danger:hover { background: var(--s-danger-tint); color: var(--s-danger); }
.s-btn-sm { min-height: 32px; padding: 0 12px; font-size: var(--s-text-md); }
.s-btn-lg { min-height: 44px; padding: 0 22px; font-size: var(--s-text-lg); }
.s-btn-block { width: 100%; }
.s-btn[disabled], .s-btn[aria-disabled="true"] { background: #c9d6cf; color: #3e4b46; border-color: transparent; cursor: not-allowed; }
.s-icon-btn {
  width: var(--s-tap); height: var(--s-tap); display: inline-grid; place-items: center; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid var(--s-field-line); background: var(--s-surface); color: var(--s-ink-soft); cursor: pointer;
}
.s-icon-btn:hover { background: var(--s-surface-soft); }
.s-icon-btn-plain { border-color: transparent; background: transparent; }
.s-icon-btn svg { width: 18px; height: 18px; }

/* ---------- Cards and panels ---------- */
.s-card { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--s-radius-lg); padding: var(--s-gap-6); display: flex; flex-direction: column; gap: var(--s-gap-4); min-width: 0; }
.s-card-tight { padding: var(--s-gap-4) var(--s-gap-5); }
.s-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-gap-4); flex-wrap: wrap; }
.s-card-head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-card-title { font-size: var(--s-title-sm); font-weight: 700; }
.s-card-title-sm { font-size: var(--s-text-lg); font-weight: 700; }
.s-card-sub { font-size: var(--s-text-md); color: var(--s-muted); }
.s-card-divider { border-top: 1px solid var(--s-line-soft); padding-top: var(--s-gap-5); }
.s-panel { background: var(--s-surface-soft); border-radius: var(--s-radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.s-callout { border-radius: var(--s-radius); padding: 14px 18px; display: flex; gap: var(--s-gap-3); align-items: flex-start; font-size: var(--s-text-md); }
.s-callout svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.s-callout-info { background: var(--s-status-collecting-bg); color: var(--s-status-collecting); }
.s-callout-warn { background: var(--s-gold-tint); color: var(--s-gold-ink); border: 1px solid var(--s-gold-line); }
.s-callout-success { background: var(--s-brand-tint); color: var(--s-brand-strong); }
.s-callout-danger { background: var(--s-danger-tint); color: var(--s-danger); border: 1px solid var(--s-danger-line); }
.s-callout strong { display: block; }

/* ---------- Status pills ---------- */
.s-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--s-pill);
  font-size: var(--s-text-sm); font-weight: 700; white-space: nowrap; line-height: 1.2;
  color: var(--s-status-draft); background: var(--s-status-draft-bg);
}
.s-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.s-pill-sm { padding: 3px 9px; font-size: var(--s-text-xs); gap: 5px; }
.s-pill-sm::before { width: 6px; height: 6px; }
.s-pill-collecting { color: var(--s-status-collecting); background: var(--s-status-collecting-bg); }
.s-pill-paused { color: var(--s-status-paused); background: var(--s-status-paused-bg); }
.s-pill-selecting { color: var(--s-status-selecting); background: var(--s-status-selecting-bg); }
.s-pill-editing { color: var(--s-status-editing); background: var(--s-status-editing-bg); }
.s-pill-delivered { color: var(--s-status-delivered); background: var(--s-status-delivered-bg); }
.s-pill-closed { color: var(--s-status-closed); background: var(--s-status-closed-bg); }
.s-pill-deleted { color: var(--s-status-deleted); background: var(--s-status-deleted-bg); }
.s-tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--s-pill); background: var(--s-line-soft); color: var(--s-ink-soft); font-size: var(--s-text-xs); font-weight: 700; }
/* A count that needs the owner: guest uploads waiting under "Approve before showing". */
.s-count-alert { display: inline-flex; align-items: center; align-self: flex-start; gap: 4px; padding: 2px 9px; border-radius: var(--s-pill); background: var(--s-gold-tint); color: var(--s-gold-ink); border: 1px solid var(--s-gold-line); font-size: var(--s-text-xs); font-weight: 700; text-decoration: none; white-space: nowrap; }
a.s-count-alert:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.s-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s-label { font-size: var(--s-text-md); font-weight: 600; }
.s-optional { font-weight: 400; color: var(--s-muted); }
.s-hint { font-size: var(--s-text-sm); color: var(--s-muted); font-weight: 400; }
.s-error-text { font-size: var(--s-text-sm); color: var(--s-danger); font-weight: 600; }
.s-input, .s-select, .s-textarea {
  width: 100%; min-height: var(--s-control); padding: 0 12px; border-radius: var(--s-radius-sm);
  border: 1px solid var(--s-field-line); background: var(--s-surface); color: var(--s-ink); font-size: var(--s-text);
}
.s-textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.5; }
.s-select { appearance: none; padding-right: 40px; 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='%2356645e' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.s-input:focus, .s-select:focus, .s-textarea:focus { outline: none; border-color: var(--s-brand); box-shadow: 0 0 0 3px var(--s-brand-tint); }
.s-input[aria-invalid="true"] { border-color: var(--s-danger); }
.s-form-grid { display: grid; gap: var(--s-gap-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.s-form-grid .s-span-all { grid-column: 1 / -1; }
/* Long single fields stay readable instead of stretching across wide cards. */
.s-field { max-width: 640px; }
.s-copy { max-width: 640px; }
.s-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.s-check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--s-brand); flex: 0 0 auto; }
.s-check > span { display: flex; flex-direction: column; gap: 2px; }
.s-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: var(--s-text-md); }
.s-switch input { appearance: none; width: 42px; height: 24px; margin: 0; border-radius: var(--s-pill); background: #c9d3ce; position: relative; cursor: pointer; transition: background .15s; flex: 0 0 auto; }
.s-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.s-switch input:checked { background: var(--s-brand); }
.s-switch input:checked::after { transform: translateX(18px); }
.s-choices { display: grid; gap: var(--s-gap-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border: 0; margin: 0; padding: 0; min-width: 0; }
.s-choices > legend { font-size: var(--s-text-md); font-weight: 600; margin-bottom: 10px; padding: 0; }
.s-choice { display: flex; gap: 10px; align-items: flex-start; padding: 13px; border-radius: var(--s-radius); border: 1px solid var(--s-line); background: var(--s-surface); cursor: pointer; }
.s-choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--s-brand); flex: 0 0 auto; }
.s-choice > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.s-choice small { font-size: var(--s-text-md); color: var(--s-muted); }
.s-choice:has(input:checked) { border: 2px solid var(--s-brand); padding: 12px; box-shadow: 0 0 0 4px var(--s-brand-tint); }

/* ---------- Segmented filters and tabs ---------- */
.s-segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--s-pill); background: #f0f3f0; flex-wrap: wrap; }
.s-segmented button, .s-segmented a { min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--s-pill); background: transparent; color: var(--s-ink-soft); font-size: var(--s-text-md); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.s-segmented [aria-pressed="true"], .s-segmented [aria-current="page"] { background: var(--s-brand); color: var(--s-on-brand); font-weight: 700; }
.s-tabs { display: flex; gap: 6px; border-bottom: 1px solid #dfe6e1; overflow-x: auto; scrollbar-width: none; }
.s-tabs a { padding: 12px 16px; text-decoration: none; font-weight: 600; color: var(--s-muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.s-app .s-tabs a:hover { color: var(--s-ink); }
.s-app .s-tabs a[aria-current="page"] { color: var(--s-ink); border-bottom-color: var(--s-brand); }

/* ---------- Stage tracker ---------- */
.s-stages { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: var(--s-gap-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--s-radius-lg); }
.s-stage { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--s-field-line); min-width: 0; }
.s-stage-mark { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--s-text-md); background: #eef2ef; color: var(--s-muted); }
.s-stage-mark svg { width: 16px; height: 16px; }
.s-stage > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.s-stage strong { font-size: var(--s-text); color: var(--s-ink-soft); }
.s-stage small { font-size: var(--s-text-sm); color: var(--s-muted); }
.s-stage-done { border-style: solid; border-color: var(--s-line); }
.s-stage-done .s-stage-mark { background: var(--s-brand); color: var(--s-on-brand); }
.s-stage-done strong { color: var(--s-ink); }
.s-stage-current { border-style: solid; border-color: currentColor; color: var(--s-status-selecting); background: var(--s-status-selecting-bg); }
.s-stage-current .s-stage-mark { background: currentColor; }
.s-stage-current .s-stage-mark > * { color: #fff; }
.s-stage-current strong { color: inherit; }
.s-stage-current.s-tone-editing { color: var(--s-status-editing); background: var(--s-status-editing-bg); }
.s-stage-current.s-tone-collecting { color: var(--s-status-collecting); background: var(--s-status-collecting-bg); }
.s-stage-current.s-tone-paused { color: var(--s-status-paused); background: var(--s-status-paused-bg); }
.s-stage-current.s-tone-delivered { color: var(--s-status-delivered); background: var(--s-status-delivered-bg); }

/* ---------- Key dates timeline ---------- */
.s-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.s-timeline li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding-bottom: 16px; position: relative; }
.s-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--s-line); }
.s-timeline-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; background: var(--s-surface); border: 3px solid var(--s-faint); position: relative; z-index: 1; }
.s-timeline-done .s-timeline-dot { background: var(--s-brand); border-color: var(--s-brand); }
.s-timeline-next .s-timeline-dot { border-color: var(--s-gold); }
.s-timeline strong { font-weight: 600; }
.s-timeline small { display: block; font-size: var(--s-text-sm); color: var(--s-muted); }
.s-timeline-date { font-size: var(--s-text-md); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---------- Lists that become cards on phones ---------- */
.s-list { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: var(--s-radius-lg); overflow: hidden; }
.s-list-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--s-line-soft); flex-wrap: wrap; }
.s-list-head, .s-list-row { display: grid; grid-template-columns: var(--s-list-columns, minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto); gap: var(--s-gap-4); align-items: center; padding: 10px 16px; }
.s-list-head { padding-block: 10px; background: var(--s-surface-soft); font-size: var(--s-text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--s-muted); }
.s-list-row { border-top: 1px solid var(--s-line-soft); }
.s-list-row:first-of-type { border-top: 0; }
.s-list-empty { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--s-muted); }
.s-list-empty strong { color: var(--s-ink); font-size: var(--s-text-lg); }
.s-cell-label { display: none; }
.s-thumb { flex: 0 0 auto; width: 56px; height: 42px; border-radius: var(--s-radius-sm); background: var(--s-line-soft); object-fit: cover; display: grid; place-items: center; color: var(--s-faint); }
.s-thumb svg { width: 20px; height: 20px; }
.s-meta { font-size: var(--s-text-sm); color: var(--s-muted); }
.s-strong-link { font-weight: 700; color: var(--s-ink); text-decoration: none; }
.s-app .s-strong-link:hover { color: var(--s-brand); text-decoration: underline; }

/* ---------- Meters ---------- */
.s-meter { height: 10px; border-radius: var(--s-pill); background: var(--s-line-soft); overflow: hidden; }
.s-meter > span { display: block; height: 100%; border-radius: var(--s-pill); background: var(--s-brand); }
.s-meter-gold > span { background: var(--s-gold); }
.s-meter-editing > span { background: var(--s-status-editing); }
.s-stat { display: flex; flex-direction: column; gap: 2px; }
.s-stat strong { font: 600 28px/1.1 var(--s-display); font-variant-numeric: tabular-nums; }

/* ---------- Copy field ---------- */
.s-copy { display: flex; gap: 8px; align-items: center; border: 1px solid var(--s-line); border-radius: var(--s-radius-sm); padding: 6px 6px 6px 12px; min-width: 0; }
.s-copy > span { flex: 1; min-width: 0; font-size: var(--s-text-md); color: var(--s-ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Sticky save bar: only shown while a form has unsaved changes ---------- */
.s-savebar { position: sticky; bottom: 0; z-index: 20; background: var(--s-surface); border-top: 1px solid #dfe6e1; box-shadow: var(--s-shadow-bar); padding-bottom: env(safe-area-inset-bottom, 0px); }
.s-savebar .s-container { display: flex; align-items: center; gap: var(--s-gap-3); padding-block: 12px; }
.s-savebar-note { flex: 1 1 auto; font-size: var(--s-text-md); color: var(--s-muted); min-width: 0; }

/* ---------- Dialog ---------- */
.s-dialog { border: 0; border-radius: var(--s-radius-lg); padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: var(--s-shadow-raised); color: var(--s-ink); }
.s-dialog::backdrop { background: rgba(14, 30, 25, .45); }
.s-dialog-body { padding: var(--s-gap-6); display: flex; flex-direction: column; gap: var(--s-gap-4); }
.s-dialog-actions { display: flex; justify-content: flex-end; gap: var(--s-gap-3); padding: 0 var(--s-gap-6) var(--s-gap-6); flex-wrap: wrap; }

/* ---------- Flash messages ---------- */
.s-flash { margin-bottom: var(--s-gap-5); }

/* ---------- Footer ---------- */
.s-footer { padding-block: 28px; color: var(--s-muted); font-size: var(--s-text-sm); }
.s-footer .s-container { display: flex; gap: var(--s-gap-4); flex-wrap: wrap; justify-content: space-between; }
.s-footer nav { display: flex; gap: var(--s-gap-4); flex-wrap: wrap; }
.s-app .s-footer a { color: var(--s-muted); }

@media (pointer: coarse) {
  :root { --s-tap: 44px; --s-control: 44px; }
}

/* ---------- Phone and tablet ---------- */
@media (max-width: 900px) {
  :root { --s-gutter: 16px; --s-title-lg: 26px; --s-title: 22px; }
  .s-main { padding-block: 20px 40px; }
  .s-header-inner { gap: var(--s-gap-3); min-height: 60px; }
  .s-nav-toggle { display: inline-grid; place-items: center; width: var(--s-tap); height: var(--s-tap); margin-left: auto; border: 0; background: transparent; color: var(--s-on-brand); cursor: pointer; }
  .s-nav-toggle svg { width: 22px; height: 22px; }
  .s-nav, .s-header .s-menu { display: none; }
  .s-header.is-open .s-header-inner { flex-wrap: wrap; padding-bottom: 12px; }
  .s-header.is-open .s-nav { display: flex; flex-direction: column; flex-basis: 100%; order: 3; }
  .s-header.is-open .s-nav a { min-height: var(--s-tap); }
  .s-header.is-open .s-menu { display: block; flex-basis: 100%; order: 4; }
  .s-header.is-open .s-menu > summary { display: none; }
  .s-header.is-open .s-menu-panel { position: static; display: flex; box-shadow: none; border: 0; background: transparent; padding: 0; }
  .s-header.is-open .s-menu-panel a, .s-header.is-open .s-menu-panel button { color: var(--s-nav-text); min-height: var(--s-tap); }
  .s-header.is-open .s-menu-panel a:hover, .s-header.is-open .s-menu-panel a:active, .s-header.is-open .s-menu-panel a:focus-visible,
  .s-header.is-open .s-menu-panel button:hover, .s-header.is-open .s-menu-panel button:active { background: rgba(255, 255, 255, .1); color: var(--s-nav-text); }
  .s-header.is-open .s-menu-panel hr { border-color: rgba(255, 255, 255, .12); }
  .s-header.is-open .s-menu-label { color: var(--s-nav-text); }
  .s-card { padding: var(--s-gap-5) var(--s-gap-4); }
  .s-list-head { display: none; }
  .s-list-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 16px; }
  .s-cell-label { display: inline; color: var(--s-muted); font-size: var(--s-text-sm); margin-right: 6px; }
  .s-page-head .s-btn { min-height: var(--s-tap); }
}
@media (max-width: 520px) {
  .s-savebar .s-container { flex-wrap: wrap; }
  .s-savebar-note { flex-basis: 100%; }
  .s-savebar .s-btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .s-app *, .s-app *::before, .s-app *::after { transition: none !important; animation: none !important; }
}
.s-check > span small { font-size: var(--s-text-sm); color: var(--s-muted); font-weight: 400; }

/* Phones: a gallery's sections along the bottom of the screen, like an app (studio_section_bar). */
.s-tabbar { display: none; }
@media (max-width: 640px) {
  .s-gallery-tabs { display: none; }
  .s-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: stretch; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid #dfe6e1; box-shadow: 0 -6px 24px rgba(10, 30, 25, .08); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
  .s-tabbar > .s-tabbar-item, .s-tabbar-more { flex: 1 1 0; min-width: 0; }
  .s-tabbar-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 2px; border-radius: 14px; color: var(--s-muted); font-size: 11px; font-weight: 600; text-decoration: none; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .s-tabbar-item::-webkit-details-marker { display: none; }
  .s-tabbar-item svg { width: 22px; height: 22px; }
  .s-tabbar-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .s-tabbar-item[aria-current="page"] { color: var(--s-brand); background: var(--s-brand-tint, #e7f0ec); }
  .s-tabbar-badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--s-brand); color: #fff; font-size: 10px; font-weight: 700; line-height: 18px; text-align: center; }
  .s-tabbar-more { position: relative; }
  .s-tabbar-more > summary { height: 100%; }
  .s-tabbar-sheet { position: absolute; right: 0; bottom: calc(100% + 12px); display: grid; gap: 2px; min-width: 200px; padding: 6px; border-radius: 18px; background: #fff; box-shadow: 0 14px 40px rgba(10, 30, 25, .22); transform-origin: bottom right; animation: s-tabbar-pop .16s ease-out; }
  .s-tabbar-sheet .s-tabbar-item { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 46px; padding: 0 14px; font-size: 15px; color: var(--s-ink); }
  .s-tabbar-sheet .s-tabbar-badge { position: static; }
  body:has(.s-tabbar) { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  body:has(.s-tabbar) .s-preview-fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body:has(.s-tabbar) .s-toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@keyframes s-tabbar-pop { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .s-tabbar-sheet { animation: none; } }

/* Unsaved changes: a bar along the bottom of the window with Save and Discard (studio.js). */
.s-unsaved-bar { position: fixed; z-index: 60; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: var(--s-gap-4); width: max-content; max-width: calc(100vw - 24px); padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--s-ink, #16241f); color: #fff; box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .45); animation: s-unsaved-in .25s ease-out; }
.s-unsaved-bar[hidden] { display: none; }
.s-unsaved-bar-text { font-weight: 600; font-size: var(--s-text-md); white-space: nowrap; }
.s-unsaved-bar-actions { display: flex; gap: 6px; }
.s-unsaved-bar .s-btn-ghost { color: #fff; }
.s-unsaved-bar .s-btn-ghost:hover { background: rgba(255, 255, 255, .12); }
body.has-unsaved-bar { padding-bottom: 84px; }
@keyframes s-unsaved-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 520px) { .s-unsaved-bar { left: 12px; right: 12px; transform: none; width: auto; border-radius: 16px; } .s-unsaved-bar-text { white-space: normal; } @keyframes s-unsaved-in { from { opacity: 0; } to { opacity: 1; } } }
@media (prefers-reduced-motion: reduce) { .s-unsaved-bar { animation: none; } }

/* Guest messages (gallery Settings tab). */
.s-message-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 640px; overflow-y: auto; }
.s-message-item { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--s-line); border-radius: var(--s-radius-sm); background: var(--s-surface); }
.s-message-item.is-waiting { border-color: var(--s-gold-line); background: var(--s-gold-tint); }
.s-message-item.is-hidden .s-message-text { opacity: .55; }
.s-message-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.45; }
.s-message-item .s-meta { margin: 0; }
.s-message-item .s-row { gap: 8px; flex-wrap: wrap; }
.s-message-status { font-weight: 700; }
