:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #311330;
  color: #fff6fa;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, #8d3a7e 0, transparent 34rem), #311330; }
button, input { font: inherit; }
.app-shell { width: min(1180px, calc(100% - 2.5rem)); margin: 0 auto; padding: 2.75rem 0 4.5rem; }
.intro { max-width: 43rem; margin-bottom: 2.25rem; }
.eyebrow { margin: 0 0 .55rem; color: #f8a7bf; font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .7rem; font-size: clamp(2.7rem, 6vw, 5rem); line-height: .92; letter-spacing: -.06em; }
.intro > p:last-child { margin-bottom: 0; color: #f0cad8; font-size: 1.1rem; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: minmax(18rem, .72fr) minmax(0, 1.28fr); gap: 1.25rem; }
.controls, .preview-panel { border: 1px solid rgba(241, 116, 158, .3); border-radius: 1.25rem; background: rgba(73, 27, 72, .85); box-shadow: 0 1.5rem 4rem rgba(31, 5, 31, .25); }
.controls { padding: 1.5rem; }
.section-heading { margin-bottom: 1.6rem; }
.unit-control { display: flex; gap: .45rem; align-items: center; margin-top: .8rem; color: #efc8d7; font-size: .82rem; font-weight: 600; }
.unit-control select { border: 1px solid #9e5d91; border-radius: .45rem; background: #351431; color: #fff4f8; padding: .35rem .45rem; }
.section-heading p:last-child { margin: 0; color: #efc8d7; line-height: 1.45; }
label { display: block; margin-top: 1.05rem; color: #fff4f8; font-size: .95rem; font-weight: 680; }
label span { color: #ebc1d0; font-weight: 500; }
input[type="number"] { display: block; width: 100%; margin-top: .5rem; padding: .76rem .85rem; border: 1px solid #9e5d91; border-radius: .55rem; outline: none; background: #351431; color: inherit; }
input[type="number"]:focus { border-color: #f1749e; box-shadow: 0 0 0 3px rgba(241, 116, 158, .2); }
input[aria-invalid="true"] { border-color: #e47a7a; }
.field-error { display: block; min-height: 1.2em; margin-top: .3rem; color: #ffafaf; font-size: .78rem; font-weight: 500; }
.shape-note { margin: 1rem 0; color: #efc8d7; font-size: .86rem; line-height: 1.45; }
.tab-option { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem; border: 1px solid #8f527f; border-radius: .7rem; background: rgba(43, 14, 42, .46); cursor: pointer; }
.tab-option input { width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; accent-color: #f1749e; }
.tab-option strong, .tab-option small { display: block; }
.tab-option small { margin-top: .22rem; color: #efc8d7; font-size: .78rem; font-weight: 450; line-height: 1.4; }
.download-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1.25rem; }
button { width: 100%; padding: .9rem 1rem; border: 0; border-radius: .6rem; background: #f1749e; color: #4c173f; font-weight: 800; cursor: pointer; }
button:hover:not(:disabled) { background: #ffc0d3; }
button:disabled { opacity: .43; cursor: not-allowed; }
.preview-panel { display: flex; min-width: 0; flex-direction: column; padding: 1.5rem; }
.preview-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
h2 { margin-bottom: 0; font-size: 1.35rem; letter-spacing: -.02em; }
.shape-badge { padding: .42rem .6rem; border: 1px solid #8f527f; border-radius: 999px; color: #ffd0de; font-size: .76rem; white-space: nowrap; }
.preview { display: grid; flex: 1; place-items: center; min-height: 26rem; margin-top: 1.35rem; padding: 1.5rem; border-radius: .9rem; background-color: #2a1029; background-image: linear-gradient(rgba(241, 116, 158, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(241, 116, 158, .08) 1px, transparent 1px); background-size: 18px 18px; }
.preview > p { color: #efc8d7; text-align: center; }
.preview svg { width: 100%; max-width: 100%; max-height: 24rem; }
.preview svg path { stroke: #f1749e; stroke-width: .55; vector-effect: non-scaling-stroke; }
.preview-note { margin: 1rem 0 0; color: #efc8d7; font-size: .8rem; line-height: 1.45; }
@media (max-width: 760px) { .app-shell { width: min(100% - 1.5rem, 42rem); padding: 2rem 0 2.5rem; } .workspace { grid-template-columns: 1fr; } .preview { min-height: 20rem; } }
