/* ========================================
   PsychGuard Mini App - Prototype Styles
   Telegram Theme Compatible
   ======================================== */

/* ========================================
   Device Simulator Styles
   ======================================== */

.simulator-mode {
    background: linear-gradient(135deg, #2A2118 0%, #3D2914 50%, #1F170F 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
    overflow: auto;
}

/* Device Selector Bar */
.device-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.device-selector label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.device-selector select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.device-selector select:focus {
    outline: none;
    border-color: #2481cc;
}

.device-selector button {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.device-selector button:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Device Frame */
.device-frame {
    position: relative;
    background: #1c1c1e;
    border-radius: 50px;
    padding: 12px;
    box-shadow:
        0 0 0 3px #2c2c2e,
        0 0 0 6px #1c1c1e,
        0 25px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Device Screen */
.device-screen {
    position: relative;
    border-radius: 40px;
    overflow: hidden;
    background: var(--tg-theme-bg-color);
}

/* Dynamic Island */
.dynamic-island {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 37px;
    background: #000;
    border-radius: 20px;
    z-index: 1000;
}

/* Device Sizes */
.device-frame.iphone-15-pro .device-screen {
    width: 393px;
    height: 852px;
}

.device-frame.iphone-15-pro-max .device-screen {
    width: 430px;
    height: 932px;
}

.device-frame.iphone-se .device-screen {
    width: 375px;
    height: 667px;
}

.device-frame.iphone-se .dynamic-island {
    display: none;
}

.device-frame.iphone-se {
    border-radius: 40px;
}

.device-frame.iphone-se .device-screen {
    border-radius: 30px;
}

/* iPhone SE - Home Button */
.device-frame.iphone-se::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border: 3px solid #3a3a3c;
    border-radius: 50%;
    background: #1c1c1e;
}

.device-frame.iphone-14 .device-screen {
    width: 390px;
    height: 844px;
}

.device-frame.iphone-14 .dynamic-island {
    width: 80px;
    height: 25px;
    border-radius: 13px;
}

.device-frame.pixel-7 .device-screen {
    width: 412px;
    height: 915px;
}

.device-frame.pixel-7 {
    border-radius: 35px;
}

.device-frame.pixel-7 .device-screen {
    border-radius: 25px;
}

.device-frame.pixel-7 .dynamic-island {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    top: 20px;
}

.device-frame.samsung-s23 .device-screen {
    width: 360px;
    height: 780px;
}

.device-frame.samsung-s23 {
    border-radius: 35px;
}

.device-frame.samsung-s23 .device-screen {
    border-radius: 25px;
}

.device-frame.samsung-s23 .dynamic-island {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    top: 15px;
}

/* Fullscreen Mode */
.device-frame.fullscreen {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.device-frame.fullscreen .device-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.device-frame.fullscreen .dynamic-island {
    display: none;
}

body.simulator-mode.fullscreen-active {
    padding: 0;
}

body.simulator-mode.fullscreen-active .device-selector {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    opacity: 0.3;
    transition: opacity 0.3s;
}

body.simulator-mode.fullscreen-active .device-selector:hover {
    opacity: 1;
}

/* App Container in Simulator */
.simulator-mode #app {
    height: 100%;
    padding-bottom: 80px;
}

.simulator-mode .bottom-nav {
    position: absolute;
    border-radius: 0 0 40px 40px;
}

.device-frame.iphone-se .bottom-nav {
    border-radius: 0 0 30px 30px;
}

.device-frame.pixel-7 .bottom-nav,
.device-frame.samsung-s23 .bottom-nav {
    border-radius: 0 0 25px 25px;
}

.device-frame.fullscreen .bottom-nav {
    border-radius: 0;
}

/* Toast in Simulator */
.simulator-mode .toast {
    bottom: 100px;
}

/* Modal in Simulator */
.simulator-mode .modal-overlay {
    border-radius: 40px;
}

.device-frame.fullscreen .modal-overlay {
    border-radius: 0;
}

/* Notch safe area simulation */
.simulator-mode .header {
    padding-top: calc(50px + var(--spacing-md));
}

.device-frame.iphone-se .header {
    padding-top: calc(20px + var(--spacing-md));
}

.device-frame.pixel-7 .header,
.device-frame.samsung-s23 .header {
    padding-top: calc(40px + var(--spacing-md));
}

.device-frame.fullscreen .header {
    padding-top: var(--spacing-md);
}

/* Scale for smaller screens */
@media (max-height: 950px) {
    .device-frame:not(.fullscreen) {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

@media (max-height: 800px) {
    .device-frame:not(.fullscreen) {
        transform: scale(0.75);
        transform-origin: top center;
    }
}

@media (max-height: 700px) {
    .device-frame:not(.fullscreen) {
        transform: scale(0.65);
        transform-origin: top center;
    }
}

/* CSS Variables - Bohemian Retro Theme */
:root {
    /* Light Theme - Bohemian Warm */
    --tg-theme-bg-color: #F5E6D3;
    --tg-theme-text-color: #4A3728;
    --tg-theme-hint-color: #8B7355;
    --tg-theme-link-color: #E8734A;
    --tg-theme-button-color: #E8734A;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #EDD9C4;
    --tg-theme-header-bg-color: #F5E6D3;
    --tg-theme-accent-text-color: #D65A3A;
    --tg-theme-section-bg-color: #FDF8F3;
    --tg-theme-section-header-text-color: #8B7355;
    --tg-theme-section-separator-color: #E0CCAF;
    --tg-theme-subtitle-text-color: #9C8570;
    --tg-theme-destructive-text-color: #D64550;

    /* Bohemian Color Palette - from reference images */
    --boho-orange: #E8734A;
    --boho-tangerine: #F28C5A;
    --boho-coral: #E85A6B;
    --boho-magenta: #D64580;
    --boho-pink: #E8707A;
    --boho-teal: #3A9BA5;
    --boho-turquoise: #4ABDC4;
    --boho-cream: #F5E6D3;
    --boho-sand: #EDD9C4;
    --boho-caramel: #C9956C;
    --boho-brown: #8B6F47;
    --boho-espresso: #4A3728;
    --boho-sage: #7BA05B;
    --boho-forest: #5A8F6A;

    /* Accent gradients */
    --gradient-primary: linear-gradient(135deg, #E8734A 0%, #F28C5A 100%);
    --gradient-coral: linear-gradient(135deg, #E85A6B 0%, #E8707A 100%);
    --gradient-teal: linear-gradient(135deg, #3A9BA5 0%, #4ABDC4 100%);

    /* Severity - Vibrant warm tones */
    --severity-high: #D64550;
    --severity-high-bg: #FCEAEC;
    --severity-medium: #E8934A;
    --severity-medium-bg: #FDF3E8;
    --severity-low: #5A8F6A;
    --severity-low-bg: #EEF6F0;
    --severity-none: #9C8570;
    --severity-none-bg: #F5F0EB;

    /* Health Score - Vibrant */
    --health-high: #5A8F6A;
    --health-high-bg: #EEF6F0;
    --health-medium: #E8934A;
    --health-medium-bg: #FDF3E8;
    --health-low: #D64550;
    --health-low-bg: #FCEAEC;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius - Softer, friendlier */
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 999px;

    /* Shadows - Warm tinted */
    --shadow-sm: 0 2px 8px rgba(139, 111, 71, 0.1);
    --shadow-md: 0 4px 16px rgba(139, 111, 71, 0.14);
    --shadow-lg: 0 8px 32px rgba(139, 111, 71, 0.18);
    --shadow-glow: 0 0 20px rgba(232, 115, 74, 0.25);

    /* Safe areas */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Dark Theme - Bohemian Night */
.theme-dark {
    --tg-theme-bg-color: #2D231A;
    --tg-theme-text-color: #F5E6D3;
    --tg-theme-hint-color: #B8A690;
    --tg-theme-link-color: #F5A06E;
    --tg-theme-button-color: #E8734A;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #3D3026;
    --tg-theme-header-bg-color: #2D231A;
    --tg-theme-accent-text-color: #F5A06E;
    --tg-theme-section-bg-color: #3D3026;
    --tg-theme-section-header-text-color: #B8A690;
    --tg-theme-section-separator-color: #4D3D30;
    --tg-theme-subtitle-text-color: #B8A690;
    --tg-theme-destructive-text-color: #FF7B7B;

    /* Severity - Dark vibrant */
    --severity-high: #FF7B7B;
    --severity-high-bg: rgba(255, 123, 123, 0.18);
    --severity-medium: #FFB86C;
    --severity-medium-bg: rgba(255, 184, 108, 0.18);
    --severity-low: #8FBF8E;
    --severity-low-bg: rgba(143, 191, 142, 0.18);
    --severity-none: #B8A690;
    --severity-none-bg: rgba(184, 166, 144, 0.15);

    /* Health - Dark vibrant */
    --health-high: #8FBF8E;
    --health-high-bg: rgba(143, 191, 142, 0.18);
    --health-medium: #FFB86C;
    --health-medium-bg: rgba(255, 184, 108, 0.18);
    --health-low: #FF7B7B;
    --health-low-bg: rgba(255, 123, 123, 0.18);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 0 20px rgba(245, 160, 110, 0.2);
}

/* ========================================
   Base Styles
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 80px; /* Space for bottom nav */
}

.hidden {
    display: none !important;
}

/* ========================================
   Lucide Icons
   ======================================== */

.lucide-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.lucide-icon-xl {
    width: 72px;
    height: 72px;
    stroke-width: 1.5;
    color: var(--boho-orange);
}

.lucide-icon-lg {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

.lucide-icon-sm {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.lucide-icon-xs {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.lucide-icon-xxs {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
    vertical-align: middle;
}

.lucide-avatar {
    width: 40px;
    height: 40px;
    stroke-width: 1.5;
    color: var(--boho-caramel);
    background: var(--boho-sand);
    padding: 8px;
    border-radius: 50%;
}

/* Navigation icons */
.nav-icon .lucide-icon {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

/* Header action icons */
.header-action .lucide-icon {
    width: 22px;
    height: 22px;
    stroke-width: 2;
    color: var(--tg-theme-link-color);
}

/* Button icons */
.btn .lucide-icon-sm {
    margin-left: 4px;
}

/* Step number icons */
.step-num .lucide-icon-xs {
    color: white;
}

/* Disclaimer check icons */
.disclaimer-list .lucide-icon-xs {
    color: var(--boho-sage);
    margin-right: 8px;
    vertical-align: middle;
}

/* Severity badge icons */
.severity-badge .lucide-icon-xxs {
    margin-right: 3px;
}

/* Health score icons */
.health-score .lucide-icon-xxs {
    margin-right: 2px;
}

/* Dialog chevron */
.dialog-chevron .lucide-icon-sm {
    color: var(--tg-theme-hint-color);
}

/* ========================================
   Typography - Space Grotesk for headlines
   ======================================== */

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-weight: 600;
    color: var(--tg-theme-text-color);
    letter-spacing: -0.02em;
}

h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

p {
    color: var(--tg-theme-text-color);
}

.text-secondary {
    color: var(--tg-theme-hint-color);
}

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

.text-danger {
    color: var(--tg-theme-destructive-text-color);
}

/* ========================================
   Screen Container
   ======================================== */

.screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    padding-bottom: var(--spacing-xl);
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   Header
   ======================================== */

.header {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    padding-top: calc(var(--safe-area-top) + var(--spacing-md));
    background: linear-gradient(180deg, var(--tg-theme-header-bg-color) 0%, var(--tg-theme-bg-color) 100%);
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
    min-height: 56px;
}

.header.with-back {
    gap: var(--spacing-sm);
}

.back-btn {
    background: none;
    border: none;
    color: var(--tg-theme-link-color);
    font-size: 14px;
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.back-btn:hover {
    transform: translateX(-3px);
}

.header-content {
    flex: 1;
}

.header-title {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-subtitle {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.header-action {
    background: none;
    border: none;
    font-size: 20px;
    padding: var(--spacing-sm);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.header-action:hover {
    transform: scale(1.1);
}

/* ========================================
   Bottom Navigation - Warm & Friendly
   ======================================== */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: linear-gradient(0deg, var(--tg-theme-header-bg-color) 0%, rgba(245, 230, 211, 0.95) 100%);
    border-top: 1px solid var(--tg-theme-section-separator-color);
    padding: var(--spacing-sm);
    padding-bottom: calc(var(--safe-area-bottom) + var(--spacing-sm));
    z-index: 100;
    backdrop-filter: blur(10px);
}

.theme-dark .bottom-nav {
    background: linear-gradient(0deg, var(--tg-theme-header-bg-color) 0%, rgba(45, 35, 26, 0.95) 100%);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    color: var(--tg-theme-hint-color);
    transition: all 0.25s ease;
    border-radius: var(--radius-md);
    position: relative;
}

.nav-item:hover {
    color: var(--boho-orange);
}

.nav-item.active {
    color: var(--boho-orange);
    background: linear-gradient(180deg, rgba(232, 115, 74, 0.12) 0%, rgba(232, 115, 74, 0.05) 100%);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 0 0 3px 3px;
}

.nav-icon {
    font-size: 24px;
    transition: transform 0.2s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    animation: gentlePop 0.3s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
}

/* ========================================
   Buttons - Warm & Friendly
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 14px 28px;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--tg-theme-button-text-color);
    box-shadow: 0 4px 15px rgba(232, 115, 74, 0.35);
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 115, 74, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(232, 115, 74, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--boho-sand) 0%, var(--tg-theme-secondary-bg-color) 100%);
    color: var(--tg-theme-text-color);
    box-shadow: var(--shadow-sm);
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
}

.btn-secondary:hover {
    box-shadow: var(--shadow-md);
}

.btn-text {
    background: none;
    color: var(--tg-theme-link-color);
    padding: var(--spacing-sm);
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
}

.btn-text:hover {
    color: var(--boho-coral);
}

.btn-danger {
    background: var(--gradient-coral);
    color: white;
    box-shadow: 0 4px 15px rgba(232, 90, 107, 0.3);
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(232, 90, 107, 0.4);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-full {
    width: 100%;
}

/* ========================================
   Cards - Warm & Cozy
   ======================================== */

.card, .dialog-card, .health-card, .context-card,
.message-card, .technique-card, .summary-card,
.section-card, .report-card, .stat-card {
    background-color: var(--tg-theme-section-bg-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--tg-theme-section-separator-color);
    transition: all 0.25s ease;
}

.dialog-card:hover,
.report-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--boho-tangerine);
}

.dialog-card:active,
.report-card:active {
    transform: translateY(0);
}

.card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.card-icon {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(139, 111, 71, 0.2));
}

.card-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-section-header-text-color);
}

.card-action {
    background: none;
    border: none;
    color: var(--tg-theme-link-color);
    font-size: 14px;
    cursor: pointer;
}

/* ========================================
   Dialog List
   ======================================== */

.dialog-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.dialog-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    transition: background-color 0.2s;
}

.dialog-card:active {
    background-color: var(--tg-theme-secondary-bg-color);
}

.dialog-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--tg-theme-secondary-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.dialog-info {
    flex: 1;
    min-width: 0;
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 2px;
}

.dialog-name {
    font-weight: 600;
    font-size: 16px;
}

.dialog-meta {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.dialog-stats {
    margin-top: 4px;
}

.dialog-time {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}

.dialog-chevron {
    color: var(--tg-theme-hint-color);
    font-size: 16px;
}

/* Unread Dialog Indicator */
.dialog-card.unread {
    position: relative;
    background: linear-gradient(135deg, rgba(232, 115, 74, 0.08) 0%, rgba(242, 140, 90, 0.04) 100%);
    border-left: 3px solid var(--boho-orange);
}

.dialog-card.unread .dialog-name {
    font-weight: 700;
}

.unread-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--boho-orange) 0%, var(--boho-tangerine) 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    animation: gentlePulse 2s ease-in-out infinite;
}

.unread-badge i {
    width: 10px;
    height: 10px;
}

@keyframes gentlePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.unread-dot {
    position: absolute;
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--boho-orange);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--boho-orange);
}

/* ========================================
   Severity Badges
   ======================================== */

.severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.severity-badge.high {
    background-color: var(--severity-high-bg);
    color: var(--severity-high);
    box-shadow: 0 2px 6px rgba(201, 68, 68, 0.2);
}

.severity-badge.medium {
    background-color: var(--severity-medium-bg);
    color: var(--severity-medium);
    box-shadow: 0 2px 6px rgba(232, 155, 74, 0.2);
}

.severity-badge.low {
    background-color: var(--severity-low-bg);
    color: var(--severity-low);
    box-shadow: 0 2px 6px rgba(123, 160, 91, 0.2);
}

.severity-badge.none {
    background-color: var(--severity-none-bg);
    color: var(--severity-none);
}

/* Health Score */
.health-score {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}

.health-score.high {
    color: var(--health-high);
    background-color: var(--health-high-bg);
}
.health-score.medium {
    color: var(--health-medium);
    background-color: var(--health-medium-bg);
}
.health-score.low {
    color: var(--health-low);
    background-color: var(--health-low-bg);
}

/* ========================================
   Health Card
   ======================================== */

.health-card {
    text-align: center;
    padding: var(--spacing-lg);
}

.health-score-big {
    font-size: 64px;
    font-weight: 700;
    color: var(--severity-low);
    line-height: 1;
    margin: var(--spacing-md) 0;
}

.health-bar {
    height: 8px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: var(--spacing-md) 0;
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--severity-high), var(--severity-medium), var(--severity-low));
    border-radius: var(--radius-full);
    transition: width 0.3s;
}

.health-trend {
    font-size: 14px;
    margin-bottom: var(--spacing-md);
}

.health-trend.negative { color: var(--severity-high); }
.health-trend.positive { color: var(--severity-low); }
.health-trend.neutral { color: var(--tg-theme-hint-color); }

.health-stats {
    display: flex;
    justify-content: space-around;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--tg-theme-section-separator-color);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-label {
    font-size: 11px;
    color: var(--tg-theme-hint-color);
}

/* ========================================
   Context Card
   ======================================== */

.context-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--tg-theme-text-color);
}

/* ========================================
   Tabs
   ======================================== */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
    margin-bottom: var(--spacing-md);
}

.tab {
    flex: 1;
    padding: var(--spacing-md);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab.active {
    color: var(--tg-theme-accent-text-color);
    border-bottom-color: var(--tg-theme-accent-text-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========================================
   Timeline
   ======================================== */

.timeline {
    position: relative;
}

.timeline-group {
    margin-bottom: var(--spacing-lg);
}

.timeline-date {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-section-header-text-color);
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-sm);
}

.timeline-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--tg-theme-section-bg-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-sm);
    cursor: pointer;
    transition: background-color 0.2s;
}

.timeline-item:active {
    background-color: var(--tg-theme-secondary-bg-color);
}

.timeline-time {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    flex-shrink: 0;
    width: 40px;
}

.timeline-content {
    flex: 1;
    min-width: 0;
}

.timeline-content .severity-badge {
    margin-bottom: var(--spacing-xs);
}

.techniques {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.timeline-quote {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-action {
    font-size: 12px;
    color: var(--tg-theme-link-color);
    flex-shrink: 0;
    align-self: center;
}

/* ========================================
   Summaries
   ======================================== */

.summary-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.summary-card {
    background-color: var(--tg-theme-section-bg-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.summary-icon {
    font-size: 18px;
}

.summary-period {
    font-weight: 600;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-sm);
}

.summary-techniques {
    font-size: 13px;
    margin-bottom: var(--spacing-sm);
}

.summary-trend {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.summary-trend.negative { color: var(--severity-high); }
.summary-trend.positive { color: var(--severity-low); }
.summary-trend.neutral { color: var(--tg-theme-hint-color); }

.summary-text {
    font-size: 13px;
    font-style: italic;
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-sm);
}

.summary-card.collapsed .summary-text,
.summary-card.collapsed .summary-techniques {
    display: none;
}

/* ========================================
   Statistics
   ======================================== */

.stats-section {
    margin-bottom: var(--spacing-lg);
}

.stats-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tg-theme-section-header-text-color);
    margin-bottom: var(--spacing-md);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.bar-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.bar-label {
    font-size: 12px;
    width: 90px;
    flex-shrink: 0;
}

.bar {
    flex: 1;
    height: 12px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background-color: var(--tg-theme-button-color);
    border-radius: var(--radius-full);
}

.bar-value {
    font-size: 12px;
    font-weight: 500;
    width: 40px;
    text-align: right;
}

.severity-distribution {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.severity-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.severity-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.severity-dot.high { background-color: var(--severity-high); }
.severity-dot.medium { background-color: var(--severity-medium); }
.severity-dot.low { background-color: var(--severity-low); }
.severity-dot.none { background-color: var(--severity-none); }

.severity-label {
    font-size: 13px;
}

.activity-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100px;
    padding: var(--spacing-md) 0;
}

.day-bar {
    flex: 1;
    margin: 0 4px;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: background-color 0.2s;
}

.day-bar.active {
    background-color: var(--tg-theme-button-color);
}

.day-bar span {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: var(--tg-theme-hint-color);
}

.activity-note {
    text-align: center;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: var(--spacing-lg);
}

/* ========================================
   Analysis Detail
   ======================================== */

.severity-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
}

.severity-banner.high {
    background-color: rgba(255, 59, 48, 0.1);
}

.severity-banner.medium {
    background-color: rgba(255, 149, 0, 0.1);
}

.severity-banner.low {
    background-color: rgba(52, 199, 89, 0.1);
}

.severity-icon {
    font-size: 32px;
}

.severity-level {
    display: block;
    font-weight: 700;
    font-size: 16px;
}

.severity-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.message-text, .response-text {
    font-size: 15px;
    line-height: 1.6;
    padding: var(--spacing-md);
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--tg-theme-button-color);
    margin: var(--spacing-sm) 0;
}

.message-meta {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.techniques-section, .summary-section, .advice-section, .response-section {
    margin-bottom: var(--spacing-md);
}

.technique-card {
    margin-top: var(--spacing-sm);
}

.technique-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.technique-name {
    font-weight: 600;
}

.technique-confidence {
    font-size: 14px;
    font-weight: 600;
}

.technique-confidence.high { color: var(--severity-high); }
.technique-confidence.medium { color: var(--severity-medium); }

.technique-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--tg-theme-text-color);
    margin-bottom: var(--spacing-sm);
}

.typical-badge {
    display: inline-block;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-sm);
}

.advice-text {
    font-size: 14px;
    line-height: 1.6;
}

.actions-row {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.actions-row .btn {
    flex: 1;
}

/* ========================================
   Reports
   ======================================== */

.filters {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-section-header-text-color);
}

.filter-select {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--tg-theme-secondary-bg-color);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--tg-theme-text-color);
}

.reports-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.report-header {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.report-icon {
    font-size: 24px;
}

.report-info {
    display: flex;
    flex-direction: column;
}

.report-title {
    font-weight: 600;
}

.report-period {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.report-stats {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-md);
}

.report-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ========================================
   Profile
   ======================================== */

.profile-header {
    text-align: center;
    padding: var(--spacing-lg) 0;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--tg-theme-secondary-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto var(--spacing-md);
}

.profile-name {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.profile-username {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.profile-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.stats-cards {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.stat-card {
    flex: 1;
    text-align: center;
    padding: var(--spacing-md);
    margin-bottom: 0;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    display: block;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
}

.techniques-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.technique-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
}

.technique-rank {
    font-weight: 600;
    width: 24px;
}

.technique-row .technique-name {
    flex: 1;
}

.technique-count {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.subscription {
    border: 1px solid var(--tg-theme-button-color);
}

.subscription-info {
    padding-top: var(--spacing-sm);
}

.subscription-plan {
    margin-bottom: var(--spacing-md);
}

.plan-name {
    display: block;
    font-size: 18px;
    font-weight: 600;
}

.plan-status {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.subscription-features {
    list-style: none;
    margin-bottom: var(--spacing-md);
}

.subscription-features li {
    font-size: 14px;
    padding: var(--spacing-xs) 0;
    color: var(--severity-low);
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

/* ========================================
   Settings
   ======================================== */

.settings-section {
    margin-bottom: var(--spacing-lg);
}

.settings-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tg-theme-section-header-text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-sm);
}

.settings-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    background-color: var(--tg-theme-section-bg-color);
    margin-bottom: 1px;
    cursor: pointer;
}

.settings-item:first-of-type {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.settings-item:last-of-type {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: 0;
}

.settings-item:only-of-type {
    border-radius: var(--radius-md);
}

.settings-item.danger .settings-label {
    color: var(--tg-theme-destructive-text-color);
}

.settings-info {
    flex: 1;
}

.settings-label {
    display: block;
    font-size: 16px;
}

.settings-desc {
    display: block;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: 2px;
}

.settings-value {
    font-size: 14px;
    color: var(--tg-theme-hint-color);
}

.settings-chevron {
    color: var(--tg-theme-hint-color);
    margin-left: var(--spacing-sm);
}

/* Toggle Switch */
.toggle {
    position: relative;
    width: 50px;
    height: 30px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-full);
    transition: 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background-color: var(--severity-low);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Retention Picker */
.settings-intro {
    font-size: 15px;
    margin-bottom: var(--spacing-lg);
}

.retention-options {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.retention-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--tg-theme-section-bg-color);
    border-radius: var(--radius-md);
    cursor: pointer;
}

.retention-option input {
    display: none;
}

.retention-radio {
    width: 22px;
    height: 22px;
    border: 2px solid var(--tg-theme-hint-color);
    border-radius: 50%;
    position: relative;
}

.retention-option input:checked + .retention-radio {
    border-color: var(--tg-theme-button-color);
}

.retention-option input:checked + .retention-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: var(--tg-theme-button-color);
    border-radius: 50%;
}

.retention-info {
    flex: 1;
}

.retention-days {
    display: block;
    font-size: 16px;
    font-weight: 500;
}

.retention-desc {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
}

.retention-warning {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background-color: rgba(255, 149, 0, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.warning-icon {
    font-size: 20px;
}

.retention-warning p {
    font-size: 13px;
    color: var(--severity-medium);
}

/* Delete Confirmation */
.delete-confirm {
    text-align: center;
    padding-top: var(--spacing-xl);
}

.delete-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
}

.delete-title {
    font-size: 22px;
    margin-bottom: var(--spacing-sm);
}

.delete-text {
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-md);
}

.delete-list {
    list-style: none;
    text-align: left;
    padding: var(--spacing-md);
    background-color: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.delete-list li {
    padding: var(--spacing-xs) 0;
    color: var(--tg-theme-hint-color);
}

.delete-confirm-input {
    text-align: left;
    margin-bottom: var(--spacing-lg);
}

.delete-confirm-input label {
    display: block;
    font-size: 14px;
    margin-bottom: var(--spacing-sm);
}

.input {
    width: 100%;
    padding: var(--spacing-md);
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--tg-theme-text-color);
}

.input:focus {
    outline: none;
    border-color: var(--tg-theme-button-color);
}

.delete-actions {
    display: flex;
    gap: var(--spacing-md);
}

.delete-actions .btn {
    flex: 1;
}

/* ========================================
   Onboarding - Warm & Welcoming
   ======================================== */

.onboarding-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: linear-gradient(180deg, var(--tg-theme-bg-color) 0%, var(--tg-theme-secondary-bg-color) 100%);
}

.onboarding-content {
    text-align: center;
    max-width: 320px;
}

.onboarding-icon {
    font-size: 80px;
    margin-bottom: var(--spacing-lg);
    filter: drop-shadow(0 4px 12px rgba(232, 115, 74, 0.35));
    animation: gentleBounce 2s ease-in-out infinite;
}

.onboarding-title {
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-size: 30px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--boho-espresso) 0%, var(--boho-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.theme-dark .onboarding-title {
    background: linear-gradient(135deg, var(--boho-cream) 0%, var(--boho-tangerine) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.onboarding-text {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.onboarding-text.disclaimer {
    font-weight: 500;
    color: var(--tg-theme-text-color);
}

.onboarding-steps {
    text-align: left;
    margin-bottom: var(--spacing-lg);
}

.step {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    animation: slideInLeft 0.5s ease-out backwards;
}

.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

.step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(232, 115, 74, 0.35);
}

.step-text {
    font-size: 15px;
}

.disclaimer-list {
    list-style: none;
    text-align: left;
    margin-bottom: var(--spacing-lg);
}

.disclaimer-list li {
    padding: var(--spacing-sm) 0;
    font-size: 15px;
    animation: fadeIn 0.4s ease-out backwards;
}

.disclaimer-list li:nth-child(1) { animation-delay: 0.1s; }
.disclaimer-list li:nth-child(2) { animation-delay: 0.2s; }
.disclaimer-list li:nth-child(3) { animation-delay: 0.3s; }

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--tg-theme-secondary-bg-color);
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--gradient-primary);
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(232, 115, 74, 0.45);
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-title {
    font-size: 20px;
    margin-bottom: var(--spacing-sm);
}

.empty-text {
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   Loading & Error States
   ======================================== */

.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl);
    height: 100%;
}

.loading-spinner {
    font-size: 48px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-text {
    font-size: 16px;
    color: var(--tg-theme-hint-color);
    margin-top: var(--spacing-md);
}

.error-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.error-title {
    font-size: 18px;
    margin-bottom: var(--spacing-sm);
}

.error-text {
    color: var(--tg-theme-hint-color);
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   Toast
   ======================================== */

.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--tg-theme-text-color);
    color: var(--tg-theme-bg-color);
    border-radius: var(--radius-full);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    z-index: 200;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ========================================
   Modal
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 300;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background-color: var(--tg-theme-bg-color);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUpModal 0.3s ease;
}

@keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--tg-theme-hint-color);
    cursor: pointer;
    padding: var(--spacing-sm);
}

.modal-content {
    padding: var(--spacing-md);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-top: 1px solid var(--tg-theme-section-separator-color);
}

.modal-actions .btn {
    flex: 1;
}

/* Form Elements */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.form-select, .form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--tg-theme-text-color);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
}

.form-textarea::placeholder {
    color: var(--tg-theme-hint-color);
}

.date-range {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.date-range .form-input {
    flex: 1;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.radio-option input {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--tg-theme-hint-color);
    border-radius: 50%;
    position: relative;
}

.radio-option input:checked + .radio-custom {
    border-color: var(--tg-theme-button-color);
}

.radio-option input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background-color: var(--tg-theme-button-color);
    border-radius: 50%;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 360px) {
    .health-score-big {
        font-size: 48px;
    }

    .stats-cards {
        flex-wrap: wrap;
    }

    .stat-card {
        min-width: calc(50% - var(--spacing-xs));
    }
}

/* ========================================
   Scrollbar Styling
   ======================================== */

.content::-webkit-scrollbar {
    width: 4px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background-color: var(--boho-sand);
    border-radius: var(--radius-full);
}

.theme-dark .content::-webkit-scrollbar-thumb {
    background-color: var(--tg-theme-hint-color);
}

/* ========================================
   Animations - Lively & Friendly
   ======================================== */

/* Gentle bounce for icons */
@keyframes gentleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

/* Pop effect for nav items */
@keyframes gentlePop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Slide in from left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide in from right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Fade in up */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scale in */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse glow */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(214, 69, 80, 0.4);
    }
    50% {
        box-shadow: 0 0 15px 4px rgba(214, 69, 80, 0.25);
    }
}

/* Shake for attention */
@keyframes gentleShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-4px);
    }
    75% {
        transform: translateX(4px);
    }
}

/* Spin for loading */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Heartbeat for important elements */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    15% {
        transform: scale(1.1);
    }
    30% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.05);
    }
}

/* ========================================
   Animation Classes - Apply to elements
   ======================================== */

/* Dialog cards staggered animation */
.dialog-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.dialog-card:nth-child(1) { animation-delay: 0.05s; }
.dialog-card:nth-child(2) { animation-delay: 0.1s; }
.dialog-card:nth-child(3) { animation-delay: 0.15s; }
.dialog-card:nth-child(4) { animation-delay: 0.2s; }
.dialog-card:nth-child(5) { animation-delay: 0.25s; }
.dialog-card:nth-child(6) { animation-delay: 0.3s; }
.dialog-card:nth-child(7) { animation-delay: 0.35s; }
.dialog-card:nth-child(8) { animation-delay: 0.4s; }
.dialog-card:nth-child(9) { animation-delay: 0.45s; }
.dialog-card:nth-child(10) { animation-delay: 0.5s; }

/* Timeline items animation */
.timeline-item {
    animation: slideInLeft 0.4s ease-out backwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }

/* Cards animation */
.health-card,
.context-card,
.message-card,
.summary-card {
    animation: scaleIn 0.35s ease-out backwards;
}

.health-card { animation-delay: 0.1s; }
.context-card { animation-delay: 0.15s; }
.message-card { animation-delay: 0.2s; }
.summary-card { animation-delay: 0.25s; }

/* Technique cards */
.technique-card {
    animation: fadeInUp 0.35s ease-out backwards;
}

.technique-card:nth-child(1) { animation-delay: 0.1s; }
.technique-card:nth-child(2) { animation-delay: 0.2s; }
.technique-card:nth-child(3) { animation-delay: 0.3s; }

/* Severity badge pulse on high */
.severity-badge.high {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Toast animation */
.toast:not(.hidden) {
    animation: slideInRight 0.3s ease-out, fadeIn 0.3s ease-out;
}

/* Modal animation */
.modal-sheet {
    animation: slideInUp 0.3s ease-out;
}

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

/* Button hover ripple effect */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s, height 0.4s;
}

.btn:active::after {
    width: 200%;
    height: 200%;
}

/* Avatar bounce on hover */
.dialog-avatar {
    transition: transform 0.2s ease;
}

.dialog-card:hover .dialog-avatar {
    animation: gentleBounce 0.5s ease;
}

/* Health score number animation */
.health-score-big {
    animation: scaleIn 0.5s ease-out;
}

/* Progress bar animation */
.health-bar-fill {
    animation: growWidth 1s ease-out;
}

@keyframes growWidth {
    from {
        width: 0;
    }
}

/* Stat cards staggered */
.stat-card {
    animation: fadeInUp 0.3s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

/* Profile stats */
.profile-stat {
    transition: transform 0.2s ease;
}

.profile-stat:hover {
    transform: scale(1.05);
}

/* Toggle switch animation */
.toggle-slider {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   AI Chat Styles
   ======================================== */

/* Ask AI Button Section */
.ask-ai-section {
    margin: var(--spacing-lg) 0;
    text-align: center;
}

.btn-ai {
    background: linear-gradient(135deg, var(--boho-teal) 0%, var(--boho-turquoise) 100%);
    color: white;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(58, 155, 165, 0.35);
    font-family: 'Space Grotesk', 'DM Sans', sans-serif;
}

.btn-ai:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(58, 155, 165, 0.45);
}

.btn-ai i {
    margin-right: 8px;
}

.ask-ai-hint {
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    margin-top: var(--spacing-sm);
}

/* Chat Screen Layout */
.chat-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-screen .chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: 0;
}

.chat-header {
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
}

.ai-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--boho-teal) 0%, var(--boho-turquoise) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 10px rgba(58, 155, 165, 0.3);
}

/* Chat Context Card */
.chat-context-card {
    margin: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--tg-theme-secondary-bg-color);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--boho-teal);
}

.context-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--boho-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.context-text {
    font-size: 13px;
    color: var(--tg-theme-text-color);
    font-style: italic;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.context-techniques {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.technique-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.technique-tag.high {
    background: var(--severity-high-bg);
    color: var(--severity-high);
}

.technique-tag.medium {
    background: var(--severity-medium-bg);
    color: var(--severity-medium);
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Chat Message */
.chat-message {
    display: flex;
    gap: 10px;
    animation: fadeInUp 0.3s ease-out;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--boho-teal) 0%, var(--boho-turquoise) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message-content {
    max-width: 80%;
    display: flex;
    flex-direction: column;
}

.chat-message.user .message-content {
    align-items: flex-end;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.message-bubble.ai {
    background: var(--tg-theme-section-bg-color);
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: 18px 18px 18px 4px;
}

.message-bubble.user {
    background: linear-gradient(135deg, var(--boho-orange) 0%, var(--boho-tangerine) 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
}

.message-bubble p {
    margin: 0 0 8px 0;
}

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

.message-time {
    font-size: 10px;
    color: var(--tg-theme-hint-color);
    margin-top: 4px;
    padding: 0 4px;
}

/* AI Message Content Styles */
.suggestion-list {
    margin: 8px 0;
    padding-left: 20px;
}

.suggestion-list li {
    margin: 4px 0;
    color: var(--boho-teal);
    font-weight: 500;
}

.ai-point {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--tg-theme-section-separator-color);
}

.ai-point:last-of-type {
    border-bottom: none;
}

.point-icon {
    color: var(--boho-orange);
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-note {
    margin-top: 12px;
    padding: 10px;
    background: rgba(58, 155, 165, 0.1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--boho-teal);
}

.ai-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
}

.ai-step .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.ai-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    background: rgba(232, 115, 74, 0.1);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--boho-orange);
}

.ai-warning i {
    color: var(--boho-coral);
}

/* Quick Suggestions */
.quick-suggestions {
    display: flex;
    gap: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}

.quick-suggestions::-webkit-scrollbar {
    display: none;
}

.suggestion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--tg-theme-secondary-bg-color);
    border: 1px solid var(--tg-theme-section-separator-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--tg-theme-text-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: linear-gradient(135deg, rgba(58, 155, 165, 0.1) 0%, rgba(74, 189, 196, 0.1) 100%);
    border-color: var(--boho-teal);
    color: var(--boho-teal);
}

.suggestion-chip i {
    color: var(--boho-teal);
}

/* Chat Input */
.chat-input-container {
    padding: var(--spacing-md);
    background: var(--tg-theme-bg-color);
    border-top: 1px solid var(--tg-theme-section-separator-color);
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--tg-theme-section-bg-color);
    border-radius: var(--radius-full);
    padding: 4px 4px 4px 16px;
    border: 1px solid var(--tg-theme-section-separator-color);
    transition: border-color 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--boho-teal);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 15px;
    color: var(--tg-theme-text-color);
    padding: 8px 0;
    outline: none;
}

.chat-input::placeholder {
    color: var(--tg-theme-hint-color);
}

.send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--boho-teal) 0%, var(--boho-turquoise) 100%);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(58, 155, 165, 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--boho-teal);
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ========================================
   Safe Area Support (iOS)
   ======================================== */

@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(env(safe-area-inset-top) + var(--spacing-md));
    }

    .bottom-nav {
        padding-bottom: calc(env(safe-area-inset-bottom) + var(--spacing-sm));
    }

    #app {
        padding-bottom: calc(80px + env(safe-area-inset-bottom));
    }
}

/* ========================================
   Loading Overlay
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    color: var(--text-primary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   Empty State
   ======================================== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    color: var(--text-secondary);
    min-height: 200px;
}

.empty-state h3 {
    margin: var(--spacing-md) 0 var(--spacing-sm);
    color: var(--text-primary);
    font-size: var(--font-size-lg);
}

.empty-state p {
    font-size: var(--font-size-sm);
    margin: 0;
}

.empty-state .lucide-icon-xl,
.empty-state .lucide-icon-lg {
    opacity: 0.5;
}

/* ========================================
   Dynamic Dialog Cards (API Data)
   ======================================== */

.dialog-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dialog-card:hover {
    background: var(--hover-bg);
    transform: translateX(4px);
}

.dialog-card:active {
    transform: scale(0.98);
}

.dialog-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.dialog-info {
    flex: 1;
    min-width: 0;
}

.dialog-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.dialog-name {
    font-weight: 600;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dialog-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.dialog-meta span::after {
    content: '•';
    margin-left: var(--spacing-sm);
    opacity: 0.5;
}

.dialog-meta span:last-child::after {
    display: none;
}

.dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.health-score {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.dialog-arrow {
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ========================================
   Analysis Cards (API Data)
   ======================================== */

.analysis-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.analysis-card:hover {
    background: var(--hover-bg);
}

.analysis-card:active {
    transform: scale(0.98);
}

.analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.analysis-date {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.analysis-techniques {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.analysis-summary {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* ========================================
   Technique Items (Analysis Detail)
   ======================================== */

.technique-item {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.technique-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.technique-name {
    font-weight: 600;
    color: var(--text-primary);
}

.confidence {
    font-size: var(--font-size-sm);
    color: var(--accent-color);
    font-weight: 500;
}

.technique-evidence {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin: 0;
    font-style: italic;
}

/* ========================================
   Telegram-Specific Styles
   ======================================== */

body:not(.simulator-mode) {
    background: var(--tg-theme-bg-color, var(--bg-primary));
}

body:not(.simulator-mode) .device-frame {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

body:not(.simulator-mode) .device-screen {
    border-radius: 0 !important;
}

body:not(.simulator-mode) .dynamic-island {
    display: none !important;
}
