/* CDE3's own minimal stylesheet -- independent build pipeline from the root Preact app and from
   CDE2, but reuses the same palette tokens as apps/cde2-leptos/styles/app.css for visual continuity
   across this repo's three viewer variants (--ink/--paper/--accent/--line/--muted/--dark are the
   same hex values there and in src/styles.css's :root). Layout/structure is CDE3's own -- this DOM
   is simpler than CDE2's (no identity bar, no grouping tables, no draft/save panels), so those rules
   are not ported. */

:root {
  --ink: #202520;
  --paper: #fbfbf8;
  --accent: #be4127;
  --line: #d6dad3;
  --muted: #6b756e;
  --dark: #1d2725;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.shell { max-width: 960px; margin: 0 auto; padding: 0 0 48px; }

.experimental-banner {
  background: var(--dark);
  color: #ec7a5f;
  text-align: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

main { padding: 24px 20px; }

h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 20px 0 8px; }

.lede { color: var(--muted); max-width: 60ch; }

.hint { color: var(--muted); font-size: 12px; font-style: italic; }

section {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.open-file { display: flex; flex-direction: column; gap: 6px; }
.open-file label { font-size: 12px; font-weight: 700; color: var(--muted); }

.status-ok { color: #1a7a4c; font-weight: 600; }
.status-err { color: var(--accent); font-weight: 600; white-space: pre-wrap; }
.status-warn { color: #8a5a00; font-weight: 600; white-space: pre-wrap; }

.summary .file-name { font-weight: 600; }

/* The canvas is styled directly (no separate `.viewer-canvas` wrapper div in this app's simpler
   DOM -- see apps/cde2-leptos/styles/app.css's own comment on why CDE2 needs that wrapper for its
   ResizeObserver; CDE3's canvas is a fixed width/height attribute pair, not observer-driven, so a
   wrapper box is not needed here). */
.viewer canvas {
  display: block;
  max-width: 100%;
  background: #10120f;
  border-radius: 6px;
  touch-action: none;
}

.storeys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 8px 0 0;
}

.storeys label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}

.models-list {
  display: grid;
  gap: 8px;
}

.model-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, auto) auto auto;
  align-items: center;
  gap: 8px 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.model-row label {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.model-select {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-stats {
  color: var(--muted);
  font-size: 12px;
}

.appearance-summary { font-size: 12px; }

button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .model-row { grid-template-columns: 1fr 1fr; }
  .model-stats { grid-column: 1 / -1; }
}
