/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    color: #202124;
    overflow-x: hidden;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    background: transparent;
    align-items: center;
}

/* Tabs Container */
.tabs-container {
    display: flex;
    gap: 12px;
    margin-right: auto;
}

.tab-button {
    background: transparent;
    border: 1px solid #dadce0;
    border-radius: 40px;
    height: 40px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    color: #3c4043;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.tab-button:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-button.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.tab-button.active:hover {
    background: #1557b0;
    border-color: #1557b0;
}

body.dark .tab-button {
    background: transparent;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .tab-button:hover {
    background: #3c4043;
}

body.dark .tab-button.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

body.dark .tab-button.active:hover {
    background: #1557b0;
}

.theme-toggle {
    background: transparent;
    border: 1px solid #dadce0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Header actions container */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.learn-button {
    background: transparent;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #202124;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.learn-button:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body.dark .learn-button {
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .learn-button:hover {
    background: #3c4043;
}/* Main content - Google-like layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    opacity: 1;
    transition: opacity 0.4s ease-in-out;
}

.main-content.dragover {
    background: rgba(26, 115, 232, 0.05);
    border: 2px dashed #1a73e8;
    border-radius: 12px;
}

body.dark .main-content.dragover {
    background: rgba(26, 115, 232, 0.08);
    border-color: #1a73e8;
}

/* Logo section */
.logo-section {
    margin-bottom: 40px;
}

.logo-section h1 {
    font-size: 3.5rem;
    font-weight: 400;
    color: #202124;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.logo-section p {
    font-size: 1.1rem;
    color: #5f6368;
    font-weight: 400;
}

/* Search section */
.search-section {
    width: 100%;
    max-width: 584px;
    margin-bottom: 30px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    padding: 0 16px;
    height: 44px;
    box-shadow: 0 2px 5px 1px rgba(64,60,67,.16);
    transition: all 0.2s ease;
}

.search-box:hover {
    box-shadow: 0 2px 8px 1px rgba(64,60,67,.24);
}

.search-box:focus-within {
    box-shadow: 0 2px 8px 1px rgba(64,60,67,.24);
    border-color: transparent;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #202124;
    padding: 0 8px;
}

.search-box input::placeholder {
    color: #9aa0a6;
}

.search-button {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    transition: all 0.2s ease;
}

.search-button:hover {
    background: #f8f9fa;
    color: #202124;
}

body.dark .search-button {
    color: #9aa0a6;
}

body.dark .search-button:hover {
    background: #3c4043;
    color: #e8eaed;
}

/* Header analysis section */
.header-section {
    margin-top: 20px;
    text-align: center;
}

.header-toggle-btn {
    background: transparent;
    border: 1px solid #dadce0;
    border-radius: 40px;
    height: 40px;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    color: #3c4043;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.header-toggle-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-input-container {
    margin-top: 16px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.header-input-container textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 120px;
    background: #ffffff;
    color: #202124;
    transition: all 0.2s ease;
}

.header-input-container textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

.analyze-header-btn {
    margin-top: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.analyze-header-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(26,115,232,0.2);
}

/* Dark mode for header section */
body.dark .header-toggle-btn {
    background: transparent;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .header-toggle-btn:hover {
    background: #3c4043;
}

body.dark .header-input-container textarea {
    background: #303134;
    color: #e8eaed;
    border-color: #5f6368;
}

body.dark .header-input-container textarea:focus {
    border-color: #1a73e8;
}

body.dark .analyze-header-btn {
    background: #1a73e8;
}

body.dark .analyze-header-btn:hover {
    background: #1557b0;
}

/* Header analysis results */

/* DKIM accordion */
.dkim-accordion {
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 8px;
    overflow: hidden;
    /* keep header visible when scrolling long results */
    position: sticky;
    top: 12px; /* adjusts how far from top of scroll container it sticks */
    z-index: 30;
    background: inherit; /* match parent background when sticky */
}
.dkim-accordion .dkim-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 12px 16px;
    background: rgba(255,255,255,0.02);
    transition: all 0.2s ease;
    user-select: none;
}
.dkim-accordion .dkim-accordion-header:hover { 
    background: rgba(255,255,255,0.08);
}
.dkim-accordion .dkim-toggle-indicator {
    transition: transform 0.2s ease;
    font-size: 18px;
    transform-origin: center;
    flex-shrink: 0;
    margin-left: 12px;
}
.dkim-accordion .dkim-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, padding 0.18s ease;
    padding: 0 12px;
}
.dkim-accordion.expanded .dkim-body {
    max-height: 800px; /* large enough for content */
    padding: 12px;
}
.dkim-accordion.expanded .dkim-toggle-indicator {
    transform: rotate(90deg);
}

.header-info {
    margin-bottom: 20px;
}

.header-details {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
}

.header-details h3 {
    margin: 0 0 12px 0;
    color: #202124;
    font-size: 1rem;
    font-weight: 500;
}

.header-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #5f6368;
    word-break: break-all;
}

.header-details strong {
    color: #202124;
    font-weight: 500;
}

body.dark .header-details {
    background: #3c4043;
    border-color: #5f6368;
}

body.dark .header-details h3 {
    color: #e8eaed;
}

body.dark .header-details p {
    color: #9aa0a6;
}

body.dark .header-details strong {
    color: #e8eaed;
}

/* Header comparison styling */
.header-comparison {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e8eaed;
}

.comparison-status {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
}

.status-pass {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.status-fail {
    background: #fce8e6;
    color: #d93025;
    border: 1px solid #fce8e6;
}

.status-warning {
    background: #fef7e0;
    color: #ea8600;
    border: 1px solid #fef7e0;
}

.status-error {
    background: #fce8e6;
    color: #d93025;
    border: 1px solid #fce8e6;
}

.status-unknown {
    background: #f1f3f4;
    color: #5f6368;
    border: 1px solid #e8eaed;
}

/* Dark mode for comparison status */
body.dark .header-comparison {
    border-top-color: #5f6368;
}

body.dark .status-pass {
    background: #1e3a1e;
    color: #4caf50;
    border-color: #2e5a2e;
}

body.dark .status-fail {
    background: #3a1e1e;
    color: #f44336;
    border-color: #5a2e2e;
}

body.dark .status-warning {
    background: #3a2e1e;
    color: #ff9800;
    border-color: #5a4e2e;
}

body.dark .status-error {
    background: #3a1e1e;
    color: #f44336;
    border-color: #5a2e2e;
}

body.dark .status-unknown {
    background: #3c4043;
    color: #9aa0a6;
    border-color: #5f6368;
}

/* Quick action buttons */
.quick-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
    margin-top: 20px;
}

.action-button {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 12px 16px;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: auto;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #3c4043;
    opacity: 0.7;
}

.action-button:hover {
    opacity: 1;
}

.action-icon {
    font-size: 20px;
    line-height: 1;
}

.action-button span {
    font-weight: 400;
    white-space: nowrap;
}

/* Copyright footer */
.copyright {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.copyright span {
    font-size: 11px;
    color: #9aa0a6;
    font-weight: 400;
    opacity: 0.7;
}

body.dark .copyright span {
    color: #5f6368;
}

/* Loading section - only for modal */

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f3f4;
    border-top: 3px solid #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-container {
    width: 100%;
    height: 4px;
    background: #f1f3f4;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #1a73e8;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: #5f6368;
    font-weight: 400;
}

.quote-text {
    font-size: 13px;
    color: #9aa0a6;
    font-style: italic;
    text-align: center;
}

/* Modal styles */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal.open {
    display: flex;
    opacity: 1;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-body {
    padding: 12px 12px 18px 12px;
    overflow: auto;
    background: #ffffff;
}

.modal.closing {
    opacity: 0;
    animation: modalFadeOut 0.2s ease-in;
}

.modal.closing .modal-content {
    transform: scale(0.95);
}

@keyframes modalFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
    opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.95);
    }
}

.modal-content {
    background: #ffffff;
    color: #202124;
    width: min(95vw, 1200px);
    max-height: 90vh;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}

.modal.open .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    padding-right: 60px;
    border-bottom: 1px solid #e8eaed;
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f8f9fa;
}

.modal-header h2 {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 400;
    color: #202124;
}

.modal-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    max-width: 400px;
}

.modal-controls input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    color: #202124;
    min-width: 200px;
}

.modal-controls input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.2);
}

.modal-controls .btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
    transform: scale(1);
}

.modal-controls .btn:hover {
    transform: scale(1.05);
}

.modal-controls .btn:active {
    transform: scale(0.98);
}

.modal-controls .btn-primary {
    background: #1a73e8;
    color: white;
}

.modal-controls .btn-primary:hover {
    background: #1557b0;
}

.modal-controls .btn {
    background: transparent;
    border: 1px solid #dadce0;
    color: #202124;
    padding: 8px 12px;
    border-radius: 4px;
}
.modal-controls .btn svg { display:block; }
.modal-controls .btn[aria-label] { padding: 6px; width: 36px; height: 36px; display:inline-flex; align-items:center; justify-content:center; }
.modal-controls .btn[aria-label]:hover { background: #f1f3f4; }
body.dark .modal-controls .btn[aria-label]:hover { background: #3c4043; }

/* Retry icon animation */
@keyframes retry-spin {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}
.modal-controls .btn.retrying svg { animation: retry-spin 0.6s linear; }

/* ensure icon is visible in dark mode */
.modal-controls .btn svg { color: inherit; }
body.dark .modal-controls .btn svg { color: #e8eaed; }

.tips-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #202124;
    cursor: pointer;
    user-select: none;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.tips-toggle:hover {
    background: #f1f3f4;
    border-color: #dadce0;
}

.tips-toggle input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.tips-btn {
    font-size: 16px !important;
    padding: 6px !important;
    width: 36px !important;
    height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.tips-btn.active {
    background: #1a73e8 !important;
    color: white !important;
    border-color: #1a73e8 !important;
}

.tips-btn.active:hover {
    background: #1557b0 !important;
    border-color: #1557b0 !important;
}

.tips-toggle-section {
    margin-bottom: 16px;
    border-bottom: 1px solid #e8eaed;
    padding: 16px 24px 16px 24px;
}

#modalResults {
    padding: 0 24px 24px 24px;
}

.tips-toggle-icon {
    font-size: 18px;
    opacity: 0.7;
}

.tips-toggle-text strong {
    display: block;
    font-weight: 600;
    color: #202124;
}

.tips-toggle-text small {
    display: block;
    color: #5f6368;
    font-size: 12px;
    margin-top: 2px;
}

body.dark .tips-btn {
    color: #e8eaed !important;
    border-color: #5f6368 !important;
}

body.dark .tips-btn.active {
    background: #1a73e8 !important;
    color: white !important;
    border-color: #1a73e8 !important;
}

.modal-body {
    padding: 0;
    overflow: auto;
    background: #ffffff;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #5f6368;
    z-index: 3;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    transform: scale(1);
}

.modal-close:hover {
    background: #f1f3f4;
    color: #202124;
    transform: scale(1.1);
}

.modal-close:active {
    transform: scale(0.95);
}

body.dark .modal-close {
    color: #e8eaed;
}

body.dark .modal-close:hover {
    background: #3c4043;
    color: #ffffff;
}

/* Learn Modal Styles */
.learn-modal-content {
    width: min(95vw, 900px);
    max-height: 85vh;
}

.learn-content {
    overflow-y: auto;
    padding: 24px;
    flex: 1;
}

.learn-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e8eaed;
}

.learn-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.learn-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1a73e8;
    margin-bottom: 12px;
}

.learn-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #5f6368;
    margin-bottom: 12px;
}

.learn-section code {
    background: #f8f9fa;
    border: 1px solid #dadce0;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #d33b27;
}

.policy-list, .practice-list {
    list-style: none;
    padding-left: 0;
    margin: 12px 0;
}

.policy-list li, .practice-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.5;
}

.policy-list li:before, .practice-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #1a73e8;
    font-weight: bold;
}

body.dark .learn-content {
    background: #303134;
}

body.dark .learn-section {
    border-bottom-color: #5f6368;
}

body.dark .learn-section h3 {
    color: #aecbfa;
}

body.dark .learn-section p {
    color: #dadce0;
}

body.dark .learn-section code {
    background: #3c4043;
    border-color: #5f6368;
    color: #f28482;
}

body.dark .policy-list li, 
body.dark .practice-list li {
    color: #dadce0;
}

/* Results styling */
.summary {
    background: #f8f9fa;
    padding: 24px;
    border-bottom: 1px solid #e8eaed;
}

.summary h2 {
    color: #202124;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 400;
}

.security-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
    width: 100%;
    box-sizing: border-box;
}

.tips-section {
    margin-top: 20px;
    padding: 16px;
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
}

.tips-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8eaed;
}

.tips-icon {
    font-size: 20px;
    background: #1a73e8;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tips-title h3 {
    margin: 0 0 4px 0;
    color: #202124;
    font-size: 1rem;
    font-weight: 600;
}

.tips-title p {
    margin: 0;
    color: #5f6368;
    font-size: 0.9rem;
}

.tips-section ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.tips-section li {
    margin-bottom: 8px;
    padding: 10px 12px;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tips-section li:before {
    content: '';
    flex-shrink: 0;
    margin-top: 2px;
}

.tips-section li.tip-error {
    background: #fce4e6;
    color: #c62828;
    border-left: 4px solid #d32f2f;
}

.tips-section li.tip-error:before {
    content: '❌';
}

.tips-section li.tip-warning {
    background: #fff8e1;
    color: #f57f17;
    border-left: 4px solid #fbc02d;
}

.tips-section li.tip-warning:before {
    content: '⚠️';
}

.tips-section li.tip-success {
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 4px solid #388e3c;
}

.tips-section li.tip-success:before {
    content: '✅';
}

.security-item {
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    box-sizing: border-box;
    min-width: 0;
}

.security-item h3 {
    color: #202124;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.security-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.security-item-header h3 {
    margin: 0;
    flex: 1;
}

.expand-btn {
    background: transparent;
    border: 1px solid #dadce0;
    border-radius: 4px;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #5f6368;
    transition: all 0.2s ease;
}

.expand-btn:hover {
    background: #f1f3f4;
    color: #202124;
}

.expand-btn svg {
    transition: transform 0.2s ease;
}

.spf-record.expanded .expand-btn svg {
    transform: rotate(180deg);
}

.spf-text {
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.spf-text .spf-part {
    display: block;
    padding: 4px 0;
    word-break: normal;
    white-space: nowrap;
}

.spf-record.expanded .spf-text {
    word-break: normal;
}

.mx-text .mx-part {
    display: block;
    padding: 4px 0;
    word-break: normal;
    white-space: nowrap;
}

.mx-text {
    flex: 1;
    min-width: 0;
}

.ns-text .ns-part {
    display: block;
    padding: 4px 0;
    word-break: normal;
    white-space: nowrap;
}

.ns-text {
    flex: 1;
    min-width: 0;
}

.dmarc-text {
    word-break: break-all;
    flex: 1;
    min-width: 0;
}

.dmarc-text .dmarc-part {
    display: block;
    padding: 4px 0;
    word-break: break-word;
}

.dmarc-record.expanded .dmarc-text {
    word-break: normal;
}

.dmarc-param-v {
    color: #1a73e8;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.dmarc-param-p {
    color: #d33b27;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.dmarc-param-sp {
    color: #f57c00;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.dmarc-param-rua {
    color: #0d652d;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.dmarc-param-ruf {
    color: #6f42c1;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.dmarc-param-other {
    color: #5f6368;
    white-space: nowrap;
    display: inline-block;
}

body.dark .dmarc-param-v {
    color: #5b9ef5;
}

body.dark .dmarc-param-p {
    color: #f28482;
}

body.dark .dmarc-param-sp {
    color: #ffb74d;
}

body.dark .dmarc-param-rua {
    color: #81c995;
}

body.dark .dmarc-param-ruf {
    color: #c5a3ff;
}

body.dark .dmarc-param-other {
    color: #bdc1c6;
}

/* SPF Parameter Colors */
.spf-param-v {
    color: #1a73e8;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-mechanism {
    color: #0d652d;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-ip {
    color: #6f42c1;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-include {
    color: #f57c00;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-ptr {
    color: #5f6368;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-softfail {
    color: #fbbc04;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-fail {
    color: #d33b27;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.spf-param-other {
    color: #5f6368;
    white-space: nowrap;
    display: inline-block;
}

body.dark .spf-param-v {
    color: #5b9ef5;
}

body.dark .spf-param-mechanism {
    color: #81c995;
}

body.dark .spf-param-ip {
    color: #c5a3ff;
}

body.dark .spf-param-include {
    color: #ffb74d;
}

body.dark .spf-param-ptr {
    color: #bdc1c6;
}

body.dark .spf-param-softfail {
    color: #fde293;
}

body.dark .spf-param-fail {
    color: #f28482;
}

body.dark .spf-param-other {
    color: #bdc1c6;
}

/* MX Priority Colors */
.mx-priority-high {
    color: #0d652d;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.mx-priority-medium {
    color: #f57c00;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.mx-priority-low {
    color: #d33b27;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.mx-priority-value {
    font-weight: 600;
    white-space: nowrap;
    display: inline-block;
}

body.dark .mx-priority-high {
    color: #81c995;
}

body.dark .mx-priority-medium {
    color: #ffb74d;
}

body.dark .mx-priority-low {
    color: #f28482;
}

/* Nameserver Colors */
.ns-param {
    color: #1a73e8;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

body.dark .ns-param {
    color: #5b9ef5;
}

.security-status {
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 0.875rem;
}

.status-found {
    color: #137333;
}

.status-not-found {
    color: #d93025;
}

.record-details {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    border: 1px solid #e8eaed;
    max-height: 250px;
    overflow-y: auto;
}

.record-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 8px 0;
}

.dmarc-record-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.spf-record-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.mx-record-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ns-record-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.record-text {
    flex: 1;
    word-break: break-all;
    color: #202124;
}

/* WHOIS block uses same styling but slightly different spacing for modal */
.whois-block {
    padding: 10px;
    border-radius: 6px;
}
.whois-block .record-line { display:flex; justify-content:space-between; align-items:center; padding:6px 8px; border-bottom:1px solid rgba(0,0,0,0.04); }
.whois-block .record-line:last-child { border-bottom:none; }
.whois-block .copy-btn { margin-left:12px; }

.section-header {
    margin: 24px 0 12px 0;
    padding: 0 24px;
}

.section-header h3 {
    color: #202124;
    font-size: 1.125rem;
    font-weight: 500;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8eaed;
}

.section-description {
    background: transparent;
    padding: 8px 24px;
    border-radius: 0;
    margin-bottom: 16px;
    color: #5f6368;
    border: none;
    font-size: 0.875rem;
}

.selector-result {
    background: #ffffff;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    margin: 0 24px 12px 24px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.selector-result:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-color: #dadce0;
}

.microsoft-selector {
    border-left: 3px solid #1a73e8;
}

.selector-header {
    padding: 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.selector-header:hover {
    background: #f8f9fa;
}

.selector-name {
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #202124;
}

.microsoft-badge {
    background: #1a73e8;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.75rem;
}

.status.found {
    background: #e6f4ea;
    color: #137333;
    border: 1px solid #ceead6;
}

.selector-details {
    padding: 16px;
    background: #f8f9fa;
    border-top: 1px solid #e8eaed;
    font-family: 'Courier New', monospace;
    word-break: break-all;
    color: #202124;
    font-size: 0.8rem;
}

.selector-details strong {
    display: block;
    margin: 12px 0 6px 0;
    color: #202124;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Footer GitHub icon */
.copyright {
    display: flex;
    justify-content: flex-end; /* place icon to the right */
    padding: 12px 8px 28px 0; /* reduced right padding to move icon further to the right */
}
.footer-github {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.15s ease, transform 0.12s ease;
}
.footer-github svg { display: block; }
.footer-github:hover { color: #1a73e8; transform: translateY(-2px); }
body.dark .footer-github:hover { color: #8ab4ff; }

.selector-details strong:first-child {
    margin-top: 0;
}

.error-message {
    background: #fce8e6;
    color: #d93025;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #d93025;
    margin: 16px 24px;
    border: 1px solid #fce8e6;
}

.selector-result.expanded .selector-details {
    display: block;
}

.selector-result:not(.expanded) .selector-details {
    display: none;
}

.copy-btn {
    background: #1a73e8;
    color: white;
    padding: 4px 8px;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-weight: 500;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #1557b0;
}

.copy-btn.copied {
    background: #137333;
}

/* Dark theme */
body.dark {
    background: #202124;
    color: #e8eaed;
}

body.dark .container {
    background: #202124;
}

body.dark .theme-toggle {
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .theme-toggle:hover {
    background: #3c4043;
}

body.dark .logo-section h1 {
    color: #e8eaed;
}

body.dark .logo-section p {
    color: #9aa0a6;
}

body.dark .search-box {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .search-box:hover {
    background: #303134;
    border-color: #9aa0a6;
}

body.dark .search-box:focus-within {
    background: #303134;
    border-color: #1a73e8;
}

body.dark .search-box input {
    color: #e8eaed;
}

body.dark .search-box input::placeholder {
    color: #9aa0a6;
}

body.dark .search-button {
    color: #9aa0a6;
}

body.dark .search-button:hover {
    background: #3c4043;
    color: #e8eaed;
}

body.dark .action-button {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
    opacity: 0.7;
}

body.dark .action-button:hover {
    opacity: 0.8;
}

body.dark .spinner {
    border-color: #3c4043;
    border-top-color: #1a73e8;
}

body.dark .progress-container {
    background: #3c4043;
}

body.dark .progress-bar {
    background: #1a73e8;
}

body.dark .progress-text {
    color: #9aa0a6;
}

body.dark .quote-text {
    color: #5f6368;
}

body.dark .modal-content {
    background: #303134;
    color: #e8eaed;
}

body.dark .modal-body {
    background: #303134;
}

body.dark .modal-header {
    background: #3c4043;
    border-bottom-color: #5f6368;
}

body.dark .modal-header h2 {
    color: #e8eaed;
}

body.dark .modal-controls input {
    background: #303134;
    color: #e8eaed;
    border-color: #5f6368;
}

body.dark .modal-controls input:focus {
    border-color: #1a73e8;
}

body.dark .modal-controls .btn-primary {
    background: #1a73e8;
    color: white;
}

body.dark .modal-controls .btn-primary:hover {
    background: #1557b0;
}

body.dark .dkim-accordion .dkim-accordion-header:hover {
    background: rgba(255,255,255,0.08);
}

body.dark .tips-toggle {
    color: #e8eaed;
    background: #303134;
    border-color: #5f6368;
}

body.dark .tips-toggle:hover {
    background: #3c4043;
    border-color: #718096;
}

body.dark .tips-toggle-text strong {
    color: #e8eaed;
}

body.dark .tips-toggle-text small {
    color: #a0aec0;
}

body.dark .tips-toggle-section {
    border-bottom-color: #5f6368;
}

body.dark .tips-section {
    background: #303134;
    border-color: #5f6368;
}

body.dark .tips-header {
    border-bottom-color: #5f6368;
}

body.dark .tips-icon {
    background: #1a73e8;
}

body.dark .tips-title h3 {
    color: #e8eaed;
}

body.dark .tips-title p {
    color: #bdc1c6;
}

body.dark .tips-section li.tip-error {
    background: #2d1b1b;
    color: #f8bbd0;
    border-left-color: #dc3545;
}

body.dark .tips-section li.tip-warning {
    background: #2d2a1b;
    color: #fff59d;
    border-left-color: #ffc107;
}

body.dark .tips-section li.tip-success {
    background: #1b2d1b;
    color: #81c995;
    border-left-color: #28a745;
}

body.dark .modal-close {
    color: #9aa0a6;
}

body.dark .modal-close:hover {
    background: #3c4043;
    color: #e8eaed;
}

body.dark .summary {
    background: #3c4043;
    border-bottom-color: #5f6368;
}

body.dark .summary h2 {
    color: #e8eaed;
}

body.dark .security-item {
    background: #303134;
    border-color: #5f6368;
}

body.dark .security-item h3 {
    color: #e8eaed;
}

body.dark .record-details {
    background: #424649;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .record-text {
    color: #e8eaed;
}

body.dark .expand-btn {
    border-color: #5f6368;
    color: #bdc1c6;
}

body.dark .expand-btn:hover {
    background: #3c4043;
    color: #e8eaed;
}

.speed-message {
    text-align: center;
    margin-top: 20px;
    padding: 12px 0;
}

.speed-message p {
    font-size: 14px;
    color: #9aa0a6;
    font-style: italic;
    margin: 0;
    opacity: 0.7;
}

body.dark .speed-message p {
    color: #5f6368;
}

body.dark .security-item {
    background: #303134;
    border-color: #5f6368;
}

body.dark .section-header h3 {
    color: #e8eaed;
    border-bottom-color: #5f6368;
}

body.dark .section-description {
    color: #9aa0a6;
}

/* Modal loading styles */
.modal .loading {
    display: flex;
        flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    justify-content: center;
    max-width: 100%;
}

.loading-center {
    display: flex;
    justify-content: center;
}

.loading-progress {
    display: flex;
    justify-content: center;
    margin: 8px 0 16px 0;
}

.modal .loading-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    max-width: 400px;
}

body.dark .modal .loading {
    color: #e8eaed;
}

body.dark .selector-result {
    background: #303134;
    border-color: #5f6368;
}

body.dark .selector-result:hover {
    border-color: #9aa0a6;
}

body.dark .selector-header:hover {
    background: #3c4043;
}

body.dark .selector-name {
    color: #e8eaed;
}

body.dark .selector-details {
    background: #3c4043;
    border-top-color: #5f6368;
    color: #e8eaed;
}

body.dark .selector-details strong {
    color: #e8eaed;
}

body.dark .error-message {
    background: #3c4043;
    color: #f28b82;
    border-left-color: #f28b82;
    border-color: #5f6368;
}

/* Responsive design */
@media (max-width: 768px) {
    .logo-section h1 {
        font-size: 2.5rem;
    }
    
    .logo-section p {
        font-size: 1rem;
    }
    
    .search-section {
        max-width: 100%;
        padding: 0 16px;
    }
    
    .quick-actions {
        gap: 12px;
        padding: 0 16px;
    }
    
    .action-button {
        min-width: 100px;
        padding: 10px 12px;
    }
    
    .action-icon {
        font-size: 18px;
    }
    
    .action-button span {
        font-size: 12px;
    }
    
    .security-overview {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-header {
        padding: 16px;
        padding-right: 50px;
    }
    
    .modal-controls {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .modal-controls input {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .logo-section h1 {
        font-size: 2rem;
    }
    
    .quick-actions {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .action-button {
        width: 100%;
        max-width: 200px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .action-icon {
        font-size: 16px;
    }
    
    body.dark .tips-section {
        background: #303134;
        border-color: #5f6368;
    }
    
    body.dark .tips-header {
        border-bottom-color: #5f6368;
    }
    
    body.dark .tips-icon {
        background: #1a73e8;
    }
    
    body.dark .tips-title h3 {
        color: #e8eaed;
    }
    
    body.dark .tips-title p {
        color: #bdc1c6;
    }
    
    body.dark .tips-section li.tip-error {
        background: #3c4043;
        color: #f8bbd0;
        border-left-color: #dc3545;
    }
    
    body.dark .tips-section li.tip-warning {
        background: #3c4043;
        color: #fff59d;
        border-left-color: #ffc107;
    }
    
    body.dark .tips-section li.tip-success {
        background: #3c4043;
        color: #81c995;
        border-left-color: #28a745;
    }
}

/* ==================== HEADER CHECKER STYLES (from Checkjeheader) ==================== */

/* Input card and drop zone styles */
.input-card {
    background: transparent;
    border: 0;
    border-radius: 12px;
    padding: 0;
    margin-top: 0;
}

.input-card.hero {
    text-align: center;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}

.input-card:not(.hero) {
    max-width: min(584px, 100%);
    margin: 24px auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #dfe1e5;
    border-radius: 12px;
}

/* Input method selector */
.input-method-selector {
    display: flex;
    gap: 12px;
    max-width: min(584px, 100%);
    margin: 0 auto 24px auto;
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #dfe1e5;
    border-radius: 12px;
}

.method-toggle {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    background: #ffffff;
    color: #5f6368;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-toggle:hover {
    background: #f8f9fa;
    border-color: #d0d0d0;
}

.method-toggle.active {
    background: #1a73e8;
    color: #ffffff;
    border-color: #1a73e8;
}

body.dark .method-toggle {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .method-toggle:hover {
    background: #3c4043;
    border-color: #6f7175;
}

body.dark .method-toggle.active {
    background: #1a73e8;
    border-color: #1a73e8;
    color: #ffffff;
}

body.dark .input-method-selector {
    background: rgba(255, 255, 255, 0.04);
    border-color: #5f6368;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
    text-align: left;
}

body.dark .section-title {
    color: #e8eaed;
}

.header-textarea {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    background: #ffffff;
    color: #202124;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.header-textarea:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

body.dark .header-textarea {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .header-textarea:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.drop-square {
    margin: 0 auto 0 auto;
    width: min(584px, 100%);
    height: 56px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row;
    padding: 0 16px;
    color: #5f6368;
    box-shadow: 0 2px 5px 1px rgba(64,60,67,.16);
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-square .drop-icon {
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.drop-square .drop-text {
    font-weight: 400;
    font-size: 14px;
    color: #9aa0a6;
    flex: 1;
}

.drop-square .drop-text small {
    display: none;
}

.drop-square:hover {
    border-color: #d0d0d0;
    box-shadow: 0 2px 8px 1px rgba(64,60,67,.24);
}

.drop-square.dragover {
    border-color: #1a73e8;
    background: rgba(26, 115, 232, 0.02);
    box-shadow: 0 2px 8px 1px rgba(64,60,67,.24);
}

@keyframes dashMove {
    0% { border-width: 2px; }
    50% { border-width: 3px; }
    100% { border-width: 2px; }
}

body.dark .drop-square {
    background: #303134;
    border-color: #5f6368;
    color: #9aa0a6;
}

body.dark .drop-square .drop-text {
    color: #9aa0a6;
}

body.dark .drop-square:hover {
    border-color: #6f7175;
    box-shadow: 0 2px 8px 1px rgba(0,0,0,.32);
}

body.dark .drop-square.dragover {
    background: rgba(26, 115, 232, 0.08);
    border-color: #1a73e8;
    box-shadow: 0 2px 8px 1px rgba(26,115,232,.3);
}

/* Button styles for header checker */
.button {
    appearance: none;
    border: 1px solid #dfe1e5;
    background: #f8f9fa;
    color: #202124;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-weight: 600;
}

.button.primary {
    background: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

.button.primary:hover {
    background: #1557b0;
    border-color: #1557b0;
}

.button.secondary {
    background: #f8f9fa;
    border-color: #dfe1e5;
    color: #202124;
}

.button.secondary:hover {
    background: #f1f3f4;
}

.button.ghost {
    background: transparent;
    border: none;
    padding: 6px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.button.ghost:hover {
    background: #f1f3f4;
}

body.dark .button {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .button.primary {
    background: #1a73e8;
    border-color: #1a73e8;
    color: white;
}

body.dark .button.primary:hover {
    background: #1557b0;
}

body.dark .button.secondary {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .button.secondary:hover {
    background: #3c4043;
}

body.dark .button.ghost:hover {
    background: #3c4043;
}

/* Header input styles */
#header-input {
    width: 100%;
    min-height: 220px;
    margin-top: 12px;
    background: #ffffff;
    color: #202124;
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    padding: 12px;
    font-family: 'Courier New', monospace;
    resize: vertical;
}

#header-input:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

body.dark #header-input {
    background: #303134;
    color: #e8eaed;
    border-color: #5f6368;
}

body.dark #header-input:focus {
    border-color: #1a73e8;
}

/* Typewriter animation */
.typewriter {
    color: #9aa0a6;
    font-weight: 500;
}

.typewriter::after {
    content: '\2588';
    margin-left: 4px;
    opacity: 0.7;
    animation: caretBlink 1s step-end infinite;
}

@keyframes caretBlink {
    50% { opacity: 0; }
}

body.dark .typewriter {
    color: #9aa0a6;
}

/* Modal styles for header checker */
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity .2s ease;
}

.modal.show .modal-backdrop {
    opacity: 1;
}

.modal-dialog {
    position: relative;
    margin: 40px auto;
    width: min(1100px, calc(100% - 24px));
    height: calc(100% - 80px);
    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 16px;
    opacity: 0;
    display: flex;
    flex-direction: column;
}

.modal.show .modal-dialog {
    animation: popIn .22s ease forwards;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes popIn {
    from { transform: translateY(12px) scale(.98); opacity: 0 }
    to { transform: translateY(0) scale(1); opacity: 1 }
}

body.dark .modal-dialog {
    background: #303134;
    border-color: #5f6368;
}

/* Results and table styles for header checker */
.results {
    margin-top: 20px;
    display: grid;
    gap: 16px;
}

.table-wrap {
    overflow: auto;
    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 10px 12px;
    border-bottom: 1px solid #dfe1e5;
    text-align: left;
}

thead th {
    position: sticky;
    top: 0;
    background: #f8f9fa;
    z-index: 1;
    font-weight: 600;
    color: #202124;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tr.highlight {
    background: rgba(255, 107, 107, 0.08);
}

td.delta-ok {
    color: #137333;
}

td.delta-warn {
    color: #d93025;
}

body.dark .table-wrap {
    background: #303134;
    border-color: #5f6368;
}

body.dark thead th {
    background: #3c4043;
    color: #e8eaed;
}

body.dark th, body.dark td {
    border-bottom-color: #5f6368;
}

/* Auth status badges */
.auth-status {
    background: #f8f9fa;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #dfe1e5;
    background: #ffffff;
    color: #202124;
    font-weight: 600;
    font-size: 13px;
}

.badge.pass {
    border-color: rgba(19, 115, 51, .3);
    color: #137333;
    background: #e6f4ea;
}

.badge.fail {
    border-color: rgba(217, 48, 37, .3);
    color: #d93025;
    background: #fce8e6;
}

.badge.neutral {
    color: #5f6368;
}

body.dark .auth-status {
    background: #3c4043;
    border-color: #5f6368;
}

body.dark .badge {
    background: #424649;
    color: #e8eaed;
    border-color: #5f6368;
}

body.dark .badge.pass {
    color: #81c995;
    background: #1e3a1e;
    border-color: #2e5a2e;
}

body.dark .badge.fail {
    color: #f44336;
    background: #3a1e1e;
    border-color: #5a2e2e;
}

/* Help icon */
.help-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #9aa0a6;
    color: #ffffff;
    font-size: 9px;
    font-weight: bold;
    text-align: center;
    line-height: 12px;
    cursor: help;
    margin-left: 3px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.help-icon:hover {
    background: #1a73e8;
    opacity: 1;
    transform: scale(1.1);
}

/* IP and domain popup styles */
.ip-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
}

.ip-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border: 1px solid #dfe1e5;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.ip-popup h3 {
    margin: 0 0 12px 0;
    color: #202124;
    font-size: 16px;
}

.ip-popup .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    color: #9aa0a6;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
}

.ip-popup .close-btn:hover {
    color: #202124;
}

.ip-popup .info-item {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
}

.ip-popup .info-label {
    font-weight: 600;
    color: #5f6368;
}

.ip-popup .info-value {
    color: #202124;
    text-align: right;
}

.ip-popup .loading {
    text-align: center;
    color: #9aa0a6;
    padding: 20px;
}

body.dark .ip-popup {
    background: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark .ip-popup h3 {
    color: #e8eaed;
}

body.dark .ip-popup .close-btn {
    color: #9aa0a6;
}

body.dark .ip-popup .close-btn:hover {
    color: #e8eaed;
}

body.dark .ip-popup .info-label {
    color: #9aa0a6;
}

body.dark .ip-popup .info-value {
    color: #e8eaed;
}

/* Clickable IPs and domains */
.ip-address, .domain-address {
    color: #1a73e8;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.ip-address:hover, .domain-address:hover {
    color: #1557b0;
}

body.dark .ip-address, body.dark .domain-address {
    color: #8ab4ff;
}

body.dark .ip-address:hover, body.dark .domain-address:hover {
    color: #aec7ff;
}

/* Link checker and preview styles */
.link-checker {
    max-height: 80vh;
    overflow-y: auto;
}

.urls-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.url-item {
    border: 1px solid #dfe1e5;
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.url-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.url-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #202124;
    word-break: break-all;
    flex: 1;
    margin-right: 12px;
}

.check-btn {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.check-btn:hover {
    background: #1557b0;
}

.url-preview {
    margin-top: 12px;
    min-height: 20px;
}

.preview-content {
    background: #f8f9fa;
    border: 1px solid #dfe1e5;
    border-radius: 6px;
    padding: 16px;
}

.preview-title-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.preview-header h4 {
    margin: 0;
    color: #202124;
    font-size: 16px;
    flex: 1;
}

.preview-controls {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.expand-btn,
.collapse-btn {
    background: #dfe1e5;
    color: #202124;
    border: 1px solid #dfe1e5;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.expand-btn:hover,
.collapse-btn:hover {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.preview-description {
    margin: 0 0 12px 0;
    color: #5f6368;
    font-size: 14px;
    line-height: 1.4;
}

.preview-image,
.preview-screenshot {
    margin: 12px 0;
    text-align: center;
}

.preview-meta {
    margin: 12px 0;
    padding: 12px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #dfe1e5;
}

.meta-item {
    margin-bottom: 6px;
    font-size: 14px;
}

.meta-item:last-child {
    margin-bottom: 0;
}

.preview-actions {
    margin-top: 12px;
    text-align: center;
}

.visit-btn {
    display: inline-block;
    background: #1a73e8;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.visit-btn:hover {
    background: #1557b0;
}

.preview-error {
    background: #fce8e6;
    border: 1px solid #d93025;
    border-radius: 6px;
    padding: 16px;
    text-align: center;
}

.preview-error p {
    margin: 0 0 8px 0;
    color: #d93025;
}

.error-detail {
    font-size: 12px;
    color: #666;
}

body.dark .url-item {
    background: #303134;
    border-color: #5f6368;
}

body.dark .url-text {
    color: #e8eaed;
}

body.dark .preview-content {
    background: #3c4043;
    border-color: #5f6368;
}

body.dark .preview-header h4 {
    color: #e8eaed;
}

body.dark .preview-description {
    color: #9aa0a6;
}

body.dark .preview-meta {
    background: #303134;
    border-color: #5f6368;
}

body.dark .preview-meta,
body.dark .meta-item {
    color: #e8eaed;
}

body.dark .preview-error {
    background: #3c4043;
    border-color: #d93025;
}

body.dark .preview-error p {
    color: #f44336;
}

/* Email preview styles */
.email-preview {
    max-height: 70vh;
    overflow: auto;
}

.email-body {
    padding: 16px;
}

.body-content {
    max-height: 400px;
    overflow-y: auto;
}

.mime-part {
    margin-bottom: 20px;
    padding: 12px;
    border: 1px solid #dfe1e5;
    border-radius: 6px;
    background: #ffffff;
}

.mime-part h5 {
    margin: 0 0 8px 0;
    color: #202124;
    font-size: 14px;
}

.mime-part iframe {
    background: white;
}

.mime-part pre {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #202124;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #dfe1e5;
}

body.dark .mime-part {
    background: #303134;
    border-color: #5f6368;
}

body.dark .mime-part h5 {
    color: #e8eaed;
}

body.dark .mime-part pre {
    background: #424649;
    color: #e8eaed;
    border-color: #5f6368;
}

/* Watermark - hidden */
.watermark {
    display: none;
}

/* WHOIS Popout Styles */
.whois-popout {
    position: fixed;
    z-index: 1200;
    min-width: 260px;
    max-width: 460px;
    background: #fff;
    color: #111;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(2, 6, 23, 0.4);
    padding: 12px;
    font-size: 13px;
}

.whois-popout h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
}

.whois-popout .whois-row {
    margin: 6px 0;
    color: #333;
}

.whois-popout .whois-attr {
    font-weight: 600;
    margin-right: 6px;
}

.whois-popout .attribution {
    margin-top: 8px;
    font-size: 12px;
    color: #555;
}

.whois-popout .attribution a {
    color: #1a73e8;
}

/* WHOIS Button Styles */
.whois-btn {
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    background: #555;
    color: #fff;
    border: none;
    cursor: pointer;
}

.whois-btn.loading {
    opacity: 0.7;
}