/* ===================================================
   Arogya Bot — Complete Style
   =================================================== */

:root {
    --bg: #0a1628;
    --surface: #0f1f3a;
    --surface2: #15294a;
    --surface3: #1c3459;
    --surface4: #234068;
    --border: rgba(56, 189, 248, 0.08);
    --border2: rgba(56, 189, 248, 0.18);
    --border3: rgba(56, 189, 248, 0.32);
    --accent: #38bdf8;
    --accent2: #818cf8;
    --accent3: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --text: #eef4ff;
    --text2: #8ba3be;
    --text3: #4e6580;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow: 0 12px 48px rgba(0, 0, 0, 0.65);
    --shadow-sm: 0 3px 14px rgba(0, 0, 0, 0.4);
    --glow: 0 0 50px rgba(56, 189, 248, 0.08);
    --trans: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --chat-height: calc(100vh - 160px);
    --chat-min: 500px;
    --chat-max: 800px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Background ────────────────────────────────── */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
    background-size: 54px 54px;
}

.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.orb1 {
    width: 600px;
    height: 600px;
    background: rgba(56, 189, 248, 0.04);
    top: -200px;
    right: -160px;
}

.orb2 {
    width: 450px;
    height: 450px;
    background: rgba(129, 140, 248, 0.04);
    bottom: 40px;
    left: -120px;
}

/* ── Layout ────────────────────────────────────── */
.wrap {
    max-width: 1600px;
    margin: 0 auto;
    padding: 14px 18px 30px;
    position: relative;
    z-index: 1;
}

/* ── Header ────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-top: 6px;
    flex-wrap: nowrap;
}

.logo-mark {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow);
    transition: var(--trans);
}

.logo-mark:hover {
    transform: scale(1.05) rotate(-3deg);
}

.logo-mark i {
    font-size: 20px;
    color: white;
}

.brand-text {
    min-width: 0;
    flex-shrink: 1;
}

.brand-text h1 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    white-space: nowrap;
}

.brand-text h1 .accent {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-size: 0.7rem;
    color: var(--text2);
    margin-top: 1px;
    white-space: nowrap;
}

.header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.lang-btn {
    background: rgba(15, 31, 58, 0.88);
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 7px 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: var(--trans);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lang-btn:hover {
    border-color: var(--accent);
    background: var(--surface3);
}

.LogBtn button {
    padding: 7px 14px;
    border: 1px solid var(--border2);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--surface2), var(--surface3));
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
    font-family: inherit;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.LogBtn button:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.15);
    transform: translateY(-1px);
}

.LogBtn button .user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 11px;
    color: #fff;
    flex-shrink: 0;
}

.LogBtn button .user-name {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.LogBtn button .user-caret {
    font-size: 9px;
    opacity: 0.6;
}

/* ── Emergency Strip ───────────────────────────── */
.emergency-strip {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.08), rgba(251, 191, 36, 0.05));
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pulse-icon {
    animation: pulse 1.2s infinite;
    font-size: 13px;
    flex-shrink: 0;
    color: var(--danger);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.2)
    }
}

.emergency-content {
    flex: 1;
    line-height: 1.4;
    font-size: 11px;
    color: #fca5a5;
}

.emergency-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 5px;
    font-size: 13px;
    transition: var(--trans);
}

.emergency-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
}

/* ── App Grid ──────────────────────────────────── */
.app-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 14px;
    align-items: start;
}

/* ── Panels ────────────────────────────────────── */
.panel {
    background: rgba(15, 31, 58, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: border-color 0.3s;
}

.panel:hover {
    border-color: var(--border2);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(11, 18, 32, 0.97);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.panel-icon {
    font-size: 15px;
}

.live-tag {
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent3);
    border: 1px solid rgba(52, 211, 153, 0.25);
    border-radius: 8px;
    font-size: 7px;
    font-weight: 800;
    padding: 2px 6px;
    letter-spacing: 1px;
    animation: blink 3s infinite;
}

.hosp-count {
    background: var(--accent);
    color: #fff;
    border-radius: 14px;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    min-width: 16px;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.icon-btn {
    background: rgba(23, 52, 89, 0.9);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
    color: var(--text);
}

.icon-btn:hover {
    background: var(--surface3);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.icon-btn.active {
    border-color: var(--accent3);
    background: rgba(52, 211, 153, 0.15);
}

.mic-btn.listening {
    border-color: var(--danger);
    background: rgba(248, 113, 113, 0.2);
    animation: pulse 1s infinite;
}

/* ── Chat Panel ────────────────────────────────── */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: var(--chat-height);
    min-height: var(--chat-min);
    max-height: var(--chat-max);
}

/* ── Chat History Dropdown ────────────────────── */
.chat-history-dropdown {
    background: var(--surface2);
    border-bottom: 1px solid var(--border2);
    padding: 8px 12px;
    max-height: 160px;
    overflow-y: auto;
    flex-shrink: 0;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: var(--text2);
    font-size: 11px;
    margin-bottom: 5px;
}

.history-header button {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    font-size: 13px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.history-item {
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 10px;
    color: var(--text2);
    cursor: pointer;
    transition: var(--trans);
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
}

.history-item:hover {
    background: var(--surface3);
    color: var(--text);
}

.history-item .h-time {
    color: var(--text3);
    font-size: 8px;
}

.history-item .h-delete {
    color: var(--danger);
    cursor: pointer;
    padding: 0 3px;
    opacity: 0.4;
}

.history-item .h-delete:hover {
    opacity: 1;
}

/* ── Chat Messages ─────────────────────────────── */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 8px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Welcome Message */
.welcome-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: linear-gradient(135deg, var(--surface2), var(--surface));
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 14px;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.welcome-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--glow);
}

.welcome-avatar i {
    font-size: 16px;
    color: white;
}

.welcome-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 3px;
}

.welcome-body p {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text2);
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.chip {
    background: var(--surface3);
    border: 1px solid var(--border2);
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 10px;
    color: var(--accent);
    cursor: pointer;
    transition: var(--trans);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    user-select: none;
}

.chip:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.chip i {
    font-size: 10px;
}

/* Messages */
.message {
    display: flex;
    gap: 7px;
    max-width: 94%;
    animation: msgIn 0.2s ease-out;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(5px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.bot-message {
    align-self: flex-start;
}

.msg-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.bot-message .msg-avatar {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: var(--glow);
    color: white;
}

.user-message .msg-avatar {
    background: var(--surface3);
    border: 1px solid var(--border2);
}

.msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.user-message .msg-bubble {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border-bottom-right-radius: 3px;
}

.bot-message .msg-bubble {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    border-bottom-left-radius: 3px;
}

.msg-time {
    font-size: 8px;
    color: var(--text3);
    margin-top: 2px;
}

.user-message .msg-time {
    text-align: right;
}

.bot-message .msg-time {
    text-align: left;
}

/* Markdown styling */
.md-h1 {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent);
    margin: 6px 0 3px;
}

.md-h2 {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent);
    margin: 5px 0 3px;
}

.md-h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent2);
    margin: 4px 0 2px;
}

.md-li {
    padding-left: 10px;
    margin: 2px 0;
    line-height: 1.6;
    display: block;
}

.md-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.urgency-banner {
    border-radius: var(--radius-xs);
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 11px;
    font-weight: 600;
}

.urgency-high {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.26);
    color: #fca5a5;
}

.urgency-medium {
    background: rgba(251, 191, 36, 0.10);
    border: 1px solid rgba(251, 191, 36, 0.22);
    color: #fde68a;
}

.disclaimer {
    font-size: 9px;
    color: var(--text3);
    margin-top: 6px;
    padding-top: 5px;
    border-top: 1px solid var(--border);
    font-style: italic;
}

.typing-bubble {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    border-bottom-left-radius: 3px;
    width: fit-content;
}

.typing-bubble span {
    width: 5px;
    height: 5px;
    background: var(--text3);
    border-radius: 50%;
    animation: dot 1.4s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) {
    animation-delay: 0.16s;
}

.typing-bubble span:nth-child(3) {
    animation-delay: 0.32s;
}

.typing-label {
    font-size: 11px;
    color: var(--text3);
    margin-left: 5px;
}

@keyframes dot {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4
    }

    40% {
        transform: scale(1);
        opacity: 1
    }
}

/* ── Chat Input ────────────────────────────────── */
.chat-input-bar {
    padding: 10px 14px;
    background: rgba(11, 18, 32, 0.98);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.rate-bar {
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-xs);
    padding: 5px 10px;
    margin-bottom: 6px;
}

.rate-text {
    font-size: 10px;
    color: var(--warning);
    font-weight: 500;
    display: block;
    margin-bottom: 3px;
}

.rate-track {
    height: 3px;
    background: rgba(251, 191, 36, 0.13);
    border-radius: 2px;
    overflow: hidden;
}

.rate-fill {
    height: 100%;
    background: var(--warning);
    border-radius: 2px;
    transition: width 0.1s linear;
}

.location-banner {
    background: rgba(56, 189, 248, 0.07);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-xs);
    padding: 5px 8px;
    font-size: 10px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.location-banner i {
    font-size: 13px;
    flex-shrink: 0;
}

.loc-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text3);
    font-size: 13px;
    transition: var(--trans);
    padding: 2px 4px;
    border-radius: 4px;
}

.loc-clear:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

.input-row {
    display: flex;
    gap: 6px;
    align-items: flex-end;
}

.input-row textarea {
    flex: 1;
    background: var(--surface3);
    border: 1.5px solid var(--border2);
    border-radius: 18px;
    padding: 9px 14px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    transition: var(--trans);
    outline: none;
    resize: none;
    min-height: 38px;
    max-height: 100px;
    line-height: 1.5;
}

.input-row textarea::placeholder {
    color: var(--text3);
    font-size: 12px;
}

.input-row textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    background: var(--surface4);
}

.send-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

.send-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.send-btn i {
    font-size: 13px;
    color: white;
}

.input-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 4px;
}

.char-count {
    font-size: 9px;
    color: var(--text3);
}

.char-count.warn {
    color: var(--warning);
}

.char-count.limit {
    color: var(--danger);
}

.input-hints {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.input-hints span {
    font-size: 9px;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* ── Map Panel ─────────────────────────────────── */
.map-panel {
    position: sticky;
    top: 14px;
    display: flex;
    flex-direction: column;
    max-height: var(--chat-height);
    min-height: 420px;
}

.map-container {
    height: 240px;
    min-height: 180px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.map-container .leaflet-control-zoom {
    border: none;
}

.map-container .leaflet-control-zoom a {
    background: var(--surface2);
    color: var(--text);
    border-color: var(--border2);
}

.map-container .leaflet-control-zoom a:hover {
    background: var(--surface3);
}

.map-container .leaflet-routing-container {
    display: none;
}

.hospitals-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 240px;
}

.hospitals-scroll::-webkit-scrollbar {
    width: 4px;
}

.hospitals-scroll::-webkit-scrollbar-track {
    background: var(--surface);
}

.hospitals-scroll::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 8px;
}

.hospitals-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.panel-footer {
    padding: 6px 12px;
    border-top: 1px solid var(--border);
    background: rgba(11, 18, 32, 0.9);
}

.footer-note {
    font-size: 9px;
    color: var(--text3);
    text-align: center;
}

/* Hospital Cards */
.hospital-card {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 10px;
    transition: var(--trans);
    animation: fadeInUp 0.25s ease-out;
    cursor: pointer;
}

.hospital-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.hospital-card .hosp-name {
    font-weight: 700;
    font-size: 11px;
    color: var(--text);
    margin-bottom: 2px;
}

.hospital-card .hosp-row {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.hospital-card .hosp-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: 600;
}

.hospital-card .tag-dist {
    background: rgba(56, 189, 248, 0.10);
    color: var(--accent);
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.hospital-card .tag-urgent {
    background: rgba(251, 191, 36, 0.10);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.18);
}

.hospital-card .tag-emergency {
    background: rgba(248, 113, 113, 0.10);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.18);
}

.hospital-card .tag-type {
    background: var(--surface3);
    color: var(--text2);
    border: 1px solid var(--border);
}

.hospital-card .hosp-address {
    font-size: 9px;
    color: var(--text3);
    margin-bottom: 2px;
}

.hospital-card .hosp-phone {
    font-size: 10px;
    color: var(--accent2);
    font-weight: 500;
    margin-bottom: 2px;
}

.hospital-card .hosp-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 3px;
}

.hospital-card .directions-btn,
.hospital-card .call-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 9px;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    transition: var(--trans);
    cursor: pointer;
}

.hospital-card .directions-btn:hover,
.hospital-card .call-btn:hover {
    background: var(--surface4);
    border-color: var(--accent);
}

.empty-hospitals {
    text-align: center;
    padding: 20px 12px;
    color: var(--text3);
}

.empty-hospitals .empty-icon {
    margin-bottom: 8px;
    opacity: 0.5;
    font-size: 28px;
    color: var(--text3);
}

.empty-hospitals p {
    font-size: 11px;
    line-height: 1.6;
    margin-bottom: 4px;
}

.empty-hospitals p:first-of-type {
    font-size: 12px;
    color: var(--text2);
    font-weight: 600;
}

.locate-btn {
    background: linear-gradient(135deg, var(--surface2), var(--surface3));
    border: 1px solid var(--border2);
    border-radius: 24px;
    color: var(--accent);
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: var(--trans);
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.locate-btn:hover {
    background: rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
    border-color: var(--accent);
}

/* ── Toast ─────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 11px;
    color: var(--text);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
    max-width: 88vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── AUTH MODAL ────────────────────────────────── */
.Auth {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    padding: 16px;
}

.Auth.show {
    display: flex;
}

.auth-box {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(145deg, var(--surface), var(--surface2));
    border: 1px solid var(--border2);
    border-radius: 18px;
    padding: 36px 20px 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    animation: popup 0.28s ease;
    max-height: 90dvh;
    overflow-y: auto;
}

@keyframes popup {
    from {
        transform: scale(0.92) translateY(16px);
        opacity: 0
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
    z-index: 2;
}

.close-btn:hover {
    background: rgba(248, 113, 113, 0.25);
    transform: scale(1.06);
}

.auth-switcher {
    display: flex;
    background: var(--bg);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 18px;
    gap: 3px;
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    border: none;
    padding: 8px;
    border-radius: 8px;
    background: transparent;
    color: var(--text2);
    cursor: pointer;
    font-weight: 600;
    transition: 0.25s;
    font-size: 12px;
    font-family: inherit;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 3px 10px rgba(56, 189, 248, 0.25);
}

.form-section {
    display: none;
}

.form-section.active-form {
    display: block;
}

.form-section h2 {
    color: var(--text);
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 3px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.form-subtitle {
    text-align: center;
    font-size: 11px;
    color: var(--text3);
    margin-bottom: 12px;
}

.form-section input {
    width: 100%;
    padding: 9px 12px;
    margin: 3px 0;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--surface3);
    color: var(--text);
    outline: none;
    font-size: 13px;
    transition: var(--trans);
    font-family: inherit;
}

.form-section input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    background: var(--surface4);
}

.form-section input.field-error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

.field-err-msg {
    font-size: 10px;
    color: var(--danger);
    margin-top: -2px;
    margin-bottom: 2px;
    padding-left: 4px;
}

.submit-btn {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--trans);
    font-family: inherit;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.28);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.forgot-link {
    color: var(--accent);
    font-size: 11px;
    text-decoration: none;
    transition: var(--trans);
}

.forgot-link:hover {
    color: var(--accent2);
    text-decoration: underline;
}

.auth-note {
    font-size: 10px;
    color: var(--text3);
    text-align: center;
    margin-top: 8px;
    line-height: 1.5;
}

/* ── Verify Banner ─────────────────────────────── */
.verify-banner {
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 11px;
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.verify-resend-btn,
.verify-check-btn {
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.2);
    color: #fde68a;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: var(--trans);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.verify-resend-btn:hover,
.verify-check-btn:hover {
    background: rgba(251, 191, 36, 0.2);
}

.verify-dismiss {
    background: none;
    border: none;
    color: var(--text3);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 12px;
    transition: var(--trans);
}

.verify-dismiss:hover {
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
}

/* ── User Dropdown ─────────────────────────────── */
.user-dropdown {
    position: fixed;
    z-index: 600;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 12px;
    padding: 5px;
    min-width: 180px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
    animation: popup 0.18s ease;
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 8px;
}

.dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
}

.dropdown-name {
    font-weight: 700;
    font-size: 12px;
    color: var(--text);
}

.dropdown-email {
    font-size: 9px;
    color: var(--text3);
    margin-top: 1px;
    word-break: break-all;
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 3px 0;
}

.dropdown-item {
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text2);
    transition: var(--trans);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-item:hover {
    background: var(--surface3);
    color: var(--text);
}

.badge-verified {
    font-size: 8px;
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent3);
    border: 1px solid rgba(52, 211, 153, 0.2);
    border-radius: 14px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.badge-unverified {
    font-size: 8px;
    background: rgba(251, 191, 36, 0.10);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 14px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* ── Profile Modal ─────────────────────────────── */
.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 800;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.profile-card {
    background: linear-gradient(145deg, var(--surface), var(--surface2));
    border: 1px solid var(--border2);
    border-radius: 18px;
    padding: 28px 18px 22px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    text-align: center;
    animation: popup 0.25s ease;
    max-height: 90dvh;
    overflow-y: auto;
}

.profile-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: var(--text2);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
}

.profile-close:hover {
    background: var(--surface4);
    color: var(--text);
}

.profile-avatar-xl {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
}

.profile-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.profile-email {
    font-size: 11px;
    color: var(--text2);
    margin-bottom: 2px;
}

.profile-joined {
    font-size: 10px;
    color: var(--text3);
    margin-bottom: 10px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin: 10px 0;
}

.pstat {
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 8px;
    text-align: center;
}

.pstat-val {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
}

.pstat-lbl {
    display: block;
    font-size: 9px;
    color: var(--text3);
    margin-top: 2px;
}

.profile-logout-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 8px;
    background: rgba(248, 113, 113, 0.06);
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
    font-family: inherit;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.profile-logout-btn:hover {
    background: rgba(248, 113, 113, 0.15);
    transform: translateY(-1px);
}

.profile-verified-badge,
.profile-unverified-badge {
    display: inline-block;
    font-size: 10px;
    border-radius: 14px;
    padding: 2px 10px;
    margin-bottom: 8px;
}

.profile-verified-badge {
    background: rgba(52, 211, 153, 0.12);
    color: var(--accent3);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

.profile-unverified-badge {
    background: rgba(251, 191, 36, 0.10);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--surface3);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ── Skeletons ──────────────────────────────────── */
.hosp-skeleton {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: linear-gradient(90deg, var(--surface2) 25%, var(--surface3) 50%, var(--surface2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0
    }

    100% {
        background-position: -200% 0
    }
}

.skel-line {
    height: 7px;
    border-radius: 4px;
    background: var(--surface3);
    margin-bottom: 5px;
}

.skel-line.w60 {
    width: 60%
}

.skel-line.w80 {
    width: 80%
}

.skel-line.w40 {
    width: 40%
}

/* ── Responsive ────────────────────────────────── */
@media (max-width:1100px) {
    .app-grid {
        grid-template-columns: 1fr 320px;
    }

    :root {
        --chat-height: calc(100vh - 200px);
        --chat-min: 400px;
    }
}

@media (max-width:840px) {
    :root {
        --chat-height: 440px;
        --chat-min: 320px;
        --chat-max: 560px;
    }

    .wrap {
        padding: 10px 10px 20px;
    }

    .app-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .map-panel {
        position: static;
        max-height: none;
        min-height: auto;
    }

    .map-container {
        height: 200px;
    }

    .hospitals-scroll {
        max-height: 200px;
    }

    .header {
        gap: 6px;
        padding-top: 4px;
    }

    .logo-mark {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .logo-mark i {
        font-size: 16px;
    }

    .brand-text h1 {
        font-size: 1.3rem;
    }

    .tagline {
        display: none;
    }

    .header-controls .lang-btn span {
        display: none;
    }

    .header-controls .lang-btn {
        padding: 6px 8px;
    }

    .LogBtn button {
        padding: 6px 10px;
        font-size: 11px;
    }

    .input-hints {
        display: none;
    }

    .msg-bubble {
        font-size: 12px;
        padding: 8px 12px;
    }

    .chat-messages {
        padding: 10px;
        gap: 8px;
    }

    .auth-box {
        padding: 30px 16px 18px;
    }
}

@media (max-width:600px) {
    :root {
        --chat-height: calc(100dvh - 280px);
        --chat-min: 260px;
        --chat-max: 400px;
    }

    .header {
        gap: 5px;
    }

    .brand-text h1 {
        font-size: 1.1rem;
    }

    .msg-bubble {
        font-size: 12px;
        padding: 7px 10px;
    }

    .message {
        max-width: 98%;
    }

    .chat-messages {
        padding: 8px;
        gap: 6px;
    }

    .chat-input-bar {
        padding: 6px 8px;
    }

    .input-row textarea {
        padding: 7px 10px;
        min-height: 32px;
        border-radius: 14px;
        font-size: 12px;
    }

    .send-btn {
        width: 32px;
        height: 32px;
    }

    .send-btn i {
        font-size: 11px;
    }

    .panel-header {
        padding: 8px 10px;
    }

    .panel-title {
        font-size: 11px;
    }

    .icon-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .map-container {
        height: 160px;
    }

    .hospitals-scroll {
        max-height: 160px;
        padding: 6px;
    }

    .emergency-strip {
        font-size: 10px;
        padding: 6px 8px;
    }

    .toast {
        font-size: 11px;
        padding: 6px 12px;
        max-width: 94vw;
    }

    .quick-chips {
        gap: 3px;
    }

    .chip {
        font-size: 9px;
        padding: 3px 8px;
    }

    .welcome-msg {
        padding: 10px;
        gap: 6px;
    }

    .welcome-body p {
        font-size: 11px;
    }

    .welcome-avatar {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .welcome-avatar i {
        font-size: 13px;
    }

    .profile-card {
        padding: 24px 12px 16px;
    }

    .auth-box {
        padding: 28px 12px 16px;
    }

    .LogBtn button .user-name {
        max-width: 40px;
        font-size: 10px;
    }

    .emergency-content {
        font-size: 10px;
    }
}

@media (max-width:380px) {
    :root {
        --chat-height: 220px;
        --chat-min: 180px;
    }

    .brand-text h1 {
        font-size: 0.9rem;
    }

    .logo-mark {
        width: 32px;
        height: 32px;
    }

    .logo-mark i {
        font-size: 13px;
    }

    .msg-bubble {
        font-size: 11px;
        padding: 6px 8px;
    }
}

@media (max-height:500px) {
    :root {
        --chat-height: 180px;
        --chat-min: 140px;
    }

    .hospitals-scroll {
        max-height: 120px;
    }

    .map-container {
        height: 120px;
    }

    .header {
        padding-top: 2px;
    }

    .logo-mark {
        width: 32px;
        height: 32px;
    }

    .logo-mark i {
        font-size: 13px;
    }

    .brand-text h1 {
        font-size: 1.1rem;
    }
}