:root { 
    --brand-blue: #0056b3; 
    --accent: #D4AF37; /* Gold Standard Accent #D4AF37 */
    --dark: #1a1a1a; 
    --light-bg: #f4f4f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}html, body { margin: 0; padding: 0; width: 100%; } 
.main-wrapper{
background: #f4f4f9;
}
.main-wrapper.padded{
    padding-top: 30px;
    padding-bottom: 30px;
}
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; background: #333333; color: #333; }

/* MAP & SEARCH HEADER */
#map { height: 400px; width: 100%; border-bottom: 4px solid var(--brand-blue); background: #e5e3df; }
.content-padding { padding: 20px; max-width: 1000px; margin: 0 auto; width: 100%; }
.search-box { position: relative; margin: -30px auto 20px auto; background: white; border-radius: 10px; padding: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 100; width: 90%; max-width: 800px; }
#address-search { width: 100%; border: 1px solid #ddd; padding: 15px; font-size: 16px; border-radius: 8px; outline: none; transition: border-color 0.3s; }
#address-search:focus { border-color: var(--brand-blue); }

/* HAZARD DATA DISPLAY */
.hazard-data-header {
    background: var(--dark);
    color: var(--accent);
    padding: 20px;
    border-radius: 8px;
    border-bottom: 4px solid var(--accent);
    margin-bottom: 25px;
}

.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 15px; margin-top: 20px; }
.data-card { background: white; padding: 20px; border-radius: 8px; border-top: 4px solid var(--brand-blue); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.data-card h4 { margin: 0 0 12px 0; font-size: 14px; color: #666; text-transform: uppercase; letter-spacing: 0.5px; }
.data-card p { margin: 8px 0; font-weight: 700; font-size: 18px; color: var(--dark); }

/* RELIABILITY CALLOUT (TORNADO SECTION) */
.reliability-callout {
    background: #fffdf0;
    border: 2px solid var(--accent);
    padding: 20px;
    border-radius: 8px;
    color: #333;
    font-size: 1.15rem; /* Larger desktop text per Blueprint v1.9.2 */
    line-height: 1.6;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.reliability-callout i { color: var(--accent); font-size: 1.4rem; margin-right: 12px; }
.reliability-callout strong { color: var(--brand-blue); }

/* SETTINGS & PARAMETERS */
.settings-panel { background: #eef4ff; padding: 25px; border-radius: 12px; margin: 25px 0; border-left: 6px solid var(--brand-blue); }
.settings-panel select { padding: 12px; margin: 10px 0 18px 0; width: 100%; border-radius: 8px; border: 1px solid #cbd5e1; background: white; font-size: 15px; }
.brand-btn { background: var(--brand-blue); color: white; border: none; padding: 16px; width: 100%; border-radius: 8px; font-weight: bold; font-size: 16px; cursor: pointer; transition: background 0.3s, transform 0.1s; }
.brand-btn:hover { background: #004494; }
.brand-btn:active { transform: scale(0.98); }

/* AI & NARRATIVE BOXES */
.narrative-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ddd;
    line-height: 1.7;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

/* UNIFIED SCROLLBOX (IBC EXPERT) */
#ai-response-display { 
    margin-top: 20px; 
    background: white; 
    padding: 25px; 
    border-radius: 8px; 
    border: 2px solid var(--brand-blue);
    display: none; 
    line-height: 1.8; /* Professional line-height for technical text */
    height: 500px; /* Aligned with v1.9.3 Protocol */
    max-height: 500px; 
    overflow-y: auto !important; 
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    white-space: normal;
    word-wrap: break-word;
}

/* SCROLLBAR CUSTOMIZATION (GOLD STANDARD) */
#ai-response-display::-webkit-scrollbar { width: 8px; }
#ai-response-display::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }
#ai-response-display::-webkit-scrollbar-track { background: #f1f1f1; }

/* AI RESPONSE INTERNALS (MARKDOWN RENDERING) */
#ai-response-display h3 { font-size: 1.4em; color: var(--brand-blue); border-bottom: 2px solid var(--accent); margin: 25px 0 15px 0; padding-bottom: 5px; }
#ai-response-display p { margin-bottom: 20px; }
#ai-response-display table { width: 100%; border-collapse: collapse; margin: 20px 0; background: #fff; border-radius: 4px; overflow: hidden; }
#ai-response-display th { background: var(--dark); color: var(--accent); text-align: left; padding: 14px; font-size: 13px; text-transform: uppercase; border: 1px solid #333; }
#ai-response-display td { border: 1px solid #ddd; padding: 12px; font-weight: 500; color: #333; font-size: 15px; }
#ai-response-display tr:nth-child(even) { background-color: #f9f9f9; }
#ai-response-display strong { color: var(--dark); font-weight: 700; }

/* MODULE & CALCULATOR CARDS */
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 30px; }
.calc-card { background: white; border: 1px solid #ddd; border-radius: 12px; padding: 25px; text-decoration: none; color: #333; transition: all 0.3s ease; position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.calc-card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px rgba(0,0,0,0.1); border-color: var(--brand-blue); }
.calc-card h3 { margin: 0 0 10px 0; color: var(--brand-blue); font-size: 1.2rem; }
.calc-card p { margin: 0; font-size: 0.9rem; color: #666; line-height: 1.4; flex-grow: 1; }
.calc-card.active { border-left: 6px solid var(--brand-blue); }

/* GOLD STANDARD BADGE (v1.9.3) */
.status-badge { position: absolute; top: 12px; right: 12px; font-size: 0.65rem; font-weight: bold; padding: 4px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.status-badge.verified { background: #e6f4ea; color: #1e7e34; border: 1px solid #c3e6cb; }
.status-badge.gold { background: #fff9e6; color: #856404; border: 1px solid var(--accent); }
.status-badge.soon { background: #f1f3f4; color: #5f6368; border: 1px solid #dadce0; }

/* TORNADO TABLE FORMATTING */
.tornado_table { border-collapse: collapse; width: 100%; max-width: 100%; overflow: auto; display: block; border-radius: 4px; }
.tornado_table tr, .tornado_table td, .tornado_table th { border: 1px solid #ddd; }
.tornado_table td, .tornado_table th { padding: 12px 10px; text-align: center; font-size: 14px; }
.tornado_table th, .tornado_table td:first-child { 
    background-color: #f1f3f4; 
    color: var(--dark); 
    font-weight: bold; 
    border-color: #ccc;
}
.tornado_table tr:hover { background-color: #f9f9f9; }

/* UTILITIES */
.loading-spinner { border: 3px solid rgba(0,0,0,0.1); border-top: 3px solid var(--brand-blue); border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; margin-right: 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* MOBILE RESPONSIVENESS */
@media (max-width: 600px) {
    .content-padding { padding: 15px; }
    .reliability-callout { font-size: 0.95rem; padding: 15px; }
    #map { height: 300px; }
    #ai-response-display { height: 400px; max-height: 400px; }
}
        footer{
            background: #333; color: white; padding: 40px 20px; text-align: center; width: 100%;
        }
        footer > div{
            max-width: 1000px; margin: 0 auto;
        }
        footer .footer-legal{
            font-size: 13px; color: #aaa; border-top: 1px solid #444; padding-top: 20px; line-height: 1.6;
        }

        
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            backdrop-filter: blur(3px);
        }
        .modal-overlay.active {
            display: flex;
        }
        .modal-content {
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            position: relative;
            animation: slideUp 0.3s ease-out;
        }
        /* Premium Modal - Split Screen */
        #premium-modal .modal-content.extended {
            max-width: 900px;
            width: 90%;
            padding: 0;
            display: flex;
flex-wrap:wrap;
        }
        .modal-login-section {
            padding: 50px 40px;
            flex:1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            border-right: 1px solid #eee;
        }
        .modal-subscribe-section {
            padding: 50px 40px;
            flex:1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: linear-gradient(135deg, rgba(212, 175, 55, 0.05) 0%, rgba(212, 175, 55, 0.02) 100%);
        }
        @keyframes slideUp {
            from {
                transform: translateY(30px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        .modal-close-btn {
            position: absolute;
            top: 15px;
            right: 15px;
            background: none;
            border: none;
            font-size: 1.8rem;
            color: #999;
            cursor: pointer;
            transition: color 0.2s ease;
        }
        .modal-close-btn:hover {
            color: #333;
        }
        .modal-icon {
            font-size: 3rem;
            color: #D4AF37;
            margin-bottom: 20px;
        }
        .modal-title {
            font-size: 1.8rem;
            font-weight: 800;
            color: #1a1a1a;
            margin-bottom: 15px;
        }
        .modal-description {
            color: #666;
            font-size: 1rem;
            line-height: 1.6;
            margin-bottom: 35px;
        }
        .modal-button-group {
            display: flex;
            gap: 12px;
            flex-direction: column;
            width: 100%;
        }
        .modal-button {
            padding: 14px 28px;
            font-size: 1.05rem;
            font-weight: 700;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
            width: 100%;
        }
        .modal-input-group {
            width: 100%;
            margin-bottom: 20px;
        }
        .modal-input-group label {
            display: block;
            font-weight: 700;
            color: #333;
            margin-bottom: 8px;
            font-size: 0.95rem;
        }
        .modal-input-group input {
            width: 100%;
            padding: 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 1rem;
            box-sizing: border-box;
            transition: border-color 0.2s ease;
        }
        .modal-input-group input:focus {
            outline: none;
            border-color: #D4AF37;
            box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
        }
        header {
            flex-wrap: wrap;
            background: #0056b3; color: white; padding: 12px 20px; display: flex; justify-content: flex-end; gap: 20px; border-bottom: 2px solid #D4AF37; font-size: 14px;
        }
        header a{
            text-decoration: none; font-weight: 600; display: flex; align-items: center; gap: 6px; 
            color:#fff;
        }
        body{
            transition: 0.3s all ease-in-out;
        }
        header a.profile-link{
            color: #FFD700;
        }
/* ===== NAV LINK ===== */
.nav-link {
    text-align: center;
    padding: 20px;
    background-color: #F8F9FA;
}

.nav-link a {
    color: #0056b3;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.nav-link a:hover {
    color: #D4AF37;
}

.flex{
    display: flex;
    gap: 12px;
    flex-wrap:wrap;
}

        .btn {
            padding: 12px 30px;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            height:100%;
            text-decoration: none;
        }

        .btn-primary {
            background: #D4AF37;
            color: #1a1a1a;
            box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
        }

        .btn-primary:hover {
            background: #b8962f;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
        }

        .btn-danger {
            background: #dc3545;
            color: white;
            box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
        }

        .btn-danger:hover {
            background: #c82333;
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(220, 53, 69, 0.3);
        }

        .btn-secondary {
            background: #6c757d;
            color: white;
        }

        .btn-secondary:hover {
            background: #5a6268;
            transform: translateY(-2px);
        }
        .grid{
    display: grid;
    gap: 20px;
        }
        .grid-2{
            grid-template-columns: 1fr 1fr;
        }
        .mr-auto{
            margin-right: auto;
        }
        .container-alert{
            background: #fff3cd; padding: 20px; border-radius: 8px; border-left: 4px solid #ff9800; display: flex; align-items: center; gap: 15px;
        }
        .icon{
            margin-right: 6px;
        }
        .icon-mid{
            font-size: 24px;
        }
        .container-alert .icon{
            color: #ff9800;
        }
        .modal-content{
            max-width: 600px;
    max-height: 95vh;
    overflow-y: auto;
    position: relative;
        }
        .text-center{text-align: center;}
        .welcome-header{
            margin-right: auto; font-weight: 600;
        }
        p.m-0{
            margin:0;
        }
        .flex-end{
         
    justify-content: flex-end;
        }
        .footer-link{
            color: #ffd700; text-decoration: none; margin: 0 15px;
        }
        .flex-center{
            justify-content: center;
        }