:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #202624;
  --muted: #63716b;
  --line: #dfe5e2;
  --accent: #176b50;
  --accent-light: #edf6f1;
  --green: #176b50;
  --radius: 8px;
  font-size: 16px;
}
body { background: var(--bg); line-height: 1.5; }
[hidden] { display: none !important; }
body, button, input, h1, h2, h3, .brand, .eyebrow, .tiny-badge, .field-label, .price-total strong { letter-spacing: 0; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role="button"]:focus-visible { outline-color: #245a9c; }
a:not(.brand), .text-button { color: #245a9c; }
.lucide { width: 20px; height: 20px; flex: none; stroke-width: 1.8; }
.topbar { height: 80px; padding: 0 max(24px, calc((100% - 1200px) / 2)); gap: 16px; }
.brand { font-size: 32px; gap: 18px; line-height: 1; }
.brand small { color: var(--muted); font-size: 13px; font-weight: 400; }
nav { gap: 24px; align-items: center; }
.nav { min-height: 44px; padding: 0 8px; color: var(--muted); font-size: 14px; }
.nav.active:after { display: none; }
.cart-nav { display: inline-flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 50%; padding: 0 4px; margin: 0; font-size: 12px; color: white; background: var(--accent); }
main { max-width: 1248px; padding: 0 24px; }
.page-heading { padding: 40px 0 28px; }
.eyebrow { color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 10px; }
h1 { font-size: 32px; line-height: 1.2; font-weight: 650; }
.subtitle { color: var(--muted); font-size: 16px; line-height: 1.5; margin-top: 12px; }
body:not(.has-model) #studio { max-width: 680px; margin: 0 auto; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0 40px; }
.model-column { grid-column: 1; grid-row: 1 / 3; }
.settings-card { grid-column: 2; grid-row: 1; }
.result-card { grid-column: 2; grid-row: 2; margin: 0; }
body:not(.has-model) .workspace { display: block; }
.card, .model-card, .settings-card, .result-card { border: 0; border-radius: 0; overflow: visible; background: transparent; }
.settings-card { border-top: 2px solid var(--line); padding: 24px 0; }
.card-head { padding: 0 0 14px; height: auto; min-height: 44px; border-bottom: 0; gap: 12px; }
.card-head h2, h2 { font-size: 18px; font-weight: 600; }
.step { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-right: 8px; background: var(--accent); color: white; border-radius: 6px; font-size: 14px; font-weight: 700; }
.settings-card .step { background: #245a9c; }
.model-card .card-head h2, .settings-card .card-head h2, .result-card .card-head h2 { display: flex; align-items: center; font-size: 20px; }
.tiny-badge { font-size: 11px; background: #f3f5f6; border: 0; color: var(--muted); padding: 4px 8px; }
.text-button { font-size: 14px; min-height: 44px; padding: 6px 0; gap: 6px; }
.icon-button { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; }
.model-source-switch { margin: 0 0 16px; padding: 4px; gap: 4px; background: #f3f5f6; border-radius: 8px; }
.model-source-switch button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 0; font-size: 15px; background: transparent; border-radius: 5px; color: var(--muted); }
.model-source-switch button.selected { background: white; color: var(--ink); box-shadow: 0 1px 4px #20262414; }
.dropzone { min-height: 256px; margin: 0; padding: 28px 20px; border: 1px dashed #becbc4; border-radius: 8px; background: #f8faf9; background-image: none; }
.dropzone:hover, .dropzone.dragover { background: var(--accent-light); border-color: var(--accent); }
.dropzone .upload-icon { width: 30px; height: 30px; margin-bottom: 16px; color: var(--muted); }
.dropzone h3 { font-size: 18px; }
.dropzone p { color: var(--muted); font-size: 14px; margin-top: 6px; }
.button { min-height: 48px; padding: 12px 18px; font-size: 15px; font-weight: 600; gap: 12px; border-radius: 6px; }
.button.full { justify-content: center; }
.button.dark, .button.accent { background: var(--accent); color: white; }
.button.dark:hover, .button.accent:hover { background: #11543e; }
.button.secondary { color: var(--ink); background: #f3f5f6; }
.dropzone .button { margin-top: 20px; min-width: 190px; }
.dropzone small { font-size: 13px; color: var(--muted); margin-top: 12px; }
.makerworld-form { min-height: 256px; margin: 0; padding: 24px 0; background: white; border: 0; border-radius: 0; gap: 12px; align-content: center; }
.makerworld-form label { font-size: 14px; }
.makerworld-form input { font-size: 16px; min-height: 48px; min-width: 0; background: #f8faf9; }
.makerworld-form small { font-size: 13px; }
.examples { padding: 24px 0 0; display: block; color: var(--muted); font-size: 13px; }
.example-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.example-options button { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px; text-align: left; color: var(--ink); background: #f3f5f6; border: 1px solid transparent; border-radius: 6px; text-decoration: none; }
.example-options button:hover { border-color: #b6c9bd; }
.example-options img { width: 64px; height: 64px; flex: none; object-fit: contain; border-radius: 4px; }
.example-options button > span { min-width: 0; flex: 1; }
.example-options strong, .example-options small { display: block; font-size: 14px; line-height: 1.4; }
.example-options small { color: var(--muted); font-size: 12px; margin-top: 4px; }
.example-options .lucide { width: 16px; height: 16px; }
.viewer-top { background: white; color: var(--muted); font-size: 13px; padding: 0 0 12px; }
.viewer-top > span:first-child { max-width: 90%; }
.viewer-label { display: none; }
#viewer { height: 400px; background: #f3f5f6; border-radius: 6px; overflow: hidden; }
.viewer-bottom { padding: 8px 0; background: white; color: var(--muted); font-size: 12px; }
.model-tools { padding: 12px 0 16px; gap: 12px; flex-direction: column; align-items: stretch; }
.dimensions { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-label { font-size: 13px; margin: 0; color: var(--muted); }
.dimensions strong { font-size: 16px; color: var(--ink); }
.dimension-note { max-width: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 12px; border-radius: 6px; background: #edf3f9; color: #245a9c; font-size: 14px; cursor: pointer; }
.dimension-note input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.settings-section { padding: 16px 0 0; }
.settings-section.compact { margin-top: 18px; padding: 18px 0 0; }
.control-label, .quantity-label strong { font-size: 15px; }
.quantity-label small { font-size: 13px; }
.quantity-stepper { height: 44px; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.quantity-stepper button { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 0; background: #f3f5f6; }
.quantity-stepper input { width: 48px; min-height: 44px; border: 0; border-radius: 0; background: white; padding: 6px 0; font-size: 16px; -moz-appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.help, #palette-help { font-size: 13px; line-height: 1.5; }
.palette { display: block; }
.palette-slots { margin-bottom: 12px; gap: 8px; }
.slot-button { font-size: 13px; min-height: 44px; border-radius: 6px; }
.preset-colors { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.preset-color { min-width: 0; min-height: 72px; padding: 8px 2px; font-size: 11px; color: var(--muted); border: 1px solid transparent; border-radius: 6px; background: white; }
.preset-color[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-light); color: var(--ink); }
.preset-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #20262426; display: grid; place-items: center; margin: 0 auto 5px; }
.preset-swatch .lucide { width: 16px; height: 16px; color: white; filter: drop-shadow(0 1px 1px #000); }
.smart-defaults { margin: 18px 0 0; padding: 0; background: none; font-size: 13px; color: var(--muted); }
.advanced-settings { margin-top: 18px; }
.advanced-settings > summary { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 12px 0; font-size: 14px; color: var(--ink); list-style: none; }
.advanced-settings > summary::-webkit-details-marker { display: none; }
.advanced-settings > summary::before { display: none; }
.advanced-settings[open] > summary .lucide { transform: rotate(180deg); }
.quality-options { gap: 8px; }
.quality-options strong { font-size: 14px; }
.quality-options small { font-size: 12px; }
.quality-options input:checked + span { border-color: var(--accent); background: var(--accent-light); }
.segmented { background: #f3f5f6; }
.segmented span { min-height: 44px; display: grid; place-items: center; font-size: 14px; }
.parts { max-height: 260px; }
.part-row { padding: 8px 0; gap: 6px; }
.part-name { font-size: 13px; min-height: 44px; }
.part-row select { min-height: 44px; font-size: 16px; }
.scale-label { font-size: 14px; color: var(--ink); }
.input-unit { font-size: 16px; }
.input-unit input { min-height: 44px; width: 84px; font-size: 16px; }
.settings-footer { padding: 20px 0; margin: 0; }
#calculate { font-size: 15px; }
.settings-footer p { font-size: 12px; color: var(--muted); }
.result-content { padding: 0; min-width: 0; }
#result-card { min-width: 0; }
#result-content > * { max-width: 100%; }
.result-card .card-head { border-top: 1px solid var(--line); padding-top: 20px; }
.result-card .tiny-badge { font-size: 10px; }
.included { display: none; }
.empty-result { display: flex; padding: 8px 0; color: var(--muted); }
.empty-result h3 { font-size: 16px; color: var(--ink); }
.empty-result p { font-size: 14px; }
.result-icon { display: none; }
.result-card { border-top: 2px solid var(--accent); padding: 24px 20px; background: #edf6f1; }
.result-card { scroll-margin-top: 16px; }
.result-card .card-head { border-top: 0; padding-top: 0; }
.price-total, .price-total.has-unit-price { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; background: transparent; border: 0; border-radius: 0; padding: 16px 0; margin: 0; }
.price-total > div { min-width: 0; }
.price-total > div > span { font-size: 14px; color: var(--muted); }
.price-total strong { font-size: 32px; color: var(--ink); margin-top: 2px; overflow-wrap: anywhere; }
.price-total.has-unit-price > div:first-child strong { white-space: normal; }
.price-note { display: block; text-align: left; font-size: 13px; color: var(--muted); }
.price-per-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-color: var(--line); font-size: 13px; color: var(--muted); }
.price-total .price-per-unit strong { font-size: 16px; color: var(--ink); }
.result-model { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.support-choice, .quantity-hint { padding: 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: white; }
.support-choice-control { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 12px; }
.support-choice-control input { width: 20px; height: 20px; min-width: 20px; padding: 0; margin: 2px 0 0; }
.support-choice-control > span { display: block; min-width: 0; }
.support-choice-control strong, .support-choice-control small, .support-choice > p, .support-choice > small { white-space: normal; overflow-wrap: anywhere; }
.support-choice.is-selected { background: white; border-color: var(--line); }
.support-choice-control strong { font-size: 14px; color: var(--ink); }
.support-choice-control small, .support-choice > small { font-size: 13px; color: var(--muted); }
.support-choice > p { font-size: 14px; }
.support-choice > small { display: block; }
.support-choice .support-choice-price { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: 16px 0 8px; color: var(--muted); font-weight: 400; }
.support-choice-price strong { font-size: 20px; color: var(--ink); font-weight: 650; }
.quantity-hint strong { font-size: 14px; }
.quantity-hint p { font-size: 13px; }
.cart-minimum-callout { padding: 14px; border-color: #e8d9ba; border-radius: 6px; background: #fff9ed; }
.cart-minimum-callout p { font-size: 14px; }
.cart-minimum-callout .button { margin-top: 12px; }
.notice, .missing-tariffs { background: #f3f5f6; color: var(--ink); padding: 16px; border-radius: 6px; font-size: 14px; }
.notice.warning { background: #fff9ed; color: #8a5200; }
.missing-tariffs p, .warnings { font-size: 13px; }
.running-result { flex-direction: column; gap: 12px; }
.progress-copy { width: 100%; min-width: 0; }
.running-result h3 { font-size: 16px; }
.running-result p { font-size: 14px; }
.running-result > .button { margin-left: 0; min-height: 44px; }
.progress-head { font-size: 13px; }
.progress-head strong { font-size: 22px; color: var(--accent); }
.progress-track { background: #e6ece8; height: 6px; }
.indeterminate > span { width: 35%; animation: waiting 1.6s ease-in-out infinite alternate; }
@keyframes waiting { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) { .indeterminate > span { animation: none; width: 100%; opacity: .45; } }
.progress-foot { font-size: 12px !important; }
.cart-layout { grid-template-columns: minmax(0, 1fr) 390px; gap: 48px; }
.padded { padding: 0; }
.cart-checkout { border-left: 1px solid var(--line); padding-left: 32px; }
.cart-models > h2, .cart-checkout > h2 { font-size: 22px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.cart-items { margin: 0 0 16px; }
.cart-item { padding: 22px 0; gap: 12px; }
.cart-item-main > strong { font-size: 17px; font-weight: 650; }
.cart-item-actions > strong { font-size: 22px; font-weight: 700; color: var(--ink); }
.cart-item strong { overflow-wrap: anywhere; }
.cart-item p, .cart-item-actions small, .cart-empty { font-size: 14px; }
.cart-item-actions { flex-wrap: wrap; }
.cart-item-actions .text-button { font-size: 13px; }
.cart-item-main { min-width: 0; flex: 1; }
.cart-item-controls { display: flex; align-items: center; gap: 12px; }
.cart-summary { margin-top: 28px; padding: 20px 0; border-top: 2px solid var(--accent); background: #edf6f1; }
.cart-summary h2, .cart-summary > .help { padding: 0 16px; }
.cart-summary h2 { font-size: 16px; }
.cart-total { margin: 0; padding: 12px 16px; border: 0; }
.cart-total strong { color: var(--ink); font-size: 32px; white-space: nowrap; }
.cart-summary > .help { font-size: 12px; color: var(--muted); }
#order-form { gap: 28px; padding-top: 28px; }
#order-form label, .checkout-options legend { font-size: 14px; }
.checkout-options { border: 0; border-radius: 0; padding: 16px 0 24px; border-bottom: 1px solid var(--line); gap: 16px; }
.checkout-options legend { display: flex; align-items: center; gap: 10px; padding: 0; font-size: 18px; font-weight: 650; }
.checkout-step { display: inline-grid; place-items: center; width: 28px; height: 28px; background: #edf3f9; color: #245a9c; font-size: 14px; border-radius: 50%; }
#order-form label { font-weight: 500; }
#order-form .choice-line { font-weight: 400; }
#order-form .choice-line strong { font-weight: 600; }
#order-form .choice-line input { padding: 0; height: 20px; accent-color: var(--accent); }
.checkout-submit { display: grid; gap: 16px; padding-top: 20px; border-top: 2px solid var(--line); }
#order-form .terms-choice { font-size: 12px; color: var(--muted); }
.choice-line.terms-choice > span { display: block; }
.checkout-submit > .help { text-align: center; font-size: 12px; }
.choice-line small, #order-form .help { font-size: 13px; }
.suggestions button { min-height: 48px; font-size: 14px; }
.order-confirmation { padding-top: 16px; }
.order-confirmation h3 { font-size: 22px; }
.order-confirmation .button { margin: 6px 0; }
footer { font-size: 12px; color: var(--muted); padding: 32px 0 24px; margin-top: 28px; border-top: 1px solid var(--line); gap: 16px; }
footer > span:first-child { color: var(--ink); }
footer .muted { color: var(--muted); }
#toast { background: var(--ink); font-size: 14px; border-radius: 6px; }
#toast.error { background: #b42318; }
#loading-overlay { background: #ffffffb5; }
.loading-box { border-radius: 8px; box-shadow: 0 8px 30px #20262412; }
.loading-box strong { font-size: 16px; }
.loading-box p, .loading-box small { font-size: 13px; }
.mobile-action-bar { display: none; }
.order-page { padding-top: 32px; }
@media (max-width: 900px) {
  .workspace { gap: 0 24px; grid-template-columns: minmax(0, 1fr) 320px; }
  .brand small { display: none; }
  .cart-layout { gap: 28px; grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 780px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand { font-size: 28px; }
  nav { gap: 10px; }
  .nav { font-size: 13px; }
  .cart-nav-label { display: none; }
  .cart-nav { min-width: 44px; gap: 5px; }
  main { padding: 0 16px; }
  .page-heading { padding: 26px 0 24px; }
  h1 { font-size: 26px; line-height: 1.25; }
  .eyebrow { font-size: 11px; margin-bottom: 8px; }
  .subtitle { font-size: 14px; margin-top: 8px; max-width: 330px; }
  .workspace { display: flex; flex-direction: column; gap: 0; }
  .model-column { display: contents; }
  .model-card { order: 0; }
  .settings-card { order: 1; }
  .result-card { order: 2; }
  body.has-model #studio > .page-heading { display: none; }
  body.has-model .workspace { padding-top: 16px; }
  .card-head { min-height: 44px; padding: 0 0 12px; flex-wrap: nowrap; }
  .card-head h2 { font-size: 18px; }
  .model-card .card-head h2, .settings-card .card-head h2, .result-card .card-head h2 { font-size: 18px; }
  .dropzone { min-height: 244px; padding: 24px 16px; }
  .dropzone h3 { font-size: 17px; }
  .example-options { gap: 8px; }
  .example-options button { padding: 8px; gap: 8px; }
  .example-options img { width: 40px; height: 48px; }
  .example-options strong { font-size: 12px; }
  .example-options small { font-size: 11px; }
  .example-options .lucide { display: none; }
  #viewer { height: 240px; }
  .viewer-top { padding-bottom: 10px; }
  .viewer-bottom { padding: 4px 0; flex-wrap: nowrap; }
  .dimensions { flex-basis: auto; }
  .dimensions strong { font-size: 15px; }
  .field-label { font-size: 12px; }
  .model-tools { padding: 10px 0 18px; }
  .settings-card { margin-top: 24px; padding: 24px 0; }
  .settings-card > .card-head { border-top: 0; padding-top: 0; }
  .result-card { margin: 0 -16px; padding: 24px 16px; }
  .result-card .card-head { flex-wrap: wrap; align-items: center; }
  .result-card .tiny-badge { max-width: 100%; white-space: normal; }
  .price-per-unit { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .price-total .price-per-unit strong { white-space: normal; }
  .settings-section { padding: 12px 0 0; }
  .settings-footer { padding: 14px 0; }
  .settings-footer p { margin-top: 8px; }
  body.dock-active #result-content > #add-to-cart, body.dock-active #result-content #increase-copies { display: none; }
  .mobile-action-bar { display: flex; position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); align-items: center; gap: 12px; box-shadow: 0 -3px 16px #20262406; }
  .mobile-action-bar > div { flex: 1; min-width: 0; }
  .mobile-action-bar span { color: var(--muted); font-size: 12px; display: block; }
  .mobile-action-bar strong { color: var(--ink); font-size: 18px; display: block; overflow-wrap: anywhere; }
  .mobile-action-bar .button { flex: 0 1 auto; max-width: 62%; padding: 12px 16px; font-size: 14px; min-height: 48px; }
  body.dock-active { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.keyboard-open .mobile-action-bar { position: static; box-shadow: none; }
  body.keyboard-open { padding-bottom: 0; }
  body.dock-active #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .cart-layout { display: block; }
  .cart-checkout { border-left: 0; border-top: 0; padding: 0; margin-top: 40px; }
  .cart-item { flex-direction: row; flex-wrap: wrap; gap: 16px; }
  .cart-item-main { flex-basis: 100%; }
  .cart-item-actions { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; }
  .cart-item-actions > strong { grid-column: 1; grid-row: 1; }
  .cart-item-actions > small { grid-column: 1; grid-row: 2; }
  .cart-item-controls { grid-column: 2; grid-row: 1 / 3; }
  .cart-item-actions { align-items: center; flex-direction: row; justify-content: space-between; }
  .cart-item-controls { margin-left: auto; }
  .cart-item-actions small { flex-basis: 100%; text-align: left; }
  .address-pair { gap: 8px; }
  footer { align-items: flex-start; flex-direction: column; margin-top: 24px; padding: 24px 0; gap: 8px; font-size: 11px; }
  footer > span:last-child { line-height: 1.8; }
  .order-page { margin: 0 auto; }
}
@media (max-width: 360px) {
  main, .topbar { padding-left: 12px; padding-right: 12px; }
  h1 { font-size: 24px; }
  .brand { font-size: 26px; }
  .example-options strong { font-size: 11px; }
  .example-options small { font-size: 10px; }
  .preset-colors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quantity-label { gap: 8px; }
  .quantity-label small { font-size: 12px; }
  .mobile-action-bar { padding-left: 12px; padding-right: 12px; }
  .mobile-action-bar .button { padding: 10px 12px; font-size: 13px; }
}
