[hidden] { display: none !important; }
:root { --bg: #f6f6f4; --fg: #1b1b1b; --muted: #666; --card: #fff; --line: #ddd; --accent: #2d6cdf; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151515; --fg: #eee; --muted: #aaa; --card: #202020; --line: #333; --accent: #6b9cff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, sans-serif; background: var(--bg); color: var(--fg); }
section { max-width: 1200px; margin: 0 auto; padding: 16px; }
header { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
header h1, header h2 { margin: 0; flex: 1; font-size: 1.3rem; }
button, select, input, textarea { font: inherit; }
button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--fg); cursor: pointer; }
button[aria-pressed="true"], #renderBtn, #loginForm button { background: var(--accent); color: #fff; border-color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 12px; }
label { display: grid; gap: 4px; }
input, textarea, select { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); width: 100%; }
#login { display: grid; place-items: center; min-height: 80vh; }
#loginForm { width: min(360px, 100%); }
.drop { position: relative; display: grid; gap: 4px; place-items: center; text-align: center; padding: 32px 16px; border: 2px dashed var(--line); border-radius: 8px; cursor: pointer; }
.drop.over { border-color: var(--accent); }
.drop:focus-within { outline: 2px solid var(--accent); }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.drop small, #usage, #estimate, #renderList small { color: var(--muted); }
.grid { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid button { width: 100%; padding: 0; display: grid; text-align: left; overflow: hidden; }
.grid img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.grid span { padding: 8px; }
#stage { width: 100%; height: min(70vh, 640px); background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 8px; }
#stage > img, #stage img-comparison-slider { width: 100%; height: 100%; object-fit: contain; }
#stage img-comparison-slider img { width: 100%; height: 100%; object-fit: contain; }
#toggle { display: flex; gap: 8px; margin-bottom: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
#renderList { list-style: none; padding: 0; display: grid; gap: 8px; margin-top: 16px; }
#renderList li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
#renderList small { flex-basis: 100%; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 6px; }
