:root {
    color-scheme: dark;
    --bg: #090c10;
    --surface: #0d1219;
    --panel: #111821;
    --panel-2: #151e2a;
    --line: #263141;
    --line-strong: #34445a;
    --text: #e3e9f2;
    --muted: #9aa7b8;
    --muted-strong: #b8c3d0;
    --blue: #69b7ff;
    --green: #4fdd8a;
    --yellow: #f0c95a;
    --red: #ff7373;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
    --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(105, 183, 255, 0.16), transparent 30rem),
        linear-gradient(180deg, rgba(79, 221, 138, 0.055), transparent 22rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

a,
button,
input,
select,
textarea {
    transition:
        background-color 150ms ease,
        border-color 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

:focus-visible {
    outline: 3px solid rgba(105, 183, 255, 0.42);
    outline-offset: 3px;
}

.site-header,
.site-footer,
.page-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    border-radius: 10px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(79, 221, 138, 0.36);
    background:
        linear-gradient(135deg, rgba(79, 221, 138, 0.14), rgba(105, 183, 255, 0.08)),
        #0c1320;
    color: var(--green);
    border-radius: 8px;
    font: 800 20px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 13px;
}

.brand strong {
    color: #f5f8fc;
    font-size: 16px;
}

.site-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-nav a,
.nav-trigger {
    width: auto;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 8px 11px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    font-family: inherit;
}

.site-nav a:hover,
.site-nav a.is-active,
.nav-trigger:hover,
.nav-trigger.is-active {
    border-color: var(--line-strong);
    background: rgba(17, 24, 33, 0.88);
    color: var(--text);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}

.nav-group {
    position: relative;
    padding-bottom: 8px;
    margin-bottom: -8px;
}

.nav-trigger::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    margin-left: 7px;
    transform: translateY(-2px) rotate(45deg);
    opacity: 0.72;
}

.nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 230px;
    border: 1px solid var(--line);
    background: rgba(13, 20, 33, 0.98);
    border-radius: 8px;
    padding: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
    pointer-events: none;
}

.nav-group:hover .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-group:focus-within .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.nav-menu a {
    border-radius: 6px;
    padding: 9px 10px;
}

.nav-menu a:hover {
    background: rgba(105, 183, 255, 0.1);
}

.page-shell {
    padding: 28px 0 54px;
}

.hero,
.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
    gap: 32px;
    align-items: center;
}

.hero {
    min-height: 420px;
    padding: 28px 0 10px;
}

.hero h1,
.tool-intro h1 {
    margin: 0;
    max-width: 760px;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.04;
    letter-spacing: 0;
}

.hero-copy,
.tool-intro p {
    max-width: 680px;
    color: var(--muted);
    font-size: 17px;
}

.hero-copy {
    font-size: 18px;
    color: var(--muted-strong);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.hero-actions .button-primary,
.hero-actions .button-secondary {
    width: auto;
    min-width: 148px;
    min-height: 42px;
    padding: 10px 14px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font: 700 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: 0;
    text-transform: uppercase;
}

.terminal-panel,
.tool-form,
.result-panel,
.category-card,
.tool-card,
.notice {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        linear-gradient(180deg, var(--panel), #0f1623);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.terminal-panel {
    overflow: hidden;
    justify-self: stretch;
}

.terminal-bar {
    display: flex;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.terminal-bar span {
    width: 11px;
    height: 11px;
    border-radius: 999px;
    background: var(--red);
}

.terminal-bar span:nth-child(2) {
    background: var(--yellow);
}

.terminal-bar span:nth-child(3) {
    background: var(--green);
}

pre,
code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    color: #b8c7da;
    line-height: 1.65;
}

.section-block {
    margin-top: 48px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
    font-size: 26px;
}

.section-heading span {
    max-width: 520px;
    color: var(--muted);
}

.tool-grid,
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.category-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.category-panel {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        linear-gradient(180deg, var(--panel), #0f1623);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-soft);
}

.category-panel:hover,
.tool-card:hover,
.category-card:hover,
.metric-card:hover {
    border-color: var(--line-strong);
}

.category-panel-heading {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.category-panel h3,
.category-panel p {
    margin: 0;
}

.category-panel h3 {
    color: #f2f6fb;
    font-size: 22px;
}

.category-panel p {
    color: var(--muted);
    margin-top: 4px;
}

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

.tool-list a {
    border: 1px solid var(--line);
    background: #090f19;
    color: var(--text);
    border-radius: 7px;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 14px;
}

.tool-list a:hover {
    border-color: var(--blue);
    color: #f2f6fb;
    transform: translateY(-1px);
}

.tool-card,
.category-card {
    min-height: 154px;
    padding: 18px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-card:hover {
    border-color: rgba(90, 169, 255, 0.72);
    transform: translateY(-1px);
}

.tool-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 28px;
    border: 1px solid rgba(67, 209, 122, 0.35);
    color: var(--green);
    border-radius: 6px;
    font: 700 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.tool-card span,
.category-card p {
    color: var(--muted);
}

.category-card strong,
.tool-card strong {
    color: #f2f6fb;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 26px;
}

.breadcrumbs a {
    color: var(--blue);
}

.tool-form {
    padding: 22px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #f2f6fb;
    font-weight: 700;
}

input,
select,
textarea,
button {
    width: 100%;
    min-height: 44px;
    font: inherit;
}

input,
select,
textarea {
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: rgba(9, 15, 25, 0.96);
    color: var(--text);
    border-radius: 8px;
    padding: 11px 12px;
}

input::placeholder,
textarea::placeholder {
    color: #748197;
}

.conditional-field[hidden] {
    display: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(105, 183, 255, 0.28);
    outline-offset: 0;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(105, 183, 255, 0.08);
}

textarea {
    resize: vertical;
}

.textarea-large {
    min-height: 260px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.form-meta {
    display: grid;
    grid-template-columns: 1fr minmax(180px, 220px);
    gap: 12px;
    align-items: center;
}

.form-meta span {
    color: var(--muted);
    font-size: 13px;
}

.form-hint {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.checkbox-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.checkbox-list label {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    gap: 7px;
    margin: 0;
}

.checkbox-list input {
    accent-color: var(--accent);
    height: 16px;
    width: 16px;
}

.checkbox-grid {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--text);
    font-weight: 600;
}

.checkbox-grid input {
    width: 18px;
    min-height: 18px;
    margin: 0;
}

.compact-checkbox-grid {
    margin-top: 12px;
}

.imapsync-options-grid {
    margin-top: 16px;
}

.button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: linear-gradient(180deg, #66eca0, var(--green));
    color: #06120b;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(79, 221, 138, 0.18);
}

.button-primary:hover {
    background: linear-gradient(180deg, #7af4ad, #55e493);
    transform: translateY(-1px);
}

.button-primary:active,
.button-secondary:active,
.tool-list a:active {
    transform: translateY(0);
}

.button-secondary {
    width: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 1px solid var(--line);
    background: rgba(11, 18, 32, 0.92);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 700;
    white-space: nowrap;
}

.button-secondary:hover {
    border-color: var(--blue);
    color: #f5f8fc;
    transform: translateY(-1px);
}

.danger-action {
    border-color: rgba(255, 107, 107, 0.35);
    color: #ffd9d9;
}

.danger-action:hover {
    border-color: var(--red);
}

.inline-action-form {
    margin: 0;
}

.inline-action-form button {
    min-height: 38px;
}

.cleanup-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.cleanup-form label {
    margin: 0;
}

.cleanup-form input {
    width: 90px;
}

.notice {
    display: grid;
    gap: 4px;
    margin-top: 22px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.action-notice {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.action-notice span {
    display: block;
    color: var(--muted);
}

.notice-error {
    border-color: rgba(255, 107, 107, 0.45);
}

.notice-error strong {
    color: var(--red);
}

.notice-warning {
    border-color: rgba(232, 198, 91, 0.5);
}

.notice-warning strong {
    color: var(--yellow);
}

.results-stack {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 30px 0;
}

.summary-grid.compact-summary {
    margin-top: -14px;
}

.metric-card {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        var(--panel);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-soft);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    color: #f2f6fb;
    font-size: 24px;
    overflow-wrap: anywhere;
    line-height: 1.18;
}

.metric-value-small {
    font-size: 18px !important;
    line-height: 1.25;
}

.text-success {
    color: var(--green) !important;
}

.text-danger {
    color: var(--red) !important;
}

.text-warning {
    color: var(--yellow) !important;
}

.status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.status-strip span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(12, 19, 32, 0.88);
    color: var(--muted);
    padding: 5px 10px;
    font-size: 13px;
    font-weight: 700;
}

.status-strip .status-ok {
    border-color: rgba(67, 209, 122, 0.42);
    color: var(--green);
}

.status-strip .status-warn {
    border-color: rgba(232, 198, 91, 0.5);
    color: var(--yellow);
}

.result-panel {
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.raw-result {
    margin-top: 28px;
}

.raw-result pre {
    max-height: 620px;
}

.result-panel pre,
.terminal-panel pre {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.result-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.018);
}

.result-heading h2 {
    margin: 0;
    font-size: 19px;
    overflow-wrap: anywhere;
}

.result-heading span {
    color: var(--muted);
    white-space: nowrap;
}

.result-heading small,
.result-timestamp {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.result-tools {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    align-items: center;
}

.copy-output-button {
    width: auto;
    min-height: 32px;
    border: 1px solid var(--line);
    background: rgba(9, 15, 25, 0.92);
    color: var(--text);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.copy-output-button:hover {
    border-color: var(--blue);
    color: #f5f8fc;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
}

.detail-grid > div {
    min-width: 0;
    background: #0f1623;
    padding: 17px 18px;
}

.detail-grid h3 {
    margin: 0 0 8px;
    color: var(--blue);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0;
}

.detail-grid p {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px;
}

.tag-list code {
    border: 1px solid var(--line);
    background: #090f19;
    border-radius: 6px;
    padding: 6px 8px;
    color: #dbeafe;
    overflow-wrap: anywhere;
}

.chain-list {
    display: grid;
    gap: 1px;
    background: var(--line);
}

.chain-list article {
    display: grid;
    gap: 4px;
    background: #0f1623;
    padding: 16px 18px;
}

.chain-list article:hover,
.finding-list article:hover,
.header-check-list article:hover,
.timeline-list article:hover,
.attachment-list article:hover,
tbody tr:hover td {
    background: #121b29;
}

.chain-list span,
.empty-state {
    color: var(--muted);
}

.empty-state {
    margin: 0;
    padding: 18px;
}

.result-panel .empty-state {
    background: rgba(9, 15, 25, 0.34);
}

.result-empty {
    display: grid;
    gap: 4px;
}

.result-empty strong {
    color: var(--green);
}

.table-link {
    color: var(--blue);
    overflow-wrap: anywhere;
}

.table-link:hover {
    color: #f2f6fb;
}

.empty-state.compact {
    padding: 0;
}

.resolver-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.resolver-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        linear-gradient(180deg, var(--panel), #0d1421);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.resolver-card.is-match {
    border-color: rgba(67, 209, 122, 0.34);
}

.resolver-card.is-mismatch {
    border-color: rgba(232, 198, 91, 0.48);
}

.resolver-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.resolver-card-header strong,
.resolver-card-header span {
    display: block;
}

.resolver-card-header strong {
    color: #f2f6fb;
}

.resolver-card-header span,
.resolver-meta {
    color: var(--muted);
    font-size: 13px;
}

.status-pill {
    align-self: flex-start;
    border-radius: 999px;
    padding: 4px 8px;
    font: 800 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-transform: uppercase;
}

.status-ok {
    background: rgba(67, 209, 122, 0.14);
    color: var(--green);
}

.status-warn {
    background: rgba(232, 198, 91, 0.14);
    color: var(--yellow);
}

.resolver-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.resolver-card pre {
    border: 1px solid var(--line);
    background: #090f19;
    border-radius: 8px;
    padding: 12px;
    font-size: 13px;
}

.finding-list {
    display: grid;
    gap: 1px;
    background: var(--line);
}

.finding-list article {
    background: #0f1623;
    padding: 18px;
}

.finding-list h3 {
    margin: 12px 0 8px;
    font-size: 20px;
}

.finding-list p {
    margin: 0 0 12px;
    color: var(--muted);
}

.finding-list strong {
    color: #f2f6fb;
}

.header-check-list {
    display: grid;
    gap: 1px;
    background: var(--line);
}

.header-check-list article {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 18px;
    background: #0f1623;
    padding: 18px;
}

.header-check-list h3 {
    margin: 12px 0 8px;
    font-size: 20px;
}

.header-check-list p {
    margin: 0;
    color: var(--muted);
}

.header-check-list code {
    display: block;
    border: 1px solid var(--line);
    background: #090f19;
    border-radius: 8px;
    padding: 10px;
    color: #dbeafe;
    overflow-wrap: anywhere;
}

.header-check-list strong {
    display: block;
    margin-bottom: 8px;
    color: #f2f6fb;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 28px 0;
}

.auth-card {
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
        linear-gradient(180deg, var(--panel), #0d1421);
    border-radius: 8px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.auth-card h2 {
    margin: 14px 0 8px;
    font-size: 24px;
}

.auth-card p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.status-bad {
    background: rgba(255, 107, 107, 0.14);
    color: var(--red);
}

.status-neutral {
    background: rgba(143, 155, 174, 0.14);
    color: var(--muted);
}

.live-log-heading {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.live-log-heading h2 {
    margin-top: 8px;
}

.live-log-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(67, 209, 122, 0.12);
}

.live-log-output {
    max-height: 520px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #070c14;
    padding: 16px;
    white-space: pre-wrap;
}

.raw-result pre,
.live-log-output,
.resolver-card pre,
.header-check-list code {
    max-width: 100%;
}

.live-log-output code {
    font-size: 13px;
    line-height: 1.55;
}

.timeline-list {
    display: grid;
    gap: 1px;
    background: var(--line);
}

.timeline-list article {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    background: #0f1623;
    padding: 16px 18px;
}

.timeline-index {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(90, 169, 255, 0.4);
    border-radius: 999px;
    color: var(--blue);
    font: 800 13px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.timeline-list strong {
    color: #f2f6fb;
    overflow-wrap: anywhere;
}

.timeline-list p {
    margin: 4px 0 10px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

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

.timeline-meta span {
    border: 1px solid var(--line);
    background: #090f19;
    border-radius: 6px;
    padding: 5px 7px;
    color: var(--muted);
    font-size: 13px;
}

.table-scroll {
    overflow-x: auto;
}

.eml-preview-frame {
    display: block;
    width: 100%;
    min-height: 380px;
    border: 0;
    background: #ffffff;
}

.attachment-list {
    display: grid;
    gap: 1px;
    background: var(--line);
}

.attachment-list article {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    background: #0f1623;
    padding: 14px 18px;
}

.attachment-list strong,
.attachment-list span {
    overflow-wrap: anywhere;
}

.attachment-list span {
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 11px 14px;
    border-bottom: 1px solid rgba(38, 50, 68, 0.82);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--blue);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0;
    background: rgba(105, 183, 255, 0.05);
}

td code {
    color: #dbeafe;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 24px 0 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.site-footer strong {
    color: var(--text);
}

@media (max-width: 860px) {
    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-header {
        gap: 14px;
    }

    .site-nav {
        justify-content: flex-start;
        width: 100%;
        gap: 6px;
    }

    .hero,
    .tool-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: 0;
        padding-top: 12px;
    }

    .tool-grid,
    .category-grid,
    .category-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-grid,
    .action-notice,
    .detail-grid,
    .header-check-list article,
    .attachment-list article {
        grid-template-columns: 1fr;
    }

    .result-heading,
    .live-log-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-tools,
    .live-log-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .table-scroll {
        margin: 0 -1px;
        border-radius: 0 0 8px 8px;
    }

    table {
        min-width: 640px;
    }

    .action-notice .button-secondary {
        width: 100%;
    }

    .resolver-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .section-heading {
        display: block;
    }

    .section-heading span {
        display: block;
        margin-top: 8px;
    }
}

@media (max-width: 560px) {
    .site-header,
    .site-footer,
    .page-shell {
        width: min(100% - 22px, 1120px);
    }

    .brand small {
        display: none;
    }

    .site-nav {
        flex-wrap: nowrap;
        margin: 0 -11px;
        padding: 0 11px 8px;
        overflow-x: auto;
        scrollbar-width: thin;
        overscroll-behavior-x: contain;
    }

    .site-nav a,
    .nav-trigger {
        white-space: nowrap;
    }

    .nav-group {
        position: static;
    }

    .nav-menu {
        left: 11px;
        right: 11px;
        top: auto;
        min-width: 0;
    }

    .tool-grid,
    .category-grid,
    .category-overview {
        grid-template-columns: 1fr;
    }

    .hero h1,
    .tool-intro h1 {
        font-size: 34px;
        line-height: 1.08;
    }

    .hero-copy,
    .tool-intro p {
        font-size: 16px;
    }

    .hero-actions,
    .hero-actions .button-primary,
    .hero-actions .button-secondary {
        width: 100%;
    }

    .button-primary,
    .button-secondary,
    .copy-output-button,
    .live-log-actions a,
    .live-log-actions button,
    .cleanup-form button {
        width: 100%;
    }

    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    .terminal-panel pre {
        font-size: 13px;
        padding: 16px;
    }

    .result-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
    }

    .result-heading span,
    .result-heading small,
    .result-timestamp {
        white-space: normal;
    }

    .result-tools {
        display: grid;
        width: 100%;
    }

    .raw-result pre,
    .live-log-output {
        max-height: 440px;
        padding: 14px;
        font-size: 12px;
    }

    .metric-card strong {
        font-size: 21px;
    }

    .detail-grid > div,
    .finding-list article,
    .header-check-list article,
    .timeline-list article,
    .chain-list article {
        padding: 15px;
    }

    .status-strip span,
    .status-pill {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .cleanup-form {
        display: grid;
    }

    .cleanup-form input {
        width: 100%;
    }

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

    .form-meta {
        grid-template-columns: 1fr;
    }

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

    .tool-form,
    .category-panel,
    .notice {
        padding: 16px;
    }

    .result-panel {
        border-radius: 8px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .nav-group:hover .nav-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        pointer-events: none;
    }

    .nav-group:focus-within .nav-trigger {
        border-color: var(--line);
        background: #111827;
        color: var(--text);
    }

    .nav-group:focus-within .nav-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}
