#btn-autoprepress { width:100%; border:0; text-align:left; font:inherit; border-radius:0; }
.ap-view { padding:20px; max-width:1800px; width:100%; box-sizing:border-box; }
.ap-view *, .ap-view *::before, .ap-view *::after { box-sizing:border-box; }
.ap-view h1 { font-size:22px; margin:0 0 5px; }
.ap-view h2 { font-size:16px; margin:0 0 12px; }
.ap-view h3 { font-size:13px; margin:16px 0 8px; }
.ap-view p { line-height:1.55; margin:6px 0 12px; }
.ap-view button, .ap-view input, .ap-view select, .ap-view textarea { font:inherit; font-size:12px; }
.ap-view button { width:auto; min-height:32px; padding:6px 11px; color:var(--text-main); border:1px solid var(--border); background:var(--bg-card); border-radius:5px; cursor:pointer; }
.ap-view button:hover { border-color:var(--accent); }
.ap-view button:focus-visible, .ap-view a:focus-visible, .ap-view input:focus-visible, .ap-view select:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.ap-view button:disabled { opacity:.5; cursor:default; }
.ap-view input, .ap-view select, .ap-view textarea { background:var(--bg-input); color:var(--text-main); border:1px solid var(--border); border-radius:4px; padding:7px; min-height:32px; width:100%; }
.ap-view label { display:grid; gap:5px; font-size:12px; color:var(--text-muted); min-width:0; }
.ap-header, .ap-toolbar, .ap-tabs, .ap-detail-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ap-header { justify-content:space-between; margin-bottom:16px; }
.ap-header p, .ap-muted, .ap-footnote { color:var(--text-muted); font-size:12px; }
.ap-toolbar { align-items:end; margin-bottom:12px; }
.ap-shadow-scope { display:flex; flex-wrap:wrap; gap:10px 20px; padding:12px; margin:12px 0; border:1px solid var(--border-color, #ccd2db); border-radius:6px; }
.ap-shadow-scope legend { padding:0 6px; font-weight:600; }
.ap-shadow-scope label { display:flex; align-items:center; gap:6px; margin:0; }
.ap-shadow-scope input[type="checkbox"] { width:auto; margin:0; }
.ap-toolbar label { min-width:240px; }
.ap-toolbar #ap-origin { flex:1; padding-bottom:8px; overflow-wrap:anywhere; }
.ap-badge { display:inline-block; color:#bcdcff; background:#25415e; border:1px solid #3c5b7b; border-radius:4px; font-size:11px; padding:4px 7px; line-height:1.4; }
.ap-badge.exported, .ap-badge.direct { color:#b9ebc5; background:#25432e; border-color:#43694b; }
.ap-badge.stopped, .ap-badge.declined { color:#ffd1c6; background:#553b35; border-color:#785149; }
.ap-badge.partial { color:#ffe2a8; background:#4d3d1f; border-color:#7a6230; }
.ap-badge.excluded { color:var(--text-muted); background:var(--bg-sidebar); border-color:var(--border); }
.ap-tabs { gap:4px; border-bottom:1px solid var(--border); margin:14px 0 18px; padding-bottom:9px; }
.ap-tabs button { background:transparent; border-color:transparent; }
.ap-tabs button[aria-current="page"] { color:#bcdcff; border-color:var(--accent); background:#25415e; }
.ap-stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.ap-card { background:var(--bg-sidebar); border:1px solid var(--border); border-radius:6px; padding:14px; min-width:0; margin-bottom:12px; }
#ap-live-result { overflow-wrap:anywhere; }
.ap-stats .ap-card { margin:0; }
.ap-stat { display:block; font-size:25px; font-weight:700; margin-bottom:7px; }
.ap-stats p { font-size:12px; color:var(--text-muted); margin:0; }
.ap-orders-layout { display:grid; grid-template-columns:minmax(400px,1fr) minmax(380px,.9fr); gap:16px; align-items:start; }
.ap-filters { display:grid; grid-template-columns:1.4fr 1fr; gap:8px; margin-bottom:12px; }
.ap-table-wrap { overflow:auto; max-width:100%; }
#ap-position-list > .ap-table-wrap { max-height:max(320px,calc(100vh - 500px)); }
#ap-position-list thead { position:sticky; top:0; z-index:1; }
.ap-view table { border-collapse:collapse; width:100%; font-size:12px; }
.ap-view th { text-align:left; font-size:11px; font-weight:600; color:var(--text-muted); background:var(--bg-sidebar); }
.ap-view td, .ap-view th { border-bottom:1px solid var(--border); padding:10px 8px; vertical-align:top; overflow-wrap:anywhere; }
.ap-view td button.ap-position { border:0; padding:0; min-height:28px; color:#a8d1ff; background:transparent; text-align:left; font-weight:600; }
.ap-selected { background:#2b4054; }
.ap-detail { position:sticky; top:12px; max-height:calc(100vh - 90px); overflow:auto; }
.ap-detail-head { justify-content:space-between; }
.ap-detail .ap-tabs { gap:0; margin:12px 0; }
.ap-detail .ap-tabs button { padding:6px 8px; font-size:11px; }
.ap-detail dl { display:grid; grid-template-columns:130px minmax(0,1fr); gap:9px; font-size:12px; }
.ap-detail dt { color:var(--text-muted); }
.ap-detail dd { margin:0; overflow-wrap:anywhere; }
.ap-view pre { white-space:pre-wrap; overflow-wrap:anywhere; background:var(--bg-app); font-size:11px; padding:10px; border-radius:4px; max-height:450px; overflow:auto; }
.ap-view code { font-size:11px; overflow-wrap:anywhere; }
.ap-view ul { padding-left:20px; font-size:12px; line-height:1.6; }
.ap-notice { padding:10px 12px; border-left:3px solid var(--accent); background:#283b4e; font-size:12px; }
.ap-error { border-left-color:#ffb397; background:#523b35; }
.ap-empty { padding:28px 12px; color:var(--text-muted); font-size:13px; text-align:center; }
.ap-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; align-items:start; }
.ap-intents { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.ap-intents button { text-align:left; }
.ap-intents button[aria-pressed="true"] { border-color:var(--accent); background:#25415e; }
.ap-view .ap-link { color:#a8d1ff; }
.ap-view .ap-report-link { color:var(--text-main); }
.ap-view .ap-copy { margin-top:12px; }
.ap-folder { display:grid; gap:8px; padding:10px 0; border-bottom:1px solid var(--border); font-size:12px; }
.ap-folder > div { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.ap-folder code { color:var(--text-muted); }
.ap-view details { margin:12px 0; }
.ap-view summary { cursor:pointer; font-size:12px; }
.ap-shadow-works { margin:0; padding-left:16px; }
.ap-shadow-works li { margin-bottom:6px; }
.ap-view button.ap-inline { min-height:24px; padding:2px 7px; font-size:11px; margin-top:4px; }
.ap-shadow-table { max-height:max(360px,calc(100vh - 420px)); }
.ap-shadow-table thead { position:sticky; top:0; z-index:1; }
.ap-shadow-runner p { font-size:13px; margin:4px 0 8px; }
.ap-shadow-table th:nth-child(-n+3), .ap-shadow-table td:nth-child(-n+3) { min-width:118px; overflow-wrap:normal; }
.ap-shadow-table td:nth-child(4) { min-width:260px; }
.ap-shadow-table th:nth-child(5), .ap-shadow-table td:nth-child(5) { min-width:180px; overflow-wrap:normal; }
.ap-shadow-table th:nth-child(6), .ap-shadow-table td:nth-child(6) { min-width:130px; overflow-wrap:normal; }
.ap-shadow-tabs { margin-top:0; }
.ap-shadow-reason-table { max-height:max(360px,calc(100vh - 430px)); }
.ap-shadow-reason-table caption { text-align:left; color:var(--text-muted); font-size:12px; padding:0 0 8px; }
.ap-shadow-reason-table th:first-child, .ap-shadow-reason-table td:first-child { min-width:340px; }
.ap-shadow-reason-table th:not(:first-child), .ap-shadow-reason-table td:not(:first-child) { min-width:105px; overflow-wrap:normal; }
.ap-shadow-reason-table details { margin:0; }
.ap-shadow-reason-table summary { color:#dcecff; }
.ap-shadow-reasons { margin:8px 0 0; padding-left:18px; }
.ap-shadow-reasons li { margin:0 0 10px; }
.ap-shadow-reasons code { color:var(--text-muted); margin-left:4px; }
.ap-shadow-examples { display:inline-flex; align-items:center; gap:4px; flex-wrap:wrap; margin:4px 8px 0 0; color:var(--text-muted); font-size:11px; }
.ap-footnote { margin-top:20px !important; border-top:1px solid var(--border); padding-top:12px; }
.ap-classifier-active > .ap-toolbar { display:none; }
.ap-classifier-strip { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.ap-snapshot-strip { margin-bottom:8px; }
.ap-catalog-counters { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.ap-catalog-counters > div { display:grid; gap:2px; padding:10px 12px; border:1px solid var(--border); border-radius:6px; background:var(--bg-sidebar); }
.ap-catalog-counters strong { font-size:19px; color:var(--text-main); }
.ap-catalog-counters span { font-size:12px; font-weight:700; }
.ap-catalog-counters small { color:var(--text-muted); line-height:1.3; }
.ap-classifier-sections { margin:8px 0 12px; }
.ap-classifier-toolbar { display:grid; grid-template-columns:minmax(260px,1.4fr) minmax(190px,.8fr) minmax(160px,.6fr) auto; gap:8px; align-items:end; margin-bottom:12px; }
.ap-catalog-toolbar { grid-template-columns:minmax(260px,1.4fr) repeat(3,minmax(160px,.65fr)); }
.ap-classifier-layout { display:grid; grid-template-columns:minmax(620px,1.15fr) minmax(420px,.85fr); gap:16px; align-items:start; }
.ap-classifier-table { max-height:max(420px,calc(100vh - 500px)); }
.ap-classifier-table table { min-width:760px; table-layout:fixed; }
.ap-classifier-table th:nth-child(1),.ap-classifier-table td:nth-child(1) { width:52%; }
.ap-classifier-table th:nth-child(2),.ap-classifier-table td:nth-child(2) { width:22%; overflow-wrap:normal; word-break:normal; }
.ap-classifier-table th:nth-child(3),.ap-classifier-table td:nth-child(3) { width:26%; }
.ap-classifier-table thead { position:sticky; top:0; z-index:1; }
.ap-catalog-divider th { position:sticky; top:31px; z-index:1; padding:8px; background:var(--bg-app); color:var(--text-muted); font-size:10px; letter-spacing:.05em; text-align:left; }
.ap-link-status { display:inline-block; border:1px solid var(--border); border-radius:999px; padding:3px 7px; color:var(--text-muted); line-height:1.25; }
.ap-link-automatic_exact { border-color:#527a62; color:#bfe9c9; }
.ap-link-accepted_duplicate_name,.ap-link-accepted_joined_name,.ap-link-accepted_archive_alias,.ap-link-accepted_sheet2_only { border-color:#8a7442; color:#ffe2a8; }
.ap-link-unresolved { border-color:#9e5c4b; color:#ffc3b1; }
.ap-rule-effect { display:grid; gap:2px; border-left:3px solid var(--border); padding-left:8px; min-width:170px; }
.ap-rule-effect small { color:var(--text-muted); line-height:1.35; }
.ap-rule-effect.ap-rule-safe { border-left-color:#65b87a; }
.ap-rule-effect.ap-rule-paper { border-left-color:#79bfff; }
.ap-rule-effect.ap-rule-blocking { border-left-color:#ff9c7d; }
.ap-classifier-form { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:12px; }
.ap-classifier-form label:last-child { grid-column:1 / -1; }
.ap-detail-tabs { margin-top:0 !important; }
.ap-confirm { margin-top:12px; background:var(--bg-app); }
.ap-revision { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); }
.ap-classifier-detail code { word-break:break-all; }
.ap-catalog-composition { margin-top:18px; border-top:1px solid var(--border); padding-top:12px; }
.ap-catalog-child { border-bottom:1px solid var(--border); padding:8px 0; }
.ap-catalog-child summary { display:flex; justify-content:space-between; gap:12px; cursor:pointer; color:var(--text-main); }
.ap-catalog-child summary small { color:var(--text-muted); }
.ap-catalog-child ul { margin:8px 0; padding-left:22px; max-height:240px; overflow:auto; }
.ap-catalog-child li { margin:4px 0; overflow-wrap:anywhere; }
.ap-rule-diff { display:grid; grid-template-columns:minmax(8rem,.7fr) minmax(0,1.3fr); gap:.35rem .75rem; margin:.65rem 0; }
.ap-rule-diff dt,.ap-rule-diff dd { margin:0; overflow-wrap:anywhere; }
.ap-rule-diff dd span { color:var(--text-muted); }
body.autoprepress-active #active-pdf-control,
body.autoprepress-active .top-bar #top-actions > #exportPng,
body.autoprepress-active .top-bar #top-actions > #exportPdf,
body.autoprepress-active .top-bar #top-actions > #exportPdfStatus,
body.autoprepress-active .top-bar #top-actions > #btnPrintReport { display:none !important; }
/* Tab «Правила»: read-only rule registry. Kind colours follow the existing state badges. */
.ap-rules-active > .ap-toolbar, .ap-rules-active > #ap-status { display:none; }
/* The global button style is one uppercase line of fixed height; a rule title must wrap like text. */
.ap-view .ap-rules-table td button.ap-position { height:auto; white-space:normal; text-transform:none; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.ap-rules-table th { white-space:nowrap; }
.ap-rules-table td:first-child { width:36px; }
.ap-rules-reasons td:first-child, .ap-rules-reasons th:first-child { width:50%; }
.ap-rules-kind { display:inline-grid; place-items:center; width:24px; height:22px; border-radius:4px; font-weight:700; font-size:11px; border:1px solid; vertical-align:middle; }
.ap-rules-kind.A { color:#b9ebc5; background:#25432e; border-color:#43694b; }
.ap-rules-kind.B { color:#ffe2a8; background:#4d3d1f; border-color:#7a6230; }
.ap-rules-kind.C { color:#ffd1c6; background:#553b35; border-color:#785149; }
.ap-rules-legend { display:grid; gap:4px; font-size:12px; color:var(--text-muted); }
#ap-rules-count { margin:0 0 8px; }
.ap-rules-toolbar { display:grid; grid-template-columns:minmax(220px,2fr) repeat(3,minmax(150px,1fr)) auto; gap:10px; align-items:end; margin-bottom:12px; }
.ap-rules-views { display:flex; }
.ap-rules-views button { border-radius:0; }
.ap-rules-views button:first-child { border-radius:5px 0 0 5px; }
.ap-rules-views button:last-child { border-radius:0 5px 5px 0; }
.ap-rules-views button[aria-pressed="true"] { color:#bcdcff; background:#25415e; border-color:var(--accent); }
.ap-rules-table { max-height:max(360px,calc(100vh - 420px)); }
.ap-rules-table thead { position:sticky; top:0; z-index:1; }
.ap-rules-family td { background:var(--bg-card); font-weight:600; }
.ap-rules-id { font-family:Consolas,"Courier New",monospace; font-size:11px; color:var(--text-muted); font-weight:400; }
.ap-rules-num { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.ap-rules-zero { color:#7d7d7d; }
.ap-rules-chips { display:flex; gap:4px; flex-wrap:wrap; margin-top:5px; }
.ap-rules-bar { height:6px; background:var(--bg-input); border-radius:3px; overflow:hidden; margin-top:5px; }
.ap-rules-bar i { display:block; height:100%; background:#785149; }
.ap-rules-timeline { list-style:none; padding:0; display:grid; gap:8px; }
.ap-rules-timeline li { display:grid; grid-template-columns:110px minmax(0,1fr); gap:10px; padding:8px 10px; background:var(--bg-card); border-radius:4px; }
.ap-rules-timeline li > span:first-child { font-family:Consolas,"Courier New",monospace; color:var(--text-muted); font-size:11px; }
.ap-rules-gap { border-left-color:#7a6230; background:#3a3322; }
.ap-rules-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.ap-rules-metrics div { background:var(--bg-card); border-radius:4px; padding:8px 10px; }
.ap-rules-metrics b { display:block; font-size:18px; font-variant-numeric:tabular-nums; }
.ap-rules-metrics span { font-size:11px; color:var(--text-muted); }
.ap-rules-future { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:14px; padding-top:12px; border-top:1px dashed var(--border); }
@media(max-width:1279px) { .ap-orders-layout, .ap-classifier-layout { grid-template-columns:1fr; } .ap-detail { position:static; max-height:none; } }
@media(max-width:900px) { .ap-classifier-toolbar,.ap-catalog-toolbar,.ap-rules-toolbar { grid-template-columns:1fr 1fr; } .ap-catalog-counters { grid-template-columns:1fr 1fr; } }
@media(max-width:700px) { .ap-view { padding:12px; } .ap-stats, .ap-columns { grid-template-columns:1fr 1fr; } .ap-columns { grid-template-columns:1fr; } .ap-filters, .ap-classifier-toolbar, .ap-catalog-toolbar, .ap-rules-toolbar, .ap-rules-metrics, .ap-classifier-form, .ap-catalog-counters { grid-template-columns:1fr; } .ap-rules-timeline li { grid-template-columns:1fr; } .ap-classifier-form label:last-child { grid-column:auto; } .ap-toolbar label { min-width:0; width:100%; } .ap-table-wrap { max-width:100%; } .ap-header { align-items:start; } .ap-view td, .ap-view th { padding:8px 5px; } .ap-detail dl { grid-template-columns:1fr; } .ap-catalog-child summary { display:grid; } }
