:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #30362e;
  background: #eeefed;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --line: #dce0d7;
  --muted: #8b9283;
  --accent: #536646;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
.header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 36px; }
.back { display: inline-flex; align-items: center; gap: 10px; color: #6f7769; text-decoration: none; font-size: 12px; }
.back span { font-size: 19px; }
.back:hover { color: #303b28; }
.result-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 5px 11px; border: 1px solid #e5d8be; border-radius: 999px; background: #f8f1e4; color: #94733f; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.result-badge > span { width: 5px; height: 5px; border-radius: 50%; background: #b48d50; }
.experiment { color: #939a8b; font-size: 10px; letter-spacing: .035em; }
.header-divider { margin: 0 10px; color: #bcc3b4; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 338px; gap: 20px; width: min(1480px, calc(100% - 72px)); height: calc(100svh - 104px); min-height: 550px; margin: 0 auto 28px; }
.preview-pane { min-width: 0; position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); background: radial-gradient(ellipse at 48% 42%, #f3f4f0, #e9ece5); border-radius: 18px; overflow: hidden; }
.preview-heading { padding: 32px 34px 0; }
.eyebrow { margin: 0 0 12px; color: #929b87; font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(23px, 2.4vw, 33px); font-weight: 450; line-height: 1.2; letter-spacing: -.045em; }
.stage { position: relative; flex: 1; min-height: 310px; width: 100%; isolation: isolate; }
.stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .2s; }
.stage.is-ready canvas { opacity: 1; }
.fallback-card, .interaction-zone { position: absolute; width: min(76%, 620px); max-width: calc(100% - 56px); aspect-ratio: 1.6; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 16px; }
.fallback-card { overflow: hidden; background: white; border: 1px solid #fff9; }
.fallback-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stage.is-ready .fallback-card { visibility: hidden; }
.interaction-zone { touch-action: none; cursor: grab; }
.interaction-zone:active { cursor: grabbing; }
.interaction-zone:focus-visible { outline: 1px dashed #7d8a70; outline-offset: 12px; }
.card-shadow { position: absolute; width: 56%; height: 27px; left: 50%; top: 75%; border-radius: 50%; background: #626d54; filter: blur(24px); opacity: .17; transform: translateX(-50%); pointer-events: none; }
.preview-footer { padding: 0 34px 28px; }
.preview-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mode-control { display: inline-flex; gap: 3px; padding: 4px; background: #dfe5d940; border: 1px solid #dce1d6; border-radius: 9px; }
.mode-control button { min-height: 30px; padding: 0 14px; color: #88917f; border: 0; background: none; border-radius: 6px; font-size: 11px; }
.mode-control button[aria-pressed="true"] { background: #f8faf5; color: #4e6042; box-shadow: 0 1px 4px #3340250c; }
.quiet-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 0; border: 0; background: none; color: #8c9582; font-size: 10px; }
.quiet-button:hover { color: #465b38; }
.quiet-button span { font-size: 17px; }
.hint { margin: 14px 0 0; color: #96a08c; font-size: 10px; line-height: 1.6; }
.constructor { min-height: 0; display: flex; flex-direction: column; background: #f9faf6; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 70px; padding: 0 24px; border-bottom: 1px solid #e6e9e1; }
h2 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.025em; }
.panel-header .quiet-button { font-size: 9px; }
.panel-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cbd2c2 transparent; }
.control-section { padding: 22px 24px 23px; border-bottom: 1px solid #e6e9e1; }
.control-section:last-child { border-bottom: 0; }
h3 { margin: 0 0 20px; color: #58674c; font-size: 11px; font-weight: 550; }
.image-section h3 { margin-bottom: 16px; }
.image-preview { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.image-preview img { width: 64px; height: 40px; object-fit: cover; background: white; border: 1px solid #e5e9e0; border-radius: 5px; }
.image-preview div { min-width: 0; }
.image-preview span { display: block; max-width: 190px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-preview small { display: block; margin-top: 5px; color: #a3aa9b; font-size: 9px; }
.image-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 8px 12px; border-radius: 7px; font-size: 10px; line-height: 1.4; }
.primary-button { border: 1px solid #526443; background: #5b6e4c; color: #fcfdfb; }
.primary-button:hover { background: #4a5f3d; }
.secondary-button { border: 1px solid #dfe4d7; background: #f8faf4; color: #7a886e; }
.secondary-button:hover:not(:disabled) { background: #f0f4e9; }
.presets { display: flex; gap: 12px; margin-top: 12px; }
.presets button { border: 0; padding: 4px 0; background: none; color: #a2aa99; font-size: 10px; }
.presets button[aria-pressed="true"] { color: #5b704b; }
.presets button:hover { color: #5b704b; }
.status { margin: 10px 0 0; color: #a5ad9b; font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.status.is-error { color: #a05a47; }
.control + .control { margin-top: 20px; }
.control label { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 11px; color: #7c8773; }
.control output { flex-shrink: 0; color: #a2aa99; font-size: 10px; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 4px; margin: 13px 0 3px; accent-color: var(--accent); cursor: pointer; }
.section-note { margin: 16px 0 0; color: #a7af9f; font-size: 9px; line-height: 1.65; }
:where(a, button, input, canvas):focus-visible { outline: 2px solid #7a8d67; outline-offset: 4px; }
#crop-dialog { width: min(720px, calc(100% - 32px)); max-height: calc(100svh - 32px); overflow-y: auto; padding: 28px; border: 1px solid #e0e5d9; border-radius: 17px; background: #fafbf7; color: #3f4e34; box-shadow: 0 20px 100px #1d291d35; }
#crop-dialog::backdrop { background: #17221165; backdrop-filter: blur(5px); }
.crop-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.crop-header h2 { font-size: 22px; }
.crop-header .eyebrow { margin-bottom: 8px; }
.ratio-badge { padding: 7px 10px; border: 1px solid #dbe3d2; border-radius: 6px; font-size: 11px; color: #99a48e; }
#crop-description { margin: 12px 0 20px; color: #929e85; font-size: 11px; line-height: 1.6; }
#crop-canvas { display: block; width: 100%; aspect-ratio: 1.6; background: white; border-radius: 8px; touch-action: none; cursor: move; }
.crop-zoom-row { display: flex; align-items: center; gap: 18px; margin-top: 23px; font-size: 11px; color: #8b987f; }
.crop-zoom-row input { flex: 1; width: 50%; margin: 0; }
.crop-zoom-row output { width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.crop-actions { margin-top: 25px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.crop-actions > div { display: flex; gap: 8px; }
.no-script { text-align: center; }
@media (min-width: 1500px) { .workspace { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (max-width: 1050px) and (min-width: 781px) {
  .header { padding: 0 22px; }
  .workspace { width: calc(100% - 44px); gap: 14px; grid-template-columns: minmax(0, 1fr) 300px; }
  .preview-heading { padding: 28px 24px 0; }
  .preview-footer { padding: 0 24px 25px; }
  .control-section { padding-left: 20px; padding-right: 20px; }
  .panel-header { padding: 0 20px; }
  .fallback-card, .interaction-zone { width: 80%; max-width: calc(100% - 38px); }
}
@media (max-width: 780px) {
  .header { height: 66px; padding: 0 20px; }
  .experiment { font-size: 9px; }
  .experiment .header-divider, .experiment .header-divider + * { display: none; }
  .workspace { display: flex; flex-direction: column; width: calc(100% - 32px); height: auto; min-height: 0; gap: 16px; margin-bottom: 20px; }
  .preview-pane { min-height: 490px; }
  .preview-heading { padding: 28px 26px 0; }
  .preview-footer { padding: 0 26px 24px; }
  .stage { min-height: 295px; }
  .hint { font-size: 10px; }
  .constructor { overflow: hidden; }
  .panel-scroll { overflow: visible; }
  .panel-header { min-height: 68px; }
  .control-section { padding: 24px; }
}
@media (max-width: 420px) {
  .experiment { max-width: 160px; text-align: right; line-height: 1.5; }
  .preview-pane { min-height: 440px; }
  .preview-heading { padding: 24px 22px 0; }
  .stage { min-height: 250px; }
  .preview-footer { padding: 0 22px 22px; }
  .fallback-card, .interaction-zone { width: 82%; max-width: calc(100% - 36px); }
  .crop-actions { flex-wrap: wrap; }
  #crop-dialog { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; } }

/* The preview contains only the physical object. */
.preview-pane { border: 0; border-radius: 0; background: none; }
.stage { min-height: 0; }
.back { min-height: 36px; padding: 8px 13px; border: 1px solid #d5dccd; border-radius: 8px; color: #7a8570; }
.back:hover { border-color: #b6c2aa; background: #f5f7f0; }
.constructor-dock { min-width: 0; min-height: 0; }
.constructor { height: 100%; }
.panel-scroll { flex: 1; min-height: 0; }
.panel-header-actions { display: flex; align-items: center; gap: 6px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 32px; height: 32px; padding: 6px; background: none; border: 0; color: #939e87; border-radius: 6px; }
.icon-button:hover:not(:disabled) { background: #edf1e7; color: #536646; }
.delete-image:hover:not(:disabled) { color: #a16e58; background: #f6ede7; }
.image-preview > div { flex: 1; }
.image-preview span { max-width: 100%; }
.sample-label { display: block; margin: 17px 0 8px; color: #9ba58e; font-size: 9px; }
.sample-select { width: 100%; min-height: 34px; border: 1px solid #e1e7d8; border-radius: 7px; background: #f8faf4; padding: 6px 9px; font: inherit; font-size: 10px; color: #819172; }
.position-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 24px; }
.configure-button, .sheet-close { display: none; }
[hidden] { display: none !important; }
@media (max-width: 780px) {
  .header { display: grid; grid-template-columns: 1fr 1fr; align-content: center; height: 106px; gap: 10px; }
  .header .back { grid-column: 1; grid-row: 1; justify-self: start; }
  .header .configure-button { grid-column: 2; grid-row: 1; justify-self: end; }
  .header .result-badge { grid-column: 1 / -1; grid-row: 2; justify-self: center; font-size: 10px; min-height: 25px; padding: 4px 10px; }
  .workspace { display: block; height: calc(100svh - 130px); min-height: 0; margin-bottom: 24px; }
  .preview-pane { min-height: 0; height: 100%; }
  .stage { height: 100%; min-height: 0; }
  .constructor-dock { display: none; }
  .configure-button { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 8px 11px; border: 1px solid #d5dccd; border-radius: 8px; background: none; color: #78866d; font-size: 11px; }
  .sheet-close { display: inline-flex; }
  .constructor-dialog[open] { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; height: 58svh; max-height: 78svh; padding: 0; border: 1px solid #dce3d2; border-bottom: 0; border-radius: 19px 19px 0 0; background: #f9faf6; box-shadow: 0 -14px 60px #34442315; }
  .constructor-dialog::backdrop { background: #25351a14; }
  .sheet-handle { height: 18px; display: flex; align-items: center; justify-content: center; }
  .sheet-handle::before { content: ''; width: 32px; height: 3px; border-radius: 3px; background: #d5ddca; }
  #constructor-sheet-body { height: calc(100% - 18px); }
  .constructor-dialog .constructor { border: 0; border-radius: 0; height: 100%; }
  .constructor-dialog .panel-header { min-height: 54px; }
  .constructor-dialog .panel-scroll { overflow-y: auto; }
  .constructor-open .workspace { height: calc(42svh - 110px); min-height: 0; }
}
