/* ============================================================
   Cellholder Generator — design system
   ============================================================ */

:root {
  --bg: #070a0f;
  --surface: #0d121a;
  --surface-2: #101825;
  --surface-3: #16202e;
  --line: #1c2836;
  --line-soft: #16202c;
  --text: #dbe4ef;
  --text-dim: #7f8fa3;
  --text-faint: #556374;
  --accent: #2fe3bd;
  --accent-2: #6ea8ff;
  --accent-3: #b98cff;
  --warn: #ffb545;
  --error: #ff6b6b;
  --ok: #3ddc84;

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;

  --r-sm: 6px;
  --r: 9px;
  --r-lg: 14px;
  --topbar-h: 54px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --line: #dbe3ed;
  --line-soft: #e7edf4;
  --text: #16202c;
  --text-dim: #5d6b7d;
  --text-faint: #8b98a8;
  --accent: #0aa88a;
  --accent-2: #2f6fdb;
  --accent-3: #8558d6;
  --warn: #b8730a;
  --error: #d13b3b;
  --ok: #1f9e5a;
  --shadow: 0 10px 30px rgba(24, 40, 64, 0.12);
}

* { box-sizing: border-box; }

/* A class that sets `display` beats the UA rule for [hidden], which silently
   breaks anything toggled by the attribute. Make the attribute win. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Ambient glow behind everything. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(60rem 40rem at 12% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    radial-gradient(50rem 36rem at 92% 6%, color-mix(in srgb, var(--accent-2) 8%, transparent), transparent 60%);
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }

button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* ============================================================
   Topbar
   ============================================================ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-glyph { width: 22px; height: 22px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.brand-name { font-family: var(--mono); font-size: 14.5px; letter-spacing: -0.2px; font-weight: 500; }
.brand-name b { color: var(--accent); font-weight: 700; }
.brand-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 7px;
}

.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-actions .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.icon-btn:disabled { opacity: .32; cursor: default; }

.ghost-btn {
  display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 12.5px;
  transition: color .15s, border-color .15s;
}
.ghost-btn:hover { color: var(--accent); border-color: var(--accent); }

kbd {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ============================================================
   Workspace layout
   ============================================================ */

.workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 322px minmax(0, 1fr) 288px;
  gap: 1px;
  background: var(--line);
  height: calc(100vh - var(--topbar-h));
  min-height: 620px;
}

.sidebar, .inspector {
  background: var(--surface);
  overflow-y: auto;
  padding: 14px;
}

.viewport {
  background: var(--surface);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
}

/* ============================================================
   Sidebar
   ============================================================ */

.preset-bar { display: flex; gap: 8px; margin-bottom: 14px; }
.preset-bar select { flex: 1; }

.acc { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }

.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  background: var(--surface-2);
  border: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
}
.acc-head i { margin-left: auto; font-style: normal; color: var(--text-faint); transition: transform .2s; }
.acc.open .acc-head i { transform: rotate(180deg); }
.acc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); transition: background .2s; }
.acc.open .acc-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.acc-body { display: none; padding: 13px 12px 15px; border-top: 1px solid var(--line); }
.acc.open .acc-body { display: block; }

.field { margin-bottom: 11px; }
.field:last-child { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 11px; }
.grid2 .field { margin-bottom: 0; }
.grid2.disabled, #tabFields.disabled { opacity: .38; pointer-events: none; }

.note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-faint);
}
.note b { color: var(--text-dim); font-weight: 600; }

label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}
label em { font-style: normal; color: var(--text-faint); font-family: var(--mono); font-size: 10px; }

input[type="number"], input[type="text"], select {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
select { cursor: pointer; padding-right: 6px; }
input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Segmented control */
.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
  padding: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.segmented.wrap {
  grid-auto-flow: row;
  grid-template-columns: 1fr 1fr;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 550;
  padding: 6px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.on {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

/* Sliders */
.field.slider label { justify-content: space-between; }
.field.slider output { font-family: var(--mono); font-size: 10.5px; color: var(--accent); }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 3px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--accent);
  cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  cursor: grab;
}

/* Checkboxes */
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
.check:last-child { margin-bottom: 0; }
.check input { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }

/* Buttons */
.btn {
  height: 33px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--accent-2); color: var(--accent-2); }
.btn.block { width: 100%; }
.btn.primary {
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 80%, #000));
  color: #04241d;
  border-color: transparent;
  font-weight: 700;
  height: 38px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary em {
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  opacity: .65;
}
.btn.primary:hover {
  filter: brightness(1.08);
  color: #04241d;
  box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn.tiny { height: 24px; padding: 0 10px; font-size: 11px; }
.btn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 8px; }
.btn-row + .btn { margin-top: 8px; }
.acc-body > .btn.block + .btn-row { margin-top: 9px; }

/* ============================================================
   Viewport
   ============================================================ */

.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.tabs { display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; }

.pin-table {
  width: 100%;
  max-width: 380px;
  border-collapse: collapse;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 12px;
}
.pin-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
}
.pin-table td {
  padding: 5px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-dim);
}
.pin-table td:first-child { color: var(--accent); width: 48px; }
.pin-table.wide { max-width: 100%; }
.pin-table.wide td:first-child { color: var(--text); width: auto; }
.pin-table tr.pick td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pin-table tr.pick td:first-child { color: var(--accent); font-weight: 600; }

.tag {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 20px;
  white-space: nowrap;
}
.tag.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.tag.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.tag.bad { color: var(--error); background: color-mix(in srgb, var(--error) 14%, transparent); }

/* diagrams */
.dia {
  display: block;
  width: 100%;
  max-width: 660px;
  height: auto;
  margin: 16px 0 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
}
.fig { font-size: 11.5px; color: var(--text-faint); margin: 0 0 4px; font-style: italic; }
.dia.weldmap { background: var(--surface-2); max-width: 720px; }
.weld-steps { margin-top: 12px; }
.weld-steps li { margin-bottom: 7px; }
#weldMapHost .btn.block { max-width: 280px; margin-top: 12px; }

/* build steps */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; }
.step-n {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: var(--r-sm);
  padding: 6px 0;
  text-align: center;
}
.step h4 { font-size: 14px; margin: 2px 0 5px; }
.step p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.55; }

.a-block h4 { font-size: 14px; margin: 20px 0 7px; color: var(--text); }
.a-list { margin: 0 0 8px; padding-left: 18px; }
.a-list li { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 5px; }
.a-list b { color: var(--text); }

/* insulation catalogue */
.ins-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 4px 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.ins-name { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.ins-items { font-family: var(--mono); font-size: 11.5px; color: var(--text-dim); }
.ins-use { grid-column: 2; font-size: 12px; color: var(--text-faint); line-height: 1.5; }
@media (max-width: 640px) {
  .ins-row { grid-template-columns: 1fr; }
  .ins-use { grid-column: 1; }
}
.tab {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px;
  font-weight: 550;
  padding: 6px 13px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-3); color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }

.tabbar-tools { display: flex; align-items: center; gap: 10px; }
.hint { font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }

.panes { position: relative; min-height: 0; }
.pane { position: absolute; inset: 0; display: none; }
.pane.active { display: block; }
.pane.scrollable { overflow-y: auto; }
.pane canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }

#pane2d {
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 40px 40px;
}
#pane3d {
  background:
    radial-gradient(70% 60% at 50% 40%, color-mix(in srgb, var(--accent-2) 7%, transparent), transparent 70%),
    var(--surface);
}

.gl-fallback {
  position: absolute;
  inset: auto 0 50% 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 0 40px;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 14px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: nowrap;
}
.statusbar .st b { color: var(--accent); font-weight: 600; }
.statusbar .st.dim { color: var(--text-faint); margin-left: auto; }
.statusbar .st.dim b { color: var(--text-faint); }

/* ============================================================
   Inspector
   ============================================================ */

.insp-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.warn-host { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.warn {
  font-size: 11.5px;
  line-height: 1.45;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border-left: 2px solid;
}
.warn.ok { color: var(--ok); border-color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, transparent); }
.warn.info { color: var(--accent-2); border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 9%, transparent); }
.warn.warn { color: var(--warn); border-color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.warn.error { color: var(--error); border-color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }

.stat-group { margin-bottom: 16px; }
.stat-group h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.srow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
}
.sk { color: var(--text-dim); }
.sv { font-family: var(--mono); font-size: 12px; color: var(--text); text-align: right; }
.sv.accent { color: var(--accent); font-weight: 600; }

/* ============================================================
   Analysis pane
   ============================================================ */

.analysis { padding: 20px; max-width: 1000px; }
.a-block { margin-bottom: 26px; }
.a-block h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
}
.a-block h3 span { color: var(--text-faint); text-transform: none; letter-spacing: 0; font-weight: 400; }

.a-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.a-stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
}
.a-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-faint); margin-bottom: 6px; }
.a-v { font-family: var(--mono); font-size: 21px; font-weight: 600; color: var(--accent); line-height: 1.15; }
.a-v em { font-style: normal; font-size: 12px; color: var(--text-dim); margin-left: 4px; font-weight: 400; }
.a-sub { font-size: 11px; color: var(--text-faint); margin-top: 5px; }

.calc-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.calc-row .field { margin-bottom: 0; }
.a-v.muted { color: var(--text-faint); }
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  margin-right: 6px;
  vertical-align: 1px;
}
.badge.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }

.a-note { font-size: 13px; color: var(--text-dim); margin: 0 0 8px; line-height: 1.55; }
.a-note b { color: var(--text); }
.a-note.bad { color: var(--warn); }
.a-groups { font-family: var(--mono); font-size: 12px; color: var(--text-faint); margin: 0; }

/* ============================================================
   Docs
   ============================================================ */

.docs { position: relative; z-index: 1; border-top: 1px solid var(--line); background: var(--surface); padding: 72px 24px; }
.docs-inner { max-width: 1040px; margin: 0 auto; }
.docs h2 { font-size: 26px; margin-bottom: 14px; }
.docs-lede { color: var(--text-dim); font-size: 15px; max-width: 720px; margin: 0 0 34px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 16px; }
.card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.card-num { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.1em; }
.card h3 { font-size: 15px; margin: 9px 0 7px; }
.card p { margin: 0; color: var(--text-dim); font-size: 13px; }
.docs-foot { margin: 32px 0 0; color: var(--text-faint); font-size: 12.5px; }
.docs.alt { background: var(--surface-2); }

/* about & contact */
.about-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.about-story p { color: var(--text-dim); font-size: 14.5px; line-height: 1.7; margin: 0 0 14px; max-width: 62ch; }
.about-story em { color: var(--text); font-style: italic; }
.about-sign { color: var(--text-faint) !important; font-size: 13px !important; font-style: italic; margin-top: 20px !important; }

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}
.contact-card h3 { font-size: 16px; margin-bottom: 10px; }
.contact-intro { color: var(--text-dim); font-size: 13px; line-height: 1.6; margin: 0 0 18px; }
.contact-list { display: grid; grid-template-columns: 68px 1fr; gap: 10px 14px; margin: 0 0 18px; align-items: baseline; }
.contact-list dt {
  font-family: var(--mono); font-size: 10.5px; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--text-faint);
}
.contact-list dd { margin: 0; font-size: 13.5px; }
.contact-list a { color: var(--accent); text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.soon {
  display: inline-block;
  font-size: 11.5px;
  color: var(--text-dim);
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
}

.contact-offer {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.contact-offer b { color: var(--text); }
.contact-note {
  margin: 0; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-faint); line-height: 1.6;
}
.contact-note b { color: var(--text-dim); }

@media (max-width: 820px) {
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}

.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 22px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
  background: var(--bg);
}
.footer .dot { margin: 0 8px; opacity: .4; }

/* ============================================================
   Modals, palette, toasts
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 11, 0.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding-top: 14vh;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(560px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.palette-card { padding: 10px; }
#paletteInput {
  height: 42px;
  font-size: 14px;
  font-family: var(--sans);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
#paletteInput:focus { box-shadow: none; border-color: var(--accent); }
.palette-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 46vh; overflow-y: auto; }
.palette-list li {
  padding: 9px 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}
.palette-list li.sel, .palette-list li:hover { background: var(--surface-3); color: var(--accent); }
.palette-list li.empty { color: var(--text-faint); cursor: default; }
.palette-list li.empty:hover { background: transparent; color: var(--text-faint); }

.modal-card h3 { font-size: 15px; margin-bottom: 16px; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; margin: 0; align-items: center; }
.shortcuts dt { display: flex; gap: 4px; }
.shortcuts dd { margin: 0; color: var(--text-dim); font-size: 12.5px; }
.modal-foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-faint); font-size: 12px; }

.toast-host {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.toast.in { opacity: 1; transform: translateY(0); }
.toast.ok { border-color: var(--ok); color: var(--ok); }
.toast.warn { border-color: var(--warn); color: var(--warn); }
.toast.error { border-color: var(--error); color: var(--error); }

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 300px minmax(0, 1fr); }
  .inspector { display: none; }
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .sidebar { order: 2; overflow: visible; max-height: none; }
  .viewport { order: 1; height: 68vh; min-height: 420px; }
  .brand-tag, .ghost-btn span { display: none; }
  .hint { display: none; }
  .docs { padding: 48px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
