/* ==========================================================================
   Wash42 Investor Portal — design system v2 "Vagabond"
   Source of truth: official Wash42 palette + the Vagabond app theme
   (vagabond-frontend src/theme/index.ts). Inter throughout; headlines are
   Inter 900 italic. Light theme default; dark via html[data-theme="dark"].
   ========================================================================== */

:root {
    /* Official palette */
    --brand:        #80BC00;
    /* The brand green stays exactly this, everywhere. What changes is the ink on
       top of it: WHITE on --brand measures 2.30:1 and white on --brand-dark is
       only 4.18:1, both under the 4.5:1 minimum for text below 18.66px. --onyx
       on --brand is 6.51:1, which is why every green fill carries --onyx text -
       the pattern .ad-chip .ad-avatar in admin.css already used. */
    --brand-dark:   #4A8B2C;
    --yellow-green: #DAE343;
    --cool-dark:    #323E48;
    --cool-gray:    #415364;
    --soft-gray:    #D9D8D6;
    --onyx:         #24272A;

    /* Light surfaces (default) */
    --bg:            #F6F7F7;
    --surface:       #FFFFFF;
    --surface-muted: #F2F2F2;
    --line:          #E4E7E9;
    --text:          #323E48;
    --text-2:        #415364;
    --text-muted:    #5E6C78;
    --shadow-card:   0 2px 6px rgba(50,62,72,.06), 0 10px 28px rgba(50,62,72,.07);
    --shadow-pop:    0 4px 10px rgba(50,62,72,.07), 0 18px 44px rgba(50,62,72,.10);
    --live-text:     #24272A;
    /* Ink for text on the PALE green wash (#E8F5D0 and the color-mix tint).
       --brand-dark on that wash is only 3.67:1; this is 6.96:1. .pt-message
       already used this exact value, so the tags now match it. */
    --brand-ink:     #3A5A00;
    --hl-bg:         #DAE343;
    --hl-text:       #3A4400;

    --font: 'Inter', 'Segoe UI', sans-serif;
    --radius:      16px;
    --radius-lg:   20px;
    --radius-hero: 24px;
    --pill:        999px;
}

html[data-theme="dark"] {
    --bg:            #24272A;
    --surface:       #323E48;
    --surface-muted: #3B4653;
    --line:          #46525E;
    --text:          #F2F5F7;
    --text-2:        #C3CDD5;
    --text-muted:    #8D9AA5;
    --shadow-card:   0 2px 6px rgba(0,0,0,.25), 0 10px 28px rgba(0,0,0,.28);
    --shadow-pop:    0 4px 10px rgba(0,0,0,.3), 0 18px 44px rgba(0,0,0,.38);
    --hl-bg:         #DAE343;
    --hl-text:       #3A4400;
}

/* Base ------------------------------------------------------------------ */

/* Sticky footer. The page is a column: topbar, <main class="pt-main"> (opened at
   the end of header.php, closed in footer.php), footer. Main takes the spare
   height, so on a short page the footer sits at the bottom of the viewport and
   on a long page it follows the content. Main grows rather than the footer's
   margin so the 56px gap above the footer survives on long pages. */
html { height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

.pt-main { flex: 1 0 auto; }

a { color: var(--brand-dark); }
html[data-theme="dark"] a { color: var(--brand); }

/* Anchors styled as buttons/pills must not inherit link colors (incl. dark mode) */
a.pt-btn, html[data-theme="dark"] a.pt-btn { color: var(--onyx); }
a.pt-pill-btn, html[data-theme="dark"] a.pt-pill-btn { color: var(--text-2); }
a.pt-pill-btn.is-active, html[data-theme="dark"] a.pt-pill-btn.is-active { color: var(--onyx); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

::selection { background: var(--brand); color: var(--onyx); }

/* Shell: topbar / nav / footer ------------------------------------------- */

.pt-topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pt-topbar .logo { height: 40px; width: auto; display: block; }

.pt-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }

.pt-nav a {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    padding: 9px 13px;
    border-radius: var(--pill);
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.pt-nav a:hover { background: var(--surface-muted); color: var(--text); }

.pt-nav a.is-active { background: var(--brand); color: var(--onyx); }

.pt-nav a.pt-nav-exit { color: var(--text-muted); }
.pt-nav a.pt-nav-exit:hover { background: var(--surface-muted); color: var(--text); }

/* Logout is a POST form so a prefetcher cannot trigger it. These rules mirror
   .pt-nav a exactly, so it still reads as the nav link it replaced. */
.pt-nav .pt-nav-exit-form { display: flex; align-items: center; margin: 0; }

.pt-nav .pt-nav-exit-form button.pt-nav-exit {
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: 0;
    padding: 9px 13px;
    border-radius: var(--pill);
    transition: background .15s, color .15s;
    white-space: nowrap;
    cursor: pointer;
}

.pt-nav .pt-nav-exit-form button.pt-nav-exit:hover { background: var(--surface-muted); color: var(--text); }

.pt-theme-btn {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 8px 14px;
    cursor: pointer;
    margin-left: 6px;
    transition: background .15s;
}
.pt-theme-btn:hover { background: var(--line); }

.pt-footer {
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1px solid var(--line);
    color: var(--text-2);
    margin-top: 56px;
    padding: 26px 24px 30px;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
}

.pt-footer a { color: var(--brand-dark); text-decoration: none; font-weight: 600; }
html[data-theme="dark"] .pt-footer a { color: var(--brand); }
.pt-footer a:hover { text-decoration: underline; }

.pt-footer .pt-legal {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 720px;
    margin: 10px auto 0;
}

/* Admin control centre ---------------------------------------------------- */

/* Shown only while admin/view_portal.php has put the session into view mode;
   footer.php renders it. It replaced a full-width banner, which took a strip off
   every page to say one thing: a pill in the corner states the mode, and the
   panel it opens carries the investor picker and the way out.

   Fixed bottom-left. On a phone it lifts clear of the 76px tab bar plus the
   home-indicator inset, so the two never argue about the bottom of the screen. */
.pt-ctl {
    position: fixed;
    left: 16px;
    bottom: 16px;
    /* Above the tab bar (40) and the More sheet (60), so the way out of view mode
       is never behind anything. Still under the idle warning (999), which is
       time-critical, and the lightbox (9999), which is meant to cover the page. */
    z-index: 70;
    font-size: 13px;
}

.pt-ctl-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(70vw, 260px);
    /* The 44px floor every other control took on in investorportal-fjj. */
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    background: var(--surface);
    color: var(--text);
    font: 600 13px/1 var(--font);
    box-shadow: var(--shadow-pop);
    cursor: pointer;
}

/* The investor's name can be long; the pill must not grow across the page. */
.pt-ctl-pill > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The mode signal, reduced to a dot. --hl-bg is the same yellow-green the old
   banner used, so the cue survives without a strip across every page. */
.pt-ctl-dot {
    flex: none;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--hl-bg);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hl-bg) 30%, transparent);
}

.pt-ctl-panel {
    display: none;
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    box-sizing: border-box;
    /* A fixed width, not max-content: the search filters rows as you type, and
       a max-content panel would change width on every keystroke. */
    width: min(78vw, 280px);
    max-height: 60vh;
    /* The panel itself never scrolls - only .pt-ctl-list does - so the head,
       the status block, the search and "Back to admin" stay in view with 500
       investors. */
    overflow: hidden;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
}

.pt-ctl-panel.is-open { display: flex; flex-direction: column; }

.pt-ctl-group {
    margin: 6px 0 2px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Who the page is being viewed as. Plain text, not a button: it is the status,
   and the rows below it are the actions. */
.pt-ctl-now {
    flex: none;
    padding: 2px 0 8px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.pt-ctl-now .pt-ctl-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pt-ctl-badge {
    padding: 2px 8px;
    border-radius: var(--pill);
    background: var(--surface-muted);
    color: var(--text-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.pt-ctl-who {
    margin: 4px 0 0;
    padding: 0 12px;
    font: 700 15px/1.3 var(--font);
    color: var(--text);
    overflow-wrap: anywhere;
}

.pt-ctl-who small {
    display: block;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
}

.pt-ctl-form { margin: 0; flex: none; }

/* "View as investor" while its picker is open. No chevron - the design keeps
   arrows off the page - so the open state is carried by the background. */
.pt-ctl-toggle[aria-expanded="true"] { background: var(--surface-muted); }

/* The search, the list and the empty note. A flex column that may shrink, so
   the list inside it is what scrolls. */
.pt-ctl-pick {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* The investor rows: the one part of the panel that scrolls. min-height: 0 lets a
   flex child shrink below its content, which is what makes overflow engage. */
.pt-ctl-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pt-ctl-search {
    flex: none;
    box-sizing: border-box;
    width: calc(100% - 8px);
    min-height: 44px;
    margin: 4px 4px 6px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    /* 16px, not the panel's 13px: iOS Safari zooms the page on focusing any
       field set smaller than 16px. */
    font: 500 16px/1 var(--font);
}

.pt-ctl-search:focus-visible {
    outline: 2px solid var(--brand-dark);
    outline-offset: -2px;
}

.pt-ctl-empty {
    flex: none;
    margin: 0;
    padding: 10px 12px;
    color: var(--text-muted);
}

/* .pt-ctl-row sets display:flex, which beats the UA's [hidden] rule; without this
   a filtered-out row would stay on screen. */
.pt-ctl-row[hidden],
.pt-ctl-pick[hidden],
.pt-ctl-search[hidden],
.pt-ctl-empty[hidden] { display: none; }

.pt-ctl-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    font: 600 13.5px/1.3 var(--font);
    text-align: left;
    cursor: pointer;
}

.pt-ctl-row small {
    font-weight: 500;
    font-size: 11.5px;
    color: var(--text-muted);
}

.pt-ctl-row:hover { background: var(--surface-muted); }

.pt-ctl-row:focus-visible {
    outline: 2px solid var(--brand-dark);
    outline-offset: -2px;
}

.pt-ctl-exit {
    margin-top: 4px;
    border-top: 1px solid var(--line);
    border-radius: 0 0 10px 10px;
    color: var(--text-2);
}

@media (max-width: 640px) {
    /* Clear of the 76px tab bar and the home-indicator inset below it. */
    .pt-ctl { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

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

.pt-wrap {
    max-width: 1180px;
    margin: 34px auto 0;
    padding: 0 22px;
}

.pt-page-head { margin: 0 0 24px; }

.pt-eyebrow {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--brand-dark);
    margin: 0 0 6px;
}
html[data-theme="dark"] .pt-eyebrow { color: var(--brand); }

.pt-page-head h1 {
    font-weight: 900;
    font-style: italic;
    font-size: clamp(27px, 3.2vw, 34px);
    letter-spacing: -.02em;
    color: var(--text);
    margin: 0;
}

.pt-page-head .pt-sub { color: var(--text-2); font-size: 15px; margin: 6px 0 0; }

.pt-grid { display: grid; gap: 18px; }
.pt-grid-main { grid-template-columns: 7fr 5fr; align-items: stretch; }

/* Stats ------------------------------------------------------------------- */

.pt-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin: 0 0 22px;
}

.pt-stat {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}

.pt-stat .k {
    font-size: 11.5px;
    letter-spacing: .06em;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin: 0 0 8px;
}

.pt-stat .v {
    font-weight: 900;
    font-size: 25px;
    letter-spacing: -.02em;
    color: var(--text);
    margin: 0;
}

.pt-stat .v em { font-style: normal; color: var(--brand-dark); font-size: 13px; font-weight: 600; margin-left: 6px; }
html[data-theme="dark"] .pt-stat .v em { color: var(--brand); }

/* No highlighted stat. A filled #DAE343 panel sitting next to three plain ones
   pulled the eye to whichever number happened to carry the class, and at panel
   size that yellow-green goes muddy - it is a stroke and label colour in the
   Wash42 palette, never a fill. All four stats now read as equals. */

/* Panels ------------------------------------------------------------------ */

.pt-panel {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px 26px;
}

.pt-panel h2 {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -.01em;
    color: var(--text);
    margin: 0 0 12px;
}

.pt-panel p { line-height: 1.65; margin: 10px 0; color: var(--text-2); font-size: 14.5px; }

/* Buttons / inputs ---------------------------------------------------------- */

.pt-btn {
    display: inline-block;
    width: 100%;
    /* Required because this rule sets width:100% AND horizontal padding, and the
       stylesheet has no global box-sizing reset. Browsers default <button> to
       border-box, so the form buttons always fitted; an <a class="pt-btn"> is
       content-box by default and rendered 40px wider than its container,
       overflowing the card on admin/index.php. */
    box-sizing: border-box;
    padding: 15px 20px;
    background: var(--brand);
    color: var(--onyx);
    border: none;
    border-radius: var(--pill);
    font-family: var(--font);
    font-weight: 700;
    font-size: 15.5px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(128,188,0,.35);
    transition: filter .15s, transform .1s;
}

.pt-btn:hover { filter: brightness(1.05); }
.pt-btn:active { transform: translateY(1px); }

.pt-input {
    width: 100%;
    box-sizing: border-box;
    padding: 14px 16px;
    margin: 7px 0;
    background: var(--surface-muted);
    border: none;
    border-radius: 12px;
    font-family: var(--font);
    font-size: 14.5px;
    color: var(--text);
    transition: box-shadow .15s, background .15s;
}

.pt-input::placeholder { color: var(--text-muted); }

.pt-input:focus {
    outline: none;
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(128,188,0,.35);
}

/* Dashboard building blocks ---------------------------------------------------- */


.pt-section-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 22px 0 8px;
}
.pt-panel .pt-section-label:first-child, .pt-panel h2 + .pt-section-label { margin-top: 14px; }

.pt-docrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--line);
}
.pt-docrow:last-child { border-bottom: none; }
.pt-docrow .pt-docrow-name { min-width: 0; }
.pt-docrow .pt-docrow-name a {
    font-weight: 600;
    font-size: 14.5px;
    text-decoration: none;
    color: var(--brand-dark);
}
html[data-theme="dark"] .pt-docrow .pt-docrow-name a { color: var(--brand); }
.pt-docrow .pt-docrow-name a:hover { text-decoration: underline; }
.pt-docrow .pt-docrow-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
}


/* Live camera tiles ---------------------------------------------------------- */

.pt-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.pt-tile {
    position: relative;
    display: block;
    background: var(--surface-muted);
    border-radius: var(--radius);
    padding: 16px 16px 46px;
    text-decoration: none;
    transition: transform .16s, box-shadow .16s, background .16s;
}

.pt-tile:hover {
    transform: translateY(-2px);
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(50,62,72,.14);
}
html[data-theme="dark"] .pt-tile:hover { box-shadow: 0 12px 30px rgba(0,0,0,.4); }

.pt-tile .pt-cam {
    font-size: 11px;
    letter-spacing: .07em;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    margin: 0 0 7px;
}

.pt-tile .pt-tile-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin: 0 0 4px;
}

.pt-tile .pt-tile-desc {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-2);
    margin: 0;
}

.pt-live {
    position: absolute;
    left: 16px;
    bottom: 13px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--live-text);
    background: var(--brand);
    padding: 4px 11px;
    border-radius: var(--pill);
}

.pt-live::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FFFFFF;
    animation: pt-pulse 1.8s infinite;
}

@keyframes pt-pulse { 50% { opacity: .35; } }

/* Tags / messages ------------------------------------------------------------ */

.pt-tag {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--brand-ink);
    background: #E8F5D0;
    padding: 4px 11px;
    border-radius: var(--pill);
}
html[data-theme="dark"] .pt-tag { background: rgba(128,188,0,.18); color: var(--brand); }

.pt-error, .pt-message {
    padding: 13px 15px;
    border-radius: 12px;
    font-size: 14px;
    margin: 16px 0;
    text-align: left;
}
.pt-error   { background: var(--surface-muted); color: var(--text); border-left: 4px solid var(--onyx); }
.pt-message { background: #E8F5D0; color: var(--brand-ink); border-left: 4px solid var(--brand); }
html[data-theme="dark"] .pt-message { background: rgba(128,188,0,.15); color: var(--brand); }

/* Small print ------------------------------------------------------------------ */
/* Operating notes and disclaimers under a panel's content. Quiet on purpose:
   footer-legal size, muted ink, upright - italic is a headline voice in this
   system and pulls the eye. The .pt-panel selector outranks .pt-panel p. */
.pt-note,
.pt-panel .pt-note {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

/* Documents library ------------------------------------------------------------ */
/* One list instead of two panels. The eye anchors on a page-shaped type tile;
   the name is dark like any other text, and green is spent only on the tile's
   folded corner, the New marker and the View pill's hover. */

.pt-doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    margin: -6px 0 18px;
}

/* Audience: a segmented control, because it is one choice among three. */
.pt-seg {
    display: inline-flex;
    padding: 3px;
    background: var(--surface-muted);
    border-radius: var(--pill);
}
.pt-seg button {
    border: 0;
    background: transparent;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    padding: 7px 14px;
    border-radius: var(--pill);
    cursor: pointer;
}
.pt-seg button em { font-style: normal; color: var(--text-muted); margin-left: 5px; }
.pt-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.pt-seg button[aria-pressed="true"] em { color: var(--brand-dark); }
html[data-theme="dark"] .pt-seg button[aria-pressed="true"] em { color: var(--brand); }

/* Type: one chip at a time, "All types" included. Selected = brand fill, the
   same active state .pt-pill-btn.is-active uses on other pages. */
.pt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-chip {
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 6px 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.pt-chip em { font-style: normal; color: var(--text-muted); margin-left: 4px; }
.pt-chip:hover { background: var(--surface-muted); color: var(--text); }
.pt-chip[aria-pressed="true"], .pt-chip[aria-pressed="true"]:hover { background: var(--brand); border-color: var(--brand); color: var(--onyx); }
.pt-chip[aria-pressed="true"] em { color: rgba(255, 255, 255, .85); }

/* Search sits with the segmented control on the right; both stay compact. */
.pt-doc-tools { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.pt-doc-search {
    width: 230px;
    box-sizing: border-box;
    padding: 8px 14px;
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--pill);
}
.pt-doc-search::placeholder { color: var(--text-muted); }
.pt-doc-search:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

.pt-panel.pt-doc-library { padding: 10px 26px 16px; }

.pt-doc-group { padding: 12px 0 6px; border-top: 1px solid var(--line); }
.pt-doc-group:first-child, .pt-doc-group.is-first-visible { border-top: 0; }   /* the script marks the first group still showing */
.pt-doc-library .pt-doc-group-title {
    margin: 6px 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.pt-doc-library .pt-doc-group-title em { font-style: normal; font-weight: 600; margin-left: 6px; }

/* The whole row is the link. Outrank the theme's anchor colours so the text
   stays ink-coloured in both modes. */
a.pt-doc-item, html[data-theme="dark"] a.pt-doc-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 11px 10px;
    margin: 0 -10px;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background .15s;
}
.pt-doc-item:hover, .pt-doc-item:focus-visible { background: var(--surface-muted); }
/* !important on purpose: the dark-theme anchor rule above has higher specificity
   than a plain [hidden] selector, which left filtered rows visible in dark mode. */
.pt-doc-library [hidden] { display: none !important; }

/* Page-shaped tile: the clipped corner says "document" without an icon font;
   the turned corner is the one brand-green mark per row. */
.pt-doc-tile {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 46px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 6px;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    clip-path: polygon(0 0, 70% 0, 100% 24%, 100% 100%, 0 100%);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--text);
}
.pt-doc-tile::after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 30%;
    height: 24%;
    background: var(--brand);
    clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.pt-doc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pt-doc-name { font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--text); }
.pt-doc-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
}
.pt-doc-pill {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 2px 8px;
    border-radius: var(--pill);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    color: var(--text-2);
}
.pt-doc-new { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--brand-dark); }
html[data-theme="dark"] .pt-doc-new { color: var(--brand); }
.pt-doc-new::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.pt-doc-open {
    flex: 0 0 auto;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 6px 13px;
    transition: background .15s, color .15s, border-color .15s;
}
.pt-doc-item:hover .pt-doc-open, .pt-doc-item:focus-visible .pt-doc-open { background: var(--brand); border-color: var(--brand); color: var(--onyx); }

/* "Show all N" under a collapsed group; indented to the name column (tile + gap). */
.pt-doc-more {
    display: inline-block;
    margin: 6px 0 4px 54px;
    padding: 6px 12px;
    font-family: var(--font);
    font-size: 12.5px;
    font-weight: 700;
    color: var(--brand-dark);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--pill);
    cursor: pointer;
}
html[data-theme="dark"] .pt-doc-more { color: var(--brand); }
.pt-doc-more:hover { background: var(--surface-muted); }

.pt-doc-empty { text-align: center; padding: 28px 12px 24px; color: var(--text-2); }
.pt-doc-library .pt-doc-empty p { margin: 0 0 8px; color: var(--text-2); }
.pt-doc-empty strong { color: var(--text); }

@media (max-width: 640px) {
    .pt-doc-toolbar { flex-direction: column; align-items: stretch; }
    .pt-doc-tools { flex-direction: column; align-items: stretch; margin-left: 0; }
    .pt-doc-search { width: 100%; }
    .pt-seg { display: flex; }
    .pt-seg button { flex: 1; }
    .pt-doc-open { display: none; }
}
/* Investor home --------------------------------------------------------------- */
/* Same arrangement as production, different skin. Two equal columns: the left
   stacks the welcome note over the live-stream panel; the right holds the
   mission poster. The poster is 3:4 portrait and always fills its column width,
   so it sets the row height and is never squeezed - the streams panel grows to
   meet its bottom edge instead. */

.pt-home {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: stretch;
    margin: 0 0 30px;
}

.pt-home-left {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.pt-home-left .pt-panel:last-child { flex: 1; }

/* The wrapper is stretched by the grid; the panel must fill the wrapper too, or
   its bottom edge stops short of the left column (seen at 1440px). */
.pt-home-right { display: flex; flex-direction: column; }
.pt-home-right .pt-panel { flex: 1; }

.pt-home-welcome p { margin: 0; font-size: 15px; }

/* Four cameras as a 2x2 inside the panel; never a 3+1 orphan row. */
.pt-home-tiles { grid-template-columns: 1fr 1fr; margin-top: 18px; }

/* No frame around the poster. The panel takes the poster's own ground colour
   (#333F48, sampled from its edges) in BOTH themes, with zero padding, so the
   card reads as one tall poster rather than a picture in a white box. It is
   top-aligned: the truck photo bleeds to the top edge, but the sides and bottom
   are solid, so any spare column height falls below it without a seam. */
.pt-home-poster {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    background: #333F48;
}
html[data-theme="dark"] .pt-home-poster { background: #333F48; }
.pt-home-poster a { display: block; width: 100%; }
.pt-home-poster a:focus-visible { outline-offset: -4px; }
.pt-home-poster img {
    display: block;
    width: 100%;
    height: auto;
}

/* Was its own 880px query; folded into `tab`. The collapse point moves 60px
   inside the tablet band and nothing changes on a phone or at desktop width. */
@media (max-width: 820px) {
    .pt-home { grid-template-columns: 1fr; }
    .pt-home-left .pt-panel:last-child { flex: none; }
}
/* Was its own 540px query; folded into `phone`, so the tiles go one-up wherever
   the phone shell is on. Bigger tiles and bigger tap targets between 541 and
   640px, which is the point of the phone pass. */
@media (max-width: 640px) {
    .pt-home-tiles { grid-template-columns: 1fr; }
}
/* Login ----------------------------------------------------------------------- */
/* Auth pages follow the Atlas "Lane Deck" system - see
   ../../atlas/docs/assets/wash42.css and atlas/docs/login.html. Every token
   below is scoped to body.pt-login-body so the signed-in portal is untouched,
   and the ground stays dark in both themes because Lane Deck has no light
   variant to copy. */

body.pt-login-body {
    --ground:  #101214;
    --panel:   #1A1D20;
    --panel-2: #22262A;
    --edge:    #2E3439;
    --ink:     #D9D8D6;
    --ink-hi:  #F2F1EF;
    --ink-lo:  #98A0A4;
    --live:    #80BC00;
    --attn:    #DAE343;
    --deep:    #24272A;

    position: relative;
    min-height: 100vh;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;     /* base body rule is a column; keep the auth card centred as before */
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--ground);
    color: var(--ink);
    font-family: "Chivo", "Helvetica Neue", system-ui, sans-serif;
}

/* The signature: Atlas's contour lines, one picked out in yellow-green. */
.pt-auth-contours {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pt-login-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--edge);
    width: 100%;
    max-width: 410px;
    border-radius: var(--radius-hero);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    text-align: center;
    padding: 38px 34px 32px;
    animation: pt-auth-rise .5s ease-out both;
}

@keyframes pt-auth-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .pt-login-card { animation: none; }
}

.pt-login-card img.logo { height: 120px; width: auto; margin: 0 auto 14px; display: inline-block; }

/* The card is dark in both themes, so the light-ground mark would vanish on it.
   The theme swap at the end of this file uses !important, so these must too. */
.pt-login-body img.pt-logo-light { display: none !important; }
.pt-login-body img.pt-logo-dark  { display: inline-block !important; }

/* The Wash42 logo is itself a bold italic wordmark, so Inter 900 italic here
   put two competing wordmarks in a stack. This takes Atlas's eyebrow treatment
   instead - Chivo, small, wide-tracked caps - so the mark stays the loud thing
   and this reads as the nameplate under it. text-indent offsets the trailing
   letter-space so the centring stays optically true. */
.pt-login-card h1 {
    font-family: "Chivo", "Helvetica Neue", system-ui, sans-serif;
    font-weight: 600;
    font-style: normal;
    font-size: 14px;
    line-height: 1.4;
    letter-spacing: .28em;
    text-indent: .28em;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 14px;
}

.pt-login-body .pt-input {
    background: var(--panel-2);
    border: 1px solid var(--edge);
    border-radius: 10px;
    color: var(--ink-hi);
}

.pt-login-body .pt-input::placeholder { color: var(--ink-lo); }

.pt-login-body .pt-input:focus {
    background: var(--panel-2);
    border-color: var(--attn);
    box-shadow: 0 0 0 3px rgba(218, 227, 67, .25);
}

.pt-login-body .pt-btn {
    margin-top: 6px;
    background: var(--live);
    color: var(--deep);
    border-radius: 10px;
    box-shadow: none;
    font-family: "Chivo", "Helvetica Neue", system-ui, sans-serif;
}

.pt-login-body .pt-btn:hover { background: var(--attn); filter: none; }

.pt-login-body .pt-btn:focus-visible {
    outline: 3px solid var(--attn);
    outline-offset: 3px;
}

.pt-login-body .forgot-link a { color: var(--live); }

.pt-login-body .forgot-link a:focus-visible {
    outline: 2px solid var(--attn);
    outline-offset: 2px;
}

.pt-login-body .pt-error {
    background: rgba(218, 91, 76, .14);
    color: #F0C3BD;
    border-left: 4px solid #DA5B4C;
}

.pt-login-body .pt-message {
    background: rgba(128, 188, 0, .14);
    color: var(--live);
    border-left: 4px solid var(--live);
}

.pt-login-card .pt-disclaimer {
    font-size: 12px;
    line-height: 1.55;
    color: var(--ink-lo);
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--edge);
}

/* Two rows: the rule on its own line, the detail underneath it. */
.pt-login-card .pt-disclaimer strong {
    display: block;
    margin-bottom: 4px;
    color: var(--ink);
}

/* The other auth pages (forgot / reset / set password / logged out) used to
   style their copy with the signed-in portal's light-theme tokens (--text-2,
   --text-muted, --brand-dark), which sit at ~3.5:1 on the dark panel. They now
   share the Lane Deck inks above. */
.pt-login-body a { color: var(--live); font-weight: 600; text-decoration: none; }
.pt-login-body a:hover { text-decoration: underline; }
.pt-login-body a:focus-visible { outline: 2px solid var(--attn); outline-offset: 2px; }

.pt-login-card .pt-auth-lede {
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--ink-lo);
    margin: 0 0 18px;
}

/* Password rules: a real list in two columns, ticked live by assets/js/pt-auth.js
   as the password is typed (hollow ring = still missing, filled = met). */
.pt-login-card .pt-auth-rules {
    list-style: none;
    margin: 10px 0 14px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 12px;
    text-align: left;
    font-size: 13px;
    line-height: 1.45;
    color: var(--ink-lo);
}

.pt-login-card .pt-auth-rules li {
    position: relative;
    padding-left: 18px;
    transition: color .15s;
}

.pt-login-card .pt-auth-rules li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .42em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-lo);
    box-sizing: border-box;
    transition: background .15s, border-color .15s;
}

.pt-login-card .pt-auth-rules li.is-ok { color: var(--ink); }
.pt-login-card .pt-auth-rules li.is-ok::before { background: var(--live); border-color: var(--live); }

/* Submit-time note from pt-auth.js; hidden until a rule fails. */
.pt-login-body .pt-auth-check[hidden] { display: none !important; }

/* Server-side rule failures render as a list inside the error panel. */
.pt-login-body .pt-error ul { margin: 6px 0 0; padding-left: 18px; }
.pt-login-body .pt-error li { margin: 2px 0; }

/* Done state: headline, countdown line, link back. */
.pt-login-card .pt-auth-done {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink-hi);
    margin: 22px 0 8px;
}

.pt-login-card .pt-auth-sub {
    font-size: 14px;
    color: var(--ink-lo);
    margin: 0 0 16px;
}

.pt-login-card .pt-auth-sub .pt-auth-count { color: var(--live); font-weight: 700; }

.pt-login-card .pt-auth-links { margin: 18px 0 0; font-size: 14px; }
.pt-login-card .pt-auth-links .pt-auth-sep { margin: 0 10px; color: var(--ink-lo); }
.pt-login-card .pt-auth-sub .pt-auth-em { color: var(--ink); font-weight: 600; word-break: break-all; }

/* Login page's own link row (was inline in index.php). */
.pt-login-body .forgot-link { margin: 16px 0 0; font-size: 14px; }

/* Password field with a Show / Hide toggle sitting inside the input, and a
   Caps Lock hint that pt-auth.js inserts right after the wrapper. */
.pt-login-body .pt-pw { position: relative; }
.pt-login-body .pt-pw .pt-input { padding-right: 68px; }

.pt-login-body .pt-pw-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 7px 9px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--ink-lo);
    font-family: "Chivo", "Helvetica Neue", system-ui, sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
}

.pt-login-body .pt-pw-toggle:hover { color: var(--ink-hi); }

.pt-login-body .pt-pw-toggle:focus-visible {
    outline: 2px solid var(--attn);
    outline-offset: 1px;
}

.pt-login-body .pt-caps {
    display: none;
    margin: -2px 0 6px;
    font-size: 12.5px;
    text-align: left;
    color: var(--attn);
}

.pt-login-body .pt-caps.is-on { display: block; }

/* Phones: one rule per line, a little less card padding. */
/* Deliberate fourth breakpoint, and the only one: the standalone auth pages.
   They carry their own shell and never include header.php, so they sit outside
   the lap 1023 / tab 820 / phone 640 system the rest of the portal uses. */
@media (max-width: 420px) {
    body.pt-login-body { padding: 16px; }
    .pt-login-card { padding: 30px 22px 26px; }
    .pt-login-card .pt-auth-rules { grid-template-columns: 1fr; }
}

/* Button / pill variants -------------------------------------------------------- */

.pt-btn-inline { width: auto; padding: 11px 22px; font-size: 14px; }

.pt-pill-btn {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--pill);
    padding: 7px 15px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.pt-pill-btn:hover { background: var(--surface-muted); color: var(--text); }
.pt-pill-btn.is-active { background: var(--brand); color: var(--onyx); border-color: var(--brand); }

/* Tables -------------------------------------------------------------------------- */

.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th {
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 600;
}
.pt-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); color: var(--text); }

.pt-empty { color: var(--text-muted); font-style: italic; text-align: center; padding: 18px; }

/* Posts / dates ------------------------------------------------------------------------ */

.pt-date {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--brand-dark);
}
html[data-theme="dark"] .pt-date { color: var(--brand); }

/* Bulletin posts. A post with a photo is a two-column grid: a reading-width
   text column (68ch) on the left, the photo on the right, vertically centred
   so a tall photo frames the text instead of leaving a hole under it. The
   photo keeps its own shape - never cropped - capped at 280px tall, and opens
   in the lightbox below. Text-only posts (no .has-media) stay single column
   at the same reading width, so both kinds of post read as one component. */
.pt-post { margin-bottom: 18px; }
.pt-post.has-media {
    display: grid;
    grid-template-columns: minmax(0, 68ch) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}
.pt-post-body { max-width: 68ch; min-width: 0; }
.pt-post-body p:last-child { margin-bottom: 0; }
.pt-post-media { display: block; text-align: right; line-height: 0; cursor: zoom-in; }
.pt-post-media img {
    display: inline-block;
    max-width: 100%;
    max-height: 280px;
    width: auto;
    height: auto;
    border-radius: 12px;
}
@media (max-width: 820px) {
    .pt-post.has-media { grid-template-columns: 1fr; gap: 16px; }
    .pt-post-media { text-align: left; }
}

.pt-sort-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Lightbox (assets/js/pt-lightbox.js). Any <a data-lightbox href="photo"> opens
   its photo full-screen. The figure is a column: the photo on top, scaled DOWN
   to at most two thirds of the viewport but never above its own pixel size
   (upscaling only blurs small originals - the gallery has 400x300 photos), and
   a translucent caption panel attached below it carrying data-title, data-date
   and the full data-desc text - nothing is clamped; a very long caption
   scrolls. The script sets the figure's width to the photo's rendered width
   (min 480px) so photo and caption share edges; a photo narrower than that
   is centred on the figure's panel colour. Hidden via [hidden]; the !important
   guards against the dark-theme anchor rules outranking it. */
.pt-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(36, 39, 42, .92);
    animation: pt-fade .2s ease;
}
.pt-lightbox[hidden] { display: none !important; }
.pt-lightbox-figure {
    display: flex;
    flex-direction: column;
    width: min(1100px, 100%);
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(50, 62, 72, .78); /* shows beside a photo narrower than the figure */
    box-shadow: 0 18px 60px rgba(0, 0, 0, .5);
    animation: pt-zoom .25s ease;
}
.pt-lightbox-figure img {
    display: block;
    align-self: center;                /* a photo narrower than the figure sits centred */
    width: 100%;
    height: auto;
    max-height: 66vh;
    object-fit: contain;
    background: rgba(50, 62, 72, .78); /* letterbox bars match the caption panel */
}
.pt-lightbox-caption {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 18px 16px;
    background: rgba(50, 62, 72, .78);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    line-height: 1.5;
    text-align: left;
}
.pt-lightbox-caption strong { display: block; font-size: 15px; font-weight: 700; }
.pt-lightbox-caption span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .72); margin-top: 2px; }
.pt-lightbox-caption p {
    margin: 8px 0 0;
    font-size: 13.5px;
    color: rgba(255, 255, 255, .9);
    white-space: pre-line;
}
.pt-lightbox-caption p:empty { display: none; }
.pt-lightbox-close {
    position: absolute;
    top: 18px; right: 18px;
    width: 40px; height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    color: #FFFFFF;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.pt-lightbox-close:hover { background: rgba(255, 255, 255, .34); }
.pt-lightbox-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@keyframes pt-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pt-zoom { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pt-lightbox, .pt-lightbox-figure { animation: none; } }
@media (max-width: 820px) {
    .pt-lightbox { padding: 56px 12px 12px; }
    .pt-lightbox-figure { width: 100%; }
    .pt-lightbox-figure img { max-height: 55vh; }
    .pt-lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 22px; }
    .pt-lightbox-caption { padding: 10px 12px 12px; }
}

/* Card grids (partners, gallery) ---------------------------------------------------------- */

.pt-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.pt-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform .16s, box-shadow .16s;
}
.pt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.pt-card img { width: 100%; height: auto; display: block; }
.pt-card .pt-card-body { padding: 14px 16px 16px; }
.pt-card .pt-card-title { font-weight: 700; font-size: 15px; color: var(--text); margin: 0 0 4px; }
.pt-card .pt-card-sub { font-size: 13px; color: var(--text-2); margin: 0; line-height: 1.5; }

/* Contacts carry their own card CSS inline (contacts.php), like partners.php. */

/* Partners: billboard bands ------------------------------------------------------------ */
/* One full-width band per partner, no cards: a hairline between bands, the photo
   side alternating on an offset green plate, the name set large in the display
   face, Impact as a pull-quote, links as underlined text. Photos are 220px
   squares (object-fit: cover); uploads smaller than that are enlarged a little. */

.pt-band {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 44px;
    align-items: center;
    padding: 40px 0;
    border-top: 1px solid var(--line);
}
.pt-bands > .pt-band:first-child { border-top: 0; padding-top: 6px; }
.pt-bands > .pt-band:nth-child(even) { grid-template-columns: 300px minmax(0, 1fr); }
.pt-bands > .pt-band:nth-child(even) .pt-band-photo { order: -1; }

.pt-band-photo { position: relative; width: 220px; height: 220px; justify-self: center; }
.pt-band-photo::before {
    content: "";
    position: absolute;
    inset: 16px -16px -16px 16px;
    border-radius: 24px;
    background: color-mix(in srgb, var(--brand) 26%, var(--bg));
}
.pt-bands > .pt-band:nth-child(even) .pt-band-photo::before { inset: 16px 16px -16px -16px; }
.pt-band-photo img {
    position: relative;
    display: block;
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: var(--shadow-pop);
}

.pt-band h2 {
    margin: 0 0 10px;
    font-weight: 900;
    font-style: italic;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -.025em;
    color: var(--text);
}
.pt-band .pt-tag {
    display: inline-block;
    margin: 0 0 18px;
    padding: 4px 11px;
    border-radius: var(--pill);
    background: color-mix(in srgb, var(--brand) 16%, transparent);
    color: var(--brand-ink);
    font-size: 12.5px;
    font-weight: 700;
}
html[data-theme="dark"] .pt-band .pt-tag { color: var(--brand); }
.pt-band .pt-bio { margin: 0 0 16px; max-width: 58ch; font-size: 17px; line-height: 1.6; color: var(--text); }
.pt-band .pt-impact { margin: 0 0 20px; max-width: 58ch; padding-left: 16px; border-left: 3px solid var(--brand); font-size: 15px; line-height: 1.6; color: var(--text-2); }
.pt-band .pt-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; font-weight: 600; }
.pt-band .pt-links a {
    color: var(--brand-dark);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-decoration-color: color-mix(in srgb, var(--brand) 45%, transparent);
    text-underline-offset: 4px;
}
.pt-band .pt-links a:hover { text-decoration-color: var(--brand); }
html[data-theme="dark"] .pt-band .pt-links a { color: var(--brand); }

@media (max-width: 820px) {
    .pt-band, .pt-bands > .pt-band:nth-child(even) { grid-template-columns: 1fr; gap: 28px; padding: 30px 0; }
    .pt-band-photo, .pt-bands > .pt-band:nth-child(even) .pt-band-photo { order: -1; justify-self: start; }
    .pt-band h2 { font-size: 28px; }
}

/* Key-value rows (profile) -------------------------------------------------------------- */

.pt-kv {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--line);
    font-size: 14.5px;
}
.pt-kv:last-of-type { border-bottom: none; }
.pt-kv .k { color: var(--text-muted); font-weight: 600; font-size: 13px; flex-shrink: 0; }
.pt-kv .v { color: var(--text); text-align: right; word-break: break-word; }

/* Theme-dependent logo swap — last in file so it wins over sizing display rules */

img.pt-logo-dark { display: none !important; }
html[data-theme="dark"] img.pt-logo-dark  { display: block !important; }
html[data-theme="dark"] img.pt-logo-light { display: none !important; }
html[data-theme="dark"] .pt-login-card img.pt-logo-dark { display: inline-block !important; }

/* Motion & responsive ----------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

@media (max-width: 820px) {
    /* Was its own 960px query; folded into `tab`. */
    .pt-grid-main { grid-template-columns: 1fr; }
    .pt-stats { grid-template-columns: 1fr 1fr; }

    .pt-topbar { padding: 10px 14px; }
    .pt-nav a,
    .pt-nav .pt-nav-exit-form button.pt-nav-exit { padding: 8px 11px; font-size: 13px; }
    .pt-wrap { margin-top: 24px; padding: 0 16px; }
    .pt-panel { padding: 20px; }
}

/* Idle-timeout warning. Fixed to the viewport corner so it cannot push page
   content around while someone is mid-read. */
.pt-idle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    display: none;
    max-width: min(360px, calc(100vw - 32px));
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    border-left: 4px solid var(--attn, #C8452F);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
}
.pt-idle.is-open { display: block; }
.pt-idle-msg { margin: 0 0 12px; font-size: 15px; line-height: 1.45; }
.pt-idle-left { font-variant-numeric: tabular-nums; font-weight: 600; }
.pt-idle-actions { display: flex; gap: 10px; }
.pt-idle .pt-btn { width: auto; padding: 9px 16px; font-size: 14px; }

/* Busy submit button. */
.pt-btn[disabled] { opacity: .65; cursor: progress; }

/* Was its own 480px query; folded into `phone`. */
@media (max-width: 640px) {
    .pt-idle { left: 16px; right: 16px; max-width: none; }
}

/* Phone shell ------------------------------------------------------------------ */
/* A fixed bottom tab bar replaces the wrapping .pt-nav pills, and the links that
   do not fit move into a bottom sheet. Markup lives in footer.php; behaviour in
   assets/js/pt-nav.js. None of it exists above `phone` - at 641px and up the
   topbar nav is still the navigation and these are display:none. */

.pt-tabbar { display: none; }
.pt-sheet  { display: none; }

@media (max-width: 640px) {
    /* .pt-nav is flex-wrap:wrap with 11 children (9 links + Logout + theme).
       At 390px that wrapped to about four rows, so every page opened with a
       screenful of navigation before any content. */
    .pt-topbar .pt-nav { display: none; }
    .pt-topbar { justify-content: space-between; }

    .pt-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        box-sizing: border-box;
        height: 76px;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        display: flex;
        align-items: stretch;
        background: var(--surface);
        border-top: 1px solid var(--line);
    }

    .pt-tab {
        position: relative;
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        font-family: var(--font);
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1;
        color: var(--text-muted);
        text-decoration: none;
        cursor: pointer;
    }

    .pt-tab.is-on { color: var(--brand-dark); font-weight: 700; }
    html[data-theme="dark"] .pt-tab.is-on { color: var(--brand); }

    .pt-tab.is-on::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 34px;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--brand);
    }

    /* The bar is fixed, so content needs somewhere to scroll past it. */
    .pt-main { padding-bottom: 96px; }
    .pt-footer { margin-bottom: 76px; }

    .pt-sheet { display: block; position: fixed; inset: 0; z-index: 60; visibility: hidden; }
    .pt-sheet.is-open { visibility: visible; }
    .pt-sheet-backdrop { position: absolute; inset: 0; background: rgba(16, 18, 20, .55); }

    .pt-sheet-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        box-sizing: border-box;
        max-height: 82vh;
        overflow-y: auto;
        padding: 10px 16px calc(26px + env(safe-area-inset-bottom, 0px));
        background: var(--surface);
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
        transition: transform .2s ease;
    }

    .pt-sheet.is-open .pt-sheet-panel { transform: none; }

    .pt-sheet-grab {
        display: block;
        width: 38px;
        height: 4px;
        margin: 0 auto 14px;
        border-radius: var(--pill);
        background: var(--soft-gray);
    }

    .pt-sheet-row-form { margin: 0; }

    .pt-sheet-row {
        display: flex;
        align-items: center;
        box-sizing: border-box;
        width: 100%;
        min-height: 52px;
        padding: 0 4px;
        border: 0;
        border-top: 1px solid var(--line);
        background: transparent;
        font-family: var(--font);
        font-size: 15.5px;
        font-weight: 600;
        color: var(--text);
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    /* The theme toggle carries .pt-theme-btn so header.php's script binds it,
       which also drags in that class's pill look. Inside the sheet it is a row
       like any other. */
    .pt-sheet-row.pt-theme-btn {
        margin-left: 0;
        padding: 0 4px;
        background: transparent;
        border: 0;
        border-top: 1px solid var(--line);
        border-radius: 0;
        font-size: 15.5px;
        color: var(--text);
    }
    .pt-sheet-row.pt-theme-btn:hover { background: var(--surface-muted); }

    .pt-sheet-row.is-on { color: var(--brand-dark); }
    html[data-theme="dark"] .pt-sheet-row.is-on { color: var(--brand); }

    .pt-sheet-cancel {
        width: 100%;
        min-height: 50px;
        margin-top: 14px;
        border: 0;
        border-radius: 12px;
        background: var(--surface-muted);
        font-family: var(--font);
        font-size: 15.5px;
        font-weight: 600;
        color: var(--text-2);
        cursor: pointer;
    }

    body.pt-sheet-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    .pt-sheet-panel { transition: none; }
}

/* Touch tap targets ------------------------------------------------------------ */
/* WCAG 2.5.5 asks for 44x44. These controls were all sized for a mouse pointer.
   Scoped to `tab` (820px), not `phone`: a 768px tablet is a touch device too, and
   at 768px the topbar nav is still what people tap. Only sizing changes - nothing
   moves or restyles. Inline links inside a paragraph are exempt (2.5.8) and are
   deliberately left alone, as is the Leaflet attribution line. */

@media (max-width: 820px) {
    .pt-nav a,
    .pt-nav .pt-nav-exit-form button.pt-nav-exit {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .pt-people-lines a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    /* The logo link in the topbar. */
    .pt-topbar > a { display: inline-flex; align-items: center; min-height: 44px; }

    .pt-chip {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    .pt-doc-search { min-height: 44px; }

    .pt-seg button { min-height: 44px; }

    .pt-doc-more {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .pt-pill-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .pt-theme-btn { min-height: 44px; }

    /* Contact rows: the email and phone links are the point of the page. */
    .pt-contact a,
    .pt-band .pt-links a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    /* Leaflet draws its own zoom buttons at 30px. Its stylesheet comes from
       unpkg, so overriding it needs the weight. */
    .leaflet-touch .leaflet-bar a,
    .leaflet-control-zoom-in,
    .leaflet-control-zoom-out {
        width: 44px !important;
        height: 44px !important;
        line-height: 44px !important;
    }
}
