/* Quotruder — Conventional SaaS direction
   Indigo accent (configurable via --accent), soft shadows, rounded cards.
*/

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --subtle: #9ca3af;
  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow-md: 0 4px 12px rgba(17,24,39,.06);
  --radius: 12px;
  --radius-sm: 7px;
}

html.dark {
  --bg: #0b0d12;
  --surface: #13161d;
  --surface-2: #1a1e27;
  --border: #262b36;
  --text: #e6e8ee;
  --muted: #8b94a7;
  --subtle: #5f6779;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ─── App shell ─────────────────────────────────────────────────────── */

.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  height: 56px; padding: 0 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 24px;
  background: var(--surface);
  position: sticky; top: 0; z-index: 50;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; background: var(--accent);
  display: grid; place-items: center; color: #fff;
}
.brand-name { font-weight: 600; font-size: 15px; }

.tabs { display: flex; gap: 4px; margin-left: 12px; }
.tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 7px;
  color: var(--muted); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* Hamburger + drawer backdrop — hidden on desktop, revealed in the mobile media query */
.nav-toggle {
  display: none; appearance: none; border: 0; background: transparent;
  color: var(--text); cursor: pointer; padding: 6px; margin-left: -6px;
  border-radius: 7px; align-items: center; justify-content: center;
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-backdrop { display: none; }

.spacer { flex: 1; }

.theme-toggle-form { display: flex; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  appearance: none; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 7px; border-radius: 7px;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }

.main { flex: 1; padding: 24px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* ─── Icons ─────────────────────────────────────────────────────────── */

.icon { width: 16px; height: 16px; display: inline-block; vertical-align: middle; }
.icon-xs { width: 11px; height: 11px; }
.icon-lg { width: 22px; height: 22px; }
.icon-xl { width: 32px; height: 32px; }

/* ─── Cards & layout ────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-head h3 { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .01em; }

.cards { display: flex; flex-direction: column; gap: 16px; }

.calc-page { display: grid; gap: 20px; }
.calc-page.is-split { grid-template-columns: 1.4fr 1fr; align-items: start; }
.calc-page.is-single { grid-template-columns: 1fr; max-width: 780px; margin: 0 auto; }
.calc-side { position: sticky; top: 80px; }

@media (max-width: 980px) {
  .calc-page.is-split { grid-template-columns: 1fr; }
  .calc-side { position: static; }
}

/* ─── Forms ─────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; }
.field > span { color: var(--muted); font-weight: 500; }

.field input, .field select, .field textarea,
.input-suffix input, .input-suffix select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px; height: 34px; font-size: 13.5px;
  color: var(--text); outline: none; width: 100%;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder {
  color: var(--subtle); opacity: 1;
}
.field textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 60px; }
.field input:focus, .field select:focus, .field textarea:focus,
.input-suffix input:focus, .input-suffix select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.field input[type=color] { padding: 2px; height: 34px; cursor: pointer; }

.input-suffix {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 10px; height: 34px;
}
.input-suffix input {
  flex: 1; border: 0; background: transparent; padding: 0; height: auto;
  font-variant-numeric: tabular-nums;
}
.input-suffix input:focus { box-shadow: none; }
.input-suffix em { color: var(--subtle); font-style: normal; font-size: 12px; }

.field-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ─── Buttons ───────────────────────────────────────────────────────── */

.btn {
  appearance: none; border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary-sm { background: var(--accent); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost-sm { background: transparent; border: 1px solid var(--border); color: var(--text); padding: 4px 10px; font-size: 11.5px; border-radius: 5px; cursor: pointer; }
.btn-ghost-sm:hover { background: var(--surface-2); }
.icon-btn {
  appearance: none; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; padding: 4px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.pill {
  font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
  display: inline-flex; align-items: center; gap: 4px;
}
.pill-default { background: color-mix(in srgb, #10b981 14%, transparent); color: #059669; margin-left: 8px; }
/* Kanban board */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  align-items: start;
}
@media (max-width: 880px) { .kanban { grid-template-columns: 1fr; } }

.kanban-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  min-height: 200px;
  overflow: hidden;
}
.kanban-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.kanban-head h3 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: .04em; }
.kanban-count {
  font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
  padding: 2px 7px; border-radius: 999px;
}
.kanban-meta { margin-left: auto; }

.kanban-col.is-printing .kanban-head { box-shadow: inset 3px 0 0 var(--accent); }
.kanban-col.is-printing .kanban-count { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.kanban-col.is-done .kanban-head { box-shadow: inset 3px 0 0 #10b981; }
.kanban-col.is-done .kanban-count { background: color-mix(in srgb, #10b981 14%, transparent); color: #059669; }

.kanban-body { padding: 10px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kanban-empty { text-align: center; padding: 24px 8px; }
.kanban-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}
.kanban-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kanban-card.is-done { opacity: .72; }
.kanban-card.is-failed { opacity: .72; border-left: 3px solid #e11d48; }
.kanban-card.is-printing { border-left: 3px solid var(--accent); }

.kanban-card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.kanban-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.badge-time { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.kanban-card-notes { line-height: 1.35; }
.kanban-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; padding-top: 6px; border-top: 1px dashed var(--border); }
.kanban-actions { display: flex; gap: 4px; align-items: center; }
.kanban-actions form { margin: 0; }
.kanban-actions .btn-primary-sm { padding: 5px 9px; font-size: 11.5px; }

.kanban-card-warn {
  background: color-mix(in srgb, #f59e0b 12%, transparent);
  border: 1px solid color-mix(in srgb, #f59e0b 32%, transparent);
  color: #92400e;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  font-size: 11.5px;
}
html.dark .kanban-card-warn { color: #fbbf24; }
.kanban-card-warn ul { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; }
.kanban-card-warn strong { display: block; font-size: 12px; }

.kanban-card { cursor: grab; }
.kanban-card:active { cursor: grabbing; }
.kanban-card-ghost { opacity: .4; background: var(--surface-2); border-style: dashed; }
.kanban-card-drag { box-shadow: 0 16px 32px rgba(17,24,39,.18); transform: rotate(2deg); }
.kanban-body { min-height: 80px; }

.kanban-printer-select {
  width: 100%; padding: 5px 8px; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
}
.kanban-printer-select:focus { outline: none; border-color: var(--accent); }

.reason-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.reason-list li strong { color: var(--accent); margin-right: 6px; }

/* ─── Drop zone ─────────────────────────────────────────────────────── */

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: 9px;
  background: var(--surface-2);
  padding: 24px 16px; text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.dropzone.is-disabled { opacity: .55; }
.dz-label { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.dz-label strong { color: var(--text); font-size: 13px; }
.dz-label input[type=file] { display: none; }
.dz-foot {
  margin-top: 10px; display: flex; justify-content: space-between; align-items: center;
  font-size: 11.5px; color: var(--muted);
}
.dz-foot form { margin: 0; }

/* ─── Breakdown / totals ────────────────────────────────────────────── */

.breakdown { display: flex; flex-direction: column; gap: 16px; }
.breakdown-card { padding: 18px; }

.bar {
  display: flex; height: 12px; border-radius: 999px;
  overflow: hidden; background: var(--surface-2);
}
.bar-seg { transition: width .25s; }

.legend { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 7px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend .dot { width: 9px; height: 9px; border-radius: 999px; flex-shrink: 0; }
.legend-label { color: var(--muted); flex: 1; }
.legend-val { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

.totals dt, .totals dd { font-size: 13.5px; }
.totals-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 0; }
.totals-grid dt { color: var(--muted); }
.totals-grid dd { color: var(--text); margin: 0; font-variant-numeric: tabular-nums; }
.totals-grid .emph { font-weight: 600; color: var(--text); }

.gross-bar {
  margin-top: 14px; padding: 12px 16px; border-radius: var(--radius-sm);
  color: #fff; display: flex; justify-content: space-between; align-items: center;
  font-size: 13px;
}
.gross-bar strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.export-row { margin-top: 14px; }
.export-row .btn { width: 100%; justify-content: center; }

.calc-queue {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.calc-queue .queue-row { margin: 0; }
.calc-queue .queue-row .btn-primary { width: 100%; justify-content: center; }
.queue-name-dialog { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.queue-hint { margin: 0; }

/* ─── Pages ─────────────────────────────────────────────────────────── */

.page { display: flex; flex-direction: column; gap: 18px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; }
.page-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.page-head p { margin: 0; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ─── Tables ────────────────────────────────────────────────────────── */

.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data th, .data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.data td.num, .data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data tr:last-child td { border-bottom: 0; }
.data .empty { text-align: center; color: var(--muted); padding: 24px; }
.data-sub { background: var(--surface-2); border-radius: var(--radius-sm); }
.data-sub th { background: transparent; }

.cell-name { display: flex; align-items: center; gap: 10px; }
.color-dot { width: 14px; height: 14px; border-radius: 999px; border: 1px solid var(--border); display: inline-block; }
.color-dot-xs { width: 8px; height: 8px; vertical-align: middle; }

/* Tooltip — hover any element with [data-tip] for a styled bubble */
[data-tip] { position: relative; cursor: help; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 0;
  background: var(--text); color: var(--bg);
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 12px; line-height: 1.4; font-weight: 400;
  white-space: normal; width: 220px;
  opacity: 0; pointer-events: none; transform: translateY(2px);
  transition: opacity .12s ease, transform .12s ease;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}
[data-tip]:hover::after { opacity: 1; transform: translateY(0); }
.field [data-tip] {
  border-bottom: 1px dotted var(--subtle);
  display: inline-block; padding-bottom: 1px;
}

.loaded-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
  margin-bottom: 16px;
  grid-column: 1 / -1;  /* span all columns of the parent calc-page grid */
}
.loaded-banner .icon { color: var(--accent); }

.filament-lines { display: flex; flex-direction: column; gap: 8px; }
.filament-line { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: center; }
.filament-line select { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; height: 34px; font-size: 13.5px; color: var(--text); }

.failures-form { display: flex; flex-direction: column; gap: 6px; }
.failures-form input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; width: 100%; font-family: inherit; }
.failures-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.failures-form button { align-self: flex-end; }

.timing-row { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; align-items: center; }
.timing-row select { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; height: 34px; font-size: 13.5px; color: var(--text); }

.timing-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.timing-badges form { margin: 0; }
.timing-badges button {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  border-radius: 999px; padding: 3px 9px; font-size: 11px; cursor: pointer; color: var(--text);
  display: inline-flex; align-items: center; gap: 4px; font-family: inherit;
}
.timing-badges button:hover { border-color: var(--accent); color: var(--accent); }

.advanced-toggle { align-self: flex-start; gap: 6px; }
.advanced-section { display: flex; flex-direction: column; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.advanced-section h4 { margin: 0; }
.row-actions { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }

.collapsible-row { cursor: pointer; transition: background .12s; }
.collapsible-row:hover { background: var(--surface-2); }
.chevron-cell { width: 28px; padding-right: 0 !important; }
.chevron { color: var(--muted); transition: transform .15s ease; }
.chevron.is-open { transform: rotate(90deg); color: var(--text); }
.data-collapse tbody { border: 0; }

.batches { padding: 14px; background: var(--surface-2); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 12px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px; font-size: 12.5px; flex: 1; min-width: 0; }

/* ─── Models cards ──────────────────────────────────────────────────── */

.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.model-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow-sm);
}
.model-img {
  height: 140px; border-radius: 8px; background: var(--surface-2);
  display: grid; place-items: center; color: var(--subtle); overflow: hidden;
}
.model-img img { width: 100%; height: 100%; object-fit: cover; }
.model-card h4 { margin: 0; font-size: 15px; font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge { font-size: 11px; padding: 2px 8px; background: var(--surface-2); border-radius: 999px; color: var(--muted); }
.badge-ghost { background: transparent; border: 1px solid var(--border); }
.model-notes { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.model-actions { display: flex; gap: 6px; align-items: center; margin-top: auto; }
.failures-toggle {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 6px 0;
  font-size: 12.5px; color: var(--muted); font-family: inherit; text-align: left;
}
.failures-toggle strong { color: var(--text); }
.failures-panel { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.failures-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.failures-list li { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.failures-list li > span:nth-child(2) { flex: 1; }

/* ─── Dialogs ───────────────────────────────────────────────────────── */

.dialog {
  border: 0; border-radius: var(--radius); padding: 0;
  background: var(--surface); color: var(--text);
  width: 480px; max-width: 92vw;
  box-shadow: 0 24px 48px rgba(17,24,39,.18);
}
.dialog::backdrop { background: rgba(17,24,39,.4); backdrop-filter: blur(2px); }
.dialog-form { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.dialog-form h3 { margin: 0; font-size: 16px; }
.dialog-form h4 { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.mat-row { align-items: center; }

/* ─── Settings form ─────────────────────────────────────────────────── */

.settings-form { display: flex; flex-direction: column; gap: 16px; max-width: 880px; }
.settings-form select, .settings-form input, .settings-form textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; color: var(--text); width: 100%; font-family: inherit; font-size: 13.5px;
}
.form-actions { display: flex; justify-content: flex-end; }

/* ─── Segmented controls & swatches ─────────────────────────────────── */

.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 6px; }
.seg-btn {
  flex: 1; appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 6px 10px; border-radius: 4px; font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.seg-btn.is-on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
label.seg-btn { text-align: center; }
.seg-radio { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.swatch { width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--surface); cursor: pointer; box-shadow: 0 0 0 1px var(--border); }
.swatch:hover { transform: scale(1.08); }

/* Color-swatch dropdown (filament cascade) */
[x-cloak] { display: none !important; }
.color-select { position: relative; }
.color-select-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 13.5px; color: var(--text); cursor: pointer; text-align: left;
}
.color-select-trigger:disabled { opacity: .5; cursor: not-allowed; }
.color-select-trigger:focus { outline: none; border-color: var(--accent); }
.color-select-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-select-name.is-placeholder { color: var(--muted); }
.color-select-trigger .chevron { width: 14px; height: 14px; color: var(--subtle); flex-shrink: 0; }
.color-menu {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0;
  max-height: 240px; overflow-y: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgba(17,24,39,.22);
}
.color-menu-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: none; border: 0; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; color: var(--text); font-size: 13px; text-align: left;
}
.color-menu-item:hover { background: var(--surface-2); }
.color-select-trigger .color-dot, .color-menu-item .color-dot { flex-shrink: 0; }

/* ─── Auth pages ────────────────────────────────────────────────────── */

.auth-shell { position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 24px 72px; background: var(--bg); }
.auth-shell .site-footer { position: absolute; left: 0; right: 0; bottom: 0; border-top: 0; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 32px; width: 100%; max-width: 400px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-card h1 { margin: 0 0 18px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form input { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 14px; color: var(--text); width: 100%; font-family: inherit; }
.auth-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.auth-form button { width: 100%; justify-content: center; padding: 10px; }
.auth-form small.muted { display: block; margin-top: 4px; font-size: 11px; line-height: 1.4; }
/* Password requirements check off live as the user types: each line turns
   green when its rule is met, red while unmet. */
.auth-form .pw-reqs { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 11px; line-height: 1.4; }
.auth-form .pw-reqs li { display: flex; align-items: baseline; gap: 6px; color: var(--muted); transition: color .15s ease; }
.auth-form .pw-reqs li::before { content: '•'; }
.auth-form .pw-reqs li.ok { color: #16a34a; }
.auth-form .pw-reqs li.ok::before { content: '✓'; }
.auth-form .pw-reqs li.bad { color: #e11d48; }
.auth-form .pw-reqs li.bad::before { content: '✗'; }
@media (prefers-reduced-motion: reduce) { .auth-form .pw-reqs li { transition: none; } }
/* Visually hidden but exposed to screen readers (announces met/not-met state). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth-error { color: #e11d48; font-size: 13px; margin: 0; padding: 8px 10px; background: color-mix(in srgb, #e11d48 8%, transparent); border-radius: var(--radius-sm); }
.auth-foot { margin: 18px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
.auth-foot a { color: var(--accent); text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* ─── User menu in header ───────────────────────────────────────────── */

.user-menu { position: relative; }
.user-menu-btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); cursor: pointer; padding: 6px 10px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500;
}
.user-menu-btn:hover { background: var(--surface-2); }
.user-avatar {
  width: 22px; height: 22px; border-radius: 999px; background: var(--accent);
  color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(17,24,39,.14); padding: 6px; min-width: 180px; z-index: 60;
}
.user-menu-dropdown form { margin: 0; }
.user-menu-dropdown button, .user-menu-dropdown a {
  appearance: none; border: 0; background: transparent; width: 100%; text-align: left;
  padding: 7px 10px; border-radius: 5px; font-size: 13px; color: var(--text); cursor: pointer;
  display: block; text-decoration: none; font-family: inherit;
}
.user-menu-dropdown button:hover, .user-menu-dropdown a:hover { background: var(--surface-2); }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-meta { padding: 7px 10px; font-size: 12px; color: var(--muted); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.18); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
html.dark ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); background-clip: content-box; }

/* upgrade CTA + teaser */
.pro-cta { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.pro-cta-icon { color: var(--muted); flex-shrink: 0; }
.pro-cta-msg { margin: 0; flex: 1; color: var(--muted); font-size: 13px; }

/* Free/guest catalog browse (interactive teaser — explore, but no add/use) */
.catalog-browse .card-head { display: block; }
.catalog-browse .card-head .muted { margin: 4px 0 0; }
.teaser-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.teaser-price { margin: 0 0 10px; }
.teaser-price strong { font-size: 16px; }
.swatch-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch-grid .swatch {
  width: 26px; height: 26px; border-radius: 6px; padding: 0;
  border: 1px solid var(--border); cursor: pointer; transition: transform .08s ease;
}
.swatch-grid .swatch:hover { transform: scale(1.12); }
.swatch-grid .swatch.is-sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.spec-card .spec-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 5px 0; border-bottom: 1px dashed var(--border);
}
.spec-note { margin-top: 10px; line-height: 1.5; }

/* ─── Site footer ───────────────────────────────────────────────────── */
.site-footer {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 16px;
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 12.5px;
}
.site-footer-brand { color: var(--subtle); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer-links a { color: var(--muted); text-decoration: none; }
.site-footer-links a:hover { color: var(--text); text-decoration: underline; }

/* ─── Legal pages ───────────────────────────────────────────────────── */
.legal-shell { display: flex; flex-direction: column; min-height: 100vh; }
.legal-bar {
  height: 56px; padding: 0 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 24px; background: var(--surface);
  position: sticky; top: 0; z-index: 50;
}
.legal-bar .brand { text-decoration: none; color: var(--text); }
.legal-back { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 13px; }
.legal-back:hover { color: var(--text); }
.legal-page { flex: 1; padding: 40px 24px; width: 100%; }
.legal-doc {
  max-width: 760px; margin: 0 auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 40px;
}
.legal-eyebrow {
  margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent);
}
.legal-doc h1 { margin: 0 0 4px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.legal-stand { margin: 0 0 28px; font-size: 12.5px; color: var(--subtle); }
.legal-doc h2 { margin: 26px 0 8px; font-size: 16px; font-weight: 600; }
.legal-doc p { margin: 0 0 12px; color: var(--text); line-height: 1.6; }
.legal-doc a { color: var(--accent); }
.legal-doc code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.legal-form {
  margin: 8px 0 0; padding: 16px 18px; border-left: 3px solid var(--border);
  background: var(--surface-2); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.7; color: var(--muted);
}

/* ─── Mobile / tablet ───────────────────────────────────────────────── */

@media (max-width: 860px) {
  /* Raise the topbar's stacking context so the open drawer + backdrop
     sit above page content */
  .topbar { gap: 12px; padding: 0 16px; z-index: 70; }

  /* Reveal hamburger */
  .nav-toggle { display: inline-flex; }

  /* Tabs become a slide-in drawer from the left */
  .tabs {
    position: fixed; top: 56px; left: 0; bottom: 0; z-index: 70;
    width: min(78vw, 280px); margin: 0; padding: 12px;
    flex-direction: column; gap: 2px; overflow-y: auto;
    background: var(--surface); border-right: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(17,24,39,.18);
    transform: translateX(-100%); visibility: hidden;
    transition: transform .22s ease, visibility .22s ease;
  }
  .tabs.is-open { transform: translateX(0); visibility: visible; }
  .tab {
    width: 100%; padding: 11px 12px; font-size: 14.5px; border-radius: 8px;
  }

  /* Backdrop behind the open drawer */
  .nav-backdrop {
    display: block; position: fixed; inset: 56px 0 0 0; z-index: 65;
    background: rgba(17,24,39,.42);
    opacity: 0; pointer-events: none; transition: opacity .22s ease;
  }
  .nav-backdrop.is-open { opacity: 1; pointer-events: auto; }

  /* Compact the right-hand controls */
  .user-menu-btn > span:not(.user-avatar) { display: none; }
  .user-menu-btn { padding: 6px; }
  .user-menu-dropdown { min-width: 200px; }

  /* Looser breathing room for content + collapse dense form grids */
  .main { padding: 16px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; gap: 12px; }
  .page-head h2 { font-size: 19px; }
}

@media (max-width: 520px) {
  .brand-name { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .filament-line, .timing-row { grid-template-columns: 1fr 1fr; }
  .data th, .data td { padding: 8px; }
  .dialog-foot { flex-direction: column-reverse; }
  .dialog-foot .btn { width: 100%; justify-content: center; }
}
.guest-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:8px 16px;background:color-mix(in srgb,var(--accent) 12%,transparent);
  border-bottom:1px solid color-mix(in srgb,var(--accent) 30%,transparent);font-size:.9rem}
.guest-banner-actions{display:flex;gap:8px;flex:none}

/* ─── Pricing page ──────────────────────────────────────────────────── */
.pricing-page { display: flex; flex-direction: column; gap: 48px; max-width: 920px; margin: 0 auto; }

.pricing-hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 12px; }
.pricing-hero h1 { margin: 0; font-size: 32px; font-weight: 680; letter-spacing: -.02em; }
.pricing-hero-sub { margin: 0; max-width: 560px; font-size: 15px; line-height: 1.55; }

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.plan-grid-single { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 22px; }
.plan-card.is-pro { border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: var(--shadow-md); }

.plan-card-head { display: flex; flex-direction: column; gap: 6px; }
.plan-card-head h2 { margin: 0; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-amount { font-size: 38px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.plan-tagline { margin: 2px 0 0; font-size: 13px; line-height: 1.45; }

.plan-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }

.plan-cta { margin-top: auto; }
.plan-cta .btn { width: 100%; justify-content: center; }

.pricing-faq h2 { font-size: 20px; font-weight: 650; letter-spacing: -.01em;
  margin: 0 0 18px; text-align: center; }

.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.faq-q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: transparent; border: 0; cursor: pointer; padding: 15px 16px; text-align: left;
  font-size: 14px; font-weight: 600; color: var(--text); }
.faq-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .18s; flex: none; }
.faq-item.is-open .faq-chev { transform: rotate(90deg); }
.faq-a { padding: 0 16px 15px; }
.faq-a p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

@media (max-width: 720px) {
  .plan-grid { grid-template-columns: 1fr; gap: 28px; }
  .pricing-hero h1 { font-size: 25px; }
  .pricing-page { gap: 36px; }
}

.queue-toolbar { margin: 0 0 12px; }
.autosub-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.autosub-switch input { accent-color: var(--accent, #4f46e5); }
.badge-stock { background: rgba(220, 38, 38, .12); color: #b91c1c; }

/* 7-day per-printer usage Gantt (below queue) */
.usage { margin-top: 16px; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.usage-legend { display: flex; gap: 12px; flex-wrap: wrap; }
.usage-key { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); }
.usage-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.usage-dot.is-printing { background: var(--accent); }
.usage-dot.is-done { background: #10b981; }
.usage-dot.is-failed { background: #ef4444; }

.usage-grid { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.usage-axis, .usage-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; }
.usage-rowlabel { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.usage-rowlabel strong { font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.usage-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.usage-day { font-size: 10.5px; color: var(--muted); text-align: center; }

.usage-track {
  position: relative; height: 22px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); overflow: hidden;
}
.usage-gridline { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.usage-gridline:first-child { display: none; }
.usage-seg {
  position: absolute; top: 3px; bottom: 3px; border-radius: 3px; min-width: 2px;
}
.usage-seg.is-printing { background: var(--accent); }
.usage-seg.is-done { background: #10b981; }
.usage-seg.is-failed { background: #ef4444; }
.usage-empty { margin: 12px 0 0; }

@media (max-width: 880px) {
  .usage-axis { display: none; }
  .usage-row { grid-template-columns: 1fr; gap: 4px; }
  .usage-rowlabel { flex-direction: row; gap: 8px; align-items: baseline; }
}

.batch-summary .card-head .pill { margin-left: auto; }
.stock-warn { padding: 8px 10px; margin-top: 8px; border-radius: 6px; background: rgba(0,0,0,.03); }
.stock-warn strong { display: block; }

/* ── Landing page ─────────────────────────────────────────────── */
.landing .main { display: block; max-width: 1080px; margin: 0 auto; padding: 0 1.25rem 4rem; }
.landing-section-title { font-size: clamp(1.35rem, 2.5vw, 1.9rem); text-align: center; margin: 0 0 1.5rem; }

/* hero */
.landing-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; padding: clamp(2.5rem, 6vw, 5rem) 0; }
.landing-hero-copy h1 { font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.07; margin: 0 0 1rem; letter-spacing: -0.02em; }
.landing-hero-sub { font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 38ch; margin: 0 0 1.75rem; }
.landing-hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.landing .btn-lg { padding: 0.85rem 1.6rem; font-size: 1.05rem; }

/* abstract hero art (pure CSS) */
.landing-hero-art { position: relative; min-height: 280px; display: grid; place-items: center; color: var(--accent); }
.landing-hero-art .lha-blob { position: absolute; border-radius: 50%; filter: blur(36px); opacity: 0.45; }
.lha-blob-1 { width: 240px; height: 240px; background: var(--accent); top: 6%; right: 12%; }
.lha-blob-2 { width: 200px; height: 200px; background: #8b5cf6; bottom: 4%; left: 8%; opacity: 0.35; }
.landing-hero-art .lha-grid { position: absolute; inset: 12%; border-radius: 18px; opacity: 0.5; background-image: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px); background-size: 28px 28px; -webkit-mask-image: radial-gradient(closest-side, #000 60%, transparent); mask-image: radial-gradient(closest-side, #000 60%, transparent); }
.landing-hero-art .lha-photo { position: relative; width: 78%; max-width: 320px; height: auto; filter: drop-shadow(0 18px 40px rgba(0,0,0,0.35)); }

/* feature grid */
.landing-features { padding: 3rem 0; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.landing-feature { padding: 1.25rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.landing-feature-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); margin-bottom: 0.6rem; }
.landing-feature h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.landing-feature p { margin: 0; font-size: 0.92rem; }

/* steps */
.landing-steps { padding: 3rem 0; }
.landing-step-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.landing-step { position: relative; padding: 1.25rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.landing-step-n { position: absolute; top: -0.75rem; left: 1.25rem; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.landing-step-ic { display: inline-grid; place-items: center; width: 36px; height: 36px; color: var(--accent); margin: 0.6rem 0; }
.landing-step h3 { margin: 0 0 0.35rem; }
.landing-step p { margin: 0; font-size: 0.92rem; }

/* testimonials */
.landing-testimonials { padding: 3rem 0; }
.landing-testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.landing-testi { margin: 0; padding: 1.25rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.landing-testi blockquote { margin: 0 0 0.9rem; font-size: 0.98rem; line-height: 1.45; }
.landing-testi figcaption { display: flex; flex-direction: column; font-size: 0.85rem; }

/* pricing teaser + final cta */
.landing-pricing, .landing-final { text-align: center; padding: 3rem 0; }
.landing-pricing-sub { max-width: 52ch; margin: 0 auto 1.5rem; }
.landing-pricing-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.landing-final { background: color-mix(in srgb, var(--accent) 8%, transparent); border-radius: 18px; margin-top: 1rem; }
.landing-final h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 0.5rem; }
.landing-final p { margin: 0 0 1.5rem; }

/* faq reuses .faq-list / .faq-item from pricing page */
.landing-faq { padding: 3rem 0; max-width: 760px; margin: 0 auto; }

/* responsive */
@media (max-width: 860px) {
  .landing-hero { grid-template-columns: 1fr; }
  .landing-hero-art { min-height: 200px; order: -1; }
  .landing-feature-grid, .landing-step-list, .landing-testi-grid { grid-template-columns: 1fr; }
}

/* Analytics in-page tabs */
.subtabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.subtab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 9px 14px; color: var(--muted); font-size: 13.5px; font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtab:hover { color: var(--text); }
.subtab.is-active { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.chart { width: 100%; min-height: 280px; }
.analytics-controls { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.analytics-controls .subtabs { margin-bottom: 0; flex: 1 1 auto; }
.program-filter { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.program-filter select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font-size: 13.5px; }

/* --- Affiliate buy pills --- */
.aff-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.aff-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.6;
  text-decoration: none; white-space: nowrap;
  /* --aff: per-program tint (set inline); falls back to the workspace accent. */
  background: color-mix(in srgb, var(--aff, var(--accent)) 12%, transparent);
  color: var(--aff, var(--accent));
  border: 1px solid color-mix(in srgb, var(--aff, var(--accent)) 30%, transparent);
}
.aff-pill:hover { background: color-mix(in srgb, var(--aff, var(--accent)) 20%, transparent); }
.aff-pill--low {
  background: color-mix(in srgb, #f43f5e 14%, transparent);
  color: #f43f5e;
  border-color: color-mix(in srgb, #f43f5e 32%, transparent);
}
.aff-pill--low:hover { background: color-mix(in srgb, #f43f5e 22%, transparent); }
.aff-pill-img { height: 16px; display: block; }
.chart-empty { padding: 40px 0; text-align: center; }
.site-footer-note { display: block; margin-top: 6px; font-size: 11px; opacity: .65; }

/* --- Blog --- */
/* Blueprint-grid placeholder for posts without a cover image. */
.blog-thumb {
  position: relative; aspect-ratio: 16/10; overflow: hidden;
  border-bottom: 1px solid var(--border); background-color: var(--surface-2);
  background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--text) 6%, transparent) 0 1px, transparent 1px 22px),
                    repeating-linear-gradient(90deg, color-mix(in srgb, var(--text) 6%, transparent) 0 1px, transparent 1px 22px);
}
.blog-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.blog-meta {
  display: flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.blog-meta-row { justify-content: space-between; }
.blog-dot { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.blog-date { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; color: var(--subtle); letter-spacing: .04em; }

/* Index header */
.blog-index { gap: 26px; }
.blog-hero { padding-top: 16px; }
.blog-kicker { margin: 0; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.blog-headline { margin: 14px 0 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.06; font-weight: 700; letter-spacing: -.02em; max-width: 800px; text-wrap: balance; }
.blog-lede { margin: 16px 0 0; font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 640px; }

/* Featured hero */
.blog-feature {
  display: grid; grid-template-columns: 1.05fr .95fr; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.blog-feature:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.blog-thumb-feature { aspect-ratio: auto; min-height: 300px; border-bottom: 0; border-right: 1px solid var(--border); }
.blog-tag {
  position: absolute; top: 16px; left: 16px; padding: 6px 11px; border-radius: 5px;
  background: var(--text); color: var(--bg);
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.blog-feature-body { padding: 36px 40px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.blog-feature-body h2 { margin: 0; font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.015em; text-wrap: balance; }
@media (max-width: 760px) { .blog-feature { grid-template-columns: 1fr; } .blog-thumb-feature { min-height: 200px; border-right: 0; border-bottom: 1px solid var(--border); } .blog-feature-body { padding: 24px; } }

/* Filters */
.blog-filters { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.blog-pills { display: flex; gap: 9px; flex-wrap: wrap; }
.blog-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; font-weight: 500;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text); text-decoration: none; white-space: nowrap;
  transition: border-color .12s;
}
.blog-pill:hover { border-color: var(--accent); }
.blog-pill.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.blog-pill-count { opacity: .55; font-size: 11px; }
.blog-search {
  width: 248px; max-width: 100%; height: 38px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text); font-size: 14px; outline: none;
}
.blog-search:focus { border-color: var(--accent); }
.blog-result-label { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); }
.blog-no-results { grid-column: 1 / -1; padding: 50px 0; text-align: center; color: var(--subtle); font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 13px; }

/* Cards */
.blog-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
.blog-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.blog-card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card-body h3 { margin: 0; font-size: 19px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
.blog-excerpt { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; flex: 1; }
.blog-more { color: var(--accent); font-weight: 600; font-size: 13.5px; margin-top: 2px; }

/* Article */
.blog-back a { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.blog-back a:hover { color: var(--accent); }
.blog-article { max-width: 760px; margin: 0 auto; }
.blog-article h1 { margin: 16px 0 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.08; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
.blog-article .blog-lede { color: var(--text); font-size: 20px; }
.blog-article-meta { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; padding-bottom: 22px; border-bottom: 1px solid var(--border); font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .04em; color: var(--subtle); }
.blog-sep { color: var(--border); }
.blog-cover-lg { aspect-ratio: 16/8; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 26px 0 6px; }
.blog-cover-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-body { line-height: 1.72; font-size: 17px; }
.blog-body img, .blog-body figure { max-width: 100%; height: auto; }
.blog-body h2, .blog-body h3 { margin-top: 1.5em; font-weight: 700; letter-spacing: -.015em; }
.blog-body p { margin: 0.9em 0; }
.blog-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--accent); font-size: 22px; line-height: 1.4; font-weight: 500; font-style: normal; }
.blog-body::after { content: ''; display: block; clear: both; }  /* contain floated images */
.blog-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.blog-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* Affiliate buy-pills keep their own pill styling, not the prose link look. */
.blog-body .aff-pills { display: inline-flex; margin: 6px 0; vertical-align: middle; }
.blog-body .aff-pill { color: var(--aff, var(--accent)); text-decoration: none; }
.blog-body code { background: var(--surface-2); padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.blog-body pre { background: var(--surface-2); padding: 14px 16px; border-radius: 8px; overflow: auto; }
.blog-body pre code { background: none; padding: 0; }
/* CKEditor image styles: block (centered), inline, and left/right float + resize. */
.blog-body figure.image { display: table; margin: 1.2em auto; }
.blog-body figure.image img, .blog-body img { max-width: 100%; height: auto; border-radius: 8px; }
.blog-body figure.image.image_resized { max-width: 100%; }
.blog-body figure.image.image_resized img { width: 100%; }
.blog-body figure.image > figcaption { display: table-caption; caption-side: bottom; margin-top: 8px; font-size: 13px; color: var(--muted); text-align: center; }
.blog-body .image-style-align-left { float: left; margin: .4em 1.4em .8em 0; }
.blog-body .image-style-align-right { float: right; margin: .4em 0 .8em 1.4em; }
.blog-body img.image_inline { display: inline-block; margin: 0 2px; vertical-align: middle; border-radius: 4px; }
/* Tables: default borders; CKEditor table/cell properties override via inline style. */
.blog-body figure.table { margin: 1.4em auto; overflow-x: auto; }
.blog-body table { border-collapse: collapse; width: 100%; }
.blog-body th, .blog-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.blog-body thead th, .blog-body th { background: var(--surface-2); font-weight: 600; }
.blog-body table caption { caption-side: bottom; margin-top: 8px; font-size: 13px; color: var(--muted); }
/* CKEditor highlight marker classes. */
.blog-body mark { background: #fef08a; color: inherit; padding: 0 .1em; }
.blog-body .marker-yellow { background: #fef08a; }
.blog-body .marker-green { background: #bbf7d0; }
.blog-body .marker-pink { background: #fbcfe8; }
.blog-body .marker-blue { background: #bfdbfe; }
.blog-body .pen-red { background: none; color: #dc2626; }
.blog-body .pen-green { background: none; color: #16a34a; }
.blog-cta { margin: 40px 0 8px; border-radius: var(--radius); background: var(--text); color: var(--bg); padding: 28px 30px; display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap; }
.blog-cta-kicker { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .7; }
.blog-cta-title { font-size: 21px; font-weight: 700; margin-top: 8px; letter-spacing: -.01em; }
.blog-related { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 20px; }

/* ============ Calculator redesign (progressive disclosure) ============ */
.calc-inputs { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.calc-intro h1 { margin: 0; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.calc-intro p { margin: 5px 0 0; font-size: 13.5px; }

/* Source tabs (upload / saved models) */
.src-card { padding: 12px; }
.src-tabs { display: flex; gap: 6px; margin-bottom: 4px; }
.src-tab {
  display: inline-flex; align-items: center; gap: 7px; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 8px;
  background: transparent; color: var(--muted);
}
.src-tab .icon { width: 15px; height: 15px; }
.src-tab:hover { background: var(--surface-2); color: var(--text); }
.src-tab.is-active { background: var(--surface-2); color: var(--text); }
.src-models { padding: 8px 2px 2px; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model-pick {
  width: 100%; text-align: left; border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; padding: 11px 13px; cursor: pointer; display: flex; flex-direction: column; gap: 3px;
}
.model-pick:hover { border-color: var(--accent); }
.model-pick-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.model-pick-meta { font-size: 11.5px; color: var(--subtle); font-family: ui-monospace, monospace; }

/* Essentials card */
.dot-head { display: flex; align-items: center; gap: 9px; }
.dot-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.dot-head .head-hint { margin-left: auto; }
.essentials-body { display: flex; flex-direction: column; gap: 16px; }
.field-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.field-block .lbl { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); }
.time-pair { display: flex; gap: 8px; }
.time-pair .input-suffix { flex: 1; }
.stepper { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; height: 38px; }
.stepper input { flex: 1; min-width: 0; text-align: center; border: 0; outline: none; background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
.stepper button { width: 38px; height: 100%; border: 0; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 17px; }
.stepper button:hover { background: var(--border); color: var(--text); }

/* Fine-tune divider */
.finetune-divider { display: flex; align-items: center; gap: 12px; padding: 0 2px; margin-top: 2px; }
.finetune-divider .ft-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--subtle); }
.finetune-divider .ft-rule { flex: 1; height: 1px; background: var(--border); }

/* Accordions (native <details>) */
.acc { padding: 0; overflow: hidden; }
.acc > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; user-select: none;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary:hover { background: var(--surface-2); }
.acc-title { font-size: 14px; font-weight: 600; flex: none; min-width: 140px; }
.acc-sum { font-size: 12.5px; color: var(--subtle); font-family: ui-monospace, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-chev { margin-left: auto; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--subtle); border-bottom: 2px solid var(--subtle); transform: rotate(45deg); transition: transform .15s; }
.acc[open] > summary .acc-chev { transform: rotate(225deg); }
.acc-body { padding: 4px 18px 18px; border-top: 1px solid var(--border); }
.acc-body.grid-2, .acc-body.grid-3 { padding-top: 16px; }

/* Quote card (right column) */
.quote-card { padding: 0; overflow: hidden; }
.quote-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.quote-kicker { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--subtle); }
.quote-head .subtabs { border: 0; margin: 0; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 3px; }
.quote-head .subtab { border: 0; padding: 5px 11px; border-radius: 6px; font-size: 12.5px; }
.quote-head .subtab.is-active { background: var(--surface); border: 0; box-shadow: var(--shadow-sm); }
.quote-hero { padding: 12px 20px 0; font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.quote-hero-sub { padding: 8px 20px 16px; }
.comp { padding: 0 20px 16px; }
.comp-bar { display: flex; height: 9px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.comp-seg { display: block; height: 100%; }
.comp-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 11px; }
.comp-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.comp-legend i { width: 8px; height: 8px; border-radius: 2px; }
.comp-legend b { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.quote-breakdown { padding: 16px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.quote-section-label { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--subtle); margin-bottom: 10px; }
.quote-card .totals-grid { padding: 16px 20px 0; }
.quote-card .totals-grid dd.accent { color: var(--accent); font-weight: 600; }
.quote-card .gross-bar { margin: 14px 20px; }
.quote-card .export-row { padding: 0 20px 18px; }
.quote-card .export-row .btn { width: 100%; justify-content: center; }
