/* 응급 페이지 공통 스타일 */
:root {
    --em-danger: #E53935;
    --em-danger-dark: #B71C1C;
    --em-warn: #FF9800;
    --em-safe: #43A047;
    --em-bg: #FFF5F5;
}

body.em-body {
    font-family: 'Pretendard', -apple-system, system-ui, sans-serif;
    background: var(--em-bg);
    color: #2D2D2D;
    margin: 0;
    padding: 0;
    line-height: 1.55;
}

.em-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 16px 80px;
}

.em-header {
    background: linear-gradient(135deg, var(--em-danger) 0%, var(--em-danger-dark) 100%);
    color: #fff;
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 18px;
    box-shadow: 0 8px 24px rgba(229, 57, 53, 0.28);
}

.em-header h1 {
    font-size: 1.6rem;
    margin: 0 0 8px;
    font-weight: 800;
}

.em-header p {
    margin: 0;
    opacity: 0.95;
    font-size: 0.95rem;
}

.em-urgent-btn {
    display: block;
    width: 100%;
    padding: 22px 20px;
    background: linear-gradient(135deg, #E53935 0%, #C62828 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 1.4rem;
    font-weight: 900;
    cursor: pointer;
    margin-bottom: 14px;
    box-shadow: 0 10px 30px rgba(229, 57, 53, 0.45);
    transition: transform 0.1s;
    letter-spacing: -0.5px;
}

.em-urgent-btn:active { transform: scale(0.98); }

.em-urgent-btn .em-sub {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.9;
    margin-top: 4px;
}

.em-quick-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.em-quick-btn {
    padding: 18px 12px;
    background: #fff;
    border: 2px solid var(--em-danger);
    border-radius: 16px;
    color: var(--em-danger);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    display: block;
}

.em-quick-btn:active { background: var(--em-danger); color: #fff; }

.em-section {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.em-section h2 {
    font-size: 1.1rem;
    margin: 0 0 12px;
    font-weight: 700;
    color: #2D2D2D;
}

.em-section h3 { font-size: 0.98rem; margin: 14px 0 6px; font-weight: 700; }

.em-alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-size: 0.92rem;
}

.em-alert.danger { background: #FFEBEE; color: var(--em-danger-dark); border-left: 4px solid var(--em-danger); }
.em-alert.warn { background: #FFF3E0; color: #E65100; border-left: 4px solid var(--em-warn); }
.em-alert.safe { background: #E8F5E9; color: #1B5E20; border-left: 4px solid var(--em-safe); }

.em-checklist { list-style: none; padding: 0; margin: 0; }
.em-checklist li {
    padding: 10px 12px 10px 36px;
    background: #FAFAFA;
    border-radius: 10px;
    margin-bottom: 6px;
    font-size: 0.95rem;
    position: relative;
}
.em-checklist li::before {
    content: '✓';
    position: absolute;
    left: 12px;
    top: 10px;
    font-weight: 800;
    color: var(--em-danger);
}

.em-card {
    background: #fff;
    border: 1px solid #F0E5E5;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}

.em-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.em-head strong { font-size: 1.05rem; }
.em-dist {
    background: var(--em-danger);
    color: #fff;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.em-meta { font-size: 0.85rem; color: #666; margin-bottom: 6px; }
.em-beds { margin-right: 8px; }
.em-ob { color: var(--em-danger); font-weight: 700; }
.em-addr { font-size: 0.88rem; color: #555; margin-bottom: 10px; }

.em-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.em-btn {
    flex: 1;
    min-width: 90px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
}
.em-btn-call { background: var(--em-danger); color: #fff; }
.em-btn-map { background: #2196F3; color: #fff; }
.em-btn-save { background: #FCE4EC; color: #C2185B; border: 1px solid #F8BBD0; }

.em-source {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 8px;
    vertical-align: middle;
}
.em-source.live { background: #E8F5E9; color: #1B5E20; }
.em-source.fallback { background: #FFF3E0; color: #E65100; }

.em-husband-banner {
    background: #263238;
    color: #fff;
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.em-husband-banner strong { font-size: 1rem; }
.em-husband-banner .em-switch {
    background: #fff;
    color: #263238;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.em-nav {
    background: #fff;
    border-radius: 14px;
    padding: 8px;
    margin-bottom: 14px;
    display: flex;
    gap: 6px;
    overflow-x: auto;
}
.em-nav a {
    flex-shrink: 0;
    padding: 8px 14px;
    background: #F5F5F5;
    border-radius: 10px;
    text-decoration: none;
    color: #555;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
}
.em-nav a.active { background: var(--em-danger); color: #fff; }

.em-back {
    display: inline-block;
    padding: 6px 14px;
    background: #fff;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.em-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--em-danger);
    color: #fff;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(229, 57, 53, 0.5);
    z-index: 999;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* 남편 모드: 단순/큰글씨 */
body.em-husband-mode .em-wrap { max-width: 520px; }
body.em-husband-mode .em-urgent-btn { font-size: 1.7rem; padding: 28px; }
body.em-husband-mode .em-section { font-size: 1.05rem; }
body.em-husband-mode .em-btn { font-size: 1rem; padding: 14px; }
body.em-husband-mode .em-husband-banner { background: #1B5E20; }

/* 로딩 */
.em-loading {
    padding: 20px;
    text-align: center;
    color: #888;
}
.em-loading::before {
    content: '🔄';
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.em-footer-note {
    margin-top: 24px;
    padding: 14px;
    background: #FFF8E1;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #7E6414;
    line-height: 1.6;
}

@media (max-width: 420px) {
    .em-header h1 { font-size: 1.35rem; }
    .em-urgent-btn { font-size: 1.2rem; padding: 20px; }
}
