/* ==========================================================================
   Rīgas 64. vidusskolas AI Chatbot - Design System & Styles
   ========================================================================== */

:root {
    /* Color Palette (R64 School Identity - matches r64vsk.lv brand teal) */
    --primary: #00594c;
    --primary-light: #0a7a63;
    --primary-dark: #00382f;

    --accent: #00866d;
    --accent-hover: #006f5a;
    --accent-light: #e3f3f0;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Light Theme (Default) */
    --bg-page: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-sidebar: #00382f;
    --bg-sidebar-card: rgba(255, 255, 255, 0.07);
    --bg-chat-user: #00594c;
    --text-chat-user: #ffffff;
    --bg-chat-bot: #ffffff;
    --text-chat-bot: #1e293b;
    --border-color: #e2e8f0;
    --border-subtle: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-sidebar: #e2e8f0;
    --text-sidebar-muted: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-full: 9999px;

    --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body.theme-dark {
    --bg-page: #0b1120;
    --bg-surface: #0f172a;
    --bg-surface-elevated: #1e293b;
    --bg-sidebar: #002019;
    --bg-sidebar-card: rgba(255, 255, 255, 0.04);
    --bg-chat-user: #00866d;
    --text-chat-user: #ffffff;
    --bg-chat-bot: #1e293b;
    --text-chat-bot: #f1f5f9;
    --border-color: #334155;
    --border-subtle: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-sidebar: #e2e8f0;
    --text-sidebar-muted: #64748b;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    color: var(--text-sidebar);
    display: flex;
    flex-direction: column;
    height: 100%;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.school-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.school-logo-badge {
    width: 44px;
    height: 44px;
    background: #ffffff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 89, 76, 0.35);
}

.school-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.school-meta h2 {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.school-tagline {
    font-size: 12px;
    color: var(--text-sidebar-muted);
}

/* Sidebar Status Card */
.sidebar-card {
    margin: 16px 20px;
    padding: 14px;
    background: var(--bg-sidebar-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    backdrop-filter: blur(8px);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #34d399;
    margin-bottom: 10px;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.4);
    animation: pulse 2s infinite ease-out;
}

@keyframes pulse {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.6); opacity: 0; }
}

.stats-mini-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    text-align: center;
}

.stat-mini-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 4px;
    border-radius: var(--radius-sm);
}

.stat-num {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.stat-label {
    font-size: 10px;
    color: var(--text-sidebar-muted);
    text-transform: uppercase;
}

/* Sidebar Section & Quick Prompts */
.sidebar-section {
    padding: 10px 20px;
    flex: 1;
    overflow-y: auto;
}

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-sidebar-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.quick-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quick-nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-sidebar);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-nav-btn i {
    font-size: 14px;
    color: #5eead4;
    width: 18px;
    text-align: center;
}

.quick-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.external-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ext-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--text-sidebar-muted);
    font-size: 13px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: color 0.2s ease, background 0.2s ease;
}

.ext-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-sidebar {
    width: 100%;
    padding: 10px 14px;
    background: linear-gradient(135deg, #00594c, #00866d);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.2s ease, transform 0.15s ease;
}

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

.btn-sidebar-secondary {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-sidebar);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease;
}

.btn-sidebar-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: var(--bg-page);
    position: relative;
}

/* Chat Header */
.chat-header {
    height: 70px;
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-titles h1 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.badge-verified {
    background: #ecfdf5;
    color: #065f46;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

body.theme-dark .badge-verified {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.model-tag {
    color: var(--text-muted);
    font-size: 11px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-btn {
    padding: 8px 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.icon-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
}

.mobile-only {
    display: none;
}

/* ==========================================================================
   Chat Scroll & Message Area
   ========================================================================== */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    scroll-behavior: smooth;
}

/* Welcome Hero */
.welcome-hero {
    max-width: 760px;
    margin: auto auto;
    text-align: center;
    padding: 30px 20px;
    animation: fadeIn 0.4s ease-out;
}

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

.hero-icon-glow {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #00594c, #14a688);
    color: #ffffff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(0, 134, 109, 0.35);
}

.welcome-hero h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.4px;
}

.hero-desc {
    font-size: 14.5px;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 30px;
    line-height: 1.6;
}

.hero-chips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    text-align: left;
}

.hero-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

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

.chip-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

body.theme-dark .chip-icon {
    background: rgba(0, 134, 109, 0.15);
    color: #2dd4bf;
}

.chip-text strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.chip-text span {
    font-size: 12px;
    color: var(--text-muted);
}

/* Message List */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
}

.message-row {
    display: flex;
    gap: 16px;
    width: 100%;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease-out;
}

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

.message-row.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.message-row.bot .message-avatar {
    background: linear-gradient(135deg, #00382f, #00594c);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 56, 47, 0.25);
}

.message-bubble {
    max-width: 85%;
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    font-size: 14.5px;
    line-height: 1.65;
    box-shadow: var(--shadow-sm);
    position: relative;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.message-row.user .message-bubble {
    background: linear-gradient(135deg, #00594c, #00866d);
    color: var(--text-chat-user);
    border-bottom-right-radius: var(--radius-sm);
    box-shadow: 0 4px 14px rgba(0, 134, 109, 0.25);
}

.message-row.bot .message-bubble {
    background: var(--bg-chat-bot);
    color: var(--text-chat-bot);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Markdown formatting inside bot bubble */
.message-bubble h3, .message-bubble h2 {
    color: var(--text-primary);
    margin: 12px 0 6px 0;
    line-height: 1.3;
}

.message-bubble h3:first-child, .message-bubble h2:first-child {
    margin-top: 0;
}

.message-bubble p {
    margin-bottom: 12px;
    color: inherit;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
    margin: 8px 0 12px 20px;
}

.message-bubble li {
    margin-bottom: 6px;
    line-height: 1.55;
}

.message-bubble strong {
    font-weight: 600;
    color: var(--text-primary);
}

.message-bubble blockquote {
    background: var(--border-subtle);
    border-left: 3.5px solid var(--accent);
    padding: 10px 14px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 12px 0;
    font-size: 13.5px;
}

.message-bubble a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}

.message-bubble .table-scroll {
    overflow-x: auto;
    margin: 14px 0;
    -webkit-overflow-scrolling: touch;
}

.message-bubble table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.message-bubble th, .message-bubble td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.message-bubble th {
    background: var(--border-subtle);
    font-weight: 600;
}

/* Sources & Citations Section */
.message-sources {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.sources-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sources-chips-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 12.5px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    max-width: 100%;
}

.source-badge:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.source-badge i.pdf-icon { color: #ef4444; font-size: 14px; }
.source-badge i.docx-icon { color: #00866d; font-size: 14px; }
.source-badge i.xlsx-icon { color: #16a34a; font-size: 14px; }
.source-badge i.pptx-icon { color: #ea580c; font-size: 14px; }
.source-badge i.html-icon { color: #10b981; font-size: 14px; }

.source-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 280px;
}

.message-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.meta-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: 4px;
    transition: color 0.15s ease;
}

.meta-btn:hover {
    color: var(--text-primary);
}

/* Typing indicator */
.typing-indicator-row {
    display: flex;
    gap: 14px;
    max-width: 840px;
    width: 100%;
    margin: 0 auto;
    align-items: center;
}

.bot-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #00382f, #00594c);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.typing-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.typing-text {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================================
   Chat Input Area
   ========================================================================== */
.chat-input-wrapper {
    padding: 16px 24px 20px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
}

.chat-form {
    max-width: 840px;
    margin: 0 auto;
}

.input-container {
    display: flex;
    align-items: flex-end;
    background: var(--bg-page);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 8px 12px 8px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-container:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 134, 109, 0.15);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14.5px;
    color: var(--text-primary);
    resize: none;
    max-height: 140px;
    min-height: 24px;
    line-height: 1.5;
    padding: 4px 0;
}

.input-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
}

.input-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn {
    background: var(--accent);
    color: #ffffff;
}

.send-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

.voice-btn {
    background: transparent;
    color: var(--text-muted);
}

.voice-btn:hover {
    color: var(--accent);
    background: var(--border-subtle);
}

.voice-btn.recording {
    color: #ef4444;
    animation: pulse 1.5s infinite;
}

.input-disclaimer {
    text-align: center;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.input-disclaimer a {
    color: var(--text-secondary);
    text-decoration: none;
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.modal-card.modal-large {
    max-width: 650px;
}

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

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent);
}

.form-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.code-box-wrapper {
    position: relative;
    background: #0f172a;
    color: #38bdf8;
    padding: 16px;
    border-radius: var(--radius-md);
    margin: 16px 0;
    overflow-x: auto;
}

.code-box-wrapper pre code {
    font-family: monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.preview-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--accent-light);
    color: #1e3a8a;
    border-radius: var(--radius-md);
    font-size: 13px;
}

body.theme-dark .preview-note {
    background: rgba(0, 134, 109, 0.15);
    color: #7dd4bf;
}

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

.btn {
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-only {
        display: flex;
    }

    .hero-chips-grid {
        grid-template-columns: 1fr;
    }
}
