/* ==========================================================================
   ePaper Digital Portal - Clean Unified Design System & Reader Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --------------------------------------------------------------------------
   1. Theme System & Variables
   -------------------------------------------------------------------------- */
:root {
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: var(--font-body);

    /* Primary Palette Default Tokens */
    --theme-primary: #0b499d;
    --theme-primary-dark: #082856;
    --theme-secondary: #ffc709;
    --theme-secondary-hover: #e0ac00;
    
    --bg-main: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-elevated: #eef2f6;

    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.08);

    --transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    --color-danger: #ef4444;
    --color-info: #0284c7;
    --color-warning: #ffc107;
    --color-success: #059669;
    --text-on-primary: #ffffff;
    --text-on-secondary: #000000;
    --bg-dark-surface: #0f172a;
}

/* Color Themes */
body.theme-classic_blue {
    --theme-primary: #0b499d;
    --theme-primary-dark: #082856;
    --theme-secondary: #ffc709;
    --theme-secondary-hover: #e0ab00;
    --bg-main: #f4f6f9;
    --bg-surface: #ffffff;
    --bg-elevated: #eef2f6;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

body.theme-purple {
    --theme-primary: #8e24aa;
    --theme-primary-dark: #6a1b9a;
    --theme-secondary: #ffc107;
    --theme-secondary-hover: #e0a800;
    --bg-main: #f8f6fc;
    --bg-surface: #ffffff;
    --bg-elevated: #f0ebf8;
    --border-color: #e6ddf2;
    --border-strong: #d4c4e8;
    --text-primary: #1e1b2e;
    --text-secondary: #4c4663;
    --text-muted: #8c84a6;
}

body.theme-executive_blue,
body.theme-eenadu {
    --theme-primary: #0266c8;
    --theme-primary-dark: #014385;
    --theme-secondary: #00e5ff;
    --theme-secondary-hover: #00b4cc;
    --bg-main: #f0f7ff;
    --bg-surface: #ffffff;
    --bg-elevated: #e0effe;
    --border-color: #bae6fd;
    --border-strong: #7dd3fc;
    --text-primary: #0c4a6e;
    --text-secondary: #0369a1;
    --text-muted: #38bdf8;
}

body.theme-crimson {
    --theme-primary: #dc2626;
    --theme-primary-dark: #991b1b;
    --theme-secondary: #f59e0b;
    --theme-secondary-hover: #d97706;
    --bg-main: #fef2f2;
    --bg-surface: #ffffff;
    --bg-elevated: #fee2e2;
    --border-color: #fecaca;
    --border-strong: #fca5a5;
    --text-primary: #450a0a;
    --text-secondary: #7f1d1d;
    --text-muted: #b91c1c;
}

body.theme-onyx {
    --theme-primary: #1e293b;
    --theme-primary-dark: #0f172a;
    --theme-secondary: #38bdf8;
    --theme-secondary-hover: #0ea5e9;
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-elevated: #e2e8f0;
    --border-color: #cbd5e1;
    --border-strong: #94a3b8;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
}

body.theme-light_creme_white {
    --theme-primary: #2d261e;
    --theme-primary-dark: #1b1712;
    --theme-secondary: #c2410c;
    --theme-secondary-hover: #9a3412;
    --bg-main: #fcfbf7;
    --bg-surface: #ffffff;
    --bg-elevated: #f5f0e6;
    --border-color: #e8e2d5;
    --border-strong: #d4cbba;
    --text-primary: #1c1917;
    --text-secondary: #44403c;
    --text-muted: #78716c;
}

body.theme-light_white {
    --theme-primary: #1e293b;
    --theme-primary-dark: #0f172a;
    --theme-secondary: #2563eb;
    --theme-secondary-hover: #1d4ed8;
    --bg-main: #ffffff;
    --bg-surface: #f8fafc;
    --bg-elevated: #f1f5f9;
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
}

body.theme-wheat {
    --theme-primary: #3d2e24;
    --theme-primary-dark: #261c14;
    --theme-secondary: #b45309;
    --theme-secondary-hover: #92400e;
    --bg-main: #f5efe6;
    --bg-surface: #fdfaf6;
    --bg-elevated: #ebe2d3;
    --border-color: #dfd5c2;
    --border-strong: #c8bc9f;
    --text-primary: #26201b;
    --text-secondary: #4e4339;
    --text-muted: #7d7063;
}

/* --- Theme surface pattern layer --- */
body.theme-classic_blue { background-image: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 4%, transparent) 25%, transparent 25%, transparent 50%, color-mix(in srgb, var(--theme-secondary) 3%, transparent) 50%, color-mix(in srgb, var(--theme-secondary) 3%, transparent) 75%, transparent 75%); background-size: 28px 28px; }
body.theme-purple, body.theme-crimson, body.theme-executive_blue, body.theme-eenadu, body.theme-onyx, body.theme-light_creme_white, body.theme-light_white, body.theme-wheat { background-image: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 3%, transparent) 25%, transparent 25%, transparent 50%, color-mix(in srgb, var(--theme-secondary) 2%, transparent) 50%, color-mix(in srgb, var(--theme-secondary) 2%, transparent) 75%, transparent 75%); background-size: 32px 32px; }
.portal-masthead, .portal-navbar, .section-block, .sidebar-widget, .epaper-card { --theme-pattern-opacity: .08; }

/* --- Dynamic Logo Effects & Border Corners System --- */
.site-logo-img {
    border-radius: var(--logo-border-radius, 0px);
    transition: all 0.25s ease;
}
.site-logo-img.logo-effect-glow_aura {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.85)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.site-logo-img.logo-effect-drop_shadow {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}
.site-logo-img.logo-effect-frosted_plaque {
    background: rgba(255, 255, 255, 0.20) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}
.site-logo-img.logo-effect-framed_border {
    border: 2px solid rgba(255, 255, 255, 0.65) !important;
    padding: 4px 8px !important;
    background: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
.site-logo-img.logo-effect-white_pill {
    background: #ffffff !important;
    padding: 5px 12px !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25) !important;
    border: 1px solid #e2e8f0 !important;
}

/* --------------------------------------------------------------------------
   2. Reset & Base Styles
   -------------------------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.45;
    font-size: 0.85rem;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

/* Common Unified Buttons & Badges */
.btn-base,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none !important;
    font-family: var(--font-body);
    white-space: nowrap;
    user-select: none;
}
.btn:hover,
.btn-base:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.btn:active,
.btn-base:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--theme-primary);
    color: #ffffff !important;
}
.btn-primary:hover {
    background: var(--theme-primary-dark);
}

.btn-secondary {
    background: var(--theme-secondary);
    color: #000000 !important;
}
.btn-secondary:hover {
    background: var(--theme-secondary-hover);
}

.btn-success {
    background: #10b981;
    color: #ffffff !important;
}
.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    color: #ffffff !important;
}
.btn-danger:hover {
    background: #dc2626;
}

.btn-info {
    background: #0ea5e9;
    color: #ffffff !important;
}
.btn-info:hover {
    background: #0284c7;
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
}

.btn-admin.btn-outline,
.btn-outline {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}
.btn-admin.btn-outline:hover,
.btn-outline:hover {
    background: var(--bg-elevated) !important;
    border-color: var(--border-strong) !important;
}

.btn-admin.btn-sm,
.btn-sm {
    padding: 5px 10px !important;
    font-size: 0.76rem !important;
}

/* Unified Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    line-height: 1.25;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-pill { border-radius: var(--radius-full); }

.badge-primary   { background: var(--theme-primary); color: #ffffff; }
.badge-secondary { background: var(--theme-secondary); color: #000000; }
.badge-neutral   { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-color); }
.badge-info      { background: var(--color-info); color: #ffffff; }
.badge-success   { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.badge-warning   { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.badge-danger    { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.badge-purple    { background: #f5f3ff; color: #5b21b6; border-color: #ddd6fe; }

/* --------------------------------------------------------------------------
   3. Header Utility Bar & Masthead (Ultra-Compact Zero-Padding)
   -------------------------------------------------------------------------- */
.top-header-bar {
    background: var(--theme-primary-dark);
    color: #ffffff;
    padding: 2px 14px;
    font-size: 0.74rem;
    font-weight: 500;
    min-height: 24px;
}

.top-header-bar-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 24px;
}

.top-header-bar .date-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 700;
    font-size: 0.72rem;
    color: var(--theme-secondary);
}

.top-header-bar .top-social-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.social-btn {
    color: #ffffff !important;
    font-size: 0.82rem;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    text-decoration: none !important;
}

.social-btn:hover {
    transform: translateY(-2px) scale(1.08);
    filter: brightness(1.15);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.social-btn[href*="facebook.com"]:hover { background: #1877F2 !important; border-color: #1877F2 !important; }
.social-btn[href*="whatsapp.com"]:hover, .social-btn[href*="api.whatsapp.com"]:hover, .social-btn[href*="wa.me"]:hover { background: #25D366 !important; border-color: #25D366 !important; }
.social-btn[href*="twitter.com"]:hover, .social-btn[href*="x.com"]:hover { background: #000000 !important; border-color: rgba(255,255,255,0.4) !important; }
.social-btn[href*="instagram.com"]:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) !important; border-color: transparent !important; }
.social-btn[href*="youtube.com"]:hover { background: #FF0000 !important; border-color: #FF0000 !important; }
.social-btn[href*="t.me"]:hover, .social-btn[href*="telegram"]:hover { background: #229ED9 !important; border-color: #229ED9 !important; }
.social-btn[href*="linkedin.com"]:hover { background: #0077B5 !important; border-color: #0077B5 !important; }

.publisher-portal-badge {
    background: var(--theme-secondary, #ffc709) !important;
    color: #000000 !important;
    padding: 3px 9px;
    border-radius: var(--radius-sm, 4px);
    font-weight: 800;
    font-size: 0.70rem;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-decoration: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.publisher-portal-badge:hover {
    background: #ffffff !important;
    color: var(--theme-primary, #0b499d) !important;
    transform: translateY(-1px);
}

/* Brand Masthead Container */
.portal-masthead {
    background-color: var(--theme-primary);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    color: #ffffff;
    padding: 6px 14px;
    border-bottom: 2px solid var(--theme-secondary);
    min-height: 52px;
    display: flex;
    align-items: center;
}

.portal-masthead-container {
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
}

.logo-align-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.brand-masthead-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    max-width: 100%;
    padding: 2px 0;
}

.site-logo-img {
    max-height: var(--logo-max-height, 65px);
    max-width: var(--logo-max-width, 320px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    border-radius: var(--logo-border-radius, 4px);
    transition: all 0.2s ease;
}

.site-title-tagline-group {
    display: flex;
    flex-direction: column;
}

.logo-text-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.15;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.site-tagline-sub {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--theme-secondary);
    letter-spacing: 0.6px;
    margin-top: 2px;
    text-transform: uppercase;
    opacity: 0.95;
}

/* --------------------------------------------------------------------------
   4. Navigation Bar & Submenu Dropdowns (Compact)
   -------------------------------------------------------------------------- */
.portal-navbar {
    background: var(--theme-primary-dark);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1200;
}

.portal-navbar-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
}

.mobile-nav-toggle {
    display: none;
    background: var(--theme-secondary);
    color: #000000;
    border: none;
    padding: 4px 10px;
    font-weight: 800;
    font-size: 0.76rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.portal-nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 4px;
}

.portal-nav-menu li a, .dropdown-trigger-link {
    color: #ffffff !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    border-radius: var(--radius-sm, 4px) !important;
    opacity: 1 !important;
    transition: all 0.15s ease !important;
}

.portal-nav-menu li.active > a,
.portal-nav-menu li.active > .dropdown-trigger-link {
    background: var(--theme-secondary, #ffc709) !important;
    color: #000000 !important;
    font-weight: 800 !important;
}

.portal-nav-menu li a:hover,
.dropdown-trigger-link:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
}

.nav-dropdown-item {
    position: relative;
}

.dropdown-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--theme-primary-dark);
    min-width: 100%;
    width: max-content;
    min-width: 220px;
    max-width: 360px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
    border-radius: 0 0 var(--radius-md, 8px) var(--radius-md, 8px);
    list-style: none;
    padding: 4px 0 !important;
    margin: 0 !important;
    z-index: 2500;
    border: 2px solid var(--theme-secondary);
    border-top: none;
    box-sizing: border-box;
}

.nav-dropdown-item:hover > .dropdown-submenu,
.nav-dropdown-item.expanded > .dropdown-submenu {
    display: block !important;
}

.dropdown-submenu li {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.dropdown-submenu li a {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 18px !important;
    color: #ffffff !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    white-space: nowrap !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease !important;
}

.dropdown-submenu li:last-child a {
    border-bottom: none !important;
    border-radius: 0 0 6px 6px !important;
}

.dropdown-submenu li a:hover,
.dropdown-submenu li a:focus {
    background: var(--theme-secondary) !important;
    color: #000000 !important;
    font-weight: 800 !important;
    width: 100% !important;
}
.dropdown-submenu li a:hover i,
.dropdown-submenu li a:focus i {
    color: #000000 !important;
}

.portal-navbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.portal-search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.28) !important;
    border-radius: var(--radius-sm, 4px);
    padding: 0 8px;
    border: 1.5px solid var(--theme-secondary, #ffc709) !important;
    height: 28px;
    transition: all 0.2s ease;
}

.portal-search-box:focus-within,
.portal-search-box:hover {
    background: rgba(0, 0, 0, 0.45) !important;
    border-color: var(--theme-secondary, #ffc709) !important;
    box-shadow: 0 0 0 2px rgba(255, 199, 9, 0.35);
}

.portal-search-box span {
    color: var(--theme-secondary, #ffc709) !important;
    font-size: 0.76rem;
    margin-right: 6px;
    display: flex;
    align-items: center;
}

.portal-search-box input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
    width: 115px;
    min-height: auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    opacity: 1 !important;
}

.portal-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 0.74rem;
}

.navbar-cal-picker-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
    background: rgba(0, 0, 0, 0.28) !important;
    border: 1.5px solid var(--theme-secondary, #ffc709) !important;
    border-radius: var(--radius-sm, 4px);
    padding: 0 8px;
    height: 28px;
    transition: all 0.2s ease;
}

.navbar-cal-picker-wrap:focus-within,
.navbar-cal-picker-wrap:hover {
    background: rgba(0, 0, 0, 0.45) !important;
    border-color: var(--theme-secondary, #ffc709) !important;
    box-shadow: 0 0 0 2px rgba(255, 199, 9, 0.35);
}

.navbar-cal-picker-wrap label {
    font-size: 0.76rem;
    color: var(--theme-secondary, #ffc709) !important;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin: 0;
}

#navbarDatePicker {
    padding: 0 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    cursor: pointer;
    outline: none !important;
    width: 115px;
    min-height: auto !important;
    color-scheme: dark;
    font-family: inherit;
    box-shadow: none !important;
    border-radius: 0 !important;
    opacity: 1 !important;
}

#navbarDatePicker::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(0.9) !important;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   4b. Continuous Infinite News Ticker Component (Theme-Aware)
   -------------------------------------------------------------------------- */
.news-ticker-bar {
    background: var(--theme-primary-dark, #082856);
    color: #ffffff;
    border-bottom: 2px solid var(--theme-secondary, #ffc709);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 300;
    overflow: hidden;
}

.news-ticker-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    min-height: 28px;
    height: 28px;
}

.ticker-label-badge {
    padding: 0 12px;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 900;
    font-size: 0.70rem;
    letter-spacing: 0.6px;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 3px 0 8px rgba(0, 0, 0, 0.35);
    position: relative;
    flex-shrink: 0;
}

/* Theme-Aware Ticker Label Badge Styles */
.ticker-style-red_pulse .ticker-label-badge {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
}

.ticker-style-gold_glow .ticker-label-badge {
    background: var(--theme-primary, #0b499d);
    color: var(--theme-secondary, #ffc709);
    border-right: 2px solid var(--theme-secondary, #ffc709);
}

.ticker-style-dark_badge .ticker-label-badge {
    background: #1e293b;
    color: #38bdf8;
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.ticker-style-emerald_badge .ticker-label-badge {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #ffffff;
}

.ticker-style-neon_purple .ticker-label-badge {
    background: linear-gradient(135deg, #8e24aa 0%, #4a148c 100%);
    color: #ffffff;
}

.ticker-track-viewport {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    display: flex;
    align-items: center;
    height: 28px;
}

.ticker-track-wrapper {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    animation: marqueeScroll 25s linear infinite;
}

.news-ticker-bar:hover .ticker-track-wrapper {
    animation-play-state: paused;
}

.ticker-item-group {
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-size: 0.76rem;
    font-weight: 600;
    color: #e2e8f0;
}

@keyframes marqueeScroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-50%, 0, 0);
    }
}

/* --------------------------------------------------------------------------
   5. Calendar Widget Popover
   -------------------------------------------------------------------------- */
.calendar-trigger-btn {
    background: var(--theme-secondary);
    color: #000000;
    border: none;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.calendar-picker-popover {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #ffffff;
    width: 290px;
    padding: 14px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    z-index: 1100;
}

.calendar-picker-popover.active {
    display: block;
}

.calendar-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.calendar-month-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--theme-primary);
}

.calendar-nav-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.calendar-weekdays-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cal-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    background: #ffffff;
    cursor: default;
    position: relative;
    user-select: none;
}

.cal-day-cell.empty-cell {
    background: transparent !important;
    border: none !important;
}

.cal-day-cell.published {
    color: var(--text-primary);
    font-weight: 800;
    background: #f1f5f9;
    cursor: pointer;
    border: 1px solid var(--theme-primary, #0b499d);
}

.cal-day-cell.published::after {
    content: '';
    position: absolute;
    bottom: 3px;
    width: 5px;
    height: 5px;
    background: #10b981;
    border-radius: 50%;
}

.cal-day-cell.published:hover {
    background: var(--theme-primary);
    color: #ffffff;
}

.cal-day-cell.selected {
    background: var(--theme-primary);
    color: #ffffff;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cal-day-cell.today-cell {
    outline: 2px solid var(--theme-secondary, #ffc107);
    outline-offset: -2px;
    font-weight: 800;
}

.cal-day-cell.today-cell.selected {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}

.cal-day-cell.disabled {
    opacity: 0.22;
    color: #94a3b8;
    background: #f8fafc;
    cursor: not-allowed !important;
    pointer-events: none !important;
    border: 1px solid transparent;
}

/* --------------------------------------------------------------------------
   6. Homepage Main Grid & Card Covers
   -------------------------------------------------------------------------- */
.main-wrapper {
    max-width: 1240px;
    margin: 14px auto 20px auto;
    padding: 0 14px;
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 20px;
}

.content-column {
    min-width: 0;
}

.section-block {
    margin-bottom: 28px;
}

.section-header-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--theme-primary);
    padding-bottom: 6px;
    margin-bottom: 16px;
}

.section-header-title h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--theme-primary);
    text-transform: uppercase;
}

.epaper-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 24px 16px;
    padding-top: 10px;
}

@media (max-width: 480px) {
    .epaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 14px 10px;
    }
}

.epaper-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: visible;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

.epaper-card:hover {
    border-color: var(--theme-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.epaper-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 0.72;
    background: #0f172a;
    overflow: hidden;
    padding: 0 !important;
    border-radius: calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0 0;
}

.epaper-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    margin: 0;
    padding: 0;
}

.epaper-card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px;
    gap: 8px;
    transition: var(--transition);
}

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

.card-action-btn {
    background: var(--theme-secondary);
    color: #000000;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-align: center;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.epaper-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--theme-primary);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    z-index: 2;
}

/* ==========================================================================
   ePaper Edition Badge Styles & Motion Animations (Admin Configurable)
   ========================================================================== */

/* Card Container Overflow Rules depending on badge style */
.badge-style-ribbon_3d .epaper-card,
.badge-style-diagonal_stitched .epaper-card,
.badge-style-page_curl .epaper-card {
    position: relative !important;
    overflow: hidden !important;
}

.badge-style-pill_overlap .epaper-card {
    position: relative !important;
    overflow: visible !important;
}

.epaper-card-status-badge {
    position: absolute;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 100 !important;
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
}

/* --- LEFT CORNER POSITIONING (badge-pos-left / default) --- */
.badge-pos-left.badge-style-ribbon_3d .epaper-card-status-badge,
.badge-style-ribbon_3d:not(.badge-pos-right) .epaper-card-status-badge {
    top: 18px;
    left: -36px;
    right: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(-45deg);
    padding: 5px 0;
    border-radius: 0;
}

.badge-pos-left.badge-style-diagonal_stitched .epaper-card-status-badge,
.badge-style-diagonal_stitched:not(.badge-pos-right) .epaper-card-status-badge {
    top: 20px;
    left: -35px;
    right: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(-45deg);
    padding: 4px 0;
    border-radius: 0;
}

.badge-pos-left.badge-style-page_curl .epaper-card-status-badge,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge {
    top: 0;
    left: 0;
    right: auto;
    width: 60px;
    height: 60px;
}
.badge-pos-left.badge-style-page_curl .epaper-card-status-badge::before,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge::before {
    top: 0;
    left: 0;
    right: auto;
    border-width: 58px 58px 0 0;
    filter: drop-shadow(3px 4px 6px rgba(0, 0, 0, 0.45));
}
.badge-pos-left.badge-style-page_curl .epaper-card-status-badge::after,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge::after {
    top: 0;
    left: 0;
    right: auto;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}
.badge-pos-left.badge-style-page_curl .epaper-card-status-badge span.badge-text,
.badge-style-page_curl:not(.badge-pos-right) .epaper-card-status-badge span.badge-text {
    top: 13px;
    left: 3px;
    right: auto;
    transform: rotate(-45deg);
}

.badge-pos-left.badge-style-pill_overlap .epaper-card-status-badge,
.badge-style-pill_overlap:not(.badge-pos-right) .epaper-card-status-badge {
    top: -10px;
    left: 10px;
    right: auto;
}

/* --- RIGHT CORNER POSITIONING (badge-pos-right) --- */
.badge-pos-right.badge-style-ribbon_3d .epaper-card-status-badge {
    top: 18px;
    right: -36px;
    left: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(45deg);
    padding: 5px 0;
    border-radius: 0;
}

.badge-pos-right.badge-style-diagonal_stitched .epaper-card-status-badge {
    top: 20px;
    right: -35px;
    left: auto;
    width: 140px;
    text-align: center;
    justify-content: center;
    transform: rotate(45deg);
    padding: 4px 0;
    border-radius: 0;
}

.badge-pos-right.badge-style-page_curl .epaper-card-status-badge {
    top: 0;
    right: 0;
    left: auto;
    width: 60px;
    height: 60px;
}
.badge-pos-right.badge-style-page_curl .epaper-card-status-badge::before {
    top: 0;
    right: 0;
    left: auto;
    border-width: 58px 0 0 58px;
    filter: drop-shadow(-3px 4px 6px rgba(0, 0, 0, 0.45));
}
.badge-pos-right.badge-style-page_curl .epaper-card-status-badge::after {
    top: 0;
    right: 0;
    left: auto;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}
.badge-pos-right.badge-style-page_curl .epaper-card-status-badge span.badge-text {
    top: 13px;
    right: 3px;
    left: auto;
    transform: rotate(45deg);
}

.badge-pos-right.badge-style-pill_overlap .epaper-card-status-badge {
    top: -10px;
    right: 10px;
    left: auto;
}

/* --- Style 1: 3D Corner Ribbon Fold --- */
.badge-style-ribbon_3d .epaper-card-status-badge {
    font-size: 0.60rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.badge-style-ribbon_3d .epaper-card-status-badge::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 6px 0 0;
}
.badge-style-ribbon_3d .epaper-card-status-badge::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 0 6px;
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-today {
    background: linear-gradient(180deg, #10b981 0%, #059669 65%, #047857 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-today::before,
.badge-style-ribbon_3d .epaper-card-status-badge.badge-today::after {
    border-color: #064e3b transparent transparent transparent;
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-latest {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 65%, #0369a1 100%);
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.badge-style-ribbon_3d .epaper-card-status-badge.badge-latest::before,
.badge-style-ribbon_3d .epaper-card-status-badge.badge-latest::after {
    border-color: #075985 transparent transparent transparent;
}

/* --- Style 2: Stitched Diagonal Corner Band --- */
.badge-style-diagonal_stitched .epaper-card-status-badge {
    font-size: 0.60rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.badge-style-diagonal_stitched .epaper-card-status-badge::before,
.badge-style-diagonal_stitched .epaper-card-status-badge::after {
    display: none !important;
}
.badge-style-diagonal_stitched .epaper-card-status-badge.badge-today {
    background: #059669;
    color: #ffffff;
    border-top: 1.5px dashed rgba(255, 255, 255, 0.95);
    border-bottom: 1.5px dashed rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.badge-style-diagonal_stitched .epaper-card-status-badge.badge-latest {
    background: #0284c7;
    color: #ffffff;
    border-top: 1.5px dashed rgba(255, 255, 255, 0.95);
    border-bottom: 1.5px dashed rgba(255, 255, 255, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* --- Style 3: Curled Corner Page Ear Fold --- */
.badge-style-page_curl .epaper-card-status-badge {
    padding: 0;
    display: flex;
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}
.badge-style-page_curl .epaper-card-status-badge::before {
    content: '';
    position: absolute;
    border-style: solid;
}
.badge-style-page_curl .epaper-card-status-badge::after {
    content: '';
    position: absolute;
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.05) 40%, rgba(0, 0, 0, 0.45) 100%);
    pointer-events: none;
}
.badge-style-page_curl .epaper-card-status-badge.badge-today::before {
    border-color: #059669 transparent transparent transparent;
}
.badge-style-page_curl .epaper-card-status-badge.badge-latest::before {
    border-color: #0284c7 transparent transparent transparent;
}
.badge-style-page_curl .epaper-card-status-badge span.badge-text {
    position: absolute;
    font-size: 0.56rem;
    font-weight: 900;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 12;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

/* --- Style 4: Overlapping Floating Pill --- */
.badge-style-pill_overlap .epaper-card-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.badge-style-pill_overlap .epaper-card-status-badge::before,
.badge-style-pill_overlap .epaper-card-status-badge::after {
    display: none !important;
}
.badge-style-pill_overlap .epaper-card-status-badge.badge-today {
    background: linear-gradient(135deg, #059669, #10b981);
    color: #ffffff;
    border: 2px solid #ffffff;
}
.badge-style-pill_overlap .epaper-card-status-badge.badge-latest {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #ffffff;
    border: 2px solid #ffffff;
}

/* ==========================================================================
   Motion Animations
   ========================================================================== */

/* 1. Pulse Glow Keyframe */
@keyframes badgePulseKey {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    }
    50% {
        transform: scale(1.07);
        filter: drop-shadow(0 6px 14px rgba(16, 185, 129, 0.7));
    }
}
.badge-anim-pulse .epaper-card-status-badge {
    animation: badgePulseKey 2.2s infinite ease-in-out;
}

/* 2. Soft Bounce Keyframe */
@keyframes badgeBounceKey {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    60% {
        transform: translateY(-2.5px);
    }
}
.badge-anim-bounce .epaper-card-status-badge {
    animation: badgeBounceKey 2.5s infinite;
}

/* 3. Metallic Shimmer Sweep Keyframe */
@keyframes badgeShineKey {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
.badge-anim-shine .epaper-card-status-badge {
    background-size: 200% 100% !important;
}
.badge-anim-shine .epaper-card-status-badge.badge-today {
    background-image: linear-gradient(110deg, #059669 0%, #10b981 35%, #ffffff 50%, #10b981 65%, #059669 100%) !important;
    animation: badgeShineKey 2.8s infinite linear;
}
.badge-anim-shine .epaper-card-status-badge.badge-latest {
    background-image: linear-gradient(110deg, #0284c7 0%, #38bdf8 35%, #ffffff 50%, #38bdf8 65%, #0284c7 100%) !important;
    animation: badgeShineKey 2.8s infinite linear;
}

/* 4. Static / No Animation */
.badge-anim-none .epaper-card-status-badge {
    animation: none !important;
}


.epaper-card-strip {
    padding: 10px 12px;
    background: var(--bg-surface, #ffffff);
    display: flex;
    flex-direction: column;
    gap: 3px;
    border-radius: 0 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px);
}

/* Sidebar Widgets */
.sidebar-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.sidebar-widget-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--theme-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.sidebar-quick-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary);
}

.sidebar-quick-link:hover {
    background: var(--theme-primary);
    color: #ffffff;
}

/* --------------------------------------------------------------------------
   Newsletter & Daily ePaper Alert Card (Theme-Aware Component)
   -------------------------------------------------------------------------- */
.newsletter-card {
    background: linear-gradient(135deg, var(--theme-primary-dark, #0f172a) 0%, #1e293b 100%);
    color: #ffffff;
    border-radius: var(--radius-md, 8px);
    padding: 20px 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    overflow: hidden;
}

.newsletter-card::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: var(--theme-secondary);
    opacity: 0.12;
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
}

.newsletter-card h4 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--theme-secondary, #ffc107);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.newsletter-card p {
    font-size: 0.78rem;
    color: #cbd5e1;
    line-height: 1.45;
    margin-bottom: 14px;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.newsletter-form input[type="email"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.84rem;
    outline: none;
    transition: var(--transition);
    box-sizing: border-box;
}

.newsletter-form input[type="email"]::placeholder {
    color: #94a3b8;
}

.newsletter-form input[type="email"]:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: var(--theme-secondary, #ffc107);
    box-shadow: 0 0 10px rgba(255, 193, 7, 0.3);
}

.newsletter-form button[type="submit"] {
    width: 100%;
    background: var(--theme-secondary, #ffc107);
    color: #000000;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 10px;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: var(--transition);
}

.newsletter-form button[type="submit"]:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
}

/* --------------------------------------------------------------------------
   7. Reader Viewport & Vertical Thumbnails Column
   -------------------------------------------------------------------------- */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
}

.reader-workspace-area {
    max-width: 1540px;
    margin: 12px auto 36px;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 154px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.reader-thumbs-column {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    position: sticky !important;
    top: 60px !important;
    height: calc(100vh - 75px) !important;
    max-height: calc(100vh - 75px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 6px 6px 20px 2px !important;
    background: #ffffff !important;
    border: 1px solid var(--border-color, #e2e8f0) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05) !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(11, 73, 157, 0.35) #f1f5f9;
}

.reader-thumbs-column::-webkit-scrollbar {
    width: 5px;
}
.reader-thumbs-column::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}
.reader-thumbs-column::-webkit-scrollbar-thumb {
    background: rgba(11, 73, 157, 0.35);
    border-radius: 4px;
}
.reader-thumbs-column::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary, #0b499d);
}

.thumb-card {
    background: #ffffff !important;
    border: 2px solid var(--border-color, #e2e8f0) !important;
    border-radius: 8px !important;
    padding: 0 !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

.thumb-card:hover {
    border-color: var(--theme-primary, #0b499d) !important;
    box-shadow: 0 4px 14px rgba(11, 73, 157, 0.18) !important;
    transform: translateY(-2px) !important;
}

.thumb-card.active {
    border-color: var(--theme-primary, #0b499d) !important;
    box-shadow: 0 0 0 3px rgba(11, 73, 157, 0.25), 0 8px 20px rgba(11, 73, 157, 0.2) !important;
    transform: scale(1.02) !important;
}

.thumb-card img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    display: block !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
}

.thumb-caption {
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    color: var(--text-primary, #0f172a) !important;
    margin: 0 !important;
    padding: 5px 4px !important;
    background: #f8fafc !important;
    border-top: 1px solid var(--border-color, #e2e8f0) !important;
    display: block !important;
    flex-shrink: 0 !important;
    transition: background 0.2s ease, color 0.2s ease !important;
}

.thumb-card.active .thumb-caption {
    background: var(--theme-primary, #0b499d) !important;
    color: #ffffff !important;
}

.reader-canvas-viewport {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.reader-top-control-bar {
    position: sticky;
    top: 0;
    z-index: 900;
    background: var(--theme-primary-dark, #0f172a);
    color: #ffffff;
    padding: 8px 14px;
    border-bottom: 2px solid var(--theme-secondary, #ffc107);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.reader-control-container {
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
}

.reader-left-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.reader-select-page {
    padding: 5px 10px;
    background: var(--theme-primary-dark);
    color: #ffffff;
    border: 1px solid var(--theme-secondary);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
}

.page-numbers-strip {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-wrap: nowrap;
}

.page-num-btn {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.page-num-btn.active,
.page-num-btn:hover {
    background: var(--theme-secondary);
    color: #000000;
    border-color: var(--theme-secondary);
}

.reader-right-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.reader-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none !important;
    white-space: nowrap;
}

.reader-action-btn.btn-pdf {
    background: var(--color-danger);
    color: var(--text-on-primary);
}

.reader-action-btn.btn-clip {
    background: var(--theme-secondary);
    color: #000000;
}

.edition-active-banner {
    background: var(--theme-primary);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 0;
    font-weight: 700;
    font-size: 0.88rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.paper-image-wrapper {
    background: #ffffff;
    padding: 0;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
    overflow: hidden !important;
}

.paper-image-wrapper.clip-mode-active {
    overflow: visible !important;
    contain: none !important;
}

/* Full-screen overlay zoom layer with z-index: 99999 over all top elements */
.paper-image-wrapper.is-zoomed {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: #081120 !important;
    z-index: 99999 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: none !important;
    contain: none !important;
}

body.reader-is-zoomed {
    overflow: hidden !important;
}

.paper-image-wrapper.is-zoomed .btn-float-nav {
    z-index: 100001 !important;
}

.paper-image-wrapper.is-zoomed .flipbook-pages-spread-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    overflow: hidden !important;
}

.paper-image-wrapper.is-zoomed .flipbook-page-wrap {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.paper-image-wrapper.is-zoomed .paper-display-img {
    max-height: 100vh !important;
    max-width: 100vw !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
}


.flipbook-pages-spread-container {
    overflow: hidden !important;
    position: relative;
}

.flipbook-page-wrap {
    transform-origin: center center;
    touch-action: none;
}




.btn-float-nav {
    position: fixed;
    top: 55%;
    transform: translateY(-50%);
    z-index: 850;
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.btn-float-prev {
    left: 16px;
}

.btn-float-next {
    right: 16px;
}

.btn-float-nav:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
    transform: translateY(-50%) scale(1.1);
}

.flipbook-pages-spread-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
    gap: 0;
}

.flipbook-page-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
}

.flipbook-pages-spread-container.flipbook-double-spread .flipbook-page-wrap {
    width: 50% !important;
    max-width: 50% !important;
    flex: 1 1 50% !important;
}

.paper-display-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    display: block;
    margin: 0 auto;
    user-select: none;
    transition: opacity 0.2s ease-out;
}

@keyframes pageTurnSmooth {
    0% {
        opacity: 0.35;
        transform: scale(0.985);
    }
    50% {
        opacity: 0.85;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.page-anim-active {
    animation: pageTurnSmooth 0.28s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* --------------------------------------------------------------------------
   8. Hotspot Overlays & Mouseover Hover Tooltips
   -------------------------------------------------------------------------- */
.hotspot-overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 105;
}

.hotspot-interactive-box {
    position: absolute;
    border-radius: 4px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    z-index: 105;
    box-sizing: border-box;
}

/* 1. Glow Style (Default Recommended) */
.hotspot-interactive-box.style-glow,
.hotspot-interactive-box:not([class*="style-"]) {
    border: 1.5px dashed rgba(37, 99, 235, 0.45);
    background: rgba(37, 99, 235, 0.04);
}

.hotspot-interactive-box.style-glow:hover,
.hotspot-interactive-box.style-glow.is-active,
.hotspot-interactive-box.style-glow.hovered,
.hotspot-interactive-box.style-glow.touch-active,
.hotspot-interactive-box:not([class*="style-"]):hover {
    border: 2.5px solid #2563eb !important;
    background: rgba(37, 99, 235, 0.22) !important;
    box-shadow: 0 0 22px rgba(37, 99, 235, 0.65), inset 0 0 14px rgba(37, 99, 235, 0.25) !important;
    z-index: 130 !important;
}

/* 2. Solid High-Contrast Primary Outline */
.hotspot-interactive-box.style-solid {
    border: 1.5px solid rgba(15, 23, 42, 0.35);
    background: rgba(15, 23, 42, 0.03);
}

.hotspot-interactive-box.style-solid:hover,
.hotspot-interactive-box.style-solid.is-active,
.hotspot-interactive-box.style-solid.hovered,
.hotspot-interactive-box.style-solid.touch-active {
    border: 2.5px solid #0f172a !important;
    background: rgba(15, 23, 42, 0.22) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
    z-index: 130 !important;
}

/* 3. Minimal Subtle Dashed Outline */
.hotspot-interactive-box.style-minimal {
    border: 1px dashed rgba(100, 116, 139, 0.4);
    background: transparent;
}

.hotspot-interactive-box.style-minimal:hover,
.hotspot-interactive-box.style-minimal.is-active,
.hotspot-interactive-box.style-minimal.hovered,
.hotspot-interactive-box.style-minimal.touch-active {
    border: 2px dashed #0284c7 !important;
    background: rgba(2, 132, 199, 0.16) !important;
    box-shadow: 0 0 14px rgba(2, 132, 199, 0.35) !important;
    z-index: 130 !important;
}

/* 4. Semi-Transparent Highlight Tint */
.hotspot-interactive-box.style-tint {
    border: 1.5px solid rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.06);
}

.hotspot-interactive-box.style-tint:hover,
.hotspot-interactive-box.style-tint.is-active,
.hotspot-interactive-box.style-tint.hovered,
.hotspot-interactive-box.style-tint.touch-active {
    border: 2.5px solid #f59e0b !important;
    background: rgba(245, 158, 11, 0.26) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.6), inset 0 0 12px rgba(245, 158, 11, 0.25) !important;
    z-index: 130 !important;
}

/* Universal Page-Load Welcoming Glimmer */
@keyframes hotspotIntroFlash {
    0% { opacity: 0.2; transform: scale(0.98); }
    50% { opacity: 1; border-color: #2563eb; background: rgba(37, 99, 235, 0.18); box-shadow: 0 0 16px rgba(37, 99, 235, 0.5); }
    100% { opacity: 1; transform: scale(1); }
}

.hotspot-interactive-box.intro-flash {
    animation: hotspotIntroFlash 0.8s ease-out;
}

.hotspot-title-tag {
    position: absolute;
    top: -26px;
    left: 2px;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffc107;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    border: 1px solid rgba(255, 193, 7, 0.45);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    opacity: 0;
    transform: translateY(4px);
    z-index: 140;
}

.hotspot-interactive-box:hover .hotspot-title-tag,
.hotspot-interactive-box.is-active .hotspot-title-tag,
.hotspot-interactive-box.hovered .hotspot-title-tag,
.hotspot-interactive-box.touch-active .hotspot-title-tag {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.public-clip-hover-tooltip {
    position: fixed;
    z-index: 999999 !important;
    background: rgba(15, 23, 42, 0.96);
    color: #ffffff;
    padding: 9px 14px;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 0 1.5px rgba(255, 193, 7, 0.45);
    font-size: 0.8rem;
    pointer-events: none !important;
    display: none;
    flex-direction: column;
    gap: 4px;
    max-width: 320px;
    backdrop-filter: blur(8px);
    animation: fadeInTooltip 0.15s ease-out;
}

.public-clip-hover-tooltip .tooltip-title {
    font-weight: 800;
    color: #ffc107;
    font-size: 0.84rem;
    line-height: 1.25;
}

.public-clip-hover-tooltip .tooltip-hint {
    font-size: 0.72rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 5px;
}

.public-clip-hover-tooltip .tooltip-hint {
    font-size: 0.7rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 4px;
}

@keyframes fadeInTooltip {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Clip Mode Visual Styles === */
.paper-image-wrapper.clip-mode-active {
    cursor: crosshair !important;
    overflow: visible !important; /* Allow marquee box to extend beyond padding */
}

.paper-image-wrapper.clip-mode-active .paper-display-img {
    cursor: crosshair !important;
}

.clip-mode-indicator {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 130;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #000;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 5px 16px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(255, 193, 7, 0.5);
    animation: clipIndicatorPulse 2s ease-in-out infinite;
    pointer-events: none;
}

.clip-mode-indicator.active {
    display: inline-flex;
}

@keyframes clipIndicatorPulse {
    0%, 100% { box-shadow: 0 4px 14px rgba(255, 193, 7, 0.5); }
    50% { box-shadow: 0 4px 22px rgba(255, 193, 7, 0.85); }
}

@keyframes marchingAnts {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 16; }
}

#publicClipMarqueeBox {
    position: absolute;
    border: 2px dashed #ffc107 !important;
    background: rgba(255, 193, 7, 0.15) !important;
    box-shadow: 0 0 0 1px rgba(8, 40, 86, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    pointer-events: none;
    z-index: 120;
    display: none;
}

.public-clip-action-bar {
    display: none;
    position: absolute;
    z-index: 125;
    gap: 4px;
    padding: 3px 6px;
    background: rgba(15, 23, 42, 0.95);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 193, 7, 0.4);
    backdrop-filter: blur(8px);
    max-width: calc(100vw - 24px);
    white-space: nowrap;
    align-items: center;
}

.clip-act-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    color: #ffffff;
    min-height: 22px;
}

.clip-act-btn.btn-act-download {
    background: #dc2626;
}

.clip-act-btn.btn-act-share {
    background: #0284c7;
}

.clip-act-btn.btn-act-save {
    background: #059669;
}

.clip-act-btn.btn-act-cancel {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 7px;
}

.clip-act-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

@media (max-width: 650px) {
    .public-clip-action-bar {
        padding: 3px 5px;
        gap: 3px;
        border-radius: 6px;
    }

    .clip-act-btn {
        min-height: 22px;
        padding: 3px 6px !important;
        font-size: 0.70rem;
    }
}


/* Floating Navigation Arrows */
.btn-float-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.btn-float-nav:hover {
    background: var(--theme-secondary);
    color: #000000;
}

.btn-float-prev { left: 8px; }
.btn-float-next { right: 8px; }

/* --------------------------------------------------------------------------
   8b. 3D Flipbook Magazine Reader View Mode
   -------------------------------------------------------------------------- */
.paper-display-img {
    width: 100%;
    height: auto;
    display: block;
    user-select: none;
    background-color: #ffffff !important;
    image-rendering: auto !important;
}

.clip-canvas-box img,
#mergedClipCanvas {
    image-rendering: auto !important;
}

/* --------------------------------------------------------------------------
   8b. 3D Flipbook Magazine Reader View Mode
   -------------------------------------------------------------------------- */
.paper-image-wrapper.has-double-spread {
    max-width: 1240px !important;
}

.flipbook-pages-spread-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    margin: 0 auto;
    background-color: #ffffff !important;
    perspective: 1400px;
    transform-style: preserve-3d;
}

.flipbook-pages-spread-container.flipbook-double-spread.flip-anim-next {
    animation: flipNextSmooth 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.flipbook-pages-spread-container.flipbook-double-spread.flip-anim-prev {
    animation: flipPrevSmooth 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes flipNextSmooth {
    0% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    45% {
        transform: perspective(1400px) rotateY(-14deg) scale(0.985);
        box-shadow: -22px 15px 42px rgba(0, 0, 0, 0.35);
    }
    100% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

@keyframes flipPrevSmooth {
    0% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
    45% {
        transform: perspective(1400px) rotateY(14deg) scale(0.985);
        box-shadow: 22px 15px 42px rgba(0, 0, 0, 0.35);
    }
    100% {
        transform: perspective(1400px) rotateY(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    }
}

.flipbook-pages-spread-container.flipbook-double-spread {
    gap: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #ffffff !important;
    border-radius: 4px;
    overflow: hidden;
}

.flipbook-double-spread .flipbook-page-left {
    width: 50% !important;
    max-width: 50% !important;
    background-color: #ffffff !important;
    border-right: 1px solid #cbd5e1;
    box-shadow: inset -10px 0 15px -8px rgba(0, 0, 0, 0.1);
}

.flipbook-double-spread .flipbook-page-right {
    width: 50% !important;
    max-width: 50% !important;
    display: block !important;
    background-color: #ffffff !important;
    border-left: 1px solid #cbd5e1;
    box-shadow: inset 10px 0 15px -8px rgba(0, 0, 0, 0.1);
}

.flipbook-mode-btn {
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.flipbook-mode-btn.active,
.flipbook-mode-btn:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
}

/* --------------------------------------------------------------------------
   9. Crop Modal & Social Sharing Box
   -------------------------------------------------------------------------- */
.crop-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.crop-modal-backdrop.active {
    display: flex;
}

.crop-modal-box {
    background: #ffffff;
    border-radius: 12px;
    max-width: 820px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    border: 2px solid var(--theme-primary, #0f172a);
}

.crop-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--theme-primary-dark, #0f172a), #1e293b);
    color: #ffffff;
}

.crop-modal-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 800;
    color: #ffc107;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.crop-modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.crop-modal-close:hover {
    background: rgba(239, 68, 68, 0.8);
}

.crop-preview-body {
    text-align: center;
    max-height: 55vh;
    overflow-y: auto;
    background: #fdfbf7;
    padding: 14px;
    border-bottom: 2px solid var(--theme-primary, #0f172a);
}

.crop-preview-body canvas {
    max-width: 100%;
    height: auto !important;
    display: block;
    margin: 0 auto;
    border: 3px solid #ffc107;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    background: #ffffff;
}

.crop-modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
}

.crop-social-strip,
.crop-actions-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crop-modal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    box-sizing: border-box;
}

.crop-social-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    margin: 0 auto;
    flex-wrap: wrap;
}

.crop-share-heading {
    display: none !important;
}

.crop-share-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 1.15rem !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22) !important;
    flex-shrink: 0 !important;
}

.crop-share-btn i {
    font-size: 1.15rem !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.crop-btn-text {
    display: none !important;
}

.btn-share-wa { background: #25D366 !important; }
.btn-share-insta { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%) !important; }
.btn-share-fb { background: #1877F2 !important; }
.btn-share-tw { background: #000000 !important; border: 1px solid rgba(255,255,255,0.25) !important; }
.btn-share-tg { background: #229ED9 !important; }
.btn-share-copy { background: #475569 !important; }

.crop-share-btn:hover {
    transform: translateY(-2px) scale(1.1) !important;
    filter: brightness(1.15) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35) !important;
}

.crop-actions-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 2px;
}

.crop-action-btn.btn-crop-download {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 24px !important;
    min-width: 180px;
    background: #16a34a !important;
    color: #ffffff !important;
    font-size: 0.92rem !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35) !important;
    transition: all 0.2s ease !important;
}
.crop-action-btn.btn-crop-download:hover {
    background: #15803d !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.45) !important;
}
.crop-action-btn .crop-btn-text {
    display: inline !important;
}

/* Prevent multiple conflicting hover text overlays on clipped articles */
.hotspot-title-tag {
    display: none !important;
}

@media (max-width: 600px) {
    .crop-modal-box {
        max-width: 96vw;
        border-radius: 12px;
    }
    .crop-modal-header {
        padding: 10px 14px;
    }
    .crop-modal-title {
        font-size: 0.88rem;
    }
    .crop-preview-body {
        max-height: 52vh;
        padding: 8px;
    }
    .crop-modal-footer {
        padding: 12px 14px;
        gap: 12px;
    }
    .crop-social-strip {
        gap: 12px;
    }
    .crop-share-btn {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        font-size: 1.1rem !important;
    }
    .crop-action-btn.btn-crop-download {
        width: 100% !important;
        max-width: 260px;
    }
}

/* --------------------------------------------------------------------------
   10. Mobile Fixed Bottom Toolbar
   -------------------------------------------------------------------------- */
.mobile-sticky-bottom-toolbar {
    display: none !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--theme-primary-dark, #0b2545);
    padding: 8px 12px;
    z-index: 1050;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}

.mobile-tb-btn {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    text-decoration: none !important;
    cursor: pointer;
}

.mobile-tb-btn.btn-pdf-mobile {
    background: var(--color-danger);
    color: var(--text-on-primary);
    border: none;
}

.mobile-tb-btn.btn-clip-mobile {
    background: var(--theme-secondary);
    color: #000000;
    border: none;
}

.mobile-tb-btn.btn-cal-mobile {
    background: var(--color-info);
    color: var(--text-on-primary);
    border: none;
}

.mobile-tb-select {
    background: var(--theme-primary-dark);
    color: #ffffff;
    border: 1px solid var(--theme-secondary);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    outline: none;
}

/* --------------------------------------------------------------------------
   11. Public Footer
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   11. Public Footer (Theme-Aware & Responsive)
   -------------------------------------------------------------------------- */
.site-footer {
    background: var(--theme-primary-dark, #0b2545);
    color: #cbd5e1;
    padding: 16px 0 10px 0;
    border-top: 2px solid var(--theme-secondary, #ffc107);
    margin-top: 20px;
}

.site-footer-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 14px;
}

.mobile-footer-content {
    display: none;
}

.desktop-footer-content {
    display: block;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 16px;
    margin-bottom: 12px;
}

.footer-col h4 {
    color: #ffffff;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.footer-col p {
    font-size: 0.78rem;
    line-height: 1.45;
}

.site-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   12. Comprehensive Responsive Media Queries
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .main-wrapper {
        grid-template-columns: 1fr;
    }
    
    .reader-workspace-area {
        grid-template-columns: 1fr !important;
        padding: 4px 8px !important;
        margin: 6px auto !important;
        gap: 0 !important;
    }

    .reader-thumbs-column {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        pointer-events: none !important;
    }
    
    .site-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 991px) {
    .mobile-nav-toggle {
        display: inline-flex !important;
    }
    
    .portal-nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--theme-primary-dark, #082856) !important;
        padding: 12px 16px;
        z-index: 2500;
        box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6);
        border-bottom: 3px solid var(--theme-secondary, #ffc709);
        gap: 6px !important;
    }
    
    .portal-nav-menu.active,
    .portal-nav-menu.mobile-open {
        display: flex !important;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .portal-nav-menu > li {
        width: 100% !important;
    }

    .portal-nav-menu > li > a,
    .portal-nav-menu > li > .dropdown-trigger-link {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 14px !important;
        border-radius: 6px !important;
        background: rgba(255, 255, 255, 0.05);
        color: #ffffff !important;
    }

    .portal-nav-menu .dropdown-submenu {
        display: none !important;
        position: static !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        background: rgba(0, 0, 0, 0.25) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-left: 3px solid var(--theme-secondary, #ffc709) !important;
        border-radius: 6px !important;
        margin: 4px 0 8px 0 !important;
        padding: 4px 0 !important;
    }

    .nav-dropdown-item.expanded > .dropdown-submenu {
        display: block !important;
        animation: slideDownMenu 0.2s ease-out;
    }

    .nav-dropdown-item .dropdown-trigger-link i.fa-chevron-down {
        transition: transform 0.25s ease;
        margin-left: auto;
    }

    .nav-dropdown-item.expanded .dropdown-trigger-link i.fa-chevron-down {
        transform: rotate(180deg);
        color: var(--theme-secondary, #ffc709) !important;
    }
    
    .portal-search-box input {
        width: 90px;
    }

    .site-logo-img {
        max-width: 100%;
        height: auto;
        object-fit: contain;
    }

    .logo-text-title {
        font-size: 1.2rem;
    }

    .reader-top-control-bar {
        display: none !important;
    }

    .mobile-sticky-bottom-toolbar {
        display: flex !important;
    }

    body {
        padding-bottom: 65px;
    }

    /* Mobile News Ticker Responsiveness */
    .news-ticker-container {
        min-height: 34px;
    }

    .ticker-label-badge {
        height: 34px;
        padding: 0 10px;
        font-size: 0.72rem;
        letter-spacing: 0.4px;
    }

    .ticker-track-viewport {
        height: 34px;
    }

    .ticker-item-group {
        font-size: 0.78rem;
    }

    /* Ultra-Compact & Tight Mobile Footer Layout */
    .site-footer {
        padding: 10px 0 8px 0 !important;
        margin-top: 12px !important;
        border-top-width: 2px !important;
    }

    .desktop-footer-content {
        display: none !important;
    }

    .mobile-footer-content {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 4px !important;
        padding: 2px 10px 0 10px !important;
    }

    .mobile-footer-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 2px 8px;
        font-size: 0.74rem;
    }

    .mobile-footer-links a {
        color: #e2e8f0;
        text-decoration: none;
        font-weight: 600;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        transition: var(--transition);
    }

    .mobile-footer-links a:hover {
        color: var(--theme-secondary, #ffc107);
    }

    .mobile-footer-links .mob-sep {
        color: rgba(255, 255, 255, 0.3);
        font-size: 0.7rem;
    }

    .mobile-footer-bottom-row {
        font-size: 0.72rem;
        color: #94a3b8;
        text-align: center;
        line-height: 1.25;
        margin-top: 1px;
    }

    .mob-credit-link {
        color: var(--theme-secondary, #ffc107) !important;
        font-weight: 800;
        text-decoration: none;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
    }
}

/* --- Highlighted Developer & Agency Attribution Badges --- */
.footer-dev-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f1f5f9;
    text-decoration: none;
    font-size: 0.78rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.footer-dev-badge:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--theme-secondary, #ffc107);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.footer-dev-badge .dev-highlight {
    color: var(--theme-secondary, #ffc709);
    font-weight: 800;
    text-decoration: none;
}
.footer-dev-badge .dev-contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(16, 185, 129, 0.25);
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.footer-dev-badge .dev-contact-pill:hover {
    background: #059669;
    color: #ffffff;
    border-color: #10b981;
}
.footer-dev-badge .dev-email-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.25);
    border: 1px solid rgba(59, 130, 246, 0.5);
    color: #60a5fa;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.footer-dev-badge .dev-email-pill:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #3b82f6;
}
.footer-dev-badge .dev-whatsapp-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(37, 211, 102, 0.25);
    border: 1px solid rgba(37, 211, 102, 0.5);
    color: #4ade80;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 800;
    text-decoration: none;
    transition: all 0.2s;
}
.footer-dev-badge .dev-whatsapp-pill:hover {
    background: #16a34a;
    color: #ffffff;
    border-color: #22c55e;
}

.mob-dev-badge-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 3px;
    font-size: 0.72rem;
}
.mob-dev-badge-wrap a {
    color: var(--theme-secondary, #ffc107) !important;
    font-weight: 800;
    text-decoration: none;
}
.mob-dev-badge-wrap .mob-phone-tag {
    color: #34d399 !important;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.mob-dev-badge-wrap .mob-email-tag {
    color: #60a5fa !important;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.mob-dev-badge-wrap .mob-whatsapp-tag {
    color: #4ade80 !important;
    font-weight: 800;
    background: rgba(37, 211, 102, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

@media (max-width: 480px) {
    .epaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .site-footer-grid {
        grid-template-columns: 1fr;
    }

    .crop-modal-box {
        padding: 12px;
    }

    .ticker-label-badge {
        padding: 0 7px;
        font-size: 0.68rem;
    }

    .ticker-label-badge i {
        font-size: 0.7rem;
    }

    .news-ticker-bar {
        border-bottom-width: 1.5px;
    }

    .portal-search-box input {
        width: 75px;
        font-size: 0.75rem;
    }
}

/* --- Clean Flipbook View Mode Toggle Buttons --- */
.flipbook-mode-btn {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.flipbook-mode-btn.active,
.flipbook-mode-btn:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
    border-color: var(--theme-secondary, #ffc107);
}

/* --------------------------------------------------------------------------
   Interactive Cropper Marquee Resizing & Repositioning Handles
   -------------------------------------------------------------------------- */
#publicClipMarqueeBox {
    cursor: move;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
    user-select: none;
    touch-action: none;
    pointer-events: auto;
}

.crop-resize-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border: 2px solid #2563eb;
    border-radius: 50%;
    z-index: 150;
    box-shadow: 0 2px 6px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.8) inset;
    touch-action: none;
    pointer-events: auto;
    cursor: pointer;
    box-sizing: border-box;
    transition: transform 0.12s ease, background-color 0.12s ease;
}

.crop-resize-handle:hover {
    border-color: #b45309;
    background: #fbbf24;
    transform: scale(1.2);
}

/* 28px Touch Target for Mobile Fingers */
.crop-resize-handle::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    touch-action: none;
    cursor: pointer;
}

.crop-resize-handle.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.crop-resize-handle.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.crop-resize-handle.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.crop-resize-handle.se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.crop-resize-handle.n  { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.crop-resize-handle.s  { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.crop-resize-handle.e  { right: -6px; top: calc(50% - 6px); cursor: ew-resize; }
.crop-resize-handle.w  { left: -6px; top: calc(50% - 6px); cursor: ew-resize; }

@media (max-width: 768px) {
    .crop-resize-handle {
        width: 14px;
        height: 14px;
        border-width: 2px;
    }
    .crop-resize-handle.nw { top: -7px; left: -7px; }
    .crop-resize-handle.ne { top: -7px; right: -7px; }
    .crop-resize-handle.sw { bottom: -7px; left: -7px; }
    .crop-resize-handle.se { bottom: -7px; right: -7px; }
    .crop-resize-handle.n  { top: -7px; left: calc(50% - 7px); width: 14px; height: 14px; }
    .crop-resize-handle.s  { bottom: -7px; left: calc(50% - 7px); width: 14px; height: 14px; }
    .crop-resize-handle.e  { right: -7px; top: calc(50% - 7px); width: 14px; height: 14px; }
    .crop-resize-handle.w  { left: -7px; top: calc(50% - 7px); width: 14px; height: 14px; }
}

/* --------------------------------------------------------------------------
   Fixed-Bottom Daily News Alert Floating Component
   -------------------------------------------------------------------------- */
.newsletter-card.floating-bottom-alert {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    max-width: calc(100vw - 32px);
    z-index: 1050;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--theme-secondary, #ffc107);
    border-radius: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.newsletter-card.floating-bottom-alert.minimized {
    transform: translateY(calc(100% - 48px));
}

.alert-toggle-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.alert-toggle-btn:hover {
    background: var(--theme-secondary, #ffc107);
    color: #000000;
}

@media (max-width: 768px) {
    .newsletter-card.floating-bottom-alert {
        bottom: 68px;
        right: 14px;
        left: 14px;
        width: auto;
        max-width: none;
    }
}

/* --------------------------------------------------------------------------
   Mobile Navbar Share Edition Button
   -------------------------------------------------------------------------- */
.mobile-share-btn {
    display: none;
    align-items: center;
    gap: 5px;
    background: #25d366;
    color: #ffffff !important;
    font-weight: 800;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.4);
    margin-left: auto;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .calendar-trigger-btn {
        display: none !important;
    }
    .portal-navbar-container {
        display: flex;
        align-items: center;
        gap: 12px !important;
    }
    .portal-navbar-actions {
        gap: 10px !important;
    }
    .mobile-share-btn {
        display: inline-flex;
        margin-left: auto;
        padding: 7px 14px;
        gap: 6px;
    }
    .calendar-picker-popover {
        position: fixed !important;
        top: 52px !important;
        bottom: auto !important;
        right: 8px !important;
        left: auto !important;
        transform: none !important;
        width: 255px !important;
        max-width: calc(100vw - 16px) !important;
        padding: 8px 10px !important;
        border-radius: 10px !important;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.5) !important;
        z-index: 999999 !important;
    }
    .calendar-picker-popover #calEditionSelect {
        padding: 4px 6px !important;
        font-size: 0.72rem !important;
        margin-bottom: 4px !important;
    }
    .calendar-picker-popover .calendar-nav-header {
        margin-bottom: 4px !important;
        padding-bottom: 4px !important;
    }
    .calendar-picker-popover .calendar-month-title {
        font-size: 0.8rem !important;
    }
    .calendar-picker-popover .calendar-nav-btn {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.7rem !important;
    }
    .calendar-picker-popover .calendar-weekdays-grid {
        font-size: 0.65rem !important;
        margin-bottom: 4px !important;
    }
    .calendar-picker-popover .cal-day-cell {
        font-size: 0.72rem !important;
    }
    /* --- Mobile navbar: one clean row that never overflows --- */
    .portal-navbar-container {
        flex-wrap: nowrap;
        gap: 8px !important;
        padding: 6px 10px;
        min-height: 44px;
    }
    .mobile-nav-toggle {
        flex-shrink: 0;
        min-height: 32px;
        padding: 5px 10px;
    }
    .portal-navbar-actions {
        flex: 1 1 auto;
        min-width: 0;
        gap: 8px !important;
    }
    .portal-search-box {
        flex: 1 1 auto;
        min-width: 0;
        height: 32px;
    }
    .portal-search-box input {
        width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto;
    }
    .navbar-cal-picker-wrap {
        flex-shrink: 0;
        width: 30px;
        height: 30px;
        padding: 0;
        justify-content: center;
    }
    #navbarDatePicker {
        width: 0 !important;
        min-width: 0 !important;
        opacity: 0;
        position: absolute;
        pointer-events: none;
    }
    .mobile-share-btn {
        padding: 7px 10px;
        font-size: 0.74rem;
        gap: 5px;
    }
    body {
        overflow-x: hidden;
    }
}

/* ========================================================================
   ePaper Modern UI/UX Refresh v3
   Safe override layer: preserves existing CMS selectors and data contracts.
   ======================================================================== */
:root {
    --ui-bg: #f4f7fb;
    --ui-surface: rgba(255,255,255,.96);
    --ui-ink: #102033;
    --ui-muted: #64748b;
    --ui-line: #e2e8f0;
    --ui-primary: #155eef;
    --ui-primary-2: #0b4aa5;
    --ui-radius: 18px;
    --ui-shadow: 0 12px 35px rgba(15,23,42,.08);
    --ui-shadow-hover: 0 20px 48px rgba(15,23,42,.14);
}
body { background: radial-gradient(circle at 15% 0%, rgba(21,94,239,.07), transparent 30%), var(--ui-bg); color: var(--ui-ink); }
.main-wrapper { max-width: 1440px !important; grid-template-columns: minmax(0,1fr) 310px !important; gap: 26px !important; padding: 24px 20px 48px !important; }
.section-block { margin-bottom: 28px !important; }
.section-header-title { padding: 0 2px 12px !important; margin-bottom: 14px !important; border-bottom: 1px solid var(--ui-line); }
.section-header-title h2 { font-size: clamp(1.15rem,2vw,1.55rem) !important; letter-spacing: -.02em; }
/* ==========================================================================
   ePaper Responsive Grid Matrix & Card Layout
   ========================================================================== */
.epaper-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
    gap: 20px !important;
    width: 100% !important;
}

@media (min-width: 1280px) {
    .epaper-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 22px !important;
    }
}

@media (min-width: 992px) and (max-width: 1279px) {
    .epaper-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px !important;
    }
}

@media (min-width: 600px) and (max-width: 991px) {
    .epaper-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

@media (max-width: 599px) {
    .epaper-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

@media (max-width: 359px) {
    .epaper-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

.epaper-card {
    position: relative !important;
    background: var(--ui-surface, #ffffff) !important;
    border: 1px solid var(--ui-line, #e2e8f0) !important;
    border-radius: 8px !important;
    box-shadow: var(--ui-shadow, 0 4px 14px rgba(15,23,42,.06)) !important;
    overflow: hidden !important;
    transform: translateZ(0);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease !important;
    display: flex !important;
    flex-direction: column !important;
}
.epaper-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--ui-shadow-hover, 0 12px 30px rgba(15,23,42,.12)) !important;
    border-color: #bfd2f8 !important;
}
.epaper-card-cover {
    position: relative !important;
    aspect-ratio: 3 / 4 !important;
    background: #eaf0f8 !important;
    overflow: hidden !important;
    border-radius: 7px 7px 0 0 !important;
    display: block !important;
    width: 100% !important;
}
.epaper-card-cover img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform .35s ease !important;
}
.epaper-card:hover .epaper-card-cover img {
    transform: scale(1.025);
}
.epaper-card-strip {
    min-height: 68px;
    padding: 10px 12px !important;
    background: #ffffff !important;
}
.epaper-card-badge {
    position: absolute !important;
    bottom: 8px !important;
    right: 8px !important;
    top: auto !important;
    left: auto !important;
    background: rgba(15, 23, 42, 0.85) !important;
    color: #ffffff !important;
    font-size: 0.68rem !important;
    font-weight: 800 !important;
    padding: 2px 7px !important;
    border-radius: 4px !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
    letter-spacing: 0.3px !important;
}
.sidebar-widget {
    border-radius: 8px !important;
    box-shadow: var(--ui-shadow) !important;
    border-color: var(--ui-line) !important;
}

/* Reader: desktop-first, high-clarity stage with always-visible vertical thumbs. */
.reader-workspace-area { max-width: 1540px !important; grid-template-columns: 154px minmax(0,1fr) !important; gap: 16px !important; margin: 14px auto 40px !important; padding: 0 16px !important; }
.reader-thumbs-column { position: sticky !important; top: 60px !important; height: calc(100vh - 75px) !important; max-height: calc(100vh - 75px) !important; overflow-y: auto !important; overflow-x: hidden !important; padding: 6px 6px 20px 2px !important; scrollbar-width: thin; background: #fff !important; border: 1px solid #e2e8f0 !important; border-radius: 4px !important; box-shadow: 0 4px 16px rgba(15,23,42,.05) !important; }
.thumb-card { width: 100% !important; min-height: 0 !important; flex: 0 0 auto !important; background: #fff !important; border: 2px solid #e2e8f0 !important; border-radius: 3px !important; overflow: hidden !important; box-shadow: 0 2px 6px rgba(15,23,42,.04); transition: all .2s cubic-bezier(.16,1,.3,1) !important; }
.thumb-card:hover { transform: translateY(-2px) !important; border-color: var(--theme-primary, #0b499d) !important; box-shadow: 0 4px 14px rgba(11,73,157,.18) !important; }
.thumb-card.active { border-color: var(--theme-primary, #0b499d) !important; box-shadow: 0 0 0 3px rgba(11,73,157,.25), 0 8px 20px rgba(11,73,157,.2) !important; transform: scale(1.02) !important; }
.thumb-card-img { width: 100% !important; height: auto !important; display: block !important; object-fit: contain !important; border-radius: 2px !important; }
.reader-stage-column { min-width: 0; }
.thumb-caption { font-size: .72rem !important; font-weight: 800 !important; padding: 5px 4px !important; background: #f8fafc !important; color: #0f172a !important; border-top: 1px solid #e2e8f0 !important; }
.thumb-card.active .thumb-caption { background: var(--theme-primary, #0b499d) !important; color: #fff !important; }
.reader-canvas-viewport { min-width: 0 !important; touch-action: pan-y !important; -webkit-overflow-scrolling: touch !important; }
.reader-stage-column { min-width: 0; touch-action: pan-y !important; }
.reader-top-control-bar { max-width: 1400px !important; border-radius: 6px !important; margin-bottom: 12px !important; background: rgba(10,24,45,.97) !important; box-shadow: 0 10px 30px rgba(15,23,42,.18) !important; }
.paper-image-wrapper { max-width: 1400px !important; padding: 8px !important; border-radius: 4px !important; background: #dce3ec !important; border: 1px solid #cbd5e1 !important; box-shadow: 0 18px 50px rgba(15,23,42,.16) !important; overflow: hidden !important; touch-action: pan-y !important; -webkit-overflow-scrolling: touch !important; }
.paper-image-wrapper.clip-mode-active { overflow: visible !important; contain: none !important; }
.flipbook-pages-spread-container { background: #fff !important; min-height: 300px; overflow: hidden !important; touch-action: pan-y !important; }
.paper-display-img { width: 100% !important; max-width: none !important; height: auto !important; image-rendering: auto !important; object-fit: contain !important; background: #fff !important; touch-action: pan-y !important; -webkit-overflow-scrolling: touch !important; }

/* Hotspots pointer handling for smooth touch scrolling */
#hotspotOverlayLayer { pointer-events: none !important; touch-action: pan-y !important; }
.hotspot-interactive-box { pointer-events: auto !important; touch-action: pan-y !important; }

/* Hide thumbnails completely on mobile/touch screens to prioritize swipe gestures and reading area */
@media (max-width: 1050px) {
  .reader-workspace-area { grid-template-columns: 1fr !important; padding: 4px 8px !important; margin: 6px auto !important; gap: 0 !important; }
  .reader-thumbs-column { display: none !important; visibility: hidden !important; height: 0 !important; padding: 0 !important; margin: 0 !important; border: none !important; box-shadow: none !important; pointer-events: none !important; }
}
@media (max-width: 700px) {
  .main-wrapper { display: block !important; padding: 14px 12px 32px !important; }
  .sidebar-column { margin-top: 20px; }
  .reader-workspace-area { padding: 0 8px !important; margin-top: 8px !important; }
  .reader-top-control-bar { border-radius: 12px !important; padding: 7px !important; }
  .reader-control-container { flex-wrap: wrap !important; }
  .reader-right-actions { margin-left: auto; }
  .paper-image-wrapper { padding: 4px !important; border-radius: 10px !important; }
  .btn-float-nav { width: 38px !important; height: 38px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* ========================================================================
   Universal High-Contrast Theme-Aware Button System (No Invisible White Buttons)
   ======================================================================== */
.btn:not(.btn-preset):not(.btn-reset-defaults):not(.btn-outline):not(.btn-light):not(.btn-tb-ghost):not(.btn-secondary):not(.btn-warning):not(.btn-accent), 
.btn-admin:not(.btn-preset):not(.btn-reset-defaults):not(.btn-outline):not(.btn-light):not(.btn-tb-ghost):not(.btn-secondary):not(.btn-warning):not(.btn-accent),
.btn-primary,
.btn-submit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    background: var(--theme-primary, #0b499d) !important;
    color: #ffffff !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15) !important;
}
.btn:not(.btn-preset):not(.btn-reset-defaults):not(.btn-outline):not(.btn-light):not(.btn-tb-ghost):not(.btn-secondary):not(.btn-warning):not(.btn-accent):hover, 
.btn-admin:not(.btn-preset):not(.btn-reset-defaults):not(.btn-outline):not(.btn-light):not(.btn-tb-ghost):not(.btn-secondary):not(.btn-warning):not(.btn-accent):hover,
.btn-primary:hover {
    background: var(--theme-primary-dark, #082856) !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}

/* Time Presets Buttons (Crisp Sky Blue Outline with Visible Dark Blue Text) */
.btn-preset {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1.5px solid #0284c7 !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 1px 3px rgba(2, 132, 199, 0.15) !important;
    transition: all 0.15s ease !important;
}
.btn-preset:hover {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3) !important;
}

/* Reset / Restore System Defaults Button */
.btn-reset-defaults {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1.5px solid #f87171 !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.15) !important;
    transition: all 0.15s ease !important;
}
.btn-reset-defaults:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3) !important;
}

/* Secondary & Accent Buttons (Theme Gold/Yellow) */
.btn-secondary,
.btn-admin.btn-secondary,
.btn-accent,
.mobile-nav-toggle,
.reader-action-btn.btn-clip {
    background: var(--theme-secondary, #ffc709) !important;
    color: #000000 !important;
    font-weight: 800 !important;
    border: none !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}
.btn-secondary:hover,
.btn-admin.btn-secondary:hover,
.mobile-nav-toggle:hover,
.reader-action-btn.btn-clip:hover {
    background: var(--theme-secondary-hover, #e6b308) !important;
    color: #000000 !important;
    transform: translateY(-1px) !important;
}

/* Success Buttons (Save / Confirm) */
.btn-success,
.btn-admin.btn-success,
.btn-save,
.btn-crop-download {
    background: #16a34a !important;
    color: #ffffff !important;
    border: none !important;
}
.btn-success:hover,
.btn-admin.btn-success:hover,
.btn-save:hover,
.btn-crop-download:hover {
    background: #15803d !important;
    color: #ffffff !important;
}

/* Danger Buttons (Delete / Close / PDF) */
.btn-danger,
.btn-admin.btn-danger,
.btn-delete,
.reader-action-btn.btn-pdf {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: none !important;
}
.btn-danger:hover,
.btn-admin.btn-danger:hover,
.btn-delete:hover,
.reader-action-btn.btn-pdf:hover {
    background: #b91c1c !important;
    color: #ffffff !important;
}

/* Outline / Light / Ghost Buttons */
.btn-outline,
.btn-tb-ghost,
.btn-light,
.btn-reset {
    background: #ffffff !important;
    color: var(--theme-primary, #0b499d) !important;
    border: 1.5px solid var(--theme-primary, #0b499d) !important;
    font-weight: 700 !important;
}
.btn-outline:hover,
.btn-tb-ghost:hover,
.btn-light:hover,
.btn-reset:hover {
    background: var(--theme-primary, #0b499d) !important;
    color: #ffffff !important;
}

/* Float Navigation & Page Number Controls */
.btn-float-nav {
    background: var(--theme-primary, #0b499d) !important;
    color: #ffffff !important;
    border: 2px solid var(--theme-secondary, #ffc709) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}
.btn-float-nav:hover {
    background: var(--theme-secondary, #ffc709) !important;
    color: #000000 !important;
}
/* Universal Pagination System (Public & Reader & Admin) */
.pagination,
.page-numbers-strip {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 0 !important;
    list-style: none !important;
}

.page-num-btn,
.pagination .page-link,
.page-item .page-link,
.pagination-btn,
.pagination a,
.pagination span {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 12px !important;
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    box-sizing: border-box !important;
}

.page-num-btn:hover,
.pagination .page-link:hover,
.page-item:not(.active) .page-link:hover,
.pagination a:hover {
    background: #f1f5f9 !important;
    color: var(--theme-primary, #0b499d) !important;
    border-color: var(--theme-primary, #0b499d) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12) !important;
}

.page-num-btn.active,
.pagination .page-item.active .page-link,
.pagination .page-link.active,
.page-item.active .page-link,
.pagination span.current,
.pagination .active a,
.pagination-link.active {
    background: var(--theme-primary, #0b499d) !important;
    color: #ffffff !important;
    border-color: var(--theme-primary, #0b499d) !important;
    box-shadow: 0 3px 8px rgba(11, 73, 157, 0.35) !important;
}

.pagination-wrapper {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-top: 24px !important;
    padding: 14px 18px !important;
    background: #ffffff !important;
    border: 1px solid var(--ui-line, #e2e8f0) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.pagination-info {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    color: #475569 !important;
}

.pagination-nav {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pagination-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
}

.pagination-link:hover:not(.disabled):not(.active) {
    background: #ffffff !important;
    border-color: var(--theme-primary, #0b499d) !important;
    color: var(--theme-primary, #0b499d) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(11, 73, 157, 0.15) !important;
}

.pagination-link.disabled {
    opacity: 0.45 !important;
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    pointer-events: none !important;
    cursor: not-allowed !important;
}

.pagination-ellipsis {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 36px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
}

@media (max-width: 600px) {
    .pagination-wrapper {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 12px !important;
    }
    .pagination-link {
        min-width: 32px !important;
        height: 32px !important;
        padding: 0 8px !important;
        font-size: 0.78rem !important;
    }
}

/* Mobile reader bottom toolbar: wrap to two rows so every button
   (especially Clip) stays visible on narrow phones. */
@media (max-width: 560px) {
    .mobile-sticky-bottom-toolbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: 8px 10px;
    }
    .mobile-tb-btn {
        flex: 0 0 auto;
        height: 34px;
        min-width: 34px;
        padding: 5px 9px;
    }
    .mobile-tb-select {
        flex: 1 1 92px;
        min-width: 84px;
        padding: 5px 6px;
    }
    body {
        padding-bottom: 112px;
    }
}

