/* Studies page (materials x methods matrix). Layout and look follow the approved
   mockup; class names are st-* so nothing collides with the site theme. The page
   frame (container width, padding) is supplied by layouts/ambit.njk. */

/* One line above the matrix, not a paragraph: the table and the Partner control say most
   of it, and every line here is a line the matrix does not get. */
.st-dek { margin: 0 0 10px; color: #646e7f; font-size: 13px; }
.st-status, .st-note { color: #5b5b5b; margin: 8px 0; }
.st-note { border-left: 3px solid #dde1e9; padding-left: 10px; }
.st-error { color: #8a2f22; background: #fbeeec; border-left: 3px solid #8a2f22; padding: 9px 12px; margin: 12px 0; border-radius: 0 4px 4px 0; }
.st-retry { margin-left: 10px; }

#st-root { --st-ink: #1d2733; --st-mut: #6b7785; --st-line: #e1e6ec; --st-bg: #f6f8fa; --st-acc: #0b6bcb; --st-accbg: #e8f1fb; --st-ambit: #8a4fff; --st-nexus: #0e8f6e; color: var(--st-ink); }
#st-root * { box-sizing: border-box; }

.st-layout { display: grid; grid-template-columns: 270px 1fr; min-height: 60vh; border: 1px solid var(--st-line); border-radius: 8px; overflow: hidden; }
.st-side { border-right: 1px solid var(--st-line); background: var(--st-bg); padding: 14px; overflow: auto; max-height: calc(100vh - 160px); }
.st-fac { margin-bottom: 16px; }
.st-fac h3 { margin: 0 0 5px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--st-mut); display: flex; justify-content: space-between; }
.st-fac h3 a { text-transform: none; letter-spacing: 0; color: var(--st-acc); cursor: pointer; font-weight: 400; }
.st-fac input[data-fq] { width: 100%; padding: 5px 8px; border: 1px solid var(--st-line); border-radius: 6px; font: inherit; margin-bottom: 4px; }
.st-fl { max-height: 168px; overflow: auto; background: #fff; border: 1px solid var(--st-line); border-radius: 6px; }
.st-fl label { display: flex; gap: 7px; align-items: center; padding: 3px 8px; cursor: pointer; margin: 0; font-weight: 400; }
.st-fl label:hover { background: var(--st-accbg); }
.st-n { margin-left: auto; color: var(--st-mut); font-variant-numeric: tabular-nums; font-size: 12px; }
.st-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-more { margin: 4px 8px; color: var(--st-mut); font-size: 12px; }

.st-content { padding: 12px 16px 24px; min-width: 0; }
.st-top { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; margin-bottom: 8px; }
.st-stat b { font-size: 20px; margin-right: 4px; }
.st-stat span { color: var(--st-mut); font-size: 12px; }
input.st-q { padding: 7px 10px; border: 1px solid var(--st-line); border-radius: 8px; font: inherit; width: 300px; max-width: 100%; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.st-chip { background: var(--st-accbg); color: var(--st-acc); border-radius: 999px; padding: 2px 6px 2px 10px; font-size: 12px; cursor: pointer; }
.st-chip b { margin-left: 4px; }
.st-pager { display: inline-flex; gap: 6px; align-items: center; color: var(--st-mut); font-size: 12px; }
.st-pager button { border: 1px solid var(--st-line); background: #fff; border-radius: 6px; padding: 2px 9px; cursor: pointer; }
.st-pager button:disabled { opacity: .35; cursor: default; }
.st-legend { color: var(--st-mut); font-size: 12px; margin: 4px 0 8px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.st-ramp i { display: inline-block; width: 16px; height: 10px; vertical-align: -1px; }

.st-wrap { overflow: auto; border: 1px solid var(--st-line); border-radius: 8px; max-height: calc(100vh - 260px); }
.st-tbl { border-collapse: separate; border-spacing: 0; }
.st-tbl th, .st-tbl td { padding: 0; border-bottom: 1px solid var(--st-line); border-right: 1px solid #f0f3f6; text-align: center; }
.st-gh { background: var(--st-bg); font-size: 12px; font-weight: 600; padding: 4px 8px !important; cursor: pointer; position: sticky; z-index: 2; white-space: nowrap; text-align: left !important; height: 26px; }
.st-gh.st-l0 { top: 0; }
.st-gh.st-l1 { top: 26px; background: #fbfcfd; }
.st-gh.st-l2 { top: 52px; background: #fff; font-weight: 500; }
.st-gh .st-sub { font-weight: 400; }
.st-ch { background: #fff; position: sticky; z-index: 2; vertical-align: bottom; font-weight: 500; font-size: 11px; }
.st-ch div { writing-mode: vertical-rl; transform: rotate(180deg); height: 118px; margin: 4px auto; max-width: 30px; }
.st-tbl td.st-rowh, .st-tbl th.st-rowh { text-align: left; position: sticky; left: 0; background: #fff; z-index: 3; min-width: 190px; max-width: 190px; padding: 5px 10px; border-right: 1px solid var(--st-line); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tbl th.st-rowh { z-index: 4; top: 0; }
.st-tbl td.st-rg { background: var(--st-bg); cursor: pointer; max-width: none; }
.st-tbl td.st-c { width: 34px; min-width: 34px; height: 30px; }
.st-sub { font-size: 12px; color: var(--st-mut); }
.st-car { color: var(--st-mut); display: inline-block; width: 12px; }
.st-badge { display: inline-block; font-size: 10px; padding: 0 6px; border-radius: 999px; color: #fff; margin-left: 6px; vertical-align: 1px; }
.st-badge.st-ambit { background: var(--st-ambit); }
.st-badge.st-nexus { background: var(--st-nexus); }
.st-cell { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 30px; border: 0; padding: 0; font-size: 12px; font-weight: 600; cursor: pointer; color: #fff; }
.st-cell:hover, .st-cell:focus, .st-cell.st-sel { outline: 2px solid var(--st-ink); outline-offset: -2px; }

.st-panel { position: fixed; right: 0; top: 0; bottom: 0; width: 440px; max-width: 100vw; background: #fff; border-left: 1px solid var(--st-line); box-shadow: -8px 0 24px rgba(0, 0, 0, .08); padding: 18px; overflow: auto; display: none; z-index: 1100; }
.st-panel.open { display: block; }
.st-panel h2 { margin: 0; font-size: 18px; padding-right: 28px; }
.st-x { position: absolute; right: 14px; top: 8px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--st-mut); }
.st-ph { margin: 16px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--st-ink); border-bottom: 2px solid var(--st-line); padding-bottom: 3px; }
.st-study { border: 1px solid var(--st-line); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.st-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.st-row.st-link { margin-top: 6px; }
.st-study a { color: var(--st-acc); text-decoration: none; font-weight: 600; font-size: 12px; margin-left: 10px; }

@media (max-width: 800px) {
	.st-layout { grid-template-columns: 1fr; }
	.st-side { border-right: 0; border-bottom: 1px solid var(--st-line); max-height: 320px; }
}

.st-ttl { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.st-row.st-link > span:last-child { flex: none; white-space: nowrap; }
.st-ref { font-size: 12px; color: var(--st-mut); margin: 0 0 4px; overflow-wrap: anywhere; }
.st-file { font-style: italic; }
