.template-report { margin-bottom:24px; padding:24px; --block-snap:#edf5e7; --block-google:#eaf2fa; --block-meta:#faedf5; --block-tiktok:#f0eafa; }
.template-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.template-heading h2 { font-family:Manrope,sans-serif; font-size:20px; letter-spacing:-.5px; margin:0 0 8px; }
.template-heading p { color:var(--text-muted); font-size:11px; line-height:1.8; margin:0; }
.template-file-badge { display:flex; align-items:center; gap:7px; font-size:9px; color:var(--text-muted); white-space:nowrap; }
.template-file-badge .lucide { width:16px; height:16px; }
.template-controls { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.template-controls label { display:flex; flex:1; min-width:150px; flex-direction:column; gap:8px; font-size:10px; color:var(--text-secondary); }
.template-controls label:first-child { flex:1.3; }
.template-controls input,.template-controls select { border:1px solid var(--line); border-radius:7px; padding:10px 12px; background:var(--surface); color:var(--ink); font-size:11px; height:38px; width:100%; }
.template-scope-note { color:var(--text-muted); font-size:9px; line-height:1.8; margin:12px 0 0; }
.template-toolbar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin:16px 0; }
.template-preview-tabs { display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.template-preview-tabs button { font-size:10px; color:var(--text-secondary); border:1px solid var(--line); border-radius:6px; padding:9px 10px; }
.template-preview-tabs button.active { color:var(--green); border-color:var(--green); background:var(--accent-soft); }
.template-preview-tabs span { margin-left:5px; font-size:9px; }
.template-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.template-sheet-title { display:flex; justify-content:space-between; align-items:center; gap:15px; background:var(--surface-soft); border:1px solid var(--line); border-radius:8px 8px 0 0; padding:13px; }
.template-sheet-title strong { font-size:11px; font-weight:600; }
.template-sheet-title span { font-size:9px; color:var(--text-muted); }
.template-grid-scroll { overflow:auto; max-height:530px; border:1px solid var(--line); border-top:0; }
.template-grid { width:max-content; min-width:100%; font-variant-numeric:tabular-nums; }
.template-grid :is(th,td) { padding:8px 6px; font-size:9px; text-align:right; min-width:90px; border:1px solid color-mix(in srgb,var(--ink) 8%,transparent); color:var(--text-secondary); }
.template-grid thead { position:sticky; top:0; z-index:3; }
.template-grid thead th { text-align:center; padding:11px 7px; font-weight:600; }
.template-grid .template-date-cell { min-width:100px; position:sticky; left:0; z-index:1; text-align:left; background:var(--surface); }
.template-grid .template-day-cell { min-width:95px; position:sticky; left:100px; z-index:1; background:var(--surface); text-align:center; }
.template-grid thead .template-date-cell,.template-grid thead .template-day-cell { background:var(--surface-soft); z-index:4; }
.template-grid .template-platform-0 { background:var(--block-snap); }
.template-grid .template-platform-1 { background:var(--block-google); }
.template-grid .template-platform-2 { background:var(--block-meta); }
.template-grid .template-platform-3 { background:var(--block-tiktok); }
.template-grid .template-date-group { background:var(--surface-soft); text-align:left; }
.template-grid input { color:var(--ink); background:transparent; border:1px solid transparent; border-radius:3px; width:88px; padding:4px; text-align:right; font-size:10px; height:27px; appearance:textfield; }
.template-grid input::-webkit-inner-spin-button { appearance:none; }
.template-grid input:focus { background:var(--surface); border-color:var(--green); outline:2px solid color-mix(in srgb,var(--green) 20%,transparent); outline-offset:0; }
.template-grid input::placeholder { color:var(--text-muted); }
.template-grid input[aria-invalid="true"] { border-color:#c87965; }
.template-grid tfoot { position:sticky; bottom:0; z-index:2; }
.template-grid tfoot :is(th,td) { font-weight:600; padding:12px 8px; border-top:2px solid var(--line); }
.template-grid tfoot th { background:var(--surface-soft); text-align:left; position:sticky; left:0; z-index:3; }
.template-pagination { display:flex; align-items:center; justify-content:space-between; gap:15px; margin-top:12px; color:var(--text-muted); font-size:8px; line-height:1.8; }
.template-pagination>div { display:flex; gap:8px; align-items:center; white-space:nowrap; }
.template-pagination .button { padding:5px; }
.template-bottom { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:22px; }
.template-bottom #template-save-status { color:var(--accent-text); font-size:10px; }
.template-bottom p { font-size:9px; line-height:1.8; color:var(--text-muted); max-width:550px; margin:7px 0 0; }
.template-copy-manual { display:flex; flex-direction:column; gap:9px; font-size:10px; color:var(--text-secondary); margin-top:20px; }
.template-copy-manual textarea { width:100%; min-height:140px; font-family:monospace; font-size:10px; white-space:pre; border:1px solid var(--line); border-radius:7px; padding:12px; color:var(--ink); background:var(--surface-soft); }
html[data-theme="midnight"] .template-report { --block-snap:#273c30; --block-google:#253846; --block-meta:#3d2d3a; --block-tiktok:#332c43; }
html[data-theme]:not([data-theme="evergreen"]) .template-grid :is(th,td) { color:var(--text-secondary); border-color:var(--line); }
html[data-theme]:not([data-theme="evergreen"]) .template-grid .template-platform-0 { background:var(--block-snap); }
html[data-theme]:not([data-theme="evergreen"]) .template-grid .template-platform-1 { background:var(--block-google); }
html[data-theme]:not([data-theme="evergreen"]) .template-grid .template-platform-2 { background:var(--block-meta); }
html[data-theme]:not([data-theme="evergreen"]) .template-grid .template-platform-3 { background:var(--block-tiktok); }
@media(max-width:900px) { .template-bottom { flex-direction:column; align-items:flex-start; } .template-file-badge { display:none; } }
@media(max-width:640px) { .template-report { padding:18px; } .template-controls { gap:10px; } .template-controls label { min-width:130px; } .template-controls label:first-child { flex-basis:100%; } .template-controls>.button { width:100%; } .template-pagination { align-items:flex-start; flex-direction:column; } .template-sheet-title { flex-wrap:wrap; gap:5px; } .template-toolbar { align-items:flex-start; } .template-actions .button { font-size:9px; padding:9px; } }

.template-copy-options { border:1px solid var(--line); background:var(--surface-soft); border-radius:8px; padding:16px; margin-top:20px; }
.template-copy-controls { display:flex; align-items:flex-end; flex-wrap:wrap; gap:12px; }
.template-copy-controls label { display:flex; flex:1; min-width:170px; flex-direction:column; gap:7px; font-size:10px; color:var(--text-secondary); }
.template-copy-controls select { padding:9px 10px; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:6px; font-size:10px; }
.template-metric-options { display:flex; flex-wrap:wrap; gap:10px 16px; margin-top:16px; }
.template-metric-options label { display:flex; align-items:center; gap:6px; font-size:10px; color:var(--text-secondary); }
.template-metric-options input { accent-color:var(--green); }
.template-copy-count { font-size:9px; line-height:1.8; color:var(--text-muted); margin:12px 0 0; }
