@font-face { font-family: "Montserrat"; font-weight: 700; src: url("./fonts/Montserrat_700Bold.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Montserrat"; font-weight: 800; src: url("./fonts/Montserrat_800ExtraBold.ttf") format("truetype"); font-display: swap; }

:root {
  --wall: #ebe7e1;
  --wall-2: #dfd9d1;
  --ink: #17171a;
  --ink-2: #55534f;
  --ink-3: #8c8984;
  --card: #ffffff;
  --line: #e6e2dc;
  --accent: #e2412c;
  --accent-ink: #ffffff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(23, 23, 26, .06), 0 8px 30px rgba(23, 23, 26, .06);
  --display: "Montserrat", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--wall); color: var(--ink); font: 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }

.top { display: flex; align-items: baseline; gap: 16px; padding: 18px 28px 0; }
.brand { font: 800 15px/1 var(--display); letter-spacing: .18em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.tag { color: var(--ink-3); font-size: 13px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; padding: 18px 28px 28px; height: calc(100vh - 52px); min-height: 640px; }

/* ---------- podium ---------- */
.stage { position: relative; border-radius: 20px; overflow: hidden; background: radial-gradient(120% 90% at 50% 35%, #f4f1ec 0%, var(--wall) 55%, var(--wall-2) 100%); }
#view { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s; touch-action: none; }
.stage.has-model #view { opacity: 1; }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; gap: 14px; }
.stage.has-model .empty { display: none; }
.empty h1 { font: 800 clamp(28px, 3.4vw, 44px)/1.08 var(--display); margin: 8px 0 0; letter-spacing: -.01em; }
.empty h1 em { font-style: normal; color: var(--accent); }
.empty p { max-width: 440px; color: var(--ink-2); margin: 0 0 10px; }
.empty small { color: var(--ink-3); }
.empty-art svg { width: 96px; height: 120px; filter: drop-shadow(0 18px 18px rgba(0,0,0,.18)); }
.empty-art rect { fill: #1b1b1c; }
.empty-art rect.inner { fill: #2a2a2d; }
.empty-art path { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linejoin: round; }
.stage.dragging { outline: 3px dashed var(--accent); outline-offset: -12px; }
.drop-hint { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font: 800 22px var(--display); background: rgba(235,231,225,.8); }
.stage.dragging .drop-hint { display: flex; }

.hud { position: absolute; top: 16px; left: 16px; }
.status, .dims { position: absolute; bottom: 16px; background: rgba(255,255,255,.86); backdrop-filter: blur(8px); border-radius: 999px; padding: 8px 14px; font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; }
.status { left: 16px; }
.dims { right: 16px; font-variant-numeric: tabular-nums; }
.status[hidden], .dims[hidden], .hud[hidden] { display: none; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.status.warn .spin { animation: none; border-color: #e0a100; }
.status.done .spin { animation: none; border-color: #2e9e5b; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- paneel ---------- */
.panel { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); overflow-y: auto; padding: 8px 22px 22px; scrollbar-width: thin; }
.step { border: 0; margin: 0; padding: 18px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.step:disabled { opacity: .42; }
.step h2 { font: 800 12px/1 var(--display); letter-spacing: .16em; text-transform: uppercase; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.step h2 span { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font-size: 11px; letter-spacing: 0; }
.file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.muted { color: var(--ink-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.routeinfo { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.routeinfo div { background: #f6f4f1; border-radius: 10px; padding: 9px 10px; }
.routeinfo b { display: block; font: 800 15px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.routeinfo small { color: var(--ink-3); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }

.field { display: block; margin-bottom: 10px; min-width: 0; }
.field span { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 4px; }
.field input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfaf8; outline: none; transition: border-color .15s, background .15s; font-weight: 600; letter-spacing: .02em; }
.field input.caps { text-transform: uppercase; }
.field input:focus { border-color: var(--ink); background: #fff; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.row3 .field { margin-bottom: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 10px 18px; font: 600 14px var(--display); cursor: pointer; transition: transform .1s, background .15s, box-shadow .15s; }
.btn:hover { background: #f6f4f1; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #2c2c30; }
.btn.big { padding: 15px 26px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.download .btn.primary:not(:disabled) { background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 24px rgba(226,65,44,.28); }
.fine { font-size: 12px; color: var(--ink-3); text-align: center; margin: 10px 0 0; }
.download { border-bottom: 0; }

.seg { display: flex; background: #f3f1ed; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 10px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 10px 6px; cursor: pointer; font: 600 14px var(--display); color: var(--ink-2); transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg button:disabled { opacity: .35; cursor: not-allowed; }
.seg.small button { padding: 7px 6px; font-size: 12.5px; }
.hud .seg { background: rgba(255,255,255,.7); backdrop-filter: blur(8px); margin: 0; box-shadow: var(--shadow); }
.hud .seg button { padding: 7px 14px; }

.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.preset { border: 2px solid transparent; background: #f6f4f1; border-radius: 12px; padding: 8px 6px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.preset.on { border-color: var(--ink); background: #fff; color: var(--ink); }
.mini { width: 46px; height: 58px; border-radius: 3px; padding: 6px; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.mini i { display: block; width: 100%; height: 100%; border-radius: 1px; position: relative; overflow: hidden; }
.mini i::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(35deg, transparent 0 5px, var(--d) 5px 6px); opacity: .55; }
.mini i::after { content: ""; position: absolute; left: 30%; top: 18%; width: 38%; height: 46%; border: 2.5px solid var(--r); border-radius: 40% 55% 45% 50%; }
.mini i { box-shadow: inset 0 -9px 0 -6px var(--t); }

.custom { margin-top: 12px; }
summary { cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
summary::-webkit-details-marker { display: none; }
summary::before { content: "+"; width: 18px; height: 18px; border-radius: 50%; background: #f3f1ed; display: inline-grid; place-items: center; font-size: 13px; }
details[open] > summary::before { content: "–"; }
.swrow { margin-top: 12px; }
.swrow > span { font-size: 12px; color: var(--ink-3); display: block; margin-bottom: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); position: relative; }
.sw.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }

.more { padding-top: 14px; }
.opt { margin-top: 12px; }
.optlabel { font-size: 12px; color: var(--ink-3); display: block; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; height: auto; padding: 12px 16px 24px; gap: 16px; }
  .stage { height: 62vh; min-height: 420px; }
  .top { padding: 14px 16px 0; }
  .tag { display: none; }
  .presets { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.fine a { color: inherit; }
