/* Report-only styles. Shared period controls keep their hub styles.
   Primary report copy inherits --report-body-size. Existing source/proof/note
   classes identify secondary metadata; they never reduce primary table text. */
.client-report{--report-body-size:14px;--report-secondary-size:13px;--report-target-height:32px;--warn:#80540e;font-size:var(--report-body-size);min-width:0;max-width:100%;display:grid;gap:16px}
.client-report *{box-sizing:border-box}
.report-readiness,.report-sheet{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px;min-width:0}
.report-readiness p{margin:6px 0}.report-sheet h3{margin:0}
.report-sheet-head{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;align-items:baseline}
.report-scroll{width:100%;max-width:100%;overflow-x:auto;margin-top:12px}
.report-table{width:100%;border-collapse:collapse;min-width:560px}
.report-table td,.report-table th{text-align:left;vertical-align:top;padding:10px;border-bottom:1px solid var(--line)}
.report-table th{font-weight:500}.report-row-number{color:var(--muted);font-family:var(--mono)}
.report-source,.report-reason{display:block;font-size:var(--report-secondary-size);color:var(--muted);overflow-wrap:anywhere}
.report-formula{color:var(--muted);background:var(--bg)}.report-formula .report-value{color:var(--muted)}
.report-discrepancy{border-inline-start:3px solid var(--line)}
.report-copy-list{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.report-copy-list>div{max-width:100%}
.report-copy{font:inherit;cursor:pointer;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--ink);padding:8px 12px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
.report-copy:hover{border-color:var(--accent)}.report-copy:disabled{opacity:.55;cursor:not-allowed}
.report-copy:focus-visible,.report-scroll:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.report-status{min-height:1.5em;color:var(--muted);margin:0}.report-warning{color:var(--warn)}.report-empty{color:var(--muted)}
.report-sheet a,.report-readiness a{overflow-wrap:anywhere}.report-period-note{margin:0;color:var(--muted)}
/* Client overview has nowrap numeric cells; original Sheet labels need wrapping. */
#pageClients .report-table td,#pageClients .report-table th{text-align:left;white-space:normal;vertical-align:top;overflow-wrap:anywhere;min-width:90px;max-width:280px}
#pageClients .report-table th{position:static;background:transparent}#pageClients .report-table tbody th{font-size:inherit;color:var(--ink);font-weight:500}
#pageClients .report-table .report-row-number{min-width:55px}
@media(max-width:480px){.report-readiness,.report-sheet{padding:12px}.report-sheet-head{display:block}.report-copy{width:100%;text-align:left}}
/* Source metadata needs a readable column, including when the table scrolls on mobile. */
#pageClients .report-table th:nth-child(2),#pageClients .report-table td:nth-child(2){min-width:170px}
#pageClients .report-table th:nth-child(3),#pageClients .report-table td:nth-child(3){min-width:120px}
#pageClients .report-table th:nth-child(4),#pageClients .report-table td:nth-child(4){min-width:280px;max-width:360px}
.report-source-name{display:block;font-size:var(--report-secondary-size);font-weight:600}
.report-proof{font-size:var(--report-secondary-size);color:var(--muted);margin-top:5px;overflow-wrap:anywhere}
.report-proof summary{cursor:pointer}.report-proof p{margin:6px 0}
.report-proof summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.report-history{display:block;width:120px;max-width:100%;margin-top:6px;--spark:var(--muted);--spark-last:var(--ink)}
.report-history svg{max-width:100%;height:auto}.report-schema{margin:8px 0}
.report-table .report-warning{display:block;font-size:var(--report-body-size)}.report-funnel{margin-top:12px}
/* Readiness stays compact; detailed clocks and reasons remain available on demand. */
.report-counts{font-size:var(--report-body-size);font-variant-numeric:tabular-nums}
.client-report a{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.client-report a:hover{color:var(--accent)}
.report-copy-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));align-items:start}
.report-copy-instruction,.report-copy-list>.report-warning,.report-copy-more{grid-column:1/-1;margin:0}
.report-copy-block{min-width:0}.report-copy-block>.report-source{margin-top:4px}
.report-copy-more{border-top:1px solid var(--line);padding-top:8px;color:var(--muted);font-size:var(--report-body-size)}
.report-copy-more summary{cursor:pointer}.report-copy-more .report-copy-block{margin-top:8px}

.report-unknown{border:1px solid var(--line);border-radius:7px;padding:10px;margin:0;scroll-margin-top:12px}
.report-unknown p+p{padding-top:8px;border-top:1px solid var(--line)}
.report-value{font-variant-numeric:tabular-nums}
@media(max-width:480px){.client-report{gap:10px}.report-readiness,.report-sheet{padding:10px}.report-sheet-head{display:flex;align-items:center}.report-period-note{font-size:var(--report-secondary-size)}.report-sheet-head>[data-report-preset-button]{width:auto;padding:8px 10px}.report-readiness>p{margin:4px 0}.report-copy-list{margin-top:8px}.report-copy{padding:9px 12px}}

.report-mobile-jump{display:none}
@media(max-width:480px){.report-mobile-jump{display:block;width:100%;position:static}.report-status:not(:empty){position:fixed;bottom:16px;left:24px;right:24px;z-index:81;padding:12px;background:var(--panel);border:1px solid var(--line);border-radius:8px;box-shadow:0 3px 16px #0003;font-size:var(--report-body-size)}}

.report-scroll-hint,.report-dismiss{display:none}.report-dismiss[hidden]{display:none}
@media(max-width:480px){.report-scroll-hint{display:block;color:var(--muted);font-size:var(--report-secondary-size);margin:10px 0 4px}.report-status:not(:empty){padding-bottom:48px}.report-dismiss{display:block;position:fixed;bottom:22px;right:30px;width:auto;z-index:82;font-size:var(--report-body-size);padding:5px 8px}.report-dismiss[hidden]{display:none}}

.report-precision{grid-column:1/-1;margin:0}

/* Semantic typography also covers shared funnel markup embedded in a report. */
#pageClients .client-report .report-table,
#pageClients .client-report .report-table th,
#pageClients .client-report .funnel-step{font-size:var(--report-body-size)}
#pageClients .client-report :is(.report-source,.report-reason,.report-source-name,.report-proof,.report-period-note,.report-scroll-hint,.report-funnel .note,.report-funnel small){font-size:var(--report-secondary-size)}
.client-report :is(button,summary,a[href],[tabindex="0"]){min-height:var(--report-target-height)}
.client-report summary{align-content:center}
.client-report a[href]{display:inline-flex;align-items:center}
.client-report .report-copy{font-size:var(--report-body-size)}
.client-report .report-status{font-size:var(--report-body-size)}
/* Disabled controls retain readable copy while the fresh source check runs. */
.client-report .report-copy:disabled{opacity:1;color:var(--muted)}
:root[data-theme="dark"] .client-report{--warn:#e8b65c}
@media(prefers-color-scheme:dark){:root:not([data-theme="light"]) .client-report{--warn:#e8b65c}}
@media(max-width:480px){
 .client-report{--report-body-size:15px;--report-secondary-size:13px;--report-target-height:44px}
 .client-report :is(button,summary,a[href],[tabindex="0"]){min-width:44px}
}

/* Round 2: early snapshots, mismatch badge, and phone rows stacked as cards (label, value, source). */
.report-badge{display:inline-block;margin-top:4px;padding:2px 8px;border:1px solid var(--warn);border-radius:999px;color:var(--warn);font-size:var(--report-body-size)}
.report-early .report-value{color:var(--muted);text-decoration:line-through}
.report-table .report-early-note{display:block;font-size:var(--report-secondary-size);margin-top:4px}
.report-copy-block{display:flex;flex-direction:column;align-items:flex-start;gap:2px}
@media(max-width:600px){
 #pageClients .report-scroll{overflow-x:visible}
 #pageClients .report-table{min-width:0;display:block}
 #pageClients .report-table thead{display:none}
 #pageClients .report-table tbody,#pageClients .report-table tr{display:block}
 #pageClients .report-table tr{border-bottom:1px solid var(--line);padding:10px 0}
 #pageClients .report-table td,#pageClients .report-table th{display:block;min-width:0;max-width:none;border:0;padding:2px 0}
 #pageClients .report-table th:nth-child(n),#pageClients .report-table td:nth-child(n){min-width:0;max-width:none}
 #pageClients .report-table td.report-row-number::before{content:'Строка '}
 #pageClients .report-table td[data-l="Значение"] .report-value{font-size:18px;font-weight:600}
 #pageClients .report-table tbody th{font-weight:600}
}

.report-line{margin:8px 0 12px;color:var(--muted);font-size:15px}
.report-formulas{margin:8px 0 14px;color:var(--muted);font-size:15px}
.report-table .report-block td{background:var(--panel);padding:8px 10px;border-top:1px solid var(--line)}
.report-table .report-block .report-source{margin-left:10px}
.report-mismatch{display:block}
.report-table .report-block .report-copy{padding:3px 10px;min-height:0;font-size:15px}

/* «Таблица отчёта»: the sheet's rows x last weeks. Not .report-table: that class turns into cards on a phone. */
.wt-copy{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}
.wt-copy-week{font-weight:600;margin-inline-end:4px}
.wt-copy-btn{width:auto}
.client-report .wt .report-source,#pageClients .client-report .wt .report-source{font-size:13px}
.wt-scroll{margin-top:12px}
.wt-table{width:100%;border-collapse:collapse;min-width:640px;table-layout:auto}
.wt-table th,.wt-table td{text-align:left;vertical-align:top;padding:8px 10px;border-bottom:1px solid var(--line)}
.wt-table th.wt-label{position:sticky;left:0;z-index:1;background:var(--panel);font-weight:500;min-width:150px;max-width:220px}
.wt-n{display:inline-block;min-width:2.2em;margin-inline-end:6px;color:var(--muted);font-family:var(--mono);font-size:13px;white-space:nowrap}
.wt-cell{min-width:96px}
.wt-val,.wt-nw{white-space:nowrap;font-variant-numeric:tabular-nums}
.wt-why{display:block;color:var(--muted);font-size:13px;overflow-wrap:break-word;hyphens:manual}
.wt-mark{display:block;margin-top:2px}
.wt-diff{color:var(--warn)}
.wt-formula th.wt-label{color:var(--muted)}
.wt-formula .wt-cell{background:var(--bg)}
.wt-proposal .wt-val,.wt-manual .wt-val,.wt-formula .wt-val{color:var(--muted)}
.wt-week{width:100%;text-align:left;white-space:nowrap;padding:4px 8px}
.wt-week[aria-pressed="true"]{border-color:var(--accent);font-weight:600}
.wt-table .wt-sel{border-inline:2px solid var(--accent)}
.wt-block th{background:var(--panel);font-weight:600;padding-top:14px;border-bottom:1px solid var(--line)}
.wt-gap td{height:10px;padding:0;border-bottom:0}
.wt-unmapped{margin:8px 0 0}
.wt-blocked{margin:12px 0 0}
#pageClients .wt-table th,#pageClients .wt-table td{text-align:left;white-space:normal}
#pageClients .wt-table .wt-val,#pageClients .wt-table .wt-nw,#pageClients .wt-table .wt-n,#pageClients .wt-table .wt-week{white-space:nowrap}
@media(max-width:600px){#pageClients .wt-scroll{overflow-x:auto}}
.wt-block th{position:sticky;left:0}

.wt-table .report-source,.wt-copy .report-copy,.wt-unmapped{font-size:13px}
.wt-copy{gap:6px}.wt-copy .report-copy{padding:3px 10px;min-height:0;width:auto}
.wt-copy-week{font-size:13px;color:var(--muted)}
#pageClients .client-report .report-period-note{font-size:13px}
.wt-alt{user-select:none;-webkit-user-select:none}
