/* Presentation only. Loaded after the editor and journey styles.
   ColourSesh brand tokens (docs/DESIGN-2026-10-01.md): warm cream, near-black ink, terracotta accent,
   coral and golden-hour highlights, eucalyptus for "free" and success. theme.css holds the dark variant. */
:root {
  --brand-ink: #1f1a17;
  --brand-cream: #fbf6ef;
  --brand-sand: #f4eadf;
  --brand-blush: #f8e3d8;
  --brand-coral: #e8684a;
  --brand-terracotta: #b0432a;
  --brand-gold: #f2b544;
  --brand-eucalyptus: #4f735d;
  --brand-eucalyptus-soft: #e3ece4;
  --font-display: "Fraunces", ui-serif, "Iowan Old Style", "Sitka Display", Cambria, Georgia, serif;
  /* The look introduction: a golden-hour band, dark in the dark theme. */
  --band-bg: linear-gradient(135deg, #fdf1e6 0%, #f9e0d1 55%, #f6d3c0 100%);
  --band-ink: #1f1a17;
  --band-muted: #5f544d;
  --band-line: #1f1a1714;
  --band-em: #b0432a;
  --band-ring: #e8684a2e;
  --accent: #b0432a;
  --accent-soft: #fbe9df;
  --line: #eadfd3;
  --muted: #6b5f57;
  --ink: #1f1a17;
  --surface: #fffdf9;
  --radius: 20px;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--brand-cream);
  text-rendering: optimizeLegibility;
}

body { -webkit-text-size-adjust: 100%; }
::selection { color: var(--ink); background: #f6cbb8; }
button, a, summary { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }
button, input, select, textarea { min-width: 0; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
button:disabled { opacity: .48; }
.button {
  min-height: 46px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  transition: background .16s, border-color .16s, box-shadow .16s;
}
.button:hover:not(:disabled) { transform: none; }
.primary { background: var(--accent); }
.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.dark { background: var(--ink); }
.text-button { color: var(--accent); min-height: 44px; line-height: 1.4; }
.hint, .muted { color: var(--muted); line-height: 1.6; }
.hint { font-size: 13px; }

/* Quiet navigation and a clear first action. */
.topbar {
  height: 76px;
  padding-inline: max(28px, calc((100vw - 1440px) / 2));
  gap: 44px;
  background: var(--surface);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: 'Segoe UI', Arial, sans-serif; font-size: 28px; font-weight: 800; letter-spacing: -1.2px; }
.brand span { color: var(--brand-coral); }
/* The ColourSesh mark: a coral tile, a cream "C" and the golden dot that also ends the wordmark. */
.brand-mark { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.topbar nav { gap: 28px; min-width: 0; }
.nav-button { font-size: 14px; font-weight: 500; }
.nav-button.active::after { height: 2px; border-radius: 2px; }
.nav-button span { background: #efe9e4; color: var(--accent); }
.account-nav { gap: 12px; min-width: 0; }
.account-nav .button { min-height: 44px; padding: 10px 18px; font-size: 14px; }
.credit-pill { min-height: 44px; max-width: 240px; font-size: 12px; line-height: 1.35; background: var(--accent-soft); border-color: #eaded5; }
#studio-view, #saved-view { max-width: 1440px; padding: 30px 28px 24px; }
.page-heading { height: auto; padding: 0; margin-bottom: 24px; gap: 24px; }
.page-heading h1 { font-family: inherit; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -1.1px; font-weight: 650; line-height: 1.2; }
.page-heading h1 span { color: var(--muted); font-weight: 400; }
.heading-note { display: block; font-size: 14px; line-height: 1.5; margin-top: 9px; }
.page-heading .button { min-height: 48px; padding: 12px 20px; font-size: 14px; }
.experience { margin-bottom: 16px; }
.experience-steps { gap: 12px; align-items: center; margin-bottom: 14px; }
.experience-steps button { min-height: 36px; gap: 8px; font-size: 13px; }
.experience-steps button + button::before { content: ''; width: 28px; height: 1px; margin-right: 4px; background: #d9d2cd; }
.experience-steps button span { width: 26px; height: 26px; flex: none; background: #eae5e1; color: var(--muted); }
.experience-steps [aria-current] span { background: var(--accent); color: white; }
.experience-steps [aria-current] { color: var(--accent); }
.intent-row { gap: 12px; }
.intent-row button { position: relative; min-height: 84px; justify-content: center; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); gap: 5px; }
.intent-row button strong { font-size: 16px; font-weight: 600; }
.intent-row button span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.intent-row [aria-pressed=true] { background: var(--accent-soft); border-color: #b7705a; box-shadow: inset 0 0 0 1px #b7705a33; }
.intent-row [aria-pressed=true] strong { color: var(--accent); }
.photo-help { gap: 6px 20px; align-items: center; margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.photo-help > span { display: flex; align-items: baseline; gap: 8px; }
.photo-help > span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #658573; flex: none; align-self: center; }
.photo-help .text-button, .photo-help summary { font-size: 13px; }
.photo-help summary { color: var(--accent); }
.photo-help summary { padding-block: 10px; }
.photo-help details p { margin: 0 0 10px; }

/* The editor keeps its existing canvas sizing and interaction model. */
.workspace { height: clamp(620px, 76dvh, 860px); min-height: 620px; grid-template-columns: minmax(0, 1fr) 410px; gap: 24px; }
.photo-panel, .settings-panel { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 14px #30292404; }
.photo-panel { position: relative; }
.photo-toolbar { min-height: 64px; padding: 10px 18px; flex-wrap: nowrap; background: var(--surface); }
.photo-toolbar > span { font-size: 13px; min-width: 0; max-width: 52%; }
.view-switch { background: #eeeae7; padding: 4px; border-radius: 11px; }
.view-switch button { min-height: 36px; padding: 8px 13px; font-size: 12px; border-radius: 8px; }
.view-switch button[aria-pressed=true] { box-shadow: 0 2px 5px #3029240c; color: var(--accent); font-weight: 600; }
.photo-stage { background: #eee5de; padding: 22px 22px 56px; }
.portrait-wrap { border-radius: 12px; box-shadow: 0 8px 32px #342a2214; }
.status-pill { max-width: calc(100% - 24px); bottom: 12px; padding: 6px 12px; font-size: 12px; border-color: #dfd7d1; line-height: 1.5; background: #fffdfaf2; }
.analysis-progress { bottom: 52px; border: 1px solid var(--line); padding: 5px 12px; }
.analysis-progress .text-button { min-height: 36px; font-size: 12px; }
.retry { bottom: 54px; }
.photo-footer { min-height: 52px; padding: 2px 16px; gap: 8px; background: var(--surface); }
.photo-footer .text-button { font-size: 12px; min-height: 44px; }
.history-actions { gap: 18px; }
.compare-control { padding: 4px 18px; background: var(--surface); }
.compare-control label { font-size: 12px; }
.mask-tools { background: var(--surface); }
.brush-actions button { min-height: 44px; border-radius: 8px; font-size: 12px; }
.restore-ai { min-height: 44px; }
.settings-panel { padding: 0; background: var(--surface); }
.category-tabs { margin: 0; padding: 8px; gap: 3px; min-height: 64px; background: var(--surface); }
.category-tabs button { min-width: 0; min-height: 46px; padding: 10px 7px; font-size: 13px; border-radius: 9px; }
.category-tabs button[aria-selected=true] { background: var(--accent-soft); border-radius: 9px; color: var(--accent); font-weight: 650; }
.category-tabs button[aria-selected=true]::after { content: none; }
.tools-scroll { padding: 24px; scrollbar-color: #cdc0b5 transparent; scrollbar-gutter: stable; }
.tools-scroll h2 { font-size: 22px; font-weight: 600; letter-spacing: -.6px; line-height: 1.3; }
.tools-scroll .muted { font-size: 14px; margin: 7px 0 22px; }
.section-title > .small-label { flex: none; font-size: 11px; letter-spacing: 0; padding: 5px 8px; background: #f1ece8; border-radius: 6px; }
.quick-shades { padding: 14px; background: #f7f1eb; border: 1px solid #ebe0d7; border-radius: 12px; margin-bottom: 22px; }
.quick-shades > strong { font-size: 13px; font-weight: 600; }
.quick-shades .rec-chip { min-height: 44px; font-size: 13px; background: var(--surface); border-color: #dfcec4; border-radius: 8px; }
.quick-shades .hint, .quick-shades .rec-explanation { font-size: 12px; color: var(--muted); }
.field-label, .range-heading, .custom-color-label, .palette-label { font-size: 14px; font-weight: 500; }
select, textarea { min-height: 46px; border: 1px solid #dcd1d0; border-radius: 10px; background-color: white; color: var(--ink); font-size: 14px; }
select { padding: 11px 12px; }
textarea { padding: 13px; line-height: 1.6; }
.palette { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
.swatch { min-height: 82px; padding: 8px 3px; gap: 6px; font-size: 12px; line-height: 1.3; border-radius: 11px; color: #64584e; }
.swatch-circle, .makeup-palette .swatch-circle { width: 44px; height: 44px; flex: none; margin: 3px 0; }
.swatch[aria-pressed=true] { background: var(--accent-soft); font-weight: 600; }
.swatch[aria-pressed=true] .swatch-circle::after { border-width: 2px; inset: -4px; }
.custom-color-label { margin-block: 18px; font-size: 13px; color: var(--muted); }
.custom-color-label input { width: 46px; height: 44px; border-radius: 10px; padding: 4px; }
.selected-shade { margin: 18px 0; padding: 14px; border: 1px solid var(--line); background: #f9f5f2; border-radius: 12px; gap: 12px; }
.selected-shade > div { min-width: 0; }
.selected-shade > span { width: 36px; height: 36px; box-shadow: inset 0 0 0 1px #00000010; }
.selected-shade .small-label { font-size: 9px; letter-spacing: 1px; }
.selected-shade strong { font-size: 14px; line-height: 1.4; }
.selected-shade button { font-size: 12px; flex: none; }
.range-heading { margin: 18px 0 2px; line-height: 1.5; }
.range-heading output { min-width: 44px; padding: 4px 7px; border-radius: 6px; background: #f1ebe8; color: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; }
input[type=range] { min-height: 44px; height: 44px; touch-action: pan-y; }
.advanced { margin-top: 18px; padding-top: 10px; }
.advanced summary { min-height: 44px; padding: 10px 0; font-size: 14px; line-height: 1.5; }
.advanced[open] summary { margin-bottom: 10px; }
.recommendation { background: #f7f1eb; border-color: #ebe0d7; border-radius: 12px; padding: 8px 14px; }
.recommendation[open] { padding-bottom: 16px; }
.recommend-button { min-height: 44px; }
.makeup-presets, .prompt-chips { gap: 8px; }
.makeup-presets button, .prompt-chips button { min-height: 44px; padding: 8px 12px; font-size: 13px; border-radius: 10px; line-height: 1.35; background: white; }
.segmented { border-color: var(--line); background: #f1ece8; border-radius: 12px; padding: 4px; }
.segmented button, #ai-panel .segmented button { min-height: 44px; font-size: 13px; border-radius: 8px; }
.photo-consent { align-items: flex-start; padding: 12px; background: #f5f1ed; border-radius: 10px; font-size: 13px; line-height: 1.55; }
.check-label { min-height: 44px; }
.check-label input { flex: none; width: 21px; height: 21px; margin-top: 2px; }
.ai-intro .eyebrow { font-size: 11px; }
.ai-run { min-height: 48px; }
.form-error { font-size: 13px; }
.save-area { padding: 16px 18px; gap: 10px; background: var(--surface); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.save-area .button { min-height: 46px; font-size: 13px; padding: 10px; }
.save-area #current-master-card { background: #f7f2ee; }
.save-area .export-options { margin: 0; font-size: 13px; }
.export-options summary { min-height: 44px; padding: 12px 0; font-size: 13px; line-height: 1.5; }
.export-options[open] { background: var(--surface); padding: 16px; border-radius: 14px 14px 0 0; }
.save-area .local-note { display: block; font-size: 11px; line-height: 1.55; color: var(--muted); }
.next-step { padding: 16px 2px; margin: 0; gap: 20px; color: var(--muted); font-size: 13px; }
.next-step button { font-size: 13px; }

/* Inspiration, collection and dialogs share the same visual language. */
.journey { background: var(--surface); border-color: var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; }
.journey > summary { min-height: 44px; font-size: 17px; }
.journey > summary small { font-size: 13px; }
.journey-card { border-color: var(--line); padding: 12px; border-radius: 12px; }
.journey-tabs button { min-height: 44px; font-size: 14px; }
.journey-tabs button[aria-selected=true] { background: var(--accent); border-color: var(--accent); }
.journey > summary::after, .catalog-card a, .catalog-links a { color: var(--accent); }
.journey-card[aria-pressed=true], .catalog-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.journey-fields label { line-height: 1.5; }
.journey-fields input, .journey-fields select { min-height: 46px; }
.journey-actions .button { min-height: 46px; font-size: 14px; }
.catalog-summary { bottom: max(8px, env(safe-area-inset-bottom)); background: var(--surface); }
.studio-footnote { display: flex; flex-wrap: wrap; margin-top: 4px; gap: 12px; color: var(--muted); }
.studio-footnote p, .studio-footnote button, .demo-links > span { font-size: 12px; }
.studio-footnote button { min-height: 44px; }
.seo-links { max-width: 1440px; margin: 0 auto; padding: 12px 28px 28px; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; }
.seo-links a { display: inline-flex; min-height: 44px; align-items: center; }
.saved-grid { gap: 18px; }
.saved-card { border-radius: 16px; background: var(--surface); }
.saved-info { padding: 18px; }
.saved-info h2 { font-size: 17px; line-height: 1.35; }
.saved-actions { gap: 4px 16px; }
.saved-actions button { min-height: 44px; }
.empty-state { padding: 60px 24px; background: var(--surface); border-style: solid; border-color: var(--line); }
.empty-state p { line-height: 1.6; }
.saved-comparison figure[data-chosen=true] { outline-color: var(--accent); }
.saved-comparison .button { min-height: 44px; font-size: 14px; }
.comparison-toolbar { background: #f7f4f0f5; border-bottom: 1px solid var(--line); padding: 12px 0; }
dialog { padding: 28px; border-radius: 22px; border-color: var(--line); background: var(--surface); color: var(--ink); overflow: auto; overscroll-behavior: contain; max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
dialog::backdrop { background: #30292480; backdrop-filter: blur(4px); }
dialog h2 { font-size: 25px; font-weight: 600; line-height: 1.3; letter-spacing: -.7px; }
.account-dialog { padding: 32px; }
.account-dialog .eyebrow { font-size: 11px; margin-right: 24px; }
.account-dialog p { font-size: 14px; }
.account-dialog form > label { font-size: 14px; }
.account-dialog input:not([type=checkbox]) { min-height: 48px; border-radius: 10px; font-size: 16px; }
.account-dialog form > .check-label { font-size: 13px; }
.dialog-x { width: 44px; height: 44px; min-height: 44px; top: 8px; right: 8px; border-radius: 50%; color: var(--muted); }
.dialog-actions { gap: 10px; flex-wrap: wrap; }
.legal-links { font-size: 12px; gap: 8px 16px; }
.legal-links a { padding-block: 8px; }
.master-dialog { width: min(1000px, calc(100vw - 32px)); }
.saved-comparison img { height: 43dvh; width: 100%; object-fit: contain; }
.comparison-actions { gap: 12px; }
#toast { bottom: max(20px, env(safe-area-inset-bottom)); border-radius: 12px; font-size: 14px; line-height: 1.5; }

@media (hover: hover) {
  .primary:hover:not(:disabled) { background: #633222; }
  .secondary:hover:not(:disabled), .dialog-x:hover { background: #f4ecea; border-color: #d3c5b9; }
  .intent-row button:hover { border-color: #be8b7b; }
  .swatch:hover:not(:disabled) { background: #f5f0ec; }
  .category-tabs button:hover { background: #f6f0ed; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .topbar { padding-inline: 22px; gap: 28px; }
  .topbar nav { gap: 20px; }
  .credit-pill { max-width: 150px; }
  #studio-view, #saved-view { padding: 24px 20px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 355px; gap: 16px; }
  .tools-scroll { padding: 20px; }
  .photo-toolbar { padding-inline: 12px; }
  .photo-toolbar > span { font-size: 12px; }
  .view-switch button { padding-inline: 9px; }
  .photo-footer { padding-inline: 12px; }
  .history-actions { gap: 10px; }
  .intent-row button { padding: 14px 16px; }
}

/* One page scroll on phones. The photo stays visible while choosing a shade. */
@media (max-width: 760px) {
  :root { --preview-height: clamp(350px, 52svh, 460px); --radius: 16px; }
  .topbar { position: static; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; height: auto; min-height: 104px; padding: env(safe-area-inset-top) 16px 0; }
  .brand { font-size: 30px; letter-spacing: -1.8px; min-height: 58px; display: flex; align-items: center; }
  .account-nav { grid-column: 2; grid-row: 1; justify-self: end; margin-left: 0; gap: 8px; }
  .account-nav .button { min-height: 44px; font-size: 13px; padding: 8px 13px; }
  .credit-pill { display: block; min-height: 44px; max-width: 155px; padding: 8px 10px; font-size: 11px; }
  .topbar nav { grid-column: 1 / -1; grid-row: 2; width: 100%; margin: 0; gap: 8px; min-height: 46px; }
  .topbar nav .nav-button, #studio-nav, #saved-nav, #ideas-button { display: block; flex: 1; min-height: 46px; padding: 6px 0; font-size: 12px; text-align: center; white-space: nowrap; }
  #saved-nav::before, #ideas-button::before { content: none; }
  #saved-nav span { width: 19px; height: 19px; margin-left: 4px; font-size: 10px; }
  #ideas-button > span { display: none; }
  #studio-view, #saved-view { height: auto; min-height: calc(100dvh - 104px); padding: 20px 14px max(16px, env(safe-area-inset-bottom)); }
  .page-heading { flex-direction: row; align-items: center; height: auto; padding: 0; gap: 12px; margin: 0 0 16px; }
  .page-heading > div { min-width: 0; }
  .page-heading h1 { font-size: 25px; letter-spacing: -.8px; }
  .page-heading h1 span, .heading-note { display: none; }
  .page-heading .button { width: auto; min-height: 46px; padding: 10px 12px; font-size: 13px; flex: none; }
  .page-heading .button > span { font-size: 19px; }
  .experience { margin-bottom: 12px; }
  .experience-steps { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; margin: 0 0 10px; }
  .experience-steps button { min-height: 44px; font-size: 11px; gap: 5px; line-height: 1.3; text-align: left; }
  .experience-steps button span { width: 23px; height: 23px; font-size: 10px; }
  .experience-steps button + button::before { content: none; }
  .intent-row { gap: 7px; }
  .intent-row button { min-width: 0; min-height: 92px; padding: 11px 10px; justify-content: flex-start; gap: 6px; border-radius: 11px; }
  .intent-row button strong { font-size: 14px; line-height: 1.3; font-weight: 600; overflow-wrap: normal; }
  .intent-row button span { font-size: 12px; line-height: 1.45; }
  .photo-help { gap: 0 16px; margin: 0 0 12px; font-size: 12px; }
  .photo-help > span { flex-basis: 100%; font-size: 12px; }
  .photo-help details { font-size: 12px; }
  .photo-help .text-button, .photo-help summary { min-height: 44px; font-size: 12px; padding-block: 12px; }
  .workspace { display: flex; flex-direction: column; height: auto; min-height: 0; gap: 12px; overflow: visible; scroll-margin-top: env(safe-area-inset-top); }
  /* Comparison needs enough room for the portrait as well as its slider.
     Define the height here so the sticky tabs and focus offsets follow it. */
  .workspace:has(#compare-mode[aria-pressed=true]) { --preview-height: clamp(440px, 66svh, 620px); }
  .photo-column { display: flex; height: var(--preview-height); min-height: 0; flex: none; position: sticky; top: env(safe-area-inset-top); z-index: 5; }
  .photo-panel { height: 100%; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 18px #342a2210; }
  .photo-toolbar { min-height: 52px; padding: 4px 10px; gap: 8px; background: var(--surface); }
  .photo-toolbar > span { min-width: 0; max-width: 48%; font-size: 11px; }
  .view-switch { padding: 2px; border-radius: 9px; margin-left: auto; }
  .view-switch button { min-height: 44px; font-size: 11px; padding: 8px 10px; border-radius: 7px; }
  .photo-stage { min-height: 70px; padding: 8px 8px 32px; }
  .portrait-wrap { border-radius: 9px; }
  .status-pill { bottom: 6px; padding: 4px 9px; max-width: calc(100% - 16px); font-size: 11px; }
  .photo-footer { min-height: 46px; padding: 0 10px; gap: 5px; flex-wrap: nowrap; }
  .photo-footer .text-button { min-height: 44px; font-size: 11px; white-space: nowrap; }
  .history-actions { gap: 12px; }
  .photo-footer #image-size { display: none; }
  .analysis-progress { bottom: 38px; padding: 3px 9px; gap: 6px; }
  .analysis-progress .text-button { min-height: 44px; font-size: 11px; }
  .retry { bottom: 40px; min-height: 44px; font-size: 12px; }
  .compare-control { min-height: 48px; padding: 2px 12px; gap: 12px; }
  .compare-control label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .compare-control::before { content: 'До'; }
  .compare-control::after { content: 'После'; }
  .compare-control::before, .compare-control::after { color: var(--muted); font-size: 12px; flex: none; }
  .compare-control input { flex: 1; min-width: 0; }
  .mask-tools { max-height: 180px; bottom: 48px; left: 6px; right: 6px; padding: 10px; }
  .mask-tools strong, .mask-tools label { font-size: 12px; }
  .brush-actions { gap: 4px; }
  .brush-actions button { min-height: 44px; padding: 6px 8px; font-size: 11px; }
  .mask-tools input[type=range] { min-height: 44px; height: 44px; }
  .restore-ai { min-height: 44px; bottom: 48px; font-size: 11px; }
  .settings-panel { position: relative; z-index: 2; min-height: 0; overflow: visible; border: 1px solid var(--line); border-radius: 16px; box-shadow: none; }
  .category-tabs { position: sticky; top: calc(var(--preview-height) + env(safe-area-inset-top)); z-index: 4; min-height: 60px; padding: 7px 6px; gap: 2px; border-radius: 16px 16px 0 0; }
  .category-tabs button { min-height: 46px; padding: 10px 4px; font-size: 12px; }
  .tools-scroll { padding: 20px 16px; overflow: visible; overscroll-behavior: auto; flex: none; scrollbar-gutter: auto; }
  .tools-scroll h2 { font-size: 22px; }
  .tools-scroll .muted { font-size: 14px; }
  #hair-panel > .muted { display: block; margin: 6px 0 18px; }
  #hair-panel > .field-label { display: block; }
  #hair-panel > #color-filter { margin-top: 0; }
  .quick-shades { padding: 12px; margin-bottom: 18px; }
  .palette, .makeup-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 5px; }
  .swatch { min-height: 84px; padding: 8px 2px; font-size: 12px; }
  .swatch-circle, .makeup-palette .swatch-circle { width: 44px; height: 44px; }
  .save-area { position: static; padding: 16px 14px max(16px, env(safe-area-inset-bottom)); gap: 10px; border-radius: 0 0 16px 16px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .save-area .button { min-height: 48px; font-size: 13px; }
  .save-area .export-options[open] { position: static; padding: 12px; box-shadow: none; border-radius: 10px; }
  .save-area .local-note { font-size: 12px; }
  .tools-scroll :is(button, input, textarea, select, summary), .save-area :is(button, select, summary, input) { scroll-margin-top: calc(var(--preview-height) + 76px + env(safe-area-inset-top)); scroll-margin-bottom: 16px; }
  :is(input:not([type=range]):not([type=checkbox]):not([type=color]), select, textarea) { font-size: 16px; }
  .photo-consent { align-items: flex-start; }
  .next-step { flex-direction: column; align-items: flex-start; padding: 18px 4px; gap: 2px; }
  .next-step button { align-self: flex-start; }
  .journey { padding: 16px; margin-bottom: 16px; }
  .journey > summary { font-size: 16px; }
  .journey > summary small { display: none; }
  .journey-grid { gap: 8px; }
  .journey-card { padding: 8px; }
  .journey-card img { height: 120px; }
  .journey-card strong { font-size: 13px; line-height: 1.4; }
  .journey-card p { display: block; font-size: 12px; }
  .journey-actions { gap: 8px; }
  .journey-actions .button { flex: 1 1 140px; }
  .journey-tabs { flex-wrap: wrap; gap: 8px; }
  .journey-fields { gap: 12px; }
  .journey-fields label { font-size: 13px; }
  .catalog-summary { padding: 12px; gap: 10px; }
  .studio-footnote { display: flex; align-items: flex-start; flex-direction: column; gap: 4px; margin: 0; }
  .demo-links { flex-wrap: wrap; gap: 16px; }
  .seo-links { padding: 4px 18px 20px; gap: 4px 10px; }
  #saved-view .page-heading { display: flex; flex-direction: column; align-items: stretch; gap: 16px; margin-bottom: 18px; }
  #saved-view h1 { font-size: 29px; }
  #saved-view .page-heading .button { width: 100%; margin: 0; }
  .saved-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .saved-info { padding: 12px; }
  .saved-info h2 { font-size: 15px; }
  .saved-info p { font-size: 12px; }
  .saved-actions { gap: 4px 12px; }
  .saved-actions .text-button { font-size: 12px; }
  .empty-state { padding: 36px 18px; }
  .comparison-toolbar { position: static; gap: 8px; }
  .comparison-toolbar .button { width: 100%; }
  dialog, .account-dialog { width: calc(100% - 24px); padding: 28px 20px 20px; border-radius: 20px; max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  dialog h2, .account-dialog h2 { font-size: 24px; padding-right: 12px; }
  .dialog-actions .button { flex: 1; }
  .master-dialog { padding: 24px 14px; }
  .master-dialog:has(.saved-comparison) { width: calc(100% - 12px); padding: 20px 10px; }
  .saved-comparison { padding: 5px; gap: 12px; scroll-snap-type: x proximity; }
  .saved-comparison figure { min-width: 0; scroll-snap-align: start; }
  .saved-comparison img { height: auto; aspect-ratio: 3 / 4; }
  .comparison-actions .button { width: 100%; }
  .analytics-consent { padding: 18px; left: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 24px); }
  .analytics-actions .button { flex: 1; }
}

@media (max-width: 359px) {
  .topbar { padding-inline: 12px; gap: 0 10px; }
  .credit-pill { max-width: 112px; font-size: 10px; padding-inline: 7px; }
  .brand { font-size: 27px; }
  .account-nav { gap: 5px; }
  .account-nav .button { padding-inline: 10px; font-size: 12px; }
  #studio-view, #saved-view { padding-inline: 10px; }
  .page-heading h1 { font-size: 22px; }
  .page-heading .button { padding-inline: 9px; font-size: 12px; gap: 4px; }
  .experience-steps { gap: 6px; }
  .experience-steps button { font-size: 10px; }
  .intent-row { gap: 5px; }
  .intent-row button { padding: 10px 7px; }
  .intent-row button strong { font-size: 12px; }
  .intent-row button span { font-size: 11px; }
  .photo-help { column-gap: 10px; }
  .photo-help .text-button, .photo-help summary { font-size: 11px; }
  .view-switch button { font-size: 10px; padding-inline: 8px; }
  .photo-stage { padding-bottom: 40px; }
  .photo-footer { padding-inline: 7px; }
  .photo-footer .text-button { font-size: 10px; }
  .history-actions { gap: 8px; }
  .tools-scroll { padding-inline: 12px; }
  .category-tabs button { font-size: 11px; }
  .save-area { padding-inline: 12px; }
  .save-area .button { font-size: 12px; }
  .saved-grid { grid-template-columns: 1fr; }
  .journey-grid { grid-template-columns: 1fr; }
  .journey-card { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .journey-card img { width: 76px; height: 104px; }
}

/* A keyboard or landscape viewport must not be covered by the sticky preview. */
@media (max-width: 1000px) and (max-height: 600px) {
  .photo-column { position: static; height: 300px; }
  .category-tabs { position: static; }
  .tools-scroll :is(button, input, textarea, select, summary), .save-area :is(button, select, summary, input) { scroll-margin-top: 16px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  /* On short phones, let the larger comparison scroll instead of covering tools. */
  .workspace:has(#compare-mode[aria-pressed=true]) .photo-column { position: static; height: max(440px, 72svh); }
  .workspace:has(#compare-mode[aria-pressed=true]) .category-tabs { position: sticky; top: 0; }
  .workspace:has(#compare-mode[aria-pressed=true]) :is(.tools-scroll, .save-area) :is(button, input, textarea, select, summary) { scroll-margin-top: 76px; }
}
@media (min-width: 761px) and (max-height: 600px) {
  .workspace { height: auto; min-height: 0; align-items: start; }
  .photo-column { height: 480px; }
  .photo-stage { padding: 10px 12px 38px; }
  .settings-panel { overflow: visible; }
  .tools-scroll { overflow: visible; }
  .save-area .export-options[open] { position: static; box-shadow: none; border-radius: 12px; }
}
@media (max-width: 760px) {
  .workspace:has(:is(textarea, input:not([type=range]):not([type=color]):not([type=checkbox])):focus) .photo-column,
  .workspace:has(:is(textarea, input:not([type=range]):not([type=color]):not([type=checkbox])):focus) .category-tabs { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
