:root {
  color-scheme: dark;
  --bg: #0d0f10;
  --panel: #151819;
  --panel-2: #1b1f20;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.15);
  --text: #f3f5f4;
  --muted: #8f9996;
  --green: #7dc244;
  --green-2: #7dc244;
  --green-ink: #0d1508;
  --radius: 12px;
  --topbar: 66px;
  --sidebar-left: 292px;
  --sidebar-right: 298px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }

.app-shell { width: 100%; height: 100%; display: grid; grid-template-rows: var(--topbar) minmax(0,1fr); }
.topbar {
  display: grid;
  grid-template-columns: var(--sidebar-left) 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(15,17,18,.96);
  position: relative;
  z-index: 20;
}
.brand { height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 11px; border-right: 1px solid var(--line); }
.brand > div:last-child { display: flex; align-items: baseline; gap: 6px; letter-spacing: -.02em; }
.brand strong { font-size: 15px; font-weight: 680; }
.brand small { font-size: 8px; letter-spacing: .19em; color: var(--green); font-weight: 800; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(125,194,68,.32); border-radius: 8px; background: rgba(125,194,68,.08); }
.brand-mark svg { width: 19px; height: 19px; fill: var(--green); filter: drop-shadow(0 0 6px rgba(125,194,68,.2)); }

.file-pill { justify-self: center; min-width: 220px; max-width: min(460px, 45vw); height: 34px; padding: 0 12px; border: 1px solid var(--line); background: rgba(255,255,255,.035); border-radius: 8px; display: flex; align-items: center; gap: 9px; font-size: 12px; overflow: hidden; }
.file-pill > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-pill #fileName { color: #dce1df; }
.file-pill .file-meta { color: var(--muted); margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.status-dot { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(125,194,68,.1); }
.top-actions { display: flex; align-items: center; gap: 8px; padding-right: 14px; }

.button { height: 38px; border: 1px solid transparent; border-radius: 8px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 690; letter-spacing: -.01em; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button svg, .icon-button svg, .link-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.button.secondary { background: #222627; border-color: var(--line-strong); }
.button.secondary:hover { background: #292e2f; }
.button.primary { background: var(--green); color: var(--green-ink); box-shadow: inset 0 1px rgba(255,255,255,.25); }
.button.primary:hover { background: var(--green); filter: brightness(1.08); }

.workspace { min-height: 0; display: grid; grid-template-columns: var(--sidebar-left) minmax(320px,1fr) var(--sidebar-right); }
.panel { min-height: 0; background: var(--panel); position: relative; z-index: 10; display: flex; flex-direction: column; }
.left-panel { border-right: 1px solid var(--line); }
.right-panel { border-left: 1px solid var(--line); }
.panel-scroll { overflow-y: auto; min-height: 0; flex: 1; scrollbar-width: thin; scrollbar-color: #38403e transparent; }
.control-section { padding: 20px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: center; min-height: 22px; margin-bottom: 14px; color: #eef1f0; font-size: 11px; font-weight: 780; letter-spacing: .105em; text-transform: uppercase; }
.field-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 7px; }

.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 12px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid #8f9996; border-bottom: 1.5px solid #8f9996; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select, input[type="number"] { width: 100%; height: 36px; color: #e9eceb; background: #202425; border: 1px solid var(--line); border-radius: 7px; outline: none; }
select { appearance: none; padding: 0 32px 0 11px; font-size: 12px; cursor: pointer; }
select:focus, input[type="number"]:focus { border-color: rgba(125,194,68,.55); box-shadow: 0 0 0 3px rgba(125,194,68,.1); }

.control-row { margin-top: 17px; }
.control-row label { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.control-row output { color: #d5dad8; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 20px; margin: 7px 0 0; appearance: none; background: transparent; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--green) 0 var(--fill,50%), #39403e var(--fill,50%) 100%); border-radius: 5px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -5px; border-radius: 50%; background: #fff; border: 3px solid var(--green-2); box-shadow: 0 1px 5px #000; }

.icon-button { width: 26px; height: 26px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; border-radius: 6px; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.06); color: var(--text); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 8px; background: #202425; border: 1px solid rgba(255,255,255,.055); }
.segmented button { height: 29px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; cursor: pointer; }
.segmented button.active { background: #323839; color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.camera-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.text-button { height: 32px; color: #cbd1cf; border: 1px solid var(--line); background: transparent; border-radius: 7px; font-size: 10px; cursor: pointer; }
.text-button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.section-hint, .preset-count { color: #66706d; font-size: 8px; font-weight: 650; letter-spacing: .04em; text-transform: none; }
.angle-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.angle-grid button { min-width: 0; height: 52px; padding: 6px 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.018); color: #9da6a3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.angle-grid button i { width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; color: #dfe4e2; font-size: 11px; font-style: normal; }
.angle-grid button span { font-size: 8px; white-space: nowrap; }
.angle-grid button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.045); color: #fff; }
.angle-grid button.active { border-color: rgba(125,194,68,.55); background: rgba(125,194,68,.085); color: var(--green); }
.angle-grid button.active i { border-color: rgba(125,194,68,.35); color: var(--green); }
.preset-save-row { display: grid; grid-template-columns: 1fr 36px; gap: 6px; }
.preset-save-row input { width: 100%; height: 36px; padding: 0 10px; color: #e9eceb; background: #202425; border: 1px solid var(--line); border-radius: 7px; outline: none; font-size: 11px; }
.preset-save-row input:focus { border-color: rgba(125,194,68,.55); box-shadow: 0 0 0 3px rgba(125,194,68,.1); }
.preset-save-row button { width: 36px; height: 36px; border: 0; border-radius: 7px; background: var(--green); color: var(--green-ink); display: grid; place-items: center; cursor: pointer; }
.preset-save-row button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.preset-list { display: grid; gap: 5px; margin-top: 9px; }
.preset-empty { min-height: 42px; border: 1px dashed rgba(255,255,255,.08); border-radius: 7px; color: #68716f; display: grid; place-items: center; font-size: 9px; }
.preset-item { display: grid; grid-template-columns: minmax(0,1fr) 28px; align-items: center; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.018); overflow: hidden; }
.preset-apply { min-width: 0; padding: 8px 9px; border: 0; background: transparent; color: #dce1df; text-align: left; cursor: pointer; }
.preset-apply strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 650; }
.preset-apply small { display: block; color: #68716f; margin-top: 3px; font-size: 8px; text-transform: capitalize; }
.preset-apply:hover { background: rgba(255,255,255,.035); }
.preset-delete { width: 28px; height: 100%; border: 0; border-left: 1px solid var(--line); background: transparent; color: #626b68; cursor: pointer; display: grid; place-items: center; }
.preset-delete:hover { color: #ff8b7e; background: rgba(255,93,76,.06); }
.preset-delete svg { width: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.local-save-note { color: #596260; font-size: 8px; line-height: 1.45; margin: 9px 0 0; }

.swatches { display: flex; gap: 10px; margin-bottom: 19px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; outline: 1px solid rgba(255,255,255,.12); outline-offset: 2px; cursor: pointer; position: relative; }
.swatch.active::after { content: ""; position: absolute; inset: -5px; border: 1.5px solid var(--green); border-radius: 50%; }
.swatch.transparent { background-color: #eef1f0; background-image: linear-gradient(45deg,#b7bdbb 25%,transparent 25%),linear-gradient(-45deg,#b7bdbb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#b7bdbb 75%),linear-gradient(-45deg,transparent 75%,#b7bdbb 75%); background-size: 8px 8px; background-position: 0 0,0 4px,4px -4px,-4px 0; }
.swatch.cloud { background: #d8dcda; }
.swatch.white { background: #fff; }
.swatch.charcoal { background: #272b2c; }

.toggle-row { min-height: 35px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; cursor: pointer; position: relative; }
.toggle-row > span:first-child, .toggle-row > div { flex: 1; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-ui { width: 29px; height: 17px; flex: 0 0 auto; border-radius: 12px; background: #39403e; position: relative; transition: background .18s ease; }
.toggle-ui::after { content: ""; position: absolute; width: 11px; height: 11px; top: 3px; left: 3px; border-radius: 50%; background: #aeb6b3; transition: transform .18s ease, background .18s ease; }
.toggle-row input:checked + .toggle-ui { background: var(--green-2); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(12px); background: #fff; }
.privacy-note { min-height: 46px; padding: 0 20px; color: #6f7976; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-size: 10px; }
.privacy-note svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.stage { min-width: 0; min-height: 0; overflow: hidden; position: relative; background: #2b3030; isolation: isolate; }
.canvas-backdrop { position: absolute; inset: 0; z-index: -2; background: radial-gradient(circle at 50% 42%, #596160 0%, #343a39 44%, #222626 100%); }
#viewport { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: -1; cursor: grab; }
#viewport:active { cursor: grabbing; }
.drop-zone { position: absolute; inset: 12px; z-index: 5; display: grid; place-items: center; border: 1.5px dashed transparent; border-radius: 14px; background: transparent; opacity: 0; pointer-events: none; transition: opacity .18s, background .18s, border-color .18s; }
.drop-zone.visible { opacity: 1; background: rgba(13,15,16,.72); border-color: var(--green); backdrop-filter: blur(6px); }
.drop-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.drop-card strong { margin-top: 13px; font-size: 15px; }
.drop-card span { color: var(--muted); margin-top: 6px; font-size: 11px; }
.drop-icon { width: 54px; height: 54px; border-radius: 16px; background: var(--green); color: var(--green-ink); display: grid; place-items: center; box-shadow: 0 14px 35px rgba(0,0,0,.3); }
.drop-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.view-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); height: 30px; padding: 0 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 7px; background: rgba(16,18,19,.62); backdrop-filter: blur(8px); color: rgba(255,255,255,.6); display: flex; align-items: center; gap: 13px; font-size: 9px; pointer-events: none; }
.view-hint span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mouse-icon { width: 10px; height: 14px; border: 1px solid currentColor; border-radius: 5px; display: inline-block; position: relative; }
.mouse-icon::after { content: ""; position: absolute; left: 50%; top: 1px; width: 1px; height: 5px; background: currentColor; }
.mouse-icon.middle::after { height: 3px; width: 2px; transform: translateX(-1px); }
.scroll-icon { width: 7px; height: 13px; display: inline-block; border-left: 1px solid currentColor; border-right: 1px solid currentColor; }
.view-cube { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; transform: rotateX(-18deg) rotateY(28deg); transform-style: preserve-3d; opacity: .65; pointer-events: none; }
.cube-face { width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.38); background: rgba(17,20,20,.33); display: grid; place-items: center; font-size: 6px; letter-spacing: .08em; }
.render-status { position: absolute; top: 18px; left: 50%; transform: translate(-50%,-10px); display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(14,16,17,.85); padding: 9px 12px; border-radius: 8px; font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.render-status.show { opacity: 1; transform: translate(-50%,0); }
.spinner { width: 12px; height: 12px; border: 1.5px solid rgba(255,255,255,.2); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.format-badge { color: var(--green); font-size: 8px; border: 1px solid rgba(125,194,68,.3); border-radius: 4px; padding: 3px 5px; }
.dimensions { display: grid; grid-template-columns: 1fr 27px 1fr; gap: 6px; align-items: end; margin-top: 15px; }
.dimensions label { color: var(--muted); font-size: 10px; }
.dimensions input { margin-top: 6px; padding: 0 8px; font-variant-numeric: tabular-nums; }
.link-button { width: 27px; height: 36px; border: 0; background: transparent; color: #697270; display: grid; place-items: center; cursor: pointer; }
.link-button.active { color: var(--green); }
.export-summary { display: flex; justify-content: space-between; color: #697270; font-size: 9px; margin-top: 8px; }
.prominent-toggle { margin-top: 17px; padding: 11px; min-height: 56px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); color: #dce1df; }
.prominent-toggle small { display: block; color: var(--muted); font-size: 9px; margin-top: 3px; }
.export-footer { padding: 14px 16px 12px; border-top: 1px solid var(--line); background: #121516; }
.export-large { width: 100%; height: 49px; justify-content: flex-start; padding-left: 17px; }
.export-large > span { text-align: left; line-height: 1.1; }
.export-large small { display: block; font-size: 8px; font-weight: 600; opacity: .7; margin-top: 4px; letter-spacing: .02em; }
.batch-export { width: 100%; height: 43px; margin-top: 7px; justify-content: flex-start; padding-left: 17px; color: #dce1df; background: #222627; border-color: var(--line-strong); }
.batch-export:hover { background: #292e2f; }
.batch-export > span { text-align: left; line-height: 1.1; }
.batch-export small { display: block; color: var(--muted); font-size: 8px; font-weight: 550; margin-top: 4px; }
.export-footer button:disabled { opacity: .55; cursor: wait; transform: none; }
.export-footer p { text-align: center; color: #596260; font-size: 8px; margin: 8px 0 0; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translate(-50%,20px); opacity: 0; pointer-events: none; padding: 10px 14px; border-radius: 8px; background: #f3f6f5; color: #171a19; box-shadow: 0 12px 40px rgba(0,0,0,.35); font-size: 11px; font-weight: 650; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 1050px) {
  :root { --sidebar-left: 248px; --sidebar-right: 255px; }
  .control-section { padding: 17px; }
  .file-pill { min-width: 160px; }
  .button { padding: 0 11px; }
}
@media (max-width: 820px) {
  :root { --sidebar-left: 0px; --sidebar-right: 250px; }
  .topbar { grid-template-columns: 1fr auto; }
  .brand { border-right: 0; }
  .file-pill, .left-panel { display: none; }
  .workspace { grid-template-columns: minmax(0,1fr) var(--sidebar-right); }
}
@media (max-width: 620px) {
  :root { --topbar: 58px; }
  .topbar { grid-template-columns: 1fr auto; }
  .brand { padding: 0 12px; }
  .brand > div:last-child { display: none; }
  .top-actions { padding-right: 8px; }
  .top-actions .secondary { width: 38px; padding: 0; font-size: 0; }
  .top-actions .primary { display: none; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) 230px; }
  .right-panel { border-left: 0; border-top: 1px solid var(--line); }
  .right-panel .panel-scroll { display: none; }
  .export-footer { height: 100%; display: grid; align-content: center; padding: 20px; }
  .view-hint { display: none; }
}
