/* Resources › Tools › Statement Extractor (#statements) and the client page's Bank statements tab. Colours from
   styles.css's tokens (light and dark), with the Resources area's violet (#8e7cf0). .linkish comes from leads.css,
   .rm-tabs from hub.css, .sr-only from work.css. */
[data-page="statements"], .st-tab { --st: #8e7cf0; --st-soft: color-mix(in srgb, var(--st) 14%, transparent); }
[data-page="statements"] .page-actions { flex-direction: row; align-items: center; }
.st-tabs { margin: 14px 0 16px; }
#st-body { display: grid; gap: 16px; min-width: 0; }
#st-banner { margin-top: 10px; }
.st-h { font-size: 13px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; }
.st-empty { margin: 18px 8px; color: var(--muted); font-size: 13px; }

/* The client bar */
.st-client { padding: 14px 16px; display: grid; gap: 8px; }
.st-cbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; align-items: flex-start; }
.st-cname { min-width: 0; }
.st-cname > b { font-size: 17px; }
.st-cdl { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0 0; }
.st-cdl div { display: grid; gap: 1px; }
.st-cdl dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.st-cdl dd { margin: 0; font-size: 13px; }
.st-cswitch { width: min(320px, 100%); }
.st-pick { display: grid; gap: 6px; position: relative; }
.st-pick .search { width: 100%; }
.st-pick .search input { width: 100%; min-width: 0; min-height: 34px; }
.st-hits { display: grid; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.st-hits button { display: flex; justify-content: space-between; gap: 8px; text-align: left; font: inherit; font-size: 13px; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 7px 10px; cursor: pointer; }
.st-hits button:hover { background: var(--line-2); }
.st-hits button small { color: var(--muted); }
.st-hits p { margin: 8px 10px; }

/* The drop zone */
.st-drop { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border: 2px dashed color-mix(in srgb, var(--st) 55%, var(--line)); border-radius: var(--radius); background: var(--st-soft); cursor: pointer; transition: background .15s, border-color .15s; position: relative; }
.st-drop:hover, .st-drop.over { border-color: var(--st); background: color-mix(in srgb, var(--st) 22%, transparent); }
.st-drop.busy { opacity: .7; pointer-events: none; }
.st-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.st-drop:focus-within { outline: 2px solid var(--st); outline-offset: 2px; }
.st-drop svg { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--st); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.st-drop b { display: block; font-size: 14px; }
.st-drop u { color: color-mix(in srgb, var(--st) 70%, var(--ink)); text-underline-offset: 3px; }
.st-drop small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }

/* Two panes: the batch and the review pane */
.st-panes { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.st-batch { padding: 12px 10px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.st-batch .st-h { margin-left: 6px; }
.st-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; width: 100%; align-items: start; gap: 8px; text-align: left; font: inherit; color: inherit; background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.st-item:hover { background: var(--line-2); }
.st-item.on { border-color: var(--st); background: var(--st-soft); }
.st-ic { min-width: 0; }
.st-ic b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-ic small { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 1px; }
.st-kind { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 6px; border-radius: 5px; background: var(--violet-soft); color: var(--violet); }
.st-pill { flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 99px; white-space: nowrap; background: var(--grey-soft); color: var(--ink-2); }
.st-pill.green { background: var(--green-soft); color: var(--green); }
.st-pill.amber { background: var(--amber-soft); color: var(--amber); }
.st-pill.red { background: var(--red-soft); color: var(--red); }
.st-pill.blue { background: var(--pma-blue-soft); color: var(--pma-blue-ink); }

.st-review { padding: 0; min-width: 0; }
.st-rvhead { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-width: 0; }
.st-rvhead b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.st-rvbody { padding: 14px 16px 16px; display: grid; gap: 14px; min-width: 0; }
.st-rvbody > p { margin: 0; }
.st-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; }
.st-rvbody input, .st-rvbody select, .st-settings input, .st-settings select, .st-tab select { font: 13px var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-height: 34px; width: 100%; min-width: 0; }
.st-ro { display: grid; gap: 4px; align-content: start; }
.st-ro span { font-size: 12.5px; color: var(--muted); }
.st-ro b { font-size: 15px; padding-top: 6px; font-variant-numeric: tabular-nums; }
.st-sec { display: grid; gap: 6px; min-width: 0; }
.st-sec h3 { font-size: 13px; color: var(--muted); letter-spacing: .06em; margin: 0; }
.st-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.st-checks li { display: flex; gap: 8px; align-items: baseline; }
.st-checks li > span { flex: none; width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; }
.st-checks li.ok > span { background: var(--green-soft); color: var(--green); }
.st-checks li.warn > span { background: var(--amber-soft); color: var(--amber); }
.st-checks li.bad > span { background: var(--red-soft); color: var(--red); }
.st-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-reading { display: grid; gap: 8px; }
.st-reading p { margin: 0; }
.st-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.st-bar span { display: block; height: 100%; background: var(--st); transition: width .3s; }
.st-pw { display: grid; gap: 10px; max-width: 460px; }
.st-pw p { margin: 0; }

/* Tables scroll inside their own box: the page never scrolls sideways */
.st-tblbox { position: relative; max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }
.st-tx { min-width: 760px; font-size: 12.5px; }
.st-tx th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.st-tx tfoot td { position: sticky; bottom: 0; background: var(--panel); font-weight: 700; border-top: 1px solid var(--line); }
.st-tx td, .st-tx th { padding: 5px 8px; vertical-align: top; }
.st-tx .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-tx .st-d { white-space: nowrap; }
.st-ed { cursor: text; }
.st-ed:hover { background: var(--line-2); }
.st-ed:focus { outline: 2px solid var(--st); outline-offset: -2px; }
.st-ed input { font: inherit; width: 100%; min-width: 80px; padding: 3px 5px; border: 1px solid var(--st); border-radius: 5px; background: var(--panel); color: var(--ink); }
.st-tx tr.flag td { background: var(--red-soft); }
.st-mark { width: 22px; text-align: center; }
.st-mark .ok { color: var(--green); }
.st-mark .bad { color: var(--red); font-weight: 700; }
.st-type { font-size: 10px; font-weight: 700; color: var(--muted); }
.st-del { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.st-del:hover { color: var(--red); }

/* Filing the original to Google Drive */
.st-filing { border-top: 1px solid var(--line-2); padding-top: 12px; }
.st-filing p { margin: 0; }
.st-fname, .st-path { display: block; font: 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--line-2); border-radius: 6px; padding: 6px 8px; overflow-wrap: anywhere; }
.st-path { color: var(--ink-2); }
.st-path .st-pill { font-family: var(--font); }
.st-drv { max-width: 340px; }
.st-paths { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.st-paths code { overflow-wrap: anywhere; }

/* Column mapping */
.st-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.st-mapcol { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-map small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-preview { font-size: 12px; }
.st-preview td, .st-preview th { white-space: nowrap; padding: 4px 8px; }

/* Saved statements and Settings */
.st-saved { display: grid; gap: 10px; }
.st-savedf { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.st-savedf .search input { min-width: 0; }
.st-stbl td small { display: block; }
.st-stbl .num { text-align: right; }
.st-settings { display: grid; gap: 16px; }
.st-set { display: grid; gap: 10px; }
.st-set .field { max-width: 320px; }
.st-layouts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.st-layouts li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.st-layouts small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The client page's Bank statements tab */
.st-tab { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.st-tab .cl-card, .st-tab .cl-body { min-width: 0; }
.st-hhead { display: flex; align-items: center; gap: 10px; }
.st-psel { max-width: 340px; margin-bottom: 12px; }
.st-gridbox { overflow-x: auto; max-width: 100%; position: relative; }
.st-grid { border-collapse: separate; border-spacing: 3px; font-size: 12px; }
.st-grid thead th { font-weight: 600; color: var(--muted); text-align: center; white-space: nowrap; padding: 0 2px; }
.st-grid tbody th { text-align: left; font-weight: 600; padding-right: 10px; white-space: nowrap; }
.st-grid tbody th small { display: block; font-weight: 400; color: var(--muted); }
.st-cell { display: inline-block; width: 26px; height: 18px; border-radius: 4px; vertical-align: middle; }
.st-cell.whole { background: var(--green); }
.st-cell.part { background: repeating-linear-gradient(135deg, var(--amber) 0 4px, var(--amber-soft) 4px 8px); }
.st-cell.missing { background: var(--red-soft); box-shadow: inset 0 0 0 1px var(--red); }
.st-cell.future { background: var(--grey-soft); box-shadow: inset 0 0 0 1px var(--line); }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); }
.st-legend > span { display: inline-flex; gap: 6px; align-items: center; }
.st-legend .st-cell { width: 16px; height: 12px; }
.st-need { margin-top: 12px; display: grid; gap: 4px; }
.st-need h3 { font-size: 13px; margin: 0; }
.st-need ul { margin: 0; padding-left: 18px; font-size: 13px; }
.st-acc + .st-acc { margin-top: 14px; }
.st-acc h3 { font-size: 14px; margin: 0 0 6px; }
.st-slist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.st-srow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.st-sper small { display: block; }
.st-sbtns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.st-sure { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; }
.st-gapline { color: var(--amber); font-size: 12.5px; font-weight: 600; padding: 4px 0 4px 30px; }

@media (max-width: 900px) {
  .st-panes { grid-template-columns: minmax(0, 1fr); }
  .st-batch { position: static; max-height: none; }
  .st-srow { grid-template-columns: auto minmax(0, 1fr) auto; }
  .st-sbtns { grid-column: 1 / -1; justify-content: flex-start; }
  .st-layouts li { grid-template-columns: minmax(0, 1fr) auto; }
  .st-layouts small { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .st-stbl .st-md { display: none; }
  .st-drop { padding: 14px; }
  .st-cswitch { width: 100%; }
}

/* AI cost (Anthropic usage only) */
.st-pill.violet { background: var(--violet-soft); color: var(--violet); }
.st-ai { position: relative; cursor: help; outline-offset: 2px; }
.st-tip { display: none; position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); width: max-content; max-width: min(320px, 80vw); white-space: pre-line; text-align: left; text-transform: none; letter-spacing: 0; font: 400 12px/1.45 var(--font); color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.st-ai.up .st-tip { top: auto; bottom: calc(100% + 6px); }
.st-ai.left .st-tip { right: auto; left: 0; }
.st-ai:hover .st-tip, .st-ai:focus .st-tip { display: block; }
.st-stbl .table-wrap, .st-saved .table-wrap { overflow: visible; }
@media (max-width: 900px) { .st-saved .table-wrap { overflow-x: auto; } }
.st-month { margin: 4px 0 0; }
.st-stbl tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.st-h3 { font-size: 13px; margin: 6px 0 0; }
.st-aikpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.st-aikpis .kpi b { font-size: 24px; }
.st-prices input { width: 80px; min-height: 30px; padding: 4px 6px; }
.st-prices th code { font-size: 12px; white-space: nowrap; }
.st-pricefields { align-items: start; }
.st-pricebox { overflow-x: auto; max-width: 100%; margin: 0 0 4px; position: relative; border: 1px solid var(--line); border-radius: 8px; }
.st-aiset .st-tick2 input { width: auto; min-height: 0; }
.st-tick2 { display: flex; gap: 8px; align-items: center; font-size: 13px; align-self: end; padding-bottom: 8px; }
@media (max-width: 900px) { .st-aikpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
