/* Brand layer: keep the established controls and mobile result layout. */
:root {
  --ink: #19231f;
  --muted: #64706b;
  --line: #dce3df;
}
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.topbar { border-bottom: 1px solid var(--ink); }
.origo-brand { display: inline-flex; align-items: center; flex: none; gap: 8px; font-size: 27px; font-weight: 750; }
.origo-brand img { display: block; width: 36px; height: 36px; object-fit: contain; }
.origo-brand > span { display: inline-flex; align-items: baseline; gap: 5px; }
.origo-brand .brand-discipline { display: inline; font-size: 12px; font-weight: 650; color: var(--accent); }
.nav.active { color: var(--ink); font-weight: 650; }
.page-heading { padding: 36px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.eyebrow { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--accent); }
h1 { font-size: 36px; font-weight: 700; line-height: 1.15; }
.subtitle { font-size: 15px; margin-top: 12px; }
body:not(.has-model) #studio { max-width: 760px; }
.card-head { padding-bottom: 18px; }
.model-card .card-head h2, .settings-card .card-head h2, .result-card .card-head h2 { font-size: 20px; font-weight: 650; }
.step { flex: none; width: 40px; height: 40px; margin-right: 12px; border-radius: 4px; font-size: 22px; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--accent); color: white; border: 0; padding: 0; }
.settings-card .step { background: #245a9c; color: white; }
.settings-card { border-top: 1px solid var(--ink); padding-top: 24px; }
.model-source-switch { background: #eef1f0; border-radius: 4px; }
.model-source-switch button { border-radius: 2px; }
.model-source-switch button.selected { box-shadow: none; border-bottom: 2px solid var(--accent); }
.dropzone { min-height: 240px; background: #f2f5f3; border: 1px solid #cbd6cf; border-radius: 4px; }
.dropzone .upload-icon { color: var(--accent); }
.dropzone h3 { font-size: 20px; font-weight: 600; }
.button { border-radius: 4px; }
.example-options { gap: 16px; }
.example-options button { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 10px 0; }
.example-options img { width: 76px; height: 76px; }
.examples { padding-top: 18px; }
#viewer { border-radius: 0; }
.viewer-top { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.dimensions { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.result-card { border-top: 3px solid var(--accent); background: #edf6f1; padding: 24px 20px; }
.result-card .step { border: 0; background: var(--ink); color: white; }
.price-total strong, .cart-total strong { font-variant-numeric: tabular-nums; font-size: 36px; font-weight: 700; }
.price-total .price-per-unit strong { font-size: 16px; }
.progress-head strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.progress-track { border-radius: 0; height: 7px; }
.cart-summary { border-top-width: 3px; }
.cart-models > h2, .cart-checkout > h2 { font-size: 22px; border-bottom-width: 1px; }
.checkout-step { border-radius: 0; background: transparent; border-right: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.cart-item { border-bottom: 1px solid var(--line); }
.mobile-action-bar { border-top-color: var(--ink); }
.makerworld-catalog { display: inline-flex; align-items: center; justify-self: start; gap: 6px; min-height: 44px; max-width: 100%; font-size: 14px; line-height: 1.4; text-decoration: underline; text-underline-offset: 3px; }
.makerworld-catalog .lucide { width: 16px; height: 16px; }
.color-required { display: grid; gap: 4px; margin-bottom: 14px; padding: 12px; border-left: 3px solid #b42318; background: #fff3f2; color: #8f2119; font-size: 13px; line-height: 1.5; }
.color-required strong { font-size: 14px; }
.slot-button.needs-color { color: #8f2119; border-color: #bd655c; background: #fff3f2; }
.palette-heading { font-size: 14px; font-weight: 650; line-height: 1.4; margin: 0 0 12px; }
.palette-source { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 18px; }
.palette-source .palette-slots { margin-bottom: 0; }
.palette-source .slot-button { min-width: 0; max-width: 100%; text-align: left; }
.palette-source .slot-button > span:last-child { overflow-wrap: anywhere; }
.palette-source .slot-button .swatch { flex: none; }
.palette-source .slot-button small { display: block; font-size: 11px; font-weight: 400; margin-top: 2px; }
#calculate-hint.color-blocked { color: #8f2119; font-size: 13px; font-weight: 600; }
.part-color-settings { border-top: 1px solid var(--line); margin-top: 18px; }
.part-color-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-size: 14px; cursor: pointer; list-style: none; }
.part-color-settings > summary::-webkit-details-marker { display: none; }
.part-color-settings[open] > summary .lucide { transform: rotate(180deg); }
.cart-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 16px 0; }
.cart-item-thumbnail { width: 72px; height: 72px; display: grid; place-items: center; background: #f3f5f6; border-radius: 4px; overflow: hidden; color: var(--muted); }
.cart-item-thumbnail img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cart-item-thumbnail .lucide { width: 24px; height: 24px; }
.cart-item-main > strong { font-size: 15px; line-height: 1.4; }
.cart-item p, .cart-item-actions small { font-size: 12px; line-height: 1.5; }
.cart-item-actions > strong { font-size: 18px; line-height: 1.4; }
.cart-item-actions { min-width: 0; }
.cart-item-controls { gap: 4px; }
.cart-item-controls .icon-button { width: 44px; height: 44px; flex: none; }
.contact-nav { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
.contact-nav .lucide { width: 20px; height: 20px; }
.studio-nav > .lucide { display: none; }
.contact-dialog { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; overflow-y: auto; }
.contact-dialog::backdrop { background: #19231f66; }
.contact-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.contact-heading h2 { font-size: 22px; }
.contact-heading .icon-button { width: 44px; height: 44px; flex: none; }
#contact-form { display: grid; gap: 18px; }
#contact-form fieldset { border: 0; padding: 0; min-width: 0; }
#contact-form legend { font-size: 14px; padding-bottom: 10px; }
#contact-form .segmented input:checked + span { background: #edf6f1; box-shadow: inset 0 -2px 0 var(--accent); color: var(--ink); font-weight: 600; }
#contact-form > label { display: grid; gap: 8px; font-size: 14px; }
#contact-form input:not([type="radio"]), #contact-form textarea { width: 100%; min-width: 0; font-size: 16px; min-height: 44px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
#contact-form textarea { resize: vertical; min-height: 112px; }
.contact-privacy { font-size: 12px; line-height: 1.5; color: var(--muted); }
.contact-privacy a { text-decoration: underline; }
.contact-status { font-size: 13px; line-height: 1.5; color: #b42318; }
#contact-done { text-align: center; }
#contact-done > .lucide { width: 32px; height: 32px; color: var(--accent); margin-bottom: 12px; }
#contact-done h3 { font-size: 20px; }
#contact-done p { font-size: 14px; margin: 12px 0 24px; color: var(--muted); }
.restore-note { min-height: 180px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 20px; font-size: 14px; color: var(--muted); text-align: center; }
.restore-note > span { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.restore-dots { display: inline-flex; gap: 4px; }
.restore-dots i { width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
body.restoring-draft #model-source-switch, body.restoring-draft #dropzone,
body.restoring-draft #makerworld-form, body.restoring-draft .examples { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .button, .icon-button, .preset-color, .slot-button, .nav, .model-source-switch button,
  .segmented span, .quality-options span { transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease; }
  .button:active:not(:disabled), .icon-button:active:not(:disabled) { transform: scale(.98); }
  .preset-color:active .preset-swatch { transform: scale(.92); }
  .preset-swatch { transition: transform 180ms ease, box-shadow 180ms ease; }
  .preset-color[aria-pressed="true"] .preset-swatch .lucide { animation: origo-check 220ms ease-out; }
  .advanced-settings > summary .lucide, .part-color-settings > summary .lucide { transition: transform 240ms ease; }
  .dropzone { transition: background-color 180ms ease, border-color 180ms ease; }
  input, select { transition: border-color 160ms ease, box-shadow 160ms ease; }
  .restore-dots i { animation: origo-loading 900ms ease-in-out infinite alternate; }
  .restore-dots i:nth-child(2) { animation-delay: 150ms; }
  .restore-dots i:nth-child(3) { animation-delay: 300ms; }
}
@keyframes origo-loading { from { opacity: .3; transform: translateY(0); } to { opacity: 1; transform: translateY(-3px); } }
@keyframes origo-check { from { opacity: .2; transform: scale(.65); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (max-width: 780px) {
  .studio-nav { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .studio-nav > span { display: none; }
  .studio-nav > .lucide { display: block; width: 20px; height: 20px; }
  .contact-dialog { width: 100%; max-width: 100%; max-height: calc(var(--contact-height, 100dvh) - 24px); position: fixed; inset: auto 0 var(--contact-bottom, 0px); margin: 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 8px 8px 0 0; border-bottom: 0; }
  .topbar { padding: 0 16px; gap: 8px; }
  .origo-brand { font-size: 23px; gap: 5px; }
  .origo-brand img { width: 30px; height: 30px; }
  .origo-brand .brand-discipline { font-size: 10px; }
  nav { gap: 4px; }
  .nav { padding: 0 5px; }
  .page-heading { padding: 24px 0 22px; margin-bottom: 22px; }
  h1 { font-size: 28px; max-width: 100%; overflow-wrap: anywhere; }
  .model-card .card-head h2, .settings-card .card-head h2, .result-card .card-head h2 { font-size: 18px; }
  .step { width: 38px; height: 38px; font-size: 22px; margin-right: 10px; padding: 0; }
  .dropzone { min-height: 228px; padding: 22px 16px; }
  .dropzone h3 { font-size: 18px; }
  .example-options { gap: 12px; }
  .example-options img { width: 52px; height: 52px; }
  .example-options button { gap: 8px; }
  .example-options strong { font-size: 13px; }
  .result-card { position: relative; left: -16px; width: calc(100% + 32px); margin: 0; padding: 24px 16px; }
  .price-total strong, .cart-total strong { font-size: 32px; overflow-wrap: anywhere; white-space: normal; }
  .cart-models > h2, .cart-checkout > h2 { font-size: 18px; padding-bottom: 12px; }
  .cart-item { grid-template-columns: 64px minmax(0, 1fr); gap: 8px 12px; padding: 14px 0; }
  .cart-item-thumbnail { width: 64px; height: 64px; grid-row: 1 / 3; }
  .cart-item-actions { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
  .cart-item-actions > strong { font-size: 18px; }
  .cart-item-actions > small { flex-basis: 100%; order: 2; }
  .cart-summary { margin-top: 20px; padding: 16px 0; }
  .cart-total strong { font-size: 28px; }
}
@media (max-width: 360px) {
  .result-card { left: -12px; width: calc(100% + 24px); padding-left: 12px; padding-right: 12px; }
}
