.panic-fab {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9990;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #b91c1c, #dc2626);
    color: #fff;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(185, 28, 28, 0.45);
    transition: transform 0.15s, box-shadow 0.15s;
}

.panic-fab:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 32px rgba(185, 28, 28, 0.55);
}

.panic-fab svg { width: 22px; height: 22px; flex-shrink: 0; }

.panic-fab-text { white-space: nowrap; }

@media (max-width: 520px) {
    .panic-fab { padding: 14px; border-radius: 50%; }
    .panic-fab-text { display: none; }
}

.panic-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(12, 30, 45, 0.72);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.panic-overlay.is-hidden { display: none !important; }

.panic-modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.panic-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 20px 12px;
    border-bottom: 1px solid #e8eef2;
}

.panic-header h2 {
    font-size: 1.1rem;
    color: #0c2d4a;
    margin-bottom: 4px;
}

.panic-header p {
    font-size: 0.82rem;
    color: #5c6b7a;
    line-height: 1.6;
}

.panic-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0 4px;
}

.panic-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 12px;
    background: #f4f7fa;
    border-bottom: 1px solid #e8eef2;
}

.panic-tab {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 6px;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    color: #5c6b7a;
    cursor: pointer;
}

.panic-tab.is-active {
    background: #fff;
    color: #0c2d4a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.panic-pane {
    display: none;
    padding: 20px;
}

.panic-pane.is-active { display: block; }

.panic-breath-ring {
    width: 180px;
    height: 180px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 4px solid #1a6b8a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease, border-color 0.4s;
}

.panic-breath-ring.inhale { transform: scale(1.12); border-color: #2a7a8c; }
.panic-breath-ring.hold { transform: scale(1.12); border-color: #0c2d4a; }
.panic-breath-ring.exhale { transform: scale(0.92); border-color: #5a9aaa; }

.panic-breath-phase {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1a6b8a;
}

.panic-breath-timer {
    font-size: 2rem;
    font-weight: 700;
    color: #0c2d4a;
    font-variant-numeric: tabular-nums;
}

.panic-breath-hint {
    text-align: center;
    font-size: 0.78rem;
    color: #5c6b7a;
    margin-bottom: 16px;
}

.panic-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.panic-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.panic-btn-primary { background: #0c2d4a; color: #fff; }
.panic-btn-muted { background: #e8eef2; color: #333; }

.panic-reminders {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panic-reminders li {
    padding: 12px 14px;
    background: #f4f7fa;
    border-right: 3px solid #1a6b8a;
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.75;
    color: #1f2d3d;
}

.panic-foot {
    margin-top: 14px;
    font-size: 0.74rem;
    color: #888;
}

.panic-surf-steps {
    padding-right: 20px;
    font-size: 0.86rem;
    line-height: 1.85;
    color: #333;
}

.panic-surf-steps li { margin-bottom: 10px; }

.panic-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #1a6b8a;
}

.panic-soon-box {
    text-align: center;
    padding: 24px 12px;
}

.panic-soon-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.panic-soon-box h3 {
    font-size: 1rem;
    color: #0c2d4a;
    margin-bottom: 10px;
}

.panic-soon-box p {
    font-size: 0.84rem;
    color: #5c6b7a;
    line-height: 1.8;
    margin-bottom: 8px;
}

.panic-modal-footer {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 14px 20px;
    border-top: 1px solid #e8eef2;
    background: #fafbfc;
    border-radius: 0 0 16px 16px;
}

.panic-modal-footer a {
    font-size: 0.8rem;
    font-weight: 600;
    color: #1a6b8a;
    text-decoration: none;
}

body.dark .panic-modal { background: #1a1a2e; color: #d8d8e0; }
body.dark .panic-header { border-color: #2a2a3a; }
body.dark .panic-header h2 { color: #e0e0f0; }
body.dark .panic-tabs { background: #121220; border-color: #2a2a3a; }
body.dark .panic-tab.is-active { background: #1a1a2e; color: #e0e0f0; }
body.dark .panic-reminders li { background: #121220; color: #d8d8e0; }
body.dark .panic-breath-timer { color: #e0e0f0; }
body.dark .panic-modal-footer { background: #121220; border-color: #2a2a3a; }
