/* 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;
}

a:hover {
  color: #0c51b8;
  text-decoration: underline;
}

/* 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-red:     #0b3d91;
    --hover-red:     #0f52ba;
}

/* 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;
}

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: underline;
}

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

/* 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-red);
    font-weight: bold;
}
/* 1_layout_core.css */
/* ---- Core page grid & column behaviour ---- */

/* 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;
    }
}
#page-wrapper {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/**
 * 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;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

@media (max-width: 1199.98px) {
    #main-content {
        position: relative;
        height: auto;
        min-height: 100vh;
        padding-bottom: 4.5rem;
    }
}

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

/* non-wrapping 3-column layout fix */
.container-fluid > .row {
    flex-wrap: nowrap;
}

.row.g-0 {
    /* Make the 3-column frame fill the viewport and keep
       scrolling inside the center column only */
    height: 100vh;
    flex-wrap: nowrap;
    overflow: hidden;
}

.container-fluid {
    padding: 0;
}

.row {
    margin: 0;
}
/* 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; }

/* animated underline */
#site-header nav ul li a::after,
#site-header nav ul li form button::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--hover-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
    pointer-events: none;
}

#site-header nav ul li a:hover::after,
#site-header nav ul li a:focus::after,
#site-header nav ul li form button:hover::after,
#site-header nav ul li form button:focus::after {
    transform: scaleX(1);
}

#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 ---- */
#site-footer {
    background: var(--footer-area);
    color: var(--footer-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 15px 20px;
    font-size: 0.9rem;
    margin-left: 20px;
    margin-right: 20px;
    width: auto;
    max-width: unset;
    box-sizing: border-box;
}

#site-footer .footer-links {
    display: flex;
    gap: 15px;
}

#site-footer .footer-links a {
    position: relative;
    color: var(--primary);
    text-decoration: none;
    padding-bottom: 2px;
    transition: color 0.3s;
}

#site-footer .footer-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--hover-red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
    pointer-events: none;
}

#site-footer .footer-links a:hover::after,
#site-footer .footer-links a:focus::after { transform: scaleX(1); }

#site-footer .footer-links a:hover,
#site-footer .footer-links a:focus { color: var(--link-hover); }

@media (max-width: 1199.98px) {
    #site-footer {
        width: 100%;
        margin: 1.5rem auto 0;
        padding: 0.75rem 1.25rem 1.25rem;
        border: none;
        box-shadow: none;
        flex-direction: column;
        align-items: center;
        gap: 0.25rem;
        background: var(--background);
    }

    #site-footer .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem 1rem;
    }

    #site-footer .footer-links a {
        padding: 0.1rem 0.25rem;
    }

    #site-footer .footer-group {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem 0.55rem;
        margin-bottom: 0.25rem;
    }

    #site-footer .footer-links-meta {
        gap: 0.25rem 0.75rem;
    }

    #site-footer .footer-copy {
        font-size: 0.85rem;
        color: var(--footer-text);
        opacity: 0.85;
    }
}
/* 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 !important; /* override bootstrap .overflow-auto */
}

.sidebar-left .ap-logo-img {
    display: block;
    width: 18px;
    height: 18px;
    object-fit: contain;
    margin-right: 2px;
    cursor: pointer;
    transition: opacity 150ms ease;
}

.sidebar-left .ap-logo-img:hover {
    opacity: 0.85;
}

.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 .navbar-brand {
    color: var(--primary);
    text-decoration: none;
}

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

.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: 56px;
    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;
}

.ai-panel-launcher img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: transparent;
}

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

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

.ai-panel.ai-panel-float {
    position: fixed;
    right: 20px;
    bottom: 88px;
    top: auto;
    left: auto;
    width: 320px;
    max-width: calc(100vw - 32px);
    height: 300px;
    max-height: calc(100vh - 80px);
    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-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: transparent;
    border-bottom: 1px solid #eef2f7;
}

.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 {
    margin: 0;
}

.ai-panel-close {
    margin-left: auto;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: #e9edf6;
    color: #111827;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ai-panel-close:hover {
    background: #dfe6f2;
}

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

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

.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: 12px;
    overflow-y: auto;
    min-height: 120px;
    padding-bottom: 12px;
}

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

.ai-panel-float .console-input form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.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 {
    padding-right: 10px;
    border-radius: 10px;
    border: 1px solid #e6eaf2;
    background: #ffffff;
    flex: 1 1 auto;
}

.ai-panel-float .console-input button {
    position: static;
    transform: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border-color: transparent;
    background: transparent;
    color: #111827;
}

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

.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: #f1f5f9;
    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;
    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-text{text-align:left; margin-left: 0.5rem;} 

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

.sidebar-left .logo-text.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 .btn-toggle{display:inline-flex;align-items:center;}
/* .sidebar-left .btn-toggle i{order:-1;margin-right:.5rem;} */ /* Disabled: handled by #toggleSidebarBtn rules below */

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

.sidebar-left .nav-link i {
    font-size: 1.2rem;
    color: #555;
    margin-right: 0.5rem;
    transition: color 0.2s;
}
.sidebar-left .nav-icon-img { margin-right: 0.5rem; }

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

.sidebar-left.collapsed .nav-link i,
html.sidebar-prefers-collapsed .sidebar-left .nav-link i,
.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 .nav-link:hover,
.sidebar-left .nav-link:hover i {
    background-color: #f0f0f0;
}

.sidebar-left .nav-link.active,
.sidebar-left .nav-link.active i {
    color: #111;
    background-color: transparent;
}

/* 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%;
}



/* --- Sidebar toggle visibility --------------------------------------- */
/* Keep the collapse/expand arrow visible even when the sidebar is collapsed */
.sidebar-left.collapsed .mt-auto,
.sidebar-left.collapsed #toggleSidebarBtn,
html.sidebar-prefers-collapsed .sidebar-left .mt-auto,
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 ---- */

/* Never underline links styled as buttons */
a.btn, a.btn:hover, .btn a, .btn a:hover, .btn-link, .btn-link:hover {
    text-decoration: none !important;
}

/* 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 { 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: underline;
}

/* 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-red);
    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-red); transform: scale(1.05); }
.cta-button:active  { background-color: var(--click-red); transform: scale(0.95); }

/* bootstrap primary overrides */
.btn.btn-primary {
    background-color: var(--click-red);
    border-color: var(--click-red);
    color: var(--background);
    transition: background-color 0.3s, transform 0.2s;
}
.btn.btn-primary:hover  { background-color: var(--hover-red);  border-color: var(--hover-red);  transform: scale(1.05); }
.btn.btn-primary:active { background-color: var(--click-red);  border-color: var(--click-red);   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-red);
    border-radius: 5px;
    font-size: 14px;
    box-sizing: border-box;
}
input:focus,
select:focus,
textarea:focus { border-color: var(--click-red); outline: none; }
input.is-invalid { border: 2px solid var(--click-red); 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,
    .sidebar-left .btn-toggle {
        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 .nav-link,
    html.sidebar-prefers-collapsed .sidebar-left .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: auto;
        top: auto;
        bottom: 76px;
        width: auto;
        height: 34vh;
        max-height: 34vh;
    }
    .ai-panel-launcher {
        right: 12px;
        bottom: 12px;
        width: 52px;
        height: 52px;
    }
}

/* 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;
}

.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: 2rem 1.5rem !important;
        overflow-y: auto !important;
        flex-direction: column !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 .nav-link {
        justify-content: flex-start !important;
        padding-left: 1rem;
    }
    .sidebar-left.drawer-open .mt-auto {
        margin-top: auto !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,
    .sidebar-left .btn-toggle {
        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-red:   #0f52ba;
    --click-red:   #0b3d91;
    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 .nav-link .wallet-sign,
html.sidebar-prefers-collapsed .sidebar-left .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;
}

/* readable text on highlights */
.sensitive,
.paid,
.private {
  color: #000 !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;
}

.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;
}

/* 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;
}
/* 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;
}
/* ===== 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; }

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,
span.censor,
span.censor-sensitive,
span.censor-paid,
span.censor-private { 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; }

/* Story card overlay styling */
.story-card {
  position: relative;
  overflow: hidden;
}

.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 12px 28px rgba(0, 0, 0, 0.22);
  transition: box-shadow .2s ease, transform .15s ease;
}
.home-day-card.is-noindex{
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
  transition: box-shadow .2s ease, transform .15s ease;
}
.home-feed-bottom{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:0;
  padding-top: 10px;
  padding-bottom: 0;
}
.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: 1px;
}

/* 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: '\F132'; /* Bootstrap icon for arrow-repeat */
    font-family: 'bootstrap-icons';
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    padding: 2px 4px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  
  .ai-response-archived .ai-response-controls:hover::before {
    color: rgba(255, 255, 255, 0.9);
  }
  
  /* Add a restore button for archived responses */
  .ai-response-archived .ai-response-controls::after {
    content: "\F2EE";
    font-family: "bootstrap-icons";
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
  }
  
  .ai-response-archived .ai-response-controls:hover::after {
    color: rgba(255, 255, 255, 0.8);
  }
  
  /* 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: #0d6efd;
    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; }

.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;
}


/* 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;
}

/* 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 .censor,
.story-card .story-inner .censor-sensitive,
.story-card .story-inner .censor-paid,
.story-card .story-inner .censor-private {
  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: #0d6efd;
  text-decoration: none;
}

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

.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%; }
}
/* 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;
}
