/**
 * OnlySecurity profile kit (`.os-p` namespace).
 *
 * Used by:
 *   - themes/ksec-training/tutor[-v4]/public-profile.php
 *   - themes/ksec-training/tutor/dashboard/settings/profile.php (v3 live)
 *   - themes/ksec-training/tutor-v4/dashboard/account/settings/account.php
 *     (v4: profile editing moved to the Account settings tab; see the
 *      "Tutor v4 account skin" section at the foot of this file)
 *
 * Same 14-token convention as .os-c / .os-a / .os-d / .os-h / .os-lb /
 * .os-t / .os-tp. Goal is zero visual drift between profile pages and
 * the rest of the redesigned platform, a future dark toggle is a
 * single :root variable swap.
 *
 * Course-card grid reuses `.os-a-card` markup verbatim, see
 * onlysecurity_course_archive_render_card() in everywhere/
 * onlysecurity-course-archive-query.php. The dashboard `.os-p-form`
 * fields layer over Tutor's stock `.tutor-form-control` /
 * `.tutor-form-select` classes so Tutor JS keeps working.
 */

/* ============================================================
 * Tokens
 * ============================================================ */
.os-p,
.os-ph-page {
    --os-p-bg: #f7f8fb;
    --os-p-panel: #ffffff;
    --os-p-border: #e5e7eb;
    --os-p-text: #1e293b;
    --os-p-muted: #64748b;
    --os-p-subtle: #94a3b8;
    --os-p-primary: #2F62AF;
    --os-p-primary-soft: rgba(47, 98, 175, 0.10);
    --os-p-gold: #fcb900;
    --os-p-gold-soft: rgba(252, 185, 0, 0.14);
    --os-p-up: #22c55e;
    --os-p-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    --os-p-shadow-lg: 0 4px 16px rgba(15, 23, 42, 0.10);
    --os-p-panel-2: #fafbfd;
    --os-p-on-primary: #ffffff;

    color: var(--os-p-text);
    font-family: inherit;

    /*
     * Shoptimizer wraps every page in `.col-full { display: flex; flex-wrap: wrap }`,
     * which makes our `.os-p` a flex item with shrink-to-content sizing
     * by default. That collapses the `.os-p-body` grid below (1fr+320px)
     * because the grid container never gets full parent width, and the
     * sidebar drops under the main column.
     * Force full-width flex behaviour so the grid math works.
     */
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
}

/* ─────────────────────────────── Dark ────────────────────────────────
 *
 * Keyed on Tutor's `data-tutor-theme`, which is present ONLY on dashboard
 * pages. Verified against production: the public profile at
 * /profile/<user>/ carries `.os-p` markup but no theme attribute, so this
 * block cannot reach it and the public page stays light as designed.
 *
 * `.os-ph-page` joined the token scope above because the profile-hub
 * dashboard pages (skills-credentials, linked-accounts) use `os-p-*`
 * components without an `.os-p` ancestor, so every token was resolving to
 * its literal light fallback and staying white on a dark page.
 *
 * Anything using --os-p-primary as a BACKGROUND must take its label colour
 * from --os-p-on-primary: the dark primary is light, so a white label on it
 * fails. Same trap as the dashboard kit.
 */
[data-tutor-theme="dark"] .os-p,
[data-tutor-theme="dark"] .os-ph-page {
    --os-p-bg: #161b26;
    --os-p-panel: #1c2333;
    --os-p-border: rgba(255, 255, 255, 0.10);
    --os-p-text: #e6edf6;
    --os-p-muted: #9fb0c6;
    --os-p-subtle: #8b9bb0;
    --os-p-primary: #96bdf2;
    --os-p-primary-soft: rgba(150, 189, 242, 0.10);
    --os-p-gold: #ffc93c;
    --os-p-gold-soft: rgba(255, 201, 60, 0.10);
    --os-p-up: #4ade80;
    --os-p-panel-2: #222a3c;
    --os-p-on-primary: #10192b;
    --os-p-shadow: 0 1px 3px rgba(0, 0, 0, 0.40);
    --os-p-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.50);
}

.os-p a { color: var(--os-p-primary); text-decoration: none; }
.os-p a:hover { text-decoration: underline; }

/* Sticky / overflow chain, same as .os-a (some profile sub-views
 * could end up with sidebar elements that need ancestors visible). */
body.tutor-page-public-profile #page,
body.tutor-page-public-profile #content,
body.tutor-page-public-profile .shoptimizer-archive,
body.tutor-page-public-profile .col-full {
    overflow: visible !important;
}

/* ============================================================
 * Public profile page (.os-p-page)
 * ============================================================ */
.os-p-page { padding: 24px 24px 80px; max-width: 1500px; margin: 0 auto; }

/* Hero */
.os-p-hero {
    background: var(--os-p-panel);
    border: 1px solid var(--os-p-border);
    border-radius: 14px;
    padding: 28px;
    box-shadow: var(--os-p-shadow);
    display: grid;
    grid-template-columns: 96px 1fr auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 24px;
}
.os-p-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a6f, #2F62AF);
    object-fit: cover;
    border: 3px solid var(--os-p-panel);
    box-shadow: var(--os-p-shadow);
}
.os-p-hero-body { min-width: 0; }
.os-p-hero h1 {
    font-size: 36px;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin: 0 0 6px;
    color: var(--os-p-text);
}
.os-p-eyebrow {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.os-p-pill {
    display: inline-block;
    padding: 4px 10px;
    background: var(--os-p-primary-soft);
    color: var(--os-p-primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.os-p-pill.gold {
    background: var(--os-p-gold-soft);
    color: #8a6500;
}
/* Trainer tier badge: educational (free) blue, Standard silver, Pro gold, Enterprise platinum. */
.os-p-tier-educational { background: var(--os-p-primary-soft); color: var(--os-p-primary); }
.os-p-tier-standard { background: rgba(100, 116, 139, 0.14); color: #475569; }
.os-p-tier-pro { background: var(--os-p-gold-soft); color: #8a6500; }
.os-p-tier-enterprise {
    background: linear-gradient(135deg, #f4f6fa 0%, #cfd6e2 50%, #eef1f6 100%);
    color: #1e293b;
    box-shadow: inset 0 0 0 1px #8f9bb0;
}
[data-tutor-theme="dark"] .os-p-tier-standard { color: #cbd5e1; }
[data-tutor-theme="dark"] .os-p-tier-pro { color: #ffd466; }
/* The avatar border takes the tier colour (it was panel colour on white and faint white on a cover photo).
 * Each tier uses one colour, matching its pill. */
.os-p-hero .os-p-avatar.os-p-avatar-educational { border-color: #2F62AF; }
.os-p-hero .os-p-avatar.os-p-avatar-standard { border-color: #94a3b8; }
.os-p-hero .os-p-avatar.os-p-avatar-pro { border-color: #fcb900; }
.os-p-hero .os-p-avatar.os-p-avatar-enterprise { border-color: #b4bfd0; }
/* Category pills are <a> elements so trainers' specialties click through
 * to the relevant /course-category/<slug>/ listing. Defeat the generic
 * .os-p a underline-on-hover so they read as chips not links. */
a.os-p-pill,
a.os-p-pill-cat {
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}
a.os-p-pill:hover,
a.os-p-pill-cat:hover {
    background: var(--os-p-primary);
    color: var(--os-p-on-primary) !important;
    text-decoration: none;
}
.os-p-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--os-p-muted);
    font-size: 13px;
}
/* Star row (G8): five outline stars with five filled stars on top, the
 * filled row clipped to the rating by an inline width. Replaces a text row
 * whose half-star glyph (U+2BE8) rendered as a box in most fonts. U+2605
 * is in every system font. Used in the hero, the review lists and, on the
 * profile only, the course cards. */
.os-p-stars {
    position: relative;
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    vertical-align: -1px;
}
.os-p-stars::before {
    content: "\2605\2605\2605\2605\2605";
    color: var(--os-p-muted);
    opacity: 0.35;
}
.os-p-stars-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    overflow: hidden;
}
.os-p-stars-fill::before {
    content: "\2605\2605\2605\2605\2605";
    color: var(--os-p-gold);
}
.os-p-rating b { color: var(--os-p-text); }

/* Hero social row (right column) */
.os-p-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}
.os-p-social {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.os-p-social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--os-p-border);
    background: var(--os-p-panel);
    color: var(--os-p-muted) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.os-p-social a:hover {
    color: var(--os-p-primary) !important;
    border-color: var(--os-p-primary);
    background: var(--os-p-primary-soft);
    text-decoration: none;
}
/* Tutor renders social icons via icon-font classes (tutor-icon-*). The
 * default `font-size: 0` reset on the <a> would hide our fallback text,
 * so explicitly restore size for the inner icon element. */
.os-p-social a::before { font-size: 15px; }

/* ============================================================
 * Stats strip, mirror of .os-t-stats
 * ============================================================ */
.os-p-stats {
    background: var(--os-p-panel);
    border: 1px solid var(--os-p-border);
    border-radius: 14px;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    box-shadow: var(--os-p-shadow);
    margin-bottom: 24px;
}
.os-p-stats .stat { text-align: center; }
.os-p-stats .stat .v {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--os-p-primary);
    line-height: 1;
}
.os-p-stats .stat .l {
    color: var(--os-p-muted);
    font-size: 12px;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Articles published (DEV-593): a linked tile, and five across when it shows. */
.os-p-stats a.stat { color: inherit; text-decoration: none; border-radius: 10px; }
.os-p-stats a.stat:hover { text-decoration: none; }
.os-p-stats a.stat:hover .l { color: var(--os-p-primary); }
.os-p-stats a.stat:focus-visible { outline: 2px solid var(--os-p-primary); outline-offset: 4px; }
@media (min-width: 881px) {
    .os-p-stats:has(> .stat:nth-child(5)) { grid-template-columns: repeat(5, 1fr); }
}

/* ============================================================
 * Body grid, main + sidebar (mirrors .os-c-body on single-course
 * for visual consistency with the rest of the platform). Hero and
 * stats stay full width above this; everything below is split.
 * Sidebar is sticky on desktop, collapses to a stacked column
 * below the main content on mobile.
 * ============================================================ */
.os-p-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 28px;
    align-items: start;
}
.os-p-main { min-width: 0; }
.os-p-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 100px;
}

/* Sidebar cards reuse .os-p-section chrome but tighter padding so
 * a 320px column doesn't feel cramped. Override section margin so
 * cards stack via the parent's gap instead of double-spacing. */
.os-p-side .os-p-section {
    margin-bottom: 0;
    padding: 18px;
}
.os-p-side h3 {
    font-size: 12px;
    margin: 0 0 12px;
    color: var(--os-p-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

/* Quick facts list, label/value rows inside a sidebar card. */
.os-p-fact-list { display: flex; flex-direction: column; }
.os-p-fact {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
    padding: 8px 0;
    border-top: 1px solid var(--os-p-border);
    gap: 12px;
}
.os-p-fact:first-child { border-top: 0; padding-top: 0; }
.os-p-fact .l { color: var(--os-p-muted); flex-shrink: 0; }
.os-p-fact .v {
    color: var(--os-p-text);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

/* Specialties tile, vertical chip list of category pills. */
.os-p-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.os-p-chip-list .os-p-pill {
    font-size: 11px;
    padding: 3px 9px;
}

/* For-hire tile, prominent green stripe so the "available for hire"
 * signal is unmistakable next to the rest of the at-a-glance facts. */
.os-p-hire-tile {
    background: linear-gradient(135deg, #0ea766, #22c55e);
    color: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--os-p-shadow);
}
.os-p-hire-tile h3 { color: rgba(255,255,255,0.78); margin: 0 0 6px; }
.os-p-hire-tile .headline { font-size: 15px; font-weight: 700; margin: 0 0 4px; line-height: 1.3; }
.os-p-hire-tile .sub { font-size: 13px; color: rgba(255,255,255,0.85); margin: 0 0 12px; line-height: 1.4; }
.os-p-hire-tile a.cta {
    display: inline-block;
    background: #fff;
    color: #0ea766 !important;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}
.os-p-hire-tile a.cta:hover { background: #f3fdf6; text-decoration: none; }

/* ============================================================
 * Section panels
 * ============================================================ */
.os-p-section {
    background: var(--os-p-panel);
    border: 1px solid var(--os-p-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--os-p-shadow);
    margin-bottom: 20px;
}
.os-p-section h2 {
    font-size: 18px;
    margin: 0 0 12px;
    color: var(--os-p-text);
}
.os-p-section h2 .count {
    color: var(--os-p-muted);
    font-size: 13px;
    font-weight: 500;
    margin-left: 6px;
}
.os-p-section > p {
    color: var(--os-p-text);
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 12px;
}
.os-p-section > p:last-child { margin-bottom: 0; }

.os-p-empty {
    color: var(--os-p-muted);
    font-size: 14px;
    padding: 16px;
    text-align: center;
    background: #fafbfd;
    border: 1px dashed var(--os-p-border);
    border-radius: 10px;
}

/* ============================================================
 * Bio
 * ============================================================ */
.os-p-bio {
    color: var(--os-p-text);
    font-size: 15px;
    line-height: 1.65;
    /* Break a word only when it cannot fit the line, such as a long URL. */
    overflow-wrap: break-word;
}
.os-p-bio p:last-child { margin-bottom: 0; }
.os-p-bio a {
    color: var(--os-p-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
/* Trainer bio clamp (G1): about four lines, faded, with "Read more". The
 * script at the foot of public-profile.php adds .is-clamped only when the
 * text is longer than that, so without JavaScript the whole bio shows. */
.os-p-bio-section.is-clamped:not(.is-expanded) .os-p-bio {
    max-height: calc(1.65em * 4);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(#000 55%, transparent);
    mask-image: linear-gradient(#000 55%, transparent);
}
.os-p-more-toggle.os-p-bio-toggle { display: block; }
.os-p-more-toggle.os-p-bio-toggle[hidden] { display: none; }

/* ============================================================
 * Courses grid (reuses .os-a-card via render helper, but we
 * also accept loose .os-a-card children directly). The wrapper
 * grid sits inside `.os-p-section`.
 * ============================================================ */
.os-p-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* "Show all / Show fewer" toggle for collapsible profile lists (the learner
 * In progress and Completed grids, and a trainer's Courses grid). Hidden on
 * desktop by default; the mobile @media block reveals it and collapses the
 * grids. A trainer's grid also collapses on desktop past 9 cards. Centred
 * pill, matching the sidebar contact/edit affordances. */
.os-p-more-toggle {
    display: none;
    width: fit-content;
    margin: 14px auto 0;
    padding: 8px 18px;
    border: 1px solid var(--os-p-border);
    background: var(--os-p-panel);
    color: var(--os-p-primary);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.os-p-more-toggle:hover {
    background: var(--os-p-primary-soft);
    border-color: var(--os-p-primary);
}
.os-p-courses-authored .os-p-more-toggle.has-more-desktop { display: block; }
.os-p-courses-authored:not(.is-expanded) .os-p-grid > :nth-child(n+10) { display: none; }

/* ============================================================
 * Reviews, mirror of .os-c-review
 * ============================================================ */
.os-p-review { padding: 16px 0; border-top: 1px solid var(--os-p-border); }
.os-p-review:first-of-type { border-top: 0; padding-top: 0; }
.os-p-review .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.os-p-review .head img { width: 32px; height: 32px; border-radius: 50%; }
.os-p-review .who { font-weight: 600; font-size: 14px; color: var(--os-p-text); }
.os-p-review .who a { color: var(--os-p-text); }
.os-p-review .when { color: var(--os-p-muted); font-size: 12px; }
.os-p-review .body { color: var(--os-p-text); font-size: 14px; line-height: 1.55; }
.os-p-review-more {
    margin-top: 12px;
    text-align: right;
    font-size: 13px;
}

/* ============================================================
 * myCred rank + Badges Plus
 * ============================================================ */
/* ============================================================
 * v2 — Contact relay modal (replaces mailto: links so recipient
 * email is never rendered client-side). Markup is appended to
 * <body> by `front-end/onlysecurity-profile-contact.php`.
 * ============================================================ */
.os-p-modal[hidden] { display: none !important; }
.os-p-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.os-p-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}
.os-p-modal-card {
    position: relative;
    background: var(--os-p-panel, #fff);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow: auto;
    padding: 28px;
    z-index: 1;
}
.os-p-modal-close {
    position: absolute;
    top: 12px; right: 12px;
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--os-p-muted, #64748b);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.os-p-modal-close:hover { background: #f1f5f9; color: var(--os-p-text, #1e293b); }
.os-p-modal-card h2 {
    margin: 0 0 6px;
    font-size: 20px;
    letter-spacing: -0.01em;
    color: var(--os-p-text, #1e293b);
}
.os-p-modal-lede {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--os-p-muted, #64748b);
    line-height: 1.5;
}
.os-p-modal-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}
.os-p-modal-field > span {
    font-size: 12px;
    font-weight: 600;
    color: var(--os-p-text, #1e293b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.os-p-modal-field input,
.os-p-modal-field textarea {
    background: #fafbfd;
    border: 1px solid var(--os-p-border, #e5e7eb);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--os-p-text, #1e293b);
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}
.os-p-modal-field input:focus,
.os-p-modal-field textarea:focus {
    outline: none;
    border-color: var(--os-p-primary, #2F62AF);
    background: #fff;
}
.os-p-modal-field textarea {
    resize: vertical;
    min-height: 100px;
}
.os-p-modal-card .cf-turnstile { margin: 12px 0 6px; }
.os-p-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 18px;
}
.os-p-modal-cancel,
.os-p-modal-send {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 0;
    font-family: inherit;
}
.os-p-modal-cancel {
    background: transparent;
    color: var(--os-p-muted, #64748b);
    border: 1px solid var(--os-p-border, #e5e7eb);
}
.os-p-modal-cancel:hover { background: #f1f5f9; }
.os-p-modal-send {
    background: var(--os-p-primary, #2F62AF);
    color: var(--os-p-on-primary, #fff);
}
.os-p-modal-send:hover { background: #3b78d0; }
.os-p-modal-send:disabled { opacity: 0.5; cursor: not-allowed; }
.os-p-modal-status {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--os-p-muted, #64748b);
    min-height: 18px;
}
.os-p-modal-status:empty { display: none; }
@media (max-width: 540px) {
    .os-p-modal { padding: 0; align-items: flex-end; }
    .os-p-modal-card {
        border-radius: 16px 16px 0 0;
        max-height: 95vh;
    }
}

/*
 * Tutor's vendor CSS adds `float: right; width: calc(100% - 278px);
 * padding-left: 30px; margin-bottom: 30px` on `.tutor-user-profile-content`
 * for its legacy "278px sidebar + content" layout. The myCred rank
 * shortcode emits that class, which is then breaking our 320px sidebar
 * grid (extra 30px left padding inside the tile, float right pulling
 * the content out of flow). Flatten the inherited box wherever the
 * class appears inside our `.os-p` shell.
 */
.os-p .tutor-user-profile-content {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

.os-p-rank {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
}
.os-p-rank small { color: var(--os-p-muted); font-size: 11px; }

/* myCred profile-rank-points shortcode emits its own markup with inline
 * styles that don't match our kit (grey 10px bar with bright blue fill,
 * default WP <p> + <strong> margins). Override with !important since the
 * shortcode writes inline `style="..."` on the bar wrapper and inner div. */
.os-p-rank .tutor-mycred-profile-rank-points,
.os-p-rank .tutor-user-profile-content {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.os-p-rank .tutor-mycred-profile-rank-points p,
.os-p-rank .tutor-user-profile-content p {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--os-p-text);
}
.os-p-rank .tutor-mycred-profile-rank-points p strong,
.os-p-rank .tutor-user-profile-content p strong {
    font-weight: 600;
    color: var(--os-p-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    margin-bottom: 2px;
}
.os-p-rank .progress-bar-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: 6px !important;
    background: #e5e7eb !important;
    border-radius: 999px !important;
    overflow: hidden !important;
    margin: 6px 0 !important;
}
.os-p-rank .progress-bar-wrapper > div {
    background: linear-gradient(90deg, var(--os-p-primary), #4f8ad8) !important;
    height: 100% !important;
    border-radius: 999px !important;
}
/* Last <p> after the bar is "X / Y Points" — make it small + muted */
.os-p-rank .tutor-mycred-profile-rank-points > p:last-child,
.os-p-rank .tutor-user-profile-content > p:last-child {
    font-size: 11px;
    color: var(--os-p-muted);
    margin-top: 0;
}
/* Badge shortcode emits its own "Badges Earned" heading, promote it to
 * the same shape as our `.os-p-section h2` so the section reads cleanly
 * without us duplicating the title. */
.os-p-badges .tutor-mycred-badges-heading {
    font-size: 18px;
    font-weight: 600;
    color: var(--os-p-text);
    margin: 0 0 12px;
    text-align: left;
}
.os-p-badges .tutor-mycred-badges-wrapper,
.os-p-badges .badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}
.os-p-badges .badge-item {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafbfd;
    border: 1px solid var(--os-p-border);
    border-radius: 10px;
    padding: 8px;
}
.os-p-badges .badge-item img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ============================================================
 * Dashboard settings form (.os-p-form)
 * Sits inside Tutor's dashboard shell, which already provides
 * .os-d chrome around it. We layer our own form styling but
 * keep the .tutor-form-control / .tutor-form-select hooks so
 * Tutor's JS validation + searchable selects keep working.
 * ============================================================ */
.os-p-form-wrap {
    background: var(--os-p-panel);
    border: 1px solid var(--os-p-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--os-p-shadow);
}
.os-p-form-section + .os-p-form-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--os-p-border);
}
.os-p-form-section h2 {
    font-size: 16px;
    margin: 0 0 4px;
    color: var(--os-p-text);
}
.os-p-form-section .hint {
    color: var(--os-p-muted);
    font-size: 13px;
    margin: 0 0 16px;
}

.os-p-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.os-p-form-grid.full { grid-template-columns: 1fr; }
.os-p-field { display: flex; flex-direction: column; gap: 6px; }
.os-p-field label,
.os-p-field .os-p-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--os-p-text);
}
.os-p-field .os-p-help {
    color: var(--os-p-muted);
    font-size: 12px;
    line-height: 1.5;
}

/* Override Tutor's stock form-control so it sits flush with our kit */
.os-p-form-wrap .tutor-form-control,
.os-p-form-wrap .tutor-form-select {
    background: #fafbfd !important;
    border: 1px solid var(--os-p-border) !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    color: var(--os-p-text) !important;
    width: 100% !important;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.os-p-form-wrap .tutor-form-control:focus,
.os-p-form-wrap .tutor-form-select:focus {
    outline: none !important;
    border-color: var(--os-p-primary) !important;
    background: var(--os-p-panel) !important;
}
.os-p-form-wrap .tutor-form-control[disabled] {
    color: var(--os-p-muted) !important;
    background: #f1f5f9 !important;
    cursor: not-allowed;
}
.os-p-form-wrap .tutor-form-control.invalid { border-color: #dc2626 !important; }

/* WYSIWYG bio editor, soften the MCE chrome to match */
.os-p-form-wrap .wp-editor-wrap .wp-editor-tools {
    background: transparent;
    border-bottom: 1px solid var(--os-p-border);
}
.os-p-form-wrap .wp-editor-wrap .mce-toolbar-grp {
    background: #fafbfd;
    border-bottom: 1px solid var(--os-p-border);
}
.os-p-form-wrap .wp-editor-wrap iframe { background: var(--os-p-panel); }

/* Cover + avatar editor block (stock Tutor uses #tutor_profile_cover_photo_editor) */
.os-p-form-wrap #tutor_profile_cover_photo_editor {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--os-p-border);
    background: #fafbfd;
}

/* Submit row */
.os-p-form-submit {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}
.os-p-form-wrap .tutor-profile-settings-save,
.os-p-form-wrap .tutor-btn.tutor-btn-primary {
    background: var(--os-p-primary) !important;
    color: var(--os-p-on-primary) !important;
    border: 0 !important;
    border-radius: 10px !important;
    padding: 12px 22px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer;
    transition: background 0.15s ease;
}
.os-p-form-wrap .tutor-profile-settings-save:hover,
.os-p-form-wrap .tutor-btn.tutor-btn-primary:hover {
    background: #3b78d0 !important;
}

/* Restyle Tutor Pro add-on markup that injects via
 * `tutor_profile_edit_input_after` (Certificate Signature field, and
 * anything else that lands in that hook). The addon emits stock
 * `.tutor-row > .tutor-col-12 > .tutor-form-group > .tutor-form-label`
 * chrome, flatten the grid wrapper and re-skin the label to match
 * `.os-p-field` labels above. */
.os-p-form-wrap .tutor-row { margin: 0; }
.os-p-form-wrap .tutor-row .tutor-col-12 { padding: 0; }
.os-p-form-wrap .tutor-form-group { margin-bottom: 0; }
.os-p-form-wrap .tutor-form-group + .tutor-form-group { margin-top: 16px; }
.os-p-form-wrap .tutor-form-label {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--os-p-text) !important;
    margin-bottom: 6px !important;
    display: block;
}
/* Thumbnail uploader widget used for the signature field, soften its
 * default border and inset it inside our card chrome. */
.os-p-form-wrap .tutor-thumbnail-uploader,
.os-p-form-wrap .tutor-image-uploader-wrap {
    border: 1px dashed var(--os-p-border);
    border-radius: 10px;
    background: #fafbfd;
    padding: 16px;
}

/* ============================================================
 * Social profile section, merged into the Profile page from the
 * old /dashboard/settings/social-profile/ tab.
 * ============================================================ */
.os-p-form-wrap-social { /* visually attaches as a sibling card below the main one */ }
.os-p-social-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 4px;
}
.os-p-social-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    align-items: center;
}
.os-p-social-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--os-p-text);
}
.os-p-social-label i {
    color: var(--os-p-muted);
    font-size: 16px;
}
@media (max-width: 880px) {
    .os-p-social-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

/* Alert / error list */
.os-p-form-wrap .tutor-alert-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}
.os-p-form-wrap .tutor-required-fields { margin: 0; padding-left: 18px; }

/* ============================================================
 * v2 — Cover photo as hero background (KD-NEW-A)
 * Member uploads a cover photo at /dashboard/settings/; we now use
 * it as a subtle background on the hero. Falls back to the panel
 * look when no cover is set. CSS var --cover-url is set inline by
 * the template when a cover exists.
 * ============================================================ */
.os-p-hero.has-cover {
    position: relative;
    isolation: isolate;
    background: #16243d;
    color: #fff;
    overflow: hidden;
}
.os-p-hero.has-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--cover-url);
    background-size: cover;
    background-position: center;
    opacity: 0.30;
    z-index: -1;
}
.os-p-hero.has-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(13,27,46,0.85), rgba(30,58,111,0.55));
    z-index: -1;
}
.os-p-hero.has-cover h1 { color: #fff; }
.os-p-hero.has-cover .os-p-avatar { border-color: rgba(255,255,255,0.25); }
.os-p-hero.has-cover .os-p-pill { background: rgba(255,255,255,0.18); color: #fff; }
.os-p-hero.has-cover .os-p-pill.gold { background: rgba(252,185,0,0.30); color: #fff5d0; }
.os-p-hero.has-cover .os-p-tier-pro { background: rgba(252,185,0,0.30); color: #fff5d0; }
.os-p-hero.has-cover .os-p-tier-enterprise { background: linear-gradient(135deg, #f4f6fa, #cfd6e2 55%, #eef1f6); color: #1e293b; }
.os-p-hero.has-cover .os-p-tier-educational { background: rgba(150,189,242,0.30); color: #e3efff; }
.os-p-hero.has-cover .os-p-tier-standard { background: rgba(203,213,225,0.30); color: #f1f5f9; }
.os-p-hero.has-cover .os-p-avatar.os-p-avatar-educational { border-color: #2F62AF; }
.os-p-hero.has-cover .os-p-avatar.os-p-avatar-standard { border-color: #94a3b8; }
.os-p-hero.has-cover .os-p-avatar.os-p-avatar-pro { border-color: #fcb900; }
.os-p-hero.has-cover .os-p-avatar.os-p-avatar-enterprise { border-color: #e4e9f1; }
.os-p-hero.has-cover .os-p-rating { color: rgba(255,255,255,0.85); }
.os-p-hero.has-cover .os-p-rating b { color: #fff; }
.os-p-hero.has-cover .os-p-stars::before { color: #fff; }
.os-p-hero.has-cover .os-p-social a {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.30);
    color: #fff !important;
}
.os-p-hero.has-cover .os-p-social a:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.50);
}

/* ============================================================
 * v2 — Quick-action buttons in hero (edit + share, own-profile only)
 * Stack vertically on desktop with social row below; horizontal on mobile.
 * ============================================================ */
.os-p-quick-actions {
    display: flex;
    gap: 6px;
}
.os-p-quick-actions a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--os-p-border);
    background: var(--os-p-panel);
    color: var(--os-p-muted) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.os-p-quick-actions a:hover {
    background: var(--os-p-primary-soft);
    color: var(--os-p-primary) !important;
    border-color: var(--os-p-primary);
    text-decoration: none;
}
.os-p-hero.has-cover .os-p-quick-actions a {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.30);
    color: #fff !important;
}
.os-p-hero.has-cover .os-p-quick-actions a:hover {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.50);
}

/* ============================================================
 * v2 — Full-width "Available for hire" banner
 * Sits between stats and body grid when a trainer has BOTH
 * _os_available_for_hire = 1 AND _os_for_hire_public = 1.
 * More prominent than the sidebar tile alternative.
 * ============================================================ */
.os-p-hire-banner {
    background: linear-gradient(135deg, #0ea766, #22c55e);
    color: #fff;
    border-radius: 14px;
    padding: 22px 28px;
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: 56px 1fr auto;
    gap: 18px;
    align-items: center;
    box-shadow: var(--os-p-shadow);
}
.os-p-hire-banner .icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.20);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}
.os-p-hire-banner .body { min-width: 0; }
.os-p-hire-banner .label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.78);
    margin: 0 0 4px;
}
.os-p-hire-banner .headline {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}
.os-p-hire-banner .sub {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    margin: 4px 0 0;
    line-height: 1.45;
}
.os-p-hire-banner .cta {
    display: inline-block;
    background: #fff;
    color: #0ea766 !important;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.os-p-hire-banner .cta:hover { background: #f3fdf6; text-decoration: none; }

/* Sidebar contact-fallback tile (used when the for-hire banner is
 * NOT shown but a contact path is still wanted). */
.os-p-contact-tile {
    background: var(--os-p-panel);
    border: 1px solid var(--os-p-border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--os-p-shadow);
    text-align: center;
}
.os-p-contact-tile h3 {
    font-size: 13px;
    margin: 0 0 4px;
    color: var(--os-p-text);
    text-transform: none;
    letter-spacing: 0;
}
.os-p-contact-tile p { margin: 0 0 12px; font-size: 12px; color: var(--os-p-muted); line-height: 1.45; }
.os-p-contact-tile .cta {
    display: inline-block;
    background: var(--os-p-primary);
    color: var(--os-p-on-primary) !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}
.os-p-contact-tile .cta:hover { background: #3b78d0; text-decoration: none; }

/* ============================================================
 * v2 — Course progress bar on enrolled learner cards
 * Renders as a bottom strip on `.os-a-card.os-p-course-card`.
 * `.is-complete` swaps the bar to green.
 * ============================================================ */
.os-p-course-card { position: relative; }
.os-p-course-card .os-p-progress {
    padding: 0 16px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}
.os-p-course-card .os-p-progress .bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.os-p-course-card .os-p-progress .bar > i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--os-p-primary), #4f8ad8);
    border-radius: 999px;
}
.os-p-course-card .os-p-progress .pct {
    font-size: 12px;
    color: var(--os-p-muted);
    font-weight: 600;
    min-width: 32px;
    text-align: right;
}
.os-p-course-card.is-complete .os-p-progress .bar > i { background: var(--os-p-up); }
.os-p-course-card.is-complete .os-p-progress .pct { color: var(--os-p-up); }

/* Featured pill marker (trainer's pinned course) */
.os-p-card-featured {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--os-p-gold);
    color: #1e293b;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    z-index: 1;
}

/* ============================================================
 * v2 — Mini-card list (certificates, recently completed, featured)
 * Used in sidebar tiles for lists of 1–3 compact items.
 * ============================================================ */
.os-p-mini-card-list { display: flex; flex-direction: column; }
.os-p-mini-card {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid var(--os-p-border);
    text-decoration: none;
    color: inherit;
}
.os-p-mini-card:first-child { border-top: 0; padding-top: 0; }
.os-p-mini-card:hover { text-decoration: none; }
.os-p-mini-card:hover .t { color: var(--os-p-primary); }
.os-p-mini-card .icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--os-p-primary-soft);
    color: var(--os-p-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.os-p-mini-card .body { min-width: 0; }
.os-p-mini-card .t {
    font-size: 13px;
    font-weight: 600;
    color: var(--os-p-text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}
.os-p-mini-card .s {
    font-size: 11px;
    color: var(--os-p-muted);
    margin-top: 2px;
}

/* ============================================================
 * v2 — Streak tile (gold gradient)
 * Learner sidebar, surfaces myCred-derived current learning streak.
 * Renders only when streak >= 2 days.
 * ============================================================ */
.os-p-streak-tile {
    background: linear-gradient(135deg, #fcb900, #f5a623);
    color: #1e293b;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--os-p-shadow);
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: center;
}
.os-p-streak-tile .icon { font-size: 28px; }
.os-p-streak-tile .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(30,41,59,0.65);
    margin: 0;
}
.os-p-streak-tile .value {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
}

/* ============================================================
 * v2 — Leaderboard rank chip in About card
 * ============================================================ */
.os-p-fact .v.leaderboard a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--os-p-primary) !important;
    background: var(--os-p-primary-soft);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.os-p-fact .v.leaderboard a:hover { background: var(--os-p-primary); color: #fff !important; }

/* ============================================================
 * v2 — Reviews received (trainer)
 * Distinct from the trainer's own "reviews left" section.
 * ============================================================ */
.os-p-reviews-received .head-strip {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--os-p-muted);
    flex-wrap: wrap;
    gap: 8px;
}
.os-p-reviews-received .head-strip strong { color: var(--os-p-text); font-size: 15px; }

/* ============================================================
 * v2 — Mobile: keep grid collapse, AND reorder critical tiles up
 * Per user feedback: About should appear above Courses, ideally
 * even above Badges. Hire banner stays full-width above grid (so
 * already first regardless of mobile). About + Streak + Contact
 * tiles get hoisted via flex order.
 * ============================================================ */
@media (max-width: 880px) {
    /* Switch the body grid to a flex column so `order` lets us
     * promote sidebar tiles above main-column sections. */
    .os-p-body {
        display: flex;
        flex-direction: column;
        gap: 16px;
        /* Reset the desktop grid's `align-items: start` (line ~231). In a flex
         * column that value sizes each card to its own content, so short cards
         * (About, Rank & points, Badges, Reviews) rendered narrower than the
         * full-width ones. `stretch` makes every card fill the column. */
        align-items: stretch;
    }
    /* `display: contents` removes the main + side wrappers from
     * layout so their children become direct flex items, which
     * lets us order across both columns. */
    .os-p-main,
    .os-p-side { display: contents; }
    .os-p-side { position: static; }

    /* Promotion order (lower = earlier on mobile):
     *   1  About card (anchor of the page on mobile)
     *   2  Hire / Contact / Streak tiles
     *   3  Bio (first long-form section)
     *   4  Recently completed / Certificates (learner sidebar)
     *   5  Courses (main)
     *   6  Featured course (trainer sidebar)
     *   7  Badges (visual but secondary to course content)
     *   8  Rank & points / Specialties
     *   9  Reviews received / left
     */
    .os-p-section.os-p-about            { order: 1; }
    .os-p-hire-tile,
    .os-p-streak-tile,
    .os-p-contact-tile                  { order: 2; }
    .os-p-section.os-p-bio-section      { order: 3; }
    .os-p-section.os-p-certificates,
    .os-p-section.os-p-recent-completed { order: 4; }
    .os-p-section.os-p-courses-section  { order: 5; }
    .os-p-section.os-p-featured-course  { order: 6; }
    .os-p-section.os-p-badges           { order: 7; }
    .os-p-section.os-p-rank-section,
    .os-p-section.os-p-specialties      { order: 8; }
    .os-p-section.os-p-reviews-received,
    .os-p-section.os-p-reviews-left     { order: 9; }
    .os-p-section:not([class*=os-p-])   { order: 5; }

    /* Trainer order (G1, revised 2026-09-27): About (compact), Contact,
     * Biography, Courses, Featured course, Reviews, Specialties, then
     * Skills, Interests and Toolstack, and Badges at the foot. Learners
     * keep the order above. */
    .tutor-instructor .os-p-section.os-p-courses-section  { order: 4; }
    .tutor-instructor .os-p-section.os-p-featured-course  { order: 5; }
    .tutor-instructor .os-p-section.os-p-reviews-received,
    .tutor-instructor .os-p-section.os-p-reviews-left     { order: 6; }
    .tutor-instructor .os-p-section.os-p-specialties      { order: 7; }
    .tutor-instructor .os-p-skills-slot                   { order: 8; }
    .tutor-instructor .os-p-section.os-pt-section         { order: 9; }
    .tutor-instructor .os-p-section.os-p-badges           { order: 10; }

    /* Compact About on trainer profiles: facts in two columns, label over
     * value, so the card takes half the height before the biography. */
    .tutor-instructor .os-p-about .os-p-fact-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 16px;
    }
    .tutor-instructor .os-p-about .os-p-fact {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .tutor-instructor .os-p-about .os-p-fact:nth-child(2) { border-top: 0; padding-top: 0; }
    .tutor-instructor .os-p-about .os-p-fact .v { text-align: left; }

    .os-p-page { padding: 16px 14px 60px; }
    .os-p-hero {
        grid-template-columns: 72px 1fr;
        gap: 16px;
        padding: 20px;
    }
    .os-p-avatar { width: 72px; height: 72px; }
    .os-p-hero h1 { font-size: 26px; }
    .os-p-hero-actions {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }
    .os-p-stats { grid-template-columns: repeat(2, 1fr); padding: 18px; }
    .os-p-stats .stat .v { font-size: 24px; }
    .os-p-stats .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .os-p-grid { grid-template-columns: 1fr; }

    /* Courses in progress: the single-column stack gets long, so cap it at 5
     * cards and reveal the rest via the toggle. Scoped to the learner
     * "in progress" grid so trainer authored-course grids are untouched. */
    .os-p-courses-inprogress .os-p-more-toggle { display: block; }
    .os-p-courses-inprogress:not(.is-expanded) .os-p-grid > *:nth-child(n+6) { display: none; }
    /* A trainer's Courses grid shows 4 cards on phones, then "Show all" (G1). */
    .os-p-courses-authored .os-p-more-toggle { display: block; }
    .os-p-courses-authored:not(.is-expanded) .os-p-grid > :nth-child(n+5) { display: none; }
    .os-p-form-grid { grid-template-columns: 1fr; }
    .os-p-section { padding: 18px; }

    /* Full-width hire banner collapses cleanly on mobile */
    .os-p-hire-banner {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 18px;
    }
    .os-p-hire-banner .icon { margin: 0 auto; }
    .os-p-hire-banner .cta { width: 100%; }
}

/* cache-bust: 20260520T062018 — force LSCache combined-bundle hash to change so Cloudflare serves a fresh URL after the 1.0.167 sidebar redesign deploy */

/* cache-bust: 20260520T062442-flex-fix */

/* ═══════════════════════════════════════════════════════════════════════
 * Tutor v4 account skin (.os-p on dashboard/account/settings/account.php)
 *
 * v4 renders the profile-edit form through its own component classes
 * (.tutor-account-section / .tutor-card / .tutor-h5), NOT the v3 `.os-p-*`
 * markup above. Our v4 override wraps that stock form in `.os-p` so these
 * rules can re-skin it to the redesign look without touching the Alpine
 * bindings. Added for the Tutor v4 rc.2 migration.
 *
 * COLOUR: deliberately NONE. The v4 dashboard is Tutor's own dark design
 * (dark --tutor-surface-* tokens, near-white text). The `.os-p` kit above is
 * the LIGHT public-profile palette; painting its white panels/slate text onto
 * the dark dashboard produced white-on-white labels and dark-on-dark headings
 * (bug caught 2026-07-12). This section keeps only shape and typography,
 * lets every colour come from Tutor's tokens, and re-neutralises the base
 * `.os-p { color: ... }` inheritance.
 * ═══════════════════════════════════════════════════════════════════════ */
.os-p.tutor-account-section {
    color: inherit; /* undo the light-kit .os-p text colour on the dark dashboard */
}

/* Section headings: Account / Public Profile / Privacy / Trainer fields */
.os-p.tutor-account-section .tutor-h5 {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Panels: shape only, surface colour stays Tutor's */
.os-p.tutor-account-section .tutor-card {
    border-radius: 14px;
    padding: 20px;
}

/* KSEC helper copy (privacy blurb etc.) */
.os-p .os-p-help {
    color: var(--tutor-text-secondary, #94a3b8);
    font-size: 12px;
    line-height: 1.5;
}

/* Give the KSEC-added Privacy + Trainer sections a touch more breathing room */
.os-p-privacy .tutor-card,
.os-p-trainer .tutor-card {
    gap: 12px;
}

/*
 * Re-hide Tutor v4's cover/profile-photo file inputs on the account settings
 * page. Wordfence Login Security's admin.css (enqueued on the dashboard via our
 * 2FA-tab integration) ships a global `input[type="file"] { display: block }`
 * with specificity (0,1,1), which outweighs Tutor's `.tutor-hidden` (0,1,0) and
 * un-hides the raw "Choose file" inputs behind the styled "Edit Cover Photo" /
 * avatar-camera controls. `input[type="file"].tutor-hidden` is (0,2,1) and wins
 * back; !important guards against any later broad reset.
 */
.tutor-account-cover-photo input[type="file"].tutor-hidden,
.tutor-account-avatar input[type="file"].tutor-hidden,
input[type="file"].tutor-hidden {
    display: none !important;
}

/*
 * Edit-profile action on the public profile: a labelled pill (icon + "Edit
 * profile") for the owner, rather than the bare icon circle used for Share /
 * socials, so the edit affordance is obvious. Overrides the 34px circle from
 * .os-p-quick-actions a. Own-profile-only (rendered behind $is_own in the
 * template).
 */
.os-p-quick-actions a.os-p-edit-btn {
    width: auto;
    border-radius: 999px;
    padding: 0 14px;
    gap: 6px;
    font-size: 13px;
}
.os-p-edit-btn .os-p-edit-label {
    white-space: nowrap;
}

/* ============================================================
 * Dashboard: badge grid outside the public profile
 * ============================================================
 *
 * `[mycred_profile_badges_plus]` emits `.badge-grid` on BOTH the public
 * profile and /dashboard/skills-credentials/. The styling below was only
 * ever scoped to `.os-p-badges`, a wrapper the public profile applies and
 * the dashboard does not, so on the dashboard the grid fell back to
 * `display: block` and every badge became a full-width 680x100 row with
 * square corners and no padding.
 *
 * Scoped to `.os-ph-page` rather than made global, so nothing outside the
 * profile-hub pages is restyled by accident.
 */
/* Only the GRID flexes. `.tutor-mycred-badges-wrapper` contains the
 * "Badges Earned" heading AND the grid, so flexing it puts the heading
 * beside the badges instead of above them. */
.os-ph-page .badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}
.os-ph-page .tutor-mycred-badges-heading {
    margin: 0 0 12px;
}
.os-ph-page .badge-item {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Deliberately light in BOTH themes. The badge artwork is drawn for a
     * light backing, so a dark tile makes it disappear. Kept slightly off
     * white so the tile still reads as a surface against the dark panel. */
    background: #f4f6fa;
    border: 1px solid var(--os-p-border);
    border-radius: 10px;
    padding: 8px;
}
.os-ph-page .badge-item img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* ============================================================
 * Skills slot (G1). On trainer profiles os-skills-matching moves its
 * Skills panel in here, at the foot of the main column. Spacing matches
 * the other main-column sections.
 * ============================================================ */
.os-p-skills-slot:empty { display: none; }
.os-p-skills-slot > .osm-fh { margin: 0; }

/* ============================================================
 * Rewards launcher on phones (G6). The myCred loyalty widget is a
 * site-wide fixed pill (#mycred-loyalty-widget-root; its fixed wrapper's
 * first child is the launcher row). On profile pages below 576px it keeps
 * only its icon, and the page gets room at the bottom so the last lines
 * of the footer clear it. The label is hidden visually, not removed, so
 * the launcher keeps its accessible name. body.os-p-profile-route is set
 * by public-profile.php; this stylesheet also loads on the dashboard,
 * which has its own launcher rules.
 * ============================================================ */
@media (max-width: 575.98px) {
    body.os-p-profile-route { padding-bottom: 96px; }
    body.os-p-profile-route #mycred-loyalty-widget-root > div > div:first-child p {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0 0 0 0) !important;
        white-space: nowrap !important;
    }
}

/* ============================================================
 * Tap targets (G14, audit 3.2). Invisible hit areas so small controls
 * take a 44px tap without changing how they look. Standalone controls get
 * the full 44px. Chips and badge titles sit in tight wrapping rows, so
 * theirs stops at half the gap between rows; a larger area would overlap
 * the neighbouring chip and send the tap to the wrong link.
 * ============================================================ */
.os-p .os-share__toggle,
.os-p-contact-tile .cta,
.os-p .os-p-more-toggle,
.os-p .osm-fh-toggle,
.os-p a.os-p-pill-cat,
.os-p .badge-title-link {
    position: relative;
}
.os-p .os-share__toggle::after,
.os-p-contact-tile .cta::after,
.os-p .os-p-more-toggle::after,
.os-p .osm-fh-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 44px;
    min-height: 100%;
    transform: translateY(-50%);
}
.os-p a.os-p-pill-cat::after {
    content: "";
    position: absolute;
    inset: -3px 0;
}
.os-p .badge-title-link::after {
    content: "";
    position: absolute;
    inset: -6px -4px;
}

/* ─────────────────────── Profile visibility ────────────────────────
 * Review P1.2 and P1.3 (onlysecurity/specs/os-open-to-work-directory.md).
 * The private notice replaces the whole profile for visitors; the bar sits
 * on top of the profile for the member and staff; the dialog warns before a
 * Save makes a profile private. All on --os-p-* tokens, so the dashboard
 * dark block above reaches the settings field and the dialog. */
.os-p-private {
    max-width: 560px;
    margin: 24px auto 48px;
    padding: 40px 24px;
    background: var(--os-p-panel, #ffffff);
    border: 1px solid var(--os-p-border, #e5e7eb);
    border-radius: 20px;
    box-shadow: var(--os-p-shadow);
    text-align: center;
}
.os-p-private__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--os-p-primary-soft, rgba(47, 98, 175, 0.10));
    color: var(--os-p-primary, #2F62AF);
    display: flex;
    align-items: center;
    justify-content: center;
}
.os-p-private__title {
    margin: 0 0 8px;
    font-size: 24px;
    color: var(--os-p-text, #1e293b);
}
.os-p-private__text {
    margin: 0 auto 24px;
    max-width: 32ch;
    color: var(--os-p-muted, #64748b);
}
.os-p .os-p-private__cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 10px;
    background: var(--os-p-primary, #2F62AF);
    color: var(--os-p-on-primary, #ffffff);
    font-weight: 600;
}
.os-p .os-p-private__cta:hover { text-decoration: none; }

.os-p-private-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--os-p-border, #e5e7eb);
    border-radius: 12px;
    background: var(--os-p-primary-soft, rgba(47, 98, 175, 0.10));
    color: var(--os-p-text, #1e293b);
}
.os-p .os-p-private-bar a { font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

.os-p-visibility-sep {
    width: 100%;
    margin: 0;
    border: 0;
    border-top: 1px solid var(--os-p-border, #e5e7eb);
}

.os-p-private-dialog {
    max-width: 520px;
    width: calc(100% - 32px);
    padding: 28px;
    border: 1px solid var(--os-p-border, #e5e7eb);
    border-radius: 16px;
    background: var(--os-p-panel, #ffffff);
    color: var(--os-p-text, #1e293b);
}
.os-p-private-dialog::backdrop { background: rgba(15, 23, 42, 0.55); }
.os-p-private-dialog h2 { margin: 0 0 8px; font-size: 20px; color: var(--os-p-text, #1e293b); }
.os-p-private-dialog p { margin: 0 0 12px; color: var(--os-p-muted, #64748b); }
.os-p-private-dialog ol { margin: 0 0 16px 20px; padding: 0; }
.os-p-private-dialog__keeps {
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--os-p-panel-2, #f1f5f9);
}
.os-p-private-dialog__keeps strong { color: var(--os-p-text, #1e293b); }
.os-p-private-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}
.os-p-private-dialog__actions .tutor-btn { min-height: 44px; }
