:root {
  --ink: #17233a;
  --muted: #5f6b7e;
  --navy: #173b62;
  --navy-dark: #0d2947;
  --teal: #12776f;
  --paper: #f5f7f8;
  --surface: #ffffff;
  --line: #dce3e8;
  --soft-blue: #eaf2f8;
  --red: #b42336;
  --red-bg: #fde8e8;
  --orange: #bd5d0b;
  --orange-bg: #fff0dc;
  --yellow: #79600b;
  --yellow-bg: #fff7c7;
  --green: #1d6b46;
  --green-bg: #e5f5e9;
  --context: #355a9b;
  --context-bg: #e8effc;
  --shadow: 0 12px 35px rgba(20, 37, 55, .08);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(18, 119, 111, .25); outline-offset: 2px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.55rem, 3vw, 2.15rem); line-height: 1.12; letter-spacing: -.025em; }
h2 { font-size: 1.02rem; line-height: 1.25; }
label { display: grid; gap: .38rem; color: #344156; font-size: .82rem; font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #cfd9e1; border-radius: 9px; padding: .72rem .78rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #9eb0bd; }
textarea { resize: vertical; line-height: 1.48; }
.hidden { display: none !important; }
.muted { color: var(--muted); line-height: 1.55; }
.compact { font-size: .82rem; margin-bottom: 0; }
.eyebrow { margin: 0 0 .35rem; text-transform: uppercase; letter-spacing: .13em; font-size: .67rem; font-weight: 800; color: var(--teal); }
.stack { display: grid; gap: 1rem; }

.access-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 12% 5%, #d8e8ec 0, transparent 34%), linear-gradient(135deg, #f7f9f8 0%, #eef3f5 55%, #e4ebf0 100%); }
.access-card { width: min(460px, 100%); padding: clamp(1.6rem, 5vw, 2.5rem); border: 1px solid rgba(149, 168, 182, .45); border-radius: 22px; background: rgba(255, 255, 255, .94); box-shadow: 0 24px 70px rgba(13, 41, 71, .14); }
.brand-mark { display: inline-grid; place-items: center; min-width: 76px; height: 46px; margin-bottom: 1.35rem; padding: 0 .75rem; border-radius: 10px 10px 10px 2px; background: var(--navy); color: #fff; font-weight: 850; letter-spacing: .05em; }
.brand-mark.small { min-width: 58px; height: 34px; margin: 0; font-size: .82rem; border-radius: 8px 8px 8px 2px; }
.privacy-note { margin: 1.5rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .76rem; line-height: 1.5; }
.privacy-note.compact-note { margin: .65rem 0 0; padding: .6rem .7rem; border: 1px solid #cfe1df; border-radius: 8px; color: #315b58; background: #eef7f6; }
.form-message { min-height: 1.2rem; margin: .8rem 0 0; color: var(--red); font-size: .82rem; line-height: 1.4; }
.form-message.success { color: var(--green); }
.analysis-connection-status { margin:0; color:#215c7b; font-size:.8rem; line-height:1.5; }
.score-profile-card { margin-top:1rem; min-width:0; }
#score-profile-charts { min-width:0; }
.score-profile-figure { margin:0; padding:.8rem 0; min-width:0; }
.score-profile-figure + .score-profile-figure { border-top:1px solid var(--line); }
.score-profile-figure figcaption { color:#215840; font-size:.95rem; font-weight:750; margin-bottom:.45rem; }
.score-profile-scroll { overflow-x:auto; max-width:100%; border:1px solid #d4e1da; border-radius:8px; background:#fff; }
.score-profile-svg { display:block; width:100%; min-width:900px; height:auto; }
.report-score-chart { max-width:100%; overflow:auto; margin:.4rem 0 .8rem; }
.score-chart-export { display:inline-block; position:relative; margin-top:.5rem; color:#215840; font-size:.8rem; }
.score-chart-export summary { min-height:44px; display:flex; align-items:center; padding:.4rem .7rem; border:1px solid #c3d7cc; border-radius:7px; cursor:pointer; font-weight:700; }
.score-chart-export > div { display:flex; flex-wrap:wrap; gap:.35rem; padding:.45rem 0; }
.score-chart-export button { min-height:44px; padding:.5rem .7rem; border:1px solid #c3d7cc; border-radius:6px; color:#215840; background:#f0f7f3; cursor:pointer; font-weight:700; }
.score-chart-export summary:focus-visible,.score-chart-export button:focus-visible { outline:3px solid #255b83; outline-offset:2px; }
@media print { .score-chart-export { display:none !important; } .score-profile-scroll { overflow:visible; } .score-profile-svg { min-width:0; } .score-profile-figure { break-inside:avoid; } }

.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: .72rem clamp(1rem, 3vw, 2rem); color: #fff; background: var(--navy-dark); box-shadow: 0 3px 10px rgba(10, 25, 42, .18); }
.brand-row, .top-actions { display: flex; align-items: center; gap: .8rem; }
.brand-row strong { display: block; font-size: .94rem; }
.brand-row span { display: block; margin-top: .15rem; color: #b9ccdb; font-size: .7rem; }
.user-pill, .status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: .25rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.user-pill { color: #d8e5ed; border: 1px solid rgba(255,255,255,.2); }
.status-pill { color: #445267; background: #eef2f4; }
.status-pill.saved { color: var(--green); background: var(--green-bg); }
.status-pill.warning { color: #785a00; background: #fff1c2; }
.tabs { position: sticky; top: 62px; z-index: 15; display: flex; gap: .25rem; overflow-x: auto; padding: 0 clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.tab { min-height: 48px; padding: 0 .9rem; border: 0; border-bottom: 3px solid transparent; color: #5b6676; background: transparent; font-size: .84rem; font-weight: 750; white-space: nowrap; }
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--teal); }
.tab-panel { display: none; }
.tab-panel.active { display: grid; grid-template-columns: minmax(0,1fr); min-width:0; }
#tab-responses { grid-template-columns: minmax(260px, 330px) 1fr; align-items: start; min-height: calc(100vh - 111px); }
.control-panel { position: sticky; top: 111px; max-height: calc(100vh - 111px); overflow-y: auto; padding: 1.15rem; border-right: 1px solid var(--line); background: #fbfcfc; }
.panel-heading, .page-heading, .table-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-heading h2, .table-heading h1 { margin: 0; }
.table-heading h1 { font-size: 1.02rem; line-height: 1.25; letter-spacing: 0; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy); background: #fff; font-size: 1.25rem; }
.case-fields, .filter-stack { display: grid; gap: .8rem; margin-top: 1.1rem; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.progress-block { margin: 1.15rem 0; padding: .85rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.progress-block div { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.progress-block strong { color: var(--ink); }
progress { width: 100%; height: 8px; margin-top: .65rem; accent-color: var(--teal); }
.check-row { display: flex; grid-template-columns: auto 1fr; align-items: flex-start; gap: .55rem; font-weight: 550; line-height: 1.4; }
.check-row input { width: 17px; height: 17px; margin-top: .05rem; accent-color: var(--teal); }
.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: 1.2rem; }
.panel-actions .primary { grid-column: 1 / -1; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: .58rem .88rem; border: 1px solid transparent; border-radius: 9px; font-size: .8rem; font-weight: 760; text-decoration: none; transition: transform .12s, background .12s, border-color .12s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .55; transform: none; }
.button.primary { color: #fff; background: var(--teal); }
.button.primary:hover { background: #0e655f; }
.button.secondary { color: var(--navy); border-color: #afc5d4; background: var(--soft-blue); }
.button.ghost { color: #46556a; border-color: var(--line); background: #fff; }
.topbar .button.ghost { color: #e4edf3; border-color: rgba(255,255,255,.22); background: transparent; }
.small-button { min-height: 32px; padding: .35rem .65rem; }
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.working-area { min-width: 0; padding: 1.1rem clamp(.8rem, 2vw, 1.6rem) 3rem; }
.safety-banner { display: grid; grid-template-columns: auto 1fr; gap: .8rem; margin-bottom: .9rem; padding: .9rem 1rem; border: 1px solid #e8a7ae; border-left: 5px solid var(--red); border-radius: 10px; color: #6d1722; background: #fff4f4; font-size: .82rem; line-height: 1.45; }
.legend-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #4b586b; font-size: .72rem; }
.legend-card span { display: inline-flex; align-items: center; gap: .35rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.level-3 { background: var(--red); }.dot.level-2 { background: var(--orange); }.dot.level-1 { background: #d3a400; }.dot.level-0 { background: var(--green); }.dot.contextual { background: var(--context); }
.text-button { margin-left: auto; border: 0; color: var(--navy); background: transparent; font-size: .72rem; font-weight: 750; }
.table-heading { align-items: end; margin: 1.3rem 0 .8rem; }
.items-list { display: grid; gap: .52rem; }
.item-row { display: grid; grid-template-columns: minmax(0, 1fr) 252px; gap: .8rem; align-items: center; min-height: 78px; padding: .72rem .78rem; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: 0 1px 0 rgba(20, 37, 55, .03); }
.item-row:hover { border-color: #b8c8d2; box-shadow: 0 4px 15px rgba(20, 37, 55, .06); }
.item-copy { min-width: 0; }
.item-title { display: flex; gap: .5rem; align-items: baseline; margin: 0; font-size: .88rem; line-height: 1.45; }
.item-number { flex: 0 0 auto; min-width: 30px; color: var(--teal); font-weight: 850; }
.item-meta { display: flex; gap: .38rem; flex-wrap: wrap; margin: .45rem 0 0 30px; }
.meta-chip { padding: .18rem .42rem; border-radius: 5px; color: #536174; background: #edf1f3; font-size: .62rem; font-weight: 680; }
.meta-chip.critical { color: #7a1c28; background: #fee9eb; }
.meta-chip.confidence { color: #6f5600; background: #fff5c9; }
.meta-chip.unscaled { color: #53636f; background: #edf1f3; }
.responses { display: grid; grid-template-columns: repeat(4, 1fr); gap: .34rem; }
.response-button { min-height: 39px; border: 1px solid #cdd7de; border-radius: 8px; color: #4c5b6e; background: #f8fafb; font-size: .75rem; font-weight: 820; }
.response-button:hover { border-color: #8ba2b2; background: #eef4f6; }
.response-button.selected.level-3 { color: #7b1724; border-color: #e8a0a9; background: var(--red-bg); box-shadow: inset 0 0 0 1px #d55767; }
.response-button.selected.level-2 { color: #85410b; border-color: #efb277; background: var(--orange-bg); box-shadow: inset 0 0 0 1px #dc7b29; }
.response-button.selected.level-1 { color: #6f5808; border-color: #e5cf67; background: var(--yellow-bg); box-shadow: inset 0 0 0 1px #cbae29; }
.response-button.selected.level-0 { color: #145739; border-color: #8ecaa2; background: var(--green-bg); box-shadow: inset 0 0 0 1px #49a46c; }
.response-button.selected.contextual { color: #294d8e; border-color: #9eb5df; background: var(--context-bg); box-shadow: inset 0 0 0 1px #6b8bc7; }
.response-button.selected.unclassified { color: #38465a; border-color: #aebbc5; background: #edf1f3; box-shadow: inset 0 0 0 1px #8c9aa6; }
.empty-state { padding: 3rem 1rem; border: 1px dashed #b9c6cf; border-radius: var(--radius); color: var(--muted); background: #fff; text-align: center; }

.content-panel { min-width:0; padding: clamp(1rem, 3vw, 2rem); }
.table-wrap[role="region"]:focus-visible { outline:3px solid rgba(18,119,111,.45); outline-offset:2px; }
.print-report { min-width:0; max-width:100%; overflow-x:auto; }
.page-heading { align-items: center; margin: 0 auto 1.4rem; width: min(1180px, 100%); }
.page-heading h1 { margin: 0; }
.interpret-grid, .settings-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 1rem; width: min(1180px, 100%); margin: 0 auto; }
.card { padding: clamp(1rem, 2.5vw, 1.4rem); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.card h2 { margin-bottom: .55rem; }
.score-grid { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: .55rem; margin-top: 1rem; }
.score-field { position: relative; }
.score-field label { display: block; margin-bottom: .28rem; color: #4c596b; font-size: .7rem; }
.score-field input { padding-right: 2.7rem; }
.score-band { position: absolute; right: .5rem; bottom: .65rem; padding: .12rem .32rem; border-radius: 4px; color: #556272; background: #edf1f3; font-size: .58rem; font-weight: 750; }
.score-band.high { color: #7b1724; background: var(--red-bg); }
.score-band.medium { color: #7b4d0a; background: var(--orange-bg); }
.score-band.bipolar { color: #294d8e; background: var(--context-bg); }
.confirm-row { margin-top: 1.1rem; padding: .8rem; border-radius: 9px; background: #f1f6f7; }
.output-card { width: min(1180px, 100%); margin: 1rem auto 0; }
.output-card textarea { min-height: 360px; font-family: ui-serif, Georgia, serif; }

.success-note { margin: 0; padding: .75rem .85rem; border-radius: 9px; color: var(--green); background: var(--green-bg); font-size: .8rem; line-height: 1.45; }
.settings-grid hr { width: 100%; border: 0; border-top: 1px solid var(--line); }
.settings-grid { align-items: start; }
.settings-action { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; }
.settings-action .form-message { margin: 0; }
.hint { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; max-width: 360px; padding: .75rem .9rem; border-radius: 9px; color: #fff; background: #25394c; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: .8rem; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 940px) {
  #tab-responses { grid-template-columns: 1fr; }
  .control-panel { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .case-fields { grid-template-columns: 1fr 1fr; }.case-fields > label:first-child, .case-fields > label:last-child { grid-column: 1 / -1; }
  .filter-stack { grid-template-columns: 1fr 1fr; }
  .panel-actions { grid-template-columns: repeat(4, 1fr); }.panel-actions .primary { grid-column: auto; }
  .item-row { grid-template-columns: 1fr; }
  .responses { max-width: 360px; margin-left: 30px; }
  .interpret-grid, .settings-grid { grid-template-columns: 1fr; }

  .score-grid { grid-template-columns: repeat(3, 1fr); }
  .items-table .col-response { width: 190px; }
  .items-table .response-button { min-width: 44px; min-height: 44px; }
  .items-table td { height: 48px; }
}

@media (max-width: 620px) {
  .topbar { align-items: center; }.brand-row > div:last-child, .user-pill, #save-state { display: none; }
  .tabs { top: 58px; }.topbar { min-height: 58px; }
  .control-panel { padding: 1rem; }.case-fields, .filter-stack { grid-template-columns: 1fr; }.case-fields > * { grid-column: auto !important; }
  .panel-actions { grid-template-columns: 1fr 1fr; }.panel-actions .primary { grid-column: 1 / -1; }
  .working-area { padding-inline: .65rem; }
  .legend-card { gap: .65rem; }.text-button { width: 100%; margin-left: 0; text-align: left; }
  .item-row { padding: .75rem .65rem; }.responses { max-width: none; margin-left: 0; }
  .item-meta { margin-left: 0; }
  .table-heading { align-items: flex-start; flex-direction: column; }
  .score-grid { grid-template-columns: repeat(2, 1fr); }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .topbar .small-button, .info-button, .icon-button, .text-button { min-height: 44px; }
  .info-button, .icon-button { width: 44px; height: 44px; }
}

@media print {
  .topbar, .tabs, .control-panel, .legend-card, .response-button:not(.selected), .button, .icon-button { display: none !important; }
  #tab-responses { display: block !important; }.working-area { padding: 0; }.item-row { break-inside: avoid; box-shadow: none; }
  .response-button.selected { display: block; }
}

/* Vista de captura compacta, deliberadamente próxima a una hoja de cálculo. */
#tab-responses { grid-template-columns: minmax(250px, 305px) 1fr; }
.control-panel { padding: .8rem; }
.case-fields, .filter-stack { gap: .48rem; margin-top: .65rem; }
.case-fields { margin-top: .35rem; gap: .35rem; padding: .45rem .5rem; border: 1px solid #d8e3ed; border-radius: 8px; background: #f7fafd; }
.case-fields label { gap: .2rem; }
.case-fields input { min-height: 34px; padding: .38rem .52rem; }
.case-fields .two-columns { gap: .4rem; }
.case-context-field { margin-top: .25rem; }
.case-context-field textarea { min-height: 54px; padding: .42rem .52rem; }
.progress-block { margin: .65rem 0; padding: .55rem .65rem; }
.keyboard-hint { margin: .55rem 0; padding: .5rem .6rem; border-left: 3px solid var(--teal); color: #36495a; background: #eaf4f3; font-size: .7rem; line-height: 1.35; }
.data-import { margin: .55rem 0; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.data-import summary { cursor: pointer; color: var(--navy); font-size: .74rem; font-weight: 800; }
.data-import[open] { display: grid; gap: .5rem; }
.data-import label { font-size: .68rem; }
.paste-import textarea { min-height: 118px; font: .7rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.paste-import .review-notes { white-space: pre-line; color: var(--ink); padding: .75rem; border-left: 3px solid var(--amber); background: var(--amber-soft); border-radius: .4rem; }
.paste-import .button { justify-self: start; min-height: 44px; }
.working-area { padding: .75rem .8rem 2rem; }
.legend-card { padding: .42rem .55rem; border-radius: 6px; font-size: .66rem; }
.table-heading { margin: .7rem 0 .45rem; }
.sheet-wrap { max-height: calc(100vh - 220px); overflow: auto; border: 1px solid #9eabb4; background: #fff; }
.items-table { width: 100%; min-width: 1050px; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.items-table thead { position: sticky; top: 0; z-index: 3; color: #fff; background: #156082; }
.items-table th { height: 27px; padding: 2px 5px; border-right: 1px solid #5d8da6; text-align: left; white-space: nowrap; }
.items-table .col-number { width: 42px; text-align: center; }
.items-table th:nth-child(2) { width: 41%; }
.items-table .col-response { width: 170px; text-align: center; }
.items-table th:nth-child(4) { width: 18%; }
.items-table th:nth-child(5) { width: 18%; }
.items-table .col-critical { width: 95px; }
.items-table .item-row { display: table-row; min-height: 0; padding: 0; border: 0; border-radius: 0; background: #fff; box-shadow: none; outline: 0; }
.items-table .item-row:nth-child(even) { background: #d9f1fa; }
.items-table .item-row:hover { background: #fff6ca; box-shadow: none; }
.items-table .item-row.active { background: #fff0a6; box-shadow: inset 4px 0 0 var(--teal); }
.items-table td { height: 29px; padding: 2px 5px; overflow: hidden; border-right: 1px solid #c6d5de; border-bottom: 1px solid #b8d5e3; line-height: 1.18; text-overflow: ellipsis; vertical-align: middle; white-space: nowrap; }
.items-table td.item-number { display: table-cell; min-width: 0; color: #0a615c; font-weight: 850; text-align: center; }
.items-table .item-text { color: #1d2b38; }
.items-table .item-scale, .items-table .item-subscale { color: #4a5965; font-size: 10px; }
.items-table .item-critical { color: #7b1724; font-size: 9px; font-weight: 750; }
.items-table .responses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.items-table .response-button { min-height: 23px; padding: 0 2px; border-radius: 2px; font-size: 10px; }
.items-table .response-button.selected { color: #000 !important; font-weight: 900; }
.items-table .response-button.selected.level-3 { border-color: #b40016; background: #ff4d4d; }
.items-table .response-button.selected.level-2 { border-color: #bd6423; background: #f4b183; }
.items-table .response-button.selected.level-1 { border-color: #bd9415; background: #ffd966; }
.items-table .response-button.selected.level-0 { border-color: #568b45; background: #a9d18e; }
.items-table .response-button.selected.contextual { border-color: #4b76a0; background: #9dc3e6; }
.items-table .response-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.items-table .response-mark { display: none; font-size: 13px; line-height: 1; font-weight: 1000; }
.items-table .response-button.selected .response-mark { display: inline; }
.items-table .item-row.skipped td { background: #fff2ca !important; }
.items-table .item-row.skipped .item-number { color: #8a5200; }
.items-table .item-row.skipped .item-text::after { content: " · pendiente"; color: #8a5200; font-weight: 750; }
.items-table .item-row.skipped.active td { background: #ffe7a6 !important; }
.info-button { width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; color: #fff; background: transparent; font: 800 italic 16px Georgia, serif; }
.info-button:hover { color: var(--navy); background: #fff; }
.modal { width: min(720px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 0; border-radius: 14px; color: var(--ink); box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.modal::backdrop { background: rgba(13,31,46,.62); backdrop-filter: blur(2px); }
.modal form, .modal > div { position: relative; padding: 1.5rem; }
#help-dialog > .help-content { max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; }
.modal h1 { margin: 0 2rem 1rem 0; color: var(--navy); }
.modal h2 { margin: 1rem 0 .3rem; font-size: .95rem; }
.modal p { margin: 0; color: #4d5b68; font-size: .8rem; line-height: 1.5; }
.modal-close { position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px; border: 0; border-radius: 50%; color: #415163; background: #edf1f3; font-size: 1.25rem; }
kbd { padding: .05rem .3rem; border: 1px solid #b7c2ca; border-radius: 4px; background: #f3f5f6; box-shadow: 0 1px 0 #aab5bd; font: 700 .75rem system-ui; }
.import-review { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; max-height: 260px; margin: .8rem 0; overflow: auto; }
.import-review span { padding: .3rem .4rem; border-radius: 4px; color: #6b2830; background: #fff1f2; font-size: .68rem; }
.warning-list { display: grid; gap: .3rem; margin-top: .7rem; }
.warning-list p { padding: .4rem .5rem; border-left: 3px solid #d08a18; background: #fff7e7; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }

@media (max-width: 940px) {
  #tab-responses { grid-template-columns: 1fr; }
  .sheet-wrap { max-height: none; }
  .items-table .col-response { width: 190px; }
  .items-table .response-button { min-width: 44px; min-height: 44px; }
  .items-table td { height: 48px; }
}

@media (max-width: 940px) {
  .items-table .response-button { min-width: 44px; min-height: 44px; }
  .items-table .response-mark { font-size: 17px; }
}

 .mobile-meta { display: none; }
@media (max-width: 620px) {
  .sheet-wrap { overflow: visible; border: 0; background: transparent; }
  .items-table { width:100%; min-width:0; border-collapse:separate; border-spacing:0 .45rem; table-layout:auto; font-size:.78rem; }
  .items-table colgroup { display:none; }
  .items-table thead { display: none; }
  .items-table .item-row { display: grid; grid-template-columns: 32px minmax(0, 1fr); overflow: hidden; border: 1px solid #c6d5de; border-radius: 9px; background: #fff; }
  .items-table .item-row:nth-child(even) { background: #fff; }
  .items-table .item-row:hover { background: #fff; }
  .items-table .item-row.active { background: #fff9df; box-shadow: inset 4px 0 0 var(--teal); }
  .items-table td { height: auto; min-height: 0; padding: .5rem .45rem; overflow: visible; border: 0; line-height: 1.4; text-overflow: clip; white-space: normal; }
  .items-table td.item-number { display: block; grid-column: 1; grid-row: 1; align-self: start; padding-right: .1rem; }
  .items-table td.item-text { grid-column: 2; grid-row: 1; color: #1d2b38; }
  .mobile-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .4rem; }
  .mobile-meta span { padding: .15rem .35rem; border-radius: 4px; color: #405365; background: #edf3f5; font-size: .62rem; font-weight: 650; }
  .mobile-meta span:last-child:not(:first-child) { color: #7b1724; background: #fee9eb; }
  .items-table td:nth-child(3) { grid-column: 1 / -1; padding: .25rem .55rem .55rem; }
  .items-table td:nth-child(n+4) { display: none; }
  .items-table .responses { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; margin: 0; gap: .4rem; }
  .items-table .response-button { min-width: 0; min-height: 46px; border-radius: 7px; font-size: .8rem; }
  .items-table .response-mark { font-size: 19px; }
  .items-table .item-row.skipped td { background: #fff2ca !important; }
  .items-table .item-row.skipped.active td { background: #ffe7a6 !important; }
}

/* Captura editorial compacta de PD/T: filas visuales, valores separados y sin rangos inferidos. */
.score-grid { display:block; margin-top:.85rem; }
.score-group + .score-group { margin-top:1.1rem; }
.score-group h3 { margin:0 0 .45rem; color:#174354; font-size:.8rem; }
.score-fields { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.38rem; }
.score-field { min-width:0; padding:.38rem .42rem; border:1px solid #e0e8e9; border-radius:7px; background:#fbfdfd; }
.score-label-row { display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center; gap:.3rem; min-height:1.15rem; margin-bottom:.28rem; }
.score-label-row strong { color:#174354; font-size:.67rem; }
.score-label-row > span:not(.score-band) { overflow:hidden; color:#53616d; font-size:.62rem; text-overflow:ellipsis; white-space:nowrap; }
.score-values { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.3rem; }
.score-values label { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:.22rem; margin:0; color:#687681; font-size:.58rem; font-weight:750; }
.score-values input { min-width:0; min-height:32px; padding:.3rem .35rem; font-size:.78rem; }
.score-band { position:static; display:inline-block; width:max-content; padding:.08rem .25rem; border-radius:4px; font-size:.53rem; }
.score-card-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:.7rem; }
.score-card-heading > div { min-width:0; }
.profile-score-import { display:grid; gap:.7rem; margin:1rem 0 1.2rem; padding:1rem; border:1px solid #cadbd5; border-left:4px solid #33745e; border-radius:10px; background:#f1f7f3; }
.profile-score-import h3 { margin:0 0 .25rem; color:#205340; font-size:.98rem; }
.profile-score-import label { display:grid; gap:.4rem; font-size:.82rem; font-weight:700; }
.profile-score-import textarea { width:100%; min-height:112px; resize:vertical; font:.78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.profile-score-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.55rem; }
.profile-score-actions .form-message { margin:0; }
.score-interpretation { margin-top:.85rem; padding:.75rem; border:1px solid #cfe0d1; border-radius:8px; background:#edf6ef; }
.score-interpretation h3 { margin:0 0 .45rem; color:#245941; font-size:.9rem; }
.score-interpretation-row { margin-top:.45rem; padding:.55rem .65rem; border-left:3px solid #2f7059; border-radius:4px; background:#fff; }
.score-interpretation-row.validity { border-left-color:#526f8b; background:#f5f8fa; }
.score-interpretation-row h4 { margin:0 0 .2rem; color:#194b37; font-size:.78rem; }
.score-interpretation-row p { margin:0; color:#374650; font-size:.75rem; line-height:1.4; }
.score-interpretation > .muted { font-size:.72rem; }
.profile-modal { width:min(820px,calc(100vw - 1rem)); }
.profile-review-wrap { max-height:min(52vh,440px); margin-top:.7rem; overflow:auto; border:1px solid var(--line); }
.profile-review-table { width:100%; border-collapse:collapse; font-size:.78rem; }
.profile-review-table th,.profile-review-table td { padding:.45rem .5rem; border-bottom:1px solid var(--line); text-align:left; }
.profile-review-table thead { position:sticky; top:0; background:#eaf3f2; }
.profile-review-table .uncertain { background:#fff7e7; }
.report-options,.print-report { width:min(1100px,100%); margin:0 auto 1rem; }
.report-checks { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.35rem .8rem; }
.report-actions { display:flex; flex-wrap:wrap; gap:.5rem; margin-top:.8rem; }
.print-report { min-height:3rem; padding:1px; background:#fff; }


@media (max-width:940px) {
  .score-fields { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .report-checks { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .ai-key-card { grid-template-columns:1fr; }
}
@media (max-width:620px) {
  .score-card-heading { flex-direction:column; }
  .score-fields { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-checks { grid-template-columns:1fr; }
  .report-actions { display:grid; grid-template-columns:1fr; }
  .profile-review-table { min-width:520px; }
}

.auth-shell { min-height:100svh; display:grid; place-items:center; padding:1.25rem; background:radial-gradient(circle at 18% 10%,#e4f3ee 0,transparent 38%),#f2f6f4; }
.auth-card { width:min(420px,100%); padding:clamp(1.4rem,5vw,2.2rem); border:1px solid #d7e3df; border-radius:18px; background:#fff; box-shadow:0 22px 55px rgba(24,57,48,.12); }
.auth-card .brand-mark { display:grid; place-items:center; width:62px; height:62px; margin-bottom:1.15rem; border-radius:18px; color:#fff; background:linear-gradient(145deg,#174c3c,#2c8061); font-weight:900; letter-spacing:.04em; }
.auth-card .eyebrow { margin:0 0 .3rem; }
.auth-card h1 { margin:0 0 .8rem; color:#163c31; }
.auth-form { display:grid; gap:.8rem; margin-top:1rem; }
.auth-form label { display:grid; gap:.35rem; color:#253b34; font-size:.84rem; font-weight:700; }
.auth-form input { min-height:46px; }
.auth-form .button { min-height:46px; }
.auth-password-field { position:relative; display:block; }
.auth-password-field input { min-height:46px; padding-right:3.25rem; }
.auth-password-toggle { position:absolute; top:1px; right:1px; display:grid; place-items:center; width:44px; height:44px; padding:0; border:0; border-radius:8px; color:#42566a; background:transparent; }
.auth-password-toggle:hover { color:var(--navy); background:#edf3f6; }
.auth-password-toggle:focus-visible { z-index:1; }
.eye-icon { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.auth-footnote { margin:1rem 0 0; color:#5b6b65; font-size:.75rem; line-height:1.45; }
.students-list { display:grid; gap:.5rem; max-height:56vh; overflow:auto; margin-top:1rem; }
.students-hint { color:var(--muted); font-size:.9rem; line-height:1.45; margin:.75rem 2rem 0 0; }
.student-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:.5rem; padding:.7rem; border:1px solid var(--line); border-radius:9px; background:#f8fbfa; }
.student-open { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:.2rem; width:100%; min-width:0; text-align:left; }
.student-name { font-weight:700; overflow-wrap:anywhere; }
.student-meta { color:var(--muted); font-size:.82rem; line-height:1.35; overflow-wrap:anywhere; }

@media print {
  body.printing-report #app-view > .topbar,
  body.printing-report #app-view > .tabs,
  body.printing-report #app-view > #tab-responses,
  body.printing-report #app-view > #tab-interpretation,
  body.printing-report #app-view > #tab-settings,
  body.printing-report .page-heading,
  body.printing-report .report-options,
  body.printing-report .toast,
  body.printing-report dialog { display:none!important; }
  body.printing-report #app-view { display:block!important; }
  body.printing-report #tab-report { display:block!important; padding:0!important; }
  body.printing-report #report-print { display:block!important; width:100%; margin:0; padding:0; }
  body.printing-report #report-print .report-document { width:auto; min-height:0; margin:0; padding:0; box-shadow:none; }
  body.printing-report #report-print .report-heading { margin-bottom:.4rem; }
  body.printing-report #report-print section { margin-bottom:.65rem; }
  body.printing-report #report-print table { font-size:7.5pt; }
  body.printing-report #report-print th,body.printing-report #report-print td { padding:3px 4px; }
  body.printing-report #report-print thead { display:table-header-group; }
  body.printing-report #report-print tr,body.printing-report #report-print th,body.printing-report #report-print td { break-inside:avoid; page-break-inside:avoid; }
  @page { size:A4 portrait; margin:12mm; }
}

.visually-hidden { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.filter-family { display:grid; gap:.35rem; }
.filter-family h3 { margin:0; color:#405263; font-size:.7rem; }
.filter-buttons { display:flex; flex-wrap:wrap; gap:.3rem; max-height:112px; overflow:auto; }
.filter-chip { min-height:30px; max-width:100%; padding:.28rem .45rem; border:1px solid #cbd7dc; border-radius:999px; color:#3c4e5c; background:#fff; font-size:.65rem; font-weight:650; text-align:left; overflow-wrap:anywhere; }
.filter-chip { border-color:#c7d8e8; color:#354f68; background:#fff; }
.filter-chip:hover { border-color:#93b2ce; background:#f2f7fc; }
.filter-chip[aria-pressed="true"] { border-color:#779fc2; color:#183e60; background:#e4eff9; box-shadow:inset 0 0 0 1px #a9c4dc; }
.filter-chip:focus-visible { outline:3px solid rgba(18,119,111,.3); outline-offset:2px; }
.prompt-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.prompt-actions #open-assistant-instructions { grid-column:1 / -1; }
.prompt-actions .button { min-width:0; width:100%; white-space:normal; overflow-wrap:anywhere; text-align:center; }
.prompt-fallback { margin-top:.45rem; padding:.5rem; border:1px solid #e1c27a; border-radius:7px; color:#604800; background:#fff8df; }
.prompt-fallback textarea { min-height:100px; font:.68rem/1.4 ui-monospace,SFMono-Regular,Consolas,monospace; }
.button.prompt-image { color:#34532f; border-color:#b7d2ac; background:#edf5e9; }
.button.prompt-other { color:#32516b; border-color:#bad0df; background:#eaf2f8; }
.selection-toolbar { display:grid; gap:.4rem; margin:0 0 .45rem; padding:.5rem; border:1px solid #d4dfe4; border-radius:7px; background:#f9fbfc; }
.selection-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.35rem; }
#selection-count { margin-right:auto; color:#405263; font-size:.72rem; font-weight:750; }
.items-table .item-number { white-space:nowrap; }
.items-table .item-select { width:13px; height:13px; margin:0 .2rem 0 0; padding:0; vertical-align:middle; accent-color:#12776f; }
.items-table .item-text { user-select:text; -webkit-user-select:text; cursor:text; }
.export-dimensions { margin-top:1rem; padding:.8rem; border:1px solid var(--line); border-radius:9px; background:#fafcfc; }
.export-dimensions summary { color:var(--navy); cursor:pointer; font-size:.88rem; font-weight:750; }
.export-dimension-actions { display:flex; flex-wrap:wrap; gap:.4rem; margin:.65rem 0; }
.export-dimension-group { min-width:0; margin:.6rem 0; padding:.6rem; border:1px solid #d8e1e5; border-radius:7px; }
.export-dimension-group legend { padding:0 .3rem; color:#355249; font-size:.78rem; font-weight:750; }
.export-dimension-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:.35rem .7rem; }
.export-dimension-choices .check-row { align-items:center; min-width:0; font-size:.72rem; }
.export-dimension-choices .check-row span { overflow-wrap:anywhere; }
.assistant-steps { display:grid; gap:.55rem; padding-left:1.35rem; color:#344156; font-size:.83rem; line-height:1.5; }

@media (max-width:620px) {
  .prompt-actions { grid-template-columns:1fr; }
  .prompt-actions #open-assistant-instructions { grid-column:auto; }
  .filter-chip { min-height:40px; font-size:.72rem; padding:.38rem .6rem; }
  .selection-actions { align-items:stretch; }
  .selection-actions .button { flex:1 1 100%; min-height:44px; }
  #selection-count { width:100%; }
  .items-table .item-number { display:flex!important; align-items:start; gap:.1rem; padding-left:.35rem!important; }
  .items-table .item-select { flex:0 0 auto; width:16px; height:16px; margin:.05rem 0 0; }
  .items-table td.item-number span { min-width:18px; }
  .export-dimension-actions .button { min-height:44px; }
  .print-report .table-wrap { min-width:0; max-width:100%; overflow-x:auto; }
  .print-report .table-wrap table { min-width:620px; }
  .export-dimension-choices { grid-template-columns:1fr; }
  .report-actions { grid-template-columns:1fr; }
}

/* Filtros compactos y acciones globales del caso. */
.case-actions { display:flex; align-items:center; gap:.45rem; }
.import-case-button, .new-case-button { display:inline-flex; align-items:center; justify-content:center; gap:.45rem; min-height:38px; padding:.35rem .7rem; color:#fff; border:1px solid rgba(255,255,255,.3); border-radius:9px; background:rgba(255,255,255,.1); font-size:.78rem; font-weight:750; white-space:nowrap; }
.import-case-button:hover, .new-case-button:hover { background:rgba(255,255,255,.2); }
.import-case-button img { width:29px; height:27px; flex:0 0 auto; object-fit:contain; }
.import-case-button input { position:absolute; width:1px; height:1px; padding:0; opacity:0; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.import-case-button:focus-within { outline:3px solid rgba(255,255,255,.55); outline-offset:2px; }
.filter-family { min-width:0; padding:.38rem .48rem; border:1px solid #e0e7e9; border-radius:8px; background:#fff; }
.filter-family summary { cursor:pointer; color:#334a5b; font-size:.75rem; font-weight:800; }
.filter-family[open] summary { margin-bottom:.38rem; }
.filter-family .filter-buttons { max-height:none; }
.filter-chip { min-height:34px; }
.contextual-subscales { display:grid; gap:.35rem; margin:0 0 .5rem; padding:.5rem .65rem; border:1px solid #cbdbe5; border-radius:8px; background:#f1f7fb; }
.contextual-subscales strong { color:#244b68; font-size:.75rem; }
.contextual-subscales .filter-buttons { max-height:64px; overflow:visible; }
.reset-filters-button { color:#703c00!important; border-color:#e5a544!important; background:#ffedc9!important; font-weight:800!important; }
.reset-filters-button:hover { background:#ffe2a5!important; }

/* Refinamiento PAI-A2: números completos, controles compactos y superficies de informe. */
.items-table .col-number { width:76px; }
.items-table col.col-number { width:76px!important; }
.items-table td.item-number { padding-inline:3px; overflow:visible!important; text-overflow:clip!important; white-space:nowrap; }
.items-table td.item-number span { display:inline-block; flex:none; min-width:35px; overflow:visible!important; text-overflow:clip!important; white-space:nowrap; }
.filter-chip { min-height:26px; padding:.16rem .34rem; border-radius:6px; font-size:.63rem; line-height:1.15; }
.tabs { align-items:center; }
.legend-card { flex:0 1 auto; gap:.6rem; margin-left:auto; padding:.25rem .45rem; border:0; border-radius:6px; background:transparent; font-size:.67rem; }
.legend-card .text-button { min-height:30px; padding:.2rem .45rem; border:1px solid #e5a544!important; border-radius:6px; color:#703c00!important; background:#ffedc9!important; }
.legend-card .text-button:hover { background:#ffe2a5!important; }
.print-report { padding:0; background:transparent; }
.print-report .report-document { width:min(100%,1100px); margin:0 auto; padding:clamp(.9rem,2vw,1.5rem); border:1px solid #d6e0e3; border-radius:12px; background:#fff; box-shadow:0 8px 26px rgba(20,37,55,.07); }
.print-report .report-heading { display:flex; align-items:baseline; justify-content:space-between; gap:1rem; margin-bottom:.75rem; padding-bottom:.65rem; border-bottom:2px solid #22796e; }
.print-report .report-heading h1 { margin:0; color:#173b4b; font-size:1.25rem; }
.print-report .report-heading p { margin:0; color:#667682; font-size:.76rem; }
.print-report .report-scope { margin:0 0 .9rem; padding:.55rem .7rem; border-left:3px solid #287562; border-radius:5px; color:#345247; background:#eff7f2; font-size:.78rem; line-height:1.45; }
.print-report .report-document section { margin:0 0 .85rem; padding:.8rem; border:1px solid #dce5e7; border-radius:9px; background:#fff; }
.print-report .report-document section h2 { margin:0 0 .55rem; color:#17685f; font-size:.94rem; }
.print-report .table-wrap { width:100%; max-width:100%; overflow:auto; border:1px solid #d4dfe2; border-radius:6px; }
.print-report table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:.75rem; }
.print-report th { color:#173d43; background:#e8f2ef; text-align:left; }
.print-report th,.print-report td { padding:.42rem .48rem; border:1px solid #d4dfe2; vertical-align:top; overflow-wrap:anywhere; }
.print-report tbody tr:nth-child(even) { background:#f7faf9; }
.print-report .response-table th:nth-child(3),.print-report .response-table td:nth-child(3) { text-align:center; }
.print-report .response-table th:first-child,.print-report .response-table td:first-child { width:52px; text-align:center; }
.print-report .response-table th:nth-child(3),.print-report .response-table td:nth-child(3) { width:100px; }
.print-report .severity-chip { display:inline-block; min-width:2.2rem; padding:.15rem .4rem; border-radius:5px; background:var(--severity-color,#edf1f3); font-weight:750; }
.print-report .score-reading { margin:.4rem 0; padding:.6rem .7rem; border-left:3px solid #2f7059; border-radius:5px; background:#edf6ef; }
.print-report .score-reading h3 { margin:0 0 .25rem; color:#1b503d; font-size:.82rem; }
.print-report .score-reading p { margin:0; font-size:.78rem; line-height:1.45; }
.print-report .narrative { padding:.4rem .2rem; white-space:pre-wrap; line-height:1.5; }
@media (max-width:940px) {
  .items-table .col-number { width:76px; }
}
@media (max-width:620px) {
  .tabs { align-items:stretch; flex-wrap:wrap; gap:.05rem .15rem; padding-inline:.45rem; }
  .tab { min-height:44px; padding-inline:.48rem; font-size:.76rem; }
  .legend-card { display:grid; flex:1 0 100%; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.25rem .45rem; margin:0; padding:.35rem .45rem .45rem; border-top:1px solid var(--line); font-size:.68rem; }
  .legend-card span { min-width:0; }
  .legend-card .text-button { grid-column:1/-1; width:100%; min-height:44px; margin:0; text-align:center; }
  .filter-chip { min-height:44px; padding:.38rem .55rem; border-radius:7px; font-size:.72rem; }
  .items-table .item-row { width:100%; grid-template-columns:76px minmax(0,1fr); }
  .items-table td.item-number { justify-content:flex-start; padding-left:.22rem!important; }
  .items-table td.item-number span { min-width:35px; }
  .print-report .report-document { padding:.75rem; border-radius:9px; }
  .print-report .report-document section { padding:.55rem; }
  .print-report .report-heading { align-items:flex-start; flex-direction:column; gap:.2rem; }
  .print-report .response-table { min-width:620px; }
}
@media print {
  body.printing-report #report-print { padding:0!important; background:#fff; }
  body.printing-report #report-print .report-document { border:0; border-radius:0; }
  body.printing-report #report-print .report-document section { break-inside:auto; }
  body.printing-report #report-print .table-wrap { overflow:visible; }
}

@media (max-width:620px) {
  .topbar { flex-wrap:wrap; justify-content:space-between; gap:.35rem .5rem; padding:.45rem .65rem; }
  .case-actions { order:3; width:100%; }
  .case-actions > * { flex:1 1 0; }
  .import-case-button, .new-case-button { min-height:42px; }
  .import-case-button img { width:30px; height:28px; }
  .tabs { top:108px; }
  .filter-family .filter-buttons { max-height:none; }
  .filter-chip { min-height:44px; }
  .contextual-subscales .filter-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); max-height:none; }
  .contextual-subscales .filter-chip { min-width:0; min-height:44px; }
  .reset-filters-button { flex:1 1 100%; min-height:44px!important; }
}

/* Iconos NAS circulares, con alfa real fuera del contorno. */
.import-case-button img { width:28px; height:28px; object-fit:contain; }
.new-case-button img { width:22px; height:22px; flex:0 0 auto; object-fit:contain; }
.save-case-button { min-height:38px; padding:.35rem .75rem; border-radius:9px; font-size:.78rem; font-weight:800; white-space:nowrap; }
@media (max-width:620px) {
  .case-actions { gap:.25rem; }
  .import-case-button, .new-case-button, .save-case-button { min-width:0; padding:.3rem .35rem; gap:.25rem; font-size:.65rem; }
  .import-case-button img { width:24px; height:24px; }
  .new-case-button img { width:20px; height:20px; }
}

.filter-stack .filter-family[aria-labelledby="scale-filter-heading"],
.filter-stack .filter-family[aria-labelledby="subscale-filter-heading"] {
  border-color:#91b7d5;
  background:#e4f1fb;
}
.filter-stack .filter-family[aria-labelledby="scale-filter-heading"] summary,
.filter-stack .filter-family[aria-labelledby="subscale-filter-heading"] summary {
  color:#183e5b;
}

