/* ============================================================
   Console chrome - shared navbar (_TeamNav.cshtml) + Team and
   Profile pages. Depends on qs-base.css tokens.
   ============================================================ */

/* ---------- navbar ---------- */

.tn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
}

.tn-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--text);
    flex: none;
}

.tn-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    color: var(--gold-soft);
}

.tn-brand-name {
    font-weight: 700;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
}

.tn-brand-name em {
    font-style: normal;
    color: var(--text-3);
    font-weight: 600;
}

.tn-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.tn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border-radius: var(--r-pill);
    text-decoration: none;
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 160ms var(--ease), color 160ms var(--ease);
    white-space: nowrap;
}

.tn-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.tn-link.is-active {
    background: var(--brand-soft);
    color: var(--brand);
}

.tn-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
}

.tn-profile {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    border-radius: var(--r-pill);
    text-decoration: none;
    transition: background 160ms var(--ease);
    max-width: 220px;
}

.tn-profile:hover,
.tn-profile.is-active {
    background: var(--surface-2);
}

.tn-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold-soft);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    object-fit: cover;
    flex: none;
    overflow: hidden;
}

.tn-profile-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.tn-profile-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tn-profile-role {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent-deep);
}

/* ---------- notification bell ---------- */

.tn-bell {
    position: relative;
    flex: none;
}

.tn-bell-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-3);
    cursor: pointer;
    transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.tn-bell-btn:hover,
.tn-bell-btn[aria-expanded="true"] {
    color: var(--brand);
    border-color: var(--brand);
}

.tn-bell-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--warn, #C0392B);
    color: #FFF;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.tn-bell-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(340px, calc(100vw - 2rem));
    max-height: 420px;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.14));
    z-index: 60;
    overflow: hidden;
}

.tn-bell-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

.tn-bell-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text);
}

.tn-bell-markall {
    border: none;
    background: none;
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: var(--r-sm);
}

.tn-bell-markall:hover { background: var(--brand-soft); }

.tn-bell-list {
    overflow-y: auto;
    padding: 0.25rem;
}

.tn-bell-empty {
    padding: 1.1rem 0.85rem;
    font-size: 0.8125rem;
    color: var(--text-3);
    text-align: center;
}

.tn-bell-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.55rem 0.6rem;
    border-radius: var(--r-sm);
    cursor: pointer;
}

.tn-bell-item:hover { background: var(--surface-2); }

.tn-bell-item.is-unread {
    background: var(--brand-soft);
}

.tn-bell-item.is-unread:hover { filter: brightness(0.98); }

.tn-bell-item + .tn-bell-item { margin-top: 2px; }

.tn-bell-glyph {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--brand);
    font-size: 0.8rem;
    font-weight: 700;
}

.tn-bell-item-main { min-width: 0; flex: 1; }

.tn-bell-item-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.tn-bell-bundle {
    display: inline-block;
    min-width: 16px;
    padding: 0 4px;
    margin-left: 4px;
    border-radius: 999px;
    background: var(--brand);
    color: #FFF;
    font-size: 0.625rem;
    font-weight: 700;
    text-align: center;
    line-height: 16px;
}

.tn-bell-item-body {
    font-size: 0.75rem;
    color: var(--text-2);
    line-height: 1.35;
    margin-top: 1px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.tn-bell-item-time {
    font-size: 0.6875rem;
    color: var(--text-3);
    margin-top: 2px;
}

.tn-bell-accept {
    margin-top: 0.4rem;
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: var(--r-pill);
    background: var(--brand);
    color: #FFF;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.tn-bell-accept:hover { background: var(--brand-hover); }
.tn-bell-accept:disabled { opacity: 0.6; cursor: default; }

.tn-signout { margin: 0; display: inline-flex; }

.tn-signout-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-3);
    cursor: pointer;
    transition: color 160ms var(--ease), border-color 160ms var(--ease);
}

.tn-signout-btn:hover {
    color: var(--warn);
    border-color: var(--warn-border);
}

/* Account cluster (profile + sign out). Inline on desktop; phones reach it from the tab bar. */
.tn-account {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- tablets: the desktop bar, tightened ---------- */

/* Between the phone layout and a full desktop width, five staff links plus the profile do not
   fit one row and used to run under the bell. The link icons and the profile's name go (the
   avatar stays), and the links scroll sideways as a last resort rather than overlapping. */
@media (min-width: 721px) and (max-width: 1100px) {
    .tn { gap: 0.75rem; }
    .tn-links {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tn-links::-webkit-scrollbar { display: none; }
    .tn-link { padding: 0.45rem 0.65rem; }
    .tn-link > svg { display: none; }
    .tn-profile { padding: 0.2rem; }
    .tn-profile-text { display: none; }
}

/* ---------- phones: bottom tab bar + account sheet ---------- */

/* Both live in _TeamNav and only exist at phone width. */
.tn-tabs,
.tn-sheet { display: none; }

@media (max-width: 720px) {
    /* Top bar keeps the brand and the bell; the links and the account move to the tab bar. */
    .tn {
        gap: 0.5rem;
        margin-bottom: 1rem;
    }

    .tn-brand { flex: 1 1 auto; min-width: 0; }
    .tn-links,
    .tn-account { display: none; }

    .tn-bell-btn {
        width: 40px;
        height: 40px;
    }

    /* The panel hangs off a 40px button near the right edge, so anchoring it to that button
       pushes a 340px panel off the left of the screen. Pin it to the viewport instead. */
    .tn-bell-panel {
        position: fixed;
        top: 4.75rem;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        max-height: min(70vh, 520px);
    }

    .tn-bell-item { padding: 0.7rem 0.65rem; }

    .tn-tabs {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        /* Over the page's floating buttons (60), under every dialog (80 and up). */
        z-index: 70;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        align-items: stretch;
        padding: 0.3rem 0.4rem calc(0.3rem + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: saturate(1.6) blur(14px);
        -webkit-backdrop-filter: saturate(1.6) blur(14px);
        border-top: 1px solid var(--border);
        box-shadow: 0 -6px 24px rgba(15, 26, 20, 0.06);
    }

    /* Content must be able to scroll clear of the bar. site.css fixes body at height:100%,
       which would keep this padding inside the first screen while the page overflows past it. */
    body:has(.tn-tabs) {
        height: auto;
        min-height: 100%;
        padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
    }

    .tn-tab {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        min-height: 54px;
        padding: 0.3rem 0.2rem;
        border: none;
        border-radius: var(--r-md);
        background: none;
        color: var(--text-3);
        font: inherit;
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 160ms var(--ease), background 160ms var(--ease);
    }

    .tn-tab:active { background: var(--surface-2); }

    .tn-tab-label {
        font-size: 0.6875rem;
        font-weight: 600;
        letter-spacing: 0.01em;
        line-height: 1.1;
        white-space: nowrap;
    }

    .tn-tab.is-active { color: var(--brand); }
    .tn-tab.is-active .tn-tab-label { font-weight: 700; }

    /* A short bar over the active tab, so the state reads without relying on colour alone. */
    .tn-tab.is-active::before {
        content: "";
        position: absolute;
        top: -0.3rem;
        left: 50%;
        width: 24px;
        height: 3px;
        margin-left: -12px;
        border-radius: 0 0 3px 3px;
        background: var(--brand);
    }

    .tn-tab-icon { position: relative; display: inline-flex; }

    .tn-tab-badge {
        position: absolute;
        top: -4px;
        right: -9px;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--warn);
        color: #FFF;
        font-size: 0.625rem;
        font-weight: 700;
        line-height: 17px;
        text-align: center;
        box-shadow: 0 0 0 2px var(--surface);
    }

    /* "New event" is the one thing a client comes here to start, so it gets the filled mark. */
    .tn-tab-plan-mark {
        display: inline-grid;
        place-items: center;
        width: 30px;
        height: 24px;
        border-radius: var(--r-pill);
        background: var(--brand);
        color: var(--gold-soft);
    }

    .tn-tab-avatar {
        display: inline-grid;
        place-items: center;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
        color: var(--gold-soft);
        font-size: 0.5625rem;
        font-weight: 700;
        object-fit: cover;
        overflow: hidden;
    }

    .tn-tab.is-active .tn-tab-avatar,
    .tn-tab[aria-expanded="true"] .tn-tab-avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand); }

    /* ----- the sheet ----- */

    .tn-sheet {
        position: fixed;
        inset: 0;
        z-index: 230;
        display: block;
    }

    .tn-sheet[hidden] { display: none; }

    .tn-sheet-scrim {
        position: absolute;
        inset: 0;
        background: rgba(9, 18, 12, 0.42);
        opacity: 0;
        transition: opacity 200ms var(--ease);
    }

    .tn-sheet-panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 85vh;
        overflow-y: auto;
        padding: 0.5rem 1rem calc(1rem + env(safe-area-inset-bottom));
        background: var(--surface);
        border-radius: var(--r-xl) var(--r-xl) 0 0;
        box-shadow: 0 -12px 40px rgba(9, 18, 12, 0.22);
        transform: translateY(100%);
        transition: transform 240ms var(--ease);
    }

    .tn-sheet.is-open .tn-sheet-scrim { opacity: 1; }
    .tn-sheet.is-open .tn-sheet-panel { transform: none; }

    html.tn-sheet-open { overflow: hidden; }

    .tn-sheet-grip {
        display: block;
        width: 38px;
        height: 4px;
        margin: 0 auto 0.75rem;
        border-radius: 4px;
        background: var(--border-strong);
    }

    .tn-sheet-who {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.25rem 0.25rem 0.9rem;
        border-bottom: 1px solid var(--border);
    }

    .tn-sheet-avatar {
        width: 44px;
        height: 44px;
        font-size: 0.875rem;
    }

    .tn-sheet-who-text {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-width: 0;
        gap: 0.15rem;
    }

    .tn-sheet-name {
        font-size: 1rem;
        font-weight: 700;
        color: var(--text);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tn-sheet-close {
        display: inline-grid;
        place-items: center;
        width: 40px;
        height: 40px;
        flex: none;
        border: 1px solid var(--border);
        border-radius: 50%;
        background: var(--surface);
        color: var(--text-2);
        cursor: pointer;
    }

    .tn-sheet-list {
        display: flex;
        flex-direction: column;
        padding: 0.5rem 0;
    }

    .tn-sheet-item {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        width: 100%;
        min-height: 50px;
        padding: 0.7rem 0.6rem;
        border: none;
        border-radius: var(--r-md);
        background: none;
        color: var(--text);
        font: inherit;
        font-size: 0.9375rem;
        font-weight: 600;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .tn-sheet-item svg { flex: none; color: var(--text-3); }
    .tn-sheet-item:active,
    .tn-sheet-item.is-active { background: var(--surface-2); }
    .tn-sheet-item.is-active svg { color: var(--brand); }

    .tn-sheet-signout {
        margin: 0;
        padding-top: 0.5rem;
        border-top: 1px solid var(--border);
    }

    .tn-sheet-item-danger,
    .tn-sheet-item-danger svg { color: var(--danger); }
}

@media (max-width: 720px) and (prefers-reduced-motion: reduce) {
    .tn-sheet-scrim,
    .tn-sheet-panel { transition: none; }
}

/* ---------- dashboard: joined-consultant stacks ---------- */

.cq-joined {
    display: inline-flex;
    align-items: center;
}

.cq-joined-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5625rem;
    font-weight: 700;
    color: var(--gold-soft);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    box-shadow: 0 0 0 2px var(--surface);
    object-fit: cover;
    overflow: hidden;
    flex: none;
}

.cq-joined-avatar + .cq-joined-avatar { margin-left: -8px; }

.cq-joined-more {
    background: var(--surface-2);
    color: var(--text-3);
}

.cq-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
}

.cq-row-actions form { margin: 0; display: inline-flex; }

/* ---------- team page ---------- */

.tm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 980px) {
    .tm-grid { grid-template-columns: 1fr; }
}

.tm-member-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
}

.tm-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gold-soft);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    object-fit: cover;
    flex: none;
    overflow: hidden;
}

.tm-member-name {
    font-weight: 700;
    color: var(--text);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tm-member-email {
    font-size: 0.75rem;
    color: var(--text-3);
}

.tm-owner-badge {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-soft);
    background: var(--brand);
    border-radius: var(--r-pill);
    padding: 0.12rem 0.5rem;
}

.tm-role-pill {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: var(--r-pill);
    padding: 0.2rem 0.65rem;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}

.tm-role-pill.is-admin {
    background: var(--brand-soft);
    color: var(--brand);
    border-color: var(--brand);
}

.tm-state {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.tm-state-dot { width: 7px; height: 7px; border-radius: 50%; }
.tm-state.is-active { color: var(--accent-deep); }
.tm-state.is-active .tm-state-dot { background: var(--accent); }
.tm-state.is-disabled { color: var(--warn); }
.tm-state.is-disabled .tm-state-dot { background: var(--warn); }

.tm-actions-cell {
    display: flex;
    gap: 0.4rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.tm-actions-cell form { margin: 0; display: inline-flex; }

/* Phones: one card per teammate instead of a five-column table that scrolls sideways. */
@media (max-width: 720px) {
    .qs .tm-table,
    .qs .tm-table tbody { display: block; }
    .qs .tm-table thead { display: none; }

    .qs .tm-table tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "member role"
            "state joined"
            "actions actions";
        gap: 0.5rem 0.75rem;
        padding: 0.95rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .qs .tm-table tbody tr:last-child { border-bottom: 0; }
    .qs .tm-table tbody tr:hover { background: none; }

    .qs .tm-table tbody td,
    .qs .tm-table tbody td:first-child,
    .qs .tm-table tbody td:last-child {
        padding: 0;
        border: 0;
        min-width: 0;
    }

    .qs .tm-table .tm-td-member { grid-area: member; }
    .qs .tm-table .tm-td-role { grid-area: role; align-self: center; }
    .qs .tm-table .tm-td-state { grid-area: state; padding-left: calc(38px + 0.65rem); }
    .qs .tm-table .tm-td-joined {
        grid-area: joined;
        text-align: right;
        font-size: 0.75rem;
        color: var(--text-3);
    }
    .qs .tm-table .tm-td-joined::before { content: attr(data-label) ": "; }
    .qs .tm-table .tm-td-actions { grid-area: actions; text-align: left; white-space: normal; }
    .qs .tm-table .tm-td-actions:empty { display: none; }

    .tm-member-name { flex-wrap: wrap; }
    .tm-member-email { overflow-wrap: anywhere; }

    .tm-actions-cell { justify-content: stretch; }
    .tm-actions-cell form { flex: 1; }
    .tm-actions-cell .qs-btn { width: 100%; min-height: 40px; }
}

/* invite card */

.tm-invite-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.tm-invite-sub {
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    color: var(--text-3);
    line-height: 1.45;
}

.tm-field { margin-bottom: 0.85rem; }

.tm-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.3rem;
}

.tm-field input,
.tm-field select {
    width: 100%;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    padding: 0.6rem 0.75rem;
    font: inherit;
    font-size: 0.875rem;
}

.tm-field input:focus,
.tm-field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.tm-field-hint {
    margin-top: 0.3rem;
    font-size: 0.6875rem;
    color: var(--text-4);
}

/* ---------- profile page ---------- */

.pf-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 980px) {
    .pf-grid { grid-template-columns: 1fr; }
}

.pf-stack {
    display: grid;
    gap: 1.25rem;
    min-width: 0;
}

/* Sign-in details card */

.pf-signin { scroll-margin-top: 1rem; }

.pf-sub {
    margin: 1.25rem 0 0.35rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
}

.pf-note {
    margin: 0 0 0.85rem;
    font-size: 0.8125rem;
    color: var(--text-3);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.pf-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}

.pf-steps li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
}

/* An empty ring to do, a filled tick when done. */
.pf-steps li::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    box-sizing: border-box;
}

.pf-steps li.is-done { color: var(--text-3); text-decoration: line-through; }

.pf-steps li.is-done::before {
    border-color: var(--brand);
    background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.pf-pending {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--r-sm);
    border: 1px solid var(--info-border);
    background: var(--info-bg);
    color: var(--info);
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .pf-pending { flex-direction: column; align-items: flex-start; }
}

.pf-photo-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    text-align: center;
}

.pf-avatar {
    width: 148px;
    height: 148px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--gold-soft);
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
    object-fit: cover;
    overflow: hidden;
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--border-strong);
}

.pf-photo-hint {
    font-size: 0.75rem;
    color: var(--text-3);
    line-height: 1.5;
    max-width: 34ch;
}

.pf-file-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: center;
}

.pf-file-row input[type="file"] {
    font-size: 0.8125rem;
    max-width: 100%;
}

/* Count of reports carrying something unread, on the Support nav link. Small and tinted rather
   than a solid alert dot: it is a nudge, not an alarm. */
.tn-link-badge {
    display: inline-grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--warn, #C0392B);
    color: #FFF;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1;
    flex: none;
}

.tn-link.is-active .tn-link-badge { background: var(--brand); color: #FFF; }

/* AI settings: Claude keys in the order Rory tries them. */
.ai-keys {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    counter-reset: ai-key;
}

.ai-key {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.25rem 0.75rem;
    align-items: center;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    counter-increment: ai-key;
}

.ai-key:last-child { border-bottom: 0; }

.ai-key::before {
    content: counter(ai-key);
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-key:first-child::before { background: var(--brand-soft); color: var(--brand); }

.ai-key-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ai-key-meta { font-size: 0.75rem; color: var(--text-3); overflow-wrap: anywhere; }
.ai-key-meta code { font-size: 0.75rem; }
.ai-key .tm-state { margin-top: 0.2rem; font-weight: 500; }
.ai-key .tm-state.is-idle { color: var(--text-3); }
.ai-key .tm-state.is-idle .tm-state-dot { background: var(--border-strong); }
.ai-key .tm-actions-cell { grid-column: 3; grid-row: 1; }

@media (max-width: 720px) {
    .ai-key { grid-template-columns: auto minmax(0, 1fr); }
    .ai-key .tm-actions-cell { grid-column: 1 / -1; grid-row: auto; justify-content: flex-start; }
    .ai-key .tm-actions-cell form { flex: 0 0 auto; }
    .ai-key .tm-actions-cell .qs-btn { width: auto; }
}
