/* The partner portal's shared page furniture (Calm Instrument final cleanup): what every portal page stands on —
   the main column and footer, the title and lede, form controls, the card, the table and its phone stacking, the
   status badges and the report band colours. Scoped to .portal-main and .portal-foot, tokens only. It used to be a
   <style> block inside PartnerLayout.razor: global anyway, but outside the inventory and re-sent with every page.
   A page adds only what is its own. */
/* ---- Shared page furniture, so pages stop re-declaring it (page internals: later slices) ---- */
.portal-main { flex: 1; width: 100%; max-width: 1240px; padding: 40px 48px 72px; }
.portal-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
    padding: 18px 48px 26px; border-top: 1px solid var(--line);
    font-size: var(--fs-meta); color: var(--muted); }
.portal-foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.portal-foot a { color: var(--muted); text-decoration: none; }
.portal-foot a:hover { color: var(--text); }

/* Every title is the display size at most (28px); the page header draws the top-level ones. */
.portal-main h1 { font-size: var(--fs-display); font-weight: 800; letter-spacing: -.02em; line-height: var(--lh-display); margin: 0 0 10px; }
.portal-main .lede { font-size: var(--fs-body); line-height: 1.65; color: var(--text-2); max-width: 64ch; margin: 0 0 28px; }
.portal-main .label { font-size: var(--fs-label); font-weight: 500; letter-spacing: .18em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 14px; }
.portal-main a:not([class]) { color: var(--text); text-decoration-color: var(--tint-brand); text-underline-offset: 2px; }
.portal-main a:not([class]):hover { text-decoration-color: var(--text-2); }
.portal-main a:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: var(--r-sm); }

/* Form controls: one dark rule for all of them, bordered in --control (3:1 against every ground). */
.portal-main input:where(:not([type]),[type=text],[type=email],[type=url],[type=search],[type=number],[type=tel]),
.portal-main select, .portal-main textarea {
    width: 100%; padding: 11px 13px; border-radius: var(--r-md); font: inherit; font-size: var(--fs-body);
    color: var(--text); background: var(--fill-2); border: 1px solid var(--control);
    transition: border-color .18s ease, background .18s ease; }
.portal-main select { appearance: none; padding-right: 38px; cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23AEB6C2' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; }
.portal-main select option { background: var(--surface); color: var(--text); }
.portal-main input::placeholder, .portal-main textarea::placeholder { color: var(--muted); }
.portal-main input:not([type=checkbox],[type=radio],[type=file]):focus-visible, .portal-main select:focus-visible, .portal-main textarea:focus-visible {
    outline: none; border-color: var(--line-brand); background: var(--fill-2);
    box-shadow: 0 0 0 3px var(--tint-brand-2); }
.portal-main input:disabled, .portal-main select:disabled { opacity: .5; cursor: not-allowed; }

/* Portal furniture every page uses. Defined once here; a page adds only what is its own. */
.portal-main .note { margin-top: 22px; font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); max-width: 64ch; }

.portal-main .pcard { padding: 20px 22px; border-radius: var(--r-lg); border: 1px solid var(--line-strong);
    background: var(--fill-1); }
.portal-main .pcard + .pcard { margin-top: 14px; }
.portal-main .pcard p { margin: 0; font-size: var(--fs-control); line-height: 1.65; color: var(--text-2); max-width: 72ch; }
.portal-main .pcard p + p { margin-top: 10px; }
.portal-main .pcard strong { color: var(--text); }

/* Tables scroll inside their own box rather than the page, so a phone never scrolls sideways. */
.portal-main .tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg);
    -webkit-overflow-scrolling: touch; }
.portal-main table.pf { width: 100%; border-collapse: collapse; font-size: var(--fs-control); min-width: 620px; }
.portal-main table.pf th { text-align: left; font-size: var(--fs-label); font-weight: 500; letter-spacing: .18em;
    text-transform: uppercase; color: var(--muted); padding: 14px 16px;
    border-bottom: 1px solid var(--line); white-space: nowrap; }
.portal-main table.pf td { padding: 14px 16px; border-bottom: 1px solid var(--line);
    color: var(--text-2); vertical-align: top; }
.portal-main table.pf tr:last-child td { border-bottom: 0; }
.portal-main table.pf tbody tr:hover td { background: var(--fill-1); }
.portal-main .num { text-align: right; font-variant-numeric: tabular-nums; }
.portal-main .nm { font-weight: 600; color: var(--text); text-decoration: none; }
.portal-main a.nm:hover { text-decoration: underline; text-decoration-color: var(--muted); }
.portal-main .dt { font-size: var(--fs-sm); color: var(--muted); }
.portal-main .ac { text-align: right; white-space: nowrap; }
.portal-main .ac a { font-size: var(--fs-sm); }

/* Status badges. Five tones, the same five everywhere in the portal. */
.portal-main .st { display: inline-block; padding: 3px 9px; border-radius: var(--r-full); font-size: var(--fs-label); font-weight: 700;
    letter-spacing: .04em; white-space: nowrap; border: 1px solid transparent; }
.portal-main .st-good { color: var(--progress); background: var(--tint-brand); border-color: var(--line-brand); }
.portal-main .st-working { color: var(--workflow); background: var(--tint-workflow); border-color: var(--line-workflow); }
.portal-main .st-waiting { color: var(--caution); background: var(--tint-caution); border-color: var(--line-caution); }
.portal-main .st-muted { color: var(--muted); background: var(--fill-2); border-color: var(--line-strong); }
.portal-main .st-bad { color: var(--error); background: var(--tint-error); border-color: var(--line-error); }

/* Report band colours, the report's own, so a score means the same thing in both places. */
.portal-main .s-opt { color: var(--progress); } .portal-main .s-hea { color: var(--text-2); } .portal-main .s-dev { color: var(--text-2); }
.portal-main .s-eme { color: var(--caution); } .portal-main .s-risk { color: var(--error); }

@media (max-width: 900px) {
    .portal-main { padding: 24px 24px 72px; }
    /* A table marked .stack becomes a list of cards on a phone: each row a card, each cell
       labelled by its column header (data-th). Sideways scrolling hides the column that
       matters most — the status — behind the edge of the screen. */
    .portal-main .tablewrap.stack { border: 0; border-radius: 0; overflow: visible; }
    .portal-main .tablewrap.stack table.pf { min-width: 0; }
    .portal-main .tablewrap.stack thead { display: none; }
    .portal-main .tablewrap.stack tbody, .portal-main .tablewrap.stack tr { display: block; }
    .portal-main .tablewrap.stack tr { padding: 12px 14px 10px; margin-bottom: 10px; border-radius: var(--r-lg);
        border: 1px solid var(--line-strong); background: var(--fill-1); }
    .portal-main .tablewrap.stack tbody tr:hover td { background: transparent; }
    .portal-main .tablewrap.stack td { display: block; padding: 4px 0; border: 0; text-align: left; }
    .portal-main .tablewrap.stack td:empty { display: none; }
    .portal-main .tablewrap.stack td[data-th]::before { content: attr(data-th); display: block; font-size: var(--fs-label);
        font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
    .portal-main .tablewrap.stack td.ac { padding-top: 8px; }
    .portal-main .tablewrap.stack td.ac a { font-size: var(--fs-control); font-weight: 600; }
    .portal-foot { padding: 16px 24px 22px; flex-direction: column; }
}
@media (max-width: 640px) {
    .portal-main { padding: 20px 16px 96px; }
    .portal-main h1 { font-size: calc(var(--fs-display) - 4px); line-height: 30px; }
    .portal-foot { padding: 16px 16px 22px; }
}
