/* 
   Newsletter Archive — Dracula Theme Design System
   Light mode default, optimized for performance
*/

/* === DRACULA PALETTE === */
:root {
    /* Tech-Vibes Dracula Palette (Default: Light Mode) */
    --bg-body: #f1f2f6;
    /* Clean professional grey-white */
    --bg-card: #ffffff;
    --bg-glass: rgba(241, 242, 246, 0.9);
    --text-primary: #282a36;
    --text-secondary: #44475a;
    --text-muted: #6272a4;

    /* Accent Colors - Tech Focus */
    --accent-blue: #6272a4;
    --accent-cyan: #00bcd4;
    /* More vivid in light mode */
    --accent-green: #2ecc71;
    --accent-purple: #9b59b6;
    --accent-orange: #e67e22;
    --accent-red: #e74c3c;
    --accent-yellow: #f1c40f;

    /* Semantic Accents */
    --accent-primary: #00bcd4;
    /* Cyan primary for Tech look */
    --accent-secondary: var(--accent-blue);
    --accent-success: var(--accent-green);
    --accent-info: var(--accent-cyan);
    --accent-warning: var(--accent-yellow);
    --accent-danger: var(--accent-red);
    --border-color: rgba(98, 114, 164, 0.2);
    --border-hover: var(--accent-primary);

    /* Effects */
    --shadow-sm: 0 2px 8px rgba(40, 42, 54, 0.06);
    --shadow-md: 0 8px 24px rgba(40, 42, 54, 0.1);
    --shadow-glow: 0 0 20px rgba(0, 188, 212, 0.2);
    --blur-strength: 8px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-header: 'Outfit', sans-serif;

    /* Terminal Theme (Light Mode Default) */
    --bg-terminal: #ffffff;
    /* Pure White */
    --bg-terminal-header: #f1f2f6;
    /* Cool Blue/Grey */
    --border-terminal: #e1e4e8;
    /* GitHub-like border */
    --text-terminal-main: #24292e;
    /* GitHub Dark */
    --text-terminal-muted: #586069;
    --bg-terminal-code: #f6f8fa;
    /* Subtle code block bg */
    --btn-terminal-bg: #ffffff;
    --btn-terminal-hover: #f3f4f6;
}

/* Default Dark Theme Logic */
[data-theme="dark"] {
    --bg-body: #1e1f29;
    --bg-card: #282a36;
    --bg-glass: rgba(30, 31, 41, 0.9);
    --text-primary: #f8f8f2;
    --text-secondary: #8be9fd;
    --text-muted: #6272a4;

    /* High contrast tech colors for dark mode */
    --accent-cyan: #8be9fd;
    --accent-green: #50fa7b;
    --accent-primary: #8be9fd;
    --accent-blue: #6272a4;
    --border-color: rgba(98, 114, 164, 0.4);
    --shadow-glow: 0 0 25px rgba(139, 233, 253, 0.4);

    /* Terminal Theme (Dark Mode) */
    --bg-terminal: #0d1117;
    /* GitHub Dark Dimmed / Dracula Deep */
    --bg-terminal-header: #161b22;
    --border-terminal: #30363d;
    --text-terminal-main: #c9d1d9;
    --text-terminal-muted: #8b949e;
    --bg-terminal-code: #0d1117;
    /* Blend in dark mode or slightly lighter? Keep distinct? */
    --btn-terminal-bg: #21262d;
    --btn-terminal-hover: #30363d;
}

/* === BASE RESET === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* === LAYOUT === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* === HEADER === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

h1.logo {
    font-family: var(--font-header);
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent-blue);
}

.actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

/* === CONTROLS === */
.controls-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.search-row {
    display: flex;
    gap: 12px;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-main);
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(189, 147, 249, 0.15);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.sort-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sort-select {
    appearance: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 36px 10px 14px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.sort-icon-chevron {
    position: absolute;
    right: 12px;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* === STATS & FILTER ROW === */
.stats-filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
}

.stat-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.stat-label {
    color: var(--text-muted);
    font-weight: 500;
}

.stat-val {
    color: var(--text-primary);
    font-weight: 600;
}

/* === NEWS GRID === */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    list-style: none;
    margin-bottom: 40px;
}

/* === CARD COMPONENT === */
.news-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-smooth);
}

/* Border highlight on hover (desktop only) */
.news-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-md);
    border: 2px solid var(--accent-blue);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.news-card:hover::before {
    opacity: 1;
}

.news-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    text-decoration: none;
    color: inherit;
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.sender-pill {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(189, 147, 249, 0.1);
    color: var(--accent-blue);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    border: 1px solid rgba(189, 147, 249, 0.2);
}

[data-theme="dark"] .sender-pill {
    background: rgba(189, 147, 249, 0.15);
}

.card-title {
    font-family: var(--font-header);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-v2-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-terminal-muted);
    margin-bottom: 6px;
    /* Pad text */
}

/* URL Text - FULL VISIBILITY */
.card-v2-url {
    display: block;
    width: 100%;
    word-break: break-all;
    /* Critical for full visibility */
    overflow-wrap: break-word;
    /* Additional safety */
    white-space: normal;
    /* Force wrapping */
    font-family: inherit;
    /* Inherit JetBrains Mono */
    font-size: 11px;
    color: var(--accent-pink);
    line-height: 1.6;
    padding: 10px;
    background: var(--bg-terminal-code);
    border: 1px dashed var(--border-terminal);
    border-radius: 6px;
}

.card-v2-url-zone {
    padding: 0 12px 12px 12px;
    /* Pad URL zone */
}

/* === AUDIT LOG === */
.audit-log-container {
    border-top: 1px solid var(--border-terminal);
    background: var(--bg-body);
    /* Matches background to feel etched in or separate */
    padding: 12px 12px;
    display: none;
    margin-top: 4px;
    /* Slight separation from URL/Buttons */
}

.audit-log-container.active {
    display: block;
}

.audit-step {
    font-family: inherit;
    /* Inherit JetBrains Mono */
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    word-break: break-all;
    /* Ensure logs wrap */
    position: relative;
    padding-left: 14px;
    line-height: 1.5;
}

.audit-step.highlighted {
    color: var(--accent-green);
    background: rgba(80, 250, 123, 0.1);
    border-radius: 4px;
    padding: 4px 14px 4px 14px;
    border-left: 2px solid var(--accent-green);
}

/* Technical arrow/indicator for steps */
.audit-step::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--border-terminal);
}

.audit-step strong {
    color: var(--accent-cyan);
    /* Consistent with specific data points */
    font-weight: normal;
}

.audit-status-text {
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
}

.card-preview {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.read-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.arrow {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.news-card:hover .arrow {
    color: var(--accent-info);
    transform: translateX(4px);
}

/* === FOOTER === */
footer {
    margin-top: auto;
    padding-top: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

footer a {
    color: var(--accent-blue);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-blue);
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--accent-info);
}

/* === ICONS === */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        padding: 24px 16px;
    }

    h1.logo {
        font-size: 1.4rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .stats-row {
        gap: 8px;
    }

    .stat-pill {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    /* Disable hover effects on mobile */
    .news-card:hover {
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .news-card::before {
        display: none;
    }

    .news-card:hover .arrow {
        transform: none;
    }

    .hide-mobile {
        display: none !important;
    }
}

/* === GLASSMORPHISM (desktop only) === */
@media (min-width: 769px) {
    .glass {
        background: var(--bg-glass);
        backdrop-filter: blur(var(--blur-strength));
        -webkit-backdrop-filter: blur(var(--blur-strength));
    }
}

/* Mobile fallback: solid background */
@media (max-width: 768px) {
    .glass {
        background: var(--bg-card);
    }
}

/* === CRM BADGES === */
/* Unified CRM Badges */
.crm-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(0, 188, 212, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 188, 212, 0.2);
    transition: all var(--transition-smooth);
}

.crm-badge[data-crm="Unknown"] {
    background: rgba(98, 114, 164, 0.1) !important;
    color: var(--text-muted) !important;
    border-color: rgba(98, 114, 164, 0.2) !important;
}

[data-theme="dark"] .crm-badge {
    background: rgba(139, 233, 253, 0.1);
    color: var(--accent-cyan);
    border-color: rgba(139, 233, 253, 0.2);
}

[data-theme="dark"] .crm-badge[data-crm="Unknown"] {
    background: rgba(68, 71, 90, 0.3) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

/* === MULTI-COLOR UTILITIES === */
.text-purple {
    color: var(--accent-blue);
}

.text-pink {
    color: var(--accent-pink);
}

.text-cyan {
    color: var(--accent-cyan);
}

.text-green {
    color: var(--accent-green);
}

.text-orange {
    color: var(--accent-orange);
}

.text-yellow {
    color: var(--accent-yellow);
}

.text-red {
    color: var(--accent-red);
}

.bg-purple {
    background-color: rgba(189, 147, 249, 0.15);
}

.bg-pink {
    background-color: rgba(255, 121, 198, 0.15);
}

.bg-cyan {
    background-color: rgba(139, 233, 253, 0.15);
}

.bg-green {
    background-color: rgba(80, 250, 123, 0.15);
}

.bg-orange {
    background-color: rgba(255, 184, 108, 0.15);
}

/* === VIEWER SPECIFIC === */
.viewer-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.viewer-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(var(--blur-strength));
}

.viewer-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow: auto;
    background: var(--bg-body);
}

.email-frame {
    width: 100%;
    max-width: 800px;
    height: 100%;
    border: none;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.email-frame.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.email-frame.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.viewer-sidebar {
    width: 360px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-title {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    margin-top: auto;
}

.meta-section {
    margin-bottom: 20px;
}

.meta-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.meta-row:last-child {
    border-bottom: none;
}

.meta-key {
    color: var(--text-secondary);
}

.meta-val {
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
}

/* Device toggle buttons */
.device-toggle {
    display: flex;
    gap: 4px;
    background: rgba(0, 0, 0, 0.05);
    padding: 3px;
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .device-toggle {
    background: rgba(255, 255, 255, 0.05);
}

.device-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.device-btn.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* Link cards v2 (Multi-Zone) */
.link-card-v2 {
    display: flex;
    flex-direction: column;
    background: var(--bg-terminal);
    border: 1px solid var(--border-terminal);
    border-radius: 4px;
    /* Sharper corners for technical feel */
    margin-bottom: 12px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    overflow: hidden;
    font-family: 'JetBrains Mono', Consolas, Monaco, 'Andale Mono', monospace;
    box-shadow: none;
    /* Flat design */
}

.link-card-v2:hover {
    border-color: var(--accent-primary);
}

.card-v2-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-terminal-header);
    /* Header separation */
    border-bottom: 1px solid var(--border-terminal);
    color: var(--text-terminal-main);
}

[data-theme="dark"] .card-v2-header {
    background: var(--bg-terminal-header);
    /* Use variable logic */
}

/* === BUTTONS matching Header .btn-secondary style === */
.btn-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid var(--border-terminal);
    background: var(--btn-terminal-bg);
    color: var(--text-terminal-muted);
    cursor: pointer;
    transition: all 0.2s;
    /* Use Icon defaults */
}

.btn-card:hover {
    background: var(--btn-terminal-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.card-v2-index {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    color: #ffffff;
    /* FORCE WHITE TEXT */
    font-size: 0.75rem;
    font-family: var(--font-main);
    font-weight: 700;
    border-radius: 4px;
}

.card-v2-domain {
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-terminal-muted);
    /* More discreet */
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-v2-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent-orange);
    background: rgba(230, 126, 34, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.card-v2-body {
    padding: 12px 14px;
}

.card-v2-text {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-v2-url-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-body);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px dashed var(--border-color);
}

.card-v2-url {
    flex: 1;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-v2-copy-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.card-v2-copy-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 188, 212, 0.05);
}

.card-v2-copy-btn svg {
    width: 14px;
    height: 14px;
}

.card-v2-copy-btn.copy-success {
    border-color: var(--accent-green) !important;
    background: rgba(80, 250, 123, 0.1) !important;
}

/* Modal / Popup */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-family: var(--font-header);
    font-weight: 600;
    font-size: 1rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
}

.modal-body {
    flex: 1;
    overflow: auto;
    padding: 16px 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-smooth);
}

/* === ANIMATIONS === */
@keyframes pulse-highlight {
    0% {
        outline-color: var(--accent-primary);
        outline-offset: 1px;
    }

    50% {
        outline-color: var(--accent-success);
        outline-offset: 4px;
        box-shadow: 0 0 15px var(--accent-success);
    }

    100% {
        outline-color: var(--accent-primary);
        outline-offset: 1px;
    }
}

.link-highlight-pulse {
    animation: pulse-highlight 2s infinite;
    min-width: 14px !important;
    min-height: 14px !important;
    display: inline-block !important;
    /* Ensure small icons are visible targets */
}

.link-overlay-badge {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.link-overlay-badge:hover {
    transform: scale(1.3);
    z-index: 1001;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.code-block {
    background: #282a36;
    color: #f8f8f2;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Toolbar */
.viewer-toolbar {
    display: flex;
    gap: 8px;
}

/* Hide scrollbar on mobile/tablet frames */
.email-frame.no-scrollbar {
    scrollbar-width: none;
}

.email-frame.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* Responsive: hide sidebar on mobile */
@media (max-width: 900px) {
    .viewer-sidebar {
        display: none;
    }
}