/* Parser 2.0: a readable workspace for side-by-side review. */
:root { --primary:#205c54; --primary-dark:#153e39; --primary-light:#e7f1ee; --bg:#f3f5f4; --text:#1d302e; --text-secondary:#526660; --text-hint:#64746e; --divider:#dce4e0; --radius:8px; }
html,body { font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:14px; }
body { background:var(--bg); }
[hidden] { display:none!important; }
:focus-visible { outline:3px solid #367cbe; outline-offset:3px; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.skip-link { position:fixed; top:-100px; left:20px; z-index:300; background:#fff; padding:12px 20px; }
.skip-link:focus { top:10px; }
header.app-header { background:#fff; color:var(--text); box-shadow:none; border-bottom:1px solid var(--divider); position:relative; }
.brand { max-width:1600px; margin:auto; padding:20px 28px 8px; display:flex; align-items:center; gap:18px; }
.brand>a { font-weight:750; font-size:22px; letter-spacing:-.6px; color:var(--text); }
.brand>a span { font-size:12px; border:1px solid #bfd7ca; background:#eaf3ed; color:#315b43; padding:2px 6px; border-radius:5px; vertical-align:middle; letter-spacing:0; }
.brand-caption { color:var(--text-secondary); font-size:12px; }
header nav { padding:0 16px; min-height:48px; }
header nav a { color:var(--text-secondary); min-height:48px; text-transform:none; letter-spacing:0; padding:0 14px; transition:color 120ms,background 120ms; font-weight:550; }
header nav a:hover { color:var(--primary); background:#f3f7f4; }
header nav a[aria-current="page"] { color:var(--primary); border-bottom:3px solid var(--primary); }
header nav .logout { margin-left:auto; font-weight:400; font-size:12px; }
main { max-width:1600px; padding:26px 28px 60px; }
h1 { font-size:28px; letter-spacing:-.65px; font-weight:700; line-height:1.25; margin:0 0 8px; }
h1 small { font-size:17px; color:var(--text-secondary); margin-left:10px; font-variant-numeric:tabular-nums; }
h2 { font-size:20px; margin-top:28px; }
h3 { font-size:15px; margin:0 0 16px; }
.muted { color:var(--text-secondary); }
.filters { box-shadow:none; border:1px solid var(--divider); border-radius:10px; padding:18px; gap:12px 16px; margin:20px 0 12px; align-items:end; }
.filters label { font-size:12px; font-weight:550; color:var(--text-secondary); gap:5px; }
input,select,textarea { font:inherit; color:var(--text); background:#fff; border:1px solid #b8c8bf; border-radius:6px; }
input,select { min-height:36px; }
.filters input[type=checkbox] { min-height:auto; width:17px; height:17px; accent-color:var(--primary); }
.filters .filter-search { flex:1 1 240px; }
.filters .filter-search input { width:100%; }
button,.btn-primary,.btn-export { border-radius:6px; box-shadow:none; text-transform:none; letter-spacing:0; min-height:36px; font-size:13px; transition:background 120ms,color 120ms; }
button:hover { box-shadow:none; }
.btn-export { background:#fff; color:var(--primary); border:1px solid var(--divider); }
.export-row { font-size:12px; }
.view-toolbar { display:flex; gap:14px; flex-wrap:wrap; align-items:center; margin:18px 0 12px; }
.view-toolbar label { display:flex; align-items:center; gap:8px; font-size:12px; }
.view-toolbar select { max-width:235px; font-size:12px; }
.result-range { margin-right:auto; color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.table-scroll { overflow:auto; border:1px solid var(--divider); border-radius:10px; background:#fff; margin:12px 0; }
table { width:100%; box-shadow:none; border-radius:0; margin:0; background:#fff; }
th { background:#edf2ef; color:#435b52; font-size:11px; text-transform:none; letter-spacing:.02em; padding:12px 16px; border-bottom:1px solid var(--divider); }
td { padding:16px; vertical-align:top; border-bottom:1px solid var(--divider); }
table.grid td { font-size:13px; }
.comparison-grid { table-layout:fixed; min-width:900px; }
.comparison-grid th:nth-child(1),.comparison-grid th:nth-child(2) { width:32%; }
.comparison-grid th:nth-child(3) { width:16%; }
.comparison-grid th:nth-child(4) { width:20%; }
.comparison-grid td { min-width:0!important; max-width:none!important; white-space:normal!important; overflow-wrap:anywhere; }
.course-title { font-size:15px; font-weight:600; line-height:1.5; display:block; text-wrap:pretty; }
.course-meta { color:var(--text-secondary); font-size:11px; margin:7px 0 9px; }
.course-metrics { display:flex; gap:7px 15px; flex-wrap:wrap; color:var(--text-secondary); font-size:12px; margin:12px 0 8px; font-variant-numeric:tabular-nums; }
.course-metrics strong { color:var(--text); font-weight:600; }
.course-details { margin:8px 0; font-size:12px; }
summary { cursor:pointer; color:var(--primary); min-height:28px; padding:3px 0; }
.course-details dl { margin:6px 0; }
.course-details dl div,.health-metrics div { display:flex; justify-content:space-between; gap:12px; padding:4px 0; }
dt { color:var(--text-secondary); }
dd { margin:0; font-variant-numeric:tabular-nums; }
.course-details p { color:var(--text-secondary); line-height:1.55; }
.status-form select { min-height:30px; max-width:100%; font-size:12px; border:1px solid #bbcec2; background:#f1f6f2; padding:3px 8px; }
.status-form select { background-repeat:no-repeat; background-position:right 8px center; padding-right:25px; }
.comment-form { display:block; }
.comment-form select { width:100%; max-width:100%; min-width:0; min-height:36px; font-size:12px; padding:6px 8px; }
.comment-form:not(.comment-none) select { width:100%; }
.comment-form select { color:var(--text); background-position:right 6px center; padding-right:22px; }
.comment-form::before { display:none; }
table.comparison-grid { box-shadow:none; border-radius:0; }
table.grid thead th { background:#edf2ef; padding:12px 16px; text-transform:none; font-size:11px; }
table.comparison-grid tbody td { padding:18px 16px; border-bottom:1px solid var(--divider); }
.note-editor { font-size:12px; margin-top:8px; }
.note-editor textarea { width:100%; resize:vertical; padding:8px; line-height:1.5; }
.note-editor button { font-size:11px; padding:5px 8px; margin-top:6px; }
.group-note { display:block; font-size:11px; color:var(--text-secondary); margin-top:10px; }
.similarity { display:flex; align-items:center; gap:7px; margin:14px 0 10px; font-variant-numeric:tabular-nums; }
.similarity strong { flex-shrink:0; white-space:nowrap; font-size:25px; font-weight:650; }
.similarity span { min-width:0; color:var(--text-secondary); font-size:10px; line-height:1.4; }
.tag { display:inline-block; white-space:normal; font-size:10px; line-height:1.5; border-radius:4px; padding:3px 6px; }
.extra-comp-toggle { color:var(--primary); background:#edf5f0; border:1px solid #c5dace; min-height:30px; font-size:11px; padding:4px 8px; margin:4px 0; }
.alt-info { font-size:12px; background:#edf5ed; padding:10px 16px; }
.empty-state { text-align:center; padding:40px 20px; border:1px dashed #becfc4; border-radius:10px; background:#fff; }
.pagination { gap:5px; margin:14px 0; }
.pagination a,.pagination span { min-width:32px; min-height:32px; }
#action-feedback { position:sticky; top:0; z-index:150; background:#e7f1e8; border-bottom:1px solid #a4c6aa; padding:12px 28px; color:#21492b; }
#action-feedback.is-error,.health-warning { background:#fff0e8; color:#87351c; padding:12px; border:1px solid #e1b59f; }
[aria-busy=true] { opacity:.65; pointer-events:none; }
.section-heading { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; gap:8px; }
.section-heading small { color:var(--text-secondary); }
.source-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin:20px 0; }
.source-card { background:#fff; border:1px solid var(--divider); border-radius:10px; padding:20px; }
.source-total { font-size:28px; letter-spacing:-.7px; font-variant-numeric:tabular-nums; }
.completion-label { display:flex; justify-content:space-between; margin:18px 0 5px; font-size:11px; }
progress { width:100%; height:6px; accent-color:var(--primary); }
.health-metrics { margin:16px 0; font-size:12px; }
.health-metrics .needs-attention { color:#a13e21; font-weight:600; }
.source-dates { border-top:1px solid var(--divider); padding-top:10px; font-size:10px; color:var(--text-secondary); line-height:1.8; }
.run-state { border-radius:4px; padding:4px 8px; background:#edf1ef; font-size:11px; }
.state-failed,.state-timeout,.state-interrupted { color:#953819; background:#fff0e6; }
.state-ok { color:#28563c; background:#e6f3e9; }
.state-running { color:#275e8d; background:#e7f2fc; }
.phase-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:10px; margin:10px 0; }
.phase-list>div { padding:14px; background:#fff; border:1px solid var(--divider); border-radius:8px; display:flex; gap:10px; flex-wrap:wrap; font-size:12px; }
.phase-list small { width:100%; color:var(--text-secondary); }
@media(max-width:1100px) { .source-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .comparison-grid th:nth-child(4) { width:22%; } .comparison-grid th:nth-child(1),.comparison-grid th:nth-child(2) { width:31%; } }
@media(max-width:650px) { main { padding:20px 14px 40px; } .brand { padding:16px 14px 6px; } .brand-caption { display:none; } header nav { padding:0 4px; } header nav a { padding:0 10px; min-height:42px; font-size:12px; } h1 { font-size:24px; } .filters { padding:14px; } .filters label { flex:1 1 130px; } .filters select { width:100%; } .view-toolbar { gap:10px; } .result-range { width:100%; } .source-grid { grid-template-columns:1fr; } .table-scroll { border-radius:6px; } }
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media(max-width:650px) {
  table.comparison-grid { min-width:0; display:block; }
  .comparison-grid thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .comparison-grid tbody { display:block; }
  .comparison-grid tr { display:grid; grid-template-columns:1fr; border-bottom:6px solid var(--bg); }
  table.comparison-grid tbody td { display:block; padding:14px; }
  .comparison-grid .gap-row>td::before,.comparison-grid .extra-comp-row>td::before { display:block; color:var(--text-secondary); font-size:11px; font-weight:650; margin-bottom:8px; }
  .comparison-grid .gap-row>td:nth-child(1)::before { content:'Наш курс'; }
  .comparison-grid .gap-row>td:nth-child(2)::before,.comparison-grid .extra-comp-row>td:nth-child(2)::before { content:'У конкурента'; }
  .comparison-grid .gap-row>td:nth-child(3)::before,.comparison-grid .extra-comp-row>td:nth-child(3)::before { content:'Совпадение'; }
  .comparison-grid .gap-row>td:nth-child(4)::before,.comparison-grid .extra-comp-row>td:nth-child(4)::before { content:'Решение редактора'; }
}
.quick-views { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0 4px; }
.quick-views a { border:1px solid #c9d9d0; background:#fff; border-radius:20px; padding:6px 12px; font-size:12px; }
.advanced-filters { flex:1 1 100%; order:5; font-size:12px; }
.advanced-fields { display:flex; flex-wrap:wrap; gap:12px 16px; padding:12px 0 0; align-items:end; }
.filters>.filter-search { order:-1; }
.filters>label:not(.filter-search) { max-width:220px; }
.filters>label select { max-width:220px; }
.filters label,.filters button { text-transform:none; letter-spacing:0; }
.filters .filter-search { min-width:200px; max-width:300px; }
.tag.type-llm_pending { color:#785713; border-color:#ad8d40; }

/* Keep operational detail available without pushing the course table down. */
.parser-status { background:#edf3ef; border:1px solid #d4e1d8; border-radius:8px; padding:0 14px; margin:12px 0; font-size:12px; line-height:1.5; }
.status-summary { display:flex; align-items:center; flex-wrap:wrap; gap:8px 22px; min-height:48px; padding:10px 0; color:var(--text-secondary); list-style:none; }
.status-summary::-webkit-details-marker { display:none; }
.status-summary strong { color:var(--text); font-weight:600; font-variant-numeric:tabular-nums; }
.status-summary>span { display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px 8px; }
.status-summary .status-run { gap:6px; }
.status-dot { width:7px; height:7px; background:#34734c; border-radius:50%; }
.status-summary .status-disclosure { margin-inline-start:auto; color:var(--primary); white-space:nowrap; }
.status-disclosure>span { font-size:16px; line-height:1; }
#parser-status-details[open] .status-disclosure>span { transform:rotate(180deg); }
.status-warning,.status-summary .status-warning { color:#80551c; }
.status-error-count { background:#fff1d9; border-radius:4px; padding:2px 7px; color:#80551c; }
.status-expanded { padding:4px 0 14px; }
.status-phase { margin:0 0 10px; }
.status-errors { color:#80551c; background:#fff7e8; padding:10px 14px; border-radius:6px; }
.status-errors ul { margin:0; padding-inline-start:16px; }
.status-errors li+li { margin-top:5px; }
.status-dates { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 32px; margin:14px 0; }
.status-dates>div { display:flex; flex-wrap:wrap; gap:4px 10px; }
.status-dates dd { margin:0; font-variant-numeric:tabular-nums; }
.status-help { color:var(--text-secondary); max-width:105ch; margin:12px 0; }
.status-actions { display:flex; flex-wrap:wrap; gap:12px 22px; }
.status-actions a { padding:3px 0; }
.status-loading { display:flex; align-items:center; flex-wrap:wrap; gap:8px 22px; min-height:48px; padding:10px 0; color:var(--text-secondary); }

/* One set of table tools and help for all rows, including lazy-loaded offers. */
.table-tools { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; margin:14px 0 8px; }
.table-tools .view-toolbar { flex:1 1 650px; margin:0; gap:12px; }
.score-guide,.sheet-tools { font-size:12px; }
.score-guide summary,.sheet-tools summary { min-height:36px; padding:8px 0; }
.score-guide[open],.sheet-tools[open] { flex:1 1 100%; order:2; }
.score-guide p { margin:0 0 8px; max-width:90ch; line-height:1.6; color:var(--text-secondary); }
.filter-state { display:inline-block; white-space:nowrap; margin-inline-start:8px; padding:2px 6px; background:var(--primary-light); border-radius:4px; color:var(--text-secondary); }
.filters { padding:14px 16px; gap:8px 14px; margin:14px 0 10px; }
.filters .btn-primary { text-transform:none!important; letter-spacing:0; }
.quick-views { margin:14px 0 0; }
.filters>label:not(.filter-search) { max-width:240px; }
.filters .filter-search { flex:1 1 220px; min-width:180px; max-width:360px; }
.course-meta { margin:4px 0 6px; }
.course-metrics { gap:4px 14px; margin:8px 0 4px; }
.course-metrics>span { white-space:nowrap; }
.course-metrics .metric-empty { color:var(--text-secondary); font-weight:400; }
.course-details { margin:4px 0; }
table.comparison-grid tbody td { padding:14px 16px; }
.match-cell>small { color:var(--text-secondary); font-variant-numeric:tabular-nums; }
.similarity { margin:10px 0 8px; }
.group-note { margin-top:8px; }

@media(max-width:900px) {
  .status-dates { grid-template-columns:1fr; }
  .table-tools .view-toolbar { flex-basis:100%; }
}
@media(max-width:650px) {
  .parser-status { padding:0 12px; }
  .status-summary { gap:8px 16px; }
  .status-catalog { flex-basis:100%; }
  .status-summary .status-disclosure { margin-inline-start:0; }
  .status-summary { min-height:44px; }
  .filters { padding:12px; }
  .filters .filter-search { flex-basis:100%; max-width:none; }
  .filters>label:not(.filter-search),.filters>label select { max-width:none; }
  .filters input,.filters select,.note-editor textarea { font-size:16px; }
  .filters .advanced-fields label { min-width:0; }
  .filters .advanced-fields select { max-width:100%; }
  .advanced-fields .filter-toggle { flex-basis:100%; }
  .view-toolbar label { flex:1 1 100%; }
  .view-toolbar select { max-width:100%; min-width:0; flex:1; }
  .table-tools { gap:4px 20px; }
  .table-tools .view-toolbar { gap:8px 12px; }
  .quick-views a { padding:9px 12px; }
  .table-tools summary,.course-details summary,.note-editor summary { min-height:36px; }
  .table-tools .btn-export,.table-tools button { min-height:40px; }
}
