:root {
  color-scheme: light;
  --paper: #f7f7f5;
  --surface: #fbfbfa;
  --ink: #18191a;
  --muted: #717377;
  --quiet: #929498;
  --line: #d9dad8;
  --line-dark: #b8b9b8;
  --red: #bb2934;
  --red-soft: #f7e8e8;
  --green: #628b68;
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-family: var(--font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; }
body { min-width: 0; min-height: 100vh; margin: 0; background: var(--paper); font-size: 16px; line-height: 1.65; }
button, input, select { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, label:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.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; }

.site-header { position: relative; z-index: 2; height: 76px; padding: 0 clamp(20px, 5vw, 76px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); background: var(--paper); }
.brand { display: inline-flex; align-items: center; gap: 9px; width: max-content; color: var(--ink); text-decoration: none; }
.brand-mark { display: block; width: 30px; height: 21px; object-fit: contain; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.main-nav { align-self: stretch; display: flex; align-items: stretch; gap: clamp(19px, 3vw, 48px); }
.main-nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); white-space: nowrap; font-size: 14px; font-weight: 500; text-decoration: none; }
.main-nav a.active { font-weight: 600; }
.main-nav a.active::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; background: var(--red); content: ''; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 23px; }
.local-chip { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.local-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.text-action:hover { color: var(--red); }
.custom-recipe-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 7px 14px; border: 1px solid var(--line-dark); color: var(--ink); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.custom-recipe-link:hover { border-color: var(--red); color: var(--red); }
.catalog-heading .custom-recipe-link { margin-left: auto; margin-right: 18px; }
@media (max-width: 700px) { .catalog-heading .custom-recipe-link { margin: 0 0 9px; align-self: flex-start; } }

.page-shell { width: min(100% - 64px, 1380px); margin: 0 auto; }
.model-settings { margin-top: 4px; border-bottom: 1px solid var(--line); }
.model-settings > summary { display: flex; min-height: 48px; align-items: center; gap: 12px; color: var(--muted); cursor: pointer; list-style: none; }
.model-settings > summary::-webkit-details-marker { display: none; }
.model-settings > summary::after { margin-left: auto; color: var(--quiet); content: '+'; font: 16px var(--mono); }
.model-settings[open] > summary::after { content: '−'; }
.model-settings > summary strong { color: var(--ink); font-size: 14px; font-weight: 500; }
.model-bar { min-height: 72px; display: flex; align-items: center; gap: 22px; border-top: 1px solid var(--line); }
.eyebrow, .kicker { color: var(--muted); font: 12px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.model-switch { display: flex; align-items: stretch; gap: 9px; }
.model-switch button { min-width: 102px; min-height: 44px; padding: 0 9px; border-bottom: 1px solid transparent; text-align: center; }
.model-switch button[aria-pressed='true'] { border-bottom: 2px solid var(--ink); font-weight: 700; }
.model-switch strong { font-size: 14px; font-weight: 600; white-space: nowrap; }
.model-divider { height: 28px; margin-left: 3px; border-left: 1px solid var(--line); }
.variant-label { margin-left: 1px; }
.variant-options { display: flex; align-items: center; gap: 8px; }
.variant-options button { min-width: 104px; min-height: 44px; padding: 5px 12px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: nowrap; }
.variant-options button[aria-pressed='true'] { border-color: var(--red); color: var(--red); background: #fff; }
.model-status { margin: 0 0 0 auto; color: var(--muted); font-size: 12px; text-align: right; }

.workflow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 3vw, 40px); padding-top: 18px; border-bottom: 1px solid var(--line); }
.workflow button { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 9px; padding: 0 0 8px; border-bottom: 2px solid transparent; color: var(--muted); text-align: left; white-space: nowrap; font-size: 14px; }
.workflow button span { color: var(--ink); font: 12px var(--mono); }
.workflow button b { overflow: hidden; font-weight: 500; text-overflow: ellipsis; }
.workflow button[aria-current='step'] { border-bottom-color: var(--red); color: var(--red); font-weight: 600; }
.workflow button[aria-current='step'] span { color: var(--red); }
.workflow button[aria-current='step'] b { font-weight: 600; }
.workflow button.is-done { color: var(--ink); }
.workflow button.is-done b::after { padding-left: 5px; color: var(--quiet); content: '✓'; }

.page-view { padding: 35px 0 53px; }
.page-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; justify-content: space-between; align-items: end; gap: 24px; margin: 1px 0 24px; }
.kicker { margin: 0 0 6px; }
h1, h2, h3, p, figure, dl { margin-top: 0; }
h1 { margin: 0 0 5px; font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
.lead { max-width: min(65ch, 100%); margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.surface { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.quick-film-nav { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px auto; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #e8e8e6; }
.quick-film-step { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--line); color: var(--ink); font-size: 16px; }
.quick-film-step:disabled { cursor: not-allowed; opacity: .38; }
.quick-film-step:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.quick-film-picker { display: flex; min-width: 0; align-items: center; gap: 9px; }
.quick-film-picker > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.quick-film-picker select { width: 100%; min-width: 0; min-height: 44px; padding: 5px 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.quick-film-position { color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.button { display: inline-flex; min-width: 125px; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line-dark); border-radius: 1px; background: transparent; color: var(--ink); font-size: 14px; text-align: center; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.button:hover:not(:disabled) { border-color: var(--ink); background: #efefed; }
.button.dark { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.button.dark:hover:not(:disabled) { background: #333436; }
.button.wide { width: 100%; min-width: 0; }
.help-text { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.catalog-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 9px; }
.catalog-heading > div { display: grid; gap: 2px; }
.catalog-heading > div strong { font-size: 12px; font-weight: 600; }
.catalog-search { display: flex; width: min(260px, 43%); min-height: 44px; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); background: var(--surface); }
.catalog-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; }
.catalog-search input:focus-visible { outline: 0; }
.catalog-search kbd { color: var(--quiet); font: 12px var(--mono); }
.catalog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.catalog-result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.catalog-actions { display: flex; align-items: center; gap: 10px; }
.catalog-action { min-height: 44px; padding: 3px 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.catalog-action:hover:not(:disabled) { color: var(--red); }
.muted-small { color: var(--muted); font-size: 12px; }
.filmstrip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.empty-recipes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; padding: 16px 0; color: var(--muted); font-size: 12px; }
.catalog-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.catalog-pagination select { min-height: 44px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.pagination-status { margin-right: auto; }
.page-button { width: 44px; height: 44px; border: 1px solid var(--line); color: var(--ink); font-size: 15px; }
.page-button:disabled { opacity: .35; }
.recipe-note { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.source-link { min-height: 44px; padding: 3px 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.source-link:hover { color: var(--red); }
.camera-draft-details > summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.camera-draft-details > summary::-webkit-details-marker { display: none; }
.camera-draft-details > summary::after { color: var(--quiet); content: '+'; font: 15px var(--mono); }
.camera-draft-details[open] > summary::after { content: '−'; }
.camera-draft-content { display: grid; gap: 16px; padding-top: 9px; }
.camera-draft-content .parameter-section, .camera-draft-content .white-balance-section { min-width: 0; }
.camera-draft-content .parameter-heading h3 { font-size: 12px; }
.slot-disabled-details { grid-column: 1 / -1; width: 100%; }
.slot-disabled-details > summary { color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.slot-disabled-note { margin: 6px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.55; }
.parameter-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.parameter-heading h3 { margin-bottom: 1px; }
.parameter-heading span { color: var(--red); font-size: 12px; }
.parameter-disclaimer { margin: 4px 0 5px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.parameter-list { margin: 0; }
.parameter-row { display: flex; align-items: center; gap: 10px; min-height: 28px; border-bottom: 1px solid #e9e9e7; }
.parameter-row dt { flex: 1; color: var(--muted); font-size: 13px; }
.parameter-row dd { width: 90px; margin: 0; }
.parameter-row select { width: 100%; min-height: 25px; padding: 2px 5px; border: 0; background: transparent; font: 12px var(--mono); text-align: right; }
.parameter-row select:disabled { color: var(--quiet); opacity: .7; }
.wb-row { display: flex; min-height: 31px; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e9e9e7; color: var(--muted); font-size: 12px; }
.wb-row select, .wb-row input { width: 115px; min-height: 28px; padding: 3px 6px; border: 0; background: transparent; color: var(--ink); font: 12px var(--mono); text-align: right; }
.slot-notice { grid-column: 1 / -1; margin: 0; color: var(--red); font-size: 12px; line-height: 1.5; }
.undo-assignment { display: flex; grid-column: 1 / -1; align-items: flex-start; justify-content: space-between; gap: 10px; padding-top: 3px; border-top: 1px solid var(--line); }
.undo-assignment > span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.undo-assignment .text-action { flex: 0 0 auto; min-height: 44px; color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.selection-undo-row { margin: 13px 0 8px; }
.flow-cta { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-top: 14px; padding: 13px 0 0; border-top: 1px solid var(--line); }
.flow-cta .button.dark { min-width: 210px; min-height: 46px; font-size: 14px; }
.global-demo-note { margin: 16px 0 0; color: var(--quiet); font-size: 12px; }
.global-demo-note span { color: var(--muted); }

.stage[hidden] { display: none; }
.capacity-mark { color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.selection-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; align-items: start; }
.surface { padding: 24px; }
.surface-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.surface-heading h3, .surface > h3 { margin: 0; font-size: 18px; font-weight: 600; }
.slot-list { margin-top: 2px; }
.slot-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(180px, .8fr) 40px; align-items: center; gap: 15px; min-height: 93px; border-bottom: 1px solid var(--line); }
.slot-number { color: var(--quiet); font: 12px var(--mono); }
.slot-name { display: grid; gap: 2px; }
.slot-name strong { font-size: 13px; font-weight: 600; }
.slot-name span { color: var(--muted); font-size: 12px; }
.slot-row select { min-width: 0; min-height: 44px; padding: 5px 9px; border: 1px solid var(--line-dark); background: var(--surface); font-size: 13px; }
.remove-slot { width: 44px; height: 44px; border: 1px solid var(--line); color: var(--muted); font-size: 17px; }
.remove-slot:hover { border-color: var(--red); color: var(--red); }
.text-action { min-height: 44px; padding: 5px 0; color: var(--muted); font-size: 13px; text-align: left; }
.text-action:disabled { cursor: not-allowed; opacity: .45; }
.support-aside { border-top: 1px solid var(--line); }
.aside-block { padding: 19px 0; border-bottom: 1px solid var(--line); }
.aside-block h3 { margin: 6px 0 2px; font-size: 15px; font-weight: 600; }
.aside-block .muted { margin: 8px 0 0; font-size: 12px; line-height: 1.75; }
.support-version { margin: 0; color: var(--muted); font: 12px var(--mono); }
.cta-right { display: flex; align-items: center; gap: 14px; }
.cta-right .muted-small { max-width: 260px; }
.selection-layout .firmware-surface { min-height: 380px; }
.firmware-surface > .muted { max-width: 550px; margin: 9px 0 0; }
.firmware-drop { display: flex; min-height: 194px; flex-direction: column; justify-content: center; align-items: center; gap: 7px; margin-top: 24px; border: 1px dashed var(--line-dark); }
.firmware-drop.is-dragging { border-color: var(--red); background: #f9f8f6; }
.drop-mark { color: var(--red); font-size: 27px; line-height: 1; }
.firmware-drop strong { font-size: 13px; font-weight: 600; }
.firmware-drop > span:not(.drop-mark) { color: var(--muted); font-size: 12px; }
.firmware-drop .button { margin-top: 6px; }
#cancelFirmwareInspection { margin-top: 10px; }
.firmware-backup-button { margin-top: 14px; width: 100%; text-align: center; }
.firmware-backup-button[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.firmware-backup-entry .muted-small { margin-bottom: 0; font-size: 11px; line-height: 1.65; }
.firmware-summary { display: flex; align-items: flex-start; gap: 11px; min-height: 77px; margin-top: 12px; padding: 14px 0 6px; border-top: 1px solid var(--line); }
.status-mark { display: grid; flex: 0 0 21px; width: 21px; height: 21px; place-items: center; border: 1px solid var(--line-dark); border-radius: 50%; color: var(--muted); font-size: 12px; }
.firmware-summary.ready .status-mark { border-color: var(--green); color: var(--green); }
.firmware-summary.has-error .status-mark { border-color: var(--red); color: var(--red); }
.firmware-summary strong { display: block; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.firmware-summary p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.boundary-block { border-left: 2px solid var(--red); padding-left: 13px; }
.export-layout { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 20px; align-items: stretch; }
.export-left { display: grid; align-content: start; gap: 12px; }
.export-recipes { padding: 20px 23px; }
.export-recipe-list { padding-top: 0; }
.export-recipe-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 8px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.export-recipe-identity { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 16px; }
.export-recipe-identity img { display: block; width: 64px; height: 64px; object-fit: contain; }
.export-recipe-identity div { display: grid; gap: 2px; }
.export-recipe-identity strong { font-size: 20px; font-weight: 600; }
.export-recipe-identity span { color: var(--muted); font-size: 14px; }
.export-recipe-identity span.intensity-detail { margin-top: 5px; color: var(--quiet); font-size: 12px; }
.export-firmware-line { display: flex; align-items: center; gap: 14px; padding-top: 12px; color: var(--muted); font-size: 12px; }
.export-firmware-line span { padding-right: 13px; border-right: 1px solid var(--line-dark); }
.export-firmware-line strong { color: var(--ink); font-size: 12px; font-weight: 500; }
.parameter-summary { padding: 18px 20px; }
.parameter-table-wrap { width: 100%; overflow-x: auto; }
.parameter-summary table { width: 100%; border-collapse: collapse; margin-top: 11px; font-size: 13px; text-align: left; }
.parameter-summary th, .parameter-summary td { padding: 8px 9px; border: 1px solid var(--line); vertical-align: top; }
.parameter-summary th { color: var(--muted); font-size: 14px; font-weight: 500; }
.parameter-summary td:first-child, .parameter-summary td:nth-child(2) { white-space: nowrap; }
.table-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.parameter-summary .surface-heading h3, .export-recipes .surface-heading h3 { font-size: 24px; }
.export-result { display: flex; flex-direction: column; padding: 20px 23px; }
.export-result > h3 { margin: 0; padding-bottom: 9px; border-bottom: 1px solid var(--line); font-size: 26px; font-weight: 600; }
.result-state { display: grid; justify-items: center; padding: 27px 0 17px; text-align: center; }
.result-icon { display: grid; width: 80px; height: 80px; place-items: center; border: 1px solid var(--ink); border-radius: 50%; font-size: 31px; line-height: 1; }
.result-state strong { margin-top: 10px; font-size: 20px; font-weight: 600; }
.result-state p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.result-state.success .result-icon { border-color: var(--green); color: var(--green); }
.export-file-facts { display: grid; gap: 5px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.export-file-facts > span { font-size: 14px; }
.export-file-facts code { display: block; padding: 10px; background: #f1f1ef; font: 14px/1.5 var(--mono); overflow-wrap: anywhere; }
.export-file-facts p { margin: 0; color: var(--muted); font-size: 13px; }
.export-warning { margin: 12px 0 9px; color: var(--red); font-size: 16px; font-weight: 600; text-align: center; }
.confirm-demo { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.confirm-demo input { flex: 0 0 auto; margin: 3px 0 0; accent-color: var(--ink); }
.export-actions { display: grid; gap: 7px; margin-top: 4px; }
.download-button[hidden] { display: none; }
.download-button { min-height: 50px; font-size: 16px; }
.progress-wrap { margin: 3px 0 8px; }
.progress-wrap > span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.compiled-recipe-icons { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 10px; }
.compiled-recipe-icons figure { display: grid; justify-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 11px; }
.compiled-recipe-icons img { width: 64px; height: 64px; object-fit: contain; border: 1px solid var(--line); background: #f0f0ed; }
.result-footnote { margin: 11px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.5; }
.export-cta { margin-top: 18px; }
.export-cta > .muted-small { margin-left: auto; }

.help-dialog { width: min(570px, calc(100vw - 32px)); max-height: min(86vh, 760px); padding: 31px; border: 1px solid var(--line-dark); background: var(--paper); color: var(--ink); }
.help-dialog::backdrop { background: rgb(24 25 26 / 35%); }
.help-dialog form { position: absolute; top: 14px; right: 15px; }
.dialog-close { width: 44px; height: 44px; color: var(--muted); font-size: 24px; }
.help-dialog h2 { margin: 0 0 9px; font-size: 27px; letter-spacing: -.04em; }
.help-dialog > p:not(.kicker) { color: var(--muted); font-size: 12px; line-height: 1.8; }
.help-callout { display: grid; gap: 4px; margin: 17px 0; padding: 13px 15px; border-left: 2px solid var(--red); background: #f0efec; }
.help-callout strong { font-size: 12px; }
.help-callout span { color: var(--muted); font-size: 12px; line-height: 1.65; }
.help-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 13px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.help-grid span { font: 12px var(--mono); }
.help-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.help-dialog .help-final { margin: 14px 0 0; font-size: 12px !important; }

body.is-generating .site-header, body.is-generating .model-bar, body.is-generating .stage { pointer-events: none; }
body.is-generating #cancelGeneration, body.is-generating #cancelFirmwareInspection { pointer-events: auto; }

@media (min-width: 1500px) {
  .page-shell { width: min(100% - 64px, 1380px); }
}

@media (max-width: 980px) {
  .site-header { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 20px; }
  .main-nav { justify-self: center; gap: clamp(19px, 3vw, 36px); }
  .header-actions { grid-row: 1; grid-column: 3; justify-self: end; gap: 0; }
  .page-shell { width: calc(100% - 64px); }
  .workflow { gap: clamp(14px, 2vw, 28px); }
}

@media (max-width: 720px) {
  .site-header { height: auto; min-height: 104px; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: 58px 45px; padding: 0 20px; gap: 0 16px; }
  .brand { grid-row: 1; grid-column: 1; }
  .header-actions { grid-row: 1; grid-column: 3; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; gap: 28px; overflow-x: auto; scrollbar-width: none; }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { min-height: 44px; font-size: 14px; }
  .page-shell { width: calc(100% - 40px); }
  .model-bar { flex-wrap: wrap; gap: 9px 12px; padding: 8px 0; }
  .model-switch { gap: 4px; }
  .model-switch button { min-width: 75px; min-height: 44px; padding-inline: 5px; }
  .model-switch strong { font-size: 14px; }
  .model-divider { height: 22px; }
  .variant-options { gap: 5px; }
  .variant-options button { min-width: 77px; min-height: 44px; padding-inline: 7px; font-size: 13px; }
  .model-status { flex-basis: 100%; margin: 0; text-align: left; }
  .page-view { padding-top: 30px; }
  .page-heading { display: grid; }
  .workflow { width: 100%; margin-top: 0; }
  .filmstrip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .selection-layout { grid-template-columns: minmax(0, 1fr) 235px; gap: 19px; }
  .export-result { padding-inline: 16px; }
}

@media (max-width: 980px) {
  .export-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
}

@media (max-width: 480px) {
  .site-header { min-height: 101px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 55px 45px; padding-inline: 16px; column-gap: 8px; }
  .main-nav { gap: 24px; }
  .page-shell { width: calc(100% - 32px); }
  .model-settings > summary { min-height: 48px; flex-wrap: wrap; gap: 4px 9px; }
  .model-settings > summary strong { font-size: 13px; }
  .model-bar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; padding: 10px 0; }
  .model-bar > .eyebrow { font-size: 12px; }
  .model-switch { min-width: 0; gap: 2px; }
  .model-switch button { min-width: 0; flex: 1; padding-inline: 3px; }
  .model-switch strong { font-size: 13px; }
  .model-divider { display: none; }
  .variant-options { min-width: 0; overflow-x: auto; }
  .variant-options button { min-width: 0; flex: 1 0 auto; }
  .variant-label { margin: 0; }
  .model-status { grid-column: 1 / -1; font-size: 12px; text-align: left; }
  .page-view { padding-top: 24px; }
  .kicker { font-size: 12px; }
  h1 { font-size: 32px; }
  .lead { font-size: 15px; }
  .workflow { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 0; padding-top: 13px; }
  .workflow button { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 54px; padding-bottom: 6px; white-space: normal; }
  .workflow button b { font-size: 12px; }
  .quick-film-nav { grid-template-columns: 42px minmax(0, 1fr) 42px; gap: 4px 7px; padding: 7px 8px; }
  .quick-film-step { width: 42px; height: 42px; }
  .quick-film-picker { gap: 7px; }
  .quick-film-picker > span { font-size: 12px; }
  .quick-film-picker select { min-height: 44px; padding-inline: 6px; font-size: 13px; }
  .quick-film-position { grid-column: 2; grid-row: 2; justify-self: end; font-size: 12px; }
  .filmstrip { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x mandatory; }
  .catalog-heading { align-items: flex-start; flex-direction: column; }
  .catalog-search { width: 100%; }
  .catalog-toolbar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .catalog-actions { width: 100%; justify-content: space-between; gap: 7px; }
  .catalog-action { min-height: 44px; }
  .camera-draft-details > summary { min-height: 44px; }
  .slot-disabled-details > summary { min-height: 44px; display: flex; align-items: center; }
  .undo-assignment { align-items: center; }
  .undo-assignment .text-action { min-height: 44px; }
  .parameter-row { min-height: 29px; }
  .parameter-row dt { font-size: 12px; }
  .parameter-row select { font-size: 12px; }
  .flow-cta { align-items: stretch; flex-direction: column; gap: 12px; margin-top: 14px; }
  .flow-cta > .button { width: 100%; }
  .cta-right { justify-content: space-between; }
  .cta-right .button { min-width: 0; }
  .global-demo-note { margin-top: 18px; }
  .selection-layout, .export-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .surface { padding: 17px 14px; }
  .slot-row { grid-template-columns: 23px minmax(0, 1fr) 36px; gap: 8px; padding: 12px 0; }
  .slot-name { grid-column: 2; }
  .slot-row select { grid-column: 2; grid-row: 2; width: 100%; }
  .remove-slot { grid-column: 3; grid-row: 1 / span 2; }
  .support-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
  .aside-block { padding: 14px 0; }
  .cta-right { align-items: flex-end; }
  .cta-right .muted-small { max-width: 46%; }
  .firmware-surface { min-height: auto !important; }
  .firmware-drop { min-height: 180px; }
  .export-recipes, .parameter-summary { padding: 16px 13px; }
  .export-recipe-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .export-recipe-identity { gap: 12px; }
  .export-recipe-identity strong { font-size: 17px; }
  .export-recipe-identity span { font-size: 12px; }
  .export-result { padding: 17px 15px; }
  .parameter-summary table { min-width: 560px; }
  .export-cta { align-items: stretch; }
  .export-cta > .muted-small { margin: 0; text-align: center; }
  .help-dialog { padding: 27px 19px 20px; }
  .help-grid { grid-template-columns: 1fr; gap: 3px; }
  .help-grid p { margin-bottom: 9px; }
  .help-grid p:last-child { margin-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Shared code-native directional and photo icons. */
.ui-icon { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: middle; }

/* Preset-first browsing and explicit shortlist planning. */
.browse-layout { display: grid; grid-template-columns: minmax(0, 1fr) 284px; align-items: start; gap: 28px; }
.browse-main { min-width: 0; }
.catalog-view { min-width: 0; }
.browse-catalog-heading { align-items: center; margin: 0 0 15px; }
.browse-catalog-heading > div { gap: 3px; }
.browse-catalog-heading > div strong { color: var(--muted); font-size: 12px; font-weight: 500; }
.catalog-search { width: min(300px, 44%); min-height: 44px; }
.catalog-toolbar { align-items: center; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.catalog-actions { justify-content: flex-end; }
.catalog-result-count { font-size: 12px; }
.catalog-action { font-size: 12px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.preset-card { min-width: 0; border: 1px solid var(--line); background: var(--surface); transition: border-color .16s, transform .16s; }
.preset-card:hover { border-color: var(--line-dark); transform: translateY(-2px); }
.preset-card.is-shortlisted { border-color: var(--red); }
.preset-open { display: block; width: 100%; min-width: 0; padding: 0; text-align: left; }
.preset-open:focus-visible { outline-offset: 2px; }
.preset-card-copy { display: grid; gap: 5px; padding: 11px 12px 12px; }
.preset-shortlisted-mark { color: var(--red); font-size: 12px; white-space: nowrap; }
.preset-card-copy > strong { overflow: hidden; font-size: 15px; font-weight: 600; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.preset-card-copy > small { display: -webkit-box; min-height: 36px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.empty-recipes { min-height: 110px; align-content: center; }
.catalog-pagination { min-height: 39px; margin-top: 14px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; }
.catalog-pagination select { min-height: 44px; padding: 4px 8px; font-size: 13px; }
.page-button { width: 44px; height: 44px; }
.shortlist-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.shortlist-heading .eyebrow { font-size: 12px; }
.shortlist-heading h2 { margin: 2px 0 0; font-size: 20px; font-weight: 600; }
.shortlist-count { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line-dark); color: var(--red); font: 12px var(--mono); }
.shortlist-list { display: grid; gap: 0; }
.shortlist-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 55px; padding: 7px 0; border-bottom: 1px solid #e8e8e6; }
.shortlist-open { display: grid; min-width: 0; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 9px; padding: 0; text-align: left; }
.shortlist-open img { width: 64px; height: 64px; object-fit: cover; }
.shortlist-open strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.shortlist-remove { min-height: 44px; padding: 4px 2px; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.shortlist-remove:hover { color: var(--red); }
.shortlist-empty { margin: 0 0 13px; padding: 13px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.shortlist-feedback { min-height: 0; margin: 8px 0; color: var(--red); font-size: 12px; line-height: 1.5; }
.shortlist-feedback:empty { display: none; }
.shortlist-footnote { margin: 9px 0 0; color: var(--quiet); font-size: 12px; line-height: 1.5; }
.detail-view { min-width: 0; }
.detail-back { min-height: 44px; margin: -5px 0 10px; color: var(--muted); font-size: 13px; }
.detail-add-button { flex: 0 0 190px; min-height: 47px; }
.sample-gallery { margin-top: 18px; }
.sample-gallery-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sample-gallery-heading h3 { margin: 0; font-size: 16px; font-weight: 600; }
.sample-gallery-heading span { color: var(--muted); font-size: 12px; }
.selection-main { display: grid; min-width: 0; gap: 15px; }
.shortlist-plan-surface, .slot-list-surface, .assignment-editor { padding: 19px 22px; }
.shortlist-plan-list { display: grid; }
.plan-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan-card-identity { display: grid; min-width: 0; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 13px; }
.plan-card-identity img { display: block; width: 64px; height: 64px; object-fit: contain; }
.plan-card-identity div { display: grid; gap: 3px; min-width: 0; }
.plan-card-identity strong { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.plan-card-identity span { color: var(--muted); font-size: 12px; line-height: 1.5; }
.plan-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 13px; }
.plan-card-actions .text-action { min-height: 44px; padding-inline: 2px; font-size: 13px; }
.plan-card-actions .plan-button { min-width: 150px; min-height: 44px; font-size: 13px; }
.plan-assigned { color: var(--red); font-size: 12px; white-space: nowrap; }
.empty-shortlist-plan { margin: 0; padding: 18px 0 5px; font-size: 12px; }
.slot-row { grid-template-columns: 28px minmax(120px, 1fr) minmax(140px, .9fr) auto 38px; gap: 10px; min-height: 77px; }
.slot-row select { min-height: 44px; font-size: 13px; }
.edit-assignment-button { min-height: 44px; padding-inline: 2px; font-size: 13px; white-space: nowrap; }
.selection-notice { margin: 0 0 13px; padding: 8px 11px; border-left: 2px solid var(--red); background: var(--red-soft); color: var(--muted); font-size: 12px; line-height: 1.55; }
.selection-notice:empty, .selection-notice[hidden] { display: none; }
.browse-more-button { margin-top: 9px; text-decoration: underline; text-underline-offset: 3px; }
.assignment-editor .surface-heading { align-items: center; }
.editor-heading > div { display: grid; gap: 2px; }
.editor-heading h3 { margin: 0; font-size: 19px; }
.editor-assignment-label { margin: 12px 0 4px; color: var(--red); font-size: 12px; }
.assignment-editor .recipe-note { margin: 0 0 9px; }
.assignment-editor .camera-draft-details { padding-top: 4px; }
.assignment-editor .camera-draft-details > summary { min-height: 44px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.assignment-editor .camera-draft-content { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; padding-top: 15px; }
.assignment-editor .slot-disabled-details { grid-column: 1 / -1; padding-top: 5px; border-top: 1px solid var(--line); }
.assignment-editor .source-link { grid-column: 1 / -1; justify-self: start; }

@media (max-width: 720px) {
  .browse-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; }
  .plan-card { grid-template-columns: minmax(0, 1fr); }
  .plan-card-actions { justify-content: flex-start; }
  .slot-row { grid-template-columns: 24px minmax(100px, 1fr) minmax(115px, .8fr) auto 34px; gap: 7px; }
}

@media (max-width: 480px) {
  body { padding-bottom: 78px; }
  .browse-layout { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .catalog-view { padding-bottom: 4px; }
  .browse-catalog-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .browse-catalog-heading .catalog-search { width: 100%; }
  .catalog-toolbar { align-items: flex-start; flex-direction: column; gap: 5px; }
  .catalog-actions { width: 100%; justify-content: flex-start; min-height: 32px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .preset-card-copy { gap: 4px; padding: 8px 8px 9px; }
  .preset-card-copy > strong { font-size: 13px; }
  .preset-card-copy > small { min-height: 42px; font-size: 12px; }
  .catalog-pagination { justify-content: flex-start; gap: 6px; }
  .pagination-status { flex: 1 1 auto; }
  .shortlist-heading h2 { font-size: 18px; }
  .shortlist-empty { padding: 9px 0; }
  .detail-back { min-height: 42px; margin-top: -8px; }
  .detail-add-button { flex-basis: auto; width: 100%; }
  .sample-gallery-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
  .shortlist-plan-surface, .slot-list-surface, .assignment-editor { padding: 15px 13px; }
  .plan-card { gap: 8px; padding: 11px 0; }
  .plan-card-identity { grid-template-columns: 64px minmax(0, 1fr); gap: 9px; }
  .plan-card-identity img { width: 64px; height: 64px; }
  .plan-card-identity strong { font-size: 13px; }
  .plan-card-actions { gap: 3px 10px; }
  .plan-card-actions .plan-button { min-width: 0; min-height: 40px; flex: 1 1 145px; }
  .slot-row { grid-template-columns: 21px minmax(0, 1fr) 35px; gap: 7px; padding: 10px 0; }
  .slot-name { grid-column: 2; }
  .slot-row select { grid-column: 2; grid-row: 2; width: 100%; }
  .edit-assignment-button { grid-column: 2; grid-row: 3; justify-self: start; }
  .remove-slot { grid-column: 3; grid-row: 1 / span 3; }
  .assignment-editor .camera-draft-content { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .editor-heading { align-items: flex-start !important; }
  .support-aside { grid-template-columns: minmax(0, 1fr); }
}

/* Film packaging is the primary browsing cue; LUT samples remain supporting previews. */
.preset-card { overflow: hidden; }
.catalog-pack-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.preset-card-copy > small { min-height: 1.55em; -webkit-line-clamp: 1; }
.detail-add-button { width: 100%; min-width: 0; }
.shortlist-open img, .plan-card-identity img { object-fit: contain; background: #ecece9; padding: 2px; }
.plan-card-identity img { filter: drop-shadow(0 3px 3px rgb(24 25 26 / 11%)); }
.shortlist-open img { filter: drop-shadow(0 2px 3px rgb(24 25 26 / 12%)); }

@media (max-width: 720px) {
  .browse-layout { grid-template-columns: minmax(0, 1fr); }
  .detail-add-button { grid-column: 3; grid-row: 1; align-self: end; }
}

@media (max-width: 480px) {
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-add-button { grid-column: 1 / -1; grid-row: 3; }
}

/* Roll-icon film catalog and two-scene detail view. */
.page-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px 24px; }
.page-heading .title-block { min-width: 0; }
.selected-count-button { display: inline-flex; min-height: 44px; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 13px; white-space: nowrap; }
.selected-count-button strong { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line-dark); color: var(--red); font: 12px var(--mono); }
.selected-count-button > span:last-child { color: var(--red); font-size: 15px; }
.selected-count-button:disabled { opacity: .52; }
.workflow { width: 100%; flex: initial; }
.browse-layout { display: block; }
.browse-main { width: 100%; }
.catalog-heading.browse-catalog-heading { display: flex; align-items: end; }
.catalog-use-cases { display: flex; flex-wrap: wrap; gap: 3px 8px; }
.catalog-use-cases button { min-height: 44px; padding: 5px 10px; color: var(--muted); font-size: 13px; }
.catalog-use-cases button[aria-pressed='true'] { color: var(--red); box-shadow: inset 0 -1px var(--red); }
.catalog-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; }
.catalog-selected-only { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.catalog-selected-only input { width: 17px; height: 17px; margin: 0; accent-color: var(--red); }
.catalog-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; }
.preset-card { min-width: 0; overflow: visible; border: 0; border-bottom: 1px solid var(--line); background: transparent; transition: none; }
.preset-card:hover { border-color: var(--line); transform: none; }
.preset-card.is-shortlisted { border-color: var(--line); }
.preset-open { display: grid; width: 100%; min-width: 0; gap: 0; padding: 0; text-align: left; }
.preset-icon-stage { display: grid; width: 100%; aspect-ratio: 1.62 / 1; place-items: center; overflow: hidden; background: #f0f0ed; }
.preset-main-icon { display: block; width: 136px; height: 136px; object-fit: contain; filter: drop-shadow(0 4px 5px rgb(24 25 26 / 11%)); }
.preset-icon-stage.is-empty { color: var(--muted); font: 14px var(--mono); }
.preset-card-copy { display: grid; gap: 7px; padding: 12px 0 14px; }
.preset-card-copy > .preset-title { min-width: 0; overflow: visible; font-size: 18px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; text-overflow: clip; white-space: normal; }
.preset-card-copy > small { min-height: 0; font-size: 13px; line-height: 1.5; -webkit-line-clamp: 2; }
.catalog-pack-note { max-width: 950px; margin: 17px 0 0; font-size: 12px; }
.shortlist-section { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 24px; margin-top: 34px; padding: 18px 0 0; border-top: 1px solid var(--line); }
.shortlist-main { min-width: 0; }
.shortlist-heading { justify-content: flex-start; gap: 12px; padding: 0 0 10px; border: 0; }
.shortlist-heading .eyebrow { font-size: 12px; }
.shortlist-heading h2 { font-size: 18px; }
.shortlist-count { width: 28px; height: 28px; font-size: 12px; }
.shortlist-list { display: flex; min-width: 0; gap: 9px; overflow-x: auto; padding: 1px 1px 6px; scrollbar-width: thin; }
.shortlist-item { flex: 0 0 205px; grid-template-columns: minmax(0, 1fr) auto; min-height: 62px; padding: 6px 8px; border: 1px solid var(--line); background: var(--surface); }
.shortlist-open { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.shortlist-open img { width: 64px; height: 64px; object-fit: contain; background: #ecece9; }
.shortlist-open strong { font-size: 12px; }
.shortlist-remove { font-size: 12px; }
.shortlist-empty { margin: 0; padding: 3px 0 10px; font-size: 12px; }
.shortlist-feedback { margin: 2px 0 0; }
.shortlist-next { width: 180px; min-height: 44px; }
.shortlist-footnote { grid-column: 1 / -1; margin: 0; font-size: 12px; }
.page-heading.is-detail { display: none; }
#detailView { --detail-muted: #6d7074; --detail-heading: #4b5056; }
.detail-view { min-width: 0; }
.detail-titlebar { margin-bottom: 13px; }
.detail-back { min-height: 44px; margin: 0 0 8px; color: var(--detail-muted); }
.detail-title-layout { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: start; gap: 16px; }
.detail-title-icon { display: block; width: 80px; height: 80px; object-fit: contain; background: #ecece9; }
.detail-title-copy { min-width: 0; }
.detail-title-copy h1 { margin: 0; color: var(--detail-heading); font-size: clamp(30px, 3vw, 32px); font-weight: 550; line-height: 1.18; letter-spacing: -.01em; overflow-wrap: anywhere; }
/* The title only receives programmatic focus on open (tabindex=-1); it is not a control. */
.detail-title-copy h1:focus { outline: 0; }
.detail-quick-film-nav { width: min(100%, 410px); grid-template-columns: 44px minmax(0, 1fr) 44px auto; justify-self: end; margin: 12px 0 20px auto; padding: 5px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-quick-film-nav .quick-film-step { width: 44px; height: 44px; }
.detail-quick-film-nav .quick-film-picker { gap: 7px; }
.detail-quick-film-nav .quick-film-picker > span, .detail-quick-film-nav .quick-film-position { color: var(--detail-muted); }
.detail-quick-film-nav .quick-film-picker select { background: var(--paper); }
.detail-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); align-items: start; gap: clamp(16px, 2.3vw, 30px); }
.detail-recipe-card, .detail-side-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); background: var(--surface); }
.detail-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-card-heading h2, .detail-card-heading h3 { margin: 2px 0 0; color: var(--detail-heading); font-size: 16px; font-weight: 500; }
.detail-readonly-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 20px; margin: 20px 0 0; }
.detail-readonly-grid > div { display: flex; min-width: 0; min-height: 56px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px 0; text-align: center; }
.detail-readonly-grid dt { color: var(--detail-muted); font-size: 12px; font-weight: 400; line-height: 1.45; }
.detail-readonly-grid > div > dt { font-size: 13px; order: 2; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.detail-readonly-grid > div > dd { order: 1; display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 2px; margin: 0; color: var(--detail-muted); }
.parameter-symbol-icon-slot { display: grid; width: 28px; height: 28px; flex: 0 0 28px; place-items: center; }
.parameter-symbol-icon { display: block; width: 24px; height: 24px; object-fit: contain; filter: grayscale(1) opacity(.72); }
.parameter-symbol-number { color: var(--detail-muted); font-size: 18px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.parameter-symbol-number.is-pending { color: var(--detail-muted); font-size: 13px; font-weight: 400; }
.detail-side-card { padding: 20px 22px; }
.detail-add-button.button { width: 100%; min-height: 44px; border-color: var(--red); background: var(--red-soft); color: var(--red); font-size: 14px; font-weight: 500; }
.detail-add-button.button:hover:not(:disabled) { border-color: var(--red); background: var(--red); color: #fff; }
.detail-selected-link { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; margin-top: 5px; padding: 4px 0; color: var(--detail-muted); font-size: 13px; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.detail-selected-link:hover { color: var(--red); }
.detail-selected-link span { margin-left: auto; padding: 0 8px; font-weight: 600; }
.real-photo-section { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.real-photo-section .sample-gallery-heading { align-items: baseline; margin-bottom: 10px; }
#detailView .sample-gallery-heading h3 { color: var(--detail-heading); font-size: 16px; font-weight: 500; }
.real-photo-section .sample-gallery-heading span { color: var(--detail-muted); font-size: 12px; }
.detail-gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.detail-gallery-tile { position: relative; display: grid; min-width: 0; gap: 6px; padding: 0; border: 0; text-align: left; }
.detail-gallery-tile img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #e8e8e5; }
.detail-gallery-tile:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.gallery-expand { position: absolute; top: 9px; right: 9px; padding: 5px 7px; background: rgb(24 25 26 / 74%); color: #fff; font-size: 12px; }
.detail-view .gallery-caption { color: var(--detail-muted); font-size: 12px; }
.sample-lightbox { width: min(1200px, calc(100vw - 32px)); max-width: none; max-height: min(92vh, 1000px); overflow: auto; padding: 15px; border: 1px solid var(--line-dark); background: var(--paper); color: var(--ink); }
.sample-lightbox::backdrop { background: rgb(24 25 26 / 78%); }
.sample-lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sample-lightbox-head h2 { margin: 0; font-size: 16px; }
.sample-lightbox figure { margin: 8px 0 0; }
.sample-lightbox figure img { display: block; width: 100%; max-height: calc(92vh - 88px); object-fit: contain; background: #e8e8e5; }
.sample-lightbox figcaption { padding-top: 7px; color: var(--muted); font-size: 12px; }

.site-footer { display: flex; min-height: 88px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.footer-inner { display: flex; width: min(100% - 64px, 1380px); align-items: center; justify-content: space-between; gap: 24px; margin: 0 auto; }
.footer-link { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; text-underline-offset: 4px; }
.footer-link:hover { color: var(--ink); text-decoration: underline; }
.footer-link span { font-size: 12px; }
.footer-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 20px; }
.footer-version { color: var(--muted); font-size: 12px; }
.footer-trademark { max-width: 520px; color: var(--muted); font-size: 12px; }
.footer-help { min-height: 44px; padding: 5px 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.footer-help:hover { color: var(--red); }
.help-attribution, .help-trademark { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.help-dialog a { color: var(--red); text-underline-offset: 3px; }

@media (max-width: 980px) {
  .page-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .page-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .detail-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

@media (max-width: 480px) {
  .page-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
  .selected-count-button { gap: 6px; min-height: 44px; padding: 5px 7px; font-size: 13px; }
  .selected-count-button strong { width: 21px; height: 21px; }
  .workflow { margin-top: 0; }
  .browse-layout { display: block; }
  .catalog-heading.browse-catalog-heading { align-items: stretch; gap: 0; margin-bottom: 10px; }
  .catalog-heading.browse-catalog-heading > div { display: none; }
  .catalog-use-cases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; }
  .catalog-use-cases button { padding-inline: 3px; font-size: 12px; }
  .catalog-toolbar { flex-direction: row; align-items: center; flex-wrap: nowrap; gap: 6px; }
  .catalog-selected-only { flex: 0 0 auto; gap: 6px; font-size: 12px; }
  .catalog-actions { width: auto; min-width: 0; flex: 1 1 auto; justify-content: flex-end; gap: 5px; }
  .catalog-result-count { overflow: hidden; font-size: 12px; text-overflow: ellipsis; }
  .catalog-action { font-size: 12px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; }
  .preset-icon-stage { aspect-ratio: 1.15 / 1; }
  .preset-main-icon { width: clamp(112px, 34vw, 128px); height: clamp(112px, 34vw, 128px); }
  .preset-card-copy { gap: 6px; padding: 9px 0 12px; }
  .preset-card-copy > .preset-title { font-size: 17px; }
  .preset-card-copy > small { font-size: 12px; }
  .shortlist-section { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 24px; }
  .shortlist-next { width: 100%; }
  .shortlist-footnote { grid-column: 1; }
  .detail-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .detail-title-layout { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
  .detail-title-icon { width: 72px; height: 72px; }
  .detail-title-copy h1 { font-size: 30px; }
  .detail-quick-film-nav { width: 100%; max-width: 100%; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px 7px; margin: 10px 0 16px; padding: 7px 0; }
  .detail-quick-film-nav .quick-film-position { grid-column: 2; justify-self: center; }
  .detail-recipe-card, .detail-side-card { padding: 16px 14px; }
  .detail-readonly-grid { gap: 12px 12px; margin-top: 16px; }
  .detail-readonly-grid > div { gap: 3px; padding: 5px 0; }
  .parameter-symbol-icon-slot { width: 28px; height: 28px; }
  .parameter-symbol-icon { width: 24px; height: 24px; }
  .parameter-symbol-number { font-size: 18px; }
  .parameter-symbol-number.is-pending { font-size: 14px; }
  .real-photo-section { margin-top: 16px; padding-top: 12px; }
  .detail-gallery-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sample-lightbox { padding: 10px; }
}

@media (max-width: 480px) {
  body { padding-bottom: calc(94px + env(safe-area-inset-bottom)); }
  .selected-count-button:not([hidden]) {
    position: fixed;
    z-index: 20;
    right: 15px;
    bottom: max(9px, env(safe-area-inset-bottom));
    left: 15px;
    width: auto;
    min-height: 54px;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 16px;
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
    font-size: 13px;
  }
  .selected-count-button:not([hidden]) strong { width: 27px; height: 27px; border-color: #747577; color: #fff; }
  .selected-count-button:not([hidden]) > span:last-child { margin-left: auto; color: #fff; }
  .selected-count-button:not([hidden]):disabled { opacity: .72; }
}

/* A quieter hierarchy for the selected-recipes step. */
.title-heading-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 15px; }
.title-heading-row h1 { margin-bottom: 5px; }
.capacity-mark { display: inline-flex; align-items: center; min-height: 29px; padding: 4px 9px; border: 1px solid var(--line); color: var(--muted); font: 12px var(--mono); white-space: nowrap; }
.page-heading.is-selection-step { grid-template-columns: minmax(0, 1fr); align-items: end; }
.page-heading.is-selection-step .title-block { grid-column: 1; grid-row: 1; }
.page-heading.is-selection-step .selected-count-button { display: none; }
.stage#selectionStage .selection-layout { display: block; }
.stage#selectionStage .selection-main { gap: 11px; }
.support-details { margin-top: 1px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.support-details > summary { min-height: 42px; display: flex; align-items: center; color: var(--muted); font-size: 12px; cursor: pointer; }
.support-details > summary::after { content: "＋"; margin-left: auto; font-size: 16px; }
.support-details[open] > summary::after { content: "−"; }
.support-details-content { padding: 0 0 14px; }
.support-planning-note { margin: 0 0 11px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.support-camera-facts { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.support-camera-facts strong { font-size: 13px; }
.support-camera-facts .support-version { margin: 0; color: var(--muted); font-size: 12px; }
.support-details-content > .muted { margin: 7px 0 0; font-size: 12px; line-height: 1.65; }
.support-boundary { padding-top: 8px; border-top: 1px solid var(--line); }
#selectionNextHint:empty { display: none; }

@media (max-width: 480px) {
  .page-heading.is-selection-step { grid-template-columns: minmax(0, 1fr); }
  .page-heading.is-selection-step .title-heading-row { gap: 4px 9px; }
  .page-heading.is-selection-step .capacity-mark { min-height: 25px; padding: 3px 6px; font-size: 12px; }
  .stage#selectionStage .selection-main { gap: 9px; }
  .support-details > summary { min-height: 44px; }
}

@media (max-width: 480px) {
  .header-actions { grid-row: 1; grid-column: 2; }
  .brand { grid-row: 1; grid-column: 1; }
  .footer-inner { width: calc(100% - 32px); align-items: flex-start; flex-direction: column; gap: 8px; }
  .footer-meta { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
}
.detail-community-source { display: grid; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line); }
.detail-community-source p { margin: 0; color: var(--detail-muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.detail-community-source-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.detail-community-source-links a { color: var(--red); font-size: 12px; text-underline-offset: 3px; }
.community-plan-reason { max-width: 30em; margin: 0; color: var(--detail-muted); font-size: 12px; line-height: 1.55; }

/* Recipe catalog and detail layout: tags, title and byline first, then the Image Control card beside actions and source. */
.catalog-title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; }
.catalog-filter-row { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 4px 10px; }
.catalog-base-filters button { white-space: nowrap; }
.preset-icon-stage { position: relative; }
.preset-base-chip { position: absolute; top: 10px; left: 10px; padding: 2px 8px; background: var(--red-soft); color: var(--red); font-size: 12px; line-height: 1.5; }
.preset-card-copy { gap: 3px; }
.preset-card-copy > small { color: var(--muted); font-size: 13px; }
.preset-shortlisted-mark { margin-top: 2px; }

.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.detail-chips > span { display: inline-flex; min-height: 24px; align-items: center; padding: 2px 8px; border: 1px solid var(--line); color: var(--detail-muted); font-size: 12px; line-height: 1.4; }
.detail-chips > span.is-base { border-color: var(--red-soft); background: var(--red-soft); color: var(--red); }
.detail-byline { margin: 8px 0 0; color: var(--detail-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.detail-byline strong { color: var(--ink); font-weight: 500; }
.detail-original { margin: 2px 0 0; font-size: 13px; }
.detail-original a, .detail-source-card a { color: var(--red); text-underline-offset: 3px; }
.detail-titlebar { margin-bottom: 22px; }
.detail-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.detail-recipe-card .detail-card-heading .eyebrow { letter-spacing: .09em; text-transform: uppercase; }
.detail-recipe-card .detail-card-heading h2 { margin-top: 4px; color: var(--red); font-size: 18px; font-weight: 600; }
.detail-settings { display: grid; margin: 22px 0 0; }
.detail-settings > div { display: flex; min-height: 42px; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.detail-settings dt { color: var(--detail-muted); font-size: 12px; letter-spacing: .04em; }
.detail-settings dd { margin: 0; color: var(--ink); font: 13px var(--mono); text-align: right; overflow-wrap: anywhere; }
.detail-side { display: grid; gap: 16px; min-width: 0; }
.detail-source-card { display: grid; gap: 10px; }
.detail-source-card h2 { margin: 0; color: var(--detail-heading); font-size: 14px; font-weight: 600; }
.detail-source-card p { margin: 0; color: var(--detail-muted); font-size: 12px; line-height: 1.6; }
.detail-source-card p:empty { display: none; }
.detail-source-card .detail-community-source-links { display: grid; gap: 8px; }
.detail-source-card .detail-community-source-links a { font-size: 13px; }
.detail-quick-film-nav { width: min(100%, 420px); grid-template-columns: 44px minmax(0, 1fr) 44px auto; margin: 28px auto 0; border-bottom: 0; }
@media (max-width: 720px) {
  .detail-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-quick-film-nav { grid-template-columns: 44px minmax(0, 1fr) 44px; }
}
@media (max-width: 480px) {
  .catalog-filter-row { grid-template-columns: minmax(0, 1fr); }
  .catalog-base-filters.catalog-use-cases { display: flex; flex-wrap: wrap; gap: 2px 10px; }
  .preset-base-chip { top: 6px; left: 6px; padding-inline: 6px; }
  /* Leave a strip above the icon so the base chip never covers it. */
  .preset-icon-stage { aspect-ratio: auto; padding: 34px 0 12px; }
  .preset-main-icon { width: clamp(96px, 30vw, 120px); height: clamp(96px, 30vw, 120px); }
}

/* Slot picker: every camera position with its state, selectable ones first. */
.slot-dialog h2 { font-size: 22px; letter-spacing: -.01em; }
.slot-options { display: grid; margin: 14px 0 0; border-top: 1px solid var(--line); }
.slot-option { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 2px 10px; min-height: 52px; padding: 8px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.slot-option input { grid-row: 1 / span 2; width: 18px; height: 18px; margin: 0; accent-color: var(--red); }
.slot-option-name { font-size: 14px; font-weight: 600; }
.slot-option-note { grid-column: 2; color: var(--muted); font-size: 12px; line-height: 1.5; }
.slot-option.is-available .slot-option-note, .slot-option.is-current .slot-option-note { color: var(--green); }
.slot-option.is-occupied, .slot-option.is-unavailable { cursor: not-allowed; }
.slot-option.is-occupied .slot-option-name, .slot-option.is-unavailable .slot-option-name { color: var(--quiet); font-weight: 500; }
/* Keep the confirm button reachable while the 14-position list scrolls. */
.slot-dialog-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; padding: 12px 0; background: var(--paper); }
.slot-dialog-actions .button { min-height: 44px; padding-inline: 18px; }
