/* NEDVIJIMOST · интерфейс. Палитра: фон #F5F3EE, текст #172923, акцент #1F6A5C. Шрифт Inter отдаёт сервер. */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/Inter-Medium.ttf") format("truetype"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/Inter-SemiBold.ttf") format("truetype"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/Inter-Bold.ttf") format("truetype"); }
:root {
  --bg: #F5F3EE;
  --card: #FFFFFF;
  --card-soft: #FAF8F4;
  --ink: #172923;
  --ink-2: #34443E;
  --muted: #5E6B66;
  --placeholder: #98A19D;
  --line: #E7E2D8;
  --line-strong: #D5CFC2;
  --accent: #1F6A5C;
  --accent-hover: #185A4E;
  --accent-press: #124A40;
  --accent-soft: #E1EDE8;
  --accent-tint: #EFF5F2;
  --accent-line: #CFE1DA;
  --warn-bg: #FBF4E3; --warn-line: #EADAB0; --warn-ink: #6B5112;
  --error-bg: #FBEEEB; --error-line: #EBCBC3; --error-ink: #983A2A;
  --radius: 16px;
  --radius-sm: 10px;
  --ring: 0 0 0 3px rgba(31, 106, 92, .24);
  --shadow: 0 1px 2px rgba(23, 41, 35, .04), 0 6px 24px rgba(23, 41, 35, .05);
  --page: 1288px;
  --stepbar: 59px;  /* the height of the sticky step bar: what sticks below it starts here; steps-ui.js keeps it measured */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--accent-tint); border-radius: 4px; padding: 1px 4px; }

/* Header: brand, the menu, the signed-in user. It scrolls away; only the step bar of the evaluation page sticks. */
.site-header { border-bottom: 1px solid var(--line); background: var(--card); }
.site-header-inner { max-width: var(--page); margin: 0 auto; padding: 8px 24px; min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 36px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 700; letter-spacing: .16em; }
.brand:hover { color: var(--ink); }
.brand:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.brand-mark { width: 17px; height: 17px; background: var(--accent); clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%); }
.nav { display: flex; flex-wrap: wrap; gap: 6px; }
.nav a { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 9px 14px; border-radius: 10px; }
.nav a:hover { background: var(--accent-tint); color: var(--ink); }
.nav a:focus-visible { outline: none; box-shadow: var(--ring); }
.nav a.nav-on { color: var(--accent); background: var(--accent-tint); font-weight: 600; }
/* Service mode: the first letter, the name and «Выйти» at the right of the header; hidden (no space) in local mode. */
.service-user { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; font-size: 14.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.service-user form { margin: 0; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.service-user .text-button { margin-left: 0; color: var(--muted); }
.service-avatar { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.service-user-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
/* The term of access next to the name: a trial always, a month in its last three days. */
.service-term { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.back-link { margin-left: auto; }
/* The test copy of the service: the server puts this banner right after <body> (service/test_copy.py). */
.test-copy-banner { background: #F2C94C; color: #3D2E00; text-align: center; font-weight: 700; font-size: 14px; letter-spacing: .04em; padding: 8px 24px; }
.service-notice { background: var(--accent-tint); border-bottom: 1px solid var(--accent-line); }
.service-notice-inner { max-width: var(--page); margin: 0 auto; padding: 6px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--ink-2); }
.service-notice-inner p { margin: 0; }
.service-notice-inner .text-button { margin-left: 0; flex: none; }
/* The bar under the header of the evaluation page: the short title, the steps, «Сообщить о проблеме». It sticks to
   the top of the window; a step links to its panel (steps-ui.js paints the states). */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.stepbar { position: sticky; top: 0; z-index: 15; border-bottom: 1px solid var(--line); background: var(--bg); }
.stepbar-inner { max-width: var(--page); margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.stepbar-head { flex: 1 1 200px; min-width: 0; font-size: 16px; }
.stepbar-head b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepbar-actions { display: flex; align-items: center; gap: 12px; }
.stepbar-actions .text-button { margin-left: 0; color: var(--muted); font-weight: 500; }
.stepbar-actions .text-button:hover { color: var(--accent); }
.stepbar-actions .problem-sent { font-size: 13px; }
.flow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.flow li { display: flex; align-items: center; gap: 4px; }
.flow li:not([hidden]) ~ li:not([hidden])::before { content: ""; width: 18px; height: 1.5px; background: var(--line-strong); }
.flow a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.flow a:hover { background: var(--accent-tint); color: var(--ink); }
.flow a:focus-visible { outline: none; box-shadow: var(--ring); }
.flow span { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 5px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--card); color: var(--muted); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.flow .step-done a { color: var(--ink-2); }
.flow .step-done span { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 0; }
.flow .step-done span::before { content: "✓"; font-size: 12px; }
.flow .step-now a { color: var(--ink); font-weight: 650; background: var(--card); box-shadow: inset 0 0 0 1px var(--accent-line); }
.flow .step-now span { border-color: var(--accent); color: var(--accent); }
/* Service pages come with their role on <html> (server.py, service_page): what a role never sees is hidden before
   any script runs, so the page does not flash another view while loading. */
.service [data-local-only], .realtor [data-manual-search] { display: none !important; }
/* In the service only the CIAN and Avito bookmarks are offered, to the administrator too: the search runs on the robot. */
.service #bookmarks [data-manual-search] { display: none !important; }
/* A square ring while busy: the hidden step number must not stretch it into an oval. */
.flow .step-busy span { width: 26px; min-width: 26px; padding: 0; font-size: 0; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); color: transparent; animation: spin .8s linear infinite; }
.flow .step-closed a { opacity: .55; cursor: default; }
.flow .step-closed a:hover { background: none; color: var(--muted); }
.panel { scroll-margin-top: calc(var(--stepbar) + 13px); }
/* The state line of the evaluation with «Изменить подбор»; nothing while both are hidden. */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 12px; padding: 12px 16px; margin: 0 0 20px; }
.banner:not(:has(> :not([hidden]))) { display: none; }
.banner .evaluation-line { flex: 1 1 320px; margin: 0; padding: 0; border: 0; background: none; }
/* The bookmarks strip above step 01: a title, the copy buttons, how to install. */
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; background: var(--card); border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px 16px 12px 20px; margin: 0 0 20px; }
.strip-text { flex: 1 1 280px; min-width: 0; display: grid; gap: 2px; }
.strip-text b { font-size: 14.5px; font-weight: 600; }
.strip-text .hint { margin: 0; font-size: 13px; }
.strip .bm { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.strip .bm li { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; font-size: 13.5px; font-weight: 600; }
.strip .bm li small { display: none; }
.strip .bm .secondary { max-width: none; padding: 8px 12px; font-size: 13.5px; }
.strip .strip-help { flex: none; border: 0; margin: 0; padding: 0; }
.strip .strip-help[open] { flex: 1 1 100%; }
.strip .code-field { flex: 1 1 100%; margin: 0; }
/* «Мои оценки»: the home page of service mode. */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0 auto 0 0; }
.section-title .evaluation-new { flex: none; margin-left: 0; }
/* «Сообщить о проблеме» (service mode): the last item of a step title, before «Новая оценка» in the list header. */
.section-title > .problem-button { flex: none; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.section-title > .problem-button:hover { color: var(--accent); }
.section-title > .help + .problem-button { margin-left: 0; }
.section-title > .problem-button + .evaluation-new { margin-left: 0; }
.problem-sent { flex: none; font-size: 12.5px; font-weight: 560; color: var(--accent); }
.problem-dialog { width: min(440px, calc(100vw - 32px)); box-sizing: border-box; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.problem-dialog::backdrop { background: rgba(23, 41, 35, .35); }
.problem-form { margin: 0; }
.problem-label { margin-bottom: 0; }
.problem-hint { margin: 8px 0 16px; }
.problem-error { margin: 0 0 16px; }
.problem-actions { display: flex; align-items: center; gap: 8px; }
.problem-actions .text-button { margin-left: 0; }
@media (max-width: 560px) {
  .section-title > .help + .problem-button { margin-left: auto; }
  .section-title > .text-button + .help + .problem-button { margin-left: 0; }
}
.evaluations-warning { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--accent-tint); border: 1px solid var(--accent-line); font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.panel.list-panel { padding: 0; overflow: hidden; }
.list-panel:has(> .evaluation-list:empty) { display: none; }
.evaluation-list { list-style: none; margin: 0; padding: 0; }
.evaluation-list:empty { display: none; }
.evaluation-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 24px; border-top: 1px solid var(--line); }
.evaluation-row:first-child { border-top: 0; }
.evaluation-row:hover { background: var(--card-soft); }
.evaluation-link { flex: 1 1 260px; min-width: 0; display: flex; align-items: baseline; gap: 16px; color: var(--ink); text-decoration: none; }
.evaluation-link:hover .evaluation-title { color: var(--accent); }
.evaluation-link:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }
.evaluation-number { flex: none; width: 44px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.evaluation-main { display: grid; gap: 2px; min-width: 0; }
.evaluation-title { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.evaluation-note { font-size: 13.5px; color: var(--muted); }
.evaluation-note:empty { display: none; }
.admin-person { padding: 16px 24px 8px; border-top: 1px solid var(--line); }
.admin-person h3 { margin: 0 0 4px; }
.admin-person .evaluation-row { padding-left: 0; padding-right: 0; }
/* The first visit: three steps instead of the list. */
.onboarding { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.onboarding-step { display: grid; gap: 10px; align-content: start; justify-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 22px; box-shadow: var(--shadow); }
.onboarding-step b { font-size: 17px; font-weight: 650; }
.onboarding-step p { margin: 0; font-size: 14px; color: var(--ink-2); }
.onboarding-number { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 700; }
.onboarding-step.done .onboarding-number { background: var(--accent); color: #fff; }
@media (max-width: 960px) { .onboarding { grid-template-columns: 1fr; } }
main { max-width: var(--page); margin: 0 auto; padding: 28px 24px 72px; }
.eyebrow { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--accent); }

/* Layout and panels */
.workspace { display: block; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
/* Steps 04 and 05: full-width panels below the workspace; under the table, actions left and a summary right. */
.wide { margin-bottom: 18px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; margin-top: 18px; }
.two-col > * > :first-child { margin-top: 0; }
.two-col > * > .disclosure:first-child { border-top: 0; padding-top: 0; }
.section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; margin: 0; }
h2 { font-size: 19px; line-height: 1.3; letter-spacing: -.01em; font-weight: 650; margin: 0; }
h3 { font-size: 15px; line-height: 1.35; font-weight: 650; margin: 0 0 14px; }
.step { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* «?» at the end of a step title opens one help block right under the title. */
.help { flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin-left: auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.text-button + .help, .cma-basis:not(:empty) + .help { margin-left: 0; }
.section-title > .text-button[hidden] + .help { margin-left: auto; }
.help:hover { color: var(--accent); border-color: var(--accent); }
.help:focus-visible { outline: none; box-shadow: var(--ring); }
.help[aria-expanded=true] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.step-help { background: var(--card-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px; line-height: 1.6; color: var(--ink-2); margin: -6px 0 20px; }
.step-help p { margin: 8px 0 0; }
.step-help > :first-child { margin-top: 0; }
.step-help .setup-steps { margin: 6px 0 0; }
.step-help .secondary { margin-top: 10px; }

/* Form controls */
label { display: block; font-size: 13px; font-weight: 560; color: var(--ink-2); margin: 0 0 18px; }
input, textarea, select { display: block; width: 100%; margin-top: 7px; background: #fff; border: 1px solid var(--line-strong); border-radius: 9px; padding: 11px 12px; font: inherit; font-size: 15px; font-weight: 400; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
input:hover, textarea:hover, select:hover { border-color: #BDB6A7; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: var(--ring); }
input[aria-invalid=true] { border-color: var(--error-ink); box-shadow: 0 0 0 3px rgba(152, 58, 42, .14); }
input:disabled, textarea:disabled, select:disabled { background: #F3F1EC; color: var(--muted); cursor: not-allowed; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
textarea { resize: vertical; line-height: 1.5; }
select { cursor: pointer; }
.fields { display: grid; gap: 16px; }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.fields > label { margin-bottom: 0; }
.fields + .fields, .fields + .checkbox, .fields + .disclosure, .fields + .acts { margin-top: 18px; }
.optional { font-weight: 400; color: var(--muted); }
.field-note { display: block; font-size: 12.5px; margin-top: 6px; line-height: 1.5; }
.checkbox { display: flex; align-items: center; gap: 9px; font-weight: 450; margin-bottom: 0; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 10px 0 0; }
.hint.lead { margin: 0 0 16px; font-size: 15px; }

/* Buttons: primary (filled), ordinary (outlined), quiet (text). Neighbours sit in a wrapping row with a gap
   of at least 12px (.acts); no button carries a negative margin. */
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 600; padding: 12px 20px; cursor: pointer; text-decoration: none; transition: background .15s, box-shadow .15s; }
.primary:hover { background: var(--accent-hover); color: #fff; }
.primary:active { background: var(--accent-press); }
.primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.primary:disabled { background: #94B0A8; border-color: #94B0A8; cursor: not-allowed; }
.primary span { font-size: 16px; line-height: 1; }
.secondary, .action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--card); color: var(--accent); border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 600; padding: 10px 16px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; }
.secondary:hover, .action:hover { border-color: var(--accent); background: var(--accent-tint); }
.secondary:active, .action:active { background: var(--accent-soft); }
.secondary:focus-visible, .action:focus-visible { outline: none; box-shadow: var(--ring); }
.secondary:disabled, .action:disabled { color: var(--muted); background: #F3F1EC; border-color: var(--line); cursor: not-allowed; }
.secondary[data-copied] { border-color: var(--accent); background: var(--accent-soft); }
.action { border-color: var(--accent); }
.small { font-size: 13.5px; padding: 8px 12px; }
.text-button { margin-left: auto; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s; }
.text-button:hover { background: var(--accent-tint); }
.text-button:focus-visible { outline: none; box-shadow: var(--ring); }
.text-button.muted { color: var(--muted); font-weight: 500; }
.text-button.muted:hover { color: var(--accent); }
.text-button.danger:hover { background: var(--error-bg); color: var(--error-ink); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.acts > .text-button, .acts > .help { margin-left: 0; }
.spacer { flex: 1 1 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.draft { background: #EFECE4; color: var(--muted); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.local-note { font-size: 12.5px; text-align: center; color: var(--muted); margin: 12px 0 28px; }

/* Segmented switches: entry modes of step 01 (buttons), data source of step 03 (labels around hidden radios) */
.entry-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #F1EEE7; border-radius: 12px; padding: 4px; margin: -4px 0 22px; }
.entry-mode { margin: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 10px 12px; font: inherit; font-size: 14px; font-weight: 560; text-align: center; cursor: pointer; transition: background .15s, color .15s; }
.entry-mode:hover { color: var(--ink); }
.entry-mode.active { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(23, 41, 35, .12); }
.entry-mode:has(input:checked) { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(23, 41, 35, .12); }
.entry-mode:focus-visible { outline: none; box-shadow: var(--ring); }
.entry-mode:has(input:focus-visible) { box-shadow: var(--ring); }
#listing-fields { margin-bottom: 22px; }
.listing-help { margin: 16px 0 0; }
.import-status { background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); padding: 12px 14px; color: var(--ink-2); font-size: 13px; line-height: 1.55; margin: -6px 0 18px; }
#import-status { white-space: pre-line; }
/* Step 01: «Для презентации» — subject fields used only by the client presentation */
.sub-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: 0 0 14px; }
.sub-title h3 { margin: 0; }
.sub-title .optional { font-size: 13.5px; }
#manual-search-status { margin: 14px 0 0; }
#manual-search-status[data-error=true] { background: var(--error-bg); border-color: var(--error-line); color: var(--error-ink); }
/* Service mode, step 02: «Найти аналоги», «Отменить поиск» and the line of the search job. */
.search-actions { margin-top: 4px; }
/* Found analogs: «Найти заново» is an ordinary button, the way on is «Подобрать аналоги» below the step. */
#search-panel:has(#search-status[data-analogs="yes"]) #find-analogs { background: var(--card); color: var(--accent); border-color: var(--line-strong); }
#search-panel:has(#search-status[data-analogs="yes"]) #find-analogs:hover { border-color: var(--accent); background: var(--accent-tint); }
#search-status:is([data-state=queued], [data-state=running]) { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; }
#search-status:is([data-state=queued], [data-state=running])::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.form-next { justify-content: flex-end; margin: 0 0 20px; }
.action:disabled { color: var(--muted); border-color: var(--line-strong); background: #F3F1EC; cursor: not-allowed; }
#search-status { margin: 14px 0 0; }
#search-status:is([data-state=error], [data-state=too_many], [data-state=empty], [data-state=failed]) { background: var(--error-bg); border-color: var(--error-line); color: var(--error-ink); }

/* Step 02: search */
.search-summary { background: var(--card-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 18px 0 16px; }
.summary-label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
#search-summary-text { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.setup-steps { font-size: 13px; line-height: 1.65; color: var(--ink-2); padding-left: 20px; margin: 0 0 12px; }
.setup-steps li + li { margin-top: 4px; }
.code-field { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; margin-top: 12px; }
#search-params-code { font-size: 12px; margin-top: 12px; }

/* Disclosures */
.disclosure { border-top: 1px solid var(--line); margin: 18px 0 0; padding-top: 14px; }
.disclosure > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent); border-radius: 7px; padding: 2px 0; width: fit-content; max-width: 100%; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; margin: 0 2px; }
.disclosure[open] > summary::before { transform: rotate(45deg) translate(-1px, -1px); }
.disclosure > summary:hover { color: var(--accent-hover); }
.disclosure > summary:focus-visible { outline: none; box-shadow: var(--ring); }
.disclosure-body { padding-top: 14px; }
.disclosure-body > :last-child, .disclosure-body > .fields:last-child > label { margin-bottom: 0; }
/* Panel «Закладки для браузера» in the side column: name and place of use, one copy button per row. */
.bm { list-style: none; margin: 10px 0 0; padding: 0; }
.bm li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.bm li:first-child { border-top: 0; }
.bm small { display: block; color: var(--muted); font-size: 11.5px; }
.bm .secondary { padding: 6px 10px; font-size: 12px; line-height: 1.3; max-width: 150px; text-align: center; }

/* Step 03: data for analysis; the source switch is a fieldset styled as .entry-modes */
.source-switch { border: 0; min-width: 0; }
.load-status { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 12px; align-items: start; background: var(--card-soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 14px; }
.load-status::before { content: ""; grid-row: 1 / span 2; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px dashed var(--line-strong); display: grid; place-items: center; font-size: 13px; font-weight: 800; line-height: 1; color: #fff; box-sizing: border-box; }
.load-title { font-size: 14.5px; font-weight: 640; color: var(--ink); overflow-wrap: anywhere; }
.load-detail { font-size: 13px; color: var(--muted); line-height: 1.55; margin-top: 2px; overflow-wrap: anywhere; }
.load-detail:empty { display: none; }
.load-status[data-state="loading"]::before { border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.load-status[data-state="ok"] { background: var(--accent-tint); border-color: var(--accent-line); }
.load-status[data-state="ok"]::before { content: "✓"; border: 0; background: var(--accent); }
.load-status[data-state="error"] { background: var(--error-bg); border-color: var(--error-line); }
.load-status[data-state="error"]::before { content: "!"; border: 0; background: var(--error-ink); }
.load-status[data-state="error"] .load-title { color: var(--error-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .load-status[data-state="loading"]::before { animation-duration: 2.4s; } }
.load-file { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 4px; }
.load-file .hint { margin: 0; }
.load-file label { margin: 0; }
.file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; opacity: 0; }
.file-input:focus-visible + label { box-shadow: var(--ring); border-color: var(--accent); }
#sheet-input { margin: 16px 0 0; }

/* Objects preview */
#groups-preview { max-height: 460px; overflow: auto; overscroll-behavior: contain; }
.preview-warnings { margin: 0 0 12px; padding: 10px 14px 10px 30px; background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; color: var(--warn-ink); }
.group-object { border-top: 1px solid var(--line); padding: 10px 0; }
.group-object:first-of-type { border-top: 0; }
.group-object summary { cursor: pointer; line-height: 1.5; font-size: 13.5px; color: var(--ink); padding: 2px 0; border-radius: 6px; }
.group-object summary:focus-visible { outline: none; box-shadow: var(--ring); }
.group-object .table-scroll table { min-width: 540px; }
.group-object th, .group-object td { text-align: left; }
.group-object th:nth-child(2), .group-object td:nth-child(2), .group-object th:nth-child(4), .group-object td:nth-child(4) { text-align: right; }

/* Errors */
.error { background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-ink); border-radius: var(--radius-sm); padding: 14px 16px; font-size: 13.5px; line-height: 1.55; margin-bottom: 18px; }

/* Tables */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { font-size: 11.5px; color: var(--muted); font-weight: 600; background: #F5F3EE; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th:last-child, td:last-child, th:nth-child(3), td:nth-child(3) { text-align: right; }

/* Step 04: analogues and estimate */
.cma-basis { margin-left: auto; font-size: 12px; font-weight: 560; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 6px 12px; }
.cma-basis:empty { display: none; }
.cma-warning { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.6; color: var(--warn-ink); margin: 0 0 16px; }
.cma-table { font-size: 13.5px; min-width: 940px; }
.cma-table.compact { min-width: 680px; }
.cma-table .cma-return { font-size: 12.5px; padding: 6px 10px; min-height: 0; white-space: nowrap; }
.cma-return-blocked { font-size: 12px; color: var(--muted); }
.cma-returned { font-size: 12px; color: var(--warn-ink); margin-top: 3px; }
.cma-table th, .cma-table td { padding: 12px 10px; text-align: left; }
.cma-table th { white-space: nowrap; line-height: 1.3; }
.cma-table td:first-child, .cma-table th:first-child { width: 40px; padding-left: 14px; }
.cma-table:not(.compact) td:nth-child(2), .cma-table:not(.compact) th:nth-child(2) { width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cma-table .cma-num, .cma-table .cma-unit { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cma-table:not(.compact) th:nth-child(4), .cma-table:not(.compact) th:nth-child(9), .cma-table:not(.compact) th:nth-child(10) { text-align: right; }
.cma-table .cma-unit { font-weight: 650; }
.cma-table .cma-num small { display: block; font-size: 12px; color: var(--muted); }
.cma-address { font-weight: 550; }
.cma-table input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.cma-notes .cma-description-toggle { color: var(--warn-ink); margin-top: 0; padding: 4px 10px; border: 1px solid var(--warn-line); border-radius: 999px; background: var(--warn-bg); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.cma-notes-list p { color: var(--warn-ink); }
.cma-reserve-row { background: #FDF9EE; }
.cma-subject-row { background: var(--accent-tint); }
.cma-subject-row td { border-bottom: 1px solid var(--accent-line); font-weight: 560; }
.cma-subject-row .cma-object-id { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.cma-subject-row td.cma-subject-price-note { font-size: 11.5px; font-weight: 400; color: var(--muted); line-height: 1.35; }
/* The scroll wrapper must not be a scroll container, or sticky cells would pin to it, not the window. */
.table-scroll:has(> .cma-table) { overflow-x: clip; }
/* When the table is still wider than the page (long addresses, a narrow window), it scrolls
 * sideways instead of losing its last columns; the script sets the class after measuring. */
.table-scroll.cma-overflow:has(> .cma-table) { overflow-x: auto; }
/* Inside a sideways scroll the cells pin to the box, not the window: no offset for the step bar there. */
.table-scroll.cma-overflow .cma-table th { top: 0; }
.table-scroll.cma-overflow .cma-subject-row td { top: var(--cma-head, 38px); }
.cma-table th { position: sticky; top: var(--stepbar); z-index: 2; box-shadow: inset 0 -1px 0 var(--line); border-bottom: 0; }
.cma-subject-row td { position: sticky; top: calc(var(--stepbar) + var(--cma-head, 38px)); z-index: 1; background: var(--accent-tint); box-shadow: inset 0 -1px 0 var(--accent-line), 0 0 0 .5px var(--accent-tint); border-bottom: 0; }
.cma-diff { text-decoration: underline dotted; text-decoration-color: #B9B0A0; text-underline-offset: 3px; cursor: help; }
.cma-source-link { font-size: 12px; font-weight: 560; color: var(--accent); text-decoration: none; white-space: nowrap; border-radius: 4px; }
.cma-source-link:hover { color: var(--accent-hover); text-decoration: underline; }
.cma-source-link:focus-visible { outline: none; box-shadow: var(--ring); }
.cma-source-link.cma-source-generic { color: var(--muted); font-weight: 400; }
.cma-object-id { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
div.cma-sources { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
td.cma-sources { white-space: nowrap; }
td.cma-sources div + div { margin-top: 3px; }
.cma-source-plain { font-size: 12px; color: var(--muted); }
.cma-description-toggle { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; color: var(--accent); cursor: pointer; border-radius: 6px; }
.cma-description-toggle::before { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.cma-description-toggle[aria-expanded=true]::before { transform: rotate(45deg) translate(-1px, -1px); }
.cma-description-toggle:hover { color: var(--accent-hover); }
.cma-description-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.cma-table tr.cma-open td { border-bottom: 0; }
.cma-description-row td { padding: 0 12px 14px 84px; }
.cma-description-row .cma-description + .cma-description { margin-top: 8px; }
.cma-description { background: var(--card-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; max-width: 72ch; }
.cma-description-id { font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.cma-description-id:first-child { margin-top: 0; }
.cma-description p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--ink); white-space: pre-line; }
.cma-description p + p, .cma-description-id + p { margin-top: 4px; }
/* The counters above the table. */
.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tile { display: flex; align-items: baseline; gap: 8px; background: var(--card-soft); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-size: 13.5px; color: var(--muted); }
.tile b { font-size: 17px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.tile-on { background: var(--accent-tint); border-color: var(--accent-line); }
.tile-on b { color: var(--accent); }
/* The result of the step: figures on the left, the chart on the right (the policy notes stay in the PDF). */
.cma-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px; align-items: start; background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: 14px; padding: 22px 24px; margin-top: 20px; }
.cma-headline { font-size: 30px; font-weight: 700; color: var(--accent); letter-spacing: -.02em; line-height: 1.15; }
.cma-headline.muted { color: var(--muted); font-size: 22px; }
.cma-result p { margin: 10px 0 0; font-size: 14px; line-height: 1.55; }
.cma-strong { font-weight: 650; }
.cma-result .cma-strong { font-size: 16px; }
.cma-status { color: var(--accent-press); }
.cma-chart svg { width: 100%; height: auto; display: block; }
.cma-chart .grid { stroke: #DCE6E1; stroke-width: 1; }
.cma-chart .band { fill: #D3E5DD; }
.cma-chart .median { stroke: var(--ink); stroke-width: 1.6; }
.cma-chart .span { stroke: #8C9792; stroke-width: 1.2; }
.cma-chart .dot { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.cma-chart .outlier { fill: var(--ink); stroke: #fff; stroke-width: 1.5; }
.cma-chart .label, .cma-chart .axis { font-size: 11.5px; fill: var(--muted); }
/* The sticky line of the step: what is in the estimate now, and the one action. It stays inside .zone, so it
   never rises over the title of the step. */
.zone { min-width: 0; }
.dock { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin: 20px -28px -28px; padding: 14px 28px; background: var(--card); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -8px 20px rgba(23, 41, 35, .06); }
.dock-facts { flex: 1 1 320px; display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.dock-facts b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.dock .hint, .dock .cma-done { flex: 1 1 280px; margin: 0; }
.dock .primary { white-space: normal; text-align: left; }
#cma-confirm { display: inline-flex; width: auto; padding: 12px 20px; border-radius: 10px; font-size: 14.5px; }
.cma-note { margin-top: 18px; }
#cma-error { margin: 16px 0; }
#cma-error div + div { margin-top: 4px; }
/* One line of links under the button that produced the files (report in 04, presentation in 05). */
.cma-done { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 18px; margin-top: 12px; font-size: 13px; }
.cma-done .hint { flex-basis: 100%; margin: 0; }
/* Service mode, the evaluation page: its state line, «Изменить подбор» over the selection, the presentations list. */
.evaluation-line { background: var(--accent-tint); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 18px; color: var(--ink-2); font-size: 14px; }
.pr-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.pr-list li + li { margin-top: 6px; }

/* Screen-reader-only text */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Agent page (/agent): three cards of fields on the left, the slide miniature and «Сохранить» in a rail that
   stays on the screen. */
.back-link { font-size: 14px; font-weight: 600; text-decoration: none; }
.agent-page .page-head { margin-bottom: 12px; }
.agent-page .page-head .hint { margin: 0; }
.agent-page > .ag-profiles { margin: 0 0 20px; }
.agent-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.agent-col { min-width: 0; }
.agent-col .panel > h2 { margin-bottom: 18px; }
.agent-col .panel > label, .agent-col .panel > .fields { margin-bottom: 16px; }
.agent-col .panel > .fields:last-child, .agent-col .panel > label:last-child { margin-bottom: 0; }
.agent-rail { position: sticky; top: 20px; display: grid; gap: 16px; min-width: 0; }
.agent-rail .panel { margin: 0; padding: 16px; }
.agent-save { display: grid; gap: 12px; justify-items: center; }
.agent-save .primary { width: 100%; }
.agent-save .error { width: 100%; margin: 0; }
.agent-save .hint { margin: 0; text-align: center; }
.agent-save .hint:empty { display: none; }
.agent-save .text-button { margin-left: 0; }
.agent-head { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-bottom: 20px; }
.agent-head img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(23, 41, 35, .12); }
/* In place of a missing photo: a round placeholder with the initials */
.agent-head .ag-initials { width: 88px; height: 88px; font-size: 28px; letter-spacing: .02em; }
.agent-head b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.agent-head .role { font-size: 14px; color: var(--muted); }
.agent-head .photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.agent-head .photo-actions label { margin: 0; }
.agent-head .photo-actions .hint { margin: 0; }
.benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.benefit { display: grid; gap: 8px; background: var(--card-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; }
.benefit label { margin: 0; font-size: 12.5px; }
.offer-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.offer-row .pr-offer label { margin: 0; }
.offer-row .pr-offer:has(input[type=radio]:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--card); }
.pr-offer-head b { font-size: 14px; font-weight: 650; }
.offer-row + .fields { margin-bottom: 16px; }
.agent-col .pr-block > label { margin-bottom: 14px; }
.agent-col .pr-block > label.checkbox { margin-bottom: 0; }
.weeks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; }
.weeks label { margin: 0; }
.swatch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; margin: 0; }
.swatch i { display: block; width: 44px; height: 44px; border-radius: 10px; background: #5343DF; border: 1px solid rgba(0, 0, 0, .12); box-shadow: inset 0 0 0 3px #fff; }
.swatch input[type=color] { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; padding: 0; border: 0; }
.swatch input[type=color]:focus-visible + i { box-shadow: inset 0 0 0 3px #fff, var(--ring); }
.swatch code { font-size: 14px; font-family: ui-monospace, Menlo, monospace; background: none; padding: 0; }
.swatch small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
/* The miniature of slide «Агент» (slide-preview.js): an SVG of the slide in a 16:9 frame; the text of the slide is
   set in the same Inter the PDF uses. A slide that does not fit keeps its last picture, dimmed. */
.slide-mini { display: grid; gap: 10px; min-width: 0; }
.slide-mini .sub-title { margin: 0; }
.slide-mini .hint { margin: 0; font-size: 12.5px; }
.slide-frame { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: #F1F2F0; overflow: hidden; cursor: zoom-in; }
.slide-frame:focus-visible { outline: none; box-shadow: var(--ring); }
.slide-svg { display: block; width: 100%; height: auto; }
.slide-text { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.slide-mini[data-state=stale] .slide-frame { opacity: .45; }
.slide-note { margin: 0; padding: 10px 12px; font-size: 13px; }
.pr-offers-common > .slide-mini { background: var(--card-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.slide-dialog { width: min(1040px, calc(100vw - 32px)); padding: 16px; border: 0; border-radius: var(--radius); background: var(--card); box-shadow: 0 24px 80px rgba(23, 41, 35, .3); }
.slide-dialog::backdrop { background: rgba(23, 41, 35, .45); }
.slide-large { border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
#ag-error { margin: 0; }
/* Profile chips (also on step 05 of the main page) */
.ag-profiles { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-chip { display: inline-flex; align-items: center; gap: 9px; font: inherit; font-size: 13px; font-weight: 560; line-height: 1.3; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 16px 4px 4px; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.ag-chip:hover { border-color: var(--accent); }
.ag-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.ag-chip img, .ag-initials { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.ag-initials { display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); }
.ag-chip small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; line-height: 1.2; }
.ag-chip[aria-pressed=true] { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.ag-chip.add { padding: 4px 16px; min-height: 42px; color: var(--accent); border-style: dashed; }
/* Company logo block: the grey box is the slide background */
.ag-logo { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: center; }
.ag-logo-box { height: 76px; display: grid; place-items: center; background: #F1F2F0; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--placeholder); font-size: 12px; }
.ag-logo-box img { max-width: 104px; max-height: 52px; }
.ag-logo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ag-logo-actions label { margin: 0; }
.ag-logo-actions .text-button { margin-left: 0; }
.ag-logo .hint { margin: 8px 0 0; }
.ag-logo-actions .hint { margin: 0; }
/* Photo and logo of an unsaved new agent: the file input is disabled, its label looks like .secondary:disabled */
.file-input:disabled + label.secondary { color: var(--muted); background: #F3F1EC; border-color: var(--line); cursor: not-allowed; pointer-events: none; }
@media (max-width: 1100px) {
  .agent-grid { grid-template-columns: 1fr; }
  .agent-rail { position: static; order: -1; }
}
@media (max-width: 960px) { .offer-row { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .ag-logo { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .benefits { grid-template-columns: 1fr; }
  .weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Client presentation: photo slots of step 01, step 05 */
.pr-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.pr-photo-slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; background: var(--card-soft); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px; }
.pr-photo-slot:has(img) { background: var(--card); border-style: solid; border-color: var(--line); }
.pr-photo-slot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
/* An empty place: the whole tile is the button that opens the file dialog. */
.pr-photo-add { display: grid; place-items: center; aspect-ratio: 4 / 3; margin: 0; font-size: 14px; font-weight: 600; color: var(--accent); border-radius: 8px; cursor: pointer; }
.pr-photo-add:hover { background: var(--accent-tint); }
.file-input:disabled + .pr-photo-add, .file-input:disabled + label.text-button { color: var(--muted); cursor: not-allowed; pointer-events: none; }
.pr-photo-acts { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.pr-photo-acts label { margin: 0; cursor: pointer; }
.pr-photo-acts .text-button { margin: 0; padding: 2px 0; font-size: 13px; white-space: nowrap; }
.pr-photo-slot .hint { margin: 0; padding: 0 2px 2px; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Gallery of the imported Cian listing under the slots */
.pr-gallery { margin: -4px 0 16px; }
.pr-gallery .hint { margin: 0 0 8px; }
.pr-gallery-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.pr-gallery-item { position: relative; width: auto; padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--card-soft); cursor: pointer; overflow: hidden; }
.pr-gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pr-gallery-item:hover { border-color: var(--line-strong); }
.pr-gallery-item:focus-visible { outline: none; box-shadow: var(--ring); }
.pr-gallery-item[aria-pressed="true"] { border-color: var(--accent); }
.pr-gallery-item:disabled { opacity: .5; cursor: progress; }
.pr-gallery-item small { position: absolute; left: 6px; bottom: 6px; font-size: 11px; line-height: 1.3; color: var(--ink-2); background: rgba(255, 255, 255, .92); border-radius: 4px; padding: 1px 5px; }
.pr-gallery-item b { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; display: grid; place-items: center; font-size: 12px; color: #fff; background: var(--accent); border-radius: 50%; }
.pr-table td:nth-child(5) { white-space: nowrap; text-align: right; }
.pr-table th:nth-child(3), .pr-table td:nth-child(3), .pr-table th:last-child, .pr-table td:last-child { text-align: left; }
.pr-table input[type=text], .pr-table input[type=number] { margin-top: 0; padding: 7px 9px; font-size: 13px; min-width: 120px; }
.pr-unchanged { font-size: 13.5px; }
.pr-table .checkbox { font-size: 12px; margin-top: 6px; }
.pr-table .checkbox input { width: 15px; height: 15px; }
.pr-muted-row td { color: var(--muted); }
#pr-competitors-note:empty { display: none; }
.pr-strategy { border: 0; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; min-width: 0; }
.pr-strategy .checkbox { align-items: flex-start; gap: 10px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.pr-strategy .checkbox input { margin-top: 3px; }
.pr-strategy .checkbox small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.pr-strategy .checkbox:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent); }
.pr-own-range { border-top: 0; margin-top: 0; padding-top: 4px; }
#pr-error { margin: 16px 0; }
/* Step 05: the agent chips, «3 | 5» competitors on the slide, the slide cards; the chosen agent in the header */
.pr-agent { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0; }
.pr-agent a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pr-agent .ag-chip:disabled { opacity: .6; cursor: not-allowed; border-color: var(--line-strong); }
.pr-count { display: inline-grid; grid-auto-flow: column; gap: 3px; background: #F1EEE7; border-radius: 10px; padding: 3px; align-self: center; }
.pr-count button { border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 16px; cursor: pointer; }
.pr-count button:focus-visible { outline: none; box-shadow: var(--ring); }
.pr-count button[aria-pressed=true] { background: #fff; color: var(--accent); box-shadow: 0 1px 3px rgba(23, 41, 35, .12); }
.pr-count-label { margin-left: auto; font-size: 13px; color: var(--ink-2); font-weight: 560; align-self: center; }
.pr-slides { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.pr-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 720px; }
.pr-preset { text-align: left; font: inherit; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.pr-preset b { display: block; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.pr-preset small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.pr-preset:hover { border-color: var(--accent-line); }
.pr-preset:focus-visible { outline: none; box-shadow: var(--ring); }
.pr-preset[aria-pressed=true] { background: var(--accent-tint); border: 1px solid var(--accent); }
.pr-preset[aria-pressed=true] b { color: var(--accent); }
#pr-presets-note { margin: 8px 0 0; }
.pr-slides-manual .disclosure-body > .hint:first-child { margin-top: 0; }
.pr-slide { position: relative; display: block; margin: 0; background: var(--accent-tint); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 12px 13px; cursor: pointer; transition: background .15s, border-color .15s; }
.pr-slide input { position: absolute; top: 11px; right: 11px; width: 17px; height: 17px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.pr-slide .num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; font-size: 12px; font-weight: 700; color: var(--accent); background: #fff; border: 1px solid var(--accent-line); border-radius: 7px; font-variant-numeric: tabular-nums; }
.pr-slide b { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink); margin-top: 9px; line-height: 1.3; }
.pr-slide small { display: block; font-size: 11.5px; font-weight: 400; color: var(--muted); line-height: 1.4; margin-top: 3px; }
.pr-slide:not(:has(input:checked)) { background: #F6F4EF; border: 1px dashed var(--line-strong); }
.pr-slide:not(:has(input:checked)) b { color: var(--muted); text-decoration: line-through; }
.pr-slide:not(:has(input:checked)) .num { color: var(--muted); border-color: var(--line); }
.pr-slide.locked, .pr-slide.locked input { cursor: default; }
.pr-slide em { display: block; font-style: normal; font-size: 11px; font-weight: 600; color: var(--accent); margin-top: 6px; }
.pr-slides-total { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; }
.pr-block { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.pr-block.pr-first { margin-top: 0; padding-top: 0; border-top: 0; }
/* «Квартира на слайдах»: the three photos on the left, the details on the right. */
.pr-flat { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 24px; align-items: start; }
.pr-flat .pr-photos { margin-bottom: 0; }
/* The listing's photos run the full width under both columns. */
.pr-block > .pr-gallery { margin: 16px 0 0; }
@media (max-width: 1180px) { .pr-flat .fields.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pr-flat .pr-unchanged { margin: 12px 0 0; }
/* The common fields of the client's options with the slide miniature beside them. */
.pr-offers-common { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.pr-offers-common:has(> .slide-mini[hidden]) { grid-template-columns: minmax(0, 1fr); }
.pr-offers-common .cma-note { margin-top: 0; }
/* The last row of the step: the action, or what is missing for it; what was made. */
.pr-final { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; padding: 16px 20px; background: var(--card-soft); border: 1px solid var(--line); border-radius: 12px; }
.pr-need-profile { flex: 1 1 100%; }
.pr-need-profile .fields { max-width: 640px; margin-top: 10px; }
.pr-contacts-lead { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--warn-ink); }
.pr-contacts-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; margin: 8px 0 0; }
.pr-contacts-foot a { font-size: 13px; font-weight: 600; text-decoration: none; }
#pr-contact-hint { display: block; margin-top: 4px; color: var(--warn-ink); }
#pr-contact-hint[hidden], #pr-contact-status:empty { display: none; }
.pr-agent-line { margin: 0; font-size: 15px; color: var(--ink-2); }
.pr-agent-line b { color: var(--ink); font-weight: 650; }
.pr-agent-line a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.pr-made { flex: 1 1 320px; min-width: 0; }
.pr-made .cma-done { margin-top: 0; }
.pr-made .pr-list { margin: 6px 0 0; }
.pr-made .pr-list:first-child { margin-top: 0; }
@media (max-width: 1100px) { .pr-slides { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 620px) { .pr-slides { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pr-presets { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .pr-photos { grid-template-columns: 1fr; } }

/* Responsive */
@media (max-width: 980px) {
  .two-col, .cma-summary, .pr-flat, .pr-offers-common, .pr-strategy { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  main { padding: 30px 20px 24px; }
  .site-header-inner, .stepbar-inner { padding-left: 20px; padding-right: 20px; }
  .panel { padding: 22px; }
  .dock { margin: 18px -22px -22px; padding: 12px 22px; }
  .three, .four, .five { grid-template-columns: 1fr 1fr; }
  .span-3 { grid-column: span 2; }
  .stepbar { position: static; }
  :root { --stepbar: 0px; }
  .flow a { padding: 4px; font-size: 0; gap: 0; }
}
@media (max-width: 560px) {
  main { padding: 24px 16px 20px; }
  .site-header-inner, .stepbar-inner { padding-left: 16px; padding-right: 16px; gap: 8px 16px; }
  .nav a { padding: 8px 10px; }
  .service-user-name { max-width: 110px; }
  /* The term of access goes under the name: next to it the row would push «Выйти» off a phone screen. */
  .service-user { flex-wrap: wrap; row-gap: 2px; }
  .service-term { order: 1; flex-basis: 100%; white-space: normal; }
  .service-notice-inner { padding: 6px 16px; }
  .panel { padding: 18px; border-radius: 14px; }
  .section-title { flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
  /* The «?» stays at the right of the first title row (30px high: the step badge) while the rest wraps. */
  .section-title:has(> .help) { position: relative; padding-right: 34px; }
  .section-title:has(> .help) > .help { position: absolute; right: 0; top: 2px; margin: 0; }
  h2 { font-size: 18px; }
  .text-button { font-size: 12.5px; padding: 6px 2px; }
  .two, .three, .four, .five { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  input, textarea, select { font-size: 16px; }
  .action { width: 100%; justify-content: space-between; }
  .entry-mode { font-size: 13px; padding: 10px 8px; }
  .cma-basis { margin-left: 0; }
  .cma-summary { padding: 16px; }
  .dock { margin: 16px -18px -18px; padding: 12px 18px; }
}

/* The cow in the corner: decorative, never in the way of clicks. */
.margin-cow { position: fixed; left: 6px; bottom: 6px; width: 72px; height: auto; z-index: 5; pointer-events: none; }

/* Step 05: cooperation options for this client (service mode) — three editors of the cards of slide «Агент» */
.pr-offers-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.pr-offers-editors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.pr-offer { background: var(--card-soft); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px 14px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pr-offer.off { opacity: .55; }
.pr-offer.rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pr-offer-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-offer label { font-size: 12.5px; }
.pr-offer textarea { resize: vertical; }
.pr-offer textarea:not([rows="2"]) { min-height: 108px; }
@media (max-width: 900px) { .pr-offers-editors { grid-template-columns: 1fr; } }
