/*
 * pss: component refinements, loaded after css/app.css and css/pss/tokens.css.
 * Calm, minimal, mobile-first: 1 px borders instead of shadows, one gold accent, 44 px touch targets, 150-250 ms motion.
 * Base styles are for ~375 px; wider screens enhance with min-width queries.
 */

/* ---------------------------------------------------------------- base */
body.ps-app { line-height: 1.55; }
.ps-app :where(h1, h2, h3, .h1, .h2, .h3) { font-family: var(--ps-sans); font-weight: 650; letter-spacing: -.015em; line-height: 1.2; }
.ps-app :where(h1, .h1) { font-size: var(--ps-fs-2xl); }
.ps-app :where(h2, .h2) { font-size: var(--ps-fs-xl); }
.ps-app :where(h3, .h3) { font-size: var(--ps-fs-l); }
.ps-app a { text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.ps-app a:hover { background: transparent; text-decoration-color: currentColor; }
.ps-app :focus-visible { outline: 2px solid var(--ps-focus); outline-offset: 2px; box-shadow: none; }
.ps-app ::selection { background: var(--ps-accent-soft); color: var(--ps-ink); }

/* theme switch: a quiet round button, sun in dark mode and moon in light mode */
.pss-themebtn { display: inline-grid; place-items: center; width: var(--ps-target); height: var(--ps-target); border: 1px solid var(--ps-line); border-radius: 999px; background: transparent; color: var(--ps-ink-2); cursor: pointer; transition: background-color var(--ps-dur) var(--ps-ease), color var(--ps-dur) var(--ps-ease); }
.pss-themebtn:hover { background: var(--ps-sunk); color: var(--ps-ink); }
.pss-themebtn .pss-i-sun { display: none; }
.pss-themebtn[aria-pressed="true"] .pss-i-sun { display: block; }
.pss-themebtn[aria-pressed="true"] .pss-i-moon { display: none; }

/* ---------------------------------------------------------------- bottom tab bar (phones) */
.pss-tabbar { display: none; }
@media (max-width: 760px) {
    .pss-tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 45;
        height: calc(var(--ps-tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
        background: color-mix(in srgb, var(--ps-surface) 92%, transparent); border-top: 1px solid var(--ps-line);
        -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
    }
    .pss-tabbar__item {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 44px;
        color: var(--ps-ink-2) !important; text-decoration: none !important; font-size: .75rem; font-weight: 500; background: none; border: 0; font-family: inherit; cursor: pointer;
    }
    .pss-tabbar__item svg { width: 22px; height: 22px; }
    .pss-tabbar__item[aria-current="page"] { color: var(--ps-ink) !important; font-weight: 650; }
    .pss-tabbar__item[aria-current="page"] svg { color: var(--ps-accent-line); }
    .pss-tabbar__item[aria-current="page"]::before { content: ""; width: 1.5rem; height: 3px; border-radius: 3px; background: var(--ps-accent); margin-top: -5px; margin-bottom: 2px; }
    /* the floating Feedback button and the sticky save bar sit above the tab bar, not under it */
    .rf-fab { transform: translateY(calc(-1 * (var(--ps-tabbar-h) + env(safe-area-inset-bottom, 0px)))); }
    .ps-savebar { bottom: calc(var(--ps-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
}

/* ---------------------------------------------------------------- controls */
.ps-btn, .ps-app .btn { min-height: var(--ps-target); border-radius: var(--ps-radius); transition: background-color var(--ps-dur) var(--ps-ease), border-color var(--ps-dur) var(--ps-ease), transform 120ms var(--ps-ease); }
.ps-btn:active { transform: translateY(1px); }
.ps-app :where(input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea) { min-height: var(--ps-target); border-radius: var(--ps-radius); background: var(--ps-surface); color: var(--ps-ink); border: 1px solid var(--ps-line-2); transition: border-color var(--ps-dur) var(--ps-ease), box-shadow var(--ps-dur) var(--ps-ease); }
.ps-app :where(input, select, textarea):focus { border-color: var(--ps-accent-line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ps-accent) 35%, transparent); outline: none; }
.ps-app :where(input, select, textarea)::placeholder { color: var(--ps-ink-2); opacity: .8; }
.ps-app .is-invalid, .ps-app [aria-invalid="true"] { border-color: var(--ps-sev-high) !important; }
.ps-app :where(label) { display: block; margin-bottom: var(--ps-sp-1); font-weight: 550; font-size: var(--ps-fs-s); color: var(--ps-ink); }
.ps-app :where(input[type=checkbox], input[type=radio]) { accent-color: var(--ps-accent-2); width: 1.125rem; height: 1.125rem; }
@media (max-width: 640px) { .ps-app :where(input:not([type=checkbox]):not([type=radio]), select, textarea) { width: 100%; font-size: 1rem; } }

/* ---------------------------------------------------------------- surfaces: panels and cards, borders not shadows */
.ps-panel, .ps-app .card { border-radius: var(--ps-radius-panel); box-shadow: none; }

/* ---------------------------------------------------------------- tabs: one scrollable row on phones, not a wrapped block */
@media (max-width: 760px) {
    .ps-casetabs { flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin-inline: calc(-1 * var(--ps-gutter)); padding-inline: var(--ps-gutter); }
    .ps-casetabs::-webkit-scrollbar { display: none; }
    .ps-casetabs a { white-space: nowrap; flex: none; }
}
.ps-casetabs a[aria-current="page"] { color: var(--ps-ink) !important; }

/* ---------------------------------------------------------------- quiet details that must work in both modes */
/* segmented controls (status tabs, language): a sunk track with a raised, ink-weight selection; gold stays for the one primary action */
.ps-tabs { background: var(--ps-sunk); border: 0; padding: 3px; gap: 2px; border-radius: calc(var(--ps-radius) + 3px); max-width: 100%; overflow-x: auto; }
.ps-tabs a { border: 0; border-radius: var(--ps-radius); transition: background-color var(--ps-dur) var(--ps-ease), color var(--ps-dur) var(--ps-ease); }
.ps-tabs a:hover { background: color-mix(in srgb, var(--ps-surface) 60%, transparent); }
.ps-tabs a[aria-current="page"] { background: var(--ps-surface); color: var(--ps-ink) !important; box-shadow: 0 0 0 1px var(--ps-line-2); }
/* the account mark and the timeline node: ink-on-gold fails on graphite, so a sunk disc with gold text */
.ps-usermark__i, .ps-tlevent--analysis .ps-tlevent__node { background: var(--ps-sunk); color: var(--ps-accent-line); box-shadow: inset 0 0 0 1px var(--ps-line-2); }
.ps-usermark.is-current .ps-usermark__i { box-shadow: 0 0 0 2px var(--ps-accent); }
/* checked boxes and switches */
.ps-app .form-check-input:checked { background-color: var(--ps-ink-strong); filter: var(--ps-check-filter, none); }
.ps-switch input:checked + .ps-switch__track { background: var(--ps-accent); border-color: var(--ps-accent-line); }
/* dialogs */
.ps-dialog { background: var(--ps-surface); color: var(--ps-ink); }
@media (max-width: 760px) {
    .ps-actionbar { bottom: calc(var(--ps-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
    .ps-app :where(table) { font-size: var(--ps-fs-s); }
}

/* ================================================================ app shell: sidebar, top bar, content */
.pss-shell { display: flex; min-height: 100dvh; }
.pss-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-main { flex: 1; padding-block: var(--ps-sp-5) calc(var(--ps-sp-7) + var(--ps-tabbar-h)); }
@media (min-width: 761px) { .ps-main { padding-block: var(--ps-sp-6) var(--ps-sp-8); } }
.pss-ico { width: 20px; height: 20px; flex: none; }

/* sidebar */
.pss-side { --side-w: 15rem; width: var(--side-w); flex: none; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--ps-surface); border-right: 1px solid var(--ps-line); z-index: 60; transition: width var(--ps-dur) var(--ps-ease); }
.pss-side__head { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; padding: var(--ps-sp-3) var(--ps-sp-4); }
.pss-brand { display: inline-flex; align-items: center; text-decoration: none !important; }
.pss-brand .ps-brand__logo { height: 2.5rem; }
.pss-brand__mark { display: none; width: 2.25rem; height: 2.25rem; padding: 3px; border-radius: 9px; background: #f4f2ee; }
.pss-side__nav { flex: 1; overflow-y: auto; padding: var(--ps-sp-2) var(--ps-sp-3); display: flex; flex-direction: column; gap: var(--ps-sp-4); }
.pss-navgroup { display: flex; flex-direction: column; gap: 2px; }
.pss-navgroup__label { margin: 0 0 var(--ps-sp-1); padding: 0 var(--ps-sp-3); font-size: var(--ps-fs-xs); color: var(--ps-ink-2); }
.pss-navlink { display: flex; align-items: center; gap: var(--ps-sp-3); min-height: 2.5rem; padding: 0 var(--ps-sp-3); border-radius: var(--ps-radius); color: var(--ps-ink-2) !important; text-decoration: none !important; font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; width: 100%; text-align: left; transition: background-color var(--ps-dur) var(--ps-ease), color var(--ps-dur) var(--ps-ease); }
.pss-navlink:hover { background: var(--ps-sunk); color: var(--ps-ink) !important; }
.pss-navlink[aria-current="page"] { background: var(--ps-accent-soft); color: var(--ps-ink) !important; font-weight: 650; box-shadow: inset 3px 0 0 var(--ps-accent); }
.pss-navlink[aria-current="page"] .pss-ico { color: var(--ps-accent-line); }
.pss-side__foot { padding: var(--ps-sp-3); border-top: 1px solid var(--ps-line); }
.pss-side__collapse .pss-ico { transition: transform var(--ps-dur) var(--ps-ease); }
.pss-iconbtn { display: inline-grid; place-items: center; width: var(--ps-target); height: var(--ps-target); border: 0; border-radius: var(--ps-radius); background: transparent; color: var(--ps-ink-2); cursor: pointer; }
.pss-iconbtn:hover { background: var(--ps-sunk); color: var(--ps-ink); }
.pss-side__close, .pss-top__menu, .pss-scrim, .pss-top__brand { display: none; }
@media (max-width: 760px) { .pss-top__brand { display: inline-flex; } .pss-top__brand .ps-brand__logo { height: 2.25rem; } }
.pss-side__lang { display: none; margin-bottom: var(--ps-sp-2); padding-inline: var(--ps-sp-3); }
@media (max-width: 760px) { .pss-side__lang { display: flex; } }

/* collapsed rail (wide screens), remembered per browser */
@media (min-width: 761px) {
    html[data-side="collapsed"] .pss-side { --side-w: 4.5rem; }
    html[data-side="collapsed"] .pss-side .ps-brand__logo { display: none; }
    html[data-side="collapsed"] .pss-brand__mark { display: block; }
    html[data-side="collapsed"] .pss-side__head { justify-content: center; padding-inline: 0; }
    html[data-side="collapsed"] .pss-navlink { justify-content: center; padding: 0; }
    html[data-side="collapsed"] .pss-navlink__t, html[data-side="collapsed"] .pss-navgroup__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    html[data-side="collapsed"] .pss-side__collapse .pss-ico { transform: scaleX(-1); }
}
@media (min-width: 761px) and (max-width: 1023px) { .pss-side { --side-w: 4.5rem; } .pss-side .ps-brand__logo { display: none; } .pss-brand__mark { display: block; } .pss-side__head { justify-content: center; padding-inline: 0; } .pss-navlink { justify-content: center; padding: 0; } .pss-navlink__t, .pss-navgroup__label, .pss-side__foot { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* top bar */
.pss-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: var(--ps-sp-3); min-height: 3.5rem; padding-inline: var(--ps-gutter); background: color-mix(in srgb, var(--ps-paper) 85%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--ps-line); }
.pss-top__tools { margin-left: auto; display: flex; align-items: center; gap: var(--ps-sp-3); }
.pss--guest .pss-top .ps-brand__logo { height: 2.5rem; }
.ps-brand__logo--dark { display: var(--ps-logo-dark, none); }
.ps-brand__logo--light { display: var(--ps-logo-light, block); }

/* phones: the sidebar is a drawer, the tab bar is the thumb-reach navigation */
@media (max-width: 760px) {
    .pss-side { position: fixed; inset: 0 auto 0 0; --side-w: min(18rem, 86vw); transform: translateX(-102%); transition: transform 220ms var(--ps-ease); box-shadow: var(--ps-overlay-shadow); }
    .pss-side-open .pss-side { transform: none; }
    .pss-side__close, .pss-top__menu { display: inline-grid; }
    .pss-side__collapse { display: none; }
    .pss-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .5); }
    .pss-scrim[hidden] { display: none !important; }
    .pss-side-open .pss-scrim { display: block; }
    .pss-top__menu { display: none; }       /* the tab bar's Menu button opens the drawer */
    .pss-top .ps-lang { display: none; }     /* on phones the language switch is in the drawer */
}
@media (prefers-reduced-motion: reduce) { .pss-side { transition: none; } }

/* ================================================================ findings workspace: table + detail panel */
.pss-ws { display: grid; gap: var(--ps-sp-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
.pss-ws__detail { display: none; }
.pss-ws.has-detail .pss-ws__detail { display: block; }
.pss-ws.has-detail .pss-ws__list { display: none; }
.pss-ws__back { margin: 0 0 var(--ps-sp-3); }
.pss-ws__empty { padding: var(--ps-sp-5); text-align: center; color: var(--ps-ink-2); }
@media (min-width: 1500px) {
    .pss-ws { grid-template-columns: minmax(0, 1.5fr) minmax(26rem, 1fr); }
    .pss-ws__detail, .pss-ws.has-detail .pss-ws__detail { display: block; position: sticky; top: 4.5rem; max-height: calc(100dvh - 5.5rem); overflow-y: auto; }
    .pss-ws.has-detail .pss-ws__list { display: block; }
    .pss-ws__back { display: none; }
}
.pss-ws__detail { background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-radius-panel); padding: var(--ps-pad); }
/* inside the panel the finding card is one column: clause, wording, then the note with flags, law and actions */
.pss-ws__detail .ps-finding { grid-template-columns: minmax(0, 1fr) !important; border: 0; padding: 0; background: none; }
@media (min-width: 900px) and (max-width: 1499px) { .pss-ws__detail .ps-finding:not(.ps-finding--noquote) { grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem) !important; } }
.pss-ws__detail .ps-finding__note { border-left: 0 !important; padding-left: 0 !important; }
.pss-related { margin-top: var(--ps-sp-5); padding-top: var(--ps-sp-4); border-top: 1px solid var(--ps-line); }
.pss-related h3 { font-size: var(--ps-fs-m); }
.pss-related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ps-sp-2); }
.pss-related li { display: flex; justify-content: space-between; gap: var(--ps-sp-3); align-items: center; padding: var(--ps-sp-2) var(--ps-sp-3); border: 1px solid var(--ps-line); border-radius: var(--ps-radius); }

.pss-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-radius-panel); overflow: hidden; }
.pss-table thead th { text-align: left; font-weight: 550; font-size: var(--ps-fs-xs); color: var(--ps-ink-2); background: var(--ps-sunk); padding: var(--ps-sp-2) var(--ps-sp-4); border-bottom: 1px solid var(--ps-line); white-space: nowrap; }
.pss-table td { padding: var(--ps-sp-3) var(--ps-sp-4); vertical-align: top; border-top: 1px solid var(--ps-line); }
.pss-table tbody tr:first-child td { border-top: 0; }
.pss-row { position: relative; transition: background-color var(--ps-dur) var(--ps-ease); }
.pss-row:hover { background: color-mix(in srgb, var(--ps-sunk) 55%, transparent); }
.pss-row.is-selected { background: var(--ps-accent-soft); box-shadow: inset 3px 0 0 var(--ps-accent); }
.pss-row.is-closed .pss-row__main, .pss-row.is-closed .pss-row__quote { opacity: .6; }
.pss-row__link { display: block; font-weight: 600; color: var(--ps-ink) !important; text-decoration: none !important; line-height: 1.35; }
.pss-row__link::after { content: ""; position: absolute; inset: 0; }
.pss-row__link:focus-visible { outline-offset: -2px; }
.pss-row__pos { display: block; margin-top: 2px; font-size: var(--ps-fs-xs); color: var(--ps-ink-2); }
.pss-row__quote { font-size: var(--ps-fs-s); color: var(--ps-ink-2); }
.pss-row__quote q { quotes: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--ps-serif); line-height: 1.45; }
.pss-row__quote q::before, .pss-row__quote q::after { content: none; }
.pss-row__basis { font-size: var(--ps-fs-s); }
.pss-basis__t { font-weight: 550; }
@media (min-width: 900px) { .pss-table th:nth-child(1) { width: 8rem; } .pss-table th:nth-child(5) { width: 6.5rem; } }
/* narrow: every finding is a card (severity and state on top, the finding, then what the document says) */
@media (max-width: 899px) {
    .pss-table, .pss-table tbody { display: block; background: none; border: 0; }
    .pss-table thead { display: none; }
    .pss-table tr { display: grid; grid-template-columns: 1fr auto; gap: var(--ps-sp-2) var(--ps-sp-3); margin-bottom: var(--ps-sp-3); padding: var(--ps-sp-4); background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-radius-panel); }
    .pss-table td { display: block; padding: 0; border: 0; }
    .pss-table td::before { content: none !important; }
    .pss-row__main, .pss-row__quote, .pss-row__basis { grid-column: 1 / -1; }
    .pss-row__sev { grid-column: 1; grid-row: 1; }
    .pss-row__status { grid-column: 2; grid-row: 1; }
    .pss-row__basis { font-size: var(--ps-fs-xs); }
    .pss-row.is-selected { box-shadow: none; background: var(--ps-surface); }
}

/* ================================================================ summary: one compact strip of figures, not four big cards */
.ps-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ps-sp-3); margin-bottom: var(--ps-sp-3); }
.ps-scard { padding: var(--ps-sp-3) var(--ps-sp-4); border-radius: var(--ps-radius-panel); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ps-scard__k { font-family: var(--ps-sans); font-size: var(--ps-fs-xs) !important; font-weight: 550 !important; color: var(--ps-ink-2) !important; letter-spacing: 0 !important; margin: 0 !important; }
.ps-scard__big { font-size: var(--ps-fs-xl) !important; font-weight: 650; line-height: 1.2; margin: 0 !important; font-family: var(--ps-sans); }
.ps-scard__verdict { margin: 0 !important; }
.ps-scard__line { font-size: var(--ps-fs-xs); margin: 0 !important; }
.ps-scard .ps-linkbtn { align-self: flex-start; font-size: var(--ps-fs-xs); margin-top: var(--ps-sp-1); }
@media (max-width: 899px) {
    /* phones and tablets: the figures scroll sideways as one row of tiles, the findings come first */
    .ps-cards { display: flex; overflow-x: auto; scroll-snap-type: x proximity; margin-inline: calc(-1 * var(--ps-gutter)); padding-inline: var(--ps-gutter); scrollbar-width: none; }
    .ps-cards::-webkit-scrollbar { display: none; }
    .ps-scard { flex: 0 0 min(15.5rem, 72vw); scroll-snap-align: start; }
}
.ps-cardbar { margin-bottom: var(--ps-sp-4); }

/* phones: toolbars are one row that scrolls sideways, so the findings start higher on the screen */
@media (max-width: 760px) {
    .ps-pagehead .ps-row[role="group"], .ps-filterbar, .ps-orgbar, .ps-cardbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--ps-gutter)); padding-inline: var(--ps-gutter); }
    .ps-pagehead .ps-row[role="group"]::-webkit-scrollbar, .ps-filterbar::-webkit-scrollbar, .ps-orgbar::-webkit-scrollbar, .ps-cardbar::-webkit-scrollbar { display: none; }
    .ps-pagehead .ps-row[role="group"] > *, .ps-filterbar > *, .ps-orgbar > *, .ps-cardbar > * { flex: none; }
    .ps-filterbar .ps-search { min-width: 13rem; }
    .ps-filterbar .ps-spacer, .ps-filterbar .ps-shown { display: none; }
    .ps-orgbar { flex-direction: column; align-items: stretch; gap: var(--ps-sp-2); overflow: visible; }
    .ps-orgbar .ps-filterbar { margin-inline: calc(-1 * var(--ps-gutter)); }
    .ps-filterbar__panel { position: fixed; inset: auto var(--ps-gutter) calc(var(--ps-tabbar-h) + .75rem); z-index: 50; background: var(--ps-surface); border: 1px solid var(--ps-line-2); border-radius: var(--ps-radius-panel); padding: var(--ps-sp-4); box-shadow: var(--ps-overlay-shadow); }
}
@media (max-width: 760px) { .ps-orgbar .ps-filterbar { flex: none; width: auto; } }
@media (max-width: 760px) { .ps-filterbar .ps-field { min-width: 9.5rem; } .ps-filterbar .ps-field select { width: 100%; } }

/* ================================================================ check chooser: choices are cards, the price follows the thumb */
.ps-picker { gap: var(--ps-sp-5); }
.ps-picker__checks.pss-cardgrid { border-top: 0; }
.ps-picker__checks.pss-cardgrid > li { border-bottom: 0; }
.pss-cardgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--ps-sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pss-cardgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pss-cardgrid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pss-cardgrid > li { display: flex; }
.ps-app .pss-card, .ps-picker__checks .ps-check.pss-card { display: flex; flex: 1; align-items: flex-start; gap: var(--ps-sp-3); width: 100%; padding: var(--ps-sp-4); background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-radius-panel); cursor: pointer; transition: border-color var(--ps-dur) var(--ps-ease), background-color var(--ps-dur) var(--ps-ease); }
.ps-app .pss-card:hover { border-color: var(--ps-line-2); background: var(--ps-surface); }
.ps-app .pss-card:has(input:checked) { border-color: var(--ps-accent); background: var(--ps-accent-soft); box-shadow: 0 0 0 1px var(--ps-accent); }
.ps-app .pss-card:has(input:focus-visible) { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
.ps-app .pss-card:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.pss-card input { margin-top: .15rem; }
.pss-card br { display: none; }
.pss-card > span > strong { display: block; font-weight: 650; margin-bottom: 2px; }
.pss-card > span > .ps-small { display: block; margin-top: 2px; color: var(--ps-ink-2); }
.pss-card > span > .ps-why { color: var(--ps-sev-medium-ink); }
.pss-card > span > span.ps-muted { display: block; }
[data-knowledge-option] .pss-card { margin-top: var(--ps-sp-3); }
.ps-picker .ps-side-h { font-family: var(--ps-sans); font-size: var(--ps-fs-s); font-weight: 650; color: var(--ps-ink); margin: var(--ps-sp-6) 0 var(--ps-sp-2); }
/* phones: the price and the confirm button stay above the tab bar while the cards are chosen */
@media (max-width: 899px) {
    .ps-price-panel { position: sticky; bottom: calc(var(--ps-tabbar-h) + env(safe-area-inset-bottom, 0px) + var(--ps-sp-2)); z-index: 20; box-shadow: var(--ps-overlay-shadow); padding: var(--ps-sp-3) var(--ps-sp-4); }
    .ps-price-panel .ps-step { margin-bottom: var(--ps-sp-1); }
    .ps-price-panel [data-quote-scope] { display: none; }
}
/* grid and flex children may shrink below their content, so a scrolling toolbar can never widen the page */
.ps-docs-layout > *, .ps-docs-main, .ps-picker > *, .pss-ws > *, .ps-pagehead > * { min-width: 0; }
/* absolutely placed children (the visually hidden labels) must be clipped by the scrolling rows, or they widen the page */
.ps-pagehead .ps-row[role="group"], .ps-filterbar, .ps-orgbar, .ps-cardbar, .ps-cards, .ps-casetabs, .ps-tabs { position: relative; }

/* ================================================================ documents: a table with a header row; cards when narrow */
.ps-docs-main { container-type: inline-size; container-name: docs; }
.pss-dochead { display: none; }
.ps-docrow { grid-template-columns: minmax(0, 1fr); align-items: start; row-gap: var(--ps-sp-2); padding-block: var(--ps-sp-4); }
.ps-docrow .pss-cell { min-width: 0; font-size: var(--ps-fs-s); }
.ps-docrow .pss-cell--name .ps-rowitem__title { font-family: var(--ps-sans); font-size: var(--ps-fs-m); font-weight: 650; }
.ps-docrow .ps-rowitem__facts { margin: 0; gap: 2px var(--ps-sp-4); }
.ps-docrow .pss-cell--file, .ps-docrow .pss-cell--verdict { display: inline-flex; align-items: center; }
.ps-docrow .pss-cell--status { display: flex; flex-direction: column; align-items: flex-start; gap: var(--ps-sp-2); }
.ps-docrow .ps-rowitem__tags { margin-top: var(--ps-sp-2); }
@container docs (max-width: 699px) {
    /* narrow: a card, the name first, then the facts, then file, verdict and status in one wrapping line */
    .ps-docrow { grid-template-columns: auto auto minmax(0, 1fr); }
    .ps-docrow .pss-cell--name, .ps-docrow .pss-cell--facts { grid-column: 1 / -1; }
    .ps-docrow .pss-cell--status { flex-direction: row; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }
}
@container docs (min-width: 700px) {
    .pss-dochead, .ps-docrow { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr) minmax(0, 1fr) 7.5rem 7.5rem; column-gap: var(--ps-sp-4); }
    .pss-dochead { display: grid; padding: var(--ps-sp-2) var(--ps-pad) var(--ps-sp-2) calc(var(--ps-pad) + var(--ps-bar)); font-size: var(--ps-fs-xs); font-weight: 550; color: var(--ps-ink-2); background: var(--ps-sunk); border: 1px solid var(--ps-line); border-bottom: 0; border-radius: var(--ps-radius-panel) var(--ps-radius-panel) 0 0; }
    [data-selectable] .pss-dochead { padding-left: calc(var(--ps-pad) + var(--ps-bar) + 1.6rem); }
    .pss-dochead + .ps-rows { border-top-left-radius: 0; border-top-right-radius: 0; }
    .ps-docrow .ps-fact__k { display: none; }
    .ps-docrow .ps-rowitem__facts { flex-direction: column; }
    .ps-docrow .pss-cell--status { align-items: flex-start; }
}
/* folders: a row of cards above the table (all documents, top of the Case, each folder) instead of a side tree; the table gets the full width */
.ps-docs-layout { grid-template-columns: minmax(0, 1fr) !important; gap: var(--ps-sp-4); }
.ps-docs-side { display: flex; flex-wrap: wrap; align-items: center; gap: var(--ps-sp-3) var(--ps-sp-4); }
.ps-docs-side > .ps-side-h { flex: 0 0 100%; margin: 0; font-family: var(--ps-sans); font-size: var(--ps-fs-s); font-weight: 650; }
.ps-docs-side .ps-folders { flex: 1 1 20rem; min-width: 0; overflow-x: auto; scrollbar-width: none; position: relative; }
.ps-docs-side .ps-folders::-webkit-scrollbar { display: none; }
.ps-folders ul, .ps-folders li { display: contents; }
.ps-folders > ul { display: flex; gap: var(--ps-sp-2); padding: 0; margin: 0; border: 0; }
.ps-folder { flex: none; flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; min-width: 8.5rem; min-height: 3.5rem; padding: var(--ps-sp-2) var(--ps-sp-4); background: var(--ps-surface); border: 1px solid var(--ps-line); border-radius: var(--ps-radius-panel); transition: border-color var(--ps-dur) var(--ps-ease), background-color var(--ps-dur) var(--ps-ease); }
.ps-folder:hover { background: var(--ps-surface); border-color: var(--ps-line-2); }
.ps-folder.is-open { background: var(--ps-accent-soft); border-color: var(--ps-accent); box-shadow: 0 0 0 1px var(--ps-accent); }
.ps-folder .ps-muted { font-size: var(--ps-fs-xs); }
.ps-docs-side .ps-folder-new { flex: 0 1 16rem; margin: 0; }
.ps-docs-side .ps-folder-new label { margin-bottom: 2px; }
