:root {
  --bg: #f6f7f5; --surface: #ffffff; --text: #1b1f1d; --muted: #5d6662; --line: #dfe3e0;
  --accent: #0f766e; --accent-ink: #ffffff; --warn-bg: #fff4d6; --warn-ink: #7a5300;
  --err: #b42318; --chip: #eef2f0;
  --p-low: #8a8f8c; --p-medium: #2563eb; --p-high: #c2410c; --p-viral: #be123c;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111413; --surface: #1a1e1c; --text: #e8ece9; --muted: #9aa39f; --line: #2c3330;
    --accent: #2dd4bf; --accent-ink: #062b27; --warn-bg: #3a2f10; --warn-ink: #f5d27a; --err: #f97066; --chip: #242a27;
    --p-low: #9aa39f; --p-medium: #60a5fa; --p-high: #fb923c; --p-viral: #fb7185; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; align-items: center; gap: 24px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 4px; background: var(--accent); }
.tabs { display: flex; gap: 4px; }
.tabs button { background: none; border: 0; padding: 8px 12px; border-radius: 8px; color: var(--muted); font: inherit; cursor: pointer; }
.tabs button.active { background: var(--chip); color: var(--text); font-weight: 600; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 60px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.narrow { max-width: 380px; margin: 60px auto; }
h1 { font-size: 22px; margin: 0 0 8px; } h2 { font-size: 18px; margin: 0; } h3 { font-size: 16px; margin: 0; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.error { color: var(--err); min-height: 1.2em; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font: inherit; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check, .printers label { flex-direction: row; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
label.check input, .printers input { width: auto; }
button, .button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
button:disabled { opacity: .6; cursor: wait; }
#loginForm { display: flex; gap: 8px; margin-top: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .wide, .form-grid .printers, .form-grid .row { grid-column: 1 / -1; }
.printers { border: 1px solid var(--line); border-radius: 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 12px; margin: 0; }
.printers legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.row { display: flex; gap: 12px 16px; align-items: flex-end; flex-wrap: wrap; }
.row > label { min-width: 140px; }
.banner { padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; }
.warn { background: var(--warn-bg); color: var(--warn-ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 16px; }
.idea { display: flex; flex-direction: column; gap: 8px; }
.idea .head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.idea .vi { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--chip); border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.pp { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.pp-low { color: var(--p-low); } .pp-medium { color: var(--p-medium); } .pp-high { color: var(--p-high); } .pp-viral { color: var(--p-viral); }
.pill { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
details { font-size: 14px; } details summary { cursor: pointer; color: var(--muted); }
details p { margin: 6px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.actions button { padding: 6px 10px; font-size: 13px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar select { width: auto; } .spacer { flex: 1; }
dialog { width: min(900px, 94vw); max-height: 88vh; border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.modal-head button { border: 0; }
#modalBody { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; overflow: auto; max-height: 50vh; font-size: 12.5px; white-space: pre; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .grid { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-top: 16px; align-items: start; }
.section-title { margin: 8px 0; }
.bookmarklet { display: inline-block; background: var(--accent); color: var(--accent-ink); padding: 3px 10px; border-radius: 8px; font-weight: 600; text-decoration: none; cursor: grab; }
table.kw { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table.kw th, table.kw td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.kw th { color: var(--muted); font-weight: 600; }
.chip.new { background: var(--accent); color: var(--accent-ink); }
.chip button { border: 0; background: none; padding: 0 0 0 4px; font-size: 12px; color: inherit; }
.niche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.project h2 { display: flex; gap: 8px; align-items: center; }
.meter { display: inline-flex; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.suggestion { border-left: 3px solid var(--accent); }
.models { font-size: 13px; max-height: 220px; overflow: auto; }
.models li { margin: 2px 0; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.row > input, .row > select { flex: 1 1 180px; width: auto; }
.row > button { flex: 0 0 auto; }
.project h2 button { font-size: 13px; font-weight: 400; padding: 4px 10px; }
/* filament library */
.form-grid.dense { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
input[type="color"] { padding: 2px; height: 38px; }
.fil-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.fil { display: flex; flex-direction: column; gap: 8px; }
.fil .top-line { display: flex; gap: 10px; align-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.swatch.sm { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 4px; border-width: 1px; }
.bar { height: 8px; border-radius: 99px; background: var(--chip); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.fil.low .bar > span { background: var(--err); }
.badge-low { background: var(--err); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.warn-pill { background: var(--err); color: #fff; }
.fil .actions, .setup-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: end; }
.setup-form label { flex: 1; min-width: 160px; }
table.settings td { vertical-align: top; padding: 4px 8px 4px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
table.settings { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }
.scan-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.photo-drop { width: 150px; height: 150px; border: 2px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; overflow: hidden; color: var(--muted); flex: none; position: relative; }
.photo-drop.drag, .photo-drop:hover { border-color: var(--accent); }
.photo-drop img { width: 100%; height: 100%; object-fit: cover; }
.form-grid.quick { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.color-field { display: flex; gap: 6px; } .color-field input[type="color"] { width: 46px; flex: none; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; }
.palette button { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.palette button.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.fil-photo { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; border: 1px solid var(--line); }
/* research / radar */
.trend-drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 16px; cursor: pointer; color: var(--muted); }
.trend-drop.drag, .trend-drop:hover { border-color: var(--accent); }
#trendScanStatus:empty { display: none; }
.subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.subtabs button { border: 0; border-radius: 0; background: none; color: var(--muted); border-bottom: 2px solid transparent; padding: 8px 14px; white-space: nowrap; }
.subtabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.loop { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.loop span { border: 1px solid var(--line); border-radius: 99px; padding: 2px 10px; background: var(--surface); }
.loop span.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.loop b { color: var(--muted); font-weight: 400; }
.head-row { display: flex; gap: 12px; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; }
.row-end { display: flex; gap: 8px; flex-wrap: wrap; }
.note { border-left: 3px solid var(--accent); background: var(--chip); padding: 8px 12px; border-radius: 0 8px 8px 0; margin: 0; }
.radar-bar, .bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px; }
.bulk { border-top: 1px solid var(--line); background: var(--chip); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.filters button { font-size: 13px; padding: 3px 10px; border-radius: 99px; color: var(--muted); }
.filters button.on { border-color: var(--accent); color: var(--text); background: var(--chip); font-weight: 600; }
.tablewrap { overflow-x: auto; }
table.radar { width: 100%; border-collapse: collapse; }
table.radar th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.radar td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.radar tr.sel td { background: var(--chip); }
table.radar input[type="checkbox"] { width: auto; }
.kwtext { font-weight: 600; }
.hot { display: flex; align-items: center; gap: 8px; min-width: 110px; font-variant-numeric: tabular-nums; }
.hot .hbar { flex: 1; height: 6px; background: var(--chip); border-radius: 99px; overflow: hidden; min-width: 50px; }
.hot .hbar i { display: block; height: 100%; background: var(--accent); }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; font-size: 13px; }
.up-t { color: #15803d; } .down-t { color: var(--err); }
.st { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.st-new { color: #7c3aed; } .st-up { color: #15803d; } .st-flat, .st-lost { color: var(--muted); } .st-down { color: var(--err); }
@media (prefers-color-scheme: dark) { .up-t, .st-up { color: #4ade80; } .st-new { color: #a78bfa; } }
.sugg { font-size: 13px; max-width: 260px; }
.sugg .why { color: var(--muted); font-size: 12px; }
.acts { display: flex; gap: 6px; flex-wrap: nowrap; }
.acts button, .acts select { padding: 5px 10px; font-size: 13px; }
.acts select { width: auto; max-width: 150px; }
@media (max-width: 640px) { .hide-sm { display: none; } }
#radarError:empty, #radarSummary:empty, #trendError:empty { display: none; }
.trend-drop #trendScanStatus { display: block; margin-top: 6px; color: var(--text); }
.trend-drop #trendScanStatus:empty { display: none; }
.warn-t { color: #b45309; font-weight: 600; }
details > summary { cursor: pointer; color: var(--muted); }
/* contests */
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.concept { margin: 0; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.concept img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--chip); }
.concept .ph { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; background: var(--chip); border-radius: 8px; color: var(--muted); font-size: 13px; }
.concept.starred { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.version.final { border-color: var(--accent); }
.version p { margin: 0; }
.comments { display: flex; flex-direction: column; gap: 8px; }
.comment { display: flex; gap: 10px; align-items: flex-start; background: var(--chip); border-radius: 8px; padding: 8px 10px; }
.comment > div { flex: 1; }
.comment button { border: 0; background: none; padding: 2px 6px; color: var(--muted); }
.comment-form input[name="body"] { flex: 1 1 260px; }
.small-btn { padding: 8px 10px; }
.checklist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.checklist label.check { align-items: flex-start; }
.checklist input { margin-top: 4px; }
.idea.dim { opacity: .55; }
#cdError:empty, #cScanStatus:empty, #cBriefStatus:empty { display: none; }
#cDrop #cScanStatus { display: block; margin-top: 6px; color: var(--text); }
.comment-form > label { min-width: 0; flex: none; }
pre.wrap { white-space: pre-wrap; }
.job { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.job button { padding: 3px 10px; font-size: 13px; }
.lib-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--chip); display: block; }
.lib-cover.ph { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

/* Steps 4-6: pick the idea to work on */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card.pick { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.card.pick:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pick-img { width: 100%; }
.pick-img img, .pick-img .ph { box-sizing: border-box; width: 100%; border-radius: 0; aspect-ratio: 4 / 3; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--chip); color: var(--muted); font-size: 13px; }
.pick-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.pick-cta { margin-top: 4px; color: var(--accent); font-weight: 600; font-size: 14px; }
.idea-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* Step 5: versions, written for a non-technical founder */
.version .lead { font-size: 15.5px; margin: 0; }
.next-steps { background: var(--chip); border-radius: 10px; padding: 12px 16px; }
.next-steps ol { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.next-steps li > button { margin-left: 8px; }
.plan { display: flex; flex-direction: column; gap: 14px; }
ul.tight { margin: 4px 0 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; margin-top: 6px; }
.print-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.print-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.print-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.print-table .st-cell { white-space: nowrap; }
.print-table .st-cell button { margin-left: 6px; }
.pst { font-size: 12px; font-weight: 600; }
.pst.done { color: var(--accent); }
.pst.failed, .pst.stopped { color: var(--err); }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.quick input { width: 110px; }
.tech > summary { cursor: pointer; color: var(--muted); }
.tech-body { margin-top: 10px; }
.tech .params input { width: 110px; }
.tech details.part { border-top: 1px solid var(--line); padding-top: 8px; }
.tech details.part textarea { width: 100%; box-sizing: border-box; }
label.radio { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line, #ddd); border-radius: 8px; cursor: pointer; }
label.radio input { margin: 0; }
.view3d { border: 1px solid var(--line, #ddd); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.viewer3d { width: 100%; min-height: 260px; background: linear-gradient(#f7f8fa, #e9edf2); border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.viewer3d canvas { display: block; width: 100% !important; touch-action: none; }
.fit-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fit-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fit-list .dot { width: 12px; height: 12px; border-radius: 50%; background: #ccc; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
@media (prefers-color-scheme: dark) { .viewer3d { background: linear-gradient(#2a2e35, #1f2328); } }
.pair3d { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 10px; align-items: start; }
.pair3d figure { margin: 0; display: grid; gap: 4px; }
.pair3d img { width: 100%; border-radius: 8px; display: block; }
@media (max-width: 700px) { .pair3d { grid-template-columns: 1fr; } }
.compare { border-top: 1px solid var(--line, #ddd); padding-top: 10px; }
.tc-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.tc-list label { flex-direction: row; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); cursor: pointer; }
.tc-list input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.chip .dot { display: inline-block; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); width: 10px; height: 10px; margin-right: 1px; vertical-align: -1px; }
.stock-check { margin-top: 10px; }
/* Phones: the app tabs and the step tabs scroll sideways instead of widening the page. */
.tabs, .subtabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.tabs button, .subtabs button { white-space: nowrap; flex: none; }
details.techcheck > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.techcheck[open] > summary { margin-bottom: 10px; }
.top .tabs { max-width: 100%; min-width: 0; }
label.radio { flex-direction: row; color: var(--text); font-size: 14px; }
label.radio input { width: auto; }
.quick .row { flex-wrap: nowrap; align-items: center; gap: 6px; }
.quick .row input { width: 120px; }
.stock-check .fit-list li { align-items: flex-start; }
.stock-check .fit-list .dot { margin-top: 5px; }
