/* ============================================================
   Pharmshark — site chrome + landing page
   ------------------------------------------------------------
   Every rule is scoped with a .ps- prefix (except the shared
   base below) so this file can sit alongside the Branch
   Directory's own style.css without any collisions.
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 Helvetica, Arial, sans-serif;
    background: #f5f7fa;
    color: #1f2937;
    line-height: 1.55;
}

/* ------------- Top navigation bar ------------- */
.ps-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.ps-topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo lockup */
.ps-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-right: auto;          /* pushes the nav to the right */
}
.ps-logo-mark { width: 32px; height: 32px; display: block; flex: none; }
.ps-logo-text {
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.ps-logo-pharm { color: #1f2937; }
.ps-logo-shark { color: #0b5394; }

/* Nav links */
.ps-nav { display: flex; align-items: center; gap: 18px; }
.ps-nav-link {
    color: #475569;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.ps-nav-link:hover { color: #0b5394; }
.ps-nav-link.is-active { color: #0b5394; border-bottom-color: #0b5394; }
.ps-nav-user { color: #6b7280; font-size: 0.95rem; }

/* ---- Avatar circle — loaded on every page so nav always renders correctly ---- */
.ps-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    user-select: none;
    letter-spacing: 0.03em;
    vertical-align: middle;
}
.ps-avatar--nav  { width: 32px; height: 32px; font-size: 0.72rem; }
.ps-avatar--lg   { width: 80px; height: 80px; font-size: 1.6rem; }
.ps-avatar--photo {
    object-fit: cover;
}
.ps-nav-avatar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    border-radius: 20px;
    padding: 2px 8px 2px 2px;
    transition: background 0.15s;
}
.ps-nav-avatar-link:hover,
.ps-nav-avatar-link.is-active { background: rgba(11,83,148,0.08); }
.ps-nav-greeting { font-size: 0.9rem; font-weight: 500; color: #475569; }

/* Mobile menu toggle (hidden on desktop) */
.ps-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 36px;
    padding: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    cursor: pointer;
}
.ps-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: #1f2937;
    border-radius: 2px;
}

/* ------------- Buttons ------------- */
.ps-btn {
    display: inline-block;
    padding: 9px 16px;
    border: 1px solid #0b5394;
    border-radius: 7px;
    background: #0b5394;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.ps-btn:hover { background: #0a4279; border-color: #0a4279; }
.ps-btn-ghost { background: #fff; color: #0b5394; }
.ps-btn-ghost:hover { background: #eef4fb; border-color: #0b5394; color: #0b5394; }
.ps-btn-lg { padding: 12px 22px; font-size: 1rem; }
.ps-btn-block { display: block; width: 100%; }

/* ------------- Main layout ------------- */
.ps-main { min-height: 72vh; padding-bottom: 40px; }
.ps-main-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* ------------- Hero ------------- */
.ps-hero {
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
    padding: 56px 20px 32px;
}
.ps-hero-mark { width: 72px; height: 72px; margin-bottom: 18px; }
.ps-hero-title {
    margin: 0;
    font-size: 2.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.ps-hero-tagline {
    margin: 10px 0 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0b5394;
}
.ps-hero-lede {
    margin: 14px auto 0;
    max-width: 540px;
    font-size: 1.02rem;
    color: #475569;
}

/* ------------- Cards ------------- */
.ps-cards {
    max-width: 920px;
    margin: 12px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.ps-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.ps-card > .ps-btn { margin-top: auto; }
.ps-card-tag {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #166534;
    background: #dcfce7;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.ps-card-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; }
.ps-card-sub  { margin: 0 0 16px; color: #6b7280; font-size: 0.95rem; }
.ps-card-body { margin: 0 0 20px; color: #475569; }
.ps-card-form { margin-top: 36px; }

.ps-account-name  { margin: 0; font-size: 1.05rem; font-weight: 600; }
.ps-account-email { margin: 2px 0 14px; color: #6b7280; font-size: 0.92rem; }

/* ------------- Forms ------------- */
.ps-form { display: flex; flex-direction: column; gap: 14px; }
.ps-field { display: flex; flex-direction: column; gap: 5px; }
.ps-field > span { font-size: 0.85rem; font-weight: 600; color: #475569; }
.ps-field input {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-size: 0.98rem;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
}
.ps-field input:focus {
    outline: none;
    border-color: #0b5394;
    box-shadow: 0 0 0 3px rgba(11, 83, 148, 0.15);
}
.ps-field-hint { margin: -4px 0 0; font-size: 0.82rem; color: #6b7280; }
.ps-form-title { margin: 0 0 18px; font-size: 1.5rem; font-weight: 700; text-align: center; }
.ps-form-alt {
    margin: 16px 0 0;
    font-size: 0.92rem;
    color: #6b7280;
    text-align: center;
}
.ps-form-alt a { color: #0b5394; font-weight: 600; }

/* ------------- Alerts ------------- */
.ps-alert {
    max-width: 880px;
    margin: 8px auto 0;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
}
.ps-alert-ok  { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.ps-alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ------------- Footer ------------- */
.ps-footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    margin-top: 40px;
}
.ps-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.ps-footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #1f2937;
}
.ps-footer-mark { width: 22px; height: 22px; display: block; }
.ps-footer-meta { color: #6b7280; font-size: 0.88rem; }
.ps-donate-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #0b5394;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}
.ps-donate-btn:hover { background: #093f72; }
.ps-donate-btn svg { width: 17px; height: 17px; flex-shrink: 0; }

/* ------------- Responsive ------------- */
@media (max-width: 720px) {
    .ps-nav-toggle { display: flex; }
    .ps-nav {
        display: none;
        position: absolute;
        top: 62px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        background: #fff;
        border-bottom: 1px solid #e2e8f0;
        padding: 10px 20px 16px;
        box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
    }
    .ps-topbar.ps-open .ps-nav { display: flex; }
    .ps-nav-link { padding: 10px 2px; border-bottom: 1px solid #f1f5f9; }
    .ps-nav-link.is-active { border-bottom-color: #0b5394; }
    .ps-nav-user { padding: 10px 2px; }
    .ps-nav .ps-btn { width: 100%; }

    .ps-cards { grid-template-columns: 1fr; }
    .ps-hero { padding-top: 40px; }
    .ps-hero-title { font-size: 2.3rem; }
}

/* ====================================================================
   Clinical Articles — listing page (articles.php)
   ==================================================================== */

.ps-articles-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 20px 28px;
}
.ps-articles-hero h1 {
    margin: 0 0 10px;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.ps-articles-hero p {
    margin: 0;
    color: #475569;
    font-size: 1.02rem;
    max-width: 560px;
}
.ps-articles-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
    background: #dbeafe;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.ps-article-list {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.ps-article-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 26px 28px;
    box-shadow: 0 1px 3px rgba(15,23,42,0.05);
    display: block;
    position: relative;
    transition: border-color .15s, box-shadow .15s;
}
.ps-article-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(11,83,148,0.10);
}
/* Stretched link — covers the entire card, sits below interactive children */
.ps-article-card-link {
    position: absolute;
    inset: 0;
    border-radius: 12px;
    z-index: 0;
}
.ps-article-card-link:focus-visible {
    outline: 2px solid #0b5394;
    outline-offset: 2px;
}
.ps-article-card-title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0b5394;
}
.ps-article-card-summary {
    margin: 0 0 14px;
    color: #475569;
    font-size: 0.97rem;
    line-height: 1.6;
}
.ps-article-card-meta {
    font-size: 0.83rem;
    color: #94a3b8;
}
.ps-article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    position: relative;
    z-index: 1;
}
.ps-article-card-cta {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0b5394;
    text-decoration: none;
}
.ps-article-card-pdf {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    transition: border-color .15s, color .15s, background .15s;
    position: relative;
    z-index: 1;
}
.ps-article-card-pdf:hover {
    border-color: #0b5394;
    color: #0b5394;
    background: #f0f6ff;
}

/* ====================================================================
   Clinical Articles — search + filter bar (articles.php)
   ==================================================================== */

.ps-search-bar {
    max-width: 760px;
    margin: 0 auto 8px;
    padding: 0 20px;
}
.ps-search-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.ps-search-input-wrap {
    position: relative;
    flex: 1 1 220px;
    min-width: 180px;
}
.ps-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}
.ps-search-input {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.92rem;
    color: #1f2937;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    -webkit-appearance: none;
}
.ps-search-input:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147,197,253,0.25);
}
.ps-search-input::-webkit-search-cancel-button { cursor: pointer; }
.ps-filter-select {
    padding: 9px 30px 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #374151;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    flex: 0 1 auto;
}
.ps-filter-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(147,197,253,0.25);
}
.ps-search-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 28px;
    margin-top: 6px;
    font-size: 0.83rem;
    color: #6b7280;
}
.ps-search-clear {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.83rem;
    color: #0b5394;
    cursor: pointer;
    text-decoration: underline;
}
.ps-search-clear:hover { color: #1e40af; }
.ps-no-results {
    text-align: center;
    color: #6b7280;
    padding: 40px 0;
    font-size: 0.95rem;
    grid-column: 1 / -1;
}

/* ====================================================================
   Clinical Articles — detail page (article.php)
   ==================================================================== */

.ps-article-wrap {
    max-width: 740px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}
.ps-article-back {
    display: inline-block;
    font-size: 0.88rem;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 24px;
}
.ps-article-back:hover { color: #0b5394; }
.ps-article-header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}
.ps-article-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1e40af;
    background: #dbeafe;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.ps-article-title {
    margin: 0 0 12px;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.ps-article-summary {
    margin: 0;
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.65;
    font-style: italic;
}
.ps-article-meta {
    margin-top: 12px;
    font-size: 0.83rem;
    color: #94a3b8;
}

/* Article body sections */
.ps-art-section {
    margin-bottom: 36px;
}
.ps-art-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}
.ps-art-section p {
    margin: 0 0 12px;
    color: #374151;
    line-height: 1.7;
}
.ps-art-section p:last-child { margin-bottom: 0; }

/* Red flags table */
.ps-art-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.ps-art-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.93rem;
}
.ps-art-table th {
    background: #f1f5f9;
    color: #374151;
    font-weight: 700;
    text-align: left;
    padding: 11px 14px;
    border-bottom: 1px solid #e2e8f0;
}
.ps-art-table th:last-child { color: #b91c1c; }
.ps-art-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
    color: #374151;
    line-height: 1.5;
}
.ps-art-table tr:last-child td { border-bottom: none; }
.ps-art-table td:first-child { font-weight: 600; }
.ps-art-table .ps-art-redflag {
    color: #b91c1c;
    font-weight: 500;
}

/* What to do — action items */
.ps-art-actions { display: flex; flex-direction: column; gap: 10px; }
.ps-art-action {
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 4px solid transparent;
}
.ps-art-action--emergency {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #7f1d1d;
}
.ps-art-action--urgent {
    background: #fffbeb;
    border-left-color: #d97706;
    color: #78350f;
}
.ps-art-action--selfcare {
    background: #f0fdf4;
    border-left-color: #16a34a;
    color: #14532d;
}
.ps-art-action strong { font-weight: 700; }

/* Key takeaways */
.ps-art-takeaways {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ps-art-takeaways li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.97rem;
    color: #374151;
    line-height: 1.6;
}
.ps-art-takeaways li::before {
    content: "✓";
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: #0b5394;
    color: #fff;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

/* Checklist download */
.ps-art-checklist-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.ps-art-checklist-label {
    font-size: 0.95rem;
    color: #374151;
    margin: 0;
}
.ps-art-checklist-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Professional disclaimer */
.ps-art-disclaimer {
    margin-top: 44px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.65;
}
.ps-art-disclaimer strong { color: #6b7280; }

/* Responsive */
@media (max-width: 600px) {
    .ps-article-title { font-size: 1.5rem; }
    .ps-art-checklist-box { flex-direction: column; align-items: flex-start; }
    .ps-art-table { font-size: 0.85rem; }
}

/* -----------------------------------------------------------------------
   Article listing tabs
   ----------------------------------------------------------------------- */

.ps-tab-bar-outer {
    position: relative;
    max-width: 860px;
    margin: 0 auto 28px;
}
.ps-tab-bar {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}
.ps-tab-bar::-webkit-scrollbar { display: none; }

/* Arrow buttons */
.ps-tab-arrow {
    position: absolute;
    top: 0;
    height: calc(100% - 2px);
    width: 40px;
    border: none;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, color 0.15s;
    padding: 0;
}
.ps-tab-arrow:hover { color: #0b5394; }
.ps-tab-arrow--left  {
    left: 0;
    background: linear-gradient(to right, #fff 55%, transparent);
}
.ps-tab-arrow--right {
    right: 0;
    background: linear-gradient(to left, #fff 55%, transparent);
}

/* Show arrows only when there is overflow */
.ps-tab-bar-outer.ps-has-overflow .ps-tab-arrow { opacity: 1; pointer-events: auto; }
/* Hide left arrow when already at the start */
.ps-tab-bar-outer.ps-has-overflow.ps-tabs-at-start .ps-tab-arrow--left  { opacity: 0; pointer-events: none; }
/* Hide right arrow when already at the end */
.ps-tab-bar-outer.ps-has-overflow.ps-tabs-at-end  .ps-tab-arrow--right { opacity: 0; pointer-events: none; }
.ps-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.ps-tab-btn:hover {
    color: #0b5394;
}
.ps-tab-btn.active {
    color: #0b5394;
    border-bottom-color: #0b5394;
}
.ps-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    background: #e2e8f0;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 10px;
}
.ps-tab-btn.active .ps-tab-count {
    background: #dbeafe;
    color: #0b5394;
}
.ps-tab-panel {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}
.ps-tab-desc {
    font-size: 0.92rem;
    color: #6b7280;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* Inside tab panels, article list handles its own spacing */
.ps-tab-panel .ps-article-list {
    max-width: none;
    margin: 0;
    padding: 0 0 60px;
}
.ps-tab-panel .ps-search-bar {
    max-width: none;
    margin: 0 0 20px;
    padding: 0;
}

@media (max-width: 600px) {
    .ps-tab-bar { padding: 0 12px; gap: 0; }
    .ps-tab-btn { padding: 9px 12px 11px; font-size: 0.88rem; }
    .ps-tab-panel { padding: 0 12px; }
    .ps-tab-arrow { width: 32px; }
}

/* -----------------------------------------------------------------------
   Dispensing-check article styles
   ----------------------------------------------------------------------- */

.ps-art-section--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 16px 20px;
}
.ps-art-section--danger h2 {
    color: #b91c1c;
    border-bottom-color: #fecaca;
}

.ps-art-subhead {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0b5394;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 18px 0 8px;
}

.ps-art-list {
    margin: 0 0 4px 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ps-art-list li {
    font-size: 0.95rem;
    color: #374151;
    line-height: 1.6;
}
.ps-art-list--questions li {
    font-style: italic;
    color: #1f2937;
    font-weight: 500;
}
.ps-art-list--danger li {
    color: #b91c1c;
    font-weight: 500;
}
.ps-art-list--sub {
    margin-top: 6px;
    padding-left: 18px;
    gap: 4px;
}
.ps-art-list--sub li {
    font-size: 0.9rem;
    color: #4b5563;
}
.ps-art-section--warning {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 16px 20px;
}
.ps-art-section--warning h2 {
    color: #92400e;
    border-bottom-color: #fcd34d;
}
.ps-art-section--framework {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 16px 20px;
}
.ps-art-section--framework h2 {
    color: #1d4ed8;
    border-bottom-color: #bfdbfe;
}
.ps-art-stop-grid {
    display: grid;
    grid-template-columns: 2.2rem 1fr;
    gap: 10px 8px;
    margin-top: 10px;
}
.ps-art-stop-letter {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: #1d4ed8;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50%;
    flex-shrink: 0;
    padding-top: 2px;
}
.ps-art-stop-item {
    padding-top: 2px;
}
.ps-art-stop-item strong {
    display: block;
    font-size: 0.9rem;
    color: #1e3a8a;
    margin-bottom: 2px;
}
.ps-art-stop-item p {
    margin: 0;
    font-size: 0.88rem;
    color: #374151;
}

.ps-art-script {
    background: #eff6ff;
    border-left: 4px solid #0b5394;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #1e3a5f;
    margin-top: 4px;
}

/* -----------------------------------------------------------------------
   Triage accordion — sub-category grouping
   ----------------------------------------------------------------------- */

.ps-accordion {
    max-width: none;
    margin: 0;
    padding: 0 0 60px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ps-accordion-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}

.ps-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 18px;
    background: #f8fafc;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    text-align: left;
    transition: background .15s;
}
.ps-accordion-header:hover {
    background: #f0f6ff;
}
.ps-accordion-header[aria-expanded="false"] {
    border-bottom-color: transparent;
}

.ps-accordion-dot {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}
.ps-accordion-dot--emergency        { background: #dc2626; }
.ps-accordion-dot--cardiovascular   { background: #e11d48; }
.ps-accordion-dot--respiratory      { background: #0284c7; }
.ps-accordion-dot--neurology        { background: #7c3aed; }
.ps-accordion-dot--ophthalmology    { background: #0d9488; }
.ps-accordion-dot--gastroenterology { background: #d97706; }
.ps-accordion-dot--genitourinary    { background: #2563eb; }
.ps-accordion-dot--ent              { background: #16a34a; }
.ps-accordion-dot--paediatrics      { background: #db2777; }
.ps-accordion-dot--clinical_practice{ background: #6b7280; }
.ps-accordion-dot--psychiatry       { background: #7c3aed; }
.ps-accordion-dot--musculoskeletal  { background: #b45309; }
.ps-accordion-dot--endocrine        { background: #0369a1; }
.ps-accordion-dot--pain_management          { background: #be185d; }
.ps-accordion-dot--pharmacy_first           { background: #0369a1; }
.ps-accordion-dot--discharge_medicines      { background: #047857; }
.ps-accordion-dot--contraception            { background: #9333ea; }
.ps-accordion-dot--hypertension_case_finding{ background: #e11d48; }
.ps-accordion-dot--new_medicine_service     { background: #0891b2; }
.ps-accordion-dot--other                    { background: #94a3b8; }

.ps-accordion-label {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
}

.ps-accordion-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0b5394;
    background: #dbeafe;
    border-radius: 20px;
    padding: 2px 9px;
    white-space: nowrap;
}

.ps-accordion-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    transition: transform .2s ease;
}
.ps-accordion-header[aria-expanded="false"] .ps-accordion-chevron {
    transform: rotate(-90deg);
}

.ps-accordion-body {
    padding: 16px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}
.ps-accordion-body[hidden] {
    display: none;
}

/* Cards inside accordion need no extra border-radius shadow duplication */
.ps-accordion-body .ps-article-card {
    margin: 0;
    box-shadow: none;
    border-color: #e2e8f0;
}
.ps-accordion-body .ps-article-card:hover {
    box-shadow: 0 2px 8px rgba(11,83,148,0.08);
}

/* Visible-count chip shown on header when filtering */
.ps-accordion-visible-count {
    font-size: 0.78rem;
    color: #6b7280;
    margin-left: 2px;
}

@media (max-width: 600px) {
    .ps-accordion-header { padding: 12px 14px; }
    .ps-accordion-body   { padding: 12px 10px 4px; }
    .ps-accordion-label  { font-size: 0.93rem; }
}
