#month-checklist {
  --check-cols: minmax(0, 1.08fr) minmax(0, 1.3fr) minmax(0, 1.42fr) minmax(70px, .42fr);
  display: grid;
  gap: 14px;
  min-width: 0;
  color: var(--ink);
}
#month-checklist [hidden], #month-checklist [data-check-errors]:empty { display: none !important; }
.check-banner, .check-group, .check-report {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.check-banner {
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.check-banner h2 { font-size: 19px; }
.check-banner p, .check-report p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.check-metrics { display: flex; gap: 20px; align-items: center; }
.check-metrics > div { display: grid; gap: 2px; }
.check-metrics > div + div { border-left: 1px solid var(--line); padding-left: 18px; }
.check-metrics b { font-size: 20px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.check-metrics small, .check-metrics span { color: var(--muted); font-size: 12px; }
.check-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.check-toolbar .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-dimension select { width: auto; min-height: 33px; font-size: 13px; }
.check-group { overflow: clip; min-width: 0; }
.check-group > header { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; }
.check-group > header div,.check-report > div { display: flex; align-items: center; gap: 8px; }
.check-group > header .icon,.check-report .icon { width: 17px; height: 17px; color: var(--blue); }
.check-group > header h2 { font-size: 16px; }
.check-group > header small, .check-col-head, .check-row small, .check-subtle { color: var(--muted); }
.check-row,.check-col-head { display: grid; grid-template-columns: var(--check-cols); gap: 12px; }
.check-col-head { padding: 7px 16px; background: #f2f5f9; font-size: 12px; font-weight: 550; }
.check-row { padding: 12px 16px; align-items: start; border-top: 1px solid var(--line); }
.check-row > div, .check-name h3, .check-row details { min-width: 0; }
.check-name > small, .check-gaps, .check-self > small { display: block; }
.check-link { padding: 0; min-height: 22px; border: 0; border-radius: 2px; background: none; color: var(--blue); font-size: 12px; text-align: start; }
.check-link:hover { text-decoration: underline; }
.check-name h3 .check-link { font-size: 14px; line-height: 1.5; font-weight: 650; color: var(--ink); }
.check-name h3 .check-link:hover { color: var(--blue); }
.check-gaps { font-size: 12px; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.check-gaps.needs-attention,.check-material-gap { color: #87551e; }
.check-material { display: flex; align-items: start; flex-direction: column; gap: 3px; font-size: 12px; }
.check-col-label { display: none; }
.check-row details { max-width:100%; }
.check-row summary { cursor: pointer; color: var(--blue); display:list-item; padding:0; font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
.check-requirement summary, .check-extra summary { color: var(--muted); }
.check-sources ul { list-style: none; display: grid; gap: 6px; padding: 7px 0; }
.check-sources li, .check-requirement p, .check-collision { font-size:12px; overflow-wrap:anywhere; }
.check-sources li small { display: block; }
.check-source-kind { color: var(--muted); }
.check-extra { margin-top: 4px; }
.check-extra[open] { display: grid; gap: 5px; }
.check-field { display: grid; gap: 3px; min-width: 0; }
.check-field > span, .check-rate { font-size: 12px; color: var(--muted); }
.check-field input,.check-field textarea { width: 100%; min-width: 0; padding: 6px 8px; min-height: 34px; font-size:14px; border:1px solid #cbd5e1; border-radius:5px; background:#fff; }
.check-field textarea { resize: vertical; }
.check-row input[type=number] { appearance: textfield; -moz-appearance: textfield; font-variant-numeric:tabular-nums; }
.check-row input[type=number]::-webkit-inner-spin-button { -webkit-appearance:none; }
.check-amounts { display: grid; gap: 7px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.check-rate:not(:empty) {display:block; margin-top:2px;}
.check-na {display:flex; align-items:center; gap:5px; font-size:12px; margin:4px 0;}
.check-na input {width:auto;}
.check-read-value {font-size:13px; overflow-wrap:anywhere;}
.check-self input {max-width:96px;}
.check-collision {display:grid; justify-items:start; border-left:2px solid #c87c1b; padding-left:6px; margin-top:6px;}
.check-status-line:not(:empty), .check-notice { background:#fff8ed; border:1px solid #ecdbb6; border-radius:6px; padding:8px 12px; font-size:13px; }
.check-empty { background:#fff; padding:24px; color:var(--muted); }
.check-report {display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px;}
.check-bottom {position:sticky; bottom:0; z-index:3; display:flex; justify-content:space-between; gap:8px; align-items:center; padding:10px 14px calc(10px + env(safe-area-inset-bottom)); background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 -2px 10px rgb(23 41 72 / .05);}
.check-save {font-size:12px; color:var(--muted);}
.check-bottom .actions {justify-content:flex-end; gap:6px;}
#month-checklist :is(input,textarea,select,button,summary,a):focus-visible {outline:2px solid var(--blue); outline-offset:2px;}
@media(max-width:880px){
  #month-checklist {--check-cols:minmax(0,1fr) minmax(0,1fr) minmax(0,1.35fr) minmax(56px,.45fr);}
  .check-row,.check-col-head {gap:8px;padding-left:12px;padding-right:12px;}
}
@media(max-width:700px){
  .check-banner {padding:12px;}
  .check-group > header {padding:11px 12px; background:#f4f6fa;}
  .check-col-head {display:none;}
  .check-row {grid-template-columns:minmax(0,1fr) minmax(64px, .33fr); gap:8px 12px; padding:14px 12px;}
  .check-name {grid-column:1/-1;}
  .check-name h3 {display:inline;}
  .check-name >small {display:inline; margin-left:7px;}
  .check-material {grid-column:1/-1; border-left:2px solid #e1e7ef; padding-left:8px;}
  .check-actual {grid-column:1;}
  .check-self {grid-column:2;}
  .check-field input,.check-field textarea {min-height:39px;font-size:16px;}
  .check-report {padding:10px 12px;}
  .check-bottom {flex-wrap:wrap;padding:8px; border-radius:6px;}
  .check-toolbar .chip {font-size:12px;}
  .check-metrics {gap:12px;}
  .check-metrics > div + div {padding-left:12px;}
  .check-toolbar .chip,.check-bottom .button {min-height:36px;}
}
@media(max-width:390px){
  .check-toolbar {gap:5px;}
  .check-toolbar .chips {gap:3px;}
  .check-toolbar .chip {padding:5px 7px;}
  .check-banner {gap:10px;}
  .check-save {font-size:11px;}
  .check-bottom .button {font-size:12px; padding:5px 7px;}
}
.check-draft-tools summary { width: fit-content; cursor:pointer; font-size:12px; color:var(--muted); }
.check-draft-tools[open] .button { margin-top:7px; }
.check-excerpt { white-space:pre-line; font-size:12px; color:var(--ink); margin:3px 0; }
.check-export-menu {position:relative;}
.check-export-menu summary {list-style:none;cursor:pointer;}
.check-export-menu summary::-webkit-details-marker {display:none;}
.check-export-menu > div {position:absolute;right:0;top:calc(100% + 4px);z-index:5;display:grid;gap:3px;min-width:98px;padding:5px;border:1px solid var(--line);border-radius:6px;background:#fff;box-shadow:0 3px 12px rgb(23 41 72 / .1);}
.check-tools {gap:6px 10px;flex-wrap:wrap;}
.check-tools > small,.check-rule-hint,.month-report header > span,.month-report-actions small {color:var(--muted);font-size:12px;}
.check-rule-hint {display:block;margin-top:3px;}
.month-report {
  display:grid;gap:14px;min-width:0;padding:clamp(14px,1.5vw,22px);
  background:linear-gradient(115deg,#f6f7ff,transparent 43%) no-repeat 0 0 / 100% 120px,white;
  border:1px solid var(--command-edge);border-radius:var(--radius);
  box-shadow:var(--elevation);scroll-margin-top:20px;container-type:inline-size;
}
.month-report > header,.month-report-actions {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px 12px;}
.month-report > header h2 {display:flex;align-items:center;gap:10px;font-size:18px}
.month-report > header h2 .icon {
  width:34px;height:34px;padding:7px;border-radius:9px;color:#f7f8ff;
  background:var(--primary-face);box-shadow:inset 0 1px 0 #ffffff44;
}
.report-preparation {
  display:flex;align-items:center;justify-content:space-between;gap:10px 18px;flex-wrap:wrap;
  padding:10px 12px;border:1px solid #dce1ed;border-radius:9px;
  background:linear-gradient(115deg,#f5f7fa,#eff0fa);
}
.report-preparation [data-month-model-action],.report-scope {
  display:flex;align-items:center;flex-wrap:wrap;gap:8px;
}
.report-preparation [data-month-model-action]:empty,.report-source-list:empty {display:none}
.report-scope {font-size:12px;color:var(--muted)}
.report-scope select {width:auto;font-size:13px;min-height:34px}
.report-preparation .button {min-height:34px}
.report-preparation .ai-action {background:#51478a;border-color:#49407d;color:white;box-shadow:inset 0 1px 0 #ffffff22}
.report-preparation .ai-action:hover:not(:disabled) {background:#453b79;border-color:#3b326c}
.report-source-list {display:flex;align-items:start;flex-wrap:wrap;gap:0 20px;padding:4px 2px 0}
.report-source-list details[open] {flex-basis:100%}
.report-source-list summary,.report-format summary {width:fit-content;max-width:100%;font-weight:550}
.month-report-actions {justify-content:flex-start;gap:4px;border-top:1px solid var(--line);padding-top:8px}
.month-report-actions small {margin-inline-start:auto}
.month-report-editors {display:grid;grid-template-columns:1fr 1fr;gap:14px;min-width:0}
.month-report-editors>.panel {
  display:grid;grid-template-rows:auto auto 1fr auto;align-content:start;gap:9px;
  margin:0;padding:15px;min-width:0;background:white;box-shadow:0 2px 5px rgb(31 45 72 / 4%);
}
.month-report-editors>.panel+.panel {margin:0}
.month-report-editors .section-head {margin:0;min-height:30px}
.month-report-editors .section-head h2 {display:flex;align-items:center;gap:8px;font-size:16px}
.month-report-editors .section-head .icon {color:#52648a}
.month-report-editors .section-head .ai-action {
  color:var(--ai-ink);background:transparent;border-color:transparent;box-shadow:none;
}
.month-report-editors .report-editor-actions {margin:0;gap:4px 6px;align-content:start}
.month-report .button .icon,.check-bottom .button .icon {width:16px;height:16px}
.month-report-editors .rich {
  min-height:115px;padding:12px 14px;line-height:1.75;max-width:100%;border-radius:8px;
  border-color:#d4dce9;background:#fcfdff;box-shadow:inset 0 1px 3px rgb(26 42 69 / 4%);overflow-x:auto;
}
.month-report-editors .rich:focus {background:white;outline:2px solid var(--focus);outline-offset:1px}
.month-report-editors .rich:empty::before {
  content:attr(aria-placeholder);color:#65738a;pointer-events:none;
}
.month-report-editors .report-format {margin:0;align-self:start}
.month-report-editors .report-format[open]>summary {margin-bottom:8px}
@supports (grid-template-rows:subgrid) {
  .month-report-editors>.panel {grid-row:span 4;grid-template-rows:subgrid}
}
@container (max-width:744px) {
  .month-report-editors {grid-template-columns:minmax(0,1fr)}
}
.month-report .report-format,.check-source-preview {margin-block:6px;color:var(--muted);font-size:12px;}
.month-report summary {cursor:pointer;}
.month-report .report-format .toolbar {margin:5px 0;}
.check-source-preview li {margin:5px 0;overflow-wrap:anywhere;white-space:pre-line;color:var(--ink);}
.check-source-preview small {color:var(--muted);}
@media(max-width:700px){
  .month-report {padding:12px;}
  .month-report-editors {grid-template-columns:minmax(0,1fr);}
  .month-report .rich {font-size:16px;}
  .check-tools .button {min-height:36px;}
}

.check-tools details summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.check-tools details[open] > div { margin-top: 6px; }

.check-banner {display:grid;grid-template-columns:minmax(0,1fr);justify-content:stretch;gap:14px;padding:18px 20px;}
.check-summary-title,.check-summary-foot {display:flex;align-items:center;justify-content:space-between;gap:5px 16px;flex-wrap:wrap;}
.check-step,.check-cap {padding:3px 9px;border-radius:5px;background:#edf3fb;color:var(--nav);font-weight:600;font-size:12px;font-variant-numeric:tabular-nums;}
.check-metrics {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;gap:8px;}
.check-metrics progress {display:block;max-width:130px;width:90%;height:4px;accent-color:var(--blue);margin-top:3px;}
.check-metrics b,.check-preview dd,.rv-counts b {font-variant-numeric:tabular-nums;}
.check-summary-foot {border-top:1px solid var(--line);padding-top:9px;color:var(--muted);font-size:12px;}
.check-cap {padding:1px 6px;}
.check-target {color:var(--muted);font-size:12px;line-height:1.5;margin-top:4px;overflow-wrap:anywhere;}
.check-target summary {color:var(--muted);}
.check-target[open] p {margin:4px 0;color:var(--ink);}
.check-save {display:grid;gap:2px;}.check-save small {font-size:inherit;}
.check-save small:empty {display:none;}
.check-step[data-act]{border:1px solid var(--line);cursor:pointer}
.check-step[data-act]:disabled{border-color:transparent;cursor:default}
@media(max-width:700px){
  #month-checklist:has(:is(input:not([type=checkbox]),textarea,[contenteditable=true]):focus) .check-bottom{position:static}
  .check-step[data-act]{min-height:var(--touch-target)}
}
.check-preview {display:grid;gap:17px;overflow-wrap:anywhere;}
.check-preview-status {padding:10px 12px;background:#f2f5fa;border-radius:6px;color:var(--nav);font-size:13px;}
.check-preview h3 {font-size:16px;display:flex;align-items:baseline;gap:8px;padding-bottom:7px;border-bottom:1px solid var(--line);}
.check-preview h4 {font-size:14px;}
.check-preview small {color:var(--muted);font-size:12px;font-weight:400;}
.check-preview article {display:grid;grid-template-columns:minmax(0,1fr) minmax(190px,.7fr);gap:5px 20px;padding:9px 0;border-bottom:1px solid var(--line);}
.check-preview article>p,.check-preview article>details {grid-column:1/-1;font-size:12px;}
.check-preview dl {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0;text-align:right;}
.check-preview dt {font-size:12px;color:var(--muted);}
.check-preview dd {font-size:14px;font-weight:600;margin:0;}
.check-preview .rich-preview {max-width:100%;overflow:auto;}
.item-inline-materials {border:1px solid var(--line);border-radius:8px;margin:10px 0 14px;}
.item-inline-materials>summary {cursor:pointer;padding:10px 12px;color:var(--nav);font-weight:600;}
.item-inline-materials>summary small {color:var(--muted);margin-left:4px;font-weight:400;}
.item-inline-materials[open]>summary {border-bottom:1px solid var(--line);}
.item-inline-materials [data-inline-materials] {padding:0 12px;}
.item-panel [data-item-materials]>.drawer-section {padding-block:12px;}
.item-summary-head>b {margin-left:auto;}
.item-rule-preview:not(:empty) {margin:8px 0;padding:7px 10px;border-radius:6px;background:var(--pale);color:var(--nav);font-size:13px;font-variant-numeric:tabular-nums;}
.item-panel .file-row {align-items:start;flex-wrap:wrap;}
.item-panel .file-row>a[download] {overflow-wrap:anywhere;}
.item-panel .file-row .sheet-sample {flex:1 1 100%;grid-column:1/-1;min-width:0;}
.item-panel .sheet-sample details>div {overflow:auto;max-width:100%;}
.item-panel .sheet-sample td {white-space:normal;overflow-wrap:anywhere;}
@media(min-width:701px){
  .check-col-head {position:sticky;top:0;z-index:1;}
  .item-panel .dropzone {min-height:64px;}
}
@media(max-width:700px){
  .check-banner {padding:13px;gap:10px;}
  .check-metrics {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;}
  .check-metrics>div+div {padding-left:0;border-left:0;}
  .check-metrics b {font-size:18px;}
  .check-preview article {grid-template-columns:minmax(0,1fr);}
  .check-preview dl {text-align:left;}
  .check-summary-foot {padding-top:6px;}
  .check-bottom .actions {flex-wrap:wrap;}
}

@media(max-width:700px) {
  :is(.check-bottom,.check-toolbar) :is(.button,.chip,select) {min-height:var(--touch-target)}
}
.check-bottom {
  border-color:var(--command-edge);border-radius:var(--radius);
  box-shadow:inset 0 1px 0 white,0 -3px 18px rgb(30 44 76 / 8%);
}
.check-bottom .actions {gap:8px}
.check-bottom .actions .button {min-height:38px;font-size:13px}
.check-save [data-check-save-state] {font-weight:600;color:var(--ink)}
@media(max-width:850px) {
  .month-report .button,.month-report select,.check-bottom .actions .button,
  .month-report summary {min-height:var(--touch-target)}
  .month-report summary {align-content:center}
}
@container (max-width:500px) {
  .report-preparation {align-items:stretch;flex-direction:column;gap:8px;padding:8px}
  .report-preparation [data-month-model-action] {justify-content:flex-start}
  .report-scope {flex-basis:100%;gap:8px}
  .report-preparation [data-act=check-use-report] {justify-content:flex-start}
  .report-source-list {gap:0 12px}
  .month-report-editors>.panel {padding:12px}
}
@media(max-width:520px) {
  .check-bottom {display:grid;grid-template-columns:minmax(0,1fr);gap:6px;padding-inline:8px}
  .check-bottom .actions {display:grid;grid-template-columns:auto 1fr 1fr;gap:4px}
  .check-bottom .actions .button {padding-inline:5px;font-size:12px;gap:4px}
  .check-bottom .actions .icon {display:none}
  .check-save {display:flex;align-items:baseline;gap:3px 8px;flex-wrap:wrap}
}

#evidence-batch {min-width:0;overflow-wrap:anywhere}
.match-scope {font-weight:600;color:var(--text)}
.match-group {margin:.8rem 0;padding:.75rem;border:1px solid var(--line,#d9e1ec);border-radius:.65rem}
.match-group>summary {cursor:pointer;font-weight:650}
.match-group>summary span,.match-row small,.match-row p,.match-footer span {color:var(--muted,#53647f);font-size:.85rem}
.match-group section h3 {margin:.8rem 0 .25rem;font-size:.95rem}
.match-group ul {margin:0;padding:0;list-style:none}
.match-row {padding:.65rem 0;border-top:1px solid var(--line,#d9e1ec)}
.match-row p {margin:.3rem 0}
.match-pick,.match-adjust label {display:flex;align-items:center;gap:.5rem;min-height:36px}
.match-pick {font-weight:600}
.match-row input[type=checkbox] {width:1rem;height:1rem;flex:none}
.match-row blockquote {margin:.35rem 0;padding:.3rem .65rem;border-inline-start:2px solid #9cadd6}
.match-source,.match-adjust {margin-top:.4rem;font-size:.85rem}
.match-adjust select {min-width:0;max-width:75%}
.match-footer {position:sticky;bottom:0;background:var(--panel,#fff);border-top:1px solid var(--line,#d9e1ec);padding:.65rem 0 max(.65rem,env(safe-area-inset-bottom));display:flex;justify-content:space-between;align-items:center;gap:.5rem}
@media(max-width:600px){.match-pick,.match-adjust label,.match-group>summary,.match-source a,.match-source summary,.match-adjust summary{min-height:44px;align-content:center}.match-group{padding:.65rem}}

.month-compare {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:10px 0 20px}
.month-compare>div,.month-findings {border:1px solid var(--line,#d8e0ec);border-radius:10px;padding:12px;overflow-wrap:anywhere}
.month-compare h4,.month-findings h3 {margin:0 0 8px}
.month-findings {background:var(--soft,#f3f6fb);margin-bottom:18px}
.month-findings p,.month-findings li {margin:4px 0}
.month-findings small {color:var(--muted,#52617a)}
[data-month-field] fieldset {margin:8px 0;border:1px solid var(--line,#d8e0ec);border-radius:8px}
[data-month-field] fieldset label {display:block;margin:5px}
.month-compare [data-report-ref],.rich [data-report-ref] {font-size:.85em;color:var(--muted,#52617a)}
@media(max-width:680px){.month-compare{grid-template-columns:minmax(0,1fr);gap:6px}.month-compare .rich-preview{max-height:36vh;overflow:auto}}
