/* angry.css is generated from static/css/angry/*.css via build.py.
 * Edit the partials, then run: python3 static/css/angry/build.py
 */
/* Global link styling - blue */
a {
  color: #1a0dab;
  text-decoration: none !important;
}

a:hover,
a:focus,
a:active,
a:visited {
  color: #0c51b8;
  text-decoration: none !important;
}

/* In-page rails (Terms/About/etc) should be muted, not "Google blue". */
.ap-page-rail a {
  color: #64748b; /* slate-500 */
  text-decoration: none;
}

.ap-page-rail a:hover,
.ap-page-rail a:focus {
  color: #475569; /* slate-600 */
  text-decoration: none;
}

.ap-page-rail a[aria-current="page"] {
  color: #0f172a; /* slate-900 */
}

/* Keep logo icon visibility stable to avoid flicker */
.sidebar-left .logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* (contents originally from 1_core.css up through the :root {...} block) 
/static/css/
0_reset_base.css        /* normalize + :root vars + body/h1-h6/link helpers   
1_layout_core.css       /* #page-wrapper, #main-content, 3-col flex + grid    
2_header_footer.css     /* #site-header nav + #site-footer / .footer-links    
3_sidebars.css          /* .sidebar-left (+collapsed) & .sidebar-right panel  
4_components.css        /* cards, buttons, forms, censor tiers, utilities     
5_responsive.css        /* ≤576px & tablet MQ + dark-mode variable overrides  

/* Show only the right label for each sidebar state */
.sidebar-left .link-text-short {          /* expanded sidebar */
    display: none !important;
}

.sidebar-left.collapsed .link-text,
html.sidebar-prefers-collapsed .sidebar-left .link-text {      /* collapsed sidebar */
    display: none !important;
}
.sidebar-left.collapsed .link-text-short,
html.sidebar-prefers-collapsed .sidebar-left .link-text-short {
    display: inline !important;
}
*/
/* 0_reset_base.css */
/* ---- Reset & base typography ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary:       #333333;
    --link-hover:    #666666;
    --background:    #F9F9F7;
    --footer-text:   #444444;
    --footer-area:   #F4F3EE;
    --hover-darker:     #888888;
    --click-dark:     #666666;
    --click-blue:    #0f172a;
    --hover-blue:    #1f2937;
}

/* Bootstrap `bg-light` defaults to `#f8f9fa !important`, which
   mismatches our brand background. Force it to our theme. */
.bg-light {
    background-color: var(--background) !important;
}

/* In dark mode, align `bg-light` surfaces with our surface tone. */
body.dark-mode .bg-light {
    background-color: var(--footer-area) !important;
}

/* Native <dialog> baseline (Tailwind-styled replacement for Bootstrap modals). */
dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
dialog[open] {
    animation: ap-dialog-in 120ms ease-out;
}
@keyframes ap-dialog-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

html,
body {
    height: 100%;
}


/* Custom styling for profile card panels */
.card-body .bg-light,
.card-body .bg-white {
    background-color: var(--footer-area) !important;
    border-radius: 6px;
}

/* Add a subtle border */
.card .card-body > div.bg-light,
.card .card-body > div.bg-white {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Style links within these panels */
.card-body .bg-light a:not(.btn),
.card-body .bg-white a:not(.btn) {
    color: var(--primary);
    text-decoration: none;
}

.card-body .bg-light a:not(.btn):hover,
.card-body .bg-white a:not(.btn):hover {
    color: var(--link-hover);
    text-decoration: none;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--background);
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--primary);
}

input,
textarea,
select,
input::placeholder,
textarea::placeholder {
    font-family: Helvetica, Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Hard guard: never allow horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden !important;
}
.sidebar-drawer-open {
    overflow: hidden !important;
}

h1,
h2,
h3 {
    text-align: left;
    color: var(--primary);
}

h1 {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.text-danger {
    color: var(--click-blue);
    font-weight: bold;
}
/* 1_layout_core.css */
/* ---- Core page grid & column behaviour ---- */

:root {
    --ap-maintenance-banner-height: 2.35rem;
}

/* Desktop: lock page scroll so ONLY #main-content scrolls */
@media (min-width: 992px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
        overscroll-behavior: none;
    }

    #page-wrapper {
        height: 100vh;
        overflow: hidden;
    }

    body.ap-maintenance-active #page-wrapper,
    body.ap-maintenance-active .ap-shell,
    body.ap-maintenance-active #main-content {
        height: calc(100vh - var(--ap-maintenance-banner-height));
    }
}
#page-wrapper {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* App shell: replaces legacy Bootstrap `.row.g-0`/`.container-fluid > .row` layout glue. */
@media (min-width: 992px) {
    .ap-shell {
        height: 100vh;
        overflow: hidden;
        flex-wrap: nowrap;
    }
}

/**
 * Allow the article feed to stretch naturally on tablets/mobiles so the footer
 * appended below can scroll into view instead of being clipped at 100vh.
 */
#main-content {
    flex: 1 1 auto;
    padding: 0;
    margin-bottom: 25px;
    min-width: 0;
    background-color: var(--background);
    height: 100vh;                 /* own scroll area */
    overflow-y: auto;
    overflow-x: hidden;            /* prevent horizontal page panning inside the main scroller */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

#main-content .main-content-inner {
    flex: 1 0 auto;
    min-height: 0;
}

.ap-maintenance-banner {
    min-height: var(--ap-maintenance-banner-height);
    width: 100%;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #d8b84d;
    background: #fff8df;
    color: #111827;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.04);
}

.ap-maintenance-banner__inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.6rem;
    align-items: center;
    justify-content: center;
    width: min(100%, 88rem);
    padding: 0.42rem 1rem;
    font-size: 0.86rem;
    line-height: 1.3;
    text-align: center;
}

.ap-maintenance-banner__label {
    display: inline-flex;
    align-items: center;
    min-height: 1.35rem;
    border: 1px solid #d8b84d;
    border-radius: 999px;
    background: #fffdf4;
    padding: 0.05rem 0.5rem;
    color: #111827;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1;
    text-transform: uppercase;
}

.ap-maintenance-banner__primary {
    font-weight: 750;
}

.ap-maintenance-banner__detail {
    color: #4b5563;
}

@media (max-width: 1199.98px) {
    #main-content {
        position: relative;
        height: auto;
        min-height: 100vh;
        overflow-y: visible;
        -webkit-overflow-scrolling: auto;
        overscroll-behavior: auto;
        padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
    }

    /* keep footer accessible above fixed Elle orb */
}

@media (max-width: 575.98px) {
    .ap-maintenance-banner__inner {
        justify-content: center;
        padding: 0.45rem 0.75rem;
        font-size: 0.8rem;
    }
}

/* eliminate unwanted top gap before first heading */
#main-content .main-content-inner > h1:first-child {
    margin-top: 0;
}

/* NOTE: legacy Bootstrap grid hooks removed. Any remaining `.row` / `.col-*`
 * uses in templates should be migrated to Tailwind / AP-native layout. */
/* 2_header_footer.css */
/* ---- Header (logo + nav) ---- */
/* Header (logo + nav) */
#site-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: var(--background);
    padding: 10px 20px;
    font-size: 20px;
    font-weight: bold;
    /* left-align logo, push nav to right */
}
#site-header .logo {
    margin-right: auto;
    /* Ensure logo is left-aligned in navbar */
    justify-content: flex-start;
    align-items: center;
    display: flex;
}

/* Remove any center alignment from logo wrapper in header */
#site-header .logo a {
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    letter-spacing: 1px;
    transition: color 0.2s;
    text-align: left;
    /* Remove any .text-center or .justify-content-center on logo */
}
#site-header .logo a:hover { color: var(--primary); }

#site-header nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

#site-header nav ul li a,
#site-header nav ul li form button {
    position: relative;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

/* hide default focus outline */
#site-header nav ul li a:focus,
#site-header nav ul li form button:focus { outline: none; }

#site-header nav ul li a:hover,
#site-header nav ul li a:focus,
#site-header nav ul li form button:hover,
#site-header nav ul li form button:focus { color: var(--link-hover); }

/* header search input override */
#site-header .form-control {
    background: var(--background);
    border: 1px solid #ccc;
}

/* ---- Footer ---- */
/*
  The global footer is intentionally mobile-only via Tailwind (`sm:tw-hidden`).
  Do not force legacy desktop footer styling on `#site-footer`, or it will show
  up on desktop/tablet and fight `.mobile-footer-links` layout.
*/
@media (min-width: 40rem) {
    #site-footer { display: none !important; }
}

.mobile-footer-links {
    width: 100%;
    align-items: stretch;
}

.mobile-footer-card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    width: min(100%, 34rem);
    margin: 0 auto;
}

.mobile-footer-card {
    margin: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.mobile-footer-card .story-inner {
    padding: 14px 16px 16px;
}

.mobile-footer-card__inner {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.mobile-footer-card__kicker {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.2;
    text-transform: uppercase;
}

.mobile-footer-card__title {
    color: #0f172a;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}

.mobile-footer-card__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.75rem;
    align-items: center;
}

.mobile-footer-card__links a {
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}

.mobile-footer-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.45;
}

.mobile-footer-links .footer-links a,
.mobile-footer-card__links a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

.mobile-footer-links .footer-links a:hover,
.mobile-footer-links .footer-links a:focus,
.mobile-footer-card__links a:hover,
.mobile-footer-card__links a:focus { color: var(--link-hover); }
/* 3_sidebars.css */
/* ---- Left & Right sidebars ---- */
.sidebar-left {
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    background-color: var(--background);
    border-right: 0;
    flex: 0 0 14rem;
    width: 14rem;
    max-width: 14rem;
    transition: width 150ms ease;
    overflow: hidden;
}

.sidebar-left .ap-logo-img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 0;
    cursor: pointer;
    transform: translateY(0) scale(1);
    transform-origin: 50% 50%;
    transition: opacity 150ms ease, transform 0.18s cubic-bezier(.2,.9,.2,1.25), filter 0.18s ease;
}

.sidebar-left .logo a:hover .ap-logo-img,
.sidebar-left .ap-logo-img:hover {
    opacity: 0.85;
    transform: translateY(-1px) scale(1.1) rotate(-3deg);
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, 0.14)) saturate(1.18);
}

.sidebar-left.collapsed .ap-logo-img,
html.sidebar-prefers-collapsed .sidebar-left .ap-logo-img {
    display: block;
    margin-right: 0;
    width: 47px;
    height: 47px;
}

.ap-mobile-nav {
    background-color: var(--background) !important;
}

.ap-mobile-nav .ap-mobile-brand {
    color: var(--primary);
    text-decoration: none;
}

.ap-mobile-nav .ap-mobile-brand:hover {
    text-decoration: none;
}

.ap-mobile-nav #hamburgerBtn i,
.ap-mobile-nav #hamburgerBtn .ap-bi-svg,
.ap-mobile-nav #hamburgerBtn svg,
.ap-mobile-nav .ap-mobile-brand img {
    display: inline-block;
    transform: translateY(0) scale(1);
    transform-origin: 50% 50%;
    transition: transform 0.18s cubic-bezier(.2,.9,.2,1.25), filter 0.18s ease;
}

.ap-mobile-nav #hamburgerBtn:hover i,
.ap-mobile-nav #hamburgerBtn:hover .ap-bi-svg,
.ap-mobile-nav #hamburgerBtn:hover svg,
.ap-mobile-nav #hamburgerBtn:focus-visible i,
.ap-mobile-nav #hamburgerBtn:focus-visible .ap-bi-svg,
.ap-mobile-nav #hamburgerBtn:focus-visible svg,
.ap-mobile-nav .ap-mobile-brand:hover img,
.ap-mobile-nav .ap-mobile-brand:focus-visible img {
    transform: translateY(-1px) scale(1.12) rotate(-3deg);
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, 0.14)) saturate(1.18);
}

.sidebar-left .sidebar-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.policy-rail-divider {
    border: 0;
    border-top: 2px solid #cbd5e1;
    margin: 0.75rem 0 0.9rem;
}

.ai-panel-section {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 0.5rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.75rem;
    min-height: 0;
    overflow-y: auto;
    padding-top: 0.75rem;
}

.ai-panel-section.ai-panel-collapsed {
    display: none;
}

.ai-panel-section .ai-panel-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-panel-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 62px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    padding: 0;
    background: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1051;
    cursor: pointer;
    overflow: hidden;
    /* Fine-tune Elle framing inside the orb */
    --ap-orb-img-scale: 1.11;
    --ap-orb-img-y: 3px;
    opacity: 1;
    transform: scale(1);
    transition: none;
}

.ai-panel-launcher.ap-orb-dormant {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.ai-panel-launcher.ap-orb-revealed {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.ai-panel-launcher.ap-orb-fading {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.ai-panel-launcher.ap-orb-nudge {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    animation: none;
}

.ai-panel-launcher.ap-orb-notification {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 4px rgba(15, 23, 42, 0.08);
}

.ai-panel-launcher.ap-orb-has-message {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
    animation: none;
}

@keyframes apOrbPulse {
    0% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 0 rgba(255, 182, 193, 0.45); }
    70% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 14px rgba(255, 182, 193, 0); }
    100% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 0 rgba(255, 182, 193, 0); }
}

@keyframes apOrbUnreadPulse {
    0% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 0 rgba(185, 28, 28, 0.32); }
    70% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 14px rgba(185, 28, 28, 0); }
    100% { box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22), 0 0 0 0 rgba(185, 28, 28, 0); }
}

.ap-orb-badge {
    position: absolute;
    top: 2px;
    right: 1px;
    z-index: 3;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    background: #b91c1c;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.01em;
}

.ap-orb-badge.ap-orb-badge-unread {
    background: #b91c1c;
    color: #ffffff;
    border-color: #ffffff;
}

.ap-orb-badge[hidden] {
    display: none !important;
}

.ap-orb-bubble {
    position: fixed;
    z-index: 1053;
    background: rgba(255,255,255,0.98);
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
    color: #0f172a;
    font-size: 0.9rem;
    line-height: 1.25;
    max-width: 260px;
    cursor: pointer;
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 320ms ease, transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.ap-orb-bubble-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.ap-orb-bubble-body {
    color: rgba(15, 23, 42, 0.74);
}

.ap-orb-bubble.is-hiding {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
}

.ai-panel-launcher::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transform-origin: 100% 50%;
}

.ai-panel-launcher.ap-orb-page-turn::after {
    opacity: 0;
    background: transparent;
    animation: none;
}

@keyframes apOrbPageTurn {
    0%   { opacity: 0; transform: perspective(680px) rotateY(0deg) translateX(0); }
    18%  { opacity: 0.85; }
    55%  { opacity: 0.65; }
    100% { opacity: 0; transform: perspective(680px) rotateY(-110deg) translateX(-18px); }
}

.ai-panel-launcher.ap-orb-activated img {
    animation: none;
}

@keyframes apOrbActivate {
    0%   { top: calc(var(--ap-orb-img-y) + 2px); filter: saturate(1.06) contrast(1.02); }
    60%  { top: calc(var(--ap-orb-img-y) - 1px); }
    100% { top: var(--ap-orb-img-y); filter: none; }
}

.ai-panel-launcher img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    position: relative;
    top: var(--ap-orb-img-y);
    transform: scale(var(--ap-orb-img-scale));
    transform-origin: 50% 20%;
    will-change: transform;
    display: block;
    background: transparent;
}

.ai-panel-launcher.ap-orb-offline img {
    filter: grayscale(1);
    opacity: 0.78;
}

.ai-panel-launcher.ap-orb-online img {
    filter: none;
    opacity: 1;
}

.ai-panel.ap-elle-responding::before,
.ai-panel.ap-elle-page-turn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.ai-panel.ap-elle-responding::before {
    opacity: 0.16;
    background: linear-gradient(110deg,
        rgba(15,23,42,0.00) 0%,
        rgba(15,23,42,0.06) 35%,
        rgba(255,255,255,0.30) 50%,
        rgba(15,23,42,0.04) 65%,
        rgba(15,23,42,0.00) 100%);
    background-size: 220% 100%;
    animation: apElleThinking 1.05s ease-in-out infinite;
}

@keyframes apElleThinking {
    0%   { background-position: 0% 0%; }
    100% { background-position: 100% 0%; }
}

.ai-panel.ap-elle-page-turn::after {
    opacity: 0;
    transform-origin: 100% 50%;
    background:
        linear-gradient(120deg,
            rgba(255,255,255,0.0) 0%,
            rgba(255,255,255,0.0) 22%,
            rgba(255,255,255,0.55) 46%,
            rgba(255,255,255,0.0) 70%,
            rgba(255,255,255,0.0) 100%),
        radial-gradient(circle at 85% 20%, rgba(255,255,255,0.25), rgba(255,255,255,0.0) 55%);
    animation: apPanelPageTurn 720ms cubic-bezier(0.2, 0.9, 0.2, 1) 1;
}

@keyframes apPanelPageTurn {
    0%   { opacity: 0; transform: perspective(860px) rotateY(0deg) translateX(0); }
    18%  { opacity: 0.75; }
    55%  { opacity: 0.55; }
    100% { opacity: 0; transform: perspective(860px) rotateY(-108deg) translateX(-28px); }
}

.ai-panel-launcher:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 3px;
}

.ai-panel.ai-panel-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    top: auto;
    left: auto;
    width: 410px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 56px);
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e6eaf2;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1050;
}

.ai-panel-float.ai-panel-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    bottom: 20px;
}

.ai-panel-float.ai-panel-collapsed {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
    pointer-events: none;
    visibility: hidden;
}

.ai-panel-launcher.is-hidden {
    display: none;
}

.ai-panel.ai-panel-open + .ai-panel-launcher {
    display: none;
}

.ai-panel-header {
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 3;
    padding: 0;
    background: transparent;
    border-bottom: 0;
}

.ai-panel-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e1e6ef;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-panel-avatar img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.ai-panel-title {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ai-panel-name {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
}

.ai-panel-status {
    font-size: 0.75rem;
    color: #4b5563;
}

.ai-panel-float .ai-panel-avatar,
.ai-panel-float .ai-panel-status {
    display: none;
}

.ai-panel-float .ai-panel-title {
    display: none;
}

.ai-panel-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ai-panel-close:hover {
    background: #eef2f7;
    border-color: #e2e8f0;
    color: #334155;
}

.ai-panel-live-status {
    display: none;
    flex: 1 1 auto;
    min-height: 1.6rem;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: #475569;
    font-size: 0.74rem;
    line-height: 1.6rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.ai-panel-live-status[data-active="1"] {
    display: block;
    opacity: 1;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
}

.ai-panel-notices-tray {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 92px 6px 14px;
    border-bottom: 0;
    background: #ffffff;
}

.ai-panel-tray-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-panel-tray-tab {
    appearance: none;
    border: 1px solid #d9e2ec;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    min-width: 32px;
    max-width: 150px;
    overflow: hidden;
    padding: 0 8px;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
    transition: max-width 0.18s ease, padding 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ai-panel-tray-tab.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.ai-panel-tray-tab .ap-bi-svg,
.ai-panel-tray-tab i {
    width: 0.92rem;
    height: 0.92rem;
    flex: 0 0 auto;
    font-size: 0.92rem;
}

.ai-panel-tray-label {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.18s ease, opacity 0.14s ease;
}

.ai-panel-tray-tab:hover,
.ai-panel-tray-tab:focus-visible,
.ai-panel-tray-tab:active,
.ai-panel-tray-tab.is-active {
    padding: 0 12px;
}

.ai-panel-tray-tab:hover .ai-panel-tray-label,
.ai-panel-tray-tab:focus-visible .ai-panel-tray-label,
.ai-panel-tray-tab:active .ai-panel-tray-label,
.ai-panel-tray-tab.is-active .ai-panel-tray-label {
    max-width: 96px;
    opacity: 1;
}

.ai-panel-tray-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #b91c1c;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.ai-panel-tray-badge[hidden] {
    display: none !important;
}

.ai-panel-tray-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-panel-tray-item {
    appearance: none;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: none;
}

.ai-panel-tray-item:hover,
.ai-panel-tray-item:focus-visible {
    color: #0f172a;
    text-decoration: none;
    border-color: #cbd5e1;
    background: #fdfdfd;
}

.ai-panel-tray-item:disabled {
    cursor: wait;
    opacity: 0.62;
}

.ai-panel-tray-item-title {
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.25;
}

.ai-panel-tray-item-copy {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1.3;
}

.ai-panel-tray-empty {
    padding: 4px 2px 0;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.ai-panel-close .ap-bi-svg,
.ai-panel-close i {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.95rem;
}

.ai-panel-content {
    flex: 1 1 auto;
    padding: 0 24px;
    background: transparent;
    overflow: auto;
}

.ai-panel-float .ai-panel-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-panel-float .ai-face-overlay {
    display: none !important;
}

.ai-panel-float .console-output {
    margin: 0;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    padding-top: 0 !important;
    height: auto !important;
    flex: 1 1 auto;
    background: transparent;
    border: none;
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 140px;
    padding-bottom: 10px;
}

.ai-panel-float .console-input {
    margin: 0;
    margin-top: 0;
    padding: 0 14px 8px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.ai-panel-float .console-input form {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 54px;
    position: relative;
}

.ai-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 10px;
}

.ai-panel-float .ai-screen-ask-btn {
    width: 36px;
    min-width: 0;
    max-width: 220px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: hidden;
    padding: 0 9px;
    margin: 0;
    border-radius: 999px;
    border: 1px solid #d8dee8;
    background: #ffffff;
    color: #111827;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
    transition: width 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ai-panel-float .ai-screen-ask-btn:hover,
.ai-panel-float .ai-screen-ask-btn:focus-visible,
.ai-panel-float .ai-screen-ask-btn:active {
    width: 168px;
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ai-panel-float .ai-screen-ask-btn .ap-bi-svg,
.ai-panel-float .ai-screen-ask-btn i {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    font-size: 1rem;
}

.ai-screen-ask-label {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.18s ease, opacity 0.14s ease;
}

.ai-panel-float .ai-screen-ask-btn:hover .ai-screen-ask-label,
.ai-panel-float .ai-screen-ask-btn:focus-visible .ai-screen-ask-label,
.ai-panel-float .ai-screen-ask-btn:active .ai-screen-ask-label {
    max-width: 132px;
    opacity: 1;
}

.ai-panel-float .ai-screen-ask-btn:disabled {
    opacity: 0.62;
    cursor: wait;
}

.ai-panel-float .console-output.ai-face-only .user-message,
.ai-panel-float .console-output.ai-face-only .system-message,
.ai-panel-float .console-output.ai-face-only .ai-response-block {
    display: block !important;
}

.ai-panel-float .console-input textarea {
    min-height: 48px;
    max-height: 120px;
    padding: 13px 42px 10px 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    flex: 1 1 auto;
    box-sizing: border-box;
    line-height: 1.45;
    color: #111827;
    overflow-y: auto;
    box-shadow: none;
    outline: none;
    resize: none;
}

.ai-panel-float .console-input textarea:focus {
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none;
}

.ai-panel-float .console-input button {
    position: absolute;
    right: 0;
    bottom: 50%;
    transform: translateY(50%);
    width: 32px;
    height: 32px;
    margin-bottom: 0;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: #111827;
    box-shadow: none;
    flex: 0 0 32px;
}

.ai-panel-float .console-input button:hover {
    background: transparent;
    border-color: transparent;
    color: #0f172a;
}

.ai-panel-float .console-input button .ap-bi-svg,
.ai-panel-float .console-input button i {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 1.2rem;
}

.ai-panel-float .ai-response-header,
.ai-panel-float .ai-response-controls {
    display: none;
}

.ai-panel-float .ai-response-block {
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    align-self: flex-start;
    max-width: 85%;
    border: 1px solid #e6eaf2 !important;
    background: #ffffff !important;
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    overflow: visible;
}

.ai-panel-float .ai-response-content {
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: transparent;
    border: 0;
    color: #111827;
    opacity: 1;
    font-size: 0.92rem;
    line-height: 1.4;
    display: block;
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.ai-panel-float .ai-response-content * {
    color: #111827 !important;
    opacity: 1;
}

.ai-panel-float .user-message {
    align-self: flex-end;
    max-width: 85%;
    margin: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: transparent;
    color: #111827;
    font-size: 0.92rem;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    height: auto;
    min-height: 0;
    white-space: normal;
    word-break: break-word;
}

.ai-panel-float .system-message {
    align-self: center;
    max-width: 90%;
    margin: 0;
    padding: 8px 12px;
    border-radius: 14px;
    background: #eef2f7;
    color: #4b5563;
    border: none;
    font-size: 0.82rem;
}

.sidebar-left .logo a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    text-align: left;
    padding: 0.75rem 1rem;
    transition: color 0.2s;
}
.sidebar-left .logo {
    margin: 0;
    padding-top: 0.55rem;
    padding-bottom: 0.35rem;
    line-height: 1;
}
.sidebar-left .logo-text{text-align:left; margin-left: 0;} 

/* Logo text state styling for active/inactive states */
.sidebar-left .logo-text.is-active {
    color: #111;
    font-weight: bold;
}

.sidebar-left .logo-text.is-inactive {
    color: #555; /* Slightly gray text for inactive state */
}

/* AI Panel text styling for normal and collapsed states */
.link-text-short {
    display: none; /* Hidden by default in normal sidebar mode */
}

.ai-panel-text {
    display: inline; /* Shown by default in normal sidebar mode */
}

/* When sidebar is collapsed, show short text and hide icon */
.sidebar-left.collapsed .link-text-short,
html.sidebar-prefers-collapsed .sidebar-left .link-text-short {
    display: inline;
}

.sidebar-left.collapsed .ai-panel-text,
.sidebar-left.collapsed .ai-panel-icon,
html.sidebar-prefers-collapsed .sidebar-left .ai-panel-text,
html.sidebar-prefers-collapsed .sidebar-left .ai-panel-icon {
    display: none;
}

.sidebar-left .ap-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: #555;
    text-decoration: none;
    transition: background 0.2s;
}

/* Buttons don't reliably inherit font styles across browsers; keep nav text consistent. */
.sidebar-left button.ap-nav-link {
    font: inherit;
}

.sidebar-left .ap-sidebar-search-item {
    width: 100%;
}

.sidebar-left .ap-sidebar-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 80%;
    max-width: 80%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.45rem 0.75rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: #555;
    font: inherit;
}

.sidebar-left .ap-sidebar-search-form:focus-within {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.sidebar-left .ap-sidebar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    box-shadow: none;
    background: transparent;
    color: #555;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    padding: 0;
}

.sidebar-left .ap-sidebar-search-input::placeholder {
    color: #555;
    font: inherit;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    opacity: 1;
}

.sidebar-left .ap-sidebar-search-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #64748b;
    line-height: 0;
    padding: 0;
    cursor: pointer;
    transform: translateY(0) scale(1);
    transform-origin: 50% 50%;
    transition: color 0.2s ease, transform 0.18s cubic-bezier(.2,.9,.2,1.25), filter 0.18s ease;
}

.sidebar-left .ap-sidebar-search-submit i,
.sidebar-left .ap-sidebar-search-submit .ap-bi-svg,
.sidebar-left .ap-sidebar-search-submit svg {
    display: inline-block;
    font-size: 1.05rem;
}

.sidebar-left .ap-sidebar-search-form:hover .ap-sidebar-search-submit,
.sidebar-left .ap-sidebar-search-form:focus-within .ap-sidebar-search-submit,
.sidebar-left .ap-sidebar-search-submit:hover,
.sidebar-left .ap-sidebar-search-submit:focus-visible {
    color: #111;
    transform: translateY(-2px) scale(1.14) rotate(-3deg);
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, 0.14)) saturate(1.18);
}

.sidebar-left .ap-sidebar-search-collapsed-link {
    display: none;
}

.sidebar-left .ap-cards-per-row-item {
    padding: 0.05rem 0 0.15rem;
    width: 100%;
}

.sidebar-left .ap-cards-per-row-item[hidden] {
    display: none !important;
}

.sidebar-left .ap-cards-per-row-item.ap-nav-link {
    align-items: center;
    background: transparent;
    box-sizing: border-box;
    gap: 0.5rem;
    justify-content: flex-start;
    max-width: 80%;
    padding: 0.45rem 0.75rem;
    width: 80%;
}

.sidebar-left .ap-cards-per-row-item.ap-nav-link:hover,
.sidebar-left .ap-cards-per-row-item.ap-nav-link:focus-visible {
    background: transparent;
}

.sidebar-left .ap-cards-per-row-item .cards-per-row-control {
    display: flex;
    min-height: 2.2rem;
    width: 100%;
    align-items: center;
}

.sidebar-left .ap-cards-per-row-item.ap-nav-link .cards-per-row-control {
    flex: 1 1 auto;
    min-height: 2.2rem;
    min-width: 0;
}

.sidebar-left .ap-cards-row-toggle.ap-reading-level-toggle {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    max-width: 100%;
}

.sidebar-left .ap-cards-row-toggle.ap-reading-level-toggle::after {
    content: none;
    display: none;
}

.sidebar-left .ap-cards-row-toggle .ap-cards-row-option {
    min-height: 2.2rem;
    opacity: 1;
    padding: 0;
    pointer-events: auto;
}

.sidebar-left .ap-cards-row-toggle .ap-cards-row-option:hover,
.sidebar-left .ap-cards-row-toggle .ap-cards-row-option:focus-visible {
    background: transparent;
    color: #111;
}

.sidebar-left .ap-cards-row-toggle.is-settled .ap-cards-row-option {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-left .ap-cards-row-option.active,
.sidebar-left .ap-cards-row-option.is-active {
    background: transparent;
    color: #111;
}

.sidebar-left .ap-cards-row-menu-icon {
    flex: 0 0 1.1rem;
    width: 1.1rem;
    color: #555;
    font-size: 0.9rem;
    line-height: 1;
    transform: translateY(0) scale(1);
    transform-origin: 50% 50%;
    transition: color 0.2s ease, transform 0.18s cubic-bezier(.2,.9,.2,1.25), filter 0.18s ease;
}

.sidebar-left .ap-cards-per-row-item.ap-nav-link:hover .ap-cards-row-menu-icon,
.sidebar-left .ap-cards-per-row-item.ap-nav-link:focus-visible .ap-cards-row-menu-icon {
    color: #111;
    filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.12)) saturate(1.12);
    transform: translateY(-1px) scale(1.08) rotate(-2deg);
}

.sidebar-left .ap-cards-per-row-item .cols-icon {
    display: block;
    width: 0.88rem;
    height: 0.58rem;
    border-radius: 2px;
    opacity: 0.85;
}

.sidebar-left .ap-cards-row-toggle .ap-cards-row-option.active .cols-icon,
.sidebar-left .ap-cards-row-toggle .ap-cards-row-option.is-active .cols-icon {
    opacity: 1;
}

.sidebar-left .ap-cards-per-row-item .cols-1 {
    background: currentColor;
}

.sidebar-left .ap-cards-per-row-item .cols-2 {
    width: 0.34rem;
    background: currentColor;
    box-shadow: 0.46rem 0 0 currentColor;
}

.sidebar-left .ap-cards-per-row-item .cols-3 {
    width: 0.22rem;
    background: currentColor;
    box-shadow: 0.34rem 0 0 currentColor, 0.68rem 0 0 currentColor;
    transform: translateX(-0.34rem);
}

.sidebar-left .ap-cards-per-row-item .cols-4 {
    width: 0.16rem;
    background: currentColor;
    box-shadow: 0.25rem 0 0 currentColor, 0.5rem 0 0 currentColor, 0.75rem 0 0 currentColor;
    transform: translateX(-0.375rem);
}

.sidebar-left .ap-reading-level-item,
.sidebar-left .ap-cards-per-row-item,
.sidebar-left.collapsed .ap-cards-per-row-item,
html.sidebar-prefers-collapsed .sidebar-left .ap-cards-per-row-item {
    display: none;
}

.sidebar-left .ap-reading-level-item {
    padding: 0.05rem 0 0.15rem;
    width: 100%;
}

.sidebar-left .ap-reading-level-toggle {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    width: 80%;
    max-width: 80%;
    margin-left: 0;
    box-sizing: border-box;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: transparent;
    padding: 0;
    transition: background 0.2s ease;
}

.sidebar-left .ap-reading-level-toggle:hover,
.sidebar-left .ap-reading-level-toggle:focus-within {
    background: #f0f0f0;
}

.sidebar-left .ap-reading-level-option {
    display: inline-flex;
    min-width: 0;
    min-height: 2.4rem;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #555;
    cursor: pointer;
    font: inherit;
    letter-spacing: 0;
    opacity: 0;
    overflow: hidden;
    padding: 0 0.02rem;
    transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.sidebar-left .ap-reading-level-toggle:hover .ap-reading-level-option,
.sidebar-left .ap-reading-level-toggle:focus-within .ap-reading-level-option {
    opacity: 1;
}

.sidebar-left .ap-reading-level-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    z-index: 2;
    width: 1.1rem;
    height: 1.1rem;
    color: #555;
    line-height: 1;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity 0.12s ease, color 0.12s ease;
}

.sidebar-left .ap-reading-level-icon::before,
.sidebar-left .ap-reading-level-icon::after {
    position: absolute;
    content: "";
}

.sidebar-left .ap-reading-level-icon::before {
    left: 0.05rem;
    right: 0.05rem;
    top: 50%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.72;
    transform: translateY(-50%);
}

.sidebar-left .ap-reading-level-icon::after {
    left: 0.42rem;
    top: 50%;
    width: 0.34rem;
    height: 0.34rem;
    border: 2px solid currentColor;
    border-radius: 999px;
    background: var(--background);
    transform: translateY(-50%);
}

.sidebar-left .ap-reading-level-toggle:hover .ap-reading-level-icon,
.sidebar-left .ap-reading-level-toggle:focus-within .ap-reading-level-icon {
    opacity: 0;
}

.sidebar-left .ap-reading-level-short {
    display: inline;
}

.sidebar-left .ap-reading-level-full {
    display: none;
    font-size: 0.72rem;
    font-weight: inherit;
    line-height: 1;
}

.sidebar-left .ap-reading-level-toggle:hover .ap-reading-level-short,
.sidebar-left .ap-reading-level-toggle:focus-within .ap-reading-level-short {
    display: none;
}

.sidebar-left .ap-reading-level-toggle:hover .ap-reading-level-full,
.sidebar-left .ap-reading-level-toggle:focus-within .ap-reading-level-full {
    display: inline;
}

.sidebar-left .ap-reading-level-option.is-active {
    background: rgba(15, 23, 42, 0.08);
    color: #111;
}

.sidebar-left .ap-reading-level-option.is-disabled,
.sidebar-left .ap-reading-level-option:disabled {
    display: none;
}

.sidebar-left .ap-reading-level-toggle::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: inherit;
    background: transparent;
    color: #555;
    content: attr(data-ap-reading-level-label);
    font: inherit;
    letter-spacing: 0;
    line-height: inherit;
    opacity: 1;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    pointer-events: none;
    transform: scale(1);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.sidebar-left .ap-reading-level-toggle:hover::after,
.sidebar-left .ap-reading-level-toggle:focus-within::after {
    opacity: 0;
    transform: scale(0.98);
}

.sidebar-left .ap-reading-level-option:hover,
.sidebar-left .ap-reading-level-option:focus-visible {
    background: #475569;
    color: #ffffff;
    outline: 0;
}

.sidebar-left .ap-reading-level-option.is-disabled:hover,
.sidebar-left .ap-reading-level-option.is-disabled:focus-visible,
.sidebar-left .ap-reading-level-option:disabled:hover,
.sidebar-left .ap-reading-level-option:disabled:focus-visible {
    background: transparent;
}

.sidebar-left .ap-reading-level-option.is-denied {
    background: #dc2626;
    color: #ffffff;
}

.sidebar-left .ap-reading-level-toggle.is-settled .ap-reading-level-option {
    opacity: 0;
    pointer-events: none;
}

.sidebar-left .ap-reading-level-toggle.is-settled .ap-reading-level-icon {
    opacity: 1;
}

.sidebar-left .ap-reading-level-toggle.is-settled::after {
    opacity: 1;
    transform: scale(1);
}

.sidebar-left.collapsed .ap-reading-level-item,
html.sidebar-prefers-collapsed .sidebar-left .ap-reading-level-item,
.sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-reading-level-item {
    display: none;
}

html[data-ap-reading-level="1"] #main-content span[data-tier="sensitive"]:not(.censored),
html[data-ap-reading-level="1"] #main-content span[data-tier="paid"]:not(.censored),
html[data-ap-reading-level="1"] #main-content span[data-tier="private"]:not(.censored),
html[data-ap-reading-level="1"] #main-content span[data-tier="black"]:not(.censored),
html[data-ap-reading-level="2"] #main-content span[data-tier="paid"]:not(.censored),
html[data-ap-reading-level="2"] #main-content span[data-tier="private"]:not(.censored),
html[data-ap-reading-level="2"] #main-content span[data-tier="black"]:not(.censored),
html[data-ap-reading-level="3"] #main-content span[data-tier="private"]:not(.censored),
html[data-ap-reading-level="3"] #main-content span[data-tier="black"]:not(.censored) {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
    user-select: none;
}

#main-content span[data-ap-reader-hidden="1"],
#main-content span[data-ap-reader-hidden="1"] * {
    color: transparent !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
    user-select: none;
}

/* Search submenu: show all search options under Originals. */
.sidebar-left .ap-nav-link:hover,
.sidebar-left .ap-nav-link:focus,
.sidebar-left .ap-nav-link:focus-visible { text-decoration: none; }

.sidebar-left .ap-nav-link i,
.sidebar-left .ap-nav-link .ap-bi-svg,
.sidebar-left .ap-nav-link svg,
.sidebar-left .nav-icon-img {
    display: inline-block;
    font-size: 1.2rem;
    color: #555;
    margin-right: 0;
    transform: translateY(0) scale(1);
    transform-origin: 50% 50%;
    transition: color 0.2s ease, transform 0.18s cubic-bezier(.2,.9,.2,1.25), filter 0.18s ease;
}
.sidebar-left .nav-icon-img { margin-right: 0; }

.sidebar-left.collapsed .ap-nav-link,
html.sidebar-prefers-collapsed .sidebar-left .ap-nav-link {
    justify-content: center;
    padding: 0.75rem 0;
    width: 100%;
}

.sidebar-left.collapsed .ap-sidebar-search-form,
html.sidebar-prefers-collapsed .sidebar-left .ap-sidebar-search-form {
    display: none;
}

.sidebar-left.collapsed .ap-sidebar-search-collapsed-link,
html.sidebar-prefers-collapsed .sidebar-left .ap-sidebar-search-collapsed-link {
    display: flex;
}

.sidebar-left.collapsed .ap-nav-link i,
.sidebar-left.collapsed .ap-nav-link .ap-bi-svg,
.sidebar-left.collapsed .ap-nav-link svg,
html.sidebar-prefers-collapsed .sidebar-left .ap-nav-link i,
html.sidebar-prefers-collapsed .sidebar-left .ap-nav-link .ap-bi-svg,
html.sidebar-prefers-collapsed .sidebar-left .ap-nav-link svg,
.sidebar-left.collapsed .nav-icon-img,
html.sidebar-prefers-collapsed .sidebar-left .nav-icon-img {
    margin-right: 0;
}

/* AI Panel System Messages & Notifications */
.system-message {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-left: 3px solid;
    background-color: rgba(0, 0, 0, 0.03);
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.system-message .system-tag {
    font-weight: bold;
    margin-right: 6px;
    color: #444;
}

.system-message.success { border-left-color: #28a745; }
.system-message.error { border-left-color: #dc3545; }
.system-message.warning { border-left-color: #ffc107; }
.system-message.info { border-left-color: #17a2b8; }
.system-message.debug { border-left-color: #6c757d; }

/* AI Notification Badge */
#aiNotificationBadge {
    font-size: 0.65rem;
    padding: 0.25em 0.6em;
    transform: translate(25%, -25%) !important;
    transition: all 0.3s ease;
}

/* Notification item styling */
.notification-item {
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border-radius: 4px;
    margin-bottom: 2px;
}

.notification-item:hover,
.notification-item.notification-hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.notification-item.unread {
    border-left: 3px solid #dc3545;
}

.notification-item.read {
    opacity: 0.9;
}

/* Notification actions styling */
.notification-actions {
    transition: all 0.3s ease;
    opacity: 0;
}

.notification-item:hover .notification-actions,
.notification-item.notification-hover .notification-actions {
    opacity: 1;
}

/* Hide notification animation */
.notification-hiding {
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

/* Approve & Hide button styling */
.hide-notification-btn {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.hide-notification-btn:hover {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

/* Notifications container */
.notifications-container {
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.notifications-container::-webkit-scrollbar {
    width: 6px;
}

.notifications-container::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.notifications-container::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

/* Notification types */
.notification-item i.bi-check-circle-fill {
    color: #28a745;
}

.notification-item i.bi-exclamation-triangle-fill {
    color: #ffc107;
}

.notification-item i.bi-exclamation-circle-fill {
    color: #dc3545;
}

.notification-item i.bi-info-circle-fill {
    color: #17a2b8;
}

.sidebar-left .ap-nav-link:hover,
.sidebar-left .ap-nav-link:focus-visible {
    background-color: #f0f0f0;
}

.sidebar-left .ap-nav-link:hover i,
.sidebar-left .ap-nav-link:hover .ap-bi-svg,
.sidebar-left .ap-nav-link:hover svg,
.sidebar-left .ap-nav-link:hover .nav-icon-img,
.sidebar-left .ap-nav-link:focus-visible i,
.sidebar-left .ap-nav-link:focus-visible .ap-bi-svg,
.sidebar-left .ap-nav-link:focus-visible svg,
.sidebar-left .ap-nav-link:focus-visible .nav-icon-img {
    color: #111;
    transform: translateY(-2px) scale(1.14) rotate(-3deg);
    filter: drop-shadow(0 3px 4px rgba(15, 23, 42, 0.14)) saturate(1.18);
}

.sidebar-left .ap-nav-link.is-active,
.sidebar-left .ap-nav-link.is-open,
.sidebar-left .ap-nav-link.is-active i,
.sidebar-left .ap-nav-link.is-open i,
.sidebar-left .ap-nav-link.is-active .ap-bi-svg,
.sidebar-left .ap-nav-link.is-open .ap-bi-svg,
.sidebar-left .ap-nav-link.is-active svg,
.sidebar-left .ap-nav-link.is-open svg {
    color: #111;
    background-color: transparent;
}

.sidebar-left .ap-nav-link.is-active i,
.sidebar-left .ap-nav-link.is-open i,
.sidebar-left .ap-nav-link.is-active .ap-bi-svg,
.sidebar-left .ap-nav-link.is-open .ap-bi-svg,
.sidebar-left .ap-nav-link.is-active svg,
.sidebar-left .ap-nav-link.is-open svg {
    transform: translateY(0) scale(1.05);
}

/* collapsed left sidebar */
.sidebar-left.collapsed,
html.sidebar-prefers-collapsed .sidebar-left {
    flex: 0 0 5.5rem;   /* shrink the flex‑basis too */
    width: 5.5rem;
}
.sidebar-left.collapsed .link-text,
.sidebar-left.collapsed .logo-text,
.sidebar-left.collapsed .nav-icon-hide-xs,
.sidebar-left.collapsed .ai-panel-section,
html.sidebar-prefers-collapsed .sidebar-left .link-text,
html.sidebar-prefers-collapsed .sidebar-left .logo-text,
html.sidebar-prefers-collapsed .sidebar-left .nav-icon-hide-xs,
html.sidebar-prefers-collapsed .sidebar-left .ai-panel-section { display: none; }
.sidebar-left.collapsed .link-text-short,
html.sidebar-prefers-collapsed .sidebar-left .link-text-short { display: inline-block; }

.sidebar-left.collapsed .logo,
html.sidebar-prefers-collapsed .sidebar-left .logo {
    margin: 0;
    padding: 0;
    width: 100%;
    justify-content: center;
}

.sidebar-left.collapsed .logo a,
html.sidebar-prefers-collapsed .sidebar-left .logo a {
    display: flex;
    justify-content: center;
    padding: 0.75rem 0;
    width: 100%;
}

body.ap-sidebar-lock-collapsed .sidebar-left,
body.ap-sidebar-lock-collapsed .sidebar-left * {
    transition: none !important;
}



@media (min-width: 1200px) {
    .sidebar-left {
        z-index: 1040;
        transition: flex-basis 160ms ease, width 160ms ease, max-width 160ms ease, box-shadow 160ms ease;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) {
        flex: 0 0 5.5rem;
        width: 5.5rem;
        max-width: 5.5rem;
        overflow: visible;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .link-text,
    .sidebar-left.sidebar-auto-compact:not(.collapsed) .logo-text,
    .sidebar-left.sidebar-auto-compact:not(.collapsed) .nav-icon-hide-xs,
    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ai-panel-section,
    .sidebar-left.sidebar-auto-compact:not(.collapsed) .sidebar-footer-links {
        display: none !important;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .link-text-short {
        display: inline-block;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-copyright-short {
        display: inline;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .logo {
        margin: 0;
        padding: 0;
        width: 100%;
        justify-content: center;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .logo a {
        display: flex;
        justify-content: center;
        padding: 0.75rem 0;
        width: 100%;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-logo-img {
        display: block;
        margin-right: 0;
        width: 47px;
        height: 47px;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-nav-link {
        justify-content: center;
        padding: 0.75rem 0;
        width: 100%;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-sidebar-search-form {
        display: none;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-sidebar-search-collapsed-link {
        display: flex;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .ap-nav-link i,
    .sidebar-left.sidebar-auto-compact:not(.collapsed) .nav-icon-img {
        margin-right: 0;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) .sidebar-footer {
        display: none !important;
    }

    .sidebar-left.sidebar-auto-compact:not(.collapsed) #toggleSidebarBtn {
        display: none !important;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) {
        z-index: 1060;
        background: var(--background);
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .logo,
    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-body,
    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-footer {
        width: 14rem;
        max-width: 14rem;
        background: var(--background);
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-body,
    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-footer {
        box-shadow: 16px 16px 44px rgba(15, 23, 42, 0.12);
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .link-text,
    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .logo-text,
    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .nav-icon-hide-xs {
        display: inline-block !important;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-footer-links {
        display: flex !important;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-footer {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        position: static;
        margin-top: auto;
        padding-top: 0.9rem;
        padding-bottom: 12px;
        opacity: 1;
        background: var(--background);
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .link-text-short {
        display: none;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .logo {
        padding-top: 0.55rem;
        padding-bottom: 0.35rem;
        justify-content: flex-start;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .logo a {
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        width: auto;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .ap-logo-img {
        width: 18px;
        height: 18px;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .ap-nav-link {
        justify-content: flex-start;
        padding: 0.6rem 1rem;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .ap-sidebar-search-form {
        display: flex;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .ap-sidebar-search-collapsed-link {
        display: none;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .ap-copyright-full {
        display: inline;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .ap-copyright-short {
        display: none;
    }

    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-footer-links a,
    .sidebar-left.sidebar-auto-compact.sidebar-auto-expanded:not(.collapsed) .sidebar-footer .ap-copyright {
        color: #7a7a7a;
        opacity: 1;
    }
}



/* --- Sidebar toggle visibility --------------------------------------- */
/* Keep the collapse/expand arrow visible even when the sidebar is collapsed */
.sidebar-left.collapsed #toggleSidebarBtn,
html.sidebar-prefers-collapsed .sidebar-left #toggleSidebarBtn {
    display: flex !important;
    justify-content: flex-start;
    align-items: center;
    padding: 0.75rem 1rem;
    width: 100%;
}

/* shared sidebar height fix */
.sidebar-left {
    /* allow sidebar to span full viewport */
    height: 100vh;
    padding-bottom: 2px; /* keep footer off screen edge */
}

/* Default: show left sidebar footer */
.sidebar-left .sidebar-footer {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

/* Allow footer links inside the mobile/tablet drawer */
@media (max-width: 1199.98px) {
  .sidebar-left.drawer-open .sidebar-footer {
    display: flex !important;
  }
}

/* Phone only: keep left footer visible */
@media (max-width: 575.98px) {
  .sidebar-left .sidebar-footer {
    display: flex !important;
  }
}

.sidebar-footer-links {
    display: flex;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 3px;
    margin-bottom: 6px;
    line-height: 1.2;
}
.sidebar-footer-links:last-child {
    margin-bottom: 8px; /* not flush-to-bottom */
}
.sidebar-footer-links a {
    color: #bbb;
    text-decoration: none;
    padding: 0 1px;
    transition: color 0.2s;
    font-weight: 600;
}
.sidebar-footer-links a:hover { color: #333; }

/* Sidebar footer — restore original style */
.sidebar-footer {
  margin-top: auto;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: inherit;
  flex: 0 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
  padding-top: 1rem;
  padding-bottom: 12px;
  font-size: 0.65rem;
  color: #bbb;
  opacity: 0.75;
  user-select: none;
}

.sidebar-left.collapsed .sidebar-footer-links,
html.sidebar-prefers-collapsed .sidebar-left .sidebar-footer-links {
    display: none;
}

.sidebar-left.collapsed .sidebar-footer-links.sidebar-footer-copyright,
html.sidebar-prefers-collapsed .sidebar-left .sidebar-footer-links.sidebar-footer-copyright {
    display: none;
}

.sidebar-left:not(.collapsed) .sidebar-footer-links,
html:not(.sidebar-prefers-collapsed) .sidebar-left .sidebar-footer-links {
    display: flex;
}

.sidebar-left .sidebar-footer-links.sidebar-footer-copyright {
    display: flex;
}

.sidebar-footer-links.sidebar-footer-copyright,
.ap-copyright {
    white-space: nowrap;
}

.ap-copyright-short {
    display: none;
}

.sidebar-left.collapsed .ap-copyright-full,
html.sidebar-prefers-collapsed .sidebar-left .ap-copyright-full {
    display: none;
}

.sidebar-left.collapsed .ap-copyright-short,
html.sidebar-prefers-collapsed .sidebar-left .ap-copyright-short {
    display: inline;
}

.sidebar-left:not(.collapsed) #toggleSidebarBtn .sidebar-toggle-face {
    display: none;
}

.sidebar-left.collapsed #toggleSidebarBtn,
html.sidebar-prefers-collapsed .sidebar-left #toggleSidebarBtn {
    display: none !important;
}

.sidebar-footer-links {
    white-space: normal;
    font-size: 0.65rem;
    line-height: 1.2;
}

.sidebar-footer .sidebar-footer-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.sidebar-footer a {
  color: inherit;
  text-decoration: none;
}

.sidebar-footer a:hover {
  text-decoration: none;
}

/* ---- Cards, buttons, forms, utilities ---- */

/* Button shims live in 06-components-tail.css (AP-native + legacy `.btn*`). */

/* story cards */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.5rem;
}

.story-card {
  
    background-color:#fafafa;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.story-card a       { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.story-card h5      { margin: 0; padding: 0.75rem 1rem 0.25rem; font-size: 1rem; font-weight: 600; }
.story-card img     { flex: 0 0 150px; width: 100%; object-fit: cover; }
.story-card .snippet{ flex: 1; padding: 1rem; overflow: hidden; }
.story-card .time   { padding: 0 1rem 1rem; font-size: 0.85rem; color: rgba(0,0,0,0.6); }

.story-card:hover           { background-color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
/* Card hover effects removed as requested */
.story-card:hover img:not(.ap-reaction-icon):not(.ap-reaction-icon-clone):not(.story-card-badge__reaction) { transform: none; }
.story-card:hover .snippet,
.story-card:hover .time { color: inherit; }

.story-card .overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.9);
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    overflow-y: auto;
}
/* Let JavaScript control overlay visibility instead */
/* .story-card:hover .overlay { opacity: 1; } */


/* profile cards */
.profile-card {
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.profile-card a       { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.profile-card img     { flex: 0 0 150px; width: 100%; object-fit: cover; }
.profile-card .snippet{ flex: 1; padding: 1rem; overflow: hidden; }
.profile-card .time   { padding: 0 1rem 1rem; font-size: 0.85rem; color: rgba(0,0,0,0.6); }

.profile-card:hover           { background-color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.profile-card:hover img       { filter: brightness(0) invert(1) saturate(100%); }
.profile-card:hover .snippet,
.profile-card:hover .time     { color: #fff !important; }

.profile-card .overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.9);
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
    overflow-y: auto;
}

.profile-card:hover .overlay { opacity: 1; }

/* --- Override: keep profile card visible on hover --- */
.profile-card:hover .overlay { opacity: 0 !important; }
.profile-card:hover img      { filter: none !important; }
.profile-card:hover .snippet,
.profile-card:hover .time    { color: var(--primary) !important; }


.profile-card {
  display: block;
  border: 1px solid rgba(0,0,0,.125); 
  border-radius: 0.25rem;
  padding: 1rem;
  margin-bottom: 1rem;
  background-color: white;
}

.profile-card .username {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.profile-card .profile-links a {
  text-decoration: none;
  margin-right: 1rem;
}

.profile-card .profile-links a:hover {
  text-decoration: none;
}

/* marketplace cards */
.market-card            { padding: 0.25rem; max-width: 12rem; width: 100%; }
.market-card .card-body { padding: 0.25rem; }
.market-card i,
.market-card .card-body .card-title,
.market-card .card-body a { color: #666; transition: color 0.2s; }
.market-card:hover i,
.market-card:hover .card-body .card-title,
.market-card:hover .card-body a { color: #222; }

/* content blocks */
.content-block {
    max-width: 800px;
    margin: 5px auto;
    padding: 5px;
    font-family: Arial, sans-serif;
    line-height: 1.5;
    color: var(--primary);
    background-color: var(--background);
}
.content-block h1,
.content-block h2,
.content-block h3 { margin-top: 5px; margin-bottom: 25px; text-align: left; }

/* buttons */
.cta-button {
    display: inline-block;
    background-color: var(--click-blue);
    color: var(--background);
    font-size: 1rem;
    font-weight: bold;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}
.cta-button:hover   { background-color: var(--hover-blue); transform: scale(1.05); }
.cta-button:active  { background-color: var(--click-blue); transform: scale(0.95); }

/* forms */
.form-container {
    background-color: var(--background);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
    max-width: 400px;
    margin: 20px auto;
}
input,
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--click-blue);
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}
input:focus,
select:focus,
textarea:focus { border-color: var(--click-blue); outline: none; }
input.is-invalid { border: 2px solid var(--click-blue); background: #ffcaca; }

/* Chat / console panel in right sidebar */
.console-output {
    background: #eee;
    font-family: Arial, sans-serif;
    border-radius: 8px;
    padding: 10px;
    min-height: 180px;  /* Increased from 110px */
    max-height: 350px;  /* Increased from 150px */
    overflow-y: auto;
    margin-bottom: 7px;
    border: 1px solid var(--footer-area);
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 18px 20px 8px 20px; /* Reduced bottom margin */
}
.console-panel {
    background: #f4f4f4;
    border: 1.5px solid #bbb;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin: 14px 16px 0 16px;
    padding: 18px 18px 12px 18px; /* Reduced bottom padding */
    min-height: 180px;
    max-height: 450px;  /* Increased from 320px */
    display: flex;
    flex-direction: column;
}

/* chat box */
.chat-box {
    background: #fafafa;
    border: 1px solid #ddd;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.chat-box::-webkit-scrollbar      { width: 8px; }
.chat-box::-webkit-scrollbar-thumb{ background: #ccc; border-radius: 10px; }
.chat-box::-webkit-scrollbar-thumb:hover { background: #888; }
.chat-box { scrollbar-width: thin; scrollbar-color: #ccc transparent; }


/* misc utilities */
.pagination-controls { margin-top: 1rem; display:flex; justify-content:space-between; gap:1rem; }
.homepage-footer     { text-align:center; color:#6c757d; padding:0.5rem 0; font-size:0.875rem; opacity:0.8; }
.story-navigation    { display:flex; justify-content:space-between; margin-top:2rem; font-size:0.9rem; color:#666; }

.pagination-controls a:hover,
.pagination-controls a:focus {
    color: #222 !important;
}
.story-navigation a:hover,
.story-navigation a:focus { 
    color: #222 !important;
}
/* 5_responsive.css */
/* ---- Mobile, tablet & dark-mode overrides ---- */


/* Hamburger visibility */
#hamburgerBtn {
    display: none !important;
}
@media (max-width:1199.98px) {
    #hamburgerBtn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* Tablet (≥576px and <768px): icon-only collapsed */
@media (min-width:576px) and (max-width:767.98px) {
    .sidebar-left {
        flex: 0 0 6rem;
        width: 6rem;
    }
    .sidebar-left .link-text,
    .sidebar-left .logo-text,
    .sidebar-left .nav-icon-hide-xs {
        display: none !important;
    }
    .sidebar-left .logo a {
        width: 100%;
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }
    .sidebar-left .ap-logo-img {
        margin-right: 0;
    }
    .sidebar-left .link-text-short {
        display: inline-block !important;
    }
    /* hide collapse toggle on tablet */
    #toggleSidebarBtn {
        display: none !important;
    }
    #main-content {
        flex: 1 1 100%;
        margin-left: 0;
        padding-left: 1rem;
    }
}

/* Phone (<576px): hide sidebar, show hamburger */
@media (max-width:575.98px) {
    .sidebar-left {
        display: none !important;
    }
    #hamburgerBtn {
        display: block !important;
    }
    #main-content {
        flex: 1 1 100%;
        margin-left: 0;
        padding-left: 1rem;
    }
    /* When sidebar is toggled on phones, keep full labels visible */
    .sidebar-left.collapsed .link-text,
    .sidebar-left.collapsed .logo-text,
    html.sidebar-prefers-collapsed .sidebar-left .link-text,
    html.sidebar-prefers-collapsed .sidebar-left .logo-text {
        display: inline-block !important;
    }
    .sidebar-left.collapsed .ap-nav-link,
    html.sidebar-prefers-collapsed .sidebar-left .ap-nav-link {
        justify-content: flex-start;
    }
    .sidebar-left .nav-icon-hide-xs {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .ai-panel.ai-panel-float {
        right: 12px;
        left: 12px;
        top: auto;
        bottom: 72px;
        width: auto;
        height: 52vh;
        max-height: 58vh;
    }
    .ai-panel-launcher {
        right: 12px;
        bottom: 12px;
        width: 52px;
        height: 58px;
    }
}

/* Hide duplicate footer links in the feed when the drawer is open */
.sidebar-drawer-open #site-footer {
    display: none !important;
}

.mobile-footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    text-align: center;
    background: transparent;
    padding: 0 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

.mobile-footer-links .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.85rem;
}

.footer-links-meta {
    gap: 0.35rem 0.85rem;
}

@media (max-width:1199.98px) {
    .sidebar-left.drawer-open {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        width: min(40vw, 520px) !important;
        max-width: none !important;
        flex: 0 0 auto !important;
        height: 100% !important;
        background: #ffffff !important;
        z-index: 1051 !important;
        padding: 1rem 0.75rem !important;
        overflow-y: auto !important;
        flex-direction: column !important;
    }
    .sidebar-left.drawer-open .logo {
        display: none !important;
    }
    .sidebar-left.drawer-open nav {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .sidebar-left.drawer-open .link-text,
    .sidebar-left.drawer-open .logo-text,
    .sidebar-left.drawer-open .nav-icon-hide-xs {
        display: inline-block !important;
    }
    .sidebar-left.drawer-open .link-text-short {
        display: none !important;
    }
    .sidebar-left.drawer-open #toggleSidebarBtn {
        display: none !important;
    }
    .sidebar-left.drawer-open .ap-nav-link {
        justify-content: flex-start !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* Tablet/mobile: when the Sections panel expands, show icons only (no labels). */
    .sidebar-left.drawer-open #ap-sections-panel .link-text {
        display: none !important;
    }
    .sidebar-left.drawer-open #ap-sections-panel .ap-nav-link {
        justify-content: center !important;
        padding-left: 0 !important;
    }

    /* Keep footer/copyright readable and fully visible in drawer mode. */
    .sidebar-left.drawer-open .sidebar-footer {
        position: static !important;
        opacity: 1 !important;
        color: #bbb !important;
        font-size: 0.72rem !important;
        line-height: 1.35 !important;
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .sidebar-left.drawer-open .sidebar-footer-links a,
    .sidebar-left.drawer-open .sidebar-footer .ap-copyright {
        color: #bbb !important;
        opacity: 1 !important;
    }

    .sidebar-left.drawer-open .sidebar-footer-copyright,
    .sidebar-left.drawer-open .sidebar-footer-links.sidebar-footer-copyright {
        margin-bottom: 0 !important;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .sidebar-left.drawer-open .ap-copyright,
    .sidebar-left.drawer-open .ap-copyright-full {
        white-space: normal !important;
    }
}

/* tablet tweaks */
@media (min-width: 601px) and (max-width: 1024px) {
    #site-header nav ul { gap:15px; }
    main h1             { font-size:2rem; }
    #site-footer .footer-links { gap:10px; }
    /* hide collapse toggle on tablet */
    #toggleSidebarBtn {
        display: none !important;
    }
    /* collapse left nav to icons only */
    .sidebar-left {
        flex: 0 0 6rem;
        width: 6rem;
    }
    .sidebar-left .link-text,
    .sidebar-left .logo-text,
    .sidebar-left .nav-icon-hide-xs {
        display: none !important;
    }
    .sidebar-left .link-text-short {
        display: inline-block !important;
    }
    #main-content {
        flex: 1 1 100%;
        margin-left: 0;
        padding-left: 1rem;
    }
}

/* dark-mode */
body.dark-mode {
    --background:  #121212;
    --primary:     #e0e0e0;
    --link-hover:  #888888;
    --footer-text: #aaaaaa;
    --footer-area: #1e1e1e;
    --hover-blue:  #555555;
    --click-blue:  #3f3f3f;
    background:     var(--background);
    color:          var(--primary);
}

body.dark-mode #site-header,
body.dark-mode .sidebar-left { background: var(--footer-area); color: var(--primary); }

body.dark-mode .chat-box,
body.dark-mode .console-panel {
    background: #1b1b1b !important;
    border-color: #333 !important;
    color: var(--primary) !important;
}

body.dark-mode .chat-message.user { background:#333; }
body.dark-mode .chat-message.ai   { background:#222; }
body.dark-mode .input-group input { background:#1e1e1e; color:var(--primary); border-color:#333; }
body.dark-mode .input-group button{ background:#444; color:#fff; }
body.dark-mode .input-group button:hover{ background:#666; }

/* hide collapse toggle on screens narrower than desktop */
@media (max-width: 1024px) {
    #toggleSidebarBtn {
        display: none !important;
    }
}
/* Align toggle icon to right inside the link */
.sidebar-left #toggleSidebarBtn {
  position: relative;
  z-index: 1060; /* Higher than fixed-bottom footer */
  display: flex;
}
.sidebar-left:not(.collapsed) #toggleSidebarBtn,
html:not(.sidebar-prefers-collapsed) .sidebar-left #toggleSidebarBtn {
  justify-content: flex-end;
  padding: 0.5rem var(--sidebar-item-hpad, 1rem);
}
html.sidebar-prefers-collapsed .sidebar-left #toggleSidebarBtn,
.sidebar-left.collapsed #toggleSidebarBtn {
  justify-content: flex-start;
  padding: 0.75rem 1rem;
}
.sidebar-left #toggleSidebarBtn { width: 100%; }   /* keep full‑width click area */

.sidebar-left #toggleSidebarBtn,
.sidebar-left #toggleSidebarBtn i {
    color: #bbbbbb;
}

.sidebar-left #toggleSidebarBtn i {
    margin-left: auto;
}

/* Hide dollar-sign text in collapsed sidebar */
.sidebar-left.collapsed .ap-nav-link .wallet-sign,
html.sidebar-prefers-collapsed .sidebar-left .ap-nav-link .wallet-sign {
    display: none !important;
}

/* console panel input improvements */
/* Chat/console input: single box with textarea and button inside */
.console-input:not(.console-input-area) {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #f6f8fa;
    border: 1.5px solid #ddd;
    border-radius: 10px; /* Slightly smaller radius */
    padding: 8px 12px 6px 12px; /* Reduced padding */
    margin: 10px 18px 8px 18px; /* Less top margin */
    /* Remove box-shadow and outline to avoid stacking visuals */
    box-shadow: none;
    overflow: hidden;
    /* Add compact styling */
    max-height: 70px; /* Limit max height */
}

.console-input:not(.console-input-area) form,
.console-input:not(.console-input-area) form.d-flex,
.console-input:not(.console-input-area) form.align-items-center,
.console-input:not(.console-input-area) form * {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.console-input:not(.console-input-area) textarea {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    box-shadow: none;
    min-height: 32px; /* Reduced from 44px */
    font-size: 0.9rem; /* Smaller text size */
    color: #222;
    padding: 0 45px 0 0; /* Less right padding */
    margin: 0;
    resize: none;
    outline: none;
    line-height: 1.3; /* Tighter line spacing */
}

.console-input:not(.console-input-area) textarea::placeholder {
    color: #bbb;
    font-size: 1rem;
}

.console-input:not(.console-input-area) button {
    position: absolute;
    right: 18px;
    bottom: 16px;
    background: transparent !important;
    color: #bbb;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.25rem;
    width: 52px;
    height: 52px;
    min-width: 0;
    min-height: 0;
    max-width: 42px;
    max-height: 42px;
    padding: 0;
    box-shadow: none;
    margin-left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s, color 0.14s;
}
.console-input:not(.console-input-area) button svg {
    color: #aaa;
    transition: color 0.14s;
    width: 1.8em;
    height: 1.8em;
}
.console-input:not(.console-input-area) button:hover,
.console-input:not(.console-input-area) button:focus {
    color: #888;
    background: transparent;
    outline: none;
    box-shadow: none;
}
.console-input:not(.console-input-area) button:hover svg,
.console-input:not(.console-input-area) button:focus svg {
    color: #888;
}

/* Keep icon dark while the button is actively pressed */
.console-input:not(.console-input-area) button:active,
.console-input:not(.console-input-area) button:active svg,
.console-input:not(.console-input-area) button:active:focus,
.console-input:not(.console-input-area) button:active:hover {
    background: transparent !important;   /* no grey flash */
    color: #444 !important;               /* icon stays dark */
}

.console-input:not(.console-input-area) button:active svg {
    color: #444 !important;               /* icon stays dark */
}
.console-input:not(.console-input-area) textarea:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

.console-input:not(.console-input-area):focus-within {
    border-color: #bfc3ca;
    box-shadow: none;
}
@media (max-width: 767.98px) {
    .console-input:not(.console-input-area) {
        padding: 9px 8px 8px 10px;
        margin: 15px 6px 6px 6px;
    }
    .console-input:not(.console-input-area) textarea {
        padding-right: 48px;
    }
    .console-input:not(.console-input-area) button {
        right: 8px;
        bottom: 8px;
        width: 42px;
        height: 42px;
        max-width: 42px;
        max-height: 42px;
        font-size: 1.08rem;
    }
}
/* Sidebar footer alignment fix */
.sidebar-footer-links {
    justify-content: flex-start;
    align-items: left;
    text-align: left;
    font-size: 0.7rem;
    padding-left: 18px;
    padding-right: 18px;
}


.sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 0.7rem;
    padding-left: 16px;
    padding-right: 16px;
}
.sidebar-footer-copyright {
    align-self: flex-start;
    text-align: left;
    margin-left: 18px;
    font-size: 0.7rem;
    margin-top: 8px;
    margin-bottom: 0;
    padding: 0;
}

/* Hide token count on extra-small screens (mobile) */
@media (max-width: 575.98px) {
    #wallet-balance,
    [data-wallet-balance] {
        display: none !important;
    }
}

.sensitive {
    background: #FFF3B0 !important;
    display: inline;
}
.paid {
    background: #ffb0b0 !important;
    display: inline;
}
.private {
    background: #E6C2FF !important;
    display: inline;
}
.black {
    background: #111111 !important;
    display: inline;
}

/* readable text on highlights */
.sensitive,
.paid,
.private {
  color: #000 !important;
}
.black {
  color: #fff !important;
}

/* fallback: spans carrying only data‑tier attr (no class) */
span[data-tier="sensitive"]:not(.censored) {
  background: #FFF3B0 !important;
  color: #000 !important;
  display: inline;
}
span[data-tier="paid"]:not(.censored) {
  background: #ffb0b0 !important;
  color: #000 !important;
  display: inline;
}
span[data-tier="private"]:not(.censored) {
  background: #E6C2FF !important;
  color: #000 !important;
  display: inline;
}
span[data-tier="black"]:not(.censored) {
  background: #111111 !important;
  color: #fff !important;
  display: inline;
}

.sensitive.censored {
  background: #FFF3B0 !important;
  border-bottom: none !important;
  color: #FFF3B0 !important; /* dark-yellow text on yellow bg */
  font-weight: normal !important;
  text-decoration: none !important;
}
.paid.censored {
  background: #ffb0b0 !important;
  border-bottom: none !important;
  color: #ffb0b0 !important; /* dark-green text on green bg */
  font-weight: normal !important;
  text-decoration: none !important;
}
.private.censored {
  background: #E6C2FF !important;
  border-bottom: none !important;
  color: #E6C2FF !important; /* dark-purple text on purple bg */
  font-weight: normal !important;
  text-decoration: none !important;
}
.black.censored {
  background: #111111 !important;
  border-bottom: none !important;
  color: #111111 !important;
  font-weight: normal !important;
  text-decoration: none !important;
}

/* Ensure masked glyphs match the tier highlight color - without underlines */
.paid.censored {
  color: inherit !important;
  border-bottom: none !important;
}
.sensitive.censored {
  color: inherit !important;
  border-bottom: none !important;
}
.private.censored {
  color: inherit !important;
  border-bottom: none !important;
}
.black.censored {
  color: inherit !important;
  border-bottom: none !important;
}
/* No longer using double-classes for censoring */

/* ===== MERGED FROM notification-badge.css ===== */
/**
 * Notification Badge Styling
 */

/* Notification badge container */
.notification-count-container {
  display: flex;
  justify-content: flex-end;
  margin: 0.5rem;
}

/* Notification count badge */
#notificationCount {
  background-color: #6f42c1;
  color: white;
  border-radius: 50%;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-block;
}

#notificationCount:hover {
  background-color: #5a32a3;
}

/* ===== MERGED FROM notification-panel.css ===== */
/**
 * AI Panel Notification Styles
 * Specifically designed for the dedicated notification panel
 */

.notification-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin: 10px 15px;
  border: 1px solid #dee2e6;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.notification-container:empty {
  display: none;
}

.notification-container .notification-header {
  position: sticky;
  top: 0;
  background: #f8f9fa;
  z-index: 5;
  padding: 5px 0;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 5px;
}

.notification-item {
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 5px;
  background: white;
  border-left: 3px solid #dee2e6;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.notification-item:hover {
  background-color: #f1f3f5;
}

.notification-item.unread {
  border-left: 3px solid #dc3545;
}

.notification-item.read {
  opacity: 0.7;
}

.notification-item .notification-time {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 5px;
  text-align: right;
}

.notification-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.notification-actions button {
  font-size: 0.8rem;
  padding: 2px 8px;
}

/* Mobile/iPad: show only the top brand bar by default (single angryface). */
@media (max-width: 1199.98px) {
  .ap-mobile-nav {
    display: block !important;
  }

  .ap-nav-list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .sidebar-left {
    display: none !important;
  }

  .sidebar-left.drawer-open {
    display: flex !important;
  }
}

/* Desktop: hide mobile header and show left sidebar only. */
@media (min-width: 1200px) {
  .ap-mobile-nav {
    display: none !important;
  }

  .ap-nav-list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }

  .sidebar-left {
    display: flex !important;
  }
}
/* ===== MERGED FROM 4_components.css ===== */
/* censor tiers */
/* Fix censor styles to use proper highlighting colors */
.story-body .censor { display: inline; vertical-align: baseline; border-radius: 2px; padding: 0 1px; }
/* Fixed censor highlight styles with proper colors and normal font weight */
.story-body .censor-sensitive     { background: #cdc38c !important; color: inherit !important; display: inline; vertical-align: baseline; border-radius: 2px; padding: 0 1px; border-bottom: none !important; font-weight: normal !important; text-decoration: none !important; }
.story-body .censor-paid         { background: #ffb0b0 !important; color: inherit !important; display: inline; vertical-align: baseline; border-radius: 2px; padding: 0 1px; border-bottom: none !important; font-weight: normal !important; text-decoration: none !important; }
.story-body .censor-private      { background: #d4c4df !important; color: inherit !important; display: inline; vertical-align: baseline; border-radius: 2px; padding: 0 1px; border-bottom: none !important; font-weight: normal !important; text-decoration: none !important; }
.story-body .censor-black        { background: #111111 !important; color: #ffffff !important; display: inline; vertical-align: baseline; border-radius: 2px; padding: 0 1px; border-bottom: none !important; font-weight: normal !important; text-decoration: none !important; }

body.public .story-body .censor   { display:none !important; }

/* Stronger anti-bold rules for all censor elements */
.story-body span.censor,
.story-body span.censor-sensitive,
.story-body span.censor-paid,
.story-body span.censor-private,
.story-body span.censor-black,
span.censor,
span.censor-sensitive,
span.censor-paid,
span.censor-private,
span.censor-black { font-weight: normal !important; }

/* misc utilities */
.pagination-controls { margin-top: 1rem; display:flex; justify-content:space-between; gap:1rem; }
.homepage-footer     { text-align:center; color:#6c757d; padding:0.5rem 0; font-size:0.875rem; opacity:0.8; }
.paging-link,
.paging-link:hover,
.paging-link:focus,
.paging-link:focus-visible { text-decoration: none; }

/* Buttons (AP-native; Bootstrap `.btn*` are temporary shims while templates migrate). */
/* Never underline links styled as buttons. */
a.ap-btn,
a.ap-btn:hover,
.ap-btn a,
.ap-btn a:hover,
.ap-btn-link,
.ap-btn-link:hover,
a.btn,
a.btn:hover,
.btn a,
.btn a:hover,
.btn-link,
.btn-link:hover {
  text-decoration: none !important;
}

/* AP primary button. */
.ap-btn-primary {
  background-color: var(--click-blue);
  border: 1px solid var(--click-blue);
  color: var(--background);
  transition: background-color 0.3s, transform 0.2s, border-color 0.3s;
}
.ap-btn-primary:hover  { background-color: var(--hover-blue);  border-color: var(--hover-blue);  transform: scale(1.05); }
.ap-btn-primary:active { background-color: var(--click-blue);  border-color: var(--click-blue);  transform: scale(0.95); }

/* Legacy Bootstrap primary shim. Prefer `.ap-btn-primary` going forward. */
.btn.btn-primary {
  background-color: var(--click-blue);
  border-color: var(--click-blue);
  color: var(--background);
  transition: background-color 0.3s, transform 0.2s, border-color 0.3s;
}
.btn.btn-primary:hover  { background-color: var(--hover-blue);  border-color: var(--hover-blue);  transform: scale(1.05); }
.btn.btn-primary:active { background-color: var(--click-blue);  border-color: var(--click-blue);  transform: scale(0.95); }

/* Legacy Bootstrap shim layer.
   These are project-owned rules that keep remaining legacy class hooks functional
   after Bootstrap CSS is removed from the build output. */
.container,
.container-fluid {
  width: 100%;
  margin-right: auto;
  margin-left: auto;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}
.container { max-width: 1320px; }
@media (min-width: 576px) { .container { max-width: 540px; } }
@media (min-width: 768px) { .container { max-width: 720px; } }
@media (min-width: 992px) { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}
.row > * {
  width: 100%;
  max-width: 100%;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}
@media (min-width: 768px) {
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-8 { flex: 0 0 auto; width: 66.66666667%; }
  .col-md-10 { flex: 0 0 auto; width: 83.33333333%; }
  .col-md-12 { flex: 0 0 auto; width: 100%; }
  .d-md-flex { display: flex !important; }
  .justify-content-md-between { justify-content: space-between !important; }
}
@media (min-width: 992px) {
  .col-lg-6 { flex: 0 0 auto; width: 50%; }
  .col-lg-8 { flex: 0 0 auto; width: 66.66666667%; }
}
@media (min-width: 576px) {
  .flex-sm-row { flex-direction: row !important; }
}

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-column { flex-direction: column !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.gap-2 { gap: 0.5rem !important; }
.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }

.m-0 { margin: 0 !important; }
.mx-2 { margin-right: 0.5rem !important; margin-left: 0.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.me-1 { margin-inline-end: 0.25rem !important; }
.me-2 { margin-inline-end: 0.5rem !important; }
.me-3 { margin-inline-end: 1rem !important; }
.ms-2 { margin-inline-start: 0.5rem !important; }
.ms-3 { margin-inline-start: 1rem !important; }
.p-0 { padding: 0 !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.px-0 { padding-right: 0 !important; padding-left: 0 !important; }

.h3 { font-size: 1.75rem; line-height: 1.2; }
.h4 { font-size: 1.5rem; line-height: 1.2; }
.h5 { font-size: 1.25rem; line-height: 1.2; }
.display-4 { font-size: 2.25rem; line-height: 1.15; }
.display-5 { font-size: 2rem; line-height: 1.15; }
.fs-3 { font-size: 1.75rem; }
.fs-4 { font-size: 1.5rem; }
.fw-semibold { font-weight: 600 !important; }
.lead { font-size: 1.125rem; line-height: 1.6; }
.small,
small { font-size: 0.875em; }

.text-center { text-align: center !important; }
.text-white { color: #ffffff !important; }
.text-dark { color: #111827 !important; }
.text-muted { color: #6b7280 !important; }
.text-success { color: #166534 !important; }
.text-danger { color: #b91c1c !important; }
.text-warning { color: #854d0e !important; }
.text-reset { color: inherit !important; }
.text-decoration-none { text-decoration: none !important; }

.bg-white { background-color: #ffffff !important; }
.bg-primary { background-color: #0f172a !important; color: #ffffff !important; }
.bg-success { background-color: #16a34a !important; color: #ffffff !important; }
.bg-warning { background-color: #f59e0b !important; color: #111827 !important; }
.bg-danger { background-color: #dc2626 !important; color: #ffffff !important; }
.bg-secondary { background-color: #475569 !important; color: #ffffff !important; }
.bg-opacity-25 { opacity: 0.25 !important; }

.border { border: 1px solid #e2e8f0 !important; }
.border-0 { border: 0 !important; }
.border-danger { border-color: #dc2626 !important; }
.rounded { border-radius: 0.375rem !important; }
.rounded-3 { border-radius: 0.5rem !important; }
.rounded-circle { border-radius: 9999px !important; }
.shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08) !important; }
.shadow { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16) !important; }

.card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.card-body { padding: 1.25rem; }

.alert {
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
}
.alert-heading { margin-top: 0; margin-bottom: 0.5rem; font-weight: 700; }
.alert-success { background: #ecfdf3; border-color: #a7f3d0; color: #065f46; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}
.btn-sm { padding: 0.35rem 0.625rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.625rem 1rem; font-size: 1rem; }
.btn-primary { background: #0f172a; border-color: #0f172a; color: #ffffff; }
.btn-primary:hover { background: #1f2937; border-color: #1f2937; color: #ffffff; }
.btn-secondary { background: #e2e8f0; border-color: #cbd5e1; color: #0f172a; }
.btn-secondary:hover { background: #cbd5e1; border-color: #94a3b8; color: #0f172a; }
.btn-success { background: #16a34a; border-color: #16a34a; color: #ffffff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #ffffff; }
.btn-dark { background: #0f172a; border-color: #0f172a; color: #ffffff; }
.btn-dark:hover { background: #020617; border-color: #020617; color: #ffffff; }
.btn-primary,
.btn-dark,
a.tw-bg-black,
button.tw-bg-black,
input.tw-bg-black,
[role="button"].tw-bg-black,
a.tw-bg-slate-950,
button.tw-bg-slate-950,
input.tw-bg-slate-950,
[role="button"].tw-bg-slate-950,
a.tw-bg-slate-900,
button.tw-bg-slate-900,
input.tw-bg-slate-900,
[role="button"].tw-bg-slate-900,
a.tw-bg-slate-800,
button.tw-bg-slate-800,
input.tw-bg-slate-800,
[role="button"].tw-bg-slate-800,
a.tw-bg-gray-950,
button.tw-bg-gray-950,
input.tw-bg-gray-950,
[role="button"].tw-bg-gray-950,
a.tw-bg-gray-900,
button.tw-bg-gray-900,
input.tw-bg-gray-900,
[role="button"].tw-bg-gray-900,
a.tw-bg-gray-800,
button.tw-bg-gray-800,
input.tw-bg-gray-800,
[role="button"].tw-bg-gray-800,
a.tw-bg-neutral-950,
button.tw-bg-neutral-950,
input.tw-bg-neutral-950,
[role="button"].tw-bg-neutral-950,
a.tw-bg-neutral-900,
button.tw-bg-neutral-900,
input.tw-bg-neutral-900,
[role="button"].tw-bg-neutral-900,
a.tw-bg-neutral-800,
button.tw-bg-neutral-800,
input.tw-bg-neutral-800,
[role="button"].tw-bg-neutral-800,
a.tw-bg-zinc-950,
button.tw-bg-zinc-950,
input.tw-bg-zinc-950,
[role="button"].tw-bg-zinc-950,
a.tw-bg-zinc-900,
button.tw-bg-zinc-900,
input.tw-bg-zinc-900,
[role="button"].tw-bg-zinc-900,
a.tw-bg-zinc-800,
button.tw-bg-zinc-800,
input.tw-bg-zinc-800,
[role="button"].tw-bg-zinc-800 {
  color: #ffffff !important;
}
.btn-primary *,
.btn-dark *,
a.tw-bg-black *,
button.tw-bg-black *,
[role="button"].tw-bg-black *,
a.tw-bg-slate-950 *,
button.tw-bg-slate-950 *,
[role="button"].tw-bg-slate-950 *,
a.tw-bg-slate-900 *,
button.tw-bg-slate-900 *,
[role="button"].tw-bg-slate-900 *,
a.tw-bg-slate-800 *,
button.tw-bg-slate-800 *,
[role="button"].tw-bg-slate-800 *,
a.tw-bg-gray-950 *,
button.tw-bg-gray-950 *,
[role="button"].tw-bg-gray-950 *,
a.tw-bg-gray-900 *,
button.tw-bg-gray-900 *,
[role="button"].tw-bg-gray-900 *,
a.tw-bg-gray-800 *,
button.tw-bg-gray-800 *,
[role="button"].tw-bg-gray-800 *,
a.tw-bg-neutral-950 *,
button.tw-bg-neutral-950 *,
[role="button"].tw-bg-neutral-950 *,
a.tw-bg-neutral-900 *,
button.tw-bg-neutral-900 *,
[role="button"].tw-bg-neutral-900 *,
a.tw-bg-neutral-800 *,
button.tw-bg-neutral-800 *,
[role="button"].tw-bg-neutral-800 *,
a.tw-bg-zinc-950 *,
button.tw-bg-zinc-950 *,
[role="button"].tw-bg-zinc-950 *,
a.tw-bg-zinc-900 *,
button.tw-bg-zinc-900 *,
[role="button"].tw-bg-zinc-900 *,
a.tw-bg-zinc-800 *,
button.tw-bg-zinc-800 *,
[role="button"].tw-bg-zinc-800 * {
  color: inherit !important;
}
.btn-warning { background: #f59e0b; border-color: #f59e0b; color: #111827; }
.btn-warning:hover { background: #d97706; border-color: #d97706; color: #111827; }
.btn-link {
  background: transparent;
  border-color: transparent;
  color: #0f172a;
  padding-left: 0;
  padding-right: 0;
}
.btn-link:hover { color: #1f2937; background: transparent; border-color: transparent; }
.btn-outline-primary { background: #ffffff; border-color: #0f172a; color: #0f172a; }
.btn-outline-primary:hover { background: #f8fafc; border-color: #1f2937; color: #1f2937; }
.btn-outline-secondary { background: #ffffff; border-color: #94a3b8; color: #334155; }
.btn-outline-secondary:hover { background: #f8fafc; border-color: #64748b; color: #0f172a; }
.btn-outline-dark { background: #ffffff; border-color: #0f172a; color: #0f172a; }
.btn-outline-dark:hover { background: #f8fafc; border-color: #0f172a; color: #0f172a; }
.btn-outline-danger { background: #ffffff; border-color: #dc2626; color: #dc2626; }
.btn-outline-danger:hover { background: #fef2f2; border-color: #b91c1c; color: #b91c1c; }
.btn.disabled,
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.btn-close {
  background: transparent;
  border: 0;
  color: #475569;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-close::before {
  content: "\00d7";
  font-size: 1.1rem;
  line-height: 1;
}

.form-label { display: inline-block; margin-bottom: 0.375rem; font-weight: 600; }
.form-text { margin-top: 0.25rem; font-size: 0.875rem; color: #64748b; }
.form-control,
.form-select {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.375rem;
  background: #ffffff;
  color: #0f172a;
  padding: 0.5rem 0.75rem;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.form-control-lg { min-height: 2.875rem; padding: 0.625rem 0.875rem; font-size: 1rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1rem; height: 1rem; }
.form-check-label { margin: 0; }
.form-switch .form-check-input { width: 2rem; }
.invalid-feedback { display: block; margin-top: 0.25rem; font-size: 0.875rem; color: #b91c1c; }

.list-group {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  overflow: hidden;
}
.list-group-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}
.list-group-item:last-child { border-bottom: 0; }
.list-unstyled { list-style: none; padding-left: 0; margin-bottom: 0; }

.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.625rem;
}
.table-striped tbody tr:nth-child(odd) { background: #f8fafc; }

.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  z-index: 60;
  min-width: 12rem;
  margin-top: 0.25rem;
  padding: 0.375rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.dropdown-menu.show { display: block; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.375rem;
  background: transparent;
  color: #0f172a;
  text-decoration: none;
  padding: 0.5rem 0.625rem;
}
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active { background: #f1f5f9; color: #0f172a; text-decoration: none; }

/* Story card overlay styling */
.story-card {
  position: relative;
  overflow: hidden;
}
.story-card a,
.story-card a:hover,
.story-card a:focus,
.story-card a:focus-visible { text-decoration: none; }
.story-card .snippet a,
.story-card .snippet a:hover,
.story-card .snippet a:focus,
.story-card .snippet a:focus-visible { text-decoration: none; }

.story-card-image-wrap { position: relative; }
.story-card-badge{
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  z-index: 2;
  pointer-events: none;
  transition: opacity .15s ease;
}

/* Theme styles are now handled automatically */



.story-card .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  padding: 1rem;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.story-card:hover .overlay {
  opacity: 0.1;
}

/* ===== Storefront homepage progressive day feed ===== */
.home-day-card.is-dimmed{
  opacity: 0.4;
  transition: opacity .25s ease, transform .15s ease, box-shadow .15s ease;
}
.home-day-card.is-dimmed:hover{
  opacity: 0.85;
}
.home-day-card.is-indexable{
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  transition: box-shadow .2s ease, transform .15s ease;
}
.home-day-card.is-noindex{
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.10);
  transition: box-shadow .2s ease, transform .15s ease;
}
.home-day-link,
.home-day-link:hover,
.home-day-link:focus,
.home-day-link:focus-visible { text-decoration: none; }
.paging-link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 12px;
  border:1px solid #e2e8f0;
  border-radius:999px;
  background:#fff;
  color:#475569;
  font-weight:600;
  box-shadow:0 1px 2px rgba(15,23,42,0.06);
  text-decoration:none;
}
.paging-link:hover{
  background:#f8fafc;
  color:#0f172a;
  text-decoration:none;
}
.paging-link i{ color:inherit; }
.year-nav{ gap:12px; }
.year-nav .paging-link{ padding:6px 14px; font-size:0.9rem; }

/* Pages app layout + rail */
.pages-layout{ max-width: 1100px; margin: 0 auto 0 0; padding: 0 0.5rem; }
.pages-rail-col{ flex: 0 0 110px; max-width: 110px; padding-left:0; padding-right:6px; }
.pages-content-col{ flex: 1 1 auto; min-width: 0; max-width: calc(100% - 110px); }
.pages-main{ border-left:0; padding-left:32px; }
.pages-rail{ position: sticky; top: 0; margin-top:-24px; margin-left:-8px; background: transparent !important; border:0 !important; box-shadow:none !important; }
.pages-rail .pages-rail-body{ padding:0 !important; background:transparent; }
.pages-rail .pages-rail-nav{ padding:0; gap:0; }
.pages-rail .pages-rail-item{
  border:0;
  background:transparent;
  padding:6px 0;
  border-radius:0;
  text-decoration:none;
  color:#9ca3af;
}
.pages-rail .pages-rail-item:hover,
.pages-rail .pages-rail-item:focus{ color:#6b7280; text-decoration:none; }
.pages-rail .pages-rail-item.is-active{
  color:#111827;
  font-weight:700;
  text-decoration:none;
}

/* Shared compact rail-form shell (Contact + Legal) */
.rail-form-shell{
  max-width:860px;
  margin:0;
  padding:0.25rem 0 1.25rem;
}
.rail-form-card .rail-form-body{ padding:1rem; }
.rail-form-card .form-text{ margin-top:0.25rem; }
/* Bootstrap grid was removed from rail forms; spacing is handled via Tailwind gaps. */
.rail-form-compact label{ font-weight:600; }
.rail-form-compact .form-control,
.rail-form-compact .form-select{ min-height:40px; }
.rail-form-compact textarea.form-control{ min-height:110px; }
@media (max-width: 991px){
  .pages-layout{ padding: 0 0.75rem; }
  /* Mobile: render rail *under* the content. */
  .pages-content-col{ order: 1; }
  .pages-rail-col{ flex: 0 0 100%; max-width: 100%; order: 2; }
  .pages-main{ border-left:0; padding-left:0; }
}
@media (max-width: 767px){
  .rail-form-shell{ padding:0 0 1.25rem; }
}

/* Motif pill buttons */
.motifs-inline__pill{
  text-decoration:none;
  color:#334155;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  padding:2px 8px;
  font-size:0.75rem;
  line-height:1.2;
}
.motifs-inline__pill:hover,
.motifs-inline__pill:focus-visible{
  background:#e2e8f0;
  color:#0f172a;
  text-decoration:none;
}
.motifs-inline__pill:visited{ color:#334155; }

/* Profile settings layout (independent of Tailwind build) */
.settings-layout{ display:flex; flex-direction:column; gap:16px; }
.settings-rail-col{ width:100%; }
.settings-main{ flex:1; min-width:0; }
@media (min-width: 992px){
  .settings-layout{ flex-direction:row; align-items:flex-start; }
  .settings-rail-col{ flex:0 0 220px; max-width:220px; }
}
.settings-form-grid{ display:grid; grid-template-columns:1fr; gap:12px; }
.settings-form-grid .settings-span-2{ grid-column:1 / -1; }
@media (min-width: 768px){
  .settings-form-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
.home-feed-bottom{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0;
  padding-top: 10px;
  padding-bottom: clamp(40px, 8vh, 96px);
}
.home-feed-loader{
  font-size: 0.9rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  color: #6b7280;
  opacity: 0;
  transition: opacity .2s ease;
}
.home-feed-loader.is-loading{
  opacity: 1;
}
.home-feed-loader .spinner-border{
  width: 1rem;
  height: 1rem;
  border-width: 0.15rem;
}
.home-feed-loader .home-feed-shimmer{
  display: block;
  width: 280px;
  height: 12px;
  border-radius: 999px;
  margin: 0;
}
.home-feed-loader .home-feed-shimmer:nth-child(2){
  width: 230px;
}
.home-feed-loader .home-feed-shimmer:nth-child(3){
  width: 180px;
}
.home-feed-loader .ai-skeleton-line{
  margin-bottom: 0;
}
.home-feed-loader .loader-text{
  letter-spacing: 0.01em;
}
.home-feed-sentinel{
  width: 100%;
  height: 72px;
}

/* Talker messaging app - textarea focus effect */
textarea:focus {
  box-shadow: 0 0 0 1px gray;
}

/**
 * AI Console Styling
 *
 * New consolidated console design for AngryPages
 * - Fixed height with internal scrolling
 * - Notifications always at top
 * - Silver background for all messages
 * - Subtle left border for AI messages
 * - Hover-revealed dismiss controls
 */

/* Console container */
.ai-console-block {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: #f8f9fa;
    margin-bottom: 1rem;
    max-height: 60vh; /* Fixed maximum height */
    display: flex;
    flex-direction: column;
  }
  
  /* Console header with chevron toggle */
  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: #f0f0f0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    user-select: none;
  }
  
  .console-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
  }
  
  .chevron-icon {
    transition: transform 0.2s ease;
  }
  
  .console-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
  }
  
  .notification-count {
    font-size: 0.7rem;
    color: #adb5bd;
    background-color: #f8f9fa;
    border-radius: 1rem;
    padding: 0.15rem 0.4rem;
  }
  
  /* Console body - collapsible */
  .console-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .console-body.expanded {
    max-height: 50vh;
    overflow-y: auto;
  }
  
  /* Notifications container */
  .notification-container {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 0.5rem;
  }
  
  /* Notification item */
  .console-notification-item {
    background-color: silver;
    color: #555 !important;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    position: relative;
    transition: all 0.2s ease;
  }
  
  /* Console output section */
  .console-output {
    height: 30vh !important;
    overflow-y: auto !important;
  }
  
  /* Message styling */
  .user-message, .ai-message {
    background-color: silver;
    color: #222;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    position: relative;
    font-size: 0.875rem;
  }
  
  /* AI message specific styling - includes subtle left border */
  .ai-message {
    border-left: 3px solid #6f42c1;
  }
  
  /* Dismiss button that appears on hover */
  .message-dismiss, .notification-dismiss {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
    font-size: 0.75rem;
    color: #999;
    background: none;
    border: none;
    padding: 0.25rem;
  }
  
  .user-message:hover .message-dismiss,
  .ai-message:hover .message-dismiss,
  .console-notification-item:hover .notification-dismiss {
    opacity: 1;
  }
  
  /* Console input area */
  .console-input {
    position: relative;
    margin-top: 0.5rem;
  }
  
  .console-input textarea {
    border-radius: 0.375rem;
    font-size: 0.875rem;
    resize: none;
  }
  
  /* Custom Chat Overrides - Light & minimal */
  .ai-console-block {
    height: 60vh;
    max-height: 60vh;
  }
  .ai-console-block i,
  .ai-response-controls,
  .message-dismiss,
  .notification-dismiss {
    display: none !important;
  }
  .user-message,
  .ai-message {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-left: 3px solid;
    background-color: rgba(0, 0, 0, 0.03);
    color: #222;
    border-radius: 0;
    line-height: 1.4;
    word-break: break-word;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  .ai-message {
    border-left-color: #dbeafe;
  }
  .user-message {
    border-left-color: #f3e8fd;
  }
  .user-message:hover,
  .ai-message:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #000;
  }
  
  /* Dark mode support 
  @media (prefers-color-scheme: dark) {
    .ai-console-block {
      background-color: #1e1e1e;
    }
    
    .console-header {
      background-color: #252525;
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .notification-count {
      background-color: #333;
      color: #aaa;
    }
    
    .console-notification-item,
    .user-message, 
    .ai-message {
      background-color: #888;
      color: #222;
    }
    
    .notification-container {
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
  }
  */
  
  /* Animations */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .console-notification-item,
  .user-message,
  .ai-message {
    animation: fadeIn 0.2s ease-out;
  }
  
  /* Mobile responsiveness */
  @media (max-width: 992px) {
    .ai-console-block {
      border-radius: 0.375rem;
    }
    
    .console-notification-item,
    .user-message,
    .ai-message {
      padding: 0.375rem 0.5rem;
      margin: 0.375rem 0.5rem;
      font-size: 0.813rem;
    }
  }
  
  /**
 * AI Panel and Response Blocks Styling
 * 
 * Minimalist, clean styling for AI Panel that matches AngryPages design system
 * - Shadow-sm, rounded-2xl, conforming to existing button and card styling
 * - Subtle gray text (text-gray-500), darkens on hover
 * - Practical, calm, and visually quiet design
 * - Mobile-aware with responsive breakpoints
 * - Archive functionality for AI responses
 * - Fixed height with internal scrolling
 * - Notifications consolidated into one console block
 * - Subtle left border for AI messages
 */

/* ========== AI PANEL CONTAINER ========== */
.ai-panel {
    position: relative;
    background-color: var(--surface-color, #f8f9fa);
    border-radius: 1rem; /* rounded-2xl */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    overflow: hidden;
    transition: height 0.2s ease, opacity 0.2s ease;
    font-family: var(--body-font, system-ui, -apple-system, sans-serif);
  }
  
  /* Panel header with toggle button */
  .ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .ai-panel-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
    margin: 0;
  }
  
  .ai-panel-toggle {
    background: none;
    border: none;
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease;
  }
  
  .ai-panel-toggle:hover {
    color: var(--text-color, #212529); /* hover:text-gray-800 */
  }
  
  /* AI Panel content area */
  .ai-panel-content {
    height: calc(100% - 3rem); /* Full height minus header */
    overflow-y: auto;
  }
  
  /* ========== AI RESPONSE BLOCKS ========== */
  .ai-response-block {
    margin: 0.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: var(--surface-color, #ffffff);
    color: #212529;
    transition: box-shadow 0.2s ease;
    animation: fadeIn 0.2s ease-out;
  }
  
  .ai-response-block:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  /* Header styling with AI indicator and archive control */
  .ai-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .ai-indicator {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
    display: flex;
    align-items: center;
  }
  
  .ai-indicator i {
    color: var(--primary-color, #6f42c1);
    margin-right: 0.25rem;
    font-size: 0.75rem;
  }
  
  .ai-response-controls {
    display: flex;
  }
  
  /* Content area - selectable text */
  .ai-response-content {
    padding: 0.75rem 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-color, #212529);
    cursor: text;
    user-select: text;
  }
  
  /* Selectable text handling */
  .selectable {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }
  
  /* User message styling */
  .user-message {
    margin: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-color, #212529);
    font-size: 0.875rem;
  }
  
  /* ========== ARCHIVE FUNCTIONALITY ========== */
  /* Archive button styling */
  .archive-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-color-tertiary, #adb5bd); /* text-gray-400 */
    transition: color 0.15s ease;
  }
  
  .archive-btn:hover {
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
  }
  
  /* Restore button styling */
  .restore-btn {
    display: none;
    background: none;
    border: none;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-color-tertiary, #adb5bd); /* text-gray-400 */
    transition: color 0.15s ease;
  }
  
  .restore-btn:hover {
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
  }
  
  /* Archived response styling - collapsed view */
  .ai-response-archived .ai-response-content {
    display: none;
  }
  
  .ai-response-archived {
    opacity: 0.75;
    background-color: var(--surface-color, #ffffff);
    border-color: rgba(0, 0, 0, 0.03);
  }
  
  .ai-response-archived:hover {
    opacity: 0.9;
  }
  
  .ai-response-archived .archive-btn {
    display: none;
  }
  
  .ai-response-archived .restore-btn {
    display: inline-flex;
    align-items: center;
  }
  
  .ai-response-archived .ai-indicator::after {
    content: ' (archived)';
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 0.25rem;
  }
  
  /* ========== AI LOGS IN USER PROFILE ========== */
  .ai-logs-section {
    margin-top: 1.5rem;
  }
  
  .ai-logs-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d);
    margin-bottom: 1rem;
  }
  
  .ai-logs-section .ai-response-block {
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  
  .ai-logs-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-color-tertiary, #adb5bd);
    font-size: 0.875rem;
    background-color: var(--surface-color, #ffffff);
    border-radius: 0.5rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
  }
  
  /* ========== ANIMATIONS ========== */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* ========== DARK MODE SUPPORT ========== */
  /* Console header with chevron indicator */
  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: var(--surface-color-alt, #f0f0f0);
    border-radius: 0.375rem 0.375rem 0 0;
    cursor: pointer;
  }
  
  .console-header .chevron-icon {
    transition: transform 0.2s ease;
  }
  
  .console-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
  }
  
  .console-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .console-body.expanded {
    max-height: 50vh;
    overflow-y: auto;
  }
  /*
  @media (prefers-color-scheme: dark) {
    .ai-panel {
      background-color: var(--surface-dark-color, #121212);
      border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .ai-panel-header {
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
  
    .ai-response-block {
      background-color: rgba(30, 30, 30, 0.3);
      border-color: rgba(255, 255, 255, 0.05);
    }
    
    .ai-response-block:hover {
      background-color: rgba(40, 40, 40, 0.4);
    }
    
    .ai-response-header {
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .ai-response-content {
      color: var(--text-color-dark, rgba(255, 255, 255, 0.9));
    }
    
    .user-message {
      background-color: rgba(255, 255, 255, 0.05);
      color: var(--text-color-dark, rgba(255, 255, 255, 0.9));
    }
    
    .ai-response-archived {
      background-color: rgba(30, 30, 30, 0.2);
      border-color: rgba(255, 255, 255, 0.02);
    }
    
    .ai-logs-empty {
      background-color: rgba(30, 30, 30, 0.3);
      border-color: rgba(255, 255, 255, 0.05);
    }
  }
  */
  
  /* ========== MOBILE RESPONSIVENESS ========== */
  @media (max-width: 992px) {
    .ai-panel {
      border-radius: 0.5rem; /* smaller radius on mobile */
      margin-bottom: 0.75rem;
    }
    
    .ai-response-block {
      margin: 0.5rem;
    }
    
    .ai-response-content {
      padding: 0.5rem 0.75rem;
      font-size: 0.813rem; /* slightly smaller font on mobile */
    }
    
    .ai-panel-toggle {
      padding: 0.375rem; /* larger touch target on mobile */
    }
  }
  
  /* ========== AI PANEL CONTAINER ========== */
  .ai-panel {
    position: relative;
    background-color: var(--surface-color, #f8f9fa);
    border-radius: 1rem; /* rounded-2xl */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    overflow: hidden;
    transition: height 0.2s ease, opacity 0.2s ease;
    font-family: var(--body-font, system-ui, -apple-system, sans-serif);
  }
  
  /* Panel header with toggle button */
  .ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .ai-panel-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
    margin: 0;
  }
  
  .ai-panel-toggle {
    background: none;
    border: none;
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease;
  }
  
  .ai-panel-toggle:hover {
    color: var(--text-color, #212529); /* hover:text-gray-800 */
  }
  
  /* AI Panel content area */
  .ai-panel-content {
    height: calc(100% - 3rem); /* Full height minus header */
    overflow-y: auto;
  }
  
  /* ========== AI RESPONSE BLOCKS ========== */
  .ai-response-block {
    margin: 0.75rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background-color: var(--surface-color, #ffffff);
    transition: box-shadow 0.2s ease;
    animation: fadeIn 0.2s ease-out;
  }
  
  .ai-response-block:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  }
  
  /* Header styling with AI indicator and archive control */
  .ai-response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  
  .ai-indicator {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
    display: flex;
    align-items: center;
  }
  
  .ai-indicator i {
    color: var(--primary-color, #6f42c1);
    margin-right: 0.25rem;
    font-size: 0.75rem;
  }
  
  .ai-response-controls {
    display: flex;
  }
  
  /* Content area - selectable text */
  .ai-response-content {
    padding: 0.75rem 1rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-color, #212529);
    cursor: text;
    user-select: text;
  }
  
  /* Selectable text handling */
  .selectable {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
  }
  
  /* User message styling */
  .user-message {
    margin: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-color, #212529);
    font-size: 0.875rem;
  }
  
  /* ========== ARCHIVE FUNCTIONALITY ========== */
  /* Archive button styling */
  .archive-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-color-tertiary, #adb5bd); /* text-gray-400 */
    transition: color 0.15s ease;
  }
  
  .archive-btn:hover {
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
  }
  
  /* Restore button styling */
  .restore-btn {
    display: none;
    background: none;
    border: none;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-color-tertiary, #adb5bd); /* text-gray-400 */
    transition: color 0.15s ease;
  }
  
  .restore-btn:hover {
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
  }
  
  /* Archived response styling - collapsed view */
  .ai-response-archived .ai-response-content {
    display: none;
  }
  
  .ai-response-archived {
    opacity: 0.75;
    background-color: var(--surface-color, #ffffff);
    border-color: rgba(0, 0, 0, 0.03);
  }
  
  .ai-response-archived:hover {
    opacity: 0.9;
  }
  
  .ai-response-archived .archive-btn {
    display: none;
  }
  
  .ai-response-archived .restore-btn {
    display: inline-flex;
    align-items: center;
  }
  
  .ai-response-archived .ai-indicator::after {
    content: ' (archived)';
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 0.25rem;
  }
  
  /* ========== AI LOGS IN USER PROFILE ========== */
  .ai-logs-section {
    margin-top: 1.5rem;
  }
  
  .ai-logs-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d);
    margin-bottom: 1rem;
  }
  
  .ai-logs-section .ai-response-block {
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  
  .ai-logs-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-color-tertiary, #adb5bd);
    font-size: 0.875rem;
    background-color: var(--surface-color, #ffffff);
    border-radius: 0.5rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
  }
  
  /* ========== ANIMATIONS ========== */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* ========== DARK MODE SUPPORT ========== */
  /* Console header with chevron indicator */
  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: var(--surface-color-alt, #f0f0f0);
    border-radius: 0.375rem 0.375rem 0 0;
    cursor: pointer;
  }
  
  .console-header .chevron-icon {
    transition: transform 0.2s ease;
  }
  
  .console-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
  }
  
  .console-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .console-body.expanded {
    max-height: 50vh;
    overflow-y: auto;
  }
  
  @media (prefers-color-scheme: dark) {
    .ai-panel {
      background-color: var(--surface-dark-color, #121212);
      border: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .ai-panel-header {
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
  
    .ai-response-block {
      background-color: rgba(30, 30, 30, 0.3);
      border-color: rgba(255, 255, 255, 0.05);
    }
    
    .ai-response-block:hover {
      background-color: rgba(40, 40, 40, 0.4);
    }
    
    .ai-response-header {
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .ai-response-content {
      color: var(--text-color-dark, rgba(255, 255, 255, 0.9));
    }
    
    .user-message {
      background-color: rgba(255, 255, 255, 0.05);
      color: var(--text-color-dark, rgba(255, 255, 255, 0.9));
    }
    
    .ai-response-archived {
      background-color: rgba(30, 30, 30, 0.2);
      border-color: rgba(255, 255, 255, 0.02);
    }
    
    .ai-logs-empty {
      background-color: rgba(30, 30, 30, 0.3);
      border-color: rgba(255, 255, 255, 0.05);
    }
  }
  
  /* ========== MOBILE RESPONSIVENESS ========== */
  @media (max-width: 992px) {
    .ai-panel {
      border-radius: 0.5rem; /* smaller radius on mobile */
      margin-bottom: 0.75rem;
    }
    
    .ai-response-block {
      margin: 0.5rem;
    }
    
    .ai-response-content {
      padding: 0.5rem 0.75rem;
      font-size: 0.813rem; /* slightly smaller font on mobile */
    }
    
    .ai-panel-toggle {
      padding: 0.375rem; /* larger touch target on mobile */
    }
  }
  
  
  /* Console header with chevron indicator */
  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: var(--surface-color-alt, #f0f0f0);
    border-radius: 0.375rem 0.375rem 0 0;
    cursor: pointer;
  }
  
  .console-header .chevron-icon {
    transition: transform 0.2s ease;
  }
  
  .console-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
  }
  
  .console-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .console-body.expanded {
    max-height: 50vh;
    overflow-y: auto;
  }
  
  @media (prefers-color-scheme: dark) {
    .user-message {
      background-color: rgba(255, 255, 255, 0.05);
      color: var(--text-color-dark, rgba(255, 255, 255, 0.9));
    }
  }
  
  /* Archived response styling - collapsed view */
  .ai-response-archived .ai-response-content {
    display: none;
  }
  
  .ai-response-archived {
    opacity: 0.75;
    background-color: var(--surface-color, #ffffff);
    border-color: rgba(0, 0, 0, 0.03);
  }
  
  /* Console header with chevron indicator */
  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: var(--surface-color-alt, #f0f0f0);
    border-radius: 0.375rem 0.375rem 0 0;
    cursor: pointer;
  }
  
  .console-header .chevron-icon {
    transition: transform 0.2s ease;
  }
  
  .console-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
  }
  
  .console-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .console-body.expanded {
    max-height: 50vh;
    overflow-y: auto;
  }
  
  @media (prefers-color-scheme: dark) {
    .ai-response-archived {
      background-color: rgba(30, 30, 30, 0.2);
      border-color: rgba(255, 255, 255, 0.02);
    }
  }
  
  .ai-response-archived:hover {
    opacity: 0.9;
  }
  
  .ai-response-archived .archive-btn {
    display: none;
  }
  
  /* Restore button styling */
  .restore-btn {
    display: none;
    background: none;
    border: none;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-color-tertiary, #adb5bd); /* text-gray-400 */
    transition: color 0.15s ease;
  }
  
  .restore-btn:hover {
    color: var(--text-color-secondary, #6c757d); /* text-gray-500 */
  }
  
  .ai-response-archived .restore-btn {
    display: inline-flex;
    align-items: center;
  }
  
  /* Mobile responsiveness */
  @media (max-width: 992px) {
    .ai-panel {
      border-radius: 0.5rem; /* smaller radius on mobile */
      margin-bottom: 0.75rem;
    }
    
    .ai-response-block {
      margin: 0.5rem;
    }
    
    .ai-response-content {
      padding: 0.5rem 0.75rem;
      font-size: 0.813rem; /* slightly smaller font on mobile */
    }
    
    .ai-panel-toggle {
      padding: 0.375rem; /* larger touch target on mobile */
    }
  }
  
  /* AI Logs in User Profile */
  .ai-logs-section {
    margin-top: 1.5rem;
  }
  
  .ai-logs-section h3 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary, #6c757d);
    margin-bottom: 1rem;
  }
  
  .ai-logs-section .ai-response-block {
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  
  .ai-logs-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-color-tertiary, #adb5bd);
    font-size: 0.875rem;
    background-color: var(--surface-color, #ffffff);
    border-radius: 0.5rem;
    border: 1px dashed rgba(0, 0, 0, 0.1);
  }
  
  /* Console header with chevron indicator */
  .console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: var(--surface-color-alt, #f0f0f0);
    border-radius: 0.375rem 0.375rem 0 0;
    cursor: pointer;
  }
  
  .console-header .chevron-icon {
    transition: transform 0.2s ease;
  }
  
  .console-header.collapsed .chevron-icon {
    transform: rotate(-90deg);
  }
  
  .console-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .console-body.expanded {
    max-height: 50vh;
    overflow-y: auto;
  }
  
  @media (prefers-color-scheme: dark) {
    .ai-logs-empty {
      background-color: rgba(30, 30, 30, 0.3);
      border-color: rgba(255, 255, 255, 0.05);
    }
  }
  
  /* Show archived status and restore option */
  .ai-response-archived .ai-indicator::after {
    content: ' (archived)';
    font-size: 0.7rem;
    opacity: 0.7;
    margin-left: 0.25rem;
  }
  
  .ai-response-archived .ai-response-controls::before {
    content: '';
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    vertical-align: -0.125em;
    padding: 2px 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    background-color: rgba(255, 255, 255, 0.5);
    -webkit-mask: url("../icons/bi/arrow-repeat.svg") no-repeat center / contain;
    mask: url("../icons/bi/arrow-repeat.svg") no-repeat center / contain;
  }
  
  .ai-response-archived .ai-response-controls:hover::before {
    background-color: rgba(255, 255, 255, 0.9);
  }
  
  /* Add a restore button for archived responses */
  .ai-response-archived .ai-response-controls::after {
    content: "";
    display: inline-block;
    width: 0.85em;
    height: 0.85em;
    vertical-align: -0.125em;
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.5);
    -webkit-mask: url("../icons/bi/arrow-counterclockwise.svg") no-repeat center / contain;
    mask: url("../icons/bi/arrow-counterclockwise.svg") no-repeat center / contain;
  }
  
  .ai-response-archived .ai-response-controls:hover::after {
    background-color: rgba(255, 255, 255, 0.8);
  }

  /* SVG replacement for legacy `.bi bi-*` markup. */
  .ap-bi-svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
  }
  
  /* User message styling */
  .user-message {
    margin: 6px 0;
    padding: 6px 10px;
    border-left: 2px solid rgba(108, 117, 125, 0.5);
    background: rgba(40, 40, 40, 0.2);
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 0 3px 3px 0;
  }
  
  .user-message::before {
    content: "> ";
    color: rgba(108, 117, 125, 0.8);
    font-weight: bold;
  }
  
  /* Animation for appearing/disappearing */
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .ai-response-block {
    animation: fadeIn 0.25s ease-out forwards;
  }
  
  /* Light mode support */
  @media (prefers-color-scheme: light) {
    .ai-response-block {
      background-color: rgba(245, 245, 245, 0.7);
      border-color: rgba(222, 226, 230, 0.8);
    }
    
    .ai-response-header {
      border-color: rgba(222, 226, 230, 0.5);
    }
    
    .ai-indicator {
      color: rgba(73, 80, 87, 0.85);
    }
    
    .ai-response-content {
      color: #212529;
    }
    
    .archive-btn {
      color: rgba(108, 117, 125, 0.7);
    }
    
    .archive-btn:hover {
      color: rgba(52, 58, 64, 0.9);
    }
    
    .user-message {
      background: rgba(245, 245, 245, 0.7);
      color: #212529;
    }
    
    .ai-response-archived {
      background-color: rgba(245, 245, 245, 0.5);
    }
    
    .ai-response-archived .ai-response-controls::after {
      color: rgba(108, 117, 125, 0.7);
    }
  }
  
  /* Archive logs section in user profile */
  .ai-logs-section {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background-color: rgba(40, 40, 40, 0.2);
  }
  
  .ai-logs-header {
    font-size: 1rem;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .ai-logs-list {
    max-height: 300px;
    overflow-y: auto;
  }
  
  .ai-logs-empty {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
    padding: 10px 0;
  }
  
  /* ---- force consistent dark text regardless of earlier overrides ---- */
  .ai-response-content,
  .user-message,
  .ai-message {
    color: #212529 !important;
    background:#f9f9f9 !important;   /* silver-white */
  }
  /* === minimalist tweaks ======================================== */
  /* 1. Hide the header that shows bot name & archive icon */
  .ai-response-header {
    display: none !important;
  }
  
  /* 2. Paler silver border for response blocks */
  .ai-response-block {
    border-color: #e5e7eb !important; /* light silver */
  }
  
  /* --- final override: pale background & border --- */
  .ai-response-block{
    background:#f9f9f9 !important;   /* silver-white */
  }
  
  /* --- final override: remove pink left bar on user messages --- */
  .user-message {
    border-left: none !important;      /* kill accent bar */
    background: #f9f9f9 !important;    /* match AI block background */
  }

  .following {
    background-color: #0f172a;
    color: white;
}
.following:hover {
    background-color: #0b5ed7;
}

/* Loading state */
.follow-button-loading {
    opacity: 0.8;
}

/* Success state */
.follow-button-success {
    background-color: #198754 !important;
    color: white !important;
    animation: pulse 0.5s ease-in-out;
}

/* Error state */
.follow-button-error {
    background-color: #dc3545 !important;
    color: white !important;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

    .profile-picture-container {
        position: relative;
        width: 150px;
        height: 150px;
        margin: 0 auto 1.5rem;
        border-radius: 50%;
        overflow: hidden;
        border: 3px solid #f8f9fa;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    }
    
    .profile-picture {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .profile-picture-upload {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.7);
        color: white;
        text-align: center;
        padding: 0.5rem;
        cursor: pointer;
        font-size: 0.8rem;
        transition: all 0.3s ease;
    }
    
    .profile-picture-upload:hover {
        background: rgba(0, 0, 0, 0.9);
    }
    
    .storage-progress {
        height: 10px;
        border-radius: 5px;
        overflow: hidden;
    }
    
    .progress-bar {
        transition: width 0.3s ease;
    }
    
    .storage-info {
        font-size: 0.85rem;
        color: #6c757d;
    }
    
    .form-control:focus,
    .form-select:focus {
        border-color: #80bdff;
        box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
    }
    
    .form-label {
        font-weight: 500;
        margin-bottom: 0.25rem;
    }
    
    .btn-save {
        min-width: 120px;
    }
    
    .storage-upgrade-link {
        font-size: 0.85rem;
        text-decoration: none;
    }

/* Footer styling */
footer {
  position: relative;
  z-index: 10;
  margin-bottom: 50px; /* Add space at the bottom to avoid collapse button */
}

/* Location text hover effect */
.location-text {
  cursor: pointer;
  display: inline-block;
  position: relative;
  color: #9aa0a6; /* Softer gray */
  transition: color 0.4s ease;
}

.location-text:hover {
  color: #6c757d; /* Slightly darker on hover */
}

.location-text .short-text,
.location-text .full-text {
  display: inline-block;
  transition: opacity 0.5s ease, transform 0.5s ease;
  position: absolute;
  left: 0;
  white-space: nowrap;
}

.location-text .short-text {
  opacity: 1;
  transform: translateY(0);
  position: relative;
}

.location-text .full-text {
  opacity: 0;
  transform: translateY(10px);
  position: absolute;
  z-index: 20;
}

.location-text:hover .short-text {
  opacity: 0;
  transform: translateY(-10px);
  transition-delay: 0.5s;
}

.location-text:hover .full-text {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.5s;
}

/* When mouse leaves, delay the shortening */
.location-text .short-text {
  transition-delay: 0.5s;
}

.location-text .full-text {
  transition-delay: 0.5s;
}

.location-text:hover .short-text {
  transition-delay: 0.5s;
}

.location-text:hover .full-text {
  transition-delay: 0.5s;
}

/* Simple expand-only copyright text hover effect */
.copyright-text {
  color: #bbb;
}

.copyright-text {
  position: relative;
}

.copyright-text .short-text {
  display: inline-block;
}

.copyright-text .full-text {
  display: none;
}

.copyright-text:hover .short-text {
  display: none;
  transition: none;
}

.copyright-text:hover .full-text {
  display: inline-block;
}

/* Add delay using JavaScript */
.sidebar-footer-copyright {
  align-self: flex-start;
  text-align: left;
  margin: 0;
  padding: 0 18px 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}


/* === final override : make mask glyphs use the tier colour === */
.sensitive.censored { color:#FFF3B0 !important; }
.paid.censored      { color:#ffb0b0 !important; }
.private.censored   { color:#E6C2FF !important; }
.black.censored     { color:#111111 !important; }

.sensitive.censored {
  background: #FFF3B0 !important;
  border-bottom: none !important;
  color: #FFF3B0 !important; /* dark-yellow text on yellow bg */
  font-weight: normal !important;
  text-decoration: none !important;
  display: inline !important;
}
.paid.censored {
  background: #ffb0b0 !important;
  border-bottom: none !important;
  color: #ffb0b0 !important; /* dark-green text on pink bg */
  font-weight: normal !important;
  text-decoration: none !important;
  display: inline !important;
}
.private.censored {
  background: #E6C2FF !important;
  border-bottom: none !important;
  color: #E6C2FF !important; /* dark-purple text on purple bg */
  font-weight: normal !important;
  text-decoration: none !important;
  display: inline !important;
}
.black.censored {
  background: #111111 !important;
  border-bottom: none !important;
  color: #111111 !important;
  font-weight: normal !important;
  text-decoration: none !important;
  display: inline !important;
}


/* Text + time live inside .story-inner (so media can be edge-to-edge) */
.story-card .story-inner { padding:12px 16px 14px; }
.story-card .story-inner .snippet { padding:0 !important; } /* avoid double padding */
.story-card .story-inner .time,
.story-card .story-inner time {
  padding: 0 !important;
  margin: 6px 0 8px !important;
}
.story-card .time, .story-card time { display:block; margin:6px 0 8px; color:#6c757d; }

/* Make only the trailing media full‑bleed when it’s a sibling of .story-inner */
.story-card a > img.story-media:last-child,
.story-card a > video:last-child,
.story-card a > iframe:last-child,
.story-card a > figure.story-media:last-child {
  display:block;
  width:100%;
  margin:0;
  border-radius: inherit;
}
.story-card .story-media{
  display:block;
  width:100%;
  aspect-ratio: 4 / 3;
  margin:0;
  overflow:hidden;
  border-radius: inherit;
}
.story-card .story-media img,
.story-card .story-media video,
.story-card .story-media iframe {
  display:block;
  width:100%;
  height:100%;
  object-fit: cover;
  object-position: center;
}
.ap-hidden-image-area{
  --ap-hidden-bg:#e8eef8;
  --ap-hidden-fg:#4f6487;
  position:relative;
  display:block;
  width:100%;
  padding:0;
  overflow:hidden;
  background:var(--ap-hidden-bg);
  color:var(--ap-hidden-fg);
}
.ap-hidden-image-area__label{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  z-index:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin:0;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(255,255,255,.82);
  color:var(--ap-hidden-fg);
  font-size:.82rem;
  font-weight:800;
  letter-spacing:.06em;
  line-height:1;
  text-transform:uppercase;
  box-shadow:0 4px 14px rgba(15,23,42,.08);
}
.home-day-media .ap-hidden-image-area--overlay{
  position:absolute;
  inset:0;
  border-radius:inherit;
}
.story-card .ap-hidden-image-area{
  display:flex;
  flex:0 0 auto;
  height:auto;
  min-height:0;
  aspect-ratio:4 / 3;
}
.image-container .ap-hidden-image-area{
  width:100%;
  aspect-ratio:4 / 3;
  min-height:clamp(320px, 52vw, 720px);
}
@media (max-width: 767px){
  .image-container .ap-hidden-image-area{
    min-height:clamp(240px, 62vw, 420px);
  }
}

/* Keep highlight bars inset when inside the text wrapper */
.story-card .story-inner .sensitive,
.story-card .story-inner .paid,
.story-card .story-inner .private,
.story-card .story-inner .black,
.story-card .story-inner .censor,
.story-card .story-inner .censor-sensitive,
.story-card .story-inner .censor-paid,
.story-card .story-inner .censor-private,
.story-card .story-inner .censor-black {
  display:inline !important;
  padding-left:3px; padding-right:3px;
  -webkit-box-decoration-break:clone; box-decoration-break:clone;
  background-clip:padding-box; border-radius:4px;
}
.story-card.p-3 { 
  padding: 0 !important;
}


.journal-card {
  border-radius: 8px;
  overflow: visible;
}

.journal-card .card-body {
  padding: 1rem !important;
}

.journal-container .badge {
  transition: transform 150ms ease, background-color 150ms ease, filter 150ms ease, box-shadow 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform-origin: center;
  position: relative;
  padding: 0.4rem 0.55rem;
  font-size: 0.95rem;
}

.journal-container .badge:hover {
  transform: scale(1.25);
  filter: brightness(1.12);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .journal-container .badge {
    transition: background-color 150ms ease;
    transform: none !important;
  }
  .journal-container .badge:hover {
    transform: none !important;
    box-shadow: none;
    filter: none;
  }
}

/* Journal layout refinements */
.year-section h2 {
  margin-bottom: 28px;
}
.year-section .row {
  row-gap: 18px;
}
.journal-month-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
  transition: box-shadow 180ms ease, transform 180ms ease, max-height 200ms ease;
}
.journal-month-card .card-heading {
  font-weight: 700;
  font-size: 1.1rem;
}
.journal-month-card .stretched-link {
  z-index: 0;
}
.journal-month-card .journal-badge-group .badge {
  position: relative;
  z-index: 1;
}
.month-meta-row {
  margin-top: 4px;
}
.month-meta {
  color: var(--primary);
}
.journal-month-teaser {
  margin-bottom: 4px;
}
.clamp-3,
.journal-month-teaser.clamp-3 {
  display: block;
  overflow: hidden;
  line-height: 1.5;
  max-height: calc(1.5em * 3);
  text-overflow: ellipsis;
  transition: max-height 200ms ease;
}
.month-hero-body {
  padding: 24px 22px 20px;
}
.month-hero-meta {
  margin-bottom: 6px;
}
.month-hero-highlight {
  color: var(--primary);
}
.day-card .card-heading {
  margin-bottom: 4px;
  font-weight: 700;
}
.day-card .day-card-row {
  flex-wrap: nowrap !important;
  gap: 12px !important;
  align-items: stretch;
}
.day-card {
  overflow: visible;
  transition: box-shadow 180ms ease, transform 180ms ease, max-height 200ms ease;
}
.day-card .journal-badge-group {
  flex: 0 0 auto;
  align-self: flex-start;
}
.day-card .journal-badge-group .badge {
  position: relative;
  z-index: 1;
}
.day-card .stretched-link {
  z-index: 0;
}
.journal-month-card:hover,
.day-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
.day-hook-line {
  line-height: 1.5;
}
.clamp-6,
.day-hook-line.clamp-6 {
  display: block;
  overflow: hidden;
  max-height: calc(1.5em * 6);
  text-overflow: ellipsis;
  transition: max-height 200ms ease;
}
.journal-month-card.is-expanded .clamp-3,
.journal-month-card.is-expanded .journal-month-teaser,
.journal-month-card:hover .clamp-3,
.journal-month-card:hover .journal-month-teaser {
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
}
.day-card.is-expanded .clamp-3,
.day-card.is-expanded .clamp-6,
.day-card.is-expanded .day-hook-line,
.day-card:hover .clamp-3,
.day-card:hover .clamp-6,
.day-card:hover .day-hook-line {
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
}
.journal-month-card.is-expanded .clamp-3,
.journal-month-card.is-expanded .journal-month-teaser,
.day-card.is-expanded .clamp-6,
.day-card.is-expanded .day-hook-line {
  max-height: none !important;
  overflow: visible !important;
  white-space: normal !important;
}
.day-card {
  gap: 4px;
}
.journal-badge-group {
  gap: 0.4rem !important;
}
.journal-legend {
  color: #6c757d;
}
.journal-grid .row {
  width: 100%;
}
.journal-grid .col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}
.journal-container .story-card {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.journal-legend,
.journal-badge-group {
  flex: 1 1 auto;
}

@media (hover: hover) and (pointer: fine) {
  .journal-month-card:hover .journal-month-teaser,
  .journal-month-card:hover .clamp-3 {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
  }
  .day-card:hover .day-hook-line,
  .day-card:hover .clamp-3,
  .day-card:hover .clamp-6 {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
  }
}

@media (max-width: 576px) {
  .month-hero-body {
    padding: 20px 18px;
  }
  .month-meta-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  .day-card .day-card-row {
    flex-wrap: wrap !important;
  }
}

.story-card .time,
.story-card .snippet,
.story-card .story-body {
  padding: 12px 16px;
}

.story-card .time {
  display: block;
  margin: 6px 0 8px;
  color: #6c757d;
}

.story-card a > :is(img, video, iframe, figure):last-child {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  /* parent has overflow:hidden + border-radius already */
}

.story-card img.bleed-up {
  display: block;
  width: 100%;
  height: 64px !important;         /* final height */
  flex: 0 0 24px !important;        /* override .story-card img { flex: 0 0 150px } */
  object-fit: cover;
}

/* === tighten gap between text and media (without shrinking bleed) — only when card has an image === */

/* leave time padding alone; no padding tweaks for image cards */
/* (intentionally removed any padding-bottom changes) */

/* kill trailing paragraph margin so text sits closer to media */

/* === ULTRA‑TIGHTEN gap between text and media (image cards only) === */

/* keep time ⇄ content gap unchanged on image cards */
.story-card.has-img .time { 
  margin: 6px 0 8px !important; 
}

/* kill trailing paragraph margin so text sits tight to media */
.story-card.has-img .story-inner .snippet p:last-child,
.story-card.has-img .story-inner .story-body p:last-child {
    margin-bottom: 2px !important;
}

/* tighten gap only between picture and content (not time) */
.story-card.has-img .story-inner .snippet,
.story-card.has-img .story-inner .story-body {
  margin-top: 4px !important;
}

/* AI Check modal layout */
.ai-modal-body {
  display: flex;
  flex-direction: column;
}

.ai-summary {
  line-height: 1.4;
  color: #343a40;
}

.ai-helper {
  color: #6c757d;
  transition: opacity 0.3s ease;
}

.ai-stage-list {
  gap: 0.35rem;
}

.ai-stage-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.95rem;
  line-height: 1.25;
  min-height: 38px;
  color: #212529;
  flex: 1 1 180px;
}

.ai-stage-pill__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #adb5bd;
  margin-right: 0.15rem;
}

.ai-stage-pill__name {
  font-weight: 600;
  flex: 1;
}

.ai-stage-pill__status {
  font-size: 0.8rem;
  color: #495057;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.ai-stage-pill.pending .ai-stage-pill__dot {
  background: #ced4da;
}

.ai-stage-pill.running {
  background: #fffdf5;
  border-color: #ffe08a;
  color: #7a5b00;
}

.ai-stage-pill.waiting {
  background: #f9fafb;
  border-color: #e9ecef;
  color: #6c757d;
}

.ai-stage-pill.running .ai-stage-pill__dot {
  background: #ffc107;
}

.ai-stage-pill.done {
  background: #f1fff5;
  border-color: #74c69d;
  color: #0f5132;
}

.ai-stage-pill.done .ai-stage-pill__dot {
  background: #198754;
}

.ai-stage-pill.skipped {
  background: #f4f5f7;
  border-color: #e9ecef;
}

.ai-stage-pill.skipped .ai-stage-pill__dot {
  background: #adb5bd;
}

.ai-stage-pill.error {
  background: #fff0f0;
  border-color: #f5c2c7;
  color: #842029;
}

.ai-stage-pill.error .ai-stage-pill__dot {
  background: #dc3545;
}

.ai-stage-pill .spinner-border-sm {
  width: 0.9rem;
  height: 0.9rem;
  border-width: 0.13em;
}

.ai-report-panel {
  border: 1px solid #e9ecef;
  border-radius: 10px;
  background: #ffffff;
  padding: 0.85rem;
  box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.02);
}

.ai-report-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.ai-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: #212529;
}

.ai-section-pre {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1f2937;
}

.ai-section-body {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  background: #ffffff;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #1f2937;
}

.ai-collapsible {
  max-height: none;
  position: relative;
}

.ai-collapsible.ai-collapsed {
  max-height: 180px;
  overflow: hidden;
}

.ai-collapsible.ai-collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 90%);
}

.ai-toggle {
  color: #0f172a;
  text-decoration: none;
}

.ai-toggle:hover {
  text-decoration: none;
}

.ai-spans-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ai-span-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  background: #ffffff;
}

.ai-span-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: #e9ecef;
  color: #212529;
}

.ai-span-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #1f2937;
}

.ai-span-item.tier-t4 {
  background: #fff;
  border-color: #f5c2c7;
}

.ai-span-item.tier-t4 .ai-span-pill {
  background: #dc3545;
  color: #fff;
}

.ai-span-item.tier-t3 {
  background: #fff;
  border-color: #ffd8a8;
}

.ai-span-item.tier-t3 .ai-span-pill {
  background: #fd7e14;
  color: #fff;
}

.ai-span-item.tier-t2 {
  background: #fff;
  border-color: #ffe08a;
}

.ai-span-item.tier-t2 .ai-span-pill {
  background: #ffc107;
  color: #000;
}

.ai-censored {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fdfdff;
  line-height: 1.5;
  overflow-wrap: anywhere;
  color: #1f2937;
  max-height: 280px;
  overflow-y: auto;
}

.ai-censored-collapsed {
  display: none;
}

@media (max-width: 576px) {
  .ai-stage-pill {
    width: 100%;
  }
  .ai-report-scroll {
    max-height: 52vh;
  }
}

.ai-skeletons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-skeleton-card {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  background: #f9fafb;
}

.ai-skeleton-title,
.ai-skeleton-line,
.ai-skeleton-pill {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 37%, #f3f4f6 63%);
  background-size: 400% 100%;
  animation: ai-skeleton 1.4s ease infinite;
  border-radius: 6px;
}

.ai-skeleton-title {
  height: 12px;
  margin-bottom: 0.6rem;
}

.ai-skeleton-line {
  height: 12px;
  margin-bottom: 0.4rem;
}

.ai-skeleton-pill {
  height: 18px;
  width: 80px;
  margin-bottom: 0.5rem;
}

@keyframes ai-skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.ap-page-loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2147483000;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background: transparent;
}

.ap-page-loading-bar::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  border-radius: 999px;
  background: #64748b;
  transform: translateX(-120%);
}

.ap-page-loading-bar.is-visible {
  opacity: 1;
}

.ap-page-loading-bar.is-visible::before {
  animation: ap-page-loading-line 1.05s ease-in-out infinite;
}

.ap-page-loading-bar.is-complete::before {
  width: 100%;
  animation: none;
  transform: translateX(0);
}

@keyframes ap-page-loading-line {
  0% { transform: translateX(-120%); }
  55% { transform: translateX(95%); }
  100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
  .ap-page-loading-bar.is-visible::before {
    animation: none;
    transform: translateX(0);
    width: 100%;
  }
}
/* Story detail motif pills (migrated from static/css/styles.css) */
.motifs-inline__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.motifs-inline__pill {
  text-decoration: none;
}

details.motifs-inline .motifs-inline__list {
  display: none;
}

details.motifs-inline[open] .motifs-inline__list {
  display: flex;
}

details.motifs-inline > summary {
  list-style: none;
}

details.motifs-inline[open] > summary {
  display: none !important;
}

.content-container .content-block:first-child {
  margin-top: 0;
}

.content-container .content-block p:first-child {
  margin-top: 0;
}

.ap-paywall-promo {
  display: block;
  width: min(100%, 680px);
  margin: 6px 0 18px;
  padding: 15px 16px;
  border: 1px solid #dbe7fb;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.ap-paywall-promo__content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
}

.ap-paywall-promo__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
}

.ap-paywall-promo__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.24;
  color: #111827;
}

.ap-paywall-promo__body {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.52;
  color: #475569;
}

.ap-paywall-promo__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ap-paywall-promo__count,
.ap-paywall-promo__price {
  margin: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.ap-paywall-promo__count {
  background: #f8fafc;
  color: #0f172a;
}

.ap-paywall-promo__price {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #dbe3ef;
}

.ap-paywall-promo__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ap-paywall-promo__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ap-paywall-promo__cta:hover,
.ap-paywall-promo__cta:focus,
.ap-paywall-promo__cta:focus-visible {
  text-decoration: none !important;
}

.ap-paywall-promo__cta--primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff !important;
}

.ap-paywall-promo__cta--primary:hover,
.ap-paywall-promo__cta--primary:focus,
.ap-paywall-promo__cta--primary:focus-visible {
  background: #1f2937;
  border-color: #1f2937;
  color: #ffffff !important;
}

.ap-paywall-promo__cta--secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a !important;
}

.ap-paywall-promo__cta--secondary:hover,
.ap-paywall-promo__cta--secondary:focus,
.ap-paywall-promo__cta--secondary:focus-visible {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a !important;
}

.ap-paywall-card-promo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dbe7fb;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.ap-paywall-card-promo__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ap-paywall-card-promo__title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
}

.ap-paywall-card-promo__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #0f172a;
  color: #ffffff !important;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none !important;
  white-space: nowrap;
}

.ap-paywall-card-promo__cta:hover,
.ap-paywall-card-promo__cta:focus,
.ap-paywall-card-promo__cta:focus-visible {
  background: #1f2937;
  border-color: #1f2937;
  color: #ffffff !important;
  text-decoration: none !important;
}

.ap-paywall-inline-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid #dbe7fb;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
  padding: 12px 14px;
  margin: 8px 0 14px;
}

.ap-paywall-inline-lock__copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ap-paywall-inline-lock__title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111827;
}

.ap-paywall-inline-lock__body {
  font-size: 0.8rem;
  line-height: 1.42;
  color: #475569;
}

.ap-paywall-inline-lock__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ap-paywall-inline-lock__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none !important;
}

.ap-paywall-inline-lock__cta:hover,
.ap-paywall-inline-lock__cta:focus,
.ap-paywall-inline-lock__cta:focus-visible {
  text-decoration: none !important;
}

.ap-paywall-inline-lock__cta--primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff !important;
}

.ap-paywall-inline-lock__cta--primary:hover,
.ap-paywall-inline-lock__cta--primary:focus,
.ap-paywall-inline-lock__cta--primary:focus-visible {
  background: #1f2937;
  border-color: #1f2937;
  color: #ffffff !important;
}

.ap-paywall-inline-lock__cta--secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a !important;
}

.ap-paywall-inline-lock__cta--secondary:hover,
.ap-paywall-inline-lock__cta--secondary:focus,
.ap-paywall-inline-lock__cta--secondary:focus-visible {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a !important;
}

@media (max-width: 640px) {
  .ap-paywall-promo {
    width: 100%;
    padding: 14px;
  }

  .ap-paywall-card-promo,
  .ap-paywall-inline-lock {
    align-items: flex-start;
  }
}

/* Runtime-injected styles migrated from JS modules to static CSS. */

/* journalOverlay.js */
#ap-journal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5001;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(249, 249, 247, 0.5);
  background: color-mix(in oklab, var(--background, #F9F9F7) 50%, transparent);
  backdrop-filter: blur(6px);
  padding: 12px 8px;
}
#ap-journal-overlay.show {
  display: flex;
}
#ap-journal-overlay .ap-overlay-card {
  background: #fff;
  max-width: 720px;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 26px 18px 18px;
  max-height: 82vh;
  overflow: auto;
  position: relative;
}
#ap-journal-overlay h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: #111;
}
#ap-journal-overlay h4 {
  font-size: 1rem;
  color: #6c757d;
  margin-bottom: 0.75rem;
}
#ap-journal-overlay .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
#ap-journal-overlay .badge-pill {
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #334;
  font-size: 12px;
  font-weight: 600;
}
#ap-journal-overlay .badge-pill.total {
  background-color: #0f766e;
  color: #fff;
}
#ap-journal-overlay .badge-pill.showing {
  background: #0f172a;
  color: #fff;
}
#ap-journal-overlay .badge-pill.sensitive {
  background: #ffc107;
  color: #fff;
}
#ap-journal-overlay .badge-pill.bold {
  background: #f57e7e;
  color: #fff;
}
#ap-journal-overlay .badge-pill.private {
  background: #6f42c1;
  color: #fff;
}
#ap-journal-overlay .badge-pill.black {
  background: #111111;
  color: #fff;
}
#ap-journal-overlay .ap-overlay-close {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  cursor: pointer;
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 1.1rem;
  line-height: 1;
  color: #555;
}
#ap-journal-overlay .body {
  font-size: 15px;
  line-height: 1.5;
  color: #222;
}

/* cardLoader.js */
[data-ad-id] .overlay {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
}
[data-ad-id] {
  overflow: visible !important;
}
[data-ad-id] .snippet {
  display: block !important;
}

/* consolePanel.js */
.input-area-blink {
  background-color: rgba(255, 182, 193, 0.3) !important;
  animation: blinkOnce 0.3s ease-in-out;
}
.input-area-hard-limit {
  background-color: rgba(255, 182, 193, 0.3) !important;
}
@keyframes blinkOnce {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(255, 182, 193, 0.5);
  }
  100% {
    background-color: rgba(255, 182, 193, 0.3);
  }
}
#consoleInput:focus,
#chatPrompt:focus {
  border-color: #c4c7cf !important;
  box-shadow: inset 0 0 0 1px #e4e4e7;
}

/* Elle chat typography: match panel/body font everywhere in chat UI. */
.ai-panel-float .console-output,
.ai-panel-float .ai-response-content,
.ai-panel-float .user-message,
.ai-panel-float .system-message,
.ai-panel-float .chat-message,
#consoleInput,
#chatPrompt,
.console-input textarea,
.console-input-area textarea {
  font-family: var(--body-font, system-ui, -apple-system, sans-serif);
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0;
}

#consoleInput::placeholder,
#chatPrompt::placeholder,
.console-input textarea::placeholder,
.console-input-area textarea::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  color: #9aa3b2;
}
.console-output {
  position: relative;
  min-height: 200px;
  padding-top: 260px;
}
.ai-face-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  width: calc(100% - 20px);
  height: 240px;
  border-radius: 20px;
  overflow: hidden;
  background-color: #f9fafb;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  display: none;
  pointer-events: none;
  z-index: 5;
}
.console-output.ai-face-only .user-message,
.console-output.ai-face-only .system-message,
.console-output.ai-face-only .ai-response-block {
  display: none;
}
.ai-inline-welcome {
  border: 1px solid #eceef1;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: #4b5563;
  background: #f8f8fa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 40px rgba(15, 23, 42, 0.08);
}
.ai-inline-welcome--interactive {
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.ai-inline-welcome--interactive:focus-visible {
  outline: 2px solid #c4b5fd;
  outline-offset: 2px;
}
.ai-inline-welcome--interactive:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 15px 45px rgba(15, 23, 42, 0.12);
}
.ai-starter-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 8px;
}
.ai-starter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-starter-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.85rem;
  background: #ffffff;
  color: #1f2937;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
.ai-starter-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}
.ai-panel-launcher.ap-orb-nudge {
  box-shadow: 0 0 0 0 rgba(255, 182, 193, 0.6);
  animation: apOrbPulse 1.8s ease-in-out infinite;
}
@keyframes apOrbPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 182, 193, 0.45);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(255, 182, 193, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 182, 193, 0);
  }
}
.ai-inline-consent {
  border: 1px dashed #e4e4e7;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: #52525b;
  background: #f9fafb;
  text-align: center;
}
.console-input-area .cookie-prompt-pulse {
  position: relative;
  z-index: 2;
}
.console-input-area .cookie-prompt-pulse::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(216, 199, 154, 0.9);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: cookiePromptSpin 1.2s linear infinite;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(216, 199, 154, 0.35);
}
@keyframes cookiePromptSpin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 0.65;
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
    opacity: 0.65;
  }
}
.system-message {
  color: #6b7280;
  font-size: 0.9rem;
  font-style: italic;
  margin: 6px 0;
}
.chat-message.system {
  color: #6b7280;
  font-size: 0.9rem;
  font-style: italic;
}
.ai-panel-float .ai-response-content a,
.ai-panel-float .chat-message.ai a,
.ai-panel-float .system-message a {
  color: #1f2937 !important;
  text-decoration: none !important;
  font-weight: 600;
  cursor: pointer;
}
.ai-panel-float .ai-response-content a:hover,
.ai-panel-float .chat-message.ai a:hover,
.ai-panel-float .system-message a:hover {
  color: #1e40af !important;
}
.ai-panel-float .ai-response-content p,
.ai-panel-float .chat-message.ai p,
.ai-panel-float .system-message p {
  margin: 0 0 0.52rem;
}
.ai-panel-float .ai-response-content p:last-child,
.ai-panel-float .chat-message.ai p:last-child,
.ai-panel-float .system-message p:last-child {
  margin-bottom: 0;
}
.ai-panel-float .ai-response-content ol,
.ai-panel-float .chat-message.ai ol,
.ai-panel-float .system-message ol {
  margin: 0.2rem 0 0.58rem 1.05rem;
  padding-left: 1rem;
  list-style: decimal;
}
.ai-panel-float .ai-response-content ul,
.ai-panel-float .chat-message.ai ul,
.ai-panel-float .system-message ul {
  margin: 0.2rem 0 0.58rem 1.05rem;
  padding-left: 1rem;
  list-style: disc;
}
.ai-panel-float .ai-response-content li,
.ai-panel-float .chat-message.ai li,
.ai-panel-float .system-message li {
  margin: 0 0 0.36rem;
}
.ai-panel-float .ai-response-content li:last-child,
.ai-panel-float .chat-message.ai li:last-child,
.ai-panel-float .system-message li:last-child {
  margin-bottom: 0;
}
.ai-panel-float .user-message::before,
.ai-panel-float .chat-message.user::before {
  content: none !important;
}
.ai-response-archived .ai-response-content {
  opacity: 0.7;
}
.restore-btn {
  display: none;
}
.ai-response-archived .restore-btn {
  display: inline-block;
}
.ai-response-archived .archive-btn {
  display: none;
}

/* cookieOverlay.js */
#ap-cookie-overlay {
  position: fixed;
  z-index: 5300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100vw;
  height: 100vh;
  max-width: none;
  pointer-events: none;
}
#ap-cookie-overlay.show {
  display: flex;
}
#ap-cookie-overlay .ap-cookie-box {
  width: min(540px, calc(100vw - 48px));
  max-width: 100%;
  max-height: min(560px, calc(100dvh - 32px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.12);
  padding: 26px 28px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}
#ap-cookie-overlay .ap-cookie-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#ap-cookie-overlay .ap-cookie-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
#ap-cookie-overlay .ap-cookie-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
#ap-cookie-overlay .ap-cookie-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}
#ap-cookie-overlay .ap-cookie-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.09);
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #1f2937;
  flex: 0 0 auto;
}
#ap-cookie-overlay .ap-cookie-kicker {
  margin: 0;
  color: #5b6b83;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#ap-cookie-overlay h3 {
  margin: 0;
  color: #111;
  font-size: 1.46rem;
  font-weight: 700;
  line-height: 1.08;
}
#ap-cookie-overlay p {
  margin: 0;
  color: #222;
  line-height: 1.55;
  font-size: 0.95rem;
}
#ap-cookie-overlay .ap-cookie-copy p {
  max-width: none;
}
#ap-cookie-overlay .ap-cookie-points {
  display: grid;
  gap: 0;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.82);
  overflow: hidden;
}
#ap-cookie-overlay .ap-cookie-point {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 15px 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
#ap-cookie-overlay .ap-cookie-point + .ap-cookie-point {
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}
#ap-cookie-overlay .ap-cookie-point .ap-cookie-icon {
  width: 36px;
  height: 36px;
  margin-top: 0;
  border-radius: 11px;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.1);
  color: #1f2937;
}
#ap-cookie-overlay .ap-cookie-point-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 1px;
}
#ap-cookie-overlay .ap-cookie-point-copy strong {
  color: #111827;
  font-size: 0.93rem;
  font-weight: 700;
  line-height: 1.25;
}
#ap-cookie-overlay .ap-cookie-point-copy span {
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.45;
}
#ap-cookie-overlay .ap-cookie-note {
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.45;
}
#ap-cookie-overlay .ap-cookie-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 2px;
}
#ap-cookie-overlay .btn {
  min-width: 0;
  border-radius: 999px;
  padding: 0.76rem 1rem;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.15;
  min-height: 44px;
  box-shadow: none;
}
#ap-cookie-overlay .btn.btn-dark {
  background: #0f172a;
  border-color: #0f172a;
}
#ap-cookie-overlay .btn.btn-outline-secondary {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.42);
  color: #334155;
}
#ap-cookie-overlay .ap-overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: rgba(241, 245, 249, 0.9);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1rem;
  line-height: 1;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 576px) {
  #ap-cookie-overlay {
    align-items: flex-end;
    padding: 12px;
  }
  #ap-cookie-overlay .ap-cookie-box {
    width: 100%;
    max-height: calc(100dvh - 24px);
    padding: 18px 16px 16px;
    gap: 12px;
    border-radius: 16px;
  }
  #ap-cookie-overlay .ap-cookie-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #ap-cookie-overlay .ap-cookie-badge {
    width: 46px;
    height: 46px;
  }
  #ap-cookie-overlay h3 {
    font-size: 1.32rem;
  }
  #ap-cookie-overlay p {
    max-width: none;
  }
  #ap-cookie-overlay .ap-cookie-points {
    display: none;
  }
  #ap-cookie-overlay .ap-cookie-actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  #ap-cookie-overlay .btn {
    width: 100%;
  }
}

/* signinPrompt.js */
#ap-signin-prompt {
  position: fixed;
  inset: 0;
  z-index: 10090;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: rgba(15, 23, 42, 0.58);
  pointer-events: auto;
}
#ap-signin-prompt.show {
  display: flex;
}
#ap-signin-prompt[aria-hidden="true"] {
  display: none;
}
#ap-signin-prompt .ap-signin-prompt__card {
  width: min(940px, calc(100vw - 40px));
  max-height: min(680px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  position: relative;
}
#ap-signin-prompt .ap-signin-prompt__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  border: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.9);
  color: #475569;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
}
#ap-signin-prompt .ap-signin-prompt__close:hover {
  background: #f8fafc;
  color: #0f172a;
}
#ap-signin-prompt .ap-signin-prompt__grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(340px, 1.08fr);
}
#ap-signin-prompt .ap-signin-prompt__letter {
  background: #fff;
  padding: 8px;
  border-right: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: stretch;
  overflow: hidden;
}
#ap-signin-prompt .ap-signin-prompt__letter img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border: 0;
  background: #fff;
}
#ap-signin-prompt .ap-signin-prompt__join {
  padding: 32px 34px;
}
#ap-signin-prompt .ap-signin-prompt__kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
#ap-signin-prompt .ap-signin-prompt__join h3 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.08;
  color: #0f172a;
}
#ap-signin-prompt .ap-signin-prompt__copy {
  margin: 0 0 20px;
  color: #475569;
}
#ap-signin-prompt .ap-signin-prompt__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 12px;
}
#ap-signin-prompt .ap-signin-prompt__form label,
#ap-signin-prompt .ap-signin-prompt__form .ap-signin-prompt__label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}
#ap-signin-prompt .ap-signin-prompt__form .ap-signin-prompt__label {
  position: relative;
}
#ap-signin-prompt .ap-signin-prompt__form input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 11px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
#ap-signin-prompt .ap-signin-prompt__dob-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
#ap-signin-prompt .ap-signin-prompt__dob-selects select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 8px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
}
#ap-signin-prompt .ap-signin-prompt__field-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#ap-signin-prompt .ap-signin-prompt__help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid #94a3b8;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: help;
  padding: 0;
}
#ap-signin-prompt .ap-signin-prompt__help:focus {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}
#ap-signin-prompt .ap-signin-prompt__help-bubble {
  position: absolute;
  left: 0;
  top: 24px;
  z-index: 5;
  display: block;
  width: min(260px, calc(100vw - 48px));
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  color: #475569;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}
#ap-signin-prompt .ap-signin-prompt__help-bubble[hidden] {
  display: none;
}
#ap-signin-prompt .ap-signin-prompt__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}
#ap-signin-prompt .ap-signin-prompt__primary {
  grid-column: 1 / -1;
  border: 0;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
}
#ap-signin-prompt .ap-signin-prompt__signin-row {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  color: #6b7280;
}
#ap-signin-prompt .ap-signin-prompt__signin-link,
#ap-signin-prompt .ap-signin-prompt__signin-link:visited,
#ap-signin-prompt .ap-signin-prompt__signin-link:hover,
#ap-signin-prompt .ap-signin-prompt__signin-link:focus,
#ap-signin-prompt .ap-signin-prompt__signin-link:active {
  color: #0f172a !important;
  font-weight: 800;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
#ap-signin-prompt .ap-signin-prompt__secondary,
#ap-signin-prompt .ap-signin-prompt__secondary:visited,
#ap-signin-prompt .ap-signin-prompt__secondary:hover,
#ap-signin-prompt .ap-signin-prompt__secondary:focus,
#ap-signin-prompt .ap-signin-prompt__secondary:active {
  display: block;
  width: auto;
  min-height: 0;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #0f172a !important;
  box-shadow: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
@media (max-width: 760px) {
  #ap-signin-prompt {
    padding: 16px;
  }
  #ap-signin-prompt .ap-signin-prompt__card {
    width: min(100%, 520px);
    max-height: calc(100vh - 32px);
  }
  #ap-signin-prompt .ap-signin-prompt__grid {
    grid-template-columns: 1fr;
  }
  #ap-signin-prompt .ap-signin-prompt__form {
    grid-template-columns: 1fr;
  }
  #ap-signin-prompt .ap-signin-prompt__letter {
    max-height: 260px;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
  }
  #ap-signin-prompt .ap-signin-prompt__letter img {
    height: 100%;
    object-fit: contain;
  }
  #ap-signin-prompt .ap-signin-prompt__join {
    padding: 24px 18px;
  }
  #ap-signin-prompt .ap-signin-prompt__join h3 {
    font-size: 23px;
  }
}

/* adOverlay.js */
#ap-ad-overlay {
  position: fixed;
  inset: 0;
  background: rgba(249, 249, 247, 0.78);
  background: color-mix(in oklab, var(--background, #F9F9F7) 78%, transparent);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1100;
}
#ap-ad-overlay .ap-ad-card {
  width: min(440px, 94vw);
  background: #fff;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
  position: relative;
  animation: ap-ad-pop 0.35s ease;
}
#ap-ad-overlay .ap-ad-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.95);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  color: #0f172a;
  box-shadow: 0 6px 30px rgba(15, 23, 42, 0.18);
}
#ap-ad-overlay .ap-ad-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
#ap-ad-overlay .ap-ad-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
#ap-ad-overlay .ap-ad-body {
  padding: 26px 28px 30px;
}
#ap-ad-overlay .ap-ad-headline {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.65rem 0;
}
#ap-ad-overlay .ap-ad-headline span {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: #0f172a;
  margin-right: 0.35rem;
}
#ap-ad-overlay p {
  margin-bottom: 1rem;
  color: #475467;
  line-height: 1.5;
}
#ap-ad-overlay .ap-ad-spinner {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.25rem;
}
#ap-ad-overlay .ap-ad-spinner svg {
  width: 44px;
  height: 44px;
  display: block;
}
#ap-ad-overlay .ap-ad-spinner circle {
  fill: none;
  stroke-width: 3;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
#ap-ad-overlay .ap-ad-spinner .track {
  stroke: rgba(148, 163, 184, 0.45);
}
#ap-ad-overlay .ap-ad-spinner .progress {
  stroke: #0f172a;
  stroke-dasharray: 125.6;
  stroke-dashoffset: 125.6;
  animation: ap-ad-ring 6s linear forwards;
}
#ap-ad-overlay .ap-ad-spinner.is-hidden {
  display: none;
}
#ap-ad-overlay .ap-ad-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
#ap-ad-overlay .ap-ad-actions .btn {
  flex: 1 1 auto;
  min-width: 140px;
}
#ap-ad-overlay .ap-ad-actions .btn-dark {
  background: #0f172a;
  border-color: #0f172a;
  font-weight: 600;
}
#ap-ad-overlay .ap-ad-dismiss {
  color: #6b7280;
  text-decoration: none;
  font-weight: 600;
}
#ap-ad-overlay .btn.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}
body.ad-overlay-open {
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) {
  #ap-ad-overlay .ap-ad-card {
    animation: none;
  }
}
@keyframes ap-ad-pop {
  from {
    transform: translateY(20px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes ap-ad-ring {
  to {
    stroke-dashoffset: 0;
  }
}
