/* CSV Viewer only; the shared shell remains untouched. */
#csv-viewer-tool { min-width:0; display:flow-root; contain:layout paint; }
#csv-viewer-tool * { box-sizing:border-box; }
#csv-viewer-tool .cv-heading, #csv-viewer-tool .cv-upload, #csv-viewer-tool .cv-toolbar, #csv-viewer-tool .cv-panel { max-width:1140px; margin-inline:auto; }
#csv-viewer-tool h1 { margin:16px 0; font-size:clamp(32px,4vw,44px); letter-spacing:-.04em; }
#csv-viewer-tool h2 { margin:0 0 16px; font-size:22px; }
#csv-viewer-tool p { line-height:1.6; color:var(--muted); }
#csv-viewer-tool label { display:block; font-weight:700; }
#csv-viewer-tool .cv-heading > p { max-width:720px; }
#csv-viewer-tool .cv-upload { margin-top:28px; padding:16px; border:1px solid var(--line); border-radius:16px; }
#csv-viewer-tool .cv-drop { padding:32px 16px; border:2px dashed var(--control-border); border-radius:12px; background:var(--control-hover); text-align:center; }
#csv-viewer-tool .cv-drop.cv-drag-over { outline:3px solid var(--teal); outline-offset:3px; }
#csv-viewer-tool .cv-drop svg { color:var(--teal); margin-bottom:14px; }
#csv-viewer-tool .cv-drop h2 { margin:0 0 6px; }
#csv-viewer-tool .cv-drop p { margin:8px auto 18px; max-width:620px; }
#csv-viewer-tool #cv-file-note { margin:16px auto 0; font-size:14px; }
#csv-viewer-tool .cv-choose { position:relative; display:inline-flex; align-items:center; justify-content:center; overflow:hidden; min-height:48px; padding:12px 20px; border:1px solid transparent; border-radius:7px; background:var(--deep-teal); color:var(--action-text); font:inherit; font-weight:600; cursor:pointer; }
#csv-viewer-tool .cv-choose input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
#csv-viewer-tool .cv-choose:focus-within { outline:3px solid var(--teal); outline-offset:4px; }
#csv-viewer-tool .cv-toolbar { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:12px 16px; align-items:end; margin-top:20px; padding:16px; border:1px solid var(--line); border-radius:16px; }
#csv-viewer-tool .cv-field { min-width:0; }
#csv-viewer-tool .cv-field label { margin-bottom:8px; }
#csv-viewer-tool .cv-search-input { width:100%; min-width:0; min-height:44px; padding:10px 12px; border:1px solid var(--control-border); border-radius:7px; background:var(--paper); color:var(--navy); font:inherit; }
#csv-viewer-tool .cv-toggle { display:flex; align-items:center; gap:10px; min-height:44px; padding:0 4px; font-weight:400; cursor:pointer; color:var(--navy); }
#csv-viewer-tool .cv-toggle input { width:20px; height:20px; margin:0; accent-color:var(--teal); flex:0 0 auto; }
#csv-viewer-tool button { min-height:44px; padding:10px 18px; border:1px solid var(--control-border); border-radius:7px; background:var(--paper); color:var(--navy); font:inherit; font-weight:700; cursor:pointer; }
#csv-viewer-tool button:disabled { opacity:.55; cursor:not-allowed; }
#csv-viewer-tool .cv-panel { margin-top:20px; padding:16px; border:1px solid var(--line); border-radius:16px; }
#csv-viewer-tool .cv-meta { display:flex; flex-wrap:wrap; gap:6px 20px; align-items:baseline; justify-content:space-between; margin-bottom:12px; }
#csv-viewer-tool .cv-counts { font-weight:700; color:var(--navy); }
#csv-viewer-tool .cv-page-info { margin:0; font-size:14px; }
#csv-viewer-tool .cv-state { margin:0; padding:24px 8px; text-align:center; font-size:15px; }
#csv-viewer-tool .cv-scroll { max-height:70vh; overflow:auto; border:1px solid var(--control-border); border-radius:10px; background:var(--paper); }
#csv-viewer-tool .cv-table { border-collapse:separate; border-spacing:0; width:100%; font-size:14px; color:var(--navy); }
#csv-viewer-tool .cv-table caption { padding:10px 12px; text-align:left; font-size:14px; color:var(--muted); caption-side:top; }
#csv-viewer-tool .cv-table th { padding:0; border-bottom:1px solid var(--control-border); background:var(--control-hover); text-align:left; vertical-align:top; font-weight:700; }
#csv-viewer-tool .cv-table thead th { position:sticky; top:0; z-index:2; }
#csv-viewer-tool .cv-table td { padding:9px 12px; border-bottom:1px solid var(--line); vertical-align:top; min-width:8rem; max-width:26rem; white-space:pre-wrap; overflow-wrap:anywhere; }
#csv-viewer-tool .cv-sort { display:flex; align-items:center; gap:6px; width:100%; min-height:44px; padding:9px 12px; border:0; border-radius:0; background:transparent; text-align:left; font-weight:700; white-space:nowrap; }
#csv-viewer-tool .cv-sort-mark { font-size:12px; color:var(--teal); }
#csv-viewer-tool .cv-table th.cv-gutter, #csv-viewer-tool .cv-table td.cv-gutter { position:sticky; left:0; z-index:1; min-width:0; width:1%; padding-inline:10px; background:var(--paper); text-align:right; white-space:nowrap; color:var(--muted); font-weight:700; font-variant-numeric:tabular-nums; }
#csv-viewer-tool .cv-table thead th.cv-gutter { z-index:3; background:var(--control-hover); }
#csv-viewer-tool .cv-pager { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; justify-content:space-between; margin-top:14px; }
#csv-viewer-tool .cv-pager-buttons { display:flex; gap:8px; }
#csv-viewer-tool .cv-pager-buttons button { min-width:96px; }
#csv-viewer-tool .cv-pager[hidden] { display:none; }
#csv-viewer-tool .cv-search-input:disabled { opacity:.6; cursor:not-allowed; background:var(--control-hover); }
#csv-viewer-tool .cv-toggle input:disabled { opacity:.6; cursor:not-allowed; }
#csv-viewer-tool .cv-error { margin:12px 0 0; font-size:14px; }
#csv-viewer-tool .cv-error-on { padding-left:12px; border-left:4px solid #B3261E; font-weight:700; }
#csv-viewer-tool .cv-notes { margin:12px 0 0; padding-left:20px; font-size:14px; color:var(--muted); }
#csv-viewer-tool .cv-notes li { margin-bottom:4px; line-height:1.5; }
#csv-viewer-tool :is(a,button,input):focus-visible { outline:3px solid var(--teal); outline-offset:4px; }
#csv-viewer-tool .cv-scroll:focus-visible { outline:3px solid var(--teal); outline-offset:2px; }
#csv-viewer-tool #cv-status { min-height:1.6em; margin-top:12px; font-size:14px; }
@media(max-width:900px) { #csv-viewer-tool .cv-toolbar { grid-template-columns:minmax(0,1fr) auto; } #csv-viewer-tool .cv-field { grid-column:1 / -1; } }
@media(max-width:680px) { #csv-viewer-tool .cv-toolbar { grid-template-columns:1fr; } #csv-viewer-tool .cv-panel { padding:12px; } #csv-viewer-tool .cv-upload { padding:10px; } #csv-viewer-tool .cv-drop { padding:24px 12px; } #csv-viewer-tool .cv-table td { min-width:7rem; } #csv-viewer-tool .cv-pager-buttons { width:100%; } #csv-viewer-tool .cv-pager-buttons button { flex:1 1 0; } }
