/**
 * @file style.css
 * @description Stylesheet for Infra-Mapper.
 * @version 5.55.0
 */

:root {
    --text: #0d1117;
    --muted: #57606a;
    --border: #d0d7de;
    --bg: #f6f8fa;
    --bg-alt: #ffffff;
    --bg-header: #f1f5f9;
    --bg-secondary: #f1f5f9; /* Mapped for export group select */
    --bg-pre: #f7f8fa;
    --border-pre: #d0d7de;
    --button-copy-bg: #eef1f6;
    --link-color: #0969da;
    --error-color: #d32f2f;
    --primary-color: #0066cc;
    --bg-card: #ffffff;
    --text-muted: #666;
    
    /* Mobile-First Variables */
    --spacing-unit: 10px;
    --touch-target: 48px;
}

html.dark-mode {
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --bg: #0d1117;
    --bg-alt: #161b22;
    --bg-header: #1c2128;
    --bg-secondary: #1c2128;
    --bg-pre: #1a1f27;
    --border-pre: #3b424c;
    --button-copy-bg: #2d333b;
    --link-color: #58a6ff;
    --error-color: #ef5350;
    --primary-color: #4da3ff;
    --bg-card: #1e1e1e;
    --text-muted: #aaa;
}

/* Global Reset & Box Sizing */
*, *:before, *:after {
    box-sizing: border-box;
}

html, body {
    transform: none !important;
    filter: none !important;
    perspective: none !important;
    overflow-x: auto;
}

body {
    margin: 18px;
    padding-bottom: 60px; /* Space for footer */
    color: var(--text);
    background-color: var(--bg);
    font-family: Inter, system-ui, Arial, sans-serif;
    font-size: 14px;
    position: relative;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Form Elements */
input,
button,
textarea,
select {
    background-color: var(--bg-alt);
    color: var(--text);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-family: inherit;
}

textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
}

/* Specific Input Styling from Mobile Overrides */
textarea#domains {
    width: 100%;
    max-width: 100%;
    min-height: 160px;
    padding: 12px;
    font-family: monospace;
    font-size: 16px; 
    line-height: 1.4;
}

input[type="text"], input[type="password"], select {
    width: 100%;
    min-height: var(--touch-target);
    padding: 8px;
    font-size: 16px;
}

/* Base button style */
button {
    background: #0969da;
    color: #fff;
    border: 0;
    margin-left: 6px;
    cursor: pointer;
}

button[disabled],
input[disabled],
select[disabled],
textarea[disabled] {
    opacity: .6;
    cursor: default;
}

/* Grid System */
.grid-container {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

@media (min-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr 1fr; 
    }
}

.full-width {
    grid-column: 1 / -1;
}

/* Rows & Flex Layouts */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
    align-items: stretch;
}

.row .btn-action {
    flex: 1 1 0; 
    min-width: 90px; 
    min-height: var(--touch-target);
    white-space: nowrap;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    /* Reapplying button defaults as class might override generic button */
    background: #0969da;
    color: #fff;
    border: 0;
    cursor: pointer;
}

.scan-row-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    justify-content: space-between;
}

.scan-row-flex label {
    flex: 1 1 auto;
    min-width: 150px;
    white-space: normal;
}

/* Export Group Styling */
.export-group {
    display: flex;
    flex: 1 1 100%;
    min-width: 250px;
}

.export-group button {
    flex: 1 1 auto;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.export-group select {
    flex: 0 0 90px; 
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    background-color: var(--bg-secondary);
    text-align: center;
}

.view-depth-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 260px;
}

.view-depth-control select {
    min-width: 120px;
    background-color: var(--bg-secondary);
}

/* Text & Utils */
.muted {
    color: var(--muted);
}

pre, code {
    white-space: pre-wrap;
    word-break: break-all;
}

pre {
    background: var(--bg-pre);
    border: 1px solid var(--border-pre);
    padding: 10px;
    border-radius: 8px;
    max-height: 45vh;
    overflow: auto;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Details & Summary */
details {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    background: var(--bg-alt);
    margin: 10px 0;
    position: relative;
    z-index: 1;
    overflow-x: auto; 
}

details details {
    margin-left: 15px;
    margin-top: 8px;
    margin-bottom: 8px;
}

summary {
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

summary::-webkit-details-marker {
    display: none;
}

details > summary {
    display: flex;
    align-items: center;
}

summary::before {
    content: '▶';
    color: var(--muted);
    font-size: 0.8em;
    margin-right: 8px;
    display: inline-block;
    transition: transform 0.2s ease-in-out;
}

details[open] > summary::before {
    transform: rotate(90deg);
}

.kv {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    background: var(--bg-alt);
    margin: 2px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    table-layout: auto; 
}

th, td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    word-break: break-word; 
    overflow-wrap: anywhere;
}

th {
    background: var(--bg-header);
}

/* Source Row Styling (Mobile Redesign) */
tr.source-row td {
    background-color: #f4f4f4; /* Light gray for separation */
    color: #555;
    font-size: 0.85em;
    font-weight: bold;
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #ddd;
}

.source-detail {
    margin-top: 2px;
    font-weight: normal;
    letter-spacing: normal;
    text-transform: none;
}

tr.data-row td {
    padding-top: 8px;
    padding-bottom: 12px;
}

/* Dark Mode Overrides for Tables */
.dark-mode tr.source-row td {
    background-color: #2a2a2a;
    color: #aaa;
    border-bottom: 1px solid #444;
}

/* Utilities */
.action-icon {
    cursor: pointer;
    margin-left: 5px;
    text-decoration: none;
    font-size: 1.2em; 
    opacity: 0.7;
    vertical-align: middle;
    padding: 6px; 
    display: inline-block;
}
.action-icon:hover {
    opacity: 1;
}

.action-icon.https-action-icon {
    position: relative;
    display: inline-block;
    text-decoration: none;
}

.https-action-icon-suffix {
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 0.85em;
    font-weight: 900;
    color: var(--text-color);
    background-color: var(--bg-color);
    border-radius: 4px;
    padding: 0 2px;
    line-height: 1;
    border: 1px solid var(--bg-color);
}

.nowrap-container {
    white-space: nowrap;
    display: inline-block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Info & Warning Boxes */
.info-box {
    background-color: #ddf4ff;
    border: 1px solid #58a6ff;
    padding: 10px;
    border-radius: 8px;
    margin: 12px 0;
    color: #0d1117;
}

html.dark-mode .info-box {
    background-color: #162233;
    color: #e6edf3;
}

.warning-box {
    background-color: #fff8c5;
    border: 1px solid #d29922;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    color: #0d1117;
}

html.dark-mode .warning-box {
    background-color: #2e2917;
    color: #e6edf3;
}

/* Progress Bar */
progress {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

progress::-webkit-progress-bar {
    background-color: var(--bg-pre);
}

progress::-webkit-progress-value {
    background-color: #0969da;
    border-radius: 6px;
}

.api-key-input {
    width: 100%;
}

#resultsContainer, #warnings {
    position: relative;
    z-index: 1;
}

#resultsContainer details summary {
    font-size: 1.1em;
    padding: 6px 0;
}

/* Theme Toggle */
#theme-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: 1px solid var(--border);
    width: 36px;
    height: 36px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
}

#theme-toggle svg {
    width: 100%;
    height: 100%;
    fill: var(--muted);
}

#theme-toggle .sun-icon {
    display: none;
}

#theme-toggle .moon-icon {
    display: block;
}

html.dark-mode #theme-toggle .sun-icon {
    display: block;
}

html.dark-mode #theme-toggle .moon-icon {
    display: none;
}

/* History */
#historyContainer {
    margin-top: 12px;
}

#historyChips {
    max-height: 150px;
    overflow-y: auto;
    padding: 4px;
}

.history-chip {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 6px;
    margin: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.history-chip:hover {
    background-color: var(--bg-pre);
}

.history-add-btn,
.history-delete-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    font-family: system-ui, sans-serif;
    line-height: 1;
    padding: 0 4px;
    border-radius: 50%;
}

.history-add-btn:hover,
.history-delete-btn:hover {
    color: var(--text);
    background-color: rgba(128, 128, 128, 0.2);
}

.history-add-btn {
    margin-right: 6px;
    font-weight: 600;
}

.history-delete-btn {
    margin-left: 6px;
}

/* Sticky Footer */
#sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0; /* Updated from width:100vw to ensure responsiveness */
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #ccc;
    padding: 10px;
    z-index: 2147483647;
    backdrop-filter: blur(5px);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 25px;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    font-size: 0.8em;
    line-height: 1.4;
    color: var(--text-muted);
}

.dark-mode #sticky-footer {
    background: rgba(30, 30, 30, 0.95);
    border-color: #444;
}

#sticky-footer a {
    color: var(--primary-color);
    text-decoration: none;
    white-space: nowrap;
}

#sticky-footer a:hover {
    text-decoration: underline;
}

#sticky-footer span {
    white-space: nowrap;
}

/* File Upload */
.file-upload-label {
    display: inline-block;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    background-color: var(--bg-alt);
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    color: var(--muted);
    margin-left: 0;
}

/* Consent Modal */
#consent-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

#consent-overlay.is-visible {
    display: flex;
}

#consent-modal {
    background-color: var(--bg-alt);
    padding: 24px;
    border-radius: 8px;
    border: 1px solid var(--border);
    max-width: 500px;
    text-align: left;
}

#consent-modal h3 {
    margin-top: 0;
}

#consent-modal p {
    line-height: 1.5;
}

#consent-buttons {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

#consent-buttons button {
    margin-left: 0;
}

#decline-consent {
    background-color: var(--muted);
}

#consent-return-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    text-align: center;
    z-index: 150;
    font-size: 13px;
}

#consent-return-banner.is-visible {
    display: block;
}

/* Compact Display */
#resultsContainer.compact-display details {
    margin: 2px 0;
}

#resultsContainer.compact-display details details {
    margin-top: 2px;
    margin-bottom: 2px;
}

#resultsContainer.compact-display details summary {
    padding: 4px 0;
    font-size: 1em;
}

#resultsContainer.compact-display table {
    font-size: 13px;
}

#resultsContainer.compact-display th,
#resultsContainer.compact-display td {
    padding: 4px 8px;
}

/* Scan Options Layout Classes */
.scan-section {
    margin-bottom: 12px;
}

.scan-header {
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.scan-subsection {
    margin-left: 12px !important;
    margin-bottom: 4px;
    border-left: 2px solid var(--border);
    padding-left: 8px;
    font-size: 0.9em;
}

.scan-label-small {
    font-size: 0.85em;
    margin-left: 8px;
}

.scan-section-bordered {
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

/* Utility classes */
.hidden { display: none !important; }

.is-disabled {
    opacity: 0.6;
    pointer-events: none;
    cursor: default;
}

.is-error {
    color: var(--error-color);
}

/* Result block for a domain that does not exist. Sorted to the bottom of the
   results list by sortNxDomainResultsLast() and flagged in the header. */
.nxdomain-result > summary > strong {
    color: var(--error-color);
}

.spf-indented {
    margin-left: 20px;
}

.spf-mechanism-code {
    display: block;
    margin-bottom: 5px;
}

.ns-record-list {
    margin: 4px 0 10px 0;
}

.input-small-60 {
    flex: 0 0 60px;
    text-align: center;
    width: 60px;
    padding: 4px;
    font-size: 13px;
}

.input-small-30 {
    flex: 0 0 30px; /* Adapted flex properties */
    text-align: center;
    width: 30px;
    padding: 4px;
    font-size: 13px;
}

.input-small-select {
    padding: 4px;
    font-size: 13px;
}

.margin-bottom-2 { margin-bottom: 2px; }
.margin-bottom-4 { margin-bottom: 4px; }
.margin-bottom-5 { margin-bottom: 5px !important; }
.margin-top-5 { margin-top: 5px !important; }
.margin-top-8 { margin-top: 8px; }
.margin-12-0 { margin: 12px 0; }
.margin-5-0 { margin: 5px 0 !important; }
.margin-left-0 { margin-left: 0 !important; }
.muted-text-block { margin-bottom: 8px; }

.log-header-row {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.log-header-row-top {
    display: flex;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 4px;
}

.log-buttons-group {
    margin-left: auto;
    display: flex;
    gap: 6px;
}

.cache-indicator {
    font-weight: normal;
    font-size: 0.9em;
}

.break-all {
    word-break: break-all;
}

.clipboard-helper {
    position: fixed;
    top: 0;
    left: 0;
    width: 2em;
    height: 2em;
    padding: 0;
    border: none;
    outline: none;
    box-shadow: none;
    background: transparent;
}

/* Specific button colors overrides */
.file-upload-label, 
#runButton,
#copyLinkButton, 
#dlJson, 
#dlCsv, 
.copy-btn {
    background-color: #007bff !important;
    color: white !important;
    border: 1px solid transparent;
}

.file-upload-label:not(.is-disabled):hover, 
#runButton:not(:disabled):hover,
#copyLinkButton:not(:disabled):hover, 
#dlJson:not(:disabled):hover, 
#dlCsv:not(:disabled):hover, 
.copy-btn:not(:disabled):hover {
    background-color: #0056b3 !important;
    cursor: pointer;
}

.file-upload-label.is-disabled,
#runButton:disabled,
#copyLinkButton:disabled, 
#dlJson:disabled, 
#dlCsv:disabled, 
.copy-btn:disabled {
    background-color: #007bff !important; 
    opacity: 0.65 !important;            
    cursor: not-allowed !important;
}

/* Link Action Spacing */
.link-action-row { 
    margin-top: 8px; 
}

/* Scan Options Container */
#scanOptionsContainer { 
    min-width: 460px !important; 
}
#scanOptionsContainer label { 
    white-space: nowrap; 
}

#status {
    min-height: 2.8em;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Persistent labels for the API key fields. The inputs are type="password",
   so a placeholder alone leaves the user with two identical-looking dots
   fields once a key has been entered. */
.api-key-label {
    display: block;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2em;
}
.api-key-label + .api-key-input {
    margin-top: 0;
}


/* Reliability metadata */
.reliability-badge {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8em;
    line-height: 1.4;
    background: var(--bg-secondary);
    white-space: nowrap;
}

.reliability-high {
    border-color: #2da44e;
}

.reliability-medium {
    border-color: #bf8700;
}

.reliability-low {
    border-color: var(--error-color);
}


.wildcard-parent-details {
    margin-left: 22px;
    border-left: 3px solid var(--border);
}

.wildcard-parent-details > summary strong::after {
    content: '';
}


.wildcard-children-wrapper {
    margin-top: 10px;
}

.wildcard-children-heading {
    cursor: pointer;
    font-weight: 600;
    margin: 8px 0 6px;
}

.wildcard-child-list {
    margin: 6px 0 0 22px;
    padding: 0;
}

.wildcard-child-list.is-large {
    max-height: 22rem;
    overflow: auto;
    padding-right: 8px;
}

.wildcard-child-list li {
    margin: 3px 0;
    break-inside: avoid;
    word-break: break-word;
}

.wildcard-child-source {
    font-size: 0.9em;
}

@media (min-width: 900px) {
    .wildcard-child-list.is-large {
        column-count: 2;
        column-gap: 32px;
    }
}

/* Microsoft 365 tenant service endpoints in the Cloud Identity panel */
.tenant-service-list {
    margin: 2px 0;
    padding: 0 0 0 18px;
}

.tenant-service-list li {
    margin: 3px 0;
    break-inside: avoid;
    word-break: break-word;
}

@media (min-width: 900px) {
    .tenant-service-list {
        column-count: 2;
        column-gap: 32px;
    }
}

.evidence-list {
    margin: 6px 0 0 18px;
    padding: 0;
}

.evidence-list li {
    margin: 2px 0;
    word-break: break-word;
}


.dns-signals-section, .mail-posture-section {
    border-left: 3px solid var(--border);
    padding-left: 10px;
}

.signal-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-alt);
    margin: 8px 0;
    padding: 6px 10px;
}

.signal-card > summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.signal-card-warning {
    border-left: 4px solid var(--error-color);
}

.signal-card-signal {
    border-left: 4px solid var(--primary-color);
}

.signal-description {
    margin: 6px 0 0 18px;
    color: var(--muted);
}

.signal-evidence-list {
    margin-top: 8px;
}

.signal-evidence-raw {
    margin-top: 3px;
    margin-left: 18px;
}

.signal-evidence-raw code {
    white-space: normal;
    word-break: break-word;
}


.m365-saas-services {
    display: grid;
    gap: 8px;
}

.m365-saas-service-details {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 8px 10px;
}

.m365-saas-service-details > summary {
    flex-wrap: wrap;
    gap: 4px;
}

.m365-saas-service-details > .evidence-list {
    margin-top: 8px;
}


/* Unified Microsoft 365 service presentation: one flat signal list per service. */
.m365-service-signal-list {
    margin: 8px 0 0 18px;
    padding: 0;
}

.m365-service-signal-list li {
    margin: 4px 0;
    word-break: break-word;
}


/* Extracted from index.html during Phase 2 static asset cleanup. */
/* ── Redesigned Scan Summary ── */
.scan-summary-card {
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  background: var(--card-bg, rgba(255,255,255,0.03));
  margin: 0.5em 0;
  overflow: hidden;
}
.scan-summary-card summary {
  font-weight: 600;
  padding: 0.6em 0.8em;
}
.scan-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
}
.scan-metric {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 0.65em 0.9em;
  text-align: center;
  border-right: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.scan-metric:last-child { border-right: none; }
.scan-metric-value {
  font-size: 1.3em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.scan-metric-label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
  margin-top: 0.15em;
}
.scan-metric-primary .scan-metric-value {
  color: var(--accent-color, #6ea8fe);
}
.scan-metric-warning .scan-metric-value {
  color: var(--error-color, #f77);
}

/* Breakdown section (providers / countries) */
.scan-breakdown-section {
  padding: 0.6em 0.8em;
}
.scan-breakdown-section + .scan-breakdown-section {
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.scan-breakdown-title {
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  margin-bottom: 0.5em;
}
.scan-breakdown-helper {
  font-size: 0.65em;
  opacity: 0.4;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.5em;
}
.scan-breakdown-row {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.3em 0;
  font-variant-numeric: tabular-nums;
}
.scan-breakdown-name {
  flex: 0 0 auto;
  min-width: 90px;
  font-size: 0.85em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scan-breakdown-bar-track {
  flex: 1 1 auto;
  height: 6px;
  background: var(--border-color, rgba(255,255,255,0.08));
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
}
.scan-breakdown-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent-color, #6ea8fe);
  transition: width 0.3s ease;
}
.scan-bar-width-0 { width: 0%; }
.scan-bar-width-1 { width: 1%; }
.scan-bar-width-2 { width: 2%; }
.scan-bar-width-3 { width: 3%; }
.scan-bar-width-4 { width: 4%; }
.scan-bar-width-5 { width: 5%; }
.scan-bar-width-6 { width: 6%; }
.scan-bar-width-7 { width: 7%; }
.scan-bar-width-8 { width: 8%; }
.scan-bar-width-9 { width: 9%; }
.scan-bar-width-10 { width: 10%; }
.scan-bar-width-11 { width: 11%; }
.scan-bar-width-12 { width: 12%; }
.scan-bar-width-13 { width: 13%; }
.scan-bar-width-14 { width: 14%; }
.scan-bar-width-15 { width: 15%; }
.scan-bar-width-16 { width: 16%; }
.scan-bar-width-17 { width: 17%; }
.scan-bar-width-18 { width: 18%; }
.scan-bar-width-19 { width: 19%; }
.scan-bar-width-20 { width: 20%; }
.scan-bar-width-21 { width: 21%; }
.scan-bar-width-22 { width: 22%; }
.scan-bar-width-23 { width: 23%; }
.scan-bar-width-24 { width: 24%; }
.scan-bar-width-25 { width: 25%; }
.scan-bar-width-26 { width: 26%; }
.scan-bar-width-27 { width: 27%; }
.scan-bar-width-28 { width: 28%; }
.scan-bar-width-29 { width: 29%; }
.scan-bar-width-30 { width: 30%; }
.scan-bar-width-31 { width: 31%; }
.scan-bar-width-32 { width: 32%; }
.scan-bar-width-33 { width: 33%; }
.scan-bar-width-34 { width: 34%; }
.scan-bar-width-35 { width: 35%; }
.scan-bar-width-36 { width: 36%; }
.scan-bar-width-37 { width: 37%; }
.scan-bar-width-38 { width: 38%; }
.scan-bar-width-39 { width: 39%; }
.scan-bar-width-40 { width: 40%; }
.scan-bar-width-41 { width: 41%; }
.scan-bar-width-42 { width: 42%; }
.scan-bar-width-43 { width: 43%; }
.scan-bar-width-44 { width: 44%; }
.scan-bar-width-45 { width: 45%; }
.scan-bar-width-46 { width: 46%; }
.scan-bar-width-47 { width: 47%; }
.scan-bar-width-48 { width: 48%; }
.scan-bar-width-49 { width: 49%; }
.scan-bar-width-50 { width: 50%; }
.scan-bar-width-51 { width: 51%; }
.scan-bar-width-52 { width: 52%; }
.scan-bar-width-53 { width: 53%; }
.scan-bar-width-54 { width: 54%; }
.scan-bar-width-55 { width: 55%; }
.scan-bar-width-56 { width: 56%; }
.scan-bar-width-57 { width: 57%; }
.scan-bar-width-58 { width: 58%; }
.scan-bar-width-59 { width: 59%; }
.scan-bar-width-60 { width: 60%; }
.scan-bar-width-61 { width: 61%; }
.scan-bar-width-62 { width: 62%; }
.scan-bar-width-63 { width: 63%; }
.scan-bar-width-64 { width: 64%; }
.scan-bar-width-65 { width: 65%; }
.scan-bar-width-66 { width: 66%; }
.scan-bar-width-67 { width: 67%; }
.scan-bar-width-68 { width: 68%; }
.scan-bar-width-69 { width: 69%; }
.scan-bar-width-70 { width: 70%; }
.scan-bar-width-71 { width: 71%; }
.scan-bar-width-72 { width: 72%; }
.scan-bar-width-73 { width: 73%; }
.scan-bar-width-74 { width: 74%; }
.scan-bar-width-75 { width: 75%; }
.scan-bar-width-76 { width: 76%; }
.scan-bar-width-77 { width: 77%; }
.scan-bar-width-78 { width: 78%; }
.scan-bar-width-79 { width: 79%; }
.scan-bar-width-80 { width: 80%; }
.scan-bar-width-81 { width: 81%; }
.scan-bar-width-82 { width: 82%; }
.scan-bar-width-83 { width: 83%; }
.scan-bar-width-84 { width: 84%; }
.scan-bar-width-85 { width: 85%; }
.scan-bar-width-86 { width: 86%; }
.scan-bar-width-87 { width: 87%; }
.scan-bar-width-88 { width: 88%; }
.scan-bar-width-89 { width: 89%; }
.scan-bar-width-90 { width: 90%; }
.scan-bar-width-91 { width: 91%; }
.scan-bar-width-92 { width: 92%; }
.scan-bar-width-93 { width: 93%; }
.scan-bar-width-94 { width: 94%; }
.scan-bar-width-95 { width: 95%; }
.scan-bar-width-96 { width: 96%; }
.scan-bar-width-97 { width: 97%; }
.scan-bar-width-98 { width: 98%; }
.scan-bar-width-99 { width: 99%; }
.scan-bar-width-100 { width: 100%; }
.scan-breakdown-bar-fill.country-bar {
  background: var(--accent-secondary, #a3cfbb);
}
.scan-breakdown-count {
  flex: 0 0 auto;
  font-size: 0.8em;
  font-weight: 600;
  min-width: 28px;
  text-align: right;
}
.scan-breakdown-pct {
  flex: 0 0 auto;
  font-size: 0.72em;
  opacity: 0.5;
  min-width: 36px;
  text-align: right;
}

/* Mobile responsive overrides */
@media screen and (max-width: 768px) {
  /* Scan summary mobile */
  .scan-metrics-row {
    flex-direction: column;
  }
  .scan-metric {
    border-right: none;
    border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
    padding: 0.5em 0.8em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    text-align: left;
  }
  .scan-metric:last-child { border-bottom: none; }
  .scan-metric-value { font-size: 1.05em; }
  .scan-metric-label { margin-top: 0; font-size: 0.7em; }
  .scan-breakdown-name { min-width: 70px; }
  /* Make tables card-based on mobile */
  #resultsContainer table {
    display: block;
    width: 100%;
  }
  #resultsContainer thead {
    display: none;
  }
  #resultsContainer tbody {
    display: block;
    width: 100%;
  }
  #resultsContainer tbody tr {
    display: block;
    margin-bottom: 0.75em;
    padding: 0.6em;
    border: 1px solid var(--border-color, #444);
    border-radius: 6px;
    background: var(--card-bg, rgba(255,255,255,0.03));
  }
  #resultsContainer tbody td {
    display: block;
    padding: 0.25em 0;
    text-align: left;
    border: none;
    word-break: break-all;
    overflow-wrap: anywhere;
  }
  #resultsContainer tbody td::before {
    content: attr(data-label);
    display: block;
    font-weight: bold;
    font-size: 0.75em;
    opacity: 0.65;
    text-transform: uppercase;
    margin-bottom: 0.15em;
  }
  /* General mobile text overflow fixes */
  #resultsContainer {
    overflow-x: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  #resultsContainer details {
    overflow: hidden;
  }
  #resultsContainer pre,
  #resultsContainer code {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
  /* Chips wrap properly */
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35em;
  }
  /* Prevent IP/ASN info overflow */
  #resultsContainer td a,
  #resultsContainer td span {
    word-break: break-all;
    overflow-wrap: anywhere;
  }
}
