/* ===========================================================================
   3D Tensile Structure Designer
   ---------------------------------------------------------------------------
   Standalone. Every selector is prefixed .dz- and nothing here is loaded by
   any other page, so this file and css/site.min.css cannot reach each other.
   =========================================================================== */

:root {
  --dz-bg: #0d1117;
  --dz-panel: #151b24;
  --dz-panel-2: #1b2430;
  --dz-line: #26303d;
  --dz-ink: #e8edf4;
  --dz-ink-soft: #94a3b4;
  --dz-accent: #2a9fd6;
  --dz-accent-deep: #1a6b92;
  --dz-gold: #c7a24b;
  --dz-ok: #3fb27f;
  --dz-radius: 9px;
  --dz-bar: 52px;
  --dz-side: 300px;
  --dz-right: 310px;
  --dz-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --dz-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--dz-bg);
  color: var(--dz-ink);
  font-family: var(--dz-font);
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
}

.dz-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--dz-accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--dz-radius) 0;
}
.dz-skip:focus { left: 0; }

/* ---------- app grid ---------- */
.dz-app {
  display: grid;
  grid-template-columns: var(--dz-side) 1fr var(--dz-right);
  grid-template-rows: var(--dz-bar) 1fr;
  grid-template-areas: "bar bar bar" "side stage panel";
  height: 100dvh;
  min-height: 100dvh;
}

/* ---------- toolbar ---------- */
.dz-bar {
  grid-area: bar;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 14px;
  background: var(--dz-panel);
  border-bottom: 1px solid var(--dz-line);
  overflow-x: auto;
  scrollbar-width: thin;
}
.dz-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--dz-ink);
  white-space: nowrap;
  padding-right: 8px;
  border-right: 1px solid var(--dz-line);
  margin-right: 2px;
}
.dz-brand-mark { color: var(--dz-accent); font-size: 1.3rem; line-height: 1; }
.dz-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.dz-brand-text strong { font-size: .86rem; letter-spacing: .01em; }
.dz-brand-text em {
  font-style: normal;
  font-size: .68rem;
  color: var(--dz-ink-soft);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.dz-bar-group { display: flex; gap: 4px; align-items: center; }
.dz-bar-end { margin-left: auto; }

.dz-tool {
  appearance: none;
  background: transparent;
  color: var(--dz-ink-soft);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 10px;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.dz-tool:hover:not(:disabled) { background: var(--dz-panel-2); color: var(--dz-ink); }
.dz-tool:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 1px; }
.dz-tool:disabled { opacity: .35; cursor: not-allowed; }
.dz-tool.is-on { background: var(--dz-accent-deep); color: #fff; border-color: var(--dz-accent); }

/* ---------- side panels ---------- */
.dz-side, .dz-panel {
  background: var(--dz-panel);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--dz-line) transparent;
}
.dz-side { grid-area: side; border-right: 1px solid var(--dz-line); }
.dz-panel { grid-area: panel; border-left: 1px solid var(--dz-line); }

.dz-sec { padding: 16px 16px 18px; border-bottom: 1px solid var(--dz-line); }
.dz-h {
  margin: 0 0 12px;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dz-ink-soft);
  font-weight: 700;
}

/* ---------- structure picker ---------- */
.dz-forms { display: grid; gap: 6px; }
.dz-form {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: var(--dz-panel-2);
  border: 1px solid var(--dz-line);
  border-radius: var(--dz-radius);
  color: var(--dz-ink);
  padding: 9px 11px;
  font: inherit;
  font-size: .84rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dz-form:hover { border-color: var(--dz-accent-deep); }
.dz-form:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 1px; }
.dz-form[aria-checked="true"] {
  border-color: var(--dz-accent);
  background: linear-gradient(180deg, rgba(42, 159, 214, .16), rgba(42, 159, 214, .06));
}
.dz-form svg { flex: 0 0 30px; width: 30px; height: 24px; }
.dz-form span { line-height: 1.25; }

/* ---------- fields ---------- */
.dz-field { margin-bottom: 13px; }
.dz-field:last-of-type { margin-bottom: 0; }
.dz-field label, .dz-lab {
  display: block;
  font-size: .78rem;
  color: var(--dz-ink-soft);
  margin-bottom: 5px;
}
.dz-unit { color: #5d6b7d; font-size: .72rem; }

.dz-range { display: flex; align-items: center; gap: 9px; }
.dz-range input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: var(--dz-accent);
  height: 3px;
  cursor: pointer;
}
.dz-range input[type="number"] {
  width: 68px;
  flex: 0 0 68px;
  background: var(--dz-bg);
  border: 1px solid var(--dz-line);
  border-radius: 6px;
  color: var(--dz-ink);
  padding: 6px 7px;
  font: inherit;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.dz-range input[type="number"]:focus-visible,
select:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 1px; }
.dz-range input[type="number"].is-bad { border-color: #d9534f; }

select {
  width: 100%;
  background: var(--dz-bg);
  border: 1px solid var(--dz-line);
  border-radius: 6px;
  color: var(--dz-ink);
  padding: 8px 9px;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
}
select:disabled { opacity: .4; cursor: not-allowed; }

.dz-field.is-off { opacity: .38; pointer-events: none; }

.dz-note {
  margin: 10px 0 0;
  font-size: .73rem;
  line-height: 1.45;
  color: #6f7d8f;
  min-height: 1em;
}

/* ---------- swatches ---------- */
.dz-sw { display: flex; flex-wrap: wrap; gap: 7px; }
.dz-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--dz-line);
  cursor: pointer;
  padding: 0;
  transition: transform .12s, border-color .12s;
}
.dz-chip:hover { transform: scale(1.08); }
.dz-chip:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 2px; }
.dz-chip[aria-checked="true"] { border-color: var(--dz-accent); box-shadow: 0 0 0 2px rgba(42,159,214,.3); }

/* ---------- toggles ---------- */
.dz-toggles { display: grid; gap: 8px; }
.dz-chk { display: flex; align-items: center; gap: 9px; font-size: .82rem; cursor: pointer; }
.dz-chk input { accent-color: var(--dz-accent); width: 15px; height: 15px; cursor: pointer; }

/* ---------- stage ---------- */
.dz-stage { grid-area: stage; position: relative; min-width: 0; min-height: 0; background: #0a0e14; }
.dz-canvas-wrap { position: absolute; inset: 0; overflow: hidden; }
.dz-canvas-wrap canvas { display: block; width: 100%; height: 100%; }

.dz-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #0a0e14;
  z-index: 5;
  color: var(--dz-ink-soft);
  font-size: .85rem;
  transition: opacity .25s;
}
.dz-loading.is-done { opacity: 0; pointer-events: none; }
.dz-spin {
  width: 32px;
  height: 32px;
  border: 2px solid var(--dz-line);
  border-top-color: var(--dz-accent);
  border-radius: 50%;
  animation: dzspin .8s linear infinite;
}
@keyframes dzspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dz-spin { animation-duration: 2.4s; } }

.dz-fail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
  background: #0a0e14;
  z-index: 6;
}
/* an author `display` beats the UA's [hidden] rule, so the attribute alone
   would not hide this box - it showed over a perfectly good canvas. */
.dz-fail[hidden] { display: none; }
.dz-fail h2 { margin: 0; font-size: 1.1rem; }
.dz-fail p { margin: 0; color: var(--dz-ink-soft); font-size: .86rem; max-width: 42ch; line-height: 1.6; }
.dz-fail a { color: var(--dz-accent); }

.dz-hud {
  position: absolute;
  left: 12px;
  top: 12px;
  font-family: var(--dz-mono);
  font-size: .68rem;
  color: #5f7083;
  pointer-events: none;
  line-height: 1.6;
  text-shadow: 0 1px 2px #000;
}
.dz-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  margin: 0;
  font-size: .72rem;
  color: #55657a;
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- right panel ---------- */
.dz-ref { margin: 0 0 10px; font-size: .78rem; color: var(--dz-ink-soft); }
.dz-ref strong { font-family: var(--dz-mono); color: var(--dz-gold); letter-spacing: .04em; }

.dz-spec { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: .8rem; }
.dz-spec dt { color: var(--dz-ink-soft); }
.dz-spec dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.dz-blurb { margin: 0; font-size: .8rem; line-height: 1.6; color: #9fadbe; }

.dz-acts { display: grid; gap: 7px; margin-bottom: 10px; }
.dz-btn {
  appearance: none;
  width: 100%;
  background: var(--dz-panel-2);
  border: 1px solid var(--dz-line);
  border-radius: 7px;
  color: var(--dz-ink);
  padding: 10px 12px;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dz-btn:hover { background: #222d3b; border-color: var(--dz-accent-deep); }
.dz-btn:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 1px; }
.dz-btn:disabled { opacity: .5; cursor: progress; }
.dz-btn-primary {
  background: var(--dz-accent-deep);
  border-color: var(--dz-accent);
  color: #fff;
  font-weight: 600;
}
.dz-btn-primary:hover { background: var(--dz-accent); }
.dz-btn.is-ok { background: var(--dz-ok); border-color: var(--dz-ok); color: #06240f; }

.dz-disc p { margin: 0 0 9px; font-size: .74rem; line-height: 1.6; color: #7f8d9e; }
.dz-disc p:last-child { margin-bottom: 0; }
.dz-disc strong { color: #a9b6c6; }

/* ---------- quote dialog ---------- */
.dz-modal {
  border: 1px solid var(--dz-line);
  border-radius: 12px;
  background: var(--dz-panel);
  color: var(--dz-ink);
  padding: 0;
  width: min(460px, 94vw);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.dz-modal::backdrop { background: rgba(4, 7, 11, .72); }
.dz-qf { padding: 22px; display: grid; gap: 4px; }
.dz-qf h2 { margin: 0 0 4px; font-size: 1.05rem; }
.dz-qf-sum {
  margin: 0 0 14px;
  font-size: .76rem;
  line-height: 1.55;
  color: var(--dz-ink-soft);
  background: var(--dz-bg);
  border: 1px solid var(--dz-line);
  border-radius: 7px;
  padding: 9px 11px;
}
.dz-qf-l { font-size: .76rem; color: var(--dz-ink-soft); margin-top: 8px; }
.dz-qf-i {
  width: 100%;
  background: var(--dz-bg);
  border: 1px solid var(--dz-line);
  border-radius: 6px;
  color: var(--dz-ink);
  padding: 9px 10px;
  font: inherit;
  font-size: .85rem;
  resize: vertical;
}
.dz-qf-i:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 1px; }
.dz-qf-i:invalid:not(:placeholder-shown) { border-color: #d9534f; }
.dz-qf-note { margin: 14px 0 4px; font-size: .72rem; line-height: 1.55; color: #6f7d8f; }
.dz-qf-acts { display: flex; gap: 8px; margin-top: 12px; }
.dz-qf-acts .dz-btn { width: auto; flex: 1; }
.dz-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.dz-noscript { padding: 50px 22px; max-width: 60ch; margin: 0 auto; line-height: 1.7; }
.dz-noscript a { color: var(--dz-accent); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  :root { --dz-side: 264px; --dz-right: 268px; }
  .dz-tool-l { display: none; }
}

@media (max-width: 960px) {
  .dz-app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 56vh auto auto;
    grid-template-areas: "bar" "stage" "side" "panel";
    height: auto;
    min-height: 100dvh;
  }
  .dz-side, .dz-panel {
    border: 0;
    border-top: 1px solid var(--dz-line);
    overflow: visible;
  }
  .dz-stage { min-height: 56vh; }
  .dz-bar { position: sticky; top: 0; z-index: 20; }
  .dz-hint { font-size: .66rem; }
}

@media (max-width: 560px) {
  .dz-sec { padding: 14px 13px 16px; }
  .dz-brand-text em { display: none; }
  .dz-range input[type="number"] { width: 60px; flex-basis: 60px; }
}

/* ---------- run the retractable roof ---------- */
.dz-runrow {
  display: flex;
  align-items: stretch;   /* the select is 2px taller than the button's text box */
  gap: 8px;
  margin-top: 9px;
}
.dz-run {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  background: var(--dz-panel-2);
  border: 1px solid var(--dz-line);
  border-radius: 7px;
  color: var(--dz-ink);
  padding: 8px 10px;
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.dz-run:hover:not(:disabled) { background: #222d3b; border-color: var(--dz-accent-deep); }
.dz-run:focus-visible { outline: 2px solid var(--dz-accent); outline-offset: 1px; }
.dz-run:disabled { opacity: .5; cursor: not-allowed; }
.dz-run.is-on {
  background: var(--dz-accent-deep);
  border-color: var(--dz-accent);
  color: #fff;
}
.dz-run-i { font-size: .72em; line-height: 1; }
.dz-runrow select { width: auto; flex: 0 0 88px; padding: 8px 6px; }
