/* AMURTA interface refresh. Loaded after the retained application styles.
   Presentation only: artwork, SVG geometry and stitch-plan data stay untouched. */

/* Shared scale and accessible controls */
:root {
  --muted: #626e62;
  --line: #d9ded3;
  --ui-surface: #fffefa;
  --ui-soft: #eeefe7;
  --ui-radius: 16px;
  --ui-gutter: clamp(20px, 4vw, 48px);
  --ui-nav-height: 72px;
}

html { scroll-padding-top: 24px; }
body { font-size: 16px; line-height: 1.7; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, a { touch-action: manipulation; }
button, input, select, textarea { max-width: 100%; }
button { overflow-wrap: anywhere; }
p, li, dd, h1, h2, h3 { overflow-wrap: anywhere; }
.container, .site-footer { width: min(1320px, calc(100% - var(--ui-gutter) * 2)); }
main { min-height: 64vh; }
main > *, .studio-layout > *, .comparison-grid > *, .palette-workspace > *,
.results-layout > *, .checkout-layout > *, .order-detail-grid > * { min-width: 0; }
.small, .field-hint, .optional, .textarea-footer, .submit-row p,
.field-group > label, .group-label, .form-field label, .ref-role,
.ref-name, .stage-label, .stage-caption, .source-photos figcaption,
.analysis-copy p, .analysis-copy li, .palette-labels > span,
.revision-banner p, .sidebar-note p, .sidebar-note .mini-step,
.spec-grid dt, .spec-grid dd, .summary-row, .order-info p,
.order-card-head, .order-status, .order-actions strong,
.timeline, .timeline strong, .timeline p, .timeline time,
.contact-details, .artisan-brief-content, .artisan-refs figcaption {
  font-size: 14px;
  line-height: 1.7;
}
.eyebrow { font-size: 12px; letter-spacing: 1.6px; }
.label-tag, .sample-stamp, .features-summary span { font-size: 12px; line-height: 1.6; }
.btn, .order-actions .btn, .revision-box .btn, .admin-editor button {
  min-height: 48px;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .2px;
  gap: 12px;
  white-space: normal;
  text-align: center;
}
.btn:hover:not(:disabled) { transform: none; }
.btn.secondary { background: var(--ui-surface); border-color: #bfc9b9; }
.btn.text-btn { min-height: 44px; border-radius: 0; padding: 9px 0; }
.btn:disabled { opacity: .65; }
.field, .admin-editor .field, .custom-feature .field, .revision-box textarea {
  min-height: 48px;
  padding: 12px 14px;
  background: var(--ui-surface);
  border-color: #bac6b4;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.5;
}
.field::placeholder { font-size: 15px; color: #778172; }
textarea.field, .desc-input { min-height: 144px; resize: vertical; }
select.field, .ref-role { padding-right: 28px; }
.chip, .feature-list .chip, .example-btn, .filter-btn, .custom-feature button {
  min-height: 44px;
  font-size: 14px;
  padding: 10px 14px;
}
.chip, .custom-feature button { border-radius: 10px; }
.example-btn { margin-right: 0; padding-inline: 4px; }
.confirm-check { min-height: 44px; font-size: 15px; line-height: 1.8; gap: 12px; }
.confirm-check input, .creation-mode input {
  width: 20px; height: 20px; accent-color: var(--ink); flex: none;
}
.confirm-check input { margin-top: 4px; }
.notice, .studio-v2 .notice, .error-box {
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.85;
  border-radius: 10px;
  overflow-wrap: anywhere;
}
.notice { border-left-width: 3px; background: #eee9d8; }
.notice ul, .error-box ul { padding-left: 20px; }
.error-box:empty, #studio-error:empty { display: none; }

/* Product shell */
.site-header {
  max-width: none;
  height: 88px;
  padding-inline: max(var(--ui-gutter), calc((100vw - 1320px) / 2));
  gap: 24px;
}
.brand { gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.brand-mark img, .brand-mark svg { display: block; width: 100%; height: 100%; }
.brand strong { font-size: 22px; letter-spacing: 4px; }
.brand small { font-size: 11px; letter-spacing: 1px; margin-top: 4px; }
.desktop-nav { gap: 28px; font-size: 14px; }
.desktop-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.header-cta { min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; border-radius: 10px; margin-left: 0; padding: 10px 18px; }
.header-cta span { margin-left: 12px; }
.nav-icon, .ui-icon { width: 24px; height: 24px; flex: none; }
.site-footer { padding-block: 32px; margin-top: 32px; }
.footer-brand { font-size: 17px; }
.footer-brand span, .site-footer > div { font-size: 13px; letter-spacing: 0; }
.site-footer > div a { display: inline-flex; align-items: center; min-height: 44px; }
.page-heading { padding: 36px 0 28px; }
.page-heading h1, .studio-v2 .page-heading h1 { font-size: clamp(28px, 2.7vw, 38px); line-height: 1.4; letter-spacing: .3px; margin: 10px 0 12px; }
.page-heading p { max-width: 780px; font-size: 16px; line-height: 1.8; }
.page-heading .heading-row { align-items: center; }
.breadcrumb { font-size: 14px; flex-wrap: wrap; }
.breadcrumb a { min-height: 44px; display: inline-flex; align-items: center; }

/* Home: work samples and a clear entry into the task */
.hero-inner { min-height: 540px; padding-block: 48px; width: min(1320px, calc(100% - var(--ui-gutter) * 2)); gap: 40px; }
.hero-copy h1 { font-size: clamp(36px, 4.2vw, 58px); line-height: 1.4; letter-spacing: 2px; }
.hero-copy > p { max-width: 490px; font-size: 16px; line-height: 1.9; }
.hero-actions { flex-wrap: wrap; gap: 20px; }
.hero-actions .btn { font-size: 16px; }
.hero-actions .subtle-link { font-size: 14px; min-height: 44px; display: inline-flex; align-items: center; }
.hero-footnote { font-size: 13px; letter-spacing: .5px; color: #b1bead; }
.hero-art:before, .hero-art:after { display: none; }
.hero-art-label { font-size: 12px; }
.art-tag { border-radius: 12px; }
.art-tag span, .art-tag small { font-size: 12px; letter-spacing: .5px; }
.intro-band { padding-block: 24px; font-size: 14px; }
.intro-band .intro-label { font-size: 13px; }
.intro-band .intro-points { flex-wrap: wrap; gap: 14px 24px; }
.home-section { padding-block: 56px; }
.section-head h2 { font-size: 30px; }
.section-head p, .step-item p, .gallery-info p, .gallery-note,
.craft-copy > p, .cta-band p { font-size: 15px; line-height: 1.85; }
.step-item h3 { font-size: 18px; }
.gallery-card { border-radius: var(--ui-radius); overflow: hidden; border: 1px solid #d7dccf; }
.gallery-image .label-tag { font-size: 12px; }
.gallery-image { padding: 24px; }
.gallery-info { gap: 16px; padding: 22px; }
.gallery-info h3 { font-size: 22px; }
.circle-arrow { width: 44px; height: 44px; flex: none; }
.craft-symbol { border-radius: var(--ui-radius); }
.craft-symbol > span { font-size: 12px; letter-spacing: 2px; }
.craft-copy h2 { font-size: 32px; line-height: 1.5; }
.cta-band { border-radius: var(--ui-radius); }
.home-resume:empty { display: none; }
.resume-card {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; margin-top: 28px; border: 1px solid #bfcbb7;
  background: #edf0e5; border-radius: var(--ui-radius);
}
.resume-card h2, .resume-card h3 { font-family: var(--sans); font-size: 20px; }
.resume-card p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.resume-card .btn { flex: none; }

/* Four-step studio and source assessment */
.studio-v2 { padding-bottom: 32px; }
.studio-step-context { display: none; }
.studio-steps { gap: 8px; border: 0; margin-bottom: 32px; }
.studio-steps li {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: #ecefe5; border: 1px solid transparent; border-radius: 12px;
  font-size: 14px; line-height: 1.5; color: #65705f;
}
.studio-steps li.current { color: var(--ink); background: #eee9d8; border-color: #cfbd94; }
.studio-steps li.done { background: #e8ede2; color: #40573f; }
.studio-steps li span, .studio-steps li .step-number {
  font: 600 14px var(--sans); color: inherit; margin: 0;
}
.studio-steps li .step-number {
  width: 30px; height: 30px; border-radius: 50%; background: #fffefa;
  display: grid; place-items: center; flex: none;
}
.studio-steps li .step-name { font: inherit; }
.studio-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; padding-bottom: 32px; }
.studio-sidebar { position: sticky; top: 24px; }
.studio-v2 .form-section, .form-section { padding: 24px; border-radius: var(--ui-radius); margin-bottom: 24px; }
.field-title { font-family: var(--sans); font-size: 18px; font-weight: 600; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 10px; }
.field-hint { margin-bottom: 20px; }
.creation-modes { gap: 12px; margin-bottom: 24px; }
.creation-modes legend { margin-bottom: 12px; }
.creation-mode { padding: 18px; border-radius: 12px; gap: 12px; }
.creation-mode.selected { background: #eef0e5; border-color: #78916b; box-shadow: inset 3px 0 #78916b; }
.creation-mode input { margin-top: 4px; }
.creation-mode strong { font-size: 16px; line-height: 1.6; }
.creation-mode small { font-size: 14px; line-height: 1.7; }
.upload-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 16px; }
.upload-zone { border-radius: 12px; min-height: 180px; aspect-ratio: auto; padding: 20px 12px; }
.upload-zone strong { font-size: 16px; }
.upload-zone small { font-size: 13px; }
.upload-zone:focus-within { outline: 3px solid #b79149; outline-offset: 3px; }
.ref-image { border-radius: 10px; object-fit: contain; height: 180px; aspect-ratio: auto; }
.remove-ref { width: 44px; height: 44px; top: 6px; right: 6px; font-size: 24px; border: 1px solid #d4d9ca; }
.ref-role { min-height: 44px; border-radius: 10px; padding: 10px; margin-top: 8px; }
.ref-name { margin-top: 8px; }
.style-options { gap: 12px; margin: 16px 0 24px; }
.style-option { border-radius: 12px; padding: 18px 14px; }
.style-option strong { font-size: 16px; }
.style-option small { font-size: 14px; line-height: 1.6; }
.style-option .style-symbol { font-size: 28px; }
.studio-principles { border-radius: var(--ui-radius); padding: 24px; }
.studio-principles h2 { font-size: 24px; line-height: 1.5; margin: 16px 0 20px; }
.studio-principles .mini-step { padding-block: 16px; display: flex; gap: 14px; }
.studio-principles .mini-step > span { color: #8b7544; font-variant-numeric: tabular-nums; }
.studio-principles .mini-step strong { font-size: 15px; }
.studio-principles .mini-step p { font-size: 14px; line-height: 1.8; margin: 6px 0 0; }
.submit-row { padding: 0; }
.submit-row p { margin: 14px 0 0; text-align: left; }
.submit-row .btn { min-height: 52px; }
.form-row { gap: 16px; }
.form-field { margin-bottom: 18px; }
.studio-form .form-row { margin-top: 20px; }

/* Review cards keep the work large; technical details are secondary. */
.comparison-grid { gap: 24px; align-items: stretch; }
.stage-card { border-radius: var(--ui-radius); padding: 24px; min-width: 0; }
.stage-label { letter-spacing: .8px; margin-bottom: 16px; color: #61705e; }
.stage-image { width: 100%; height: auto; max-height: 640px; object-fit: contain; border-radius: 8px; }
.stage-caption { padding-top: 16px; }
.stage-card > .btn.text-btn { margin-top: 12px; }
.stage-card > p { margin-top: 12px; }
.source-photos { gap: 16px; margin-top: 16px; padding-bottom: 8px; }
.source-photos figure { flex-basis: 180px; }
.source-photos img { object-fit: contain; border-radius: 10px; }
.source-photos figcaption { margin-top: 8px; }
.text-reference { border-radius: 12px; }
.text-reference p { font-size: 18px; }
.review-status, .draft-actions, .draft-lineage, .vector-review, .technical-details {
  border-radius: var(--ui-radius); padding: 22px 24px; margin: 24px 0;
  font-size: 15px; line-height: 1.8; background: var(--ui-surface);
  border: 1px solid var(--line);
}
.review-status { border-left-width: 4px; }
.review-status h2, .draft-actions h3 { font-family: var(--sans); font-size: 20px; line-height: 1.5; }
.review-status p, .draft-actions p { margin: 10px 0; }
.review-status.ready { border-left-color: #55774a; }
.review-status.advisory { border-left-color: #aa8f54; }
.review-status.blocked { border-left-color: #75816e; }
.draft-action-buttons { gap: 12px; margin-block: 20px; }
.revision-note { font-size: 15px; }
.revision-note textarea { min-height: 112px; margin-top: 10px; }
.candidate-empty { min-height: 260px; padding: 24px; }
.candidate-empty h3 { font-size: 20px; }
.candidate-empty p { margin-top: 12px; }
.stage-confirm { max-width: none; padding: 24px; margin: 24px 0; background: #edf0e5; border-radius: var(--ui-radius); }
.stage-confirm .confirm-check { margin-top: 0; }
.stage-actions { align-items: stretch; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.stage-actions .btn { flex: 0 1 auto; }
.studio-v2 details > summary, details.technical-details > summary,
.revision-box > summary, .artisan-brief > summary {
  min-height: 44px; padding-block: 10px; font-size: 15px;
  line-height: 1.6; color: var(--ink); cursor: pointer;
}
.studio-v2 details > summary:focus-visible { outline-offset: 3px; }
.studio-v2 details[open] > summary { margin-bottom: 12px; }
.studio-v2 details ul { padding-left: 22px; }
.studio-v2 details li { margin-block: 8px; }
.analysis-copy h3 { font-family: var(--sans); font-size: 20px; }
.fidelity-opacity { font-size: 14px; }
.fidelity-opacity input { min-height: 44px; }
.fidelity-overlay { overflow: hidden; }
.fidelity-overlay img { border-radius: 0; }
.assessment-stage { font-size: 14px; margin-bottom: 24px; }
.assessment-facts { gap: 8px; }
.assessment-facts span { border-radius: 8px; font-size: 14px; }
.assessment-report h2, .source-assessment .vector-review h2 { font-family: var(--sans); font-size: 20px; }
.assessment-report, .source-assessment .stage-card > p { font-size: 15px; }
.assessment-metrics { gap: 0 24px; }
.assessment-metrics > div { font-size: 14px; align-items: baseline; }
.assessment-table { font-size: 14px; }
.assessment-table th, .assessment-table td { padding: 14px 12px; }
.assessment-table-wrap { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.hash-note, .source-assessment .hash-note { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }

/* Color workbench */
.palette-options { gap: 18px; margin-bottom: 28px; }
.palette-option { border-radius: 14px; padding: 14px; text-align: center; }
.palette-option.selected { outline: 2px solid #9d8353; outline-offset: 2px; }
.palette-option svg { max-height: 200px; border-radius: 8px; margin-bottom: 12px; }
.palette-option strong { font-size: 16px; font-weight: 600; }
.palette-option > span { margin-top: 12px; gap: 7px; }
.palette-option i { width: 14px; height: 14px; }
.palette-workspace { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; }
.palette-canvas { position: sticky; top: 24px; padding: 24px; }
.palette-canvas svg { max-height: 700px; height: auto; border-radius: 10px; }
.palette-controls { padding: 24px; border: 1px solid var(--line); background: var(--ui-surface); border-radius: var(--ui-radius); }
.palette-controls h2 { font-family: var(--sans); font-size: 22px; line-height: 1.5; }
.thread-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0; }
.thread-colors label { font-size: 14px; gap: 10px; min-height: 48px; min-width: 0; }
.thread-colors label span { overflow-wrap: anywhere; }
.thread-colors input { width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; }
.thread-colors input::-webkit-color-swatch-wrapper { padding: 4px; }
.thread-colors input::-webkit-color-swatch { border-radius: 8px; border: 1px solid #0002; }
.region-editor { border-radius: 12px; padding: 18px; margin-block: 20px; background: var(--ui-soft); }
.region-editor > label, .region-editor label { font-size: 14px; }
.region-editor .form-row { grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.region-editor .field { margin-top: 6px; }
.region-editor p { margin-top: 12px; }
.craft-parameters, .advice-box { padding-block: 14px; font-size: 14px; line-height: 1.8; }
.craft-parameters > .btn { margin: 8px 8px 8px 0; font-size: 14px; }
.parameter-grid { gap: 16px 12px; margin-top: 20px; }
.parameter-grid label { font-size: 14px; line-height: 1.6; }
.parameter-grid input { margin-top: 8px; }
.advice-box textarea { min-height: 112px; }
.palette-controls > .btn.wide { margin-top: 8px; min-height: 52px; }
.palette-controls > .small { margin-top: 12px; }

/* Result, authoritative stage status and production handoff */
.results-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; padding-bottom: 32px; }
.artifact-panel { min-width: 0; }
.artifact-tabs { gap: 6px; padding: 5px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 12px; background: #eaece3; }
.artifact-tabs button { min-height: 48px; padding: 10px 8px; font-size: 14px; border: 0; border-radius: 9px; line-height: 1.5; }
.artifact-tabs button.selected { background: var(--ink); }
.artifact-view { border-radius: var(--ui-radius); overflow: hidden; background: #eeece1; }
.artifact-view img { max-height: 900px; object-fit: contain; }
.artifact-downloads { gap: 6px 20px; padding: 12px 0; font-size: 14px; }
.artifact-downloads a { display: inline-flex; align-items: center; min-height: 44px; }
.result-summary { min-width: 0; }
.result-summary .design-title { font-size: 30px; line-height: 1.45; margin-block: 16px; }
.result-summary .design-desc, .result-summary > p { font-size: 15px; line-height: 1.85; }
.result-summary > .btn { margin-top: 16px; }
.spec-grid { gap: 20px 16px; margin: 24px 0; padding-block: 20px; }
.spec-grid dt { margin-bottom: 6px; }
.spec-grid dd { color: var(--ink); font-size: 16px; }
.plan-facts { margin: 18px 0; }
.plan-facts p { font-size: 14px; padding-block: 12px; gap: 16px; align-items: baseline; }
.plan-facts strong { text-align: right; }
.workflow-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; }
.workflow-status > div { min-width: 0; background: #edf0e7; border: 1px solid var(--line); padding: 16px; border-radius: 12px; }
.workflow-status dt { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.workflow-status dd { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.6; }
.result-summary .workflow-status { grid-template-columns: 1fr; }
.result-summary .workflow-status > div { display: flex; justify-content: space-between; gap: 16px; }
.result-summary .workflow-status dt { margin: 0; }
.result-summary .workflow-status dd { text-align: right; }
.technical-details { margin-block: 20px; padding: 14px 18px; }
.technical-details .plan-facts { margin-bottom: 12px; }
.technical-details .hash-note { margin-top: 16px; }

/* Existing checkout, order management and artisan screens */
.checkout-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; }
.checkout-card, .order-card, .admin-login { border-radius: var(--ui-radius); padding: 28px; }
.checkout-card h2 { font-size: 20px; margin-bottom: 24px; }
.checkout-design { min-width: 0; }
.checkout-design > div { min-width: 0; }
.checkout-design h3 { font-size: 22px; }
.checkout-design p { font-size: 14px; }
.checkout-design img { flex: none; border-radius: 10px; }
.order-filters { gap: 24px; }
.filter-btn { padding-inline: 0; }
.order-card-head { flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.order-status { border-radius: 7px; padding: 6px 10px; }
.order-info h3 { font-size: 22px; }
.order-thumb { border-radius: 10px; }
.order-actions .btn { min-height: 44px; }
.order-success { border-radius: 12px; padding: 20px; align-items: flex-start; }
.order-success h2 { font-size: 18px; }
.order-success p { font-size: 14px; }
.success-tick { flex: none; }
.empty-state { border-radius: var(--ui-radius); padding: 64px 24px; }
.empty-state p { font-size: 16px; max-width: 520px; margin: 0 auto 24px; }
.empty-state h2 { font-size: 28px; line-height: 1.5; }
.timeline p, .timeline time { margin-top: 8px; }
.timeline strong { font-size: 15px; }
.artisan-brief { font-size: 15px; }
.artisan-brief-content { padding-top: 16px; }
.artisan-refs { gap: 16px; }
.artisan-refs figure { width: 150px; }
.artisan-refs img { width: 150px; height: 140px; border-radius: 10px; }
.admin-login > p { font-size: 15px; }
.admin-editor { grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-editor .admin-note, .admin-editor button { grid-column: 1 / -1; }
.admin-editor button { justify-self: start; }

/* Waiting and overlays */
.generating-page { max-width: 720px; margin: 36px auto 56px; padding: 32px 24px; }
.generating-page h1, .generating-page h2 { font-family: var(--sans); font-size: 26px; line-height: 1.5; margin-block: 16px; }
.generating-page > p { font-size: 16px; line-height: 1.9; }
.generating-icon { width: 88px; height: 88px; margin-bottom: 28px; }
.generating-icon span { font-size: 42px; }
.generating-icon img, .generating-icon svg { display: block; width: 52px; height: 52px; }
.progress-item { font-size: 15px; padding-block: 14px; }
.progress-dot { width: 28px; height: 28px; font-size: 12px; }
.generation-hint { font-size: 14px !important; }
.studio-loading, .loading-panel, .initial-loading { font-size: 16px; }
.loading-panel { padding-block: 64px; }
.loading-panel h1 { font-size: 28px; line-height: 1.5; }
.loading-panel p { margin-top: 16px; }
.loading-panel .btn { margin-top: 8px; }
.toast { font-size: 15px; line-height: 1.7; padding: 14px 20px; border-radius: 12px; width: max-content; max-width: min(580px, calc(100% - 32px)); }
dialog { border-radius: 16px; padding: 48px 24px 24px; max-width: calc(100vw - 32px); }
dialog img { max-width: min(1200px, calc(100vw - 82px)); max-height: 76dvh; }
dialog p { font-size: 13px; }
.image-close { width: 44px; height: 44px; top: 2px; right: 4px; border-radius: 50%; }

/* Tablet: a full-size work surface before the controls. */
@media (max-width: 1023px) {
  .header-cta { display: none; }
  .desktop-nav { gap: 20px; }
  .hero-inner { gap: 20px; }
  .hero-copy h1 { font-size: 40px; }
  .studio-layout, .palette-workspace, .results-layout, .checkout-layout { grid-template-columns: 1fr; gap: 24px; }
  .studio-v2 .studio-sidebar { display: block; position: static; grid-row: auto; }
  .studio-principles .mini-step { padding-block: 12px; }
  .studio-principles h2 { margin-block: 12px; }
  .palette-canvas { position: static; }
  .palette-canvas svg { max-height: 660px; }
  .palette-controls { padding: 24px; }
  .palette-controls .thread-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .palette-controls .region-editor .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-summary .workflow-status { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .result-summary .workflow-status > div { display: block; }
  .result-summary .workflow-status dt { margin-bottom: 8px; }
  .result-summary .workflow-status dd { text-align: left; }
  .checkout-layout > aside { grid-row: auto; }
  .studio-steps li { padding: 12px; gap: 8px; }
}

/* Phone: keep the current decision readable and the image complete. */
@media (max-width: 767px) {
  :root { --ui-gutter: 20px; }
  body { font-size: 16px; padding-bottom: calc(var(--ui-nav-height) + env(safe-area-inset-bottom, 0px)); }
  .site-header { height: 76px; padding-inline: 20px; gap: 12px; }
  .brand { gap: 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand strong { font-size: 20px; letter-spacing: 3px; }
  .brand small { font-size: 10px; letter-spacing: .5px; }
  .desktop-nav { display: none; }
  .header-cta { display: inline-flex; margin-left: auto; padding: 10px 12px; font-size: 14px; white-space: nowrap; }
  .header-cta span { margin-left: 8px; }
  .mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    display: flex; height: calc(var(--ui-nav-height) + env(safe-area-inset-bottom, 0px));
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: #fffefaf5; border-top: 1px solid #d9ded3; align-items: center;
    justify-content: space-around;
  }
  .mobile-nav a { min-height: 52px; min-width: 76px; font-size: 12px; line-height: 1.5; gap: 4px; color: #677562; }
  .mobile-nav a > span { display: flex; align-items: center; justify-content: center; font-size: 24px; line-height: 1; }
  .mobile-nav a.active { color: var(--ink); }
  .mobile-nav a.active .nav-icon { color: var(--ink); }
  body[data-page="studio-task"], body.task-page { padding-bottom: env(safe-area-inset-bottom, 0px); }
  body[data-page="studio-task"] .mobile-nav, body.task-page .mobile-nav { display: none; }
  body.task-page .header-cta { display: none; }
  .page-heading { padding: 28px 0 24px; }
  .page-heading h1, .studio-v2 .page-heading h1 { font-size: 28px; line-height: 1.45; margin-block: 10px; letter-spacing: 0; }
  .page-heading p { font-size: 15px; line-height: 1.8; }
  .page-heading .heading-row { flex-direction: column; align-items: stretch; gap: 16px; }
  .page-heading .heading-row .label-tag { font-size: 12px; align-self: flex-start; }
  .eyebrow { font-size: 11px; letter-spacing: 1.3px; }
  .eyebrow:before { width: 20px; }
  .studio-v2 { padding-bottom: 8px; }
  .studio-steps { display: none; }
  .studio-step-context { display: block; padding: 12px 16px; margin: 0 0 24px; border: 1px solid #d6c6a4; border-radius: 10px; background: #eee9d8; color: var(--ink); font-size: 14px; line-height: 1.6; }
  .studio-layout { gap: 24px; padding-bottom: 24px; }
  .studio-v2 .studio-sidebar { grid-row: auto; }
  .studio-v2 .form-section, .form-section { padding: 20px; margin-bottom: 20px; }
  .field-title { font-size: 18px; }
  .optional { font-size: 13px; }
  .field-hint { font-size: 14px; line-height: 1.85; margin-bottom: 16px; }
  .field, .desc-input, .admin-editor .field { font-size: 16px; }
  .field::placeholder { font-size: 15px; }
  .textarea-footer { font-size: 13px; flex-wrap: wrap; gap: 4px 12px; }
  .field-group { margin-top: 24px; }
  .creation-mode { padding: 16px; }
  .creation-mode strong { font-size: 16px; }
  .creation-mode small { font-size: 14px; }
  .upload-grid { grid-template-columns: 1fr; gap: 16px; }
  .upload-zone { min-height: 164px; padding: 20px; }
  .upload-zone strong { font-size: 16px; }
  .upload-zone small { font-size: 13px; }
  .ref-image { height: 220px; }
  .ref-role { font-size: 16px; }
  .ref-name { font-size: 13px; }
  .style-options { grid-template-columns: 1fr; gap: 10px; margin-bottom: 24px; }
  .style-option { padding: 16px; display: grid; grid-template-columns: 30px 1fr; gap: 4px 14px; align-items: center; }
  .style-option .style-symbol { grid-row: 1 / 3; margin: 0; font-size: 26px; }
  .style-option strong { font-size: 16px; }
  .style-option small { font-size: 14px; margin: 0; }
  .form-row, .source-assessment .form-row { grid-template-columns: 1fr; gap: 0; }
  .studio-principles { padding: 20px; }
  .studio-principles h2 { font-size: 22px; }
  .studio-principles .mini-step strong { font-size: 15px; }
  .studio-principles .mini-step p { font-size: 14px; }
  .submit-row p { font-size: 14px; margin-top: 16px; }
  .submit-row .btn { font-size: 16px; }
  .btn { font-size: 15px; }
  .comparison-grid { grid-template-columns: 1fr; gap: 20px; }
  .stage-card { padding: 20px; }
  .stage-label { font-size: 12px; line-height: 1.7; }
  .stage-image { max-height: 600px; }
  .stage-card > p, .source-assessment .stage-card > p { font-size: 14px; }
  .stage-confirm { padding: 20px; margin-block: 20px; }
  .stage-actions { flex-direction: column-reverse; margin-block: 16px; }
  .stage-actions .btn { width: 100%; }
  .draft-action-buttons { flex-direction: column; }
  .draft-action-buttons .btn { width: 100%; }
  .review-status, .draft-actions, .draft-lineage, .vector-review { padding: 20px; margin-block: 20px; }
  .review-status h2, .draft-actions h3 { font-size: 20px; }
  .candidate-empty { min-height: 200px; padding: 16px; }
  .source-photos figure { flex: 0 0 180px; }
  .source-photos img { height: 180px; }
  .assessment-metrics { grid-template-columns: 1fr; }
  .assessment-facts span { font-size: 13px; }
  .assessment-report { font-size: 15px; }
  .source-assessment .parameter-grid { grid-template-columns: 1fr; }
  .palette-options { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
  .palette-option { display: grid; grid-template-columns: minmax(110px, 42%) 1fr; grid-template-rows: 1fr 1fr; gap: 8px 16px; align-items: end; text-align: left; padding: 14px; }
  .palette-option svg { grid-row: 1 / 3; width: 100%; max-height: 170px; margin: 0; align-self: center; }
  .palette-option strong { font-size: 16px; align-self: end; }
  .palette-option > span { margin: 0; justify-content: flex-start; align-self: start; gap: 6px; flex-wrap: wrap; }
  .palette-workspace, .results-layout { gap: 24px; }
  .palette-canvas { padding: 16px; }
  .palette-canvas svg { max-height: 600px; }
  .palette-controls { padding: 20px; }
  .palette-controls h2 { font-size: 22px; }
  .palette-controls .thread-colors { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; }
  .thread-colors label { font-size: 14px; gap: 8px; }
  .region-editor { padding: 16px; }
  .palette-controls .region-editor .form-row { grid-template-columns: 1fr; gap: 14px; }
  .parameter-grid { gap: 16px 12px; }
  .parameter-grid label { font-size: 14px; }
  .artifact-tabs { gap: 4px; padding: 4px; }
  .artifact-tabs button { min-height: 52px; font-size: 14px; padding: 8px 4px; }
  .artifact-view img { max-height: none; }
  .artifact-downloads { font-size: 14px; gap: 0 16px; }
  .result-summary .design-title { font-size: 28px; }
  .result-summary .design-desc { font-size: 15px; }
  .result-summary .notice { font-size: 14px; }
  .spec-grid { margin-block: 20px; gap: 20px 16px; }
  .spec-grid dt { font-size: 14px; }
  .spec-grid dd { font-size: 16px; }
  .workflow-status, .result-summary .workflow-status { grid-template-columns: 1fr; gap: 10px; }
  .workflow-status > div, .result-summary .workflow-status > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 16px; }
  .workflow-status dt, .result-summary .workflow-status dt { margin: 0; font-size: 14px; }
  .workflow-status dd, .result-summary .workflow-status dd { font-size: 15px; text-align: right; }
  .plan-facts p { font-size: 14px; }
  .technical-details { padding: 12px 16px; }
  .checkout-layout { gap: 24px; }
  .checkout-card, .checkout-layout .checkout-card { padding: 20px; }
  .checkout-card h2 { font-size: 20px; }
  .checkout-design img { width: 80px; height: 80px; }
  .checkout-design h3 { font-size: 20px; }
  .checkout-design p, .summary-row { font-size: 14px; }
  .order-card { padding: 20px; }
  .order-card-body { gap: 16px; flex-wrap: wrap; }
  .order-thumb { width: 80px; height: 80px; }
  .order-info h3 { font-size: 20px; }
  .order-info p, .order-card-head, .order-status { font-size: 13px; }
  .order-actions { flex-basis: 100%; flex-direction: row; justify-content: space-between; align-items: center; padding-top: 16px; border-top: 1px solid var(--line); }
  .order-actions .btn { font-size: 14px; }
  .order-detail-grid { grid-template-columns: 1fr; gap: 20px; }
  .order-detail-grid .checkout-card:first-child { grid-column: auto; }
  .order-success h2 { font-size: 18px; }
  .order-success p { font-size: 14px; }
  .empty-state { padding: 40px 20px; }
  .empty-state h2 { font-size: 25px; }
  .empty-state p { font-size: 15px; }
  .admin-login { margin: 28px auto 40px; width: calc(100% - 40px); padding: 24px; }
  .admin-editor { grid-template-columns: 1fr; }
  .admin-editor button { width: 100%; }
  .admin-editor .admin-note, .admin-editor button { grid-column: auto; }
  .generating-page { margin: 12px auto 32px; padding: 24px 0; }
  .generating-page h1, .generating-page h2 { font-size: 24px; }
  .generating-page > p { font-size: 15px; }
  .generating-icon { width: 80px; height: 80px; }
  .loading-panel { padding: 44px 0; }
  .hero-inner { grid-template-columns: 1fr; min-height: 0; gap: 24px; padding: 36px 0; }
  .hero-copy { padding: 0; }
  .hero-copy h1 { font-size: clamp(32px, 8.5vw, 40px); line-height: 1.45; letter-spacing: 1px; margin: 20px 0; }
  .hero-copy > p { font-size: 16px; max-width: 100%; }
  .hero-copy .eyebrow { font-size: 11px; letter-spacing: 1.3px; }
  .hero-actions { gap: 16px; margin-top: 24px; }
  .hero-actions .btn { font-size: 15px; min-height: 48px; padding: 12px 18px; }
  .hero-footnote { font-size: 13px; margin-top: 20px; }
  .hero-art { height: 320px; max-width: 400px; width: 100%; margin: 0 auto; }
  .hero-frame { width: 246px; height: 246px; padding: 12px; border-width: 8px; }
  .hero-orbit { width: 282px; height: 282px; }
  .art-tag { padding: 12px 16px; right: 0; bottom: 0; }
  .art-tag strong { font-size: 18px; }
  .art-tag span, .art-tag small { font-size: 12px; }
  .intro-band { display: block; padding-block: 24px; }
  .intro-band .intro-label { display: block; font-size: 13px; margin-bottom: 12px; }
  .intro-band .intro-points { font-size: 14px; justify-content: flex-start; gap: 10px 18px; }
  .intro-points span:before { margin-right: 6px; }
  .home-section { padding-block: 40px; }
  .section-head { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
  .section-head h2 { font-size: 27px; }
  .section-head p { font-size: 14px; max-width: none; flex-basis: 100%; }
  .section-head .text-btn { font-size: 14px; white-space: normal; }
  .steps-grid { grid-template-columns: 1fr; gap: 24px; }
  .step-item { gap: 20px; padding-top: 20px; }
  .step-item h3 { font-size: 18px; }
  .step-item p { font-size: 15px; }
  .gallery-grid { grid-template-columns: 1fr; gap: 20px; }
  .gallery-card { display: block; }
  .gallery-image { aspect-ratio: 1.2; padding: 24px; }
  .gallery-image .label-tag { font-size: 12px; padding: 5px 9px; top: 14px; left: 14px; }
  .gallery-info { flex-direction: row; align-items: center; padding: 20px; gap: 16px; }
  .gallery-info h3 { font-size: 22px; }
  .gallery-info p, .gallery-note { font-size: 14px; }
  .circle-arrow { width: 44px; height: 44px; }
  .craft-section { grid-template-columns: 1fr; gap: 28px; }
  .craft-symbol { min-height: 240px; }
  .craft-symbol > span { font-size: 12px; bottom: 20px; }
  .craft-copy h2 { font-size: 28px; }
  .craft-copy > p { font-size: 15px; }
  .cta-band { padding: 24px; align-items: stretch; margin-bottom: 32px; }
  .cta-band h2 { font-size: 24px; }
  .cta-band p { font-size: 14px; }
  .resume-card { flex-direction: column; align-items: stretch; gap: 16px; padding: 20px; margin-top: 20px; }
  .resume-card h2, .resume-card h3 { font-size: 20px; }
  .resume-card p { font-size: 14px; }
  .site-footer { padding-block: 24px; flex-direction: column; align-items: flex-start; gap: 16px; margin-top: 24px; }
  .footer-brand { font-size: 17px; letter-spacing: 3px; }
  .footer-brand span { display: block; margin: 8px 0 0; font-size: 13px; letter-spacing: 0; }
  .site-footer > div { flex-wrap: wrap; gap: 8px 20px; font-size: 13px; }
  .toast { bottom: calc(var(--ui-nav-height) + 16px + env(safe-area-inset-bottom, 0px)); font-size: 14px; }
  body[data-page="studio-task"] .toast, body.task-page .toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  dialog { max-width: calc(100vw - 20px); padding: 48px 16px 20px; }
  dialog img { max-width: calc(100vw - 54px); }
  dialog p { font-size: 12px; }
}

@media (max-width: 390px) {
  .site-header { gap: 8px; }
  .brand strong { font-size: 18px; letter-spacing: 2.5px; }
  .header-cta { font-size: 13px; padding-inline: 10px; }
  .header-cta span { margin-left: 6px; }
  .form-section, .studio-v2 .form-section, .palette-controls, .stage-card { padding: 16px; }
  .palette-option { grid-template-columns: minmax(100px, 42%) 1fr; gap: 8px 12px; }
  .parameter-grid { grid-template-columns: 1fr; }
  .workflow-status > div, .result-summary .workflow-status > div { flex-direction: column; gap: 4px; }
  .workflow-status dd, .result-summary .workflow-status dd { text-align: left; }
}

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