.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .brand { text-decoration: none; color: var(--text); display: inline-flex; }
.topbar nav { display: flex; gap: 16px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.topbar nav a:hover { color: var(--text); }
main { padding: 24px; max-width: 1400px; margin: 0 auto; }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; background: #eef0f3; padding: 4px; border-radius: 10px; }
.tabs a { padding: 6px 14px; border-radius: 7px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.survey-table td.name { font-weight: 600; }
.survey-table a { text-decoration: none; }
.survey-table .actions { white-space: nowrap; }
/* Builder */
.builder { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.qlist { list-style: none; margin: 0; padding: 0; }
.qlist li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; border: 1px solid transparent; }
.qlist li:hover { background: #f6f7f9; }
.qlist li.on { background: var(--accent-soft); border-color: #f3c3cb; }
.qlist li .code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; font-size: 12px; flex: 0 0 48px; color: var(--accent); }
.qlist li .qt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qlist li .type { font-size: 11px; color: var(--muted); }
.qlist li .logic { font-size: 11px; color: var(--warn); }
.qlist li .mv { display: none; gap: 2px; }
.qlist li:hover .mv { display: inline-flex; }
.qlist li .mv button { padding: 1px 6px; font-size: 11px; border-radius: 5px; }
.editor .card { margin-bottom: 16px; }
.editor h2 { display: flex; align-items: center; gap: 10px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.lang-tag { display: inline-block; font-size: 10px; font-weight: 700; background: #eef0f3; color: var(--muted); border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: middle; }
.opt-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.opt-row .labels { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.opt-row .labels input { padding: 6px 9px; font-size: 14px; }
.opt-row .flags { display: flex; gap: 10px; padding-top: 7px; font-size: 12px; white-space: nowrap; }
.opt-row .flags label { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); }
.opt-row .flags input { width: auto; }
.opt-row .del { padding: 4px 8px; margin-top: 2px; }
.rule { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr auto; gap: 8px; align-items: start; margin-bottom: 8px; }
.rule select, .rule input { padding: 6px 9px; font-size: 14px; }
.checklist { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 0; }
.checklist label { font-size: 13px; display: inline-flex; gap: 4px; align-items: center; }
.checklist input { width: auto; }
.save-bar { display: flex; gap: 10px; align-items: center; }
.dirty { color: var(--warn); font-weight: 600; font-size: 13px; }
.errors { margin-bottom: 16px; }
.imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.imgs .img { position: relative; }
.imgs img { height: 120px; max-width: 260px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: block; }
.imgs .img button { position: absolute; top: 4px; right: 4px; }
.errors li { color: var(--bad); }
/* Results */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 20px; }
.filters label.field { margin: 0; min-width: 150px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.tile b { display: block; font-size: 26px; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.qcard { margin-bottom: 16px; }
.qcard .qh { display: flex; gap: 12px; align-items: baseline; margin-bottom: 12px; }
.qcard .qh .code { font-family: ui-monospace, Menlo, monospace; color: var(--accent); font-weight: 700; }
.qcard .qh h3 { flex: 1; margin: 0; font-size: 15px; font-weight: 600; }
.qcard .qh .base { color: var(--muted); font-size: 13px; white-space: nowrap; }
.bars { display: grid; grid-template-columns: minmax(140px, 1fr) 3fr 56px 56px; gap: 6px 12px; align-items: center; font-size: 13.5px; }
.bars .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar { height: 18px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.bars .bar div { height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bars .pct { font-weight: 700; text-align: right; }
.bars .n { color: var(--muted); text-align: right; }
.stats { display: flex; gap: 20px; margin-bottom: 10px; font-size: 14px; }
.stats b { font-size: 18px; }
.heat td { text-align: center; }
.heat td.cell { font-weight: 600; }
.heat td.rowlbl { text-align: left; }
.verbatims { max-height: 320px; overflow: auto; }
.verbatims li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.verbatims li span { color: var(--muted); font-size: 12px; margin-left: 8px; }
.other-list { margin-top: 10px; font-size: 13px; color: var(--muted); }
.fw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.minibar { display: inline-block; max-width: 70%; height: 10px; background: var(--accent); border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.empty { text-align: center; padding: 50px; color: var(--muted); }
@media (max-width: 900px) { .builder { grid-template-columns: 1fr; } .sidebar { position: static; max-height: none; } .rule { grid-template-columns: 1fr; } .bars { grid-template-columns: 1fr 2fr 50px 50px; } }

/* Review */
.badge { display: inline-block; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; vertical-align: middle; text-decoration: none; }
.tabs a .badge { margin-left: 2px; }
.review { margin-bottom: 14px; border-left: 4px solid var(--warn); }
.review.approved { border-left-color: var(--ok); }
.review.reverted { border-left-color: var(--muted); }
.review .rh { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.review .rh .code { font-family: ui-monospace, Menlo, monospace; color: var(--accent); font-weight: 700; }
.review .rh .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.review .rh h3 { flex: 1; margin: 0; font-size: 15px; }
.review .pill.pending { background: var(--warn-soft); color: var(--warn); }
.review .pill.approved { background: var(--ok-soft); color: var(--ok); }
.review .pill.reverted { background: #eef0f3; color: var(--muted); }
.changes { font-size: 13.5px; margin-top: 8px; }
.changes td:first-child { width: 22%; }

/* New survey */
.new-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.new-grid .option { display: flex; flex-direction: column; gap: 10px; }
.new-grid .option h2 { margin: 0; }
.new-grid .option p { margin: 0; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.dropzone { border: 2px dashed #c9ced6; border-radius: 12px; padding: 34px 16px; text-align: center; cursor: pointer; color: var(--muted); background: #fafbfc; transition: border-color .15s, background .15s; }
.dropzone b { color: var(--text); }
.dropzone:hover, .dropzone:focus, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone.busy { pointer-events: none; opacity: .6; }
.progress-box { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 10px; background: #f6f7f9; border: 1px solid var(--line); }
.spinner { flex: 0 0 18px; width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) { .new-grid { grid-template-columns: 1fr; } }

.review-h { font-size: 16px; margin: 22px 0 10px; display: flex; gap: 10px; align-items: baseline; }

.bylist { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.bylist textarea { flex: 1; font-size: 13px; padding: 6px 8px; }

/* Build progress */
.build-progress { display: flex; gap: 22px; align-items: center; padding: 18px; border-radius: 12px; background: #f6f7f9; border: 1px solid var(--line); }
.build-mark { flex: 0 0 120px; color: var(--text); }
.build-title { font-size: 17px; margin-bottom: 10px; }
.pbar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin-bottom: 6px; }
.pbar div { height: 100%; background: var(--accent); border-radius: 5px; transition: width .7s ease; }
@media (max-width: 600px) { .build-progress { flex-direction: column; align-items: flex-start; } }

.review.deferred, .review.client_approved, .review.client_reverted { border-left-color: #4A5D80; }
.review .pill.deferred { background: #E7EBF3; color: #4A5D80; }
.review .pill.client_approved { background: var(--ok-soft); color: var(--ok); }
.review .pill.client_reverted { background: #eef0f3; color: var(--muted); }
.badge.blue { background: #4A5D80; }
.badge.green { background: var(--ok); }

.img-need { padding: 10px 0; border-top: 1px solid var(--line); }
.img-need:first-of-type { border-top: 0; }
.img-need .code { font-family: ui-monospace, Menlo, monospace; color: var(--accent); font-weight: 700; }
.img-need .imgs { margin: 8px 0; }
