:root { 
    --accent-color: #EE7327; /* Hostmacro Bright Orange */
    --accent-color-dark: #D6621B;
    --text-color-dark: #4A4949;
    --text-color-medium: #686766;
    --background-color: #f4f6f8; 
    --card-bg: #ffffff; 
    --border-color: #e5e7eb;
    --success-color: #28a745;
    --danger-color: #dc3545;
}

/* ==========================================================================
   Base & Layout
   ========================================================================== */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--background-color); 
    color: var(--text-color-dark); 
    margin: 0; 
    padding: 20px; 
}
.container { 
    max-width: 1024px; 
    margin: 20px auto; 
}

/* ==========================================================================
   Card Structure
   ========================================================================== */
.card { 
    background: var(--card-bg); 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    margin-bottom: 30px; 
}
.card-header { 
    padding: 20px 25px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}
.card-body { 
    padding: 25px; 
}
.card-footer { 
    background-color: #f8f9fa; 
    padding: 15px 25px; 
    text-align: center; 
    border-top: 1px solid var(--border-color); 
    color: var(--text-color-medium); 
    font-size: 0.9em; 
}
.card-footer a { 
    color: var(--accent-color); 
    text-decoration: none; 
    font-weight: 500;
}

/* ==========================================================================
   Forms & Buttons
   ========================================================================== */
form { 
    display: flex; 
    gap: 10px; 
}

/* DEFINITIVE FIX: Target the main search form by its ID to override the generic rule above */
#domain-form {
    flex-direction: column;
    align-items: center;
}

.form-wrapper { 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    border-radius: 8px; 
    flex-grow: 1; 
    display: flex; 
    width: 100%; /* Ensure the wrapper always tries to be full-width */
}
input[type="text"] { 
    flex-grow: 1; 
    border: 1px solid var(--border-color);
    border-right: none;
    padding: 15px; 
    font-size: 1.1em; 
    border-radius: 8px 0 0 8px; 
    transition: border-color 0.3s; 
}
input[type="submit"], .refresh-button-small {
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}
input[type="submit"] { 
    padding: 15px 25px; 
    font-size: 1.1em; 
    background: var(--accent-color); 
    border-radius: 0 8px 8px 0; 
}
input[type="submit"]:hover { 
    background-color: var(--accent-color-dark); 
}
.refresh-button-small { 
    padding: 8px 16px; 
    font-size: 0.9em; 
    background-color: #6c757d; 
    border-radius: 6px; 
    text-decoration: none;
}
.refresh-button-small:hover { 
    background-color: #5c636a; 
}

/* ==========================================================================
   Typography & Headings
   ========================================================================== */
.card-header h2 { 
    margin: 0; 
    font-size: 1.5em; 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    color: var(--text-color-dark); 
}
h3 { 
    font-size: 1.2em; 
    margin: 25px 0 10px; 
    border-bottom: 1px solid var(--border-color); 
    padding-bottom: 5px; 
    color: #34495e; 
}
h3:first-child { 
    margin-top: 0; 
}
h4 { 
    font-size: 1em; 
    margin: 20px 0 8px; 
    color: var(--text-color-medium); 
}
.welcome-text { 
    color: var(--text-color-medium); 
    font-size: 1.1em; 
    line-height: 1.6; 
}

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs { 
    overflow-x: auto; 
    white-space: nowrap; 
    border-bottom: 1px solid var(--border-color); 
    margin-bottom: 20px; 
}
.tab-link { 
    background-color: inherit; 
    display: inline-block; 
    border: none; 
    outline: none; 
    cursor: pointer; 
    padding: 14px 16px; 
    transition: 0.3s; 
    font-size: 1em; 
    font-weight: 500; 
    color: var(--text-color-medium); 
    border-bottom: 3px solid transparent;
}
.tab-link:hover { 
    background-color: #f8f9fa; 
}
.tab-link.active { 
    color: var(--accent-color); 
    border-bottom-color: var(--accent-color); 
}
.tab-content { 
    display: none; 
}

/* ==========================================================================
   Tables & Lists
   ========================================================================== */
table { 
    border-collapse: collapse; 
    width: 100%; 
}
td { 
    padding: 10px; 
    border-bottom: 1px solid #f2f2f2; 
    vertical-align: top; 
    word-break: break-all; 
}
td:first-child { 
    width: 30%; 
    font-weight: 500; 
    color: var(--text-color-medium); 
}
tr:last-child td { 
    border-bottom: none; 
}
.info-list, .tech-list { 
    list-style-type: none; 
    padding-left: 0; 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
}
.info-list li, .tech-list li { 
    background-color: #f8f9fa; 
    padding: 8px 12px; 
    border-radius: 4px;
    font-size: 0.9em; 
}
.info-list li { 
    font-family: 'Menlo', 'Consolas', monospace; 
}
.tech-list li { 
    font-family: 'Inter', sans-serif; 
}

/* ==========================================================================
   Informational Boxes & Badges
   ========================================================================== */
.error, .no-records, .info, .cache-info {
    padding: 15px;
    border-radius: 4px;
    border-left-width: 4px;
    border-left-style: solid;
    margin-bottom: 20px;
}
.error { 
    color: #c0392b; 
    background-color: #f9e7e7; 
    border-left-color: #e74c3c; 
}
.no-records, .info { 
    color: #7f8c8d; 
    background-color: #f2f3f4; 
    border-left-color: #95a5a6; 
}
.cache-info { 
    color: #7f8c8d; 
    background-color: #e8f3fe; 
    border-left-color: #0D6EFD; 
    font-size: 0.9em; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 10px 15px;
}
.protocol-badge { 
    background-color: #fef1e8; 
    color: var(--accent-color); 
    padding: 5px 12px; 
    border-radius: 15px; 
    font-size: 0.8em; 
    font-weight: 500; 
}
.protocol-badge.legacy { 
    background-color: #f9e79f; 
    color: #f39c12; 
}
.status-badge { 
    font-weight: bold; 
}
.status-badge.present { 
    color: var(--success-color); 
}
.status-badge.missing { 
    color: var(--danger-color); 
}

/* ==========================================================================
   Utilities & Special Elements
   ========================================================================== */
.header-logo { 
    height: 80px; 
    width: auto; 
}
.favicon { 
    width: 16px !important; 
    height: 16px !important; 
    margin-right: 8px; 
    vertical-align: middle; 
}
pre { 
    background-color: #2c3e50; 
    color: #ecf0f1; 
    border-radius: 8px; 
    padding: 15px; 
    overflow-x: auto; 
    white-space: pre; 
    font-family: 'Menlo', 'Consolas', monospace; 
    font-size: 0.85em; 
    line-height: 1.7; 
}
#loader { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(255, 255, 255, 0.8); 
    z-index: 9999; 
    display: none; 
    justify-content: center; 
    align-items: center; 
    flex-direction: column; 
    gap: 15px; 
}
.spinner { 
    border: 4px solid #f3f3f3; 
    border-top: 4px solid var(--accent-color); 
    border-radius: 50%; 
    width: 50px; 
    height: 50px; 
    animation: spin 1s linear infinite; 
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 600px) {
    #domain-form {
        flex-direction: column;
    }
    .form-wrapper {
        flex-direction: column;
        box-shadow: none;
    }
    input[type="text"] {
        border-radius: 8px;
        border-right: 1px solid var(--border-color);
        text-align: center;
    }
    input[type="submit"] {
        border-radius: 8px;
        padding: 12px;
        font-size: 1em;
    }
    .header-logo {
        height: 80px;
    }
    .refresh-button-small {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
}

        .private-search { margin-top: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-color-medium); }
        .private-search input { margin: 0; }
        .status-badge.Pass { color: #28a745; }
        .status-badge.Fail { color: #dc3545; }
        .status-badge.Warning { color: #ffc107; }
        .suggestion { background-color: #e8f3fe; border-left: 4px solid #0D6EFD; padding: 10px 15px; margin-top: 10px; font-size: 0.9em; }
        
        .spf-breakdown-table td:first-child { width: 10%; font-weight: bold; }
        .spf-breakdown-table td:nth-child(2) { width: 20%; }
        .spf-breakdown-table td:nth-child(3) { width: 30%; }

        
        .dmarc-breakdown-table td:first-child { width: 10%; font-weight: bold; }
        .dmarc-breakdown-table td:nth-child(2) { width: 30%; }