:root { --pico-font-size: 95%; }
main.container { max-width: 1100px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.row-between h2 { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.actions button, .actions a[role=button] { margin: 0; padding: .35rem .8rem; font-size: .9rem; }
.muted { color: var(--pico-muted-color); }
.small { font-size: .85rem; }
.big { font-size: 1.25rem; font-weight: bold; }
.num { text-align: right; white-space: nowrap; }
.error { color: #b71c1c; }
.badge { display: inline-block; padding: .1rem .5rem; border-radius: .6rem; font-size: .8rem; background: #e9eef5; white-space: nowrap; }
.st-running { background: #dbeafe; } .st-done { background: #dcfce7; } .st-failed { background: #fee2e2; } .st-cancelled, .st-skipped { background: #f3f4f6; }
.st-queued, .st-pending { background: #fef3c7; }
table.stages td.indent { padding-left: 2rem; }
table.stages tr.region-row td { background: #f8fafc; }
table.stages progress { margin: 0; width: 140px; vertical-align: middle; }
pre.log { font-size: .8rem; height: 55vh; min-height: 160px; max-height: 90vh; resize: vertical; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
pre.log.nowrap { white-space: pre; }
pre.log .ln { display: block; padding: 0 .3rem; }
pre.log .ts { color: var(--pico-muted-color); }
pre.log .lv { color: var(--pico-muted-color); }
pre.log .lr { color: #1d4ed8; }
pre.log .lv-warning { background: #fef3c7; }
pre.log .lv-warning .lv { color: #92400e; font-weight: bold; }
pre.log .lv-error { background: #fee2e2; }
pre.log .lv-error .lv { color: #b71c1c; font-weight: bold; }
.log-bar { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }
.log-bar label, .log-bar select { margin: 0; display: inline-flex; align-items: center; gap: .3rem; }
.log-bar select { width: auto; padding: .15rem 1.8rem .15rem .5rem; font-size: .85rem; height: auto; }
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .2rem 1rem; }
.regions label { margin-bottom: .2rem; }
fieldset { margin-bottom: 1rem; }
form.inline { margin: 0; display: inline-block; }
nav .small-btn { margin: 0; padding: .2rem .7rem; font-size: .85rem; }
.login-box { max-width: 420px; margin: 3rem auto; }
details.inline { display: inline-block; margin: 0; }
details.inline summary { margin: 0; padding: .35rem .8rem; font-size: .9rem; }
details.inline form input { display: inline-block; width: auto; margin: .3rem .3rem 0 0; }
.domain-row { align-items: end; }
.domain-row .submit-col button { margin-bottom: var(--pico-spacing); }
details.settings { margin-top: .5rem; }
details.settings > summary { display: inline-block; width: auto; padding: .35rem .9rem; }
details.settings fieldset { margin-top: 1rem; }

tr.mark td { background: #fff7d6; }

/* структура сайта: таблица-дерево (строки в одну линию, раскрытие подразделов и фраз), бейдж источника узла */
table.tree td { white-space: nowrap; vertical-align: middle; }
table.tree td.node { max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
table.tree button.tg { all: unset; cursor: pointer; display: inline-block; width: 1.1rem; color: var(--pico-muted-color, #777); }
table.tree .tg-empty { display: inline-block; width: 1.1rem; }
table.tree a.ph { margin-left: .5rem; }
table.tree tr.phrases > td { white-space: normal; padding: .2rem 0 .6rem 2.5rem; background: #f8fafc; }
table.tree tr.section-row td { background: #f8fafc; padding-top: .8rem; }
table.phrases { margin: 0; width: auto; }
table.phrases td, table.phrases th { padding: .15rem .6rem; }
.badge-src { font-size: .7rem; padding: 0 .3rem; border: 1px solid var(--pico-muted-border-color, #ccc); border-radius: .3rem; color: var(--pico-muted-color, #777); }
/* блок «Сравнение с конкурентом» (jobs/_compare.html) */
.row-wrap { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 0 0 .6rem; }
.row-wrap label { display: inline-flex; align-items: center; gap: .3rem; margin: 0; }
.row-wrap select, .row-wrap input { margin: 0; width: auto; padding: .15rem .4rem; }
table.compare td.win { font-weight: 600; color: #1d4ed8; }
table.compare tr.theirs td:first-child { color: #b45309; }
table.compare tr.ours td:first-child { color: #047857; }

/* Proposal workspace: results first, detail on demand. */
.job-detail { background: #f5f7fb; color: #243148; --pico-primary: #176c9c; --pico-primary-hover: #11557d; }
.job-detail > header { border-bottom: 1px solid #e1e7ef; }
.job-detail > header.container, .job-detail main.container { max-width: 1280px; }
.job-detail main.container { padding-top: 1.8rem; padding-bottom: 4rem; }
.job-heading h1 { margin: .65rem 0 .25rem; font-size: 2rem; letter-spacing: -.045em; color: #17273e; }
.job-reference, .job-context { color: #69758a; font-size: .85rem; }
.job-context { margin-bottom: .4rem; }
.job-settings { margin: 0 0 1.2rem; }
.job-settings > summary { font-size: .8rem; display: inline-block; color: #69758a; }
.job-settings p { margin: .6rem 0; }
.job-sections { position: sticky; top: 0; z-index: 10; display: flex; justify-content: flex-start; gap: .25rem; overflow-x: auto; padding: .6rem; margin: 0 0 1.2rem; background: #fff; border: 1px solid #e1e7ef; border-radius: 12px; box-shadow: 0 3px 12px #17273e06; }
.job-sections a { flex-shrink: 0; padding: .5rem .8rem; border-radius: 7px; text-decoration: none; font-size: .85rem; color: #526176; }
.job-sections a:hover, .job-sections a:focus-visible { background: #eaf3fa; color: #11557d; }
.job-detail #progress, .report-section, #page-opportunities { scroll-margin-top: 6rem; }
.job-overview, .report-section { background: #fff; border: 1px solid #e1e7ef; border-radius: 14px; box-shadow: 0 3px 16px #17273e04; margin: 0 0 1rem; padding: 1.4rem; }
.job-overview > header { margin: -1.4rem -1.4rem 1.2rem; padding: .85rem 1.4rem; background: transparent; border-bottom: 1px solid #edf0f5; border-radius: 14px 14px 0 0; }
.budget-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.budget-card { margin: 0; padding: 1.2rem 1.35rem; background: #f6f9fc; border: 1px solid #e5edf5; border-radius: 10px; }
.budget-card h3 { font-size: .9rem; font-weight: 600; color: #4b607a; margin: 0 0 .6rem; }
.budget-amount { font-size: 1.85rem; line-height: 1.25; font-weight: 700; letter-spacing: -.035em; color: #1b304c; margin: 0 0 .45rem; }
.budget-amount span { font-size: .85rem; letter-spacing: 0; font-weight: 400; color: #69758a; }
.budget-caption { color: #69758a; font-size: .85rem; margin: 0; }
.budget-caption span { padding: 0 .4rem; }
.budget-downloads { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; margin-top: 1rem; font-size: .85rem; }
.budget-downloads a { text-decoration: none; font-weight: 600; }
.execution-details, .region-summary { margin: 0; padding: .8rem 0; border-top: 1px solid #edf0f5; }
.execution-details > summary, .region-summary > summary { font-size: .85rem; font-weight: 600; }
.execution-details > summary span, .region-summary > summary span { margin-left: .8rem; font-weight: 400; }
.table-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.table-scroll table { margin-bottom: 0; }
.execution-details table { font-size: .85rem; min-width: 680px; }
.execution-details table th { white-space: nowrap; }
.execution-details table td:first-child { min-width: 200px; }
.report-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0; color: #253c57; }
.report-section > summary::after { flex-shrink: 0; }
.report-section > summary b { display: block; font-size: 1.12rem; }
.report-section > summary small { display: block; margin-top: .25rem; font-size: .8rem; color: #738096; font-weight: 400; }
.report-section[open] > summary { margin-bottom: 1.3rem; }
.report-section > div { min-width: 0; overflow-x: auto; }
.section-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; margin-bottom: 1.2rem; }
.section-intro p { max-width: 650px; margin: 0; font-size: .9rem; color: #66758a; }
.download-link { flex-shrink: 0; font-size: .85rem; text-decoration: none; font-weight: 600; padding-top: .1rem; }
.opportunity-filters { margin-bottom: .8rem; }
.filter-chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin-bottom: 1rem; }
.filter-chip { position: relative; margin: 0; cursor: pointer; }
.filter-chip input, .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.filter-chip span { display: flex; align-items: center; gap: .6rem; font-size: .8rem; padding: .45rem .7rem; border: 1px solid #dce3ed; background: #fff; color: #637188; border-radius: 8px; }
.filter-chip b { font-variant-numeric: tabular-nums; font-size: .75rem; }
.filter-chip input:checked + span { border-color: #b7d7ec; background: #eaf4fb; color: #155e8b; }
.filter-chip:hover span { border-color: #90aec8; }
.filter-chip input:focus-visible + span { outline: 2px solid #176c9c; outline-offset: 3px; }
.filter-fields { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.filter-fields label { font-size: .75rem; color: #66758a; margin: 0; }
.filter-fields .page-search { flex: 1; min-width: 220px; }
.filter-fields input, .filter-fields select { margin: .3rem 0 0; height: 2.7rem; font-size: .85rem; padding-top: .45rem; padding-bottom: .45rem; border-radius: 8px; border-color: #dce3ed; background-color: #fff; }
.filter-fields button { width: auto; flex: 0 0 auto; margin: 0; height: 2.7rem; padding: .45rem 1rem; font-size: .85rem; border-radius: 8px; }
.result-count { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; color: #4b607a; font-size: .75rem; margin: 1rem 0 .7rem; }
.page-opportunity { margin: 0 0 .6rem; border: 1px solid #e1e7ef; border-radius: 10px; background: #fff; overflow: hidden; }
.page-opportunity > summary { display: flex; align-items: center; gap: 1.3rem; margin: 0; padding: 1rem 1.15rem; }
.page-opportunity > summary:hover { background: #f8fafd; }
.page-opportunity > summary::after { flex: 0 0 1rem; }
.page-opportunity > summary:focus-visible { outline: 2px solid #176c9c; outline-offset: -3px; }
.page-opportunity[open] > summary { background: #f6f9fc; border-bottom: 1px solid #e1e7ef; }
.page-identity { display: block; flex: 1; min-width: 0; }
.page-eyebrow { display: flex; align-items: center; gap: .65rem; font-size: .72rem; color: #738096; margin-bottom: .45rem; }
.action-badge { display: inline-block; padding: .18rem .45rem; font-size: .7rem; line-height: 1.45; font-weight: 600; border-radius: 5px; background: #f1f3f7; color: #536176; }
.action-split { background: #eeeafd; color: #6853a1; }
.action-optimize { background: #e5f2fc; color: #1e6c9e; }
.action-keep { background: #e3f3ec; color: #286d53; }
.action-review { background: #fff2d6; color: #986717; }
.page-title { display: block; font-size: .95rem; line-height: 1.4; color: #263a54; overflow-wrap: anywhere; font-weight: 600; }
.page-url { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #7d8ba0; font-size: .72rem; margin-top: .3rem; }
.page-metrics { display: grid; grid-template-columns: repeat(3, minmax(80px, 1fr)); gap: .9rem; text-align: right; font-variant-numeric: tabular-nums; }
.page-metrics b { display: block; color: #2f435d; font-size: .98rem; font-weight: 600; }
.page-metrics small { display: block; font-size: .68rem; color: #7d8ba0; margin-top: .15rem; }
.page-expanded { padding: 1.15rem; }
.page-overview { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.page-overview p { margin: 0; font-size: .9rem; }
.page-overview a { flex-shrink: 0; font-size: .8rem; text-decoration: none; }
.page-health { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: .8rem; color: #66758a; margin: .65rem 0 1.2rem; }
.topic-card { margin: 0 0 .8rem; border: 1px solid #e5eaf1; border-radius: 8px; padding: 1rem; }
.topic-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.topic-heading h4 { font-size: .95rem; margin: 0; color: #293e59; overflow-wrap: anywhere; }
.topic-heading .action-badge { flex-shrink: 0; max-width: 45%; }
.topic-metrics { font-size: .75rem; color: #738096; margin: .5rem 0 .6rem; }
.topic-advice { font-size: .85rem; margin: 0 0 .7rem; }
.topic-detail { margin: 0; padding: .55rem 0; border-top: 1px solid #eef1f5; font-size: .8rem; }
.topic-detail > summary { color: #54718e; font-size: .8rem; }
.topic-detail > summary span { color: #91a0b2; margin-left: .4rem; }
.topic-detail[open] > summary { margin-bottom: .8rem; }
.query-examples td, .query-examples th { font-size: .8rem; padding: .45rem .55rem; }
.query-examples th { color: #738096; font-weight: 500; }
.evidence-list { padding: 0; margin: 0; list-style: none; }
.evidence-list li { display: flex; align-items: baseline; gap: 1rem; justify-content: space-between; padding: .3rem 0; }
.evidence-list a { overflow-wrap: anywhere; }
.evidence-list span { flex-shrink: 0; color: #7d8ba0; }
.unassigned-note { font-size: .8rem; color: #738096; background: #f6f8fb; border-radius: 6px; padding: .75rem; margin: 0; }
.page-pagination { display: flex; justify-content: center; align-items: center; gap: 1.5rem; margin: 1.1rem 0; font-size: .8rem; }
.page-pagination button { margin: 0; font-size: .8rem; padding: .4rem .8rem; }
.methodology { margin: 1rem 0 0; padding-top: 1rem; border-top: 1px solid #edf0f5; }
.methodology > summary { color: #738096; font-size: .8rem; }
.empty-state { text-align: center; color: #738096; padding: 2.5rem 1rem; border: 1px dashed #dce3ed; border-radius: 10px; }
.empty-state p { font-size: .85rem; margin: .5rem 0 1rem; }
.empty-state button { font-size: .85rem; padding: .5rem .8rem; margin: 0; }
.opportunities .htmx-indicator { display: none; }
.opportunities .htmx-indicator.htmx-request { display: inline; }
@media (max-width: 800px) {
  .job-detail > header nav { flex-wrap: wrap; font-size: .85rem; }
  .job-reference { font-size: .75rem; }
  .job-sections { border-radius: 8px; gap: 0; }
  .job-overview, .report-section { padding: 1rem; }
  .job-overview > header { margin: -1rem -1rem 1rem; padding: .8rem 1rem; }
  .budget-grid { gap: .65rem; }
  .budget-card { padding: 1rem; }
  .budget-amount { font-size: 1.5rem; }
  .section-intro, .page-overview { flex-direction: column; gap: .6rem; }
  .page-opportunity > summary { flex-wrap: wrap; gap: .65rem; padding: .85rem; position: relative; }
  .page-identity { flex-basis: calc(100% - 2rem); padding-right: 1.5rem; }
  .page-opportunity > summary::after { position: absolute; right: .85rem; top: 1.1rem; }
  .page-metrics { text-align: left; width: 100%; gap: .7rem; }
  .page-expanded { padding: .8rem; }
  .topic-heading { flex-direction: column-reverse; gap: .5rem; }
  .topic-heading .action-badge { max-width: 100%; }
  .evidence-list li { flex-direction: column; gap: .1rem; }
  .result-count .muted { display: none; }
}
@media (max-width: 520px) {
  .budget-grid { grid-template-columns: 1fr; }
  .job-heading h1 { font-size: 1.6rem; }
  .job-overview > header .actions { width: 100%; }
  .job-overview > header .actions a { flex: 1; text-align: center; }
  .filter-fields .page-search { flex-basis: 100%; }
  .filter-fields label:not(.page-search) { flex: 1; }
  .execution-details > summary span { display: none; }
  .topic-card { padding: .75rem; }
}
