/* Hallmark · macrostructure: member portal app shell on the existing Lake Joseph
 *   site (theme route: existing tokens from new-style.css :root; genre: editorial,
 *   inherited from the public site). Sticky .main-nav, single content column,
 *   compact footer. No new theme, no new fonts.
 * Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4
 * Hallmark · component set: button · input · switch · tabs · table/row cards ·
 *   slide-out sheet · notice · badge · nav disclosure · modal (Round 5) ·
 *   drawer head with staged Save + pending link cards (Round 5) · feed rows
 *   states: default · hover · focus · active · disabled · loading · error · success
 *   contrast: pass (40–41) — text/tint pairs below are ≥ 4.5:1, control
 *   boundaries (--border-strong on --surface) ≥ 3:1, focus ring is the site's
 *   2px --primary-color ring.
 *
 * Loaded after new-style.css on member-*.html, login.html and admin pages.
 * Every colour references a token; missing tokens were added to :root in
 * new-style.css (member portal tokens block), not inlined here.
 */

html,
body {
    overflow-x: clip;
}

/* ------------------------------------------------------------------ */
/* Layout                                                              */
/* ------------------------------------------------------------------ */

.portal-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-2xl) 20px var(--space-4xl);
}

.portal-main--narrow {
    max-width: 720px;
}

.portal-head {
    margin-bottom: var(--space-xl);
}

.portal-head h1,
.portal-main h1 {
    font-size: 2rem;
    line-height: 1.2;
    font-style: normal;
    overflow-wrap: anywhere;
    min-width: 0;
    margin-bottom: var(--space-sm);
}

/* Links inside portal content use the site accent, not the UA blue. */
.portal-main a:not(.p-btn),
.p-sheet a:not(.p-btn) {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.portal-main a:not(.p-btn):hover,
.p-sheet a:not(.p-btn):hover {
    color: var(--primary-dark);
}

.portal-main a:not(.p-btn):active {
    color: var(--text-dark);
}

/* Headings and notices receive focus programmatically (tabindex="-1") so
   screen readers announce the new view; they aren't controls, so no ring. */
[tabindex="-1"]:focus {
    outline: none;
}

.portal-lede {
    color: var(--text-light);
    max-width: 62ch;
}

.portal-section + .portal-section,
.p-panel + .portal-section,
.p-picker + .p-panel {
    margin-top: var(--space-2xl);
}

.p-picker + .p-panel {
    margin-top: var(--space-md);
}

.portal-section > h2,
.p-panel h2,
.p-panel h3 {
    font-size: 1.25rem;
    line-height: 1.3;
    font-style: normal;
    overflow-wrap: anywhere;
    margin-bottom: var(--space-md);
}

.portal-section > h2 {
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.p-panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
}

.p-panel + .p-panel {
    margin-top: var(--space-lg);
}

.p-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--space-lg);
    align-items: start;
}

@media (max-width: 768px) {
    .portal-main {
        padding-top: var(--space-xl);
    }

    .portal-head h1,
    .portal-main h1 {
        font-size: 1.6rem;
    }

    .p-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Definition list of property facts */
.p-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: var(--space-sm) var(--space-lg);
    margin: 0;
}

.p-facts dt {
    color: var(--text-light);
    font-size: 0.9rem;
    padding-top: 2px;
}

.p-facts dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.p-facts .p-muted {
    font-weight: 400;
}

@media (max-width: 480px) {
    .p-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .p-facts dd {
        margin-bottom: var(--space-md);
    }
}

.p-muted {
    color: var(--text-light);
}

.p-text {
    max-width: 62ch;
    margin-bottom: var(--space-md);
}

.p-prewrap {
    white-space: pre-line;
}

.p-after {
    margin-top: var(--space-md);
}

/* ------------------------------------------------------------------ */
/* Buttons — 8 states                                                  */
/* ------------------------------------------------------------------ */

.p-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: var(--primary-color);
    color: var(--on-primary);
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out, transform 0.1s ease-out;
}

.p-btn:hover,
.p-btn.is-hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.p-btn:focus-visible,
.p-btn.is-focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.p-btn:active,
.p-btn.is-active {
    transform: translateY(1px);
}

.p-btn:disabled,
.p-btn[aria-disabled="true"] {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.p-btn[aria-busy="true"] {
    cursor: progress;
}

.p-btn[aria-busy="true"]::before {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: p-spin 0.8s linear infinite;
}

.p-btn[data-state="error"] {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--on-primary);
}

.p-btn[data-state="success"] {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--on-primary);
}

.p-btn--secondary {
    background: var(--surface);
    color: var(--primary-color);
}

.p-btn--secondary:hover,
.p-btn--secondary.is-hover {
    background: var(--primary-tint);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
}

.p-btn--quiet {
    background: transparent;
    border-color: transparent;
    color: var(--primary-color);
    padding-inline: var(--space-sm);
}

.p-btn--quiet:hover,
.p-btn--quiet.is-hover {
    background: var(--primary-tint);
    border-color: transparent;
    color: var(--primary-dark);
}

/* A disabled text button stays a text button (no grey box). */
.p-btn--quiet:disabled,
.p-btn--quiet[aria-disabled="true"] {
    background: transparent;
    border-color: transparent;
}

.p-btn--danger {
    background: var(--surface);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.p-btn--danger:hover,
.p-btn--danger.is-hover {
    background: var(--danger-tint);
    border-color: var(--danger-dark);
    color: var(--danger-dark);
}

.p-btn--danger-solid {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.p-btn--danger-solid:hover,
.p-btn--danger-solid.is-hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
}

.p-btn--block {
    width: 100%;
}

.p-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
}

@keyframes p-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ------------------------------------------------------------------ */
/* Form fields                                                         */
/* ------------------------------------------------------------------ */

.p-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
    min-width: 0;
}

.p-field label,
.p-label {
    font-weight: 600;
    color: var(--text-dark);
}

.p-input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-dark);
    font: inherit;
    transition: border-color 0.2s ease-out;
}

textarea.p-input {
    min-height: 88px;
    resize: vertical;
}

.p-input:hover,
.p-input.is-hover {
    border-color: var(--text-dark);
}

.p-input:focus-visible,
.p-input.is-focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
    border-color: var(--primary-color);
}

.p-input:disabled,
.p-input[readonly] {
    background: var(--bg-light);
    color: var(--text-light);
    border-color: var(--border-color);
    cursor: not-allowed;
}

.p-input[aria-invalid="true"] {
    border-color: var(--danger-color);
}

.p-input[aria-busy="true"] {
    cursor: progress;
}

.p-hint {
    font-size: 0.9rem;
    color: var(--text-light);
}

.p-field-error {
    font-size: 0.9rem;
    color: var(--danger-color);
    font-weight: 600;
}

.p-field-error:empty {
    display: none;
}

.p-form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 var(--space-md);
}

@media (max-width: 600px) {
    .p-form-row {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Switch: a real checkbox with role="switch" */
.p-switch {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    cursor: pointer;
}

.p-switch input {
    appearance: none;
    flex: none;
    position: relative;
    width: 44px;
    height: 26px;
    margin: 0;
    border: 1px solid var(--border-strong);
    border-radius: 13px;
    background: var(--bg-light);
    cursor: pointer;
    transition: background-color 0.2s ease-out, border-color 0.2s ease-out;
}

.p-switch input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-light);
    transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}

.p-switch input:hover {
    border-color: var(--text-dark);
}

.p-switch input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.p-switch input:active::after {
    width: 22px;
}

.p-switch input:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.p-switch input:checked::after {
    background: var(--on-primary);
    transform: translateX(18px);
}

.p-switch input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.p-switch input[aria-busy="true"] {
    cursor: progress;
}

.p-switch input[aria-invalid="true"] {
    border-color: var(--danger-color);
}

.p-switch__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ------------------------------------------------------------------ */
/* Notices, badges, empty states                                       */
/* ------------------------------------------------------------------ */

.p-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    color: var(--text-dark);
    margin-bottom: var(--space-lg);
}

.p-notice p {
    margin: 0;
    max-width: 70ch;
}

.p-notice--info {
    background: var(--primary-tint);
    border-color: var(--secondary-color);
}

.p-notice--success {
    background: var(--primary-tint);
    border-color: var(--primary-color);
}

.p-notice--error {
    background: var(--danger-tint);
    border-color: var(--danger-color);
    color: var(--danger-dark);
}

.p-notice--warning {
    background: var(--warning-tint);
    border-color: var(--warning-text);
    color: var(--warning-text);
}

.p-notice[hidden] {
    display: none;
}

.p-badge {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid var(--primary-color);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--primary-color);
    background: var(--surface);
    white-space: nowrap;
    vertical-align: middle;
}

.p-badge--quiet {
    border-color: var(--border-strong);
    color: var(--text-light);
    margin-left: var(--space-xs);
}

.p-badge--muted {
    border-color: var(--border-color);
    color: var(--text-light);
    background: var(--bg-light);
}

.p-empty {
    padding: var(--space-xl) var(--space-lg);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.p-empty h2 {
    font-size: 1.15rem;
    margin-bottom: var(--space-sm);
}

.p-loading {
    color: var(--text-light);
    padding: var(--space-lg) 0;
}

/* ------------------------------------------------------------------ */
/* Tabs (ARIA tablist)                                                 */
/* ------------------------------------------------------------------ */

.p-tabs {
    display: flex;
    gap: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.p-tab {
    min-height: 44px;
    padding: var(--space-sm) 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    color: var(--text-light);
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease-out, border-color 0.2s ease-out;
}

.p-tab:hover,
.p-tab.is-hover {
    color: var(--text-dark);
    border-bottom-color: var(--border-strong);
}

.p-tab:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.p-tab:active {
    color: var(--primary-dark);
}

.p-tab[aria-selected="true"] {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.p-tab:disabled {
    color: var(--border-strong);
    cursor: not-allowed;
}

.p-tab .p-count {
    font-weight: 400;
    color: var(--text-light);
}

/* ------------------------------------------------------------------ */
/* Toolbar + table (row cards below 768 px)                            */
/* ------------------------------------------------------------------ */

.p-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.p-toolbar .p-field {
    margin-bottom: 0;
    flex: 1 1 260px;
    max-width: 420px;
}

.p-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.p-table th,
.p-table td {
    text-align: left;
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    overflow-wrap: anywhere;
}

.p-table th {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg-light);
}

.p-table tr:last-child td {
    border-bottom: 0;
}

.p-row {
    cursor: pointer;
    transition: background-color 0.15s ease-out;
}

.p-row:hover,
.p-row.is-hover {
    background: var(--primary-tint);
}

.p-row:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.p-row:active {
    background: var(--primary-tint);
}

.p-row[aria-busy="true"] {
    cursor: progress;
}

.p-row.is-inactive td {
    color: var(--text-light);
}

.p-rowlink {
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-dark);
    font: inherit;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.p-rowlink:hover,
.p-row:hover .p-rowlink {
    color: var(--primary-color);
    text-decoration: underline;
}

.p-rowlink:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.p-rowlink:active {
    color: var(--primary-dark);
}

.p-row.is-inactive .p-rowlink {
    color: var(--text-light);
}

.p-row .p-row__primary {
    font-weight: 600;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .p-table,
    .p-table tbody,
    .p-table tr,
    .p-table td {
        display: block;
        width: 100%;
    }

    .p-table {
        border: 0;
        background: transparent;
    }

    .p-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .p-table tr {
        background: var(--surface);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-md);
        margin-bottom: var(--space-sm);
        padding: var(--space-sm) 0;
    }

    .p-table td {
        border: 0;
        padding: 4px var(--space-md);
    }

    .p-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.8rem;
        color: var(--text-light);
    }

    .p-table td.p-cell-primary::before {
        content: none;
    }
}

/* Links list inside detail panels */
.p-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

.p-list > li {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs) var(--space-md);
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.p-list > li > .p-subform {
    flex-basis: 100%;
}

.p-list > li.is-ended {
    color: var(--text-light);
}

.p-list__main {
    min-width: 0;
    flex: 1 1 220px;
    overflow-wrap: anywhere;
}

.p-list__meta {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ------------------------------------------------------------------ */
/* Slide-out sheet                                                     */
/* ------------------------------------------------------------------ */

.p-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--scrim);
}

.p-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1101;
    width: min(520px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
}

.p-sheet.is-open {
    transform: translateX(0);
}

.p-sheet__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

/* Title row: title, then Save, then Close. Baseline alignment keeps the
   buttons on the title's first line whether or not it wraps (gate 36). */
.p-sheet__bar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
}

.p-sheet__bar h2 {
    flex: 1 1 auto;
    font-size: 1.2rem;
    font-style: normal;
    margin: 0;
    min-width: 0;
    overflow-wrap: break-word;
}

.p-sheet__bar h2:focus {
    outline: none;
}

.p-sheet__actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

/* The staged Save: the label grows from "Save" to "Save (12)" without
   moving the title's wrap point. */
.p-sheet__save {
    min-width: 9ch;
    font-variant-numeric: tabular-nums;
}

/* Flash, error notice or discard bar, in the fixed head below the title. */
.p-sheet__msg:empty {
    display: none;
}

.p-sheet__msg .p-notice {
    margin: 0;
}

@media (max-width: 414px) {
    .p-sheet__head {
        padding-inline: var(--space-md);
    }

    .p-sheet__bar {
        flex-wrap: wrap;
        row-gap: var(--space-sm);
    }

    .p-sheet__bar h2 {
        flex: 1 0 100%;
    }

    .p-sheet__actions {
        margin-inline-start: auto;
    }
}

/* Inline "Discard …?" bar (drawer head, modal foot). */
.p-confirm-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm) var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--warning-text);
    border-radius: var(--radius-md);
    background: var(--warning-tint);
    color: var(--warning-text);
}

.p-confirm-bar p {
    margin: 0;
    font-weight: 600;
}

.p-confirm-bar .p-actions {
    margin: 0;
}

/* Pending link cards: staged, not saved. 1 px all-round border + tint; the
   label text carries the meaning (no side stripe, no strikethrough). */
.p-pending {
    margin-bottom: var(--space-sm);
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.p-list > li.p-pending {
    display: block;
    margin: var(--space-sm) 0;
    padding: var(--space-md);
    border: 1px solid var(--border-color);
}

.p-list > li.p-pending.is-add {
    border-color: var(--primary-color);
    background: var(--primary-tint);
}

.p-list > li.p-pending.is-end {
    border-color: var(--warning-text);
    background: var(--warning-tint);
}

.p-pending__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-md);
    margin-bottom: var(--space-sm);
}

.p-pending__label {
    margin: 0;
    font-weight: 700;
}

.p-pending.is-end .p-pending__label {
    color: var(--warning-text);
}

.p-pending__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-md);
}

.p-pending__row > .p-field {
    flex: 1 1 180px;
    min-width: 0;
}

.p-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
}

.p-sheet__body h3 {
    font-size: 1rem;
    font-style: normal;
    margin: var(--space-lg) 0 var(--space-sm);
}

.p-sheet__body h3:first-child {
    margin-top: 0;
}

/* Round 6 item 6: a section heading with its action on the same row,
 * right-aligned ("Properties ... + Link to a property"). The text button
 * keeps its 44px target; the negative block margin stops it from pushing
 * the heading rhythm apart. On a narrow drawer the action wraps under the
 * title and stays right-aligned. */
.p-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    column-gap: var(--space-md);
    margin: var(--space-lg) 0 var(--space-sm);
}

.p-section-head:first-child {
    margin-top: 0;
}

.p-sheet__body .p-section-head h3 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Member pages: the same heading row with an h2 (My Property "Add a person"). */
.portal-section > .p-section-head h2 {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}
.p-section-head__action {
    margin-left: auto;
    margin-block: calc(var(--space-sm) * -1);
}

.p-sheet-open,
.p-sheet-open body {
    overflow: hidden;
}

.p-subform {
    margin-top: var(--space-md);
    padding: var(--space-md);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-light);
}

.p-subform[hidden] {
    display: none;
}

.p-subform h4 {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
    .p-sheet {
        width: 100%;
        border-left: 0;
    }

    .p-sheet__body {
        padding: var(--space-md);
    }
}

/* ------------------------------------------------------------------ */
/* Login card                                                          */
/* ------------------------------------------------------------------ */

.p-login {
    max-width: 440px;
    margin: 0 auto;
}

.p-login .p-panel {
    padding: var(--space-xl);
}

@media (max-width: 414px) {
    .p-login .p-panel {
        padding: var(--space-lg) var(--space-md);
    }
}

.p-login h1 {
    font-size: 1.75rem;
}

.p-turnstile {
    min-height: 65px;
    margin-bottom: var(--space-md);
}

/* ------------------------------------------------------------------ */
/* Portal nav (rendered by assets/js/portal/nav.js)                    */
/* ------------------------------------------------------------------ */

.portal-nav .nav-menu {
    align-items: center;
    gap: var(--space-lg);
}

.portal-nav .nav-menu a,
.portal-nav-disclosure {
    white-space: nowrap;
}

.portal-nav .nav-menu a:focus-visible,
.portal-nav-disclosure:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}

.portal-nav .nav-menu a[aria-current="page"] {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 6px;
    text-decoration-thickness: 2px;
}

.portal-nav-admin {
    position: relative;
}

.portal-nav-disclosure {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-dark);
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease-out;
}

.portal-nav-disclosure::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.2s ease-out;
}

.portal-nav-disclosure[aria-expanded="true"]::after {
    transform: translateY(2px) rotate(-135deg);
}

.portal-nav-disclosure:hover,
.portal-nav-disclosure.active,
.portal-nav-disclosure[aria-expanded="true"] {
    color: var(--primary-color);
}

.portal-nav-disclosure:active {
    color: var(--primary-dark);
}

.portal-admin-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 230px;
    list-style: none;
    margin: 0;
    padding: var(--space-sm) 0;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    z-index: 1001;
}

.portal-admin-menu[hidden] {
    display: none;
}

.portal-admin-menu a {
    display: block;
    padding: 10px var(--space-md);
}

.portal-admin-menu a:hover {
    background: var(--primary-tint);
}

.portal-nav .current-user-nav {
    display: inline-block;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.portal-nav .btn-logout-nav {
    white-space: nowrap;
    min-height: 40px;
}

.portal-nav .btn-logout-nav:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.portal-nav .btn-logout-nav:active {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--on-primary);
}

.portal-nav .btn-logout-nav:disabled,
.portal-nav .btn-logout-nav[aria-busy="true"] {
    opacity: 0.6;
    cursor: progress;
}

@media (max-width: 1280px) {
    .portal-nav .logo-text {
        display: none;
    }
}

/* The admin row (Admin group + Logout) doesn't fit between the mobile
   sheet and 1280px: drop the lowest-priority item, the email text, rather
   than wrap or clip a link (hallmark gate 49). My Account still shows it,
   and the mobile sheet below 1025px keeps it. */
@media (min-width: 1025px) and (max-width: 1279px) {
    .portal-nav--admin .portal-nav-account {
        display: none;
    }
}

@media (max-width: 1024px) {
    .portal-nav .nav-menu {
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        gap: 0;
    }

    .portal-nav .nav-menu li {
        padding: var(--space-sm) 0;
    }

    .portal-nav-disclosure {
        margin: 0 auto;
    }

    .portal-admin-menu {
        position: static;
        min-width: 0;
        box-shadow: none;
        border: 0;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
        background: var(--bg-light);
        margin-top: var(--space-sm);
    }

    .portal-nav .current-user-nav {
        max-width: 90vw;
    }
}

/* Admin pages: the banner slot sits directly under the nav */
#portal-banner-slot .p-notice {
    margin: var(--space-md) 20px 0;
}

/* ------------------------------------------------------------------ */
/* Compact footer                                                      */
/* ------------------------------------------------------------------ */

.portal-footer {
    padding: var(--space-lg) 0;
}

.portal-footer .footer-bottom {
    border-top: 0;
    padding-top: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm) var(--space-md);
}

.portal-footer .footer-bottom a {
    color: var(--on-primary);
    white-space: nowrap;
}

.portal-footer .footer-bottom a:hover {
    text-decoration: none;
}

/* Visually hidden but available to assistive tech */
.p-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Documents (slice 1b): member list, admin filters, choices, digest   */
/* ------------------------------------------------------------------ */

/* Member document list: each row is one /d link. */
.p-doclist {
    list-style: none;
    margin: 0;
    padding: 0;
}
.p-doc {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    min-width: 0;
}
.p-doc:first-child {
    padding-top: 0;
}
.p-doc:last-child {
    border-bottom: 0;
}
.p-doc__link {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-xs) var(--space-sm);
    min-height: 44px;
    padding: var(--space-sm) 0;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.15s ease-out;
}
.p-doc__link:hover,
.p-doc__link.is-hover {
    color: var(--primary-dark);
    text-decoration: underline;
}
.p-doc__link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
.p-doc__link:active {
    color: var(--text-dark);
}
.p-doc__link[aria-disabled="true"] {
    color: var(--text-light);
    pointer-events: none;
}
.p-doc__title {
    min-width: 0;
}
.p-doc__desc {
    margin: 0;
    max-width: 62ch;
    color: var(--text-dark);
}
.p-doc__meta {
    margin: var(--space-xs) 0 0;
    font-size: 0.9rem;
    color: var(--text-light);
}
.p-doclist--compact .p-doc__desc {
    display: none;
}
.p-doclist--compact .p-doc {
    padding: var(--space-xs) 0;
}
.p-doclist--compact .p-doc__link {
    min-height: 0;
}

/* Admin filters: wrap on narrow screens, no horizontal scroll. */
.p-filters {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    flex: 1 1 520px;
    min-width: 0;
}
.p-filters .p-field {
    margin-bottom: 0;
    flex: 1 1 160px;
    min-width: 0;
}

/* Radio and checkbox choices (real inputs; native control, token colours). */
.p-fieldset {
    border: 0;
    margin: 0 0 var(--space-md);
    padding: 0;
    min-width: 0;
}
.p-fieldset legend {
    margin-bottom: var(--space-sm);
}
.p-choice,
.p-check {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 2px var(--space-sm);
    align-items: start;
    margin-bottom: var(--space-sm);
}
.p-check {
    margin-bottom: var(--space-md);
}
.p-check .p-hint {
    grid-column: 2;
    margin: 0;
}
.p-choice__input,
.p-check__input {
    width: 20px;
    height: 20px;
    margin: 2px 0 0;
    accent-color: var(--primary-color);
    cursor: pointer;
}
.p-choice__input:hover,
.p-check__input:hover {
    outline: 1px solid var(--border-strong);
    outline-offset: 1px;
}
.p-choice__input:focus-visible,
.p-check__input:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.p-choice__input:active,
.p-check__input:active {
    outline: 2px solid var(--primary-dark);
}
.p-choice__input:disabled,
.p-check__input:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.p-check__input:disabled + .p-check__label {
    color: var(--text-light);
}
.p-choice__input[aria-invalid="true"],
.p-check__input[aria-invalid="true"] {
    outline: 2px solid var(--danger-color);
}
.p-choice__label,
.p-check__label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    min-width: 0;
}
.p-choice__title {
    font-weight: 600;
}

/* File input: the native button picks up the field's states. */
input[type="file"].p-input {
    padding: 8px;
    cursor: pointer;
}
input[type="file"].p-input::file-selector-button {
    margin-right: var(--space-sm);
    padding: 6px 12px;
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--primary-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
input[type="file"].p-input:hover::file-selector-button {
    background: var(--primary-tint);
}

.p-code {
    font-size: 0.9em;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    overflow-wrap: anywhere;
}
.p-lead {
    font-weight: 600;
}
.p-versions > li.is-current .p-list__main strong {
    color: var(--primary-color);
}
.p-versions .p-badge {
    margin-left: var(--space-sm);
}

/* Pending-digest banner lines (role=status / role=alert). */
.portal-digest-banner a {
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}
.portal-digest-banner a:hover {
    text-decoration: none;
}
.portal-digest-banner a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
#portal-banner-slot .p-notice + .p-notice {
    margin-top: var(--space-sm);
}

/* ------------------------------------------------------------------ */
/* Board-message modal (Round 5 item 1)                                */
/* ------------------------------------------------------------------ */

.p-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: var(--scrim);
}

.p-modal {
    position: fixed;
    z-index: 1201;
    top: 50%;
    left: 50%;
    width: min(560px, calc(100% - 32px));
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px));
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.p-modal.is-open {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.p-modal__head,
.p-modal__foot {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
}

.p-modal__head {
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.p-modal__head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-style: normal;
    min-width: 0;
    overflow-wrap: break-word;
}

.p-modal__foot {
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
}

.p-modal__foot .p-actions {
    margin: 0;
}

.p-modal__foot .p-confirm-bar {
    flex: 1 1 auto;
}

.p-modal__buttons[hidden],
.p-dirty-hint[hidden] {
    display: none;
}

.p-modal__body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: var(--space-lg);
}

.p-modal__fields {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.p-modal__fields > .p-hint {
    margin: 0 0 var(--space-xs);
}

.p-modal__fields > .p-hint + .p-field,
.p-modal__fields > [hidden] + .p-field {
    margin-top: var(--space-md);
}

.p-modal__done h3 {
    font-size: 1.1rem;
    font-style: normal;
    margin-bottom: var(--space-sm);
}

.p-modal__done h3:focus {
    outline: none;
}

@media (max-width: 480px) {
    .p-modal {
        inset: 0;
        top: 0;
        left: 0;
        width: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
        transform: translateY(8px);
    }

    .p-modal.is-open {
        transform: none;
    }

    .p-modal__head,
    .p-modal__foot,
    .p-modal__body {
        padding-inline: var(--space-md);
    }
}

/* ------------------------------------------------------------------ */
/* Recent updates feed (Round 5 item 6)                                */
/* ------------------------------------------------------------------ */

.p-feed {
    list-style: none;
    margin: 0;
    padding: 0;
}

.p-feed__item {
    border-bottom: 1px solid var(--border-color);
}

.p-feed__item:last-child {
    border-bottom: 0;
}

/* The whole row is one link; same states as .p-doc__link. */
.p-feed__link {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: var(--space-md);
    align-items: start;
    min-height: 44px;
    padding: 12px 0;
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.15s ease-out;
}

/* Only the title carries the link underline; the meta line stays plain. */
.portal-main a.p-feed__link {
    text-decoration: none;
}

.p-feed__link .p-feed__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.p-feed__icon {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    color: var(--text-light);
}

.p-feed__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.p-feed__title {
    color: var(--primary-color);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.p-feed__meta {
    font-size: 0.9rem;
    color: var(--text-light);
}

.p-feed__link:hover .p-feed__title,
.p-feed__link.is-hover .p-feed__title {
    color: var(--primary-dark);
    text-decoration: underline;
}

.p-feed__link:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.p-feed__link:active .p-feed__title {
    color: var(--text-dark);
}

.p-feed__link[aria-disabled="true"] {
    pointer-events: none;
}

.p-feed__link[aria-disabled="true"] .p-feed__title {
    color: var(--text-light);
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                      */
/* ------------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
    .p-sheet,
    .p-btn {
        transition: none;
    }

    .p-modal,
    .p-modal.is-open {
        transform: none;
        transition: opacity 0.15s linear;
    }

    .p-btn[aria-busy="true"]::before {
        animation: none;
        border-right-color: currentColor;
        opacity: 0.6;
    }

    .p-btn:active {
        transform: none;
    }
}

/* ------------------------------------------------------------------ */
/* Posts on the member Updates page (Round 6 item 4)                   */
/* ------------------------------------------------------------------ */
/* A post is a card (title, date, body, files); documents between posts
 * stay feed rows. Headings inside a body are demoted to h4 by
 * post-html.js, so they sit under the post title. */

.p-post {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-md);
    scroll-margin-top: var(--space-4xl);
    min-width: 0;
}

.p-post:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.portal-section .p-post__title {
    font-size: 1.15rem;
    font-style: normal;
    line-height: 1.3;
    margin: 0;
    overflow-wrap: anywhere;
}

.p-post__meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: var(--space-xs) 0 var(--space-md);
}

.p-post__body {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.p-post__body > :last-child {
    margin-bottom: 0;
}

.p-post__body h4 {
    font-size: 1rem;
    font-style: normal;
    margin: var(--space-md) 0 var(--space-xs);
}

.p-post__body ul,
.p-post__body ol {
    padding-left: 1.5rem;
}

.p-post__files {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

.p-post__files h4 {
    font-size: 0.95rem;
    font-style: normal;
    margin: 0 0 var(--space-xs);
}

.p-post__file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.p-post__file-list li + li {
    margin-top: var(--space-xs);
}

.p-post__file-list a {
    overflow-wrap: anywhere;
}

.p-feed + .p-post,
.p-post + .p-feed {
    margin-top: var(--space-md);
}

@media (max-width: 414px) {
    .p-post {
        padding: var(--space-md);
    }
}

/* Hallmark · component: document category chips · genre: modern-minimal · theme: site tokens
 * states: default · hover · focus · active · disabled · loading · error · success
 * A wrapping row at the top of Documents; one pressed chip at a time. */
.p-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin: 0 0 var(--space-lg);
}
.p-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 44px;
    padding: 0 var(--space-md);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-dark);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    /* No colour transition: the pressed state swaps background and text
     * together, so it never shows white text on the pale hover tint. */
}
.p-chip:hover {
    background: var(--primary-tint);
}
.p-chip:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.p-chip:active {
    transform: translateY(1px);
}
.p-chip[aria-pressed="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--bg-white);
}
.p-chip__count {
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}
.p-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Updates page: every item is a card; the header names the type. */
.p-post__head {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}
.p-post__type {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.p-post__type .p-feed__icon {
    margin-top: 0;
}
.p-post--file {
    padding-block: var(--space-md);
}
.p-post--file .p-post__meta {
    margin-bottom: 0;
}

/* A file link that opens in a new tab: title + box-and-arrow icon. */
.p-file-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    min-height: 44px;
}
.p-file-link__icon,
.p-doc__link .p-file-link__icon {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
@media (prefers-reduced-motion: reduce) {
    .p-chip:active { transform: none; }
}

/* Hallmark · component: admin digest history · genre: modern-minimal · theme: site tokens
 * states: default · hover · focus · active · disabled · loading · error · success
 * One row per digest; the row is a disclosure button (aria-expanded) that
 * opens what went out, the email preview and the send log. */
.p-digest-history {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
}
.p-digest-run {
    border-bottom: 1px solid var(--border-color);
}
.p-digest-run__head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-sm) var(--space-md);
    width: 100%;
    min-height: 44px;
    padding: var(--space-md) 0;
    border: 0;
    background: none;
    color: var(--text-dark);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.p-digest-run__head:hover .p-digest-run__when {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.p-digest-run__head:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.p-digest-run__main,
.p-digest-run__result {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.p-digest-run__result {
    align-items: flex-end;
    text-align: right;
}
.p-digest-run__when {
    font-weight: 600;
    overflow-wrap: anywhere;
}
.p-digest-run[data-status="partial"] .p-badge,
.p-digest-run[data-status="failed"] .p-badge {
    border-color: var(--danger-color);
    color: var(--danger-color);
}
.p-digest-run__body {
    padding: 0 0 var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.p-digest-run__body h3 {
    font-size: 1rem;
    font-style: normal;
    margin: 0 0 var(--space-xs);
}
.p-digest-preview summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--primary-color);
    font-weight: 600;
}
.p-digest-preview__frame {
    width: 100%;
    height: 520px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.p-digest-run tr[data-status="failed"] td {
    color: var(--danger-color);
}
@media (max-width: 480px) {
    .p-digest-run__result { align-items: flex-start; text-align: left; }
}

/* My Property: Requests and approvals (2026-10-08). One <details> per
   request; the summary carries type, who/when and the outcome badge. */
.p-badge--danger {
    border-color: var(--danger-color);
    color: var(--danger-color);
}
.p-requests {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
}
.p-request {
    border-bottom: 1px solid var(--border-color);
}
.p-request__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
}
.p-request__summary::-webkit-details-marker {
    display: none;
}
.p-request__summary::before {
    content: "";
    flex: none;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid var(--text-light);
    border-bottom: 2px solid var(--text-light);
    transform: rotate(-45deg);
    transition: transform 0.15s;
}
.p-request__details[open] > .p-request__summary::before {
    transform: translateY(-2px) rotate(45deg);
}
.p-request__summary:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
.p-request__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.p-request__type {
    font-weight: 600;
    color: var(--text-dark);
}
.p-request__body {
    padding: 0 0 var(--space-lg) calc(0.5rem + var(--space-md));
    max-width: 68ch;
}
.p-request__label {
    margin: var(--space-md) 0 var(--space-xs);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-light);
}
.p-request__label:first-child {
    margin-top: 0;
}
.p-request__text {
    margin: 0;
    white-space: pre-line;
    overflow-wrap: anywhere;
}
@media (prefers-reduced-motion: reduce) {
    .p-request__summary::before {
        transition: none;
    }
}

/* Admin request detail: Property line and household note (2026-10-08). */
.meta-item--property {
    grid-column: 1 / -1;
    gap: var(--space-xs);
}
.rp-how,
.rp-typed {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-light);
}
.rp-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xs);
}
.rp-select {
    flex: 1 1 16rem;
    max-width: 28rem;
    min-height: 44px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font: inherit;
}
.rp-actions {
    display: flex;
    gap: var(--space-sm);
}
.rp-note {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font: inherit;
    resize: vertical;
}
.filter-tab__count {
    font-weight: 600;
}

/* Member directory (2026-10-08). */
#directory {
    scroll-margin-top: 8rem; /* clear the sticky header + member bar */
}
.p-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
.p-directory-you {
    margin-bottom: var(--space-xl);
}
.p-directory-you__title {
    margin-bottom: var(--space-xs);
    font-size: 1rem;
}
.p-directory-you .p-text {
    margin: 0;
}
.p-directory-search {
    max-width: 28rem;
}
.p-directory-table td a {
    overflow-wrap: anywhere;
}
/* My Account: email/phone choices sit under "List me", indented. */
.p-directory-sub {
    margin-left: calc(44px + var(--space-md));
}
.p-directory-sub.is-off .p-label {
    color: var(--text-light);
}

/* Documents page search (2026-10-08). */
.p-doc-search {
    max-width: 28rem;
    margin-bottom: var(--space-md);
}

/* ------------------------------------------------------------------ */
/* Member area inside the main site header (owner feedback 2026-10-08)  */
/* The site row is the public .main-nav as-is (new-style.css). The      */
/* member bar is a flat row of links under it: every member page is     */
/* visible at once; on a phone the row scrolls sideways.                */
/* ------------------------------------------------------------------ */
.site-member-nav .nav-menu a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 4px;
}
.member-bar {
    border-top: 1px solid var(--border-color);
    background: var(--surface);
}
.member-bar__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    min-height: 52px;
}
.member-bar__nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.member-bar__nav::-webkit-scrollbar {
    display: none;
}
.member-bar__list {
    display: flex;
    gap: var(--space-xs);
    list-style: none;
    margin: 0;
    padding: 0;
}
.member-bar__link {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: 0 var(--space-md);
    border-bottom: 3px solid transparent;
    color: var(--text-dark);
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s ease-out, border-color 0.2s ease-out;
}
.member-bar__list li:first-child .member-bar__link {
    padding-left: 0;
}
.member-bar__link:hover {
    color: var(--primary-color);
}
.member-bar__link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}
.member-bar__link:focus-visible,
.member-bar__switch:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}
/* Admin area (admins only): the last item, set apart by a hairline divider,
   muted text and the new-tab icon; it takes the accent on hover like the rest. */
.member-bar__admin {
    display: flex;
    align-items: center;
    margin-left: var(--space-sm);
}
.member-bar__admin::before {
    content: "";
    flex: none;
    width: 1px;
    height: 20px;
    margin-right: var(--space-sm);
    background: var(--border-strong);
}
.member-bar__link--admin {
    gap: 6px;
    color: var(--text-light);
    font-size: 0.9375rem;
}
.member-bar__link--admin .p-file-link__icon {
    width: 14px;
    height: 14px;
}
.member-bar__account {
    display: flex;
    flex: none;
    align-items: center;
    gap: var(--space-md);
}
.member-bar__account .current-user-nav {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.member-bar__switch {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    white-space: nowrap;
}
.member-bar__account .btn-logout-nav {
    min-height: 36px;
    padding: 0.35rem 0.8rem;
    white-space: nowrap;
}
.member-bar__account .btn-logout-nav:disabled,
.member-bar__account .btn-logout-nav[aria-busy="true"] {
    opacity: 0.6;
    cursor: progress;
}
@media (max-width: 1100px) {
    .member-bar__account .current-user-nav {
        display: none;
    }
}
@media (max-width: 768px) {
    .member-bar__inner {
        flex-wrap: wrap;
        gap: 0 var(--space-md);
        padding: 0 16px;
    }
    .member-bar__nav {
        flex-basis: 100%;
    }
    .member-bar__account {
        flex-basis: 100%;
        justify-content: flex-end;
        padding: var(--space-xs) 0 var(--space-sm);
        border-top: 1px solid var(--border-color);
    }
}

/* Admin area header: its own flat row (no site menu, no member pages). */
.portal-nav-switch a {
    font-weight: 600;
}
@media (min-width: 1025px) and (max-width: 1379px) {
    .portal-nav--admin .nav-menu {
        gap: var(--space-md);
    }
}
