:root {
    color-scheme: dark;
    --bg: #070a12;
    --panel: #0f1723;
    --panel-alt: #131b2d;
    --surface: #171f33;
    --surface-muted: #1b2540;
    --text: #e9edf5;
    --muted: #9aa7c4;
    --border: rgba(255, 255, 255, 0.08);
    --primary: #38bdf8;
    --primary-strong: #22c55e;
    --accent: #facc15;
    --danger: #f87171;
    --warning: #fbbf24;
    --success: #34d399;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    --radius: 20px;
    --radius-sm: 12px;
    --grid-gap: 20px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #edf2f7;
    --panel: #f3f6fb;
    --panel-alt: #e7edf6;
    --surface: #f7fbff;
    --surface-muted: #d9e2ec;
    --text: #0f172a;
    --muted: #475569;
    --border: rgba(15, 23, 42, 0.12);
    --field-border: rgba(15, 23, 42, 0.16);
    --input-bg: #f3f7fd;
    --card-bg: #f5f9ff;
    --card-border: rgba(15, 23, 42, 0.08);
    --primary: #0ea5e9;
    --primary-strong: #16a34a;
    --accent: #eab308;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 24%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    backdrop-filter: blur(18px);
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(140deg, #22c55e, #38bdf8);
    font-weight: 800;
    color: #031011;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.brand-tag {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

input::placeholder {
    color: rgba(234, 237, 245, 0.5);
}

.icon-btn,
.secondary,
.text-btn,
.primary,
.large,
.mode-btn {
    border: none;
    border-radius: 14px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.icon-btn,
.secondary,
.text-btn,
.mode-btn {
    padding: 0.9rem 1rem;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.mode-switch {
    display: inline-flex;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.35rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active,
.primary,
.secondary:hover,
.icon-btn:hover,
.primary:hover,
.text-btn:hover,
.mode-btn:hover {
    transform: translateY(-1px);
}

.mode-btn.active,
.primary {
    background: linear-gradient(135deg, #38bdf8, #22c55e);
    color: #031011;
}

.text-btn {
    background: transparent;
    color: var(--muted);
}

.primary.large {
    padding: 1rem 1.2rem;
    min-width: 170px;
}

.layout-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding: 1.8rem;
    position: relative;
    flex: 1;
}

.layout-grid:has(.summary-panel.hidden):has(.findings-panel.hidden):has(.export-panel.hidden) {
    justify-content: center;
}

.workspace {
    width: min(100%, 1100px);
    display: grid;
    gap: 2rem;
}

.history-tab {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 10px 10px 0;
    padding: 1rem 0.55rem;
    color: var(--muted);
    cursor: pointer;
    writing-mode: vertical-lr;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: left 0.3s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.history-tab:hover {
    background: var(--surface);
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.3);
}

.layout-grid:has(#history-sidebar:not(.hidden)) .history-tab {
    left: 320px;
}

@media (max-width: 768px) {
    .layout-grid:has(#history-sidebar:not(.hidden)) .history-tab {
        left: 280px;
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.hidden {
    display: none !important;
}

.history-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    background: var(--panel);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.history-sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.3rem 1.2rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

.sidebar-header button {
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
}

#history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.8rem;
}

.sidebar-footer {
    padding: 1rem 0.8rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .history-sidebar {
        width: 280px;
    }
}

.centered-panel {
    max-width: 820px;
    margin: 0 auto;
}

.input-panel.panel-card {
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    padding: 2.5rem 1.6rem;
}

.input-panel .panel-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2rem;
}

.input-panel #input-title {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
}

.input-panel .panel-description {
    font-size: 1rem;
    margin-top: 0.6rem;
}

.input-panel .investigation-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-panel .investigation-form input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.07);
}

:root[data-theme="light"] .input-panel .investigation-form input {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

:root[data-theme="light"] .input-panel .investigation-form input:focus {
    background: rgba(14, 165, 233, 0.04);
    border-color: rgba(14, 165, 233, 0.35);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.07);
}

.panel-card {
    max-width: 100%;
}

.panel-card {
    background: linear-gradient(180deg, var(--panel), var(--panel-alt));
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    padding: 1.6rem;
    width: 100%;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.panel-header h2 {
    margin: 0;
    font-size: 1rem;
}

.panel-description {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}


.list-group {
    display: grid;
    gap: 0.75rem;
}

.recent-item,
.history-item {
    display: grid;
    gap: 0.35rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.recent-item span,
.history-item span {
    color: var(--muted);
    font-size: 0.86rem;
}

.recent-item button,
.history-actions button {
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 0.45rem 0.65rem;
    border-radius: 12px;
}

.recent-item button:hover,
.history-actions button:hover {
    background: rgba(56, 189, 248, 0.14);
}

.history-item {
    position: relative;
}

.history-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.workspace {
    display: grid;
    gap: var(--grid-gap);
}

.input-panel .investigation-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.input-panel .investigation-form input {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--field-border, rgba(255, 255, 255, 0.10));
    background: var(--input-bg, rgba(255, 255, 255, 0.04));
    color: var(--text);
    outline: none;
}

@media (max-width: 600px) {
    .input-panel .investigation-form {
        grid-template-columns: 1fr;
    }
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.history-panel {
    max-width: 820px;
    margin: 0 auto;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1.35rem;
}

.summary-title {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.mini-text {
    margin-top: 0.7rem;
    color: var(--muted);
    line-height: 1.6;
}

.risk-meter {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.risk-meter span {
    font-weight: 700;
}

.risk-bar {
    margin-top: 1rem;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.risk-bar span {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, #34d399, #f87171);
    transition: width 0.35s ease;
}

.indicator-list {
    display: grid;
    gap: 0.7rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.indicator-list li {
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
}

.findings-panel {
    padding-bottom: 1.2rem;
}

.collapsible-group {
    display: grid;
    gap: 0.9rem;
}

.findings-divider {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.9rem 0 0.2rem;
    border-top: 1px solid var(--border);
    margin-top: 0.35rem;
}

.findings-divider:first-child {
    padding-top: 0;
    border-top: none;
    margin-top: 0;
}

.findings-divider-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--primary);
    white-space: nowrap;
}

.findings-divider-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collapsible-card {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 0.5rem;
}

.collapsible-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.3rem 1.35rem;
    background: transparent;
    color: var(--text);
    border: none;
    text-align: left;
}

.collapsible-title {
    font-weight: 600;
}

.collapsible-meta {
    font-size: 0.9rem;
    color: var(--muted);
}

.collapsible-content {
    padding: 0 1.25rem 1.25rem;
    color: var(--text);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.collapsible-content>*:first-child {
    margin-top: 1rem;
}

.info-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-card {
    background: var(--card-bg, rgba(255, 255, 255, 0.03));
    padding: 1.3rem;
    border-radius: 14px;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
}

.info-card h3 {
    margin: 0 0 0.85rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.info-card p,
.info-card li,
.info-card dt,
.info-card dd {
    margin: 0;
    line-height: 1.65;
}

.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1rem;
}

.info-list dt {
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 0.35rem;
}

.info-list dd {
    margin-left: 0;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    color: var(--text);
}

.info-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text);
}

.info-list strong {
    color: var(--muted);
}

.detail-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.88rem;
    line-height: 1.2;
}

.detail-pill.good {
    background: rgba(52, 211, 153, 0.14);
    color: #86efac;
}

.detail-pill.bad {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

.detail-pill.neutral {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.export-actions {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0.75rem;
}

.export-panel {
    padding-bottom: 1.25rem;
}

.export-note {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    color: var(--muted);
    font-size: 0.93rem;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

.ioc-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 1.1rem;
}

.ioc-type-badge.email-type {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.22);
}

.ioc-type-badge.url-type {
    background: rgba(52, 211, 153, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.22);
}

.dork-results {
    display: grid;
    gap: 0.75rem;
}

.dork-item {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.osint-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: rgba(251, 191, 36, 0.07);
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--warning);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.dork-header {
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 0.3rem;
}

.dork-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.dork-source-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--primary);
}

.dork-search-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;
    transition: background 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.dork-search-link:hover {
    background: rgba(56, 189, 248, 0.12);
}

.dork-query-text {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.78rem;
    color: var(--muted);
    word-break: break-all;
    background: transparent;
}

.breach-verify-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0 0.25rem;
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.breach-verify-label {
    font-size: 0.76rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-right: 0.25rem;
}

.breach-link-btn {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 0.25rem 0.65rem;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 999px;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.breach-link-btn:hover {
    background: rgba(56, 189, 248, 0.1);
}

.dork-body {
    padding: 0.75rem 1rem;
    display: grid;
    gap: 0.75rem;
}

.dork-hit {
    display: grid;
    gap: 0.2rem;
}

.dork-hit-ref {
    font-size: 0.78rem;
    color: var(--success);
    font-weight: 600;
}

.dork-hit-snippet {
    font-size: 0.86rem;
    color: var(--text);
    line-height: 1.55;
    font-family: 'Courier New', Courier, monospace;
}

.dork-hit-date {
    font-size: 0.74rem;
    color: var(--muted);
}

.dork-none {
    font-size: 0.84rem;
    color: var(--muted);
    font-style: italic;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.1rem 1rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.loading-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.api-source-link {
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.76rem;
}

.api-source-link a {
    color: var(--muted);
    text-decoration: none;
    font-family: 'Courier New', Courier, monospace;
    word-break: break-all;
}

.api-source-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.api-source-inline {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    color: var(--muted);
    text-decoration: none;
    word-break: break-all;
}

.api-source-inline:hover {
    color: var(--primary);
    text-decoration: underline;
}

.api-error {
    font-size: 0.85rem;
    color: var(--warning);
    padding: 0.5rem 0;
    margin: 0;
}

.breach-record {
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 0.25rem;
}

.breach-record:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.breach-record:first-child {
    padding-top: 0;
}

.breach-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--danger);
}

.breach-meta {
    font-size: 0.83rem;
    color: var(--muted);
}

.analysis-expander {
    display: flex;
    justify-content: center;
}

.analysis-expand-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 0.6rem 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.analysis-expand-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.25);
}

.analysis-expand-btn .expand-icon {
    display: inline-block;
    font-size: 0.72em;
    opacity: 0.7;
    transition: transform 0.25s ease;
}

.analysis-expand-btn.expanded .expand-icon {
    transform: rotate(180deg);
}


.screenshot-placeholder {
    min-height: 180px;
    padding: 1rem;
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    display: grid;
    place-items: center;
    background: rgba(56, 189, 248, 0.04);
    color: var(--muted);
}

.screenshot-label {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.secondary {
    transition: background 0.2s ease, color 0.2s ease;
}

.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.secondary:hover {
    background: rgba(56, 189, 248, 0.14);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge.safe {
    background: rgba(52, 211, 153, 0.12);
    color: #86efac;
}

.badge.suspicious {
    background: rgba(251, 191, 36, 0.12);
    color: #facc15;
}

.badge.malicious {
    background: rgba(248, 113, 113, 0.12);
    color: #fecaca;
}

.badge.unknown {
    background: rgba(148, 163, 184, 0.12);
    color: #cbd5e1;
}

.highlight-danger {
    color: #fb7185;
    font-weight: 700;
}

.highlight-warning {
    color: #fbbf24;
    font-weight: 700;
}

@media (max-width: 1080px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .top-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-search {
        min-width: auto;
        width: 100%;
    }

    .mode-switch {
        width: 100%;
    }

    .input-panel .investigation-form {
        grid-template-columns: 1fr;
    }
}

/* ─── Platform Presence (Sherlock-style) ─────────────────────── */
.presence-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin: 0.85rem 0 0.4rem;
}

.presence-group-label:first-child {
    margin-top: 0;
}

.presence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.presence-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    background: var(--surface);
    transition: background 0.15s, border-color 0.15s;
    min-width: 0;
}

.presence-found {
    border-color: rgba(52, 211, 153, 0.22);
    background: rgba(52, 211, 153, 0.05);
}

.presence-found:hover {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.4);
}

.presence-search:hover {
    background: rgba(56, 189, 248, 0.06);
    border-color: rgba(56, 189, 248, 0.2);
}

.presence-dot {
    font-size: 0.55rem;
    flex-shrink: 0;
    line-height: 1;
}

.found-dot {
    color: var(--success);
}

.search-dot {
    color: var(--muted);
    opacity: 0.5;
}

.presence-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.presence-badge {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--success);
    flex-shrink: 0;
    letter-spacing: 0.03em;
}

.presence-action {
    font-size: 0.68rem;
    color: var(--primary);
    flex-shrink: 0;
    opacity: 0.7;
}

.presence-general-search {
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border);
}

/* ─── Info button ─────────────────────────────────────────────── */
.info-btn {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--muted);
    transition: color 0.2s ease;
}

.info-btn:hover {
    color: var(--primary);
}

/* ─── Info / About modal ──────────────────────────────────────── */
.info-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.info-modal.hidden {
    display: none;
}

.info-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.info-modal-card {
    position: relative;
    z-index: 1;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 600px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.info-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.info-modal-header h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.info-modal-body {
    overflow-y: auto;
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.info-beta-banner {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.info-beta-pill {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    flex-shrink: 0;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-section h3 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--primary);
    margin: 0;
}

.info-section p {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
    margin: 0;
}

.info-note {
    font-size: 0.8rem !important;
    background: rgba(56, 189, 248, 0.07);
    border-left: 3px solid var(--primary);
    padding: 0.55rem 0.85rem;
    border-radius: 0 6px 6px 0;
    color: var(--muted) !important;
}

.info-api-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.info-api-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.1rem;
}

.info-api-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    grid-column: 1;
    grid-row: 1;
}

.info-api-desc {
    font-size: 0.78rem;
    color: var(--muted);
    grid-column: 1;
    grid-row: 2;
}

.info-api-link {
    font-size: 0.76rem;
    color: var(--primary);
    text-decoration: none;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.info-api-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.info-disclaimer {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.info-disclaimer p + p {
    margin-top: 0.5rem;
}