:root{--blue:#356f8a;--blue-dark:#244f65;--blue-soft:#e8f2f6;--green:#5e8d79;--green-soft:#eaf3ee;--ink:#23333a;--muted:#6d7b80;--line:#dce6e6;--paper:#f7faf9;--card:#ffffff;--sand:#f3efe7;--danger:#a84b4b;--shadow:0 10px 30px rgba(35,51,58,.08)}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;background:var(--paper);color:var(--ink)}a{color:var(--blue-dark);text-decoration:none}.app-shell{display:flex;min-height:100vh}.sidebar{width:248px;background:#f0f6f5;border-right:1px solid var(--line);padding:22px 16px;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;padding:4px 8px 24px}.brand-mark{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:linear-gradient(135deg,var(--blue),var(--green));color:white;font-weight:800}.brand b{display:block;font-size:20px;color:var(--ink)}.brand small{display:block;color:var(--muted);font-size:11px;margin-top:2px}.sidebar nav{display:flex;flex-direction:column;gap:6px}.sidebar nav a,.sidebar-bottom a{padding:11px 12px;border-radius:10px;color:#3b4d53;display:flex;gap:10px;align-items:center}.sidebar nav a:hover,.sidebar nav a.active{background:white;box-shadow:0 3px 12px rgba(35,51,58,.05);color:var(--blue-dark)}.sidebar-bottom{margin-top:auto}.main{margin-left:248px;min-width:0;width:calc(100% - 248px)}.topbar{height:72px;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:16px;padding:0 28px;position:sticky;top:0;z-index:10;backdrop-filter:blur(8px)}.global-search{display:flex;flex:1;max-width:720px}.global-search input{flex:1;border:1px solid var(--line);border-right:0;border-radius:10px 0 0 10px;padding:11px 13px;background:#fbfdfc}.global-search button{border:0;background:var(--blue);color:white;padding:0 16px;border-radius:0 10px 10px 0}.user-pill{background:var(--green-soft);color:#365f50;padding:8px 12px;border-radius:999px;font-size:13px}.menu-btn{display:none;border:0;background:none;font-size:22px}.content{padding:30px;max-width:1320px;margin:auto}footer{padding:20px 30px 32px;color:var(--muted);font-size:12px;max-width:1320px;margin:auto}.hero{background:linear-gradient(120deg,#edf5f8,#eef6f1 62%,#f7f2e9);border:1px solid var(--line);border-radius:22px;padding:34px;box-shadow:var(--shadow)}.eyebrow{font-size:12px;letter-spacing:.12em;text-transform:uppercase;color:var(--green);font-weight:700}.hero h1{font-size:34px;margin:8px 0 8px}.hero p{color:var(--muted);max-width:760px;font-size:16px;line-height:1.6}.hero-actions{display:flex;gap:10px;margin-top:20px}.btn{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:10px;border:1px solid var(--line);background:white;color:var(--ink);cursor:pointer}.btn.primary{background:var(--blue);color:white;border-color:var(--blue)}.btn.green{background:var(--green);color:white;border-color:var(--green)}.btn.danger{background:#fff5f5;color:var(--danger);border-color:#ead1d1}.section-title{display:flex;justify-content:space-between;align-items:end;margin:30px 0 14px}.section-title h2{margin:0;font-size:20px}.section-title a{font-size:13px}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:0 4px 16px rgba(35,51,58,.035)}.card:hover{border-color:#c8d9d9}.metric strong{display:block;font-size:28px;color:var(--blue-dark)}.metric span{color:var(--muted);font-size:13px}.category-card .icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;background:var(--blue-soft);color:var(--blue-dark);margin-bottom:12px}.category-card:nth-child(2n) .icon{background:var(--green-soft);color:#396553}.category-card:nth-child(3n) .icon{background:var(--sand);color:#7a694e}.category-card h3{margin:0 0 6px;font-size:16px}.category-card p{margin:0;color:var(--muted);font-size:13px}.article-list{display:flex;flex-direction:column;gap:10px}.article-row{background:white;border:1px solid var(--line);border-radius:14px;padding:15px 16px;display:flex;gap:16px;justify-content:space-between}.article-row h3{margin:0 0 5px;font-size:15px}.article-row p{margin:0;color:var(--muted);font-size:13px}.badges{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.badge{font-size:11px;background:var(--blue-soft);color:var(--blue-dark);padding:4px 7px;border-radius:999px}.badge.green{background:var(--green-soft);color:#3e6958}.badge.sand{background:var(--sand);color:#725f44}.filters{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}.filters input,.filters select,.form input,.form select,.form textarea{border:1px solid var(--line);background:white;border-radius:10px;padding:10px 11px;font:inherit;color:var(--ink)}.filters input{min-width:250px}.article{background:white;border:1px solid var(--line);border-radius:18px;padding:30px;box-shadow:var(--shadow)}.article h1{margin-top:0;font-size:30px}.article .meta{color:var(--muted);font-size:13px;margin-bottom:24px}.article-body{line-height:1.75}.article-body h2{margin-top:30px;border-bottom:1px solid var(--line);padding-bottom:8px}.article-body h3{margin-top:24px}.article-body pre{background:#1f2e34;color:#edf4f5;padding:16px;border-radius:12px;overflow:auto}.article-body code{font-family:"Cascadia Code",Consolas,monospace;font-size:.92em}.article-body p code,.article-body li code{background:#edf3f3;padding:2px 5px;border-radius:5px;color:#35505b}.article-body blockquote{margin:18px 0;padding:12px 16px;border-left:4px solid var(--green);background:var(--green-soft);border-radius:0 10px 10px 0}.form{display:grid;gap:12px}.form label{font-size:13px;font-weight:600}.form textarea{min-height:420px;font-family:"Cascadia Code",Consolas,monospace;line-height:1.45}.form .row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.notice{padding:12px 14px;border-radius:10px;background:var(--green-soft);color:#365f50;border:1px solid #d2e5da;margin-bottom:16px}.error{background:#fff2f2;color:#8e3f3f;border-color:#eed0d0}.login-page{min-height:100vh;display:grid;place-items:center;padding:22px;background:linear-gradient(135deg,#eef5f8,#eef6f1 58%,#f7f1e8)}.login-card{width:min(440px,100%);background:rgba(255,255,255,.94);border:1px solid var(--line);border-radius:22px;padding:30px;box-shadow:var(--shadow)}.login-brand{display:flex;align-items:center;gap:12px;margin-bottom:24px}.login-card h1{font-size:24px;margin:0}.login-card p{color:var(--muted);line-height:1.5}.login-card .form textarea{min-height:auto}.project-card h3{margin:0 0 6px}.project-card p{margin:0;color:var(--muted);font-size:13px}.project-count{margin-top:12px;font-size:12px;color:var(--green)}.empty{padding:28px;text-align:center;color:var(--muted);background:white;border:1px dashed var(--line);border-radius:14px}@media(max-width:1000px){.grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){.sidebar{transform:translateX(-100%);transition:.2s;z-index:30}.menu-open .sidebar{transform:none}.main{margin-left:0;width:100%}.menu-btn{display:block}.topbar{padding:0 14px}.user-pill{display:none}.content{padding:18px}.grid{grid-template-columns:1fr}.hero{padding:24px}.hero h1{font-size:28px}.article{padding:20px}.form .row{grid-template-columns:1fr}.global-search button{display:none}.global-search input{border-right:1px solid var(--line);border-radius:10px}}
.brand-logo-link{display:block;padding:2px 4px 22px}.brand-logo{display:block;width:100%;max-width:208px;height:auto;max-height:72px;object-fit:contain;object-position:left center}.login-brand-logo{display:block;text-align:center;margin-bottom:24px}.login-brand-logo img{display:block;width:100%;max-width:360px;height:auto;margin:0 auto}.login-brand-subtitle{margin-top:4px;color:var(--muted);font-size:12px;letter-spacing:.02em}.login-brand-logo+.notice{margin-top:0}@media(max-width:760px){.brand-logo{max-width:190px;max-height:66px}}

/* Bluewitch v1.4 - Admin / user management */
.admin-intro{color:var(--muted);max-width:780px;line-height:1.6;margin-top:-4px;margin-bottom:20px}
.admin-grid{display:grid;grid-template-columns:minmax(280px,360px) minmax(0,1fr);gap:18px;align-items:start}
.admin-card h2{margin-top:0;font-size:18px}
.user-list-card{padding:0;overflow:hidden}
.user-list-card>h2{padding:18px 18px 4px;margin:0}
.user-admin-row{padding:18px;border-top:1px solid var(--line)}
.user-admin-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.user-admin-head strong{font-size:15px}
.user-admin-fields{display:grid;grid-template-columns:160px minmax(190px,1fr) auto;gap:12px;align-items:end}
.user-admin-fields>div{display:grid;gap:6px}
.user-admin-fields label{font-size:12px;font-weight:600;color:#46575d}
.user-admin-fields input,.user-admin-fields select{width:100%;border:1px solid var(--line);background:white;border-radius:10px;padding:9px 10px;font:inherit;color:var(--ink)}
.check-label{display:flex!important;align-items:center;gap:7px;padding:10px 0;white-space:nowrap}
.check-label input{width:auto!important}
.user-admin-actions{display:flex;gap:8px;margin-top:12px}
@media(max-width:900px){.admin-grid{grid-template-columns:1fr}.user-admin-fields{grid-template-columns:1fr 1fr}.check-label{grid-column:1/-1}}
@media(max-width:600px){.user-admin-fields{grid-template-columns:1fr}}


/* Bluewitch v1.5 - password management */
.form-help{
    display:block;
    margin:-6px 0 12px;
    font-size:12px;
    color:#647a77;
}
.password-card{
    max-width:620px;
}

/* ===== Bluewitch darker UI ===== */

body{
    background:#dfe9e7;
}

.main{
    background:#dfe9e7;
}

/* Top header */
.topbar{
    background:#e8f0ee;
    border-bottom:1px solid #c7d5d2;
}

/* Sidebar */
.sidebar{
    background:#d7e5e2;
    border-right-color:#c2d1ce;
}

/* Active sidebar item */
.sidebar a.active,
.sidebar .active{
    background:#eef4f2;
}

/* Welcome / hero */
.hero{
    background:linear-gradient(
        135deg,
        #d7e8e4 0%,
        #e7e1d3 100%
    );
    border-color:#c6d4d0;
}

/* Dashboard stat cards */
.stat-card{
    background:#edf3f1;
    border-color:#c6d3d0;
}

/* Knowledge cards */
.category-card,
.project-card,
.article-card{
    background:#edf3f1;
    border-color:#c6d3d0;
}

/* Inputs */
input,
textarea,
select{
    background:#f3f7f6;
    border-color:#bdcdca;
}

/* Bluewitch v1.6 - article attachments */
.attachment-editor{
    margin:20px 0 6px;
    padding:18px;
    border:1px solid #bfd0cc;
    border-radius:14px;
    background:rgba(255,255,255,.34);
}
.attachment-editor input[type=file]{
    width:100%;
    padding:11px;
    border:1px dashed #9fb9b3;
    border-radius:10px;
    background:#f3f7f6;
}
.existing-attachments{
    margin-top:16px;
}
.attachment-heading{
    font-weight:700;
    margin-bottom:8px;
}
.attachment-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:10px 12px;
    margin:7px 0;
    border:1px solid #c6d4d0;
    border-radius:10px;
    background:#edf3f1;
}
.attachment-row small{
    display:block;
    margin-top:2px;
    color:#667b77;
}
.attachment-remove{
    display:flex;
    align-items:center;
    gap:7px;
    white-space:nowrap;
    font-size:13px;
}
.article-attachments{
    margin-top:34px;
    padding-top:24px;
    border-top:1px solid #c6d4d0;
}
.attachment-list{
    display:grid;
    gap:9px;
}
.attachment-card{
    display:flex;
    align-items:center;
    gap:12px;
    padding:13px 15px;
    border:1px solid #c6d4d0;
    border-radius:12px;
    background:#edf3f1;
    text-decoration:none;
    color:inherit;
}
.attachment-card:hover{
    transform:translateY(-1px);
    box-shadow:0 6px 18px rgba(38,72,67,.08);
}
.attachment-icon{
    width:34px;
    height:34px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:#d8e8e4;
    font-weight:800;
    color:#17627d;
}
.attachment-info{
    flex:1;
    min-width:0;
}
.attachment-info strong{
    display:block;
    overflow-wrap:anywhere;
}
.attachment-info small{
    display:block;
    margin-top:2px;
    color:#667b77;
}
.attachment-download{
    font-size:13px;
    font-weight:700;
    color:#17627d;
}
@media(max-width:760px){
    .attachment-row{align-items:flex-start;flex-direction:column;}
    .attachment-download{display:none;}
}

/* Bluewitch v1.7 - logged-in user in left sidebar */
.sidebar-user{
    display:flex;
    align-items:center;
    gap:10px;
    margin:0 2px 8px;
    padding:11px 10px;
    border:1px solid #c2d1ce;
    border-radius:11px;
    background:#e8f0ee;
}
.sidebar-user-icon{
    width:32px;
    height:32px;
    display:grid;
    place-items:center;
    flex:0 0 32px;
    border-radius:9px;
    background:#d7e5e2;
    font-size:15px;
}
.sidebar-user-info{
    min-width:0;
    display:flex;
    flex-direction:column;
    line-height:1.25;
}
.sidebar-user-info strong{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:13px;
    color:var(--ink);
}
.sidebar-user-info span{
    margin-top:2px;
    font-size:11px;
    font-weight:600;
    color:var(--green);
}

/* Bluewitch v1.8 - login security */
.turnstile-wrap{
    margin:2px 0 4px;
    min-height:36px;
}
.security-warning{
    font-size:12px;
}
.private-area-note{
    font-size:12px;
    margin-top:18px;
}
.login-card .cf-turnstile{
    max-width:100%;
}

/* Bluewitch v1.9 - user profile */
.sidebar-user-link{
    display:block;
    padding:0 !important;
    margin:0;
    border-radius:11px;
}
.sidebar-user-link:hover{
    background:transparent !important;
    box-shadow:none !important;
}
.sidebar-user{
    position:relative;
    transition:.15s ease;
}
.sidebar-user-link:hover .sidebar-user{
    background:#eef4f2;
    border-color:#aebfbb;
    transform:translateY(-1px);
}
.sidebar-user-arrow{
    margin-left:auto;
    font-size:20px;
    line-height:1;
    color:#6f8580;
}
.profile-section-title h1{
    margin:4px 0 0;
}
.profile-grid{
    display:grid;
    grid-template-columns:minmax(280px,420px) minmax(320px,1fr);
    gap:18px;
    align-items:start;
}
.profile-card{
    text-align:center;
}
.profile-avatar{
    width:74px;
    height:74px;
    margin:0 auto 14px;
    display:grid;
    place-items:center;
    border-radius:22px;
    background:#d7e5e2;
    font-size:30px;
}
.profile-main h2{
    margin:0 0 8px;
    font-size:22px;
}
.profile-role-badge{
    display:inline-flex;
    align-items:center;
    padding:5px 10px;
    border-radius:999px;
    background:var(--green-soft);
    color:#365f50;
    font-size:12px;
    font-weight:700;
}
.profile-details{
    margin-top:24px;
    text-align:left;
    border-top:1px solid #c6d4d0;
}
.profile-detail-row{
    display:flex;
    justify-content:space-between;
    gap:18px;
    padding:12px 0;
    border-bottom:1px solid #c6d4d0;
}
.profile-detail-row span{
    color:var(--muted);
    font-size:13px;
}
.profile-detail-row strong{
    text-align:right;
    font-size:13px;
}
.profile-password-card h2{
    margin:4px 0 8px;
    font-size:22px;
}
.profile-password-card p{
    color:var(--muted);
    line-height:1.6;
    max-width:650px;
}
@media(max-width:900px){
    .profile-grid{
        grid-template-columns:1fr;
    }
}

/* Bluewitch v1.9.1 - full-width sidebar profile */
.sidebar-bottom{
    width:100%;
}

.sidebar-user-link{
    width:100%;
    display:block;
}

.sidebar-user{
    width:100%;
    min-height:56px;
    padding:11px 12px;
    margin:0 0 8px 0;
}

/* Bluewitch v2.0 - Editor role */
.profile-role-badge{
    text-transform:none;
}

/* Bluewitch v2.1 - forgotten password */
.login-help-links{
    display:flex;
    justify-content:center;
    margin-top:2px;
    font-size:13px;
}
.login-help-links a{
    color:var(--blue-dark);
    font-weight:600;
}
.login-help-links a:hover{
    text-decoration:underline;
}
.user-admin-fields{
    grid-template-columns:minmax(190px,1fr) 150px minmax(190px,1fr) auto;
}
@media(max-width:1100px){
    .user-admin-fields{grid-template-columns:1fr 1fr;}
}
@media(max-width:600px){
    .user-admin-fields{grid-template-columns:1fr;}
}

/* Bluewitch v2.2 - centered copyright footer */
.site-footer{
    text-align:center;
}
.site-footer-copyright{
    margin-top:5px;
}

/* Bluewitch - center login card copyright */
.login-card .login-copyright{
    display:block !important;
    width:100% !important;
    max-width:none !important;
    margin:20px 0 0 0 !important;
    padding:0 !important;
    text-align:center !important;
    box-sizing:border-box;
    color:var(--muted);
    font-size:12px;
    line-height:1.5;
}

.login-card .login-copyright div{
    display:block;
    width:100%;
    margin:0;
    padding:0;
    text-align:center !important;
}


/* ============================================================
   Bluewitch v2.3.1 - Clearly Blue, Soft Theme
   Stronger blue identity while preserving the calm muted design.
   ============================================================ */

:root{
    --blue:#477aa3;
    --blue-dark:#285979;
    --blue-soft:#e1edf7;

    /* Existing components still using green variables inherit blue. */
    --green:#5f86a5;
    --green-soft:#e4eef6;

    --ink:#243847;
    --muted:#687b89;
    --line:#c4d4e0;
    --paper:#dfe9f2;
    --card:#edf3f8;
    --sand:#eef1f4;
    --shadow:0 10px 30px rgba(39,76,104,.08);
}

/* Main blue surfaces */
body,
.main{
    background:#dfe8f1 !important;
}

.topbar{
    background:#e8f0f7 !important;
    border-bottom-color:#c2d3df !important;
}

.sidebar{
    background:#d2e1ed !important;
    border-right-color:#b9cddb !important;
}

.sidebar a.active,
.sidebar .active,
.sidebar nav a:hover,
.sidebar nav a.active{
    background:#eaf2f8 !important;
    color:#285979 !important;
}

/* Dashboard hero */
.hero{
    background:linear-gradient(
        135deg,
        #cfdfee 0%,
        #e1ebf4 62%,
        #e8edf1 100%
    ) !important;
    border-color:#bfcfdd !important;
}

/* Cards */
.stat-card,
.category-card,
.project-card,
.article-card,
.card,
.article-row,
.article,
.empty{
    background:#edf3f8 !important;
    border-color:#c3d3df !important;
}

/* Inputs */
input,
textarea,
select,
.filters input,
.filters select,
.form input,
.form select,
.form textarea{
    background:#f3f7fa !important;
    border-color:#b9cbd9 !important;
}

/* Blue accent text */
.eyebrow,
.project-count,
.sidebar-user-info span{
    color:#4d7898 !important;
}

a{
    color:#285979;
}

/* Buttons */
.btn.primary,
.global-search button{
    background:#477aa3 !important;
    border-color:#477aa3 !important;
    color:#fff !important;
}

.btn.green{
    background:#5f86a5 !important;
    border-color:#5f86a5 !important;
}

/* Category / badge accents */
.category-card .icon{
    background:#dbe9f4 !important;
    color:#285979 !important;
}

.category-card:nth-child(2n) .icon{
    background:#e3edf5 !important;
    color:#446f8e !important;
}

.category-card:nth-child(3n) .icon{
    background:#e8eef3 !important;
    color:#567184 !important;
}

.badge,
.badge.green,
.badge.sand{
    background:#e0ebf4 !important;
    color:#355f7b !important;
}

/* Notices and blockquotes */
.notice{
    background:#e2edf5 !important;
    color:#355f78 !important;
    border-color:#c4d7e4 !important;
}

.article-body blockquote{
    border-left-color:#5f86a5 !important;
    background:#e5eef5 !important;
}

/* Attachments */
.attachment-editor{
    border-color:#b9cedd !important;
    background:rgba(241,247,251,.65) !important;
}

.attachment-editor input[type=file]{
    border-color:#99b5c8 !important;
    background:#f1f6fa !important;
}

.attachment-row,
.attachment-card{
    background:#e8f0f6 !important;
    border-color:#bfd1de !important;
}

.attachment-icon{
    background:#d4e5f1 !important;
    color:#2e6484 !important;
}

.article-attachments,
.profile-details{
    border-color:#bfd1de !important;
}

.profile-detail-row{
    border-bottom-color:#bfd1de !important;
}

/* User profile in sidebar */
.sidebar-user{
    background:#dfeaf2 !important;
    border-color:#b7cbd9 !important;
}

.sidebar-user-icon{
    background:#cadce9 !important;
}

.sidebar-user-link:hover .sidebar-user{
    background:#eaf2f8 !important;
    border-color:#9fb9cb !important;
}

.sidebar-user-arrow{
    color:#5e7e94 !important;
}

.profile-avatar{
    background:#d5e5f0 !important;
}

.profile-role-badge,
.user-pill{
    background:#dce9f3 !important;
    color:#345f7b !important;
}

/* Authentication pages */
.login-page{
    background:linear-gradient(
        135deg,
        #d7e5f0 0%,
        #e6eef5 58%,
        #edf1f4 100%
    ) !important;
}

.login-card{
    background:rgba(244,248,251,.97) !important;
    border-color:#bfd1de !important;
}

/* Code inline background gets a subtle blue cast */
.article-body p code,
.article-body li code{
    background:#e5edf3 !important;
    color:#31566d !important;
}

/* Preserve red error/danger semantics */
.error{
    background:#fff2f2 !important;
    color:#8e3f3f !important;
    border-color:#eed0d0 !important;
}

.btn.danger{
    background:#fff5f5 !important;
    color:var(--danger) !important;
    border-color:#ead1d1 !important;
}


/* ============================================================
   Bluewitch v2.4 - Enhanced Blue Workspace
   More depth and contrast on authenticated pages.
   Authentication cards remain calm and unchanged.
   ============================================================ */

:root{
    --bw-page:#d8e4ee;
    --bw-sidebar:#cbdce9;
    --bw-topbar:#e9f1f6;
    --bw-card:#f7fafc;
    --bw-card-alt:#eef5f9;
    --bw-border:#b8ccda;
    --bw-border-soft:#c8d8e3;
    --bw-primary:#3f79a4;
    --bw-primary-dark:#275a7d;
    --bw-primary-soft:#dcebf5;
    --bw-project:#7068a8;
    --bw-project-soft:#e9e7f6;
    --bw-topic:#4f8791;
    --bw-topic-soft:#dfeff0;
    --bw-warm:#9a7548;
    --bw-warm-soft:#f2e9dc;
}

/* ---------- Authenticated application canvas ---------- */
.app-shell{
    background:var(--bw-page);
}

.main{
    background:var(--bw-page) !important;
}

.sidebar{
    background:var(--bw-sidebar) !important;
    border-right:1px solid #adc4d3 !important;
    box-shadow:4px 0 18px rgba(42,79,104,.04);
}

.topbar{
    background:rgba(239,246,250,.94) !important;
    border-bottom:1px solid #b9cedb !important;
}

/* Search field gets clearer separation */
.global-search input{
    background:#f9fbfc !important;
    border-color:#aec5d4 !important;
    box-shadow:0 2px 8px rgba(38,75,101,.04);
}

.global-search button{
    background:var(--bw-primary) !important;
}
.global-search button:hover{
    background:var(--bw-primary-dark) !important;
}

/* ---------- Hero ---------- */
.hero{
    background:
        linear-gradient(135deg,#d2e4f1 0%,#e7f0f6 66%,#edf3f6 100%) !important;
    border:1px solid #abc4d5 !important;
    box-shadow:0 10px 26px rgba(41,78,104,.08) !important;
}

.hero h1{
    color:#203d51;
}

.hero .eyebrow{
    color:#39749c !important;
}

/* ---------- Buttons ---------- */
.btn{
    background:#f8fbfc;
    border-color:#b8cdda;
    box-shadow:0 2px 6px rgba(39,76,101,.04);
    transition:transform .14s ease, box-shadow .14s ease, background .14s ease;
}

.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 5px 12px rgba(39,76,101,.09);
}

.btn.primary,
.global-search button{
    background:var(--bw-primary) !important;
    border-color:var(--bw-primary) !important;
    color:#fff !important;
}

.btn.primary:hover{
    background:var(--bw-primary-dark) !important;
    border-color:var(--bw-primary-dark) !important;
}

/* The old green button becomes a complementary slate-blue action. */
.btn.green{
    background:#668aa4 !important;
    border-color:#668aa4 !important;
    color:#fff !important;
}

/* ---------- Dashboard / knowledge cards ---------- */
.stat-card,
.category-card,
.project-card,
.article-card,
.card{
    background:var(--bw-card) !important;
    border:1px solid var(--bw-border) !important;
    box-shadow:0 4px 13px rgba(39,76,101,.055) !important;
    transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.stat-card:hover,
.category-card:hover,
.project-card:hover,
.article-card:hover,
.card:hover{
    border-color:#95b5ca !important;
    box-shadow:0 8px 20px rgba(39,76,101,.09) !important;
}

.category-card:hover,
.project-card:hover{
    transform:translateY(-2px);
}

/* Overview values carry the Bluewitch accent more clearly. */
.metric strong{
    color:#225b80 !important;
}

/* Knowledge-area icons alternate through a restrained palette. */
.category-card .icon{
    background:#d9eaf5 !important;
    color:#2c688f !important;
}

.category-card:nth-child(2n) .icon{
    background:#e5e4f4 !important;
    color:#665e9e !important;
}

.category-card:nth-child(3n) .icon{
    background:#dcecee !important;
    color:#477d86 !important;
}

.category-card:nth-child(4n) .icon{
    background:#efe7dc !important;
    color:#8b6b45 !important;
}

/* ---------- Article list ---------- */
.article-row{
    background:#f6fafc !important;
    border:1px solid var(--bw-border) !important;
    box-shadow:0 3px 10px rgba(39,76,101,.045);
    transition:border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.article-row:hover{
    border-color:#94b5ca !important;
    box-shadow:0 7px 17px rgba(39,76,101,.08);
    transform:translateY(-1px);
}

.article-row h3,
.category-card h3,
.project-card h3{
    color:#174f73;
}

/* ---------- Colored metadata tags ----------
   Current Bluewitch article rows place Category first,
   Project second, and any further badge after those.
   This creates an immediate visual distinction without
   requiring a PHP/HTML change.
   --------------------------------------------------------- */
.badges .badge{
    border:1px solid transparent;
    font-weight:600;
    letter-spacing:.005em;
}

.badges .badge:nth-child(1){
    background:#d9eaf6 !important;
    color:#25658f !important;
    border-color:#c6deed !important;
}

.badges .badge:nth-child(2){
    background:var(--bw-project-soft) !important;
    color:#655d9e !important;
    border-color:#d8d4ed !important;
}

.badges .badge:nth-child(3){
    background:var(--bw-topic-soft) !important;
    color:#447a83 !important;
    border-color:#cbe1e3 !important;
}

.badges .badge:nth-child(n+4){
    background:var(--bw-warm-soft) !important;
    color:#856540 !important;
    border-color:#e5d8c5 !important;
}

/* Also make explicit legacy badge variants visibly distinct. */
.badge.green{
    background:var(--bw-project-soft) !important;
    color:#655d9e !important;
    border:1px solid #d8d4ed !important;
}

.badge.sand{
    background:var(--bw-warm-soft) !important;
    color:#856540 !important;
    border:1px solid #e5d8c5 !important;
}

/* ---------- Article reading surface ---------- */
.article{
    background:#f9fbfc !important;
    border:1px solid var(--bw-border) !important;
    box-shadow:0 8px 22px rgba(39,76,101,.07) !important;
}

.article-body blockquote{
    background:#e8f1f6 !important;
    border-left-color:#4d82a5 !important;
}

/* ---------- Forms / Admin / Profile ---------- */
input,
textarea,
select,
.filters input,
.filters select,
.form input,
.form select,
.form textarea{
    background:#f8fbfc !important;
    border-color:#afc6d5 !important;
}

input:focus,
textarea:focus,
select:focus{
    outline:none;
    border-color:#6592b0 !important;
    box-shadow:0 0 0 3px rgba(72,125,163,.12);
}

.sidebar-user{
    background:#e1ebf2 !important;
    border-color:#abc2d1 !important;
}

.sidebar-user-link:hover .sidebar-user{
    background:#edf4f8 !important;
    border-color:#8eafc4 !important;
}

.profile-avatar{
    background:#d5e6f1 !important;
}

.profile-role-badge{
    background:#dceaf4 !important;
    color:#315f7c !important;
}

/* ---------- Sidebar navigation ---------- */
.sidebar nav a{
    color:#29495d;
    transition:background .14s ease, color .14s ease;
}

.sidebar nav a:hover{
    background:#e5eff5 !important;
    color:#205c82 !important;
}

.sidebar nav a.active,
.sidebar .active{
    background:#f1f6f9 !important;
    color:#174f73 !important;
    box-shadow:0 3px 10px rgba(40,77,102,.07);
}

/* ---------- Footer ---------- */
.site-footer{
    color:#607987;
}

/* Authentication pages intentionally keep the existing v2.3.1
   login/reset/forgot-password styling. */


/* ============================================================
   Bluewitch v2.4.1 - Eye-comfort main workspace background
   Keeps the blue identity in navigation/cards, while making the
   large page canvas calmer and more neutral.
   ============================================================ */

:root{
    --bw-page:#e8edef;
}

/* Large authenticated workspace canvas */
.app-shell,
.main{
    background:#e8edef !important;
}

/* Give the content area a very subtle neutral-cool appearance */
.content{
    background:transparent;
}

/* Keep the sidebar visibly Bluewitch-blue */
.sidebar{
    background:#cbdce9 !important;
}

/* Hero remains blue, but softer against the neutral canvas */
.hero{
    background:linear-gradient(
        135deg,
        #d9e7f0 0%,
        #edf3f6 68%,
        #f2f4f4 100%
    ) !important;
}

/* Slightly warmer/cleaner cards to reduce the all-blue effect */
.stat-card,
.category-card,
.project-card,
.article-card,
.card,
.article-row,
.article,
.empty{
    background:#f8fafb !important;
}


/* ============================================================
   Bluewitch v2.5 - Premium Workspace
   Calm blue design with stronger hierarchy and a restrained
   "wow" effect. Authentication page styling is left unchanged.
   ============================================================ */

/* Subtle ambient depth instead of a flat canvas */
.app-shell,
.main{
    background:
        radial-gradient(circle at 78% 10%, rgba(83,146,185,.10) 0, rgba(83,146,185,0) 30%),
        radial-gradient(circle at 28% 70%, rgba(102,119,174,.055) 0, rgba(102,119,174,0) 28%),
        #e9eef1 !important;
}

/* Premium sidebar: still soft, but visually branded */
.sidebar{
    background:
        linear-gradient(180deg,#c9ddea 0%,#d6e4ed 58%,#cbdde8 100%) !important;
    border-right:1px solid #aac2d2 !important;
    box-shadow:5px 0 22px rgba(31,69,94,.055);
}

/* Fine accent under logo area */
.brand-logo-link{
    position:relative;
}
.brand-logo-link::after{
    content:"";
    position:absolute;
    left:7px;
    right:7px;
    bottom:11px;
    height:2px;
    border-radius:999px;
    background:linear-gradient(90deg,#2f78a8,#35a3a1,rgba(53,163,161,0));
    opacity:.68;
}

/* Top bar */
.topbar{
    background:rgba(244,248,250,.91) !important;
    border-bottom-color:#becfda !important;
    box-shadow:0 3px 14px rgba(39,75,99,.035);
}

/* Hero becomes the visual anchor */
.hero{
    position:relative;
    overflow:hidden;
    background:
        radial-gradient(circle at 89% 22%, rgba(51,151,170,.14) 0, rgba(51,151,170,0) 24%),
        radial-gradient(circle at 75% 88%, rgba(75,105,173,.08) 0, rgba(75,105,173,0) 27%),
        linear-gradient(135deg,#d6e7f2 0%,#eef4f7 58%,#f5f7f7 100%) !important;
    border:1px solid #a8c2d3 !important;
    box-shadow:
        0 14px 34px rgba(33,71,96,.09),
        inset 0 1px 0 rgba(255,255,255,.65) !important;
}

.hero::before{
    content:"";
    position:absolute;
    inset:0 auto 0 0;
    width:5px;
    background:linear-gradient(180deg,#347eae,#41aaa4);
}

.hero::after{
    content:"";
    position:absolute;
    width:180px;
    height:180px;
    right:-55px;
    top:-70px;
    border-radius:50%;
    border:28px solid rgba(52,126,174,.045);
    pointer-events:none;
}

.hero h1{
    color:#183f58 !important;
    letter-spacing:-.018em;
}

.hero .eyebrow{
    color:#34789f !important;
}

/* Main action buttons gain depth */
.btn.primary,
.global-search button{
    background:linear-gradient(135deg,#397eae,#3f7397) !important;
    border-color:#39759d !important;
    box-shadow:0 5px 13px rgba(49,110,151,.18);
}

.btn.primary:hover,
.global-search button:hover{
    background:linear-gradient(135deg,#2f719f,#315f80) !important;
}

.btn.green{
    background:linear-gradient(135deg,#638ba7,#537994) !important;
    border-color:#5b819c !important;
}

/* Section headings */
.section-title h2,
.content > h2{
    color:#183f58;
}

/* Overview cards: bright surface + individual accent strips */
.stat-card{
    position:relative;
    overflow:hidden;
    background:linear-gradient(180deg,#fbfcfd,#f5f9fb) !important;
    border-color:#b8ccd9 !important;
    box-shadow:0 6px 17px rgba(37,74,99,.065) !important;
}

.stat-card::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    top:0;
    height:4px;
    background:linear-gradient(90deg,#3b82b2,#58a9bc);
}

.stat-card:nth-child(2)::before{
    background:linear-gradient(90deg,#6d6baa,#8b86c4);
}

.stat-card:nth-child(3)::before{
    background:linear-gradient(90deg,#438b94,#65acaa);
}

.stat-card:nth-child(4)::before{
    background:linear-gradient(90deg,#9b754d,#c09b69);
}

.metric strong{
    color:#1d5b81 !important;
}

/* Knowledge cards: crisp and slightly elevated */
.category-card,
.project-card{
    position:relative;
    overflow:hidden;
    background:linear-gradient(180deg,#fbfcfd 0%,#f6f9fb 100%) !important;
    border-color:#b9cedb !important;
    box-shadow:0 6px 16px rgba(38,75,100,.06) !important;
}

.category-card::after,
.project-card::after{
    content:"";
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    height:3px;
    background:#4b8eb8;
    opacity:0;
    transition:opacity .15s ease;
}

.category-card:nth-child(2n)::after{background:#7770b0;}
.category-card:nth-child(3n)::after{background:#53949b;}
.category-card:nth-child(4n)::after{background:#a57c4c;}

.category-card:hover::after,
.project-card:hover::after{
    opacity:.75;
}

.category-card:hover,
.project-card:hover{
    transform:translateY(-3px);
    border-color:#91b2c7 !important;
    box-shadow:0 12px 24px rgba(37,74,99,.10) !important;
}

/* Make icon tiles look intentional instead of decorative dots */
.category-card .icon{
    box-shadow:inset 0 0 0 1px rgba(54,117,157,.06);
}

/* Article rows */
.article-row{
    background:linear-gradient(180deg,#fbfcfd,#f6fafc) !important;
    border-color:#b9cdda !important;
}

.article-row:hover{
    border-color:#8eaec3 !important;
    box-shadow:0 10px 22px rgba(37,74,99,.09);
}

/* Metadata chips feel more like real labels */
.badges .badge,
.badge{
    border-radius:7px !important;
    padding:5px 8px !important;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);
}

/* Search field */
.global-search input{
    background:rgba(255,255,255,.90) !important;
    border-color:#abc2d1 !important;
}

/* Sidebar selected item has a Bluewitch accent */
.sidebar nav a.active,
.sidebar .active{
    position:relative;
    background:rgba(248,251,253,.92) !important;
    color:#174f73 !important;
    box-shadow:0 5px 13px rgba(35,72,97,.075);
}

.sidebar nav a.active::before{
    content:"";
    position:absolute;
    left:0;
    top:9px;
    bottom:9px;
    width:3px;
    border-radius:0 3px 3px 0;
    background:linear-gradient(180deg,#347eae,#40a8a3);
}

/* Profile card in sidebar */
.sidebar-user{
    background:rgba(238,246,250,.72) !important;
    border-color:#a9c1d0 !important;
    box-shadow:0 4px 12px rgba(35,71,95,.045);
}

/* Footer stays quiet */
.site-footer{
    opacity:.88;
}


/* ============================================================
   Bluewitch v2.5.1 - Eye Comfort Workspace
   Softer neutral canvas and low-glare cards.
   Keeps the premium Bluewitch accents from v2.5.
   ============================================================ */

:root{
    --bw-page:#e5e8e6;
    --bw-card:#f1f3f2;
    --bw-card-alt:#edf1f1;
    --bw-border:#bdcbd0;
    --bw-border-soft:#cad4d7;
}

/* Remove the cool blue cast from the large viewing area. */
.app-shell,
.main{
    background:#e5e8e6 !important;
}

/* Keep the content canvas calm and uniform. */
.content{
    background:transparent !important;
}

/* Softer, slightly warm-neutral cards: less glare than white. */
.stat-card,
.category-card,
.project-card,
.article-card,
.card,
.article-row,
.article,
.empty{
    background:#f1f3f2 !important;
    border-color:#bdcbd0 !important;
    box-shadow:0 4px 13px rgba(40,64,73,.045) !important;
}

/* Overview cards need only a gentle separation from the page. */
.stat-card{
    background:#f3f5f4 !important;
}

/* Knowledge cards are a fraction darker for comfortable scanning. */
.category-card,
.project-card{
    background:#f2f4f3 !important;
}

/* Hover without a bright white flash. */
.stat-card:hover,
.category-card:hover,
.project-card:hover,
.article-card:hover,
.card:hover,
.article-row:hover{
    background:#f5f6f5 !important;
    border-color:#9fb5bd !important;
    box-shadow:0 8px 18px rgba(40,64,73,.065) !important;
}

/* Hero remains the branded focal area but with reduced brightness. */
.hero{
    background:
        radial-gradient(circle at 89% 22%, rgba(51,151,170,.10) 0, rgba(51,151,170,0) 24%),
        radial-gradient(circle at 75% 88%, rgba(75,105,173,.055) 0, rgba(75,105,173,0) 27%),
        linear-gradient(135deg,#d6e3e8 0%,#e8eeef 60%,#eef1ef 100%) !important;
    border-color:#adc1c8 !important;
    box-shadow:0 10px 24px rgba(38,65,75,.065) !important;
}

/* Inputs/search use the same low-glare family. */
.global-search input,
input,
textarea,
select,
.filters input,
.filters select,
.form input,
.form select,
.form textarea{
    background:#f5f6f5 !important;
    border-color:#b8c8ce !important;
}

/* Reading surface should also avoid pure/near white. */
.article{
    background:#f3f5f4 !important;
}

/* Keep text readable but not harsh black. */
body{
    color:#293b43;
}

/* Authentication pages intentionally remain unchanged. */


/* ============================================================
   Bluewitch v2.6 - Signature Blue / Turquoise Gradient
   Based on the approved Gradient Hero concept.
   Existing functionality and authentication layouts preserved.
   ============================================================ */

:root{
    --bw-navy:#073d68;
    --bw-navy-deep:#052f52;
    --bw-blue:#0879c4;
    --bw-blue-bright:#159bdb;
    --bw-turquoise:#31c9c0;
    --bw-cyan-soft:#dff5f7;
    --bw-page:#edf5f8;
    --bw-card:#ffffff;
    --bw-border:#d3e2ea;
    --bw-text:#12344d;
    --bw-muted:#668298;
}

/* ---------- Main application ---------- */
.app-shell,
.main{
    background:
        radial-gradient(circle at 78% 8%, rgba(49,201,192,.065), transparent 27%),
        linear-gradient(180deg,#f0f7fa 0%,#edf4f7 100%) !important;
}

body{
    color:var(--bw-text);
}

/* ---------- Deep branded sidebar ---------- */
.sidebar{
    background:
        radial-gradient(circle at 35% 4%, rgba(27,151,196,.20), transparent 24%),
        linear-gradient(180deg,#073f6b 0%,#06395f 55%,#052f52 100%) !important;
    border-right:1px solid rgba(255,255,255,.08) !important;
    box-shadow:6px 0 24px rgba(5,47,82,.13);
}

.brand-logo-link::after{
    background:linear-gradient(90deg,#1ca6db,#31c9c0,rgba(49,201,192,0)) !important;
    opacity:.85 !important;
}

.sidebar nav a,
.sidebar-bottom > a{
    color:#d6eaf5 !important;
}

.sidebar nav a span{
    color:#a9d4e8;
}

.sidebar nav a:hover{
    background:rgba(20,142,197,.22) !important;
    color:#fff !important;
}

.sidebar nav a.active,
.sidebar .active{
    background:linear-gradient(90deg,rgba(17,135,197,.58),rgba(22,163,202,.35)) !important;
    color:#fff !important;
    border:1px solid rgba(72,201,231,.24);
    box-shadow:0 7px 18px rgba(0,24,44,.16);
}

.sidebar nav a.active::before{
    background:linear-gradient(180deg,#67dcf1,#31c9c0) !important;
}

.sidebar-user{
    background:rgba(16,119,173,.24) !important;
    border-color:rgba(116,205,229,.28) !important;
    box-shadow:0 5px 15px rgba(0,25,45,.13);
}

.sidebar-user-link:hover .sidebar-user{
    background:rgba(20,147,195,.31) !important;
    border-color:rgba(121,220,237,.42) !important;
}

.sidebar-user-info strong{
    color:#fff !important;
}

.sidebar-user-info span{
    color:#9ed9ea !important;
}

.sidebar-user-icon{
    background:rgba(200,235,246,.18) !important;
}

.sidebar-user-arrow{
    color:#b9e1ed !important;
}

/* ---------- Top bar ---------- */
.topbar{
    background:rgba(250,253,254,.95) !important;
    border-bottom:1px solid #d5e3ea !important;
    box-shadow:0 4px 16px rgba(20,69,99,.045);
}

.global-search input{
    background:#fff !important;
    border-color:#cadde7 !important;
}

.global-search button{
    background:linear-gradient(135deg,#0a82c7,#086ca8) !important;
    border-color:#0877b7 !important;
    box-shadow:0 5px 14px rgba(8,121,196,.18);
}

.global-search button:hover{
    background:linear-gradient(135deg,#0875b6,#075f96) !important;
}

/* ---------- Signature gradient hero ---------- */
.hero{
    position:relative;
    overflow:hidden;
    color:#fff;
    background:
        radial-gradient(circle at 88% 18%,rgba(255,255,255,.16),transparent 19%),
        radial-gradient(circle at 72% 100%,rgba(78,231,218,.18),transparent 28%),
        linear-gradient(120deg,#1267c4 0%,#078fc7 50%,#31c9c0 100%) !important;
    border:1px solid rgba(26,151,194,.55) !important;
    box-shadow:0 15px 34px rgba(13,104,155,.18) !important;
}

.hero::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    bottom:0;
    width:5px;
    background:linear-gradient(180deg,#a6eff4,#48dccd);
}

.hero::after{
    content:"✦";
    position:absolute;
    right:7%;
    top:16%;
    width:130px;
    height:130px;
    display:grid;
    place-items:center;
    border-radius:50%;
    border:24px solid rgba(255,255,255,.07);
    color:rgba(255,255,255,.55);
    font-size:48px;
    line-height:1;
    pointer-events:none;
}

.hero h1{
    position:relative;
    z-index:1;
    color:#fff !important;
    letter-spacing:-.02em;
}

.hero .eyebrow{
    position:relative;
    z-index:1;
    color:#d8f6fb !important;
}

.hero p{
    position:relative;
    z-index:1;
    color:#e5f5fb !important;
}

.hero-actions{
    position:relative;
    z-index:1;
}

.hero .btn.primary{
    background:#fff !important;
    border-color:#fff !important;
    color:#0c5e99 !important;
    box-shadow:0 7px 17px rgba(5,67,105,.18);
}

.hero .btn.primary:hover{
    background:#f1fbfd !important;
}

.hero .btn.green,
.hero .btn:not(.primary){
    background:rgba(255,255,255,.12) !important;
    border-color:rgba(255,255,255,.62) !important;
    color:#fff !important;
    backdrop-filter:blur(4px);
}

/* ---------- Section headings ---------- */
.section-title h2,
.content > h2{
    color:#123a56;
}

/* ---------- Overview cards ---------- */
.stat-card{
    position:relative;
    overflow:hidden;
    background:#fff !important;
    border:1px solid var(--bw-border) !important;
    box-shadow:0 7px 18px rgba(27,78,108,.065) !important;
}

.stat-card::before{
    content:"";
    position:absolute;
    inset:0 0 auto 0;
    height:4px;
    background:linear-gradient(90deg,#168fda,#3dc1e3) !important;
}

.stat-card:nth-child(2)::before{
    background:linear-gradient(90deg,#8467d8,#aa8bea) !important;
}

.stat-card:nth-child(3)::before{
    background:linear-gradient(90deg,#1da89d,#55d1bf) !important;
}

.stat-card:nth-child(4)::before{
    background:linear-gradient(90deg,#d89a37,#efbe69) !important;
}

.metric strong{
    color:#0c5684 !important;
}

/* ---------- Knowledge area cards ---------- */
.category-card,
.project-card{
    background:#fff !important;
    border:1px solid var(--bw-border) !important;
    box-shadow:0 7px 18px rgba(27,78,108,.06) !important;
}

.category-card:hover,
.project-card:hover{
    transform:translateY(-3px);
    border-color:#9fc4d7 !important;
    box-shadow:0 12px 26px rgba(26,83,117,.11) !important;
}

.category-card h3,
.project-card h3{
    color:#0d456b !important;
}

.category-card .icon{
    background:#d8f0fc !important;
    color:#0879c4 !important;
}

.category-card:nth-child(2n) .icon{
    background:#eee5ff !important;
    color:#7253c5 !important;
}

.category-card:nth-child(3n) .icon{
    background:#d9f4f0 !important;
    color:#12877f !important;
}

.category-card:nth-child(4n) .icon{
    background:#fff0d9 !important;
    color:#a8690c !important;
}

.category-card::after,
.project-card::after{
    height:3px !important;
}
.category-card:nth-child(1)::after,
.category-card:nth-child(5)::after{background:#159bdb !important;}
.category-card:nth-child(2)::after{background:#8669d4 !important;}
.category-card:nth-child(3)::after{background:#25b4a8 !important;}
.category-card:nth-child(4)::after{background:#dda147 !important;}

/* ---------- Article rows / reading surfaces ---------- */
.article-row,
.article,
.card,
.empty{
    background:#fff !important;
    border-color:#d1e1e9 !important;
    box-shadow:0 5px 15px rgba(27,78,108,.05) !important;
}

.article-row:hover{
    border-color:#9fc2d5 !important;
    box-shadow:0 10px 23px rgba(26,83,117,.09) !important;
}

.article-row h3{
    color:#0c4f79 !important;
}

/* ---------- Colored metadata chips ---------- */
.badges .badge,
.badge{
    border-radius:8px !important;
    padding:5px 8px !important;
    font-weight:600;
}

.badges .badge:nth-child(1),
.badge:not(.green):not(.sand){
    background:#dff1fc !important;
    color:#08659d !important;
    border:1px solid #c5e4f5 !important;
}

.badges .badge:nth-child(2),
.badge.green{
    background:#eee7fc !important;
    color:#684fae !important;
    border:1px solid #ddd2f5 !important;
}

.badges .badge:nth-child(3){
    background:#dff4f1 !important;
    color:#347d78 !important;
    border:1px solid #c9e8e3 !important;
}

.badges .badge:nth-child(n+4),
.badge.sand{
    background:#faeddc !important;
    color:#8d642e !important;
    border:1px solid #eddcc5 !important;
}

/* ---------- Forms ---------- */
input,
textarea,
select,
.filters input,
.filters select,
.form input,
.form select,
.form textarea{
    background:#fff !important;
    border-color:#c6d9e3 !important;
}

input:focus,
textarea:focus,
select:focus{
    outline:none;
    border-color:#3c9bc8 !important;
    box-shadow:0 0 0 3px rgba(31,153,207,.12);
}

/* ---------- General primary actions outside hero ---------- */
.btn.primary{
    background:linear-gradient(135deg,#0b83c7,#086eab) !important;
    border-color:#0878b8 !important;
    color:#fff !important;
}

.btn.primary:hover{
    background:linear-gradient(135deg,#0875b6,#075f96) !important;
}

/* ---------- Article blockquotes ---------- */
.article-body blockquote{
    background:#e9f6fa !important;
    border-left-color:#1b9cc5 !important;
}

/* ---------- Profile ---------- */
.profile-avatar{
    background:#d9edf7 !important;
}

.profile-role-badge{
    background:#e1f1f7 !important;
    color:#276882 !important;
}

/* ---------- Footer ---------- */
.site-footer{
    color:#617d8e;
}

/* Authentication pages intentionally retain their existing
   login/reset/forgot-password card treatment. */


/* ============================================================
   Bluewitch v2.6.1 - Sidebar gradient + cleaner hero left edge
   ============================================================ */

/* Make the sidebar brighter at the top for better logo visibility,
   while keeping a deep Bluewitch tone lower down. */
.sidebar{
    background:
        radial-gradient(circle at 22% 8%, rgba(76,214,244,.18), transparent 24%),
        radial-gradient(circle at 75% 0%, rgba(49,201,192,.12), transparent 20%),
        linear-gradient(180deg,#0b6ea7 0%, #085887 22%, #063f69 56%, #052f52 100%) !important;
}

/* Remove the separate accent strip on the left side of the hero,
   so the card edge is visually consistent. */
.hero::before{
    display:none !important;
    content:none !important;
}

/* Keep the hero card clean and uniform on the left edge. */
.hero{
    border-left:1px solid rgba(26,151,194,.55) !important;
    background:
        radial-gradient(circle at 88% 18%,rgba(255,255,255,.16),transparent 19%),
        radial-gradient(circle at 72% 100%,rgba(78,231,218,.18),transparent 28%),
        linear-gradient(120deg,#1267c4 0%,#078fc7 50%,#31c9c0 100%) !important;
}


/* ============================================================
   Bluewitch v2.6.2 - Better logo visibility + lighter user icon
   ============================================================ */

/* Logo area: add a soft light panel behind the logo so the
   Bluewitch wordmark stays readable on the dark sidebar. */
.brand-logo-link{
    position:relative;
    display:block;
    padding:14px 14px 12px !important;
    border-radius:18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.06) 100%) !important;
    border:1px solid rgba(139,220,242,.20) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.10),
        0 10px 24px rgba(0,26,48,.14);
    backdrop-filter:blur(3px);
}

.brand-logo-link img{
    position:relative;
    z-index:1;
    filter:drop-shadow(0 3px 10px rgba(4,37,68,.18));
}

/* Slightly brighter accent line under the logo */
.brand-logo-link::after{
    left:10px !important;
    right:10px !important;
    bottom:8px !important;
    height:2px !important;
    background:linear-gradient(90deg,#58d1ef,#31c9c0,rgba(49,201,192,0)) !important;
    opacity:.95 !important;
}

/* Sidebar user card remains dark-blue, but the avatar tile becomes
   clearly lighter and cleaner. */
.sidebar-user-icon{
    background:linear-gradient(135deg,#e8f7fb 0%, #bde7f1 100%) !important;
    border:1px solid rgba(255,255,255,.42);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.75),
        0 4px 10px rgba(0,24,44,.12);
    color:#0b77b7 !important;
}

.sidebar-user-icon svg,
.sidebar-user-icon i,
.sidebar-user-icon span{
    color:#0b77b7 !important;
    fill:#0b77b7 !important;
}

/* Slightly cleaner user card text contrast */
.sidebar-user-info strong{
    color:#ffffff !important;
}

.sidebar-user-info span{
    color:#cfeefa !important;
}


/* ============================================================
   Bluewitch v2.6.3 - Seamless modern sidebar header
   No separate logo card; one continuous sidebar gradient.
   ============================================================ */

/* Smooth, continuous gradient across the entire left pane.
   Slightly brighter behind the logo at the top, then deeper navy
   toward the bottom for a modern integrated look. */
.sidebar{
    background:
        radial-gradient(ellipse at 52% 5%, rgba(72,214,232,.22) 0%, rgba(72,214,232,.08) 24%, transparent 43%),
        linear-gradient(180deg,
            #117aa4 0%,
            #0c698f 13%,
            #08577f 30%,
            #07466f 56%,
            #063a61 78%,
            #052f52 100%
        ) !important;
    border-right:1px solid rgba(13,74,107,.28) !important;
}

/* Remove the separate card treatment completely. */
.brand-logo-link{
    position:relative;
    display:block;
    padding:5px 4px 22px !important;
    margin:0 !important;
    border:0 !important;
    border-radius:0 !important;
    background:transparent !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
}

/* Keep the logo itself crisp against the brighter gradient. */
.brand-logo-link img,
.brand-logo{
    position:relative;
    z-index:1;
    filter:
        drop-shadow(0 2px 3px rgba(0,31,54,.20))
        drop-shadow(0 0 8px rgba(110,226,238,.10)) !important;
}

/* Replace the card underline with a very subtle integrated separator. */
.brand-logo-link::after{
    content:"" !important;
    position:absolute;
    left:7px !important;
    right:7px !important;
    bottom:11px !important;
    height:1px !important;
    border-radius:999px;
    background:linear-gradient(
        90deg,
        transparent 0%,
        rgba(121,225,237,.60) 22%,
        rgba(62,202,205,.72) 50%,
        rgba(121,225,237,.30) 78%,
        transparent 100%
    ) !important;
    opacity:.75 !important;
}

/* User avatar stays light and readable against the deep lower sidebar. */
.sidebar-user-icon{
    background:linear-gradient(135deg,#eefafd 0%,#c5eaf3 100%) !important;
    border:1px solid rgba(255,255,255,.52) !important;
    color:#0a75ad !important;
    box-shadow:0 3px 9px rgba(0,24,44,.13) !important;
}


/* ============================================================
   Bluewitch v2.6.4 - Logo visibility refinement
   Brighter turquoise/sky-blue glow behind the logo, blended
   seamlessly into the existing sidebar gradient.
   ============================================================ */

.sidebar{
    background:
        radial-gradient(
            ellipse at 46% 5%,
            rgba(105,225,235,.42) 0%,
            rgba(62,192,218,.25) 17%,
            rgba(26,147,185,.13) 32%,
            transparent 49%
        ),
        linear-gradient(
            180deg,
            #1888ad 0%,
            #11779f 12%,
            #0b628c 27%,
            #084e78 45%,
            #074269 62%,
            #06385e 80%,
            #052f52 100%
        ) !important;
}

/* Slightly stronger definition on the logo itself without creating
   a separate panel/card behind it. */
.brand-logo-link img,
.brand-logo{
    filter:
        drop-shadow(0 2px 3px rgba(0,35,58,.22))
        drop-shadow(0 0 10px rgba(116,231,238,.18)) !important;
}


/* ============================================================
   Bluewitch v2.7 - Approved Option 2 Sidebar
   Soft radial highlight behind logo, seamless deep-blue sidebar.
   Based on the approved visual mockup.
   ============================================================ */

/* One continuous sidebar: luminous around logo, deep navy below. */
.sidebar{
    background:
        radial-gradient(
            ellipse 125% 24% at 50% 2%,
            rgba(69,202,232,.72) 0%,
            rgba(28,157,203,.50) 24%,
            rgba(11,104,159,.25) 46%,
            rgba(7,72,119,0) 69%
        ),
        linear-gradient(
            180deg,
            #0876ad 0%,
            #075b91 19%,
            #064977 37%,
            #053c67 59%,
            #04345b 78%,
            #032c4e 100%
        ) !important;
    border-right:1px solid rgba(4,53,88,.32) !important;
    box-shadow:6px 0 24px rgba(4,44,77,.10) !important;
}

/* Logo is integrated directly into the gradient — no card. */
.brand-logo-link{
    position:relative !important;
    display:block !important;
    padding:3px 4px 22px !important;
    margin:0 !important;
    background:transparent !important;
    border:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    backdrop-filter:none !important;
    overflow:visible !important;
}

/* Make the existing logo image more legible without changing its colors. */
.brand-logo-link img,
.brand-logo{
    position:relative;
    z-index:1;
    filter:
        drop-shadow(0 2px 3px rgba(0,28,52,.24))
        drop-shadow(0 0 12px rgba(84,220,237,.20)) !important;
}

/* Quiet separator like the approved mockup. */
.brand-logo-link::after{
    content:"" !important;
    position:absolute !important;
    left:8px !important;
    right:8px !important;
    bottom:10px !important;
    height:1px !important;
    border-radius:999px !important;
    background:linear-gradient(
        90deg,
        transparent 0%,
        rgba(111,224,239,.32) 14%,
        rgba(111,224,239,.68) 50%,
        rgba(111,224,239,.32) 86%,
        transparent 100%
    ) !important;
    opacity:.90 !important;
}

/* Navigation spacing and readability. */
.sidebar nav{
    gap:7px !important;
}

.sidebar nav a,
.sidebar-bottom > a{
    color:#e4f1f8 !important;
}

.sidebar nav a span{
    color:#b6dceb !important;
}

.sidebar nav a:hover{
    background:rgba(19,145,199,.20) !important;
    color:#fff !important;
}

/* Selected navigation item mirrors Option 2. */
.sidebar nav a.active,
.sidebar .active{
    position:relative;
    background:linear-gradient(
        90deg,
        rgba(10,137,198,.72) 0%,
        rgba(14,151,205,.50) 100%
    ) !important;
    color:#fff !important;
    border:1px solid rgba(78,202,231,.22) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.08),
        0 7px 16px rgba(0,29,52,.14) !important;
}

.sidebar nav a.active::before{
    content:"";
    position:absolute;
    left:0;
    top:9px;
    bottom:9px;
    width:3px;
    border-radius:0 4px 4px 0;
    background:#62def0 !important;
}

/* User profile: translucent, integrated into the sidebar. */
.sidebar-user{
    background:rgba(5,82,133,.42) !important;
    border:1px solid rgba(69,191,225,.48) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.055),
        0 6px 16px rgba(0,25,46,.12) !important;
}

.sidebar-user-link:hover .sidebar-user{
    background:rgba(8,108,165,.48) !important;
    border-color:rgba(92,214,237,.62) !important;
}

/* Light clean avatar from the approved concept. */
.sidebar-user-icon{
    background:linear-gradient(135deg,#f8fcfd 0%,#d9f1f7 100%) !important;
    border:1px solid rgba(255,255,255,.72) !important;
    color:#087ac0 !important;
    box-shadow:
        0 3px 9px rgba(0,24,44,.13),
        inset 0 1px 0 rgba(255,255,255,.95) !important;
}

.sidebar-user-icon svg,
.sidebar-user-icon i,
.sidebar-user-icon span{
    color:#087ac0 !important;
    fill:#087ac0 !important;
}

.sidebar-user-info strong{
    color:#fff !important;
}

.sidebar-user-info span{
    color:#c5e9f5 !important;
}

.sidebar-user-arrow{
    color:#d8f2f8 !important;
}

/* Logout stays understated but readable. */
.sidebar-bottom > a:last-child{
    color:#d6ebf5 !important;
}

.sidebar-bottom > a:last-child:hover{
    color:#fff !important;
    background:rgba(255,255,255,.055) !important;
}

/* Keep the approved v2.6 gradient hero and light workspace unchanged. */


/* ============================================================
   Bluewitch v2.7.1 - Option 2 closer match
   Stronger logo-zone illumination without a separate logo card.
   ============================================================ */

/* The approved mockup has a much stronger cyan illumination behind
   the logo than v2.7. Keep it seamless by making it part of the
   sidebar background itself. */
.sidebar{
    background:
        radial-gradient(
            ellipse 150% 22% at 50% 1%,
            rgba(84,220,239,.92) 0%,
            rgba(33,180,220,.74) 22%,
            rgba(10,126,181,.46) 43%,
            rgba(6,82,137,.18) 61%,
            rgba(4,61,105,0) 76%
        ),
        linear-gradient(
            180deg,
            #0a84ba 0%,
            #0871a7 15%,
            #07598e 31%,
            #064675 48%,
            #053b67 65%,
            #04345a 82%,
            #032b4d 100%
        ) !important;
}

/* Increase the real raster logo's brightness/saturation slightly.
   The generated concept image naturally rendered the logo brighter
   than the source file used on the live site. */
.brand-logo-link img,
.brand-logo{
    filter:
        brightness(1.16)
        saturate(1.18)
        contrast(1.06)
        drop-shadow(0 2px 3px rgba(0,30,52,.20))
        drop-shadow(0 0 13px rgba(109,234,242,.28)) !important;
}

/* Keep the separator subtle so the top remains one continuous surface. */
.brand-logo-link::after{
    background:linear-gradient(
        90deg,
        transparent 0%,
        rgba(151,237,246,.22) 15%,
        rgba(151,237,246,.58) 50%,
        rgba(151,237,246,.22) 85%,
        transparent 100%
    ) !important;
    opacity:.75 !important;
}


/* =========================================================
   Bluewitch v2.12 - Article code block toolbar
   Language label + Copy button
   ========================================================= */

.article-body .bw-code-block{
    position:relative;
    margin:18px 0;
    border:1px solid #294451;
    border-radius:12px;
    overflow:hidden;
    background:#1f2e34;
    box-shadow:0 5px 15px rgba(13,42,56,.08);
}

.article-body .bw-code-toolbar{
    min-height:38px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:7px 9px 7px 13px;
    background:linear-gradient(180deg,#263b45 0%,#22343d 100%);
    border-bottom:1px solid rgba(190,222,234,.12);
}

.article-body .bw-code-language{
    color:#a9d9e7;
    font-size:11px;
    line-height:1;
    font-weight:800;
    letter-spacing:.09em;
    text-transform:uppercase;
    user-select:none;
}

.article-body .bw-code-copy{
    appearance:none;
    border:1px solid rgba(162,213,228,.24);
    border-radius:7px;
    background:rgba(255,255,255,.055);
    color:#d8edf3;
    padding:5px 9px;
    font:600 11px/1.15 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    cursor:pointer;
    transition:background .14s ease,border-color .14s ease,color .14s ease,transform .14s ease;
}

.article-body .bw-code-copy:hover{
    background:rgba(57,180,213,.15);
    border-color:rgba(105,213,235,.40);
    color:#fff;
}

.article-body .bw-code-copy:active{
    transform:translateY(1px);
}

.article-body .bw-code-copy.is-copied{
    background:rgba(49,201,192,.15);
    border-color:rgba(73,217,205,.38);
    color:#b9f1ea;
}

.article-body .bw-code-block > pre{
    margin:0 !important;
    border-radius:0 !important;
    box-shadow:none !important;
    border:0 !important;
    background:#1f2e34 !important;
    padding:16px !important;
}

.article-body .bw-code-block > pre > code{
    background:transparent !important;
    color:inherit !important;
    padding:0 !important;
    border-radius:0 !important;
}

@media(max-width:600px){
    .article-body .bw-code-toolbar{
        padding-left:10px;
    }
    .article-body .bw-code-copy{
        padding:5px 8px;
    }
}

/* =========================================================
   Bluewitch v2.12.1 - Restore v2.11.2 top search alignment
   ========================================================= */

.topbar{
    padding-left:max(30px, calc((100% - 1320px) / 2 + 30px)) !important;
    padding-right:max(30px, calc((100% - 1320px) / 2 + 30px)) !important;
    background:
        radial-gradient(circle at 78% 8%, rgba(49,201,192,.065), transparent 27%),
        linear-gradient(180deg,#f0f7fa 0%,#edf4f7 100%) !important;
    border-bottom:1px solid #d5e3ea !important;
    box-shadow:none !important;
}

.global-search{
    max-width:720px;
}

@media(max-width:760px){
    .topbar{
        padding-left:14px !important;
        padding-right:14px !important;
    }
}

/* =========================================================
   Bluewitch v2.14 - Automatic article Table of Contents
   ========================================================= */

.article.bw-has-toc{
    overflow:visible;
}

.bw-article-layout{
    display:grid;
    grid-template-columns:minmax(0,1fr) 230px;
    gap:32px;
    align-items:start;
}

.bw-article-main{
    min-width:0;
}

.bw-article-toc{
    position:sticky;
    top:96px;
    max-height:calc(100vh - 120px);
    overflow:auto;
    padding:16px 15px;
    border:1px solid #d3e2ea;
    border-radius:14px;
    background:rgba(248,252,253,.94);
    box-shadow:0 5px 16px rgba(27,78,108,.055);
    backdrop-filter:blur(7px);
}

.bw-toc-title{
    margin:0 0 11px;
    padding-bottom:9px;
    border-bottom:1px solid #dbe7ed;
    color:#0b567f;
    font-size:11px;
    font-weight:800;
    letter-spacing:.09em;
    text-transform:uppercase;
}

.bw-toc-list{
    display:flex;
    flex-direction:column;
    gap:2px;
}

.bw-toc-link{
    display:block;
    padding:6px 8px;
    border-radius:7px;
    color:#58758a;
    font-size:12px;
    line-height:1.35;
    transition:background .14s ease,color .14s ease;
}

.bw-toc-link:hover{
    background:#e9f5f9;
    color:#0a6e9f;
}

.bw-toc-link.bw-toc-h3{
    padding-left:20px;
    font-size:11.5px;
}

.bw-toc-link.is-active{
    background:#e3f3f8;
    color:#0879b9;
    font-weight:700;
}

.article-body h2,
.article-body h3{
    scroll-margin-top:92px;
}

/* Mobile/tablet collapsible TOC */
.bw-mobile-toc{
    display:none;
    margin:0 0 22px;
    border:1px solid #d3e2ea;
    border-radius:12px;
    background:#f8fcfd;
    overflow:hidden;
}

.bw-mobile-toc-toggle{
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding:12px 14px;
    border:0;
    background:transparent;
    color:#0b567f;
    font:700 13px/1.2 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    cursor:pointer;
    text-align:left;
}

.bw-mobile-toc-toggle::after{
    content:"⌄";
    font-size:16px;
    transition:transform .16s ease;
}

.bw-mobile-toc.is-open .bw-mobile-toc-toggle::after{
    transform:rotate(180deg);
}

.bw-mobile-toc-content{
    display:none;
    padding:0 9px 10px;
    border-top:1px solid #e0eaef;
}

.bw-mobile-toc.is-open .bw-mobile-toc-content{
    display:block;
}

@media(max-width:1120px){
    .bw-article-layout{
        display:block;
    }

    .bw-article-toc{
        display:none;
    }

    .bw-mobile-toc{
        display:block;
    }
}

@media(max-width:600px){
    .bw-mobile-toc{
        margin-bottom:18px;
    }
}

/* =========================================================
   Bluewitch v2.14.1 - Keep article-list dates on one line
   ========================================================= */

/* The second/direct child of each library article row is the updated date. */
.article-row > :last-child{
    white-space:nowrap !important;
    flex:0 0 auto;
    min-width:max-content;
}

/* =========================================================
   Bluewitch v2.15 - Personal Notebook
   ========================================================= */
.notebook-head{
    display:flex;justify-content:space-between;align-items:end;gap:16px;
    margin-bottom:18px;
}
.notebook-head h1{margin:4px 0 0}
.notebook-tools{
    display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 18px;
}
.notebook-search{
    flex:1;min-width:240px;border:1px solid #c6d9e3;border-radius:10px;
    padding:10px 11px;background:#fff;font:inherit;color:var(--bw-text,#12344d);
}
.notebook-grid{
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;
}
.notebook-card{
    position:relative;display:flex;flex-direction:column;min-height:175px;
    background:#fff;border:1px solid #d1e1e9;border-radius:16px;padding:18px;
    box-shadow:0 5px 15px rgba(27,78,108,.05);
    transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease;
}
.notebook-card:hover{
    transform:translateY(-2px);border-color:#9fc2d5;
    box-shadow:0 10px 23px rgba(26,83,117,.09);
}
.notebook-card h3{margin:0 0 9px;color:#0c4f79;font-size:16px}
.notebook-card p{
    margin:0;color:#668298;font-size:13px;line-height:1.5;
    display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;
}
.notebook-card-tags{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0 0}
.notebook-card-meta{
    margin-top:auto;padding-top:14px;color:#7890a1;font-size:11px;
}
.notebook-editor{
    max-width:980px;background:#fff;border:1px solid #d1e1e9;border-radius:18px;
    padding:24px;box-shadow:0 6px 18px rgba(27,78,108,.055);
}
.notebook-editor .form textarea{
    min-height:430px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
    line-height:1.6;
}
.notebook-actions{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    flex-wrap:wrap;margin-top:4px;
}
.notebook-actions-main{display:flex;gap:8px;flex-wrap:wrap}
.notebook-delete-form{margin:0}
.notebook-note{
    background:#fff;border:1px solid #d1e1e9;border-radius:18px;padding:28px;
    box-shadow:0 6px 18px rgba(27,78,108,.055);
}
.notebook-note-head{
    display:flex;justify-content:space-between;align-items:start;gap:16px;
    padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid #e0e9ee;
}
.notebook-note h1{margin:0 0 7px}
.notebook-note-meta{font-size:12px;color:#7890a1}
.notebook-note-body{line-height:1.7}
.notebook-note-body h1,.notebook-note-body h2,.notebook-note-body h3{color:#123f5d}
.notebook-note-body pre{
    background:#1f2e34;color:#edf4f5;padding:16px;border-radius:12px;overflow:auto;
}
.notebook-note-body code{font-family:"Cascadia Code",Consolas,monospace}
.notebook-private{
    display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#5f7b8d;
    background:#eaf5f8;border:1px solid #d4e8ef;padding:6px 9px;border-radius:999px;
}
@media(max-width:1000px){.notebook-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){
    .notebook-grid{grid-template-columns:1fr}
    .notebook-head,.notebook-note-head{align-items:stretch;flex-direction:column}
    .notebook-editor,.notebook-note{padding:19px}
}

/* =========================================================
   Bluewitch v2.16 - Article PDF / print view
   ========================================================= */
.bw-article-pdf-button{
    display:inline-flex;
    align-items:center;
    gap:6px;
}

/* Screen-only printed-document heading; hidden until printing. */
.bw-print-header,
.bw-print-footer{
    display:none;
}

@media print{
    @page{
        size:A4;
        margin:14mm 15mm 16mm;
    }

    html,body{
        background:#fff !important;
        color:#172f3f !important;
    }

    body{
        font-size:10.5pt !important;
    }

    /* Remove application chrome. */
    .sidebar,
    .topbar,
    .site-footer,
    .menu-btn,
    .bw-article-toc,
    .bw-mobile-toc,
    .bw-code-toolbar,
    .bw-article-pdf-button,
    .article-actions,
    .favorite-form,
    form[action*="favorite"],
    a[href*="editor.php"],
    .btn.danger{
        display:none !important;
    }

    .app-shell,
    .main,
    .content{
        display:block !important;
        width:auto !important;
        max-width:none !important;
        margin:0 !important;
        padding:0 !important;
        background:#fff !important;
        box-shadow:none !important;
    }

    .article,
    .article.bw-has-toc{
        width:100% !important;
        max-width:none !important;
        margin:0 !important;
        padding:0 !important;
        border:0 !important;
        border-radius:0 !important;
        background:#fff !important;
        box-shadow:none !important;
    }

    .bw-article-layout{
        display:block !important;
    }

    .bw-article-main{
        display:block !important;
        width:100% !important;
    }

    .bw-print-header{
        display:block !important;
        margin:0 0 18px;
        padding:0 0 12px;
        border-bottom:2px solid #168fda;
    }

    .bw-print-brand{
        font-size:10pt;
        font-weight:800;
        letter-spacing:.08em;
        text-transform:uppercase;
        color:#0879c4;
    }

    .bw-print-subtitle{
        margin-top:3px;
        font-size:8.5pt;
        color:#667f90;
    }

    .bw-print-footer{
        display:block !important;
        margin-top:20px;
        padding-top:9px;
        border-top:1px solid #cfdde5;
        color:#6d8291;
        font-size:8pt;
    }

    .article h1{
        font-size:22pt !important;
        line-height:1.2 !important;
        color:#103f5f !important;
    }

    .article .meta{
        color:#647d8d !important;
        font-size:9pt !important;
    }

    .article-body{
        line-height:1.55 !important;
    }

    .article-body h1,
    .article-body h2,
    .article-body h3,
    .article-body h4{
        color:#133f5b !important;
        break-after:avoid-page;
        page-break-after:avoid;
    }

    .article-body h2{
        margin-top:22px !important;
        border-bottom:1px solid #ccdce4 !important;
    }

    .article-body p,
    .article-body li{
        orphans:3;
        widows:3;
    }

    .article-body table{
        width:100% !important;
        border-collapse:collapse !important;
        font-size:8.5pt !important;
    }

    .article-body th,
    .article-body td{
        border:1px solid #cbd9e0 !important;
        padding:5px 6px !important;
        color:#1f3848 !important;
        background:#fff !important;
    }

    .article-body blockquote{
        background:#f2f7f9 !important;
        border-left:3px solid #3899bd !important;
        color:#294958 !important;
        break-inside:avoid-page;
    }

    /* Print complete readable source. The toolbar is omitted. */
    .article-body .bw-code-block{
        display:block !important;
        margin:12px 0 !important;
        border:1px solid #bbcbd3 !important;
        border-radius:5px !important;
        background:#f5f7f8 !important;
        box-shadow:none !important;
        break-inside:auto;
    }

    .article-body .bw-code-block > pre,
    .article-body pre{
        display:block !important;
        margin:0 !important;
        padding:9px !important;
        border:0 !important;
        border-radius:5px !important;
        background:#f5f7f8 !important;
        color:#20343e !important;
        white-space:pre-wrap !important;
        overflow:visible !important;
        word-break:break-word !important;
        font-size:7.6pt !important;
        line-height:1.35 !important;
    }

    .article-body code{
        color:#20343e !important;
    }

    .article-body p code,
    .article-body li code{
        background:#eef2f4 !important;
        color:#294b5c !important;
    }

    a{
        color:#174f73 !important;
        text-decoration:none !important;
    }

    /* Avoid visible web-only hover/decorative effects in PDF. */
    *{
        text-shadow:none !important;
    }
}

/* =========================================================
   Bluewitch v2.16.1 - PDF inner page spacing
   ========================================================= */
@media print{
    /*
     * Add comfortable space inside the printable article itself.
     * This remains visible even when the browser Print dialog uses
     * "Minimum" margins.
     */
    .bw-article-main{
        box-sizing:border-box !important;
        padding-left:7mm !important;
        padding-right:7mm !important;
    }

    .bw-print-header,
    .bw-print-footer{
        box-sizing:border-box !important;
    }
}

/* =========================================================
   Bluewitch v2.16.2 - PDF page-break breathing room
   ========================================================= */
@media print{
    /*
     * Reserve substantially more physical whitespace at the top/bottom of
     * every PDF page. This is handled by @page so it also applies after
     * automatic page breaks in long articles/code blocks.
     */
    @page{
        size:A4;
        margin:20mm 15mm 22mm 15mm;
    }

    /*
     * v2.16.1 already supplies comfortable inner left/right article spacing.
     * Add a small internal top/bottom cushion as well.
     */
    .bw-article-main{
        padding-top:2mm !important;
        padding-bottom:2mm !important;
    }

    /*
     * Prevent headings and common compact content units from being stranded
     * at the bottom of a page where practical.
     */
    .article-body h1,
    .article-body h2,
    .article-body h3,
    .article-body h4{
        break-after:avoid-page !important;
        page-break-after:avoid !important;
    }

    .article-body blockquote,
    .article-body table,
    .article-body ul,
    .article-body ol{
        break-inside:avoid-page;
        page-break-inside:avoid;
    }

    /*
     * Large code blocks may need to span pages, but keep enough separation
     * from normal content and let @page provide the top/bottom breathing room.
     */
    .article-body .bw-code-block,
    .article-body pre{
        margin-top:10px !important;
        margin-bottom:10px !important;
    }
}

/* =========================================================
   Bluewitch v2.16.3 - Unified article action buttons
   ========================================================= */

/* Keep Favorite, Edit and PDF together in one compact row. */
.article:has(.bw-article-pdf-button) .bw-pdf-action-fallback{
    display:inline-flex !important;
    justify-content:flex-start !important;
    align-items:center !important;
    margin:0 !important;
    vertical-align:top;
}

/*
 * Historical article.php renders Favorite/Edit before the article body,
 * while the PDF control is inserted by app.js. Float the small PDF fallback
 * into the same action row rather than leaving it on the far right.
 */
.article:has(.bw-article-pdf-button) .bw-pdf-action-fallback{
    float:none !important;
}

/* Normalize all article action controls. */
.article .btn,
.article button.btn,
.article a.btn,
.article .bw-article-pdf-button{
    box-sizing:border-box;
    min-height:40px;
    height:40px;
    padding:0 14px !important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    line-height:1 !important;
    font-size:14px;
    white-space:nowrap;
}

/*
 * app.js fallback is moved beside the preceding article controls after load.
 * This class provides the final shared action bar appearance.
 */
.bw-unified-article-actions{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:8px !important;
    flex-wrap:wrap;
    margin:12px 0 18px !important;
}

.bw-unified-article-actions form{
    margin:0 !important;
    display:inline-flex;
}

.bw-unified-article-actions .bw-pdf-action-fallback{
    display:contents !important;
}

@media(max-width:600px){
    .bw-unified-article-actions{
        gap:7px !important;
    }
    .article .btn,
    .article button.btn,
    .article a.btn,
    .article .bw-article-pdf-button{
        min-height:38px;
        height:38px;
        padding:0 11px !important;
        font-size:13px;
    }
}

/* =========================================================
   Bluewitch v2.16.4 - Force all article actions into one row
   ========================================================= */
.bw-unified-article-actions-v2{
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    flex-wrap:nowrap !important;
    gap:8px !important;
    width:100% !important;
    margin:12px 0 18px !important;
}

.bw-unified-article-actions-v2 > form,
.bw-unified-article-actions-v2 > a,
.bw-unified-article-actions-v2 > button,
.bw-unified-article-actions-v2 .bw-pdf-action-fallback{
    display:inline-flex !important;
    width:auto !important;
    margin:0 !important;
    flex:0 0 auto !important;
}

.bw-unified-article-actions-v2 form{
    margin:0 !important;
}

.bw-unified-article-actions-v2 .btn,
.bw-unified-article-actions-v2 button.btn,
.bw-unified-article-actions-v2 a.btn{
    height:40px !important;
    min-height:40px !important;
    padding:0 14px !important;
    margin:0 !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    white-space:nowrap !important;
    line-height:1 !important;
}

/* Mobile may scroll horizontally rather than splitting the three actions. */
@media(max-width:430px){
    .bw-unified-article-actions-v2{
        overflow-x:auto;
        padding-bottom:3px;
    }
}

/* =========================================================
   Bluewitch v2.17 - Email Article
   ========================================================= */
.bw-article-email-button{
    height:40px !important;
    min-height:40px !important;
    padding:0 14px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:6px !important;
    white-space:nowrap !important;
    flex:0 0 auto !important;
}

@media print{
    .bw-article-email-button{
        display:none !important;
    }
}

/* =========================================================
   Bluewitch v2.18 - Send Article by Email page
   ========================================================= */
.bw-email-card{
    max-width:900px;
    background:#fff;
    border:1px solid #d1e1e9;
    border-radius:18px;
    padding:25px;
    box-shadow:0 6px 18px rgba(27,78,108,.055);
}
.bw-email-card h1{margin-top:0}
.bw-email-article{
    margin:0 0 20px;
    padding:14px 16px;
    border:1px solid #d5e5ec;
    border-radius:12px;
    background:#f6fafc;
}
.bw-email-article strong{
    display:block;
    color:#0c4f79;
    margin-bottom:4px;
}
.bw-email-article span{
    color:#6b8394;
    font-size:13px;
}
.bw-email-card .form textarea{
    min-height:125px;
    line-height:1.55;
}
.bw-email-note{
    margin:15px 0;
    padding:11px 13px;
    border-radius:10px;
    background:#eef7fa;
    border:1px solid #d9eaf0;
    color:#557387;
    font-size:12px;
    line-height:1.5;
}
.bw-email-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
    margin-top:17px;
}

/* ============================================================
   Bluewitch v2.22 - Article author + two-line metadata header
   ============================================================ */
.article .bw-article-primary-meta{
    margin-bottom:5px !important;
    color:var(--muted);
    font-size:13px;
}

.article .bw-article-secondary-meta{
    margin-bottom:20px;
    letter-spacing:.035em;
    text-transform:none;
    line-height:1.45;
}

@media print{
    .article .bw-article-primary-meta,
    .article .bw-article-secondary-meta{
        display:block !important;
    }
}

/* ============================================================
   Bluewitch v2.23.1 - Context-aware article Back button
   ============================================================ */
.bw-article-back-button{
    height:40px !important;
    min-height:40px !important;
    padding:0 14px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:7px !important;
    white-space:nowrap !important;
    flex:0 0 auto !important;
    font-weight:600;
}
.bw-article-back-button span{font-size:16px;line-height:1;}
@media print{.bw-article-back-button{display:none !important;}}

/* ============================================================
   Bluewitch v2.23.3 - One-row blue article action palette
   ============================================================ */
.bw-unified-article-actions-v2,
.bw-unified-article-actions{
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
    flex-wrap:wrap !important;
    margin-bottom:22px !important;
}
.bw-unified-article-actions-v2 > form,
.bw-unified-article-actions > form{
    margin:0 !important;
    display:flex !important;
}
.bw-unified-article-actions-v2 .btn,
.bw-unified-article-actions-v2 button.btn,
.bw-unified-article-actions .btn,
.bw-unified-article-actions button.btn{
    min-height:40px !important;
    height:40px !important;
    padding:0 14px !important;
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:10px !important;
    font-weight:600 !important;
    white-space:nowrap !important;
    box-shadow:0 2px 7px rgba(19,73,108,.06) !important;
    transition:background .14s ease,border-color .14s ease,color .14s ease,box-shadow .14s ease,transform .14s ease !important;
}
.bw-unified-article-actions-v2 .btn:hover,
.bw-unified-article-actions-v2 button.btn:hover,
.bw-unified-article-actions .btn:hover,
.bw-unified-article-actions button.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 5px 11px rgba(19,73,108,.10) !important;
}

/* Back - strongest Bluewitch blue */
.bw-unified-article-actions-v2 .bw-article-back-button,
.bw-unified-article-actions .bw-article-back-button{
    background:#0b6fa8 !important;border-color:#0a6599 !important;color:#fff !important;
}
.bw-unified-article-actions-v2 .bw-article-back-button:hover,
.bw-unified-article-actions .bw-article-back-button:hover{
    background:#095f91 !important;border-color:#085783 !important;
}

/* Favorite - light cyan blue */
.bw-unified-article-actions-v2 form button[name="favorite"],
.bw-unified-article-actions form button[name="favorite"]{
    background:#e7f5fb !important;border-color:#b8dceb !important;color:#176b91 !important;
}

/* Edit - medium blue */
.bw-unified-article-actions-v2 a[href*="editor.php"],
.bw-unified-article-actions a[href*="editor.php"]{
    background:#dceefa !important;border-color:#afd2e7 !important;color:#155f87 !important;
}

/* PDF - steel blue */
.bw-unified-article-actions-v2 .bw-article-pdf-button,
.bw-unified-article-actions .bw-article-pdf-button{
    background:#d8e8f4 !important;border-color:#a9c5da !important;color:#244f72 !important;
}

/* Email - blue teal */
.bw-unified-article-actions-v2 .bw-article-email-button,
.bw-unified-article-actions .bw-article-email-button{
    background:#d9f1f2 !important;border-color:#acd4d7 !important;color:#236a71 !important;
}

/* Copy Link - pale indigo blue */
.bw-unified-article-actions-v2 .bw-article-copy-link-button,
.bw-unified-article-actions .bw-article-copy-link-button{
    background:#e7eafa !important;border-color:#c6ccee !important;color:#4d5e9b !important;
}
.bw-unified-article-actions-v2 .bw-article-copy-link-button.is-copied,
.bw-unified-article-actions .bw-article-copy-link-button.is-copied{
    background:#d8f1ec !important;border-color:#a9d8ce !important;color:#22685c !important;
}

@media(max-width:760px){
    .bw-unified-article-actions-v2,
    .bw-unified-article-actions{gap:7px !important;}
}
@media print{
    .bw-unified-article-actions-v2,
    .bw-unified-article-actions{display:none !important;}
}

/* ============================================================
   Bluewitch v2.24.2 - Download article button
   ============================================================ */
.bw-unified-article-actions-v2 .bw-article-download-md-button,
.bw-unified-article-actions .bw-article-download-md-button{
    background:#2f7fa8 !important;
    border-color:#246d93 !important;
    color:#ffffff !important;
}

.bw-unified-article-actions-v2 .bw-article-download-md-button:hover,
.bw-unified-article-actions .bw-article-download-md-button:hover{
    background:#276f95 !important;
    border-color:#1f6081 !important;
    color:#ffffff !important;
}

@media print{
    .bw-article-download-md-button{
        display:none !important;
    }
}


/* Knowledge login background and hub navigation. */
.hub-return{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 24px;border:1px solid #dce8ef80;border-radius:10px;background:linear-gradient(145deg,#35566ee8,#203c52ed);color:#f3f7fa;font:600 14px/1.4 system-ui,sans-serif;text-decoration:none;box-shadow:0 7px 20px #0718244d,inset 0 1px #ffffff30;transition:background .15s,transform .15s}.hub-return:hover{background:#3c627b;transform:translateY(-1px)}.hub-return:focus-visible{outline:3px solid #e4c58d;outline-offset:4px}
.knowledge-login.login-page{background:linear-gradient(120deg,#103e5840,#0b40513b),url('images/knowledge-login-it.webp') center/cover fixed no-repeat !important;min-height:100vh;min-height:100svh;padding:28px 18px}.knowledge-login .hub-login-stack{width:min(440px,100%);display:flex;flex-direction:column;align-items:center;gap:18px}.knowledge-login .login-card{width:100%;background:rgba(241,248,252,.88) !important;border-color:#e1f0f6b3 !important;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);box-shadow:0 24px 65px #082c4866,inset 0 1px #ffffffb3}.knowledge-login .hub-return{background:linear-gradient(145deg,#126e8fed,#07566ced);border-color:#c5e8eea6}@media(max-width:600px){.knowledge-login.login-page{background-attachment:scroll}.knowledge-login .login-card{padding:25px 22px}}

/* Translucent blue glass, scoped to the Knowledge Library login. */
.knowledge-login .login-card{background:linear-gradient(145deg,rgba(27,85,126,.62),rgba(10,49,83,.72)) !important;border-color:rgba(186,227,246,.48) !important;color:#f1f7fc;backdrop-filter:blur(14px) saturate(115%);-webkit-backdrop-filter:blur(14px) saturate(115%);box-shadow:0 24px 65px #021c3b66,inset 0 1px #e9f9ff52}
.knowledge-login .login-card h2,.knowledge-login .login-card label{color:#f1f7fc}.knowledge-login .login-card p,.knowledge-login .login-card .login-brand-subtitle,.knowledge-login .login-card .login-copyright{color:#d4e6f3}.knowledge-login .login-card .login-help-links a{color:#bfefff}.knowledge-login .login-card input{background:rgba(226,241,252,.88);color:#12364e;border-color:#bddcec99}.knowledge-login .login-card input:focus{outline:2px solid #83e1ee;outline-offset:2px}.knowledge-login .hub-return{background:linear-gradient(145deg,#1b557e9e,#0a3153b8);border-color:#bae3f67a;color:#f1f7fc;backdrop-filter:blur(14px) saturate(115%);-webkit-backdrop-filter:blur(14px) saturate(115%);box-shadow:0 8px 24px #021c3b55,inset 0 1px #e9f9ff40}.knowledge-login .hub-return:hover{background:linear-gradient(145deg,#2b658eae,#1a4163c8)}

/* Raised pale-blue glass authentication surfaces. */
.knowledge-login .login-card{background:radial-gradient(ellipse at 10% 0%,#effaff52,transparent 65%),linear-gradient(145deg,#aacede70,#6b9ebd52 48%,#416e946b) !important;border:1px solid #cceaff99 !important;border-top-color:#effbffe0 !important;border-left-color:#d9f1ffb8 !important;border-right-color:#8db6d5a6 !important;border-bottom-color:#47789fc9 !important;backdrop-filter:blur(10px) saturate(115%);-webkit-backdrop-filter:blur(10px) saturate(115%);box-shadow:0 4px 8px #031b3038,0 22px 42px #021b355c,0 48px 90px #011b327a,0 0 48px #a7e5ff1f,inset 0 2px 0 #f1fbff80,inset 1px 0 #e4f7ff40,inset 0 -2px 0 #082b4352}
.knowledge-login .login-card h2,.knowledge-login .login-card label{color:#fff;text-shadow:0 1px 3px #12395799}.knowledge-login .login-card p,.knowledge-login .login-card .login-brand-subtitle,.knowledge-login .login-card .login-copyright{color:#edf7ff;text-shadow:0 1px 3px #12395799}.knowledge-login .login-card .login-help-links a{color:#e2f8ff;text-shadow:0 1px 3px #12395799}.knowledge-login .login-card .login-brand-logo img{filter:drop-shadow(0 1px 3px #e5faff99)}
.knowledge-login .hub-return{background:radial-gradient(ellipse at 10% 0%,#effaff40,transparent 70%),linear-gradient(145deg,#aacede70,#416e946b);border-color:#cceaff99;border-top-color:#effbffd0;border-bottom-color:#47789fb3;backdrop-filter:blur(10px) saturate(115%);-webkit-backdrop-filter:blur(10px) saturate(115%);box-shadow:0 3px 6px #031b3038,0 12px 26px #021b355c,inset 0 2px #f1fbff66,inset 1px 0 #e4f7ff30,inset 0 -2px #082b4340;color:#fff;text-shadow:0 1px 3px #12395799}.knowledge-login .hub-return:hover{background:linear-gradient(145deg,#c0e0ee85,#6b9ebd80)}.knowledge-login .hub-return:active{transform:translateY(1px);box-shadow:0 3px 8px #021b354d,inset 0 1px 4px #12395740}
