/* Анкета «ИИ-рисование». Своя таблица стилей, от конфигуратора не зависит (модуль переносимый). */
:root {
  --bg: #f6f4f0; --card: #ffffff; --text: #23211e; --muted: #6f6a62; --line: #e2ddd4;
  --accent: #2f6f5e; --accent-soft: #e3f0ec; --accent-text: #ffffff; --warn: #b3261e; --new: #fff4d6;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614; --card: #22201d; --text: #ece8e1; --muted: #a49e94; --line: #3a3732;
    --accent: #5fb39a; --accent-soft: #1f3a32; --accent-text: #0f1a16; --warn: #ff8a80; --new: #3a3220;
  }
}
:root[data-theme="dark"] {
  --bg: #171614; --card: #22201d; --text: #ece8e1; --muted: #a49e94; --line: #3a3732;
  --accent: #5fb39a; --accent-soft: #1f3a32; --accent-text: #0f1a16; --warn: #ff8a80; --new: #3a3220;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
/* внутри конфигуратора (встроенное окно): ссылки «← Конфигуратор» нет, справа место под крестик окна */
.embed .back-link { display: none; }
.embed .top-row { padding-right: 40px; }   /* иначе display:flex у .steps перебивает атрибут hidden */
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
.muted { color: var(--muted); font-size: 14px; }
code { font-size: 13px; }

.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 16px 6px; }
.top-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; max-width: 1180px; margin: 0 auto; }
h1 { font-size: 19px; margin: 0; }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.progress { height: 4px; background: var(--line); border-radius: 2px; max-width: 1180px; margin: 8px auto 6px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.steps { list-style: none; display: flex; gap: 6px; margin: 0 auto; padding: 0 0 4px; max-width: 1180px; overflow-x: auto; scrollbar-width: none; }
.steps li button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 10px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.steps li button[aria-current="step"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.steps li button.done { border-color: var(--accent); }

.layout { display: flex; gap: 20px; max-width: 1180px; margin: 0 auto; padding: 16px; align-items: flex-start; }
main { flex: 1; min-width: 0; }
.brief { width: 380px; flex: none; position: sticky; top: 120px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; max-height: calc(100vh - 140px); overflow: auto; }
.brief-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brief h2 { font-size: 15px; margin: 0; }
.brief pre { font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }

.intro { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.block-title { font-size: 21px; margin: 4px 0 12px; }
.q { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.q.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: var(--new); } to { background: var(--card); } }
.q-text { font-weight: 600; margin: 0 0 4px; }
.q-hint { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.q-err { color: var(--warn); font-size: 14px; margin: 6px 0 0; }
.branch-mark { display: inline-block; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-left: 6px; font-weight: 400; vertical-align: 1px; }

.opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.opt { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 13px; cursor: pointer; text-align: left; min-height: 44px; }
.opt:hover { border-color: var(--accent); }
.opt[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.opt small { display: block; font-size: 12px; opacity: .8; }
.opt.unknown { border-style: dashed; }
.opt:focus-visible, .ghost:focus-visible, .primary:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.num { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.num label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 3px; }
.num input { width: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: var(--bg); min-height: 44px; }
.unit { color: var(--muted); }
textarea { width: 100%; min-height: 90px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--bg); resize: vertical; margin-top: 8px; }
textarea.long { min-height: 160px; }
.repeat-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.repeat-row > span { min-width: 70px; color: var(--muted); font-size: 14px; }
.repeat-row .opts { margin-top: 0; }

.voice { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.voice .rec { background: var(--warn); border-color: var(--warn); color: #fff; }

.nav { display: flex; justify-content: space-between; gap: 10px; margin: 18px 0 40px; }
.primary { background: var(--accent); color: var(--accent-text); border: 0; border-radius: 10px; padding: 11px 20px; cursor: pointer; min-height: 44px; font-weight: 600; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; cursor: pointer; min-height: 36px; }
a.ghost { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.ghost.small { padding: 3px 9px; min-height: 28px; font-size: 13px; }
.ghost[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }

.summary dl { display: grid; grid-template-columns: minmax(140px, 1fr) 2fr; gap: 6px 14px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }
.card-box summary { cursor: pointer; font-weight: 600; }
textarea.code { font: 12px/1.45 ui-monospace, Consolas, monospace; min-height: 320px; }
.primary:disabled { opacity: .5; cursor: default; }
.fix { border-color: var(--warn); }
.fix p { margin: 6px 0; }
.note { border-left: 3px solid var(--accent); padding: 4px 10px; margin: 12px 0; }

/* вычитка */
.review-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.review-tools select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--card); }
.rq { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.rq.branch { margin-left: 22px; border-left: 3px solid var(--accent); }
.rq-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rq-id { font: 12px ui-monospace, monospace; color: var(--muted); }
.rq-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.rq-opts { font-size: 14px; margin-top: 4px; }
.counts { font-size: 14px; }
.counts td { padding: 1px 10px 1px 0; }

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .brief { width: 100%; position: static; max-height: none; }
}
@media (max-width: 480px) {
  h1 { font-size: 17px; }
  .opt { flex: 1 1 100%; }
  .summary dl { grid-template-columns: 1fr; }
  .summary dd { margin-bottom: 6px; }
  .rq.branch { margin-left: 10px; }
}

/* окно «Знаю сам» (quick.js): рисунок в центре, вопросы вокруг */
.qk { display: grid; gap: 12px; grid-template-columns: minmax(150px, 1fr) minmax(220px, 300px) minmax(190px, 1.2fr);
  grid-template-areas: ". top ." "left pic right" "bottom bottom bottom"; align-items: start; }
.qk-top { grid-area: top; } .qk-left { grid-area: left; } .qk-pic { grid-area: pic; } .qk-right { grid-area: right; } .qk-bottom { grid-area: bottom; }
.qk .q { margin-bottom: 10px; padding: 10px 12px; }
.qk-pic { color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; }
.qk-svg { width: 100%; height: auto; display: block; }
.qk-svg .thin { stroke-width: 1.2; opacity: .7; }
.qk-svg .dim { stroke: var(--accent); stroke-width: 1.4; }
.qk-bottom { display: grid; gap: 0 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
@media (max-width: 760px) {
  .qk { grid-template-columns: 1fr; grid-template-areas: "pic" "top" "left" "right" "bottom"; }
  .qk-pic { max-width: 280px; margin: 0 auto; }
}
