/* ==========================================================================
   Command Deck - Odin's Eye analysis shell (from the Odin Redesign, variant A)
   Loads last: owns the app shell (rail + header + content column) and the
   deck-native Overview. Section internals (route timeline, IOC workbench,
   drawers, notifications) keep their existing stylesheets.
   ========================================================================== */

/* --- Type system ---------------------------------------------------------- */
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/assets/fonts/hanken.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/assets/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
    --deck-serif: "Fraunces", Georgia, serif;
    --deck-body: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
    --deck-mono: "JetBrains Mono", ui-monospace, monospace;
    --deck-bg: #060911;
    --deck-panel: #0e1523;
    --deck-rail: #0a0f1a;
    --deck-hair: rgba(140, 170, 220, 0.14);
    --deck-hair-strong: rgba(140, 170, 220, 0.28);
    --deck-ink: #eaf1fb;
    --deck-soft: #b7c4da;
    --deck-mute: #7c8aa6;
    --deck-dim: #56637d;
    --deck-accent: #35e0ff;
    --deck-good: #37e0a8;
    --deck-good-soft: #5fe9be;
    --deck-warn: #ffb347;
    --deck-warn-soft: #ffc477;
    --deck-danger: #ff5a6e;
    --deck-danger-soft: #ff8592;
}

body.deck {
    margin: 0;
    background: var(--deck-bg);
    color: var(--deck-ink);
    font-family: var(--deck-body);
    -webkit-font-smoothing: antialiased;
}

.deck-kicker {
    margin: 0;
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
/* Link back to the owning investigation when viewing a persisted artifact. */
.deck-artifact-back { color: var(--deck-accent, #35e0ff); text-decoration: underline dotted; text-underline-offset: 3px; }
.deck-artifact-back:hover { text-decoration-style: solid; }
.deck-artifact-back:focus-visible { outline: 2px solid var(--deck-accent, #35e0ff); outline-offset: 2px; }

/* --- Shell grid: rail | main ---------------------------------------------- */
.deck-shell {
    height: 100vh;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    overflow: hidden;
    transition: grid-template-columns 0.25s ease;
}
.deck-shell.rail-collapsed { grid-template-columns: 60px minmax(0, 1fr); }

/* --- Rail ------------------------------------------------------------------ */
.deck-rail {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.8rem 10px;
    border-right: 1px solid var(--deck-hair);
    background: var(--deck-rail);
    overflow: hidden;
    min-width: 0;
}
.deck-rail-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.8rem;
    padding-left: 5px;
    text-decoration: none;
}
.deck-rail-brand img {
    width: 30px; height: 30px; flex: none;
    filter: drop-shadow(0 0 10px rgba(53, 224, 255, 0.45));
}
.deck-rail-brand strong {
    font-family: var(--deck-serif);
    font-weight: 480;
    font-size: 1rem;
    color: var(--deck-ink);
}
.deck-rail-btn {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    height: 40px;
    border-radius: 11px;
    border: 1px solid transparent;
    background: none;
    color: var(--deck-mute);
    cursor: pointer;
    padding: 0 10px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
    overflow: hidden;
    transition: all 0.15s;
    white-space: nowrap;
}
.deck-rail-btn:hover { color: var(--deck-ink); background: rgba(53, 224, 255, 0.05); }
.deck-rail-btn.tab-active {
    border-color: rgba(53, 224, 255, 0.3);
    background: rgba(53, 224, 255, 0.1);
    color: var(--deck-accent);
}
.deck-rail-btn .deck-rail-icon {
    display: grid;
    place-items: center;
    width: 18px; height: 18px;
    flex: none;
}
.deck-rail-label {
    white-space: nowrap;
    flex: none;
    opacity: 1;
    transition: opacity 0.18s 0.08s;
}
.rail-collapsed .deck-rail-label { opacity: 0; transition: opacity 0.1s 0s; }
/* Cross-page entries share the rail button look; anchors need the reset. */
a.deck-rail-link { text-decoration: none; box-sizing: border-box; }
.deck-rail-divider {
    height: 1px;
    margin: 0.55rem 2px;
    background: rgba(140, 170, 220, 0.18);
    flex: none;
}
.deck-rail-toggle {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    height: 36px;
    border-radius: 11px;
    border: 1px solid rgba(140, 170, 220, 0.18);
    background: rgba(20, 29, 46, 0.6);
    color: var(--deck-mute);
    cursor: pointer;
    padding: 0 10px;
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    overflow: hidden;
    transition: all 0.15s;
    white-space: nowrap;
}
.deck-rail-toggle:hover { color: var(--deck-accent); border-color: rgba(53, 224, 255, 0.3); }
.deck-rail-toggle .deck-rail-icon { transition: transform 0.25s; }
.deck-shell:not(.rail-collapsed) .deck-rail-toggle .deck-rail-icon { transform: rotate(180deg); }

/* --- Main column ----------------------------------------------------------- */
.deck-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
    overflow: hidden;
}
.deck-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.4rem;
    border-bottom: 1px solid var(--deck-hair);
    background: rgba(14, 21, 35, 0.7);
}
.deck-header-title { min-width: 0; margin-right: auto; }
.deck-header-title h1 {
    margin: 0.1rem 0 0;
    font-family: var(--deck-serif);
    font-weight: 480;
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--deck-ink);
}
.deck-header-meta {
    display: flex;
    gap: 0.9rem;
    margin-top: 0.15rem;
    color: var(--deck-dim);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
}
.deck-header-meta span { overflow: hidden; text-overflow: ellipsis; }
.deck-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid var(--deck-hair-strong);
    border-radius: 999px;
    background: rgba(20, 29, 46, 0.6);
    color: var(--deck-soft);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    white-space: nowrap;
    max-width: 34vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.deck-status-pill .deck-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.deck-status-pill.is-secured { border-color: rgba(55,224,168,0.36); background: rgba(55,224,168,0.10); color: var(--deck-good-soft); }
.deck-status-pill.is-secured .deck-dot { background: var(--deck-good); box-shadow: 0 0 8px rgba(55,224,168,0.6); }
.deck-status-pill.is-spoofable { border-color: rgba(255,90,110,0.38); background: rgba(255,90,110,0.10); color: var(--deck-danger-soft); }
.deck-status-pill.is-spoofable .deck-dot { background: var(--deck-danger); box-shadow: 0 0 8px rgba(255,90,110,0.6); }
.deck-status-pill.is-partial { border-color: rgba(255,179,71,0.38); background: rgba(255,179,71,0.10); color: var(--deck-warn-soft); }
.deck-status-pill.is-partial .deck-dot { background: var(--deck-warn); box-shadow: 0 0 8px rgba(255,179,71,0.6); }
.deck-new-scan {
    border: 1px solid var(--deck-hair-strong);
    border-radius: 999px;
    background: rgba(20, 29, 46, 0.6);
    color: var(--deck-ink);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.42rem 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}
.deck-new-scan:hover { border-color: var(--deck-accent); color: var(--deck-accent); }

.deck-content {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: 1.4rem;
}
.deck-content > #tabContent { max-width: none; }

/* --- Deck cards (shared by sections) --------------------------------------- */
.deck-card {
    border: 1px solid var(--deck-hair);
    border-radius: 16px;
    background: var(--deck-panel);
}
.deck-card-pad { padding: 1.3rem 1.4rem; }

/* --- Overview: verdict hero ------------------------------------------------ */
.deck-overview { display: grid; gap: 1rem; }
.deck-overview-top {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 1rem;
}
@media (max-width: 900px) { .deck-overview-top { grid-template-columns: minmax(0, 1fr); } }
.deck-hero {
    background: linear-gradient(180deg, rgba(53, 224, 255, 0.045), transparent 42%), var(--deck-panel);
}
.deck-hero .deck-kicker { color: var(--deck-accent); letter-spacing: 0.26em; }
.deck-hero h2 {
    margin: 0.5rem 0 0;
    font-family: var(--deck-serif);
    font-weight: 420;
    font-size: 1.75rem;
    line-height: 1.12;
    letter-spacing: -0.015em;
    color: var(--deck-ink);
}
/* Verdict segments inside the serif hero read as italics, per the mock. */
.deck-hero h2 .verdict-domain,
.deck-hero h2 .verdict-state { font-style: italic; font-weight: 460; }
.deck-hero p.deck-hero-evidence {
    margin: 0.6rem 0 0;
    color: var(--deck-soft);
    font-size: 0.92rem;
    line-height: 1.55;
    max-width: 34rem;
}
.deck-hero-chips { display: flex; gap: 0.4rem; margin-top: 1rem; flex-wrap: wrap; }
.deck-auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid var(--deck-hair);
    background: rgba(140, 170, 220, 0.08);
    color: var(--deck-mute);
}
.deck-auth-chip strong { font-family: var(--deck-mono); font-size: 0.6rem; letter-spacing: 0.08em; }
.deck-auth-chip.is-pass { border-color: rgba(55,224,168,0.36); background: rgba(55,224,168,0.10); color: var(--deck-good-soft); }
.deck-auth-chip.is-fail { border-color: rgba(255,90,110,0.38); background: rgba(255,90,110,0.10); color: var(--deck-danger-soft); }
.deck-auth-chip.is-warn { border-color: rgba(255,179,71,0.38); background: rgba(255,179,71,0.10); color: var(--deck-warn-soft); }

/* --- Overview: quick facts ------------------------------------------------- */
.deck-facts dl { display: grid; gap: 0.62rem; margin: 0.85rem 0 0; }
.deck-facts .deck-kicker { color: var(--deck-accent); letter-spacing: 0.26em; }
.deck-fact {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 0.7rem;
    align-items: baseline;
}
.deck-fact dt {
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.deck-fact dd { margin: 0; color: #dbe6f5; font-size: 0.86rem; overflow-wrap: anywhere; }

/* --- Overview: stat tiles --------------------------------------------------- */
.deck-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
@media (max-width: 900px) { .deck-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.deck-tile {
    text-align: left;
    border: 1px solid var(--deck-hair);
    border-radius: 14px;
    background: var(--deck-panel);
    padding: 0.95rem 1.1rem;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s;
}
.deck-tile:hover { border-color: var(--deck-accent); }
.deck-tile strong { display: block; color: var(--deck-ink); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.deck-tile .deck-tile-label {
    display: block;
    margin-top: 0.35rem;
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.deck-tile .deck-tile-note { display: block; margin-top: 0.3rem; font-size: 0.74rem; font-weight: 600; }

/* --- Overview: top indicators table ----------------------------------------- */
.deck-indicators { overflow: hidden; }
.deck-indicators-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--deck-hair);
}
.deck-indicators-head h3 { margin: 0; font-size: 0.95rem; font-weight: 800; color: var(--deck-ink); }
.deck-indicators-head button {
    background: none; border: none;
    color: var(--deck-accent);
    font-size: 0.78rem; font-weight: 700;
    cursor: pointer; font-family: inherit; padding: 0;
}
.deck-ind-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6rem 7rem minmax(8rem, 12rem);
    gap: 1rem;
    align-items: center;
    padding: 0.62rem 1.2rem;
    border-bottom: 1px solid rgba(6, 9, 17, 0.5);
    cursor: pointer;
    width: 100%;
    background: none;
    border-left: none; border-right: none; border-top: none;
    font-family: inherit;
    text-align: left;
    transition: background 0.15s;
}
.deck-ind-row:hover { background: rgba(53, 224, 255, 0.04); }
.deck-ind-value {
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--deck-mono);
    font-size: 0.78rem;
    color: #dbe6f5;
}
.deck-ind-type, .deck-ind-source {
    color: var(--deck-mute);
    font-size: 0.74rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deck-ind-type { font-family: var(--deck-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.deck-pill {
    display: inline-flex;
    justify-content: center;
    width: fit-content;
    border-radius: 999px;
    padding: 0.16rem 0.55rem;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.deck-pill.rep-suspicious { background: rgba(255,179,71,0.13); color: var(--deck-warn-soft); border: 1px solid rgba(255,179,71,0.38); }
.deck-pill.rep-malicious { background: rgba(255,90,110,0.13); color: var(--deck-danger-soft); border: 1px solid rgba(255,90,110,0.38); }
.deck-pill.rep-benign { background: rgba(55,224,168,0.13); color: var(--deck-good-soft); border: 1px solid rgba(55,224,168,0.36); }
.deck-pill.rep-unknown { background: rgba(140,170,220,0.08); color: var(--deck-mute); border: 1px solid var(--deck-hair); }

/* --- Headers section: segmented toggle -------------------------------------- */
.deck-seg {
    display: inline-flex;
    width: fit-content;
    border: 1px solid var(--deck-hair);
    border-radius: 999px;
    background: var(--deck-panel);
    padding: 0.22rem;
    gap: 0.15rem;
    margin-bottom: 0.9rem;
}
.deck-seg button {
    border: none;
    border-radius: 999px;
    background: none;
    color: var(--deck-mute);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
    font-family: inherit;
}
.deck-seg button.tab-active { background: rgba(53, 224, 255, 0.12); color: var(--deck-accent); }

/* --- Message section --------------------------------------------------------- */
#messagePane { max-width: none; }
#messagePane[hidden] { display: none; }
.deck-message-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}
.deck-message-bar .deck-kicker { margin-right: auto; }

/* --- Authentication section ------------------------------------------------- */
.deck-auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    max-width: none;
}
@media (max-width: 900px) { .deck-auth-grid { grid-template-columns: minmax(0, 1fr); } }
.deck-auth-details { overflow: hidden; }
.deck-auth-details-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--deck-hair);
}
.deck-auth-details-head h3 { margin: 0; font-size: 0.95rem; font-weight: 800; color: var(--deck-ink); }
.deck-auth-verdict-line { font-size: 0.8rem; color: var(--deck-soft); }
.deck-auth-verdict-line .verdict-domain { font-weight: 700; }
.deck-auth-row {
    display: grid;
    grid-template-columns: 4.5rem 7rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
    padding: 0.85rem 1.2rem;
    border-bottom: 1px solid rgba(6, 9, 17, 0.5);
}
.deck-auth-row > strong {
    font-family: var(--deck-mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--deck-ink);
}
.deck-result-pill {
    display: inline-flex;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    height: fit-content;
    white-space: nowrap;
}
.deck-result-pill.is-pass { background: rgba(55,224,168,0.13); color: var(--deck-good); }
.deck-result-pill.is-fail { background: rgba(255,90,110,0.13); color: var(--deck-danger-soft); }
.deck-result-pill.is-warn { background: rgba(255,179,71,0.13); color: var(--deck-warn-soft); }
.deck-auth-detail { margin: 0; color: #dbe6f5; font-size: 0.85rem; line-height: 1.45; }
.deck-auth-evidence {
    margin: 0.2rem 0 0;
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.7rem;
    overflow-wrap: anywhere;
}
.deck-auth-footnote { margin: 0; padding: 0.75rem 1.2rem; color: var(--deck-dim); font-size: 0.74rem; }
/* Observed-evidence labelling: this surface reports the receiver's own
   Authentication-Results, never an Odin verification. */
.deck-auth-observed {
    margin: 0 1.2rem 0.6rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--deck-border, rgba(255,255,255,0.12));
    border-left: 3px solid var(--odin-warning, #f59e0b);
    border-radius: 0.5rem;
    color: var(--deck-dim);
    font-size: 0.74rem;
}
.deck-auth-warnings { margin: 0.4rem 1.2rem; }
.deck-auth-warnings p { margin: 0.15rem 0; color: var(--odin-warning, #f59e0b); font-size: 0.74rem; }
.deck-auth-identity-alert {
    margin: 0.65rem 1.2rem 0.4rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(255, 90, 110, 0.48);
    border-left: 4px solid var(--deck-danger, #ff5a6e);
    border-radius: 0.55rem;
    background: rgba(255, 90, 110, 0.10);
    color: var(--deck-danger-soft, #ff91a0);
    font-size: 0.78rem;
    line-height: 1.45;
}
.deck-auth-identity-alert strong { color: var(--deck-danger, #ff5a6e); font-weight: 900; }
.deck-auth-display-domain { color: #60a5fa; font-weight: 700; }
.deck-auth-mailbox-domain { color: var(--deck-warn-soft, #ffc66d); font-weight: 700; }
.deck-auth-ai-advisory {
    margin: 0.65rem 1.2rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(53, 224, 255, 0.28);
    border-radius: 0.55rem;
    background: rgba(53, 224, 255, 0.06);
    color: var(--deck-soft);
    font-size: 0.76rem;
}
.deck-auth-ai-head { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.35rem; }
.deck-auth-ai-head strong { color: var(--deck-accent); }
.deck-auth-ai-head span, .deck-auth-ai-advisory small { color: var(--deck-dim); }
.deck-auth-ai-advisory p { margin: 0.2rem 0; line-height: 1.45; }
.deck-auth-ai-verdict { color: #dbe6f5; font-weight: 800; }
.deck-align .deck-kicker { color: var(--deck-accent); letter-spacing: 0.26em; margin-bottom: 0.9rem; }
.deck-align-boxes { display: grid; gap: 0.5rem; }
.deck-align-box {
    border: 1px solid var(--deck-hair);
    border-radius: 10px;
    background: rgba(6, 9, 17, 0.45);
    padding: 0.6rem 0.8rem;
}
.deck-align-box.is-good { border-color: rgba(55, 224, 168, 0.36); }
.deck-align-label {
    display: block;
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.deck-align-value {
    display: block;
    margin-top: 0.15rem;
    color: #dbe6f5;
    font-family: var(--deck-mono);
    font-size: 0.8rem;
    overflow-wrap: anywhere;
}
.deck-align-note { margin: 0.6rem 0 0; color: var(--deck-warn-soft); font-size: 0.8rem; font-weight: 600; }
.deck-align-note.is-good { color: var(--deck-good-soft); }

/* --- Attachments ------------------------------------------------------------- */
.deck-attachment { max-width: none; display: grid; gap: 0.9rem; margin-bottom: 1rem; }
.deck-attachment-head { display: flex; align-items: center; gap: 0.9rem; }
.deck-attachment-badge {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    border-radius: 12px;
    border: 1px solid var(--deck-hair-strong);
    background: rgba(6, 9, 17, 0.5);
    color: var(--deck-accent);
    font-family: var(--deck-mono);
    font-size: 0.62rem;
    font-weight: 800;
    flex: none;
}
.deck-attachment-title { min-width: 0; margin-right: auto; }
.deck-attachment-title strong { display: block; font-size: 0.95rem; color: var(--deck-ink); overflow-wrap: anywhere; }
.deck-attachment-title span { color: var(--deck-mute); font-size: 0.78rem; }
.deck-copy-hash {
    border: 1px solid var(--deck-hair-strong);
    background: none;
    color: #dbe6f5;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
}
.deck-copy-hash:hover { border-color: var(--deck-accent); color: var(--deck-accent); }
.deck-hash {
    display: block;
    border: 1px solid var(--deck-hair);
    border-radius: 10px;
    background: rgba(6, 9, 17, 0.5);
    padding: 0.7rem 0.85rem;
    font-family: var(--deck-mono);
    font-size: 0.74rem;
    color: var(--deck-soft);
    overflow-wrap: anywhere;
}

/* --- Evidence tables (Headers section et al.) -------------------------------- */
body.deck .evidence-table-card {
    border: 1px solid var(--deck-hair);
    border-radius: 16px;
    background: var(--deck-panel);
    overflow: hidden;
    max-width: none;
}
body.deck .evidence-table { width: 100%; border-collapse: collapse; }
body.deck .evidence-table th {
    text-align: left;
    padding: 0.6rem 1.2rem;
    border-bottom: 1px solid var(--deck-hair);
    background: rgba(6, 9, 17, 0.5);
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
}
body.deck .evidence-table td {
    padding: 0.6rem 1.2rem;
    border-bottom: 1px solid rgba(6, 9, 17, 0.5);
    color: #dbe6f5;
    font-size: 0.82rem;
    vertical-align: top;
    overflow-wrap: anywhere;
    line-height: 1.5;
}
body.deck .evidence-table td:first-child {
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.72rem;
    white-space: nowrap;
}
body.deck .evidence-table .empty-cell { color: var(--deck-dim); }

/* --- Legacy-CSS neutralization under the deck ------------------------------- */
/* The rotating runes watermark and tab underline bars belong to the legacy
   shell; inside the deck they bleed through as stray shapes. */
body.deck::after { display: none !important; animation: none !important; }
body.deck { background: var(--deck-bg); }
body.deck .tab-active::after { display: none !important; }
body.deck .deck-rail-btn, body.deck .deck-seg button { border-bottom-width: 1px; }
body.deck .deck-seg button { border: none; }
/* The old workspace grid stretched section children to fill the viewport
   (giant toggle blobs); the deck content column flows normally. The [hidden]
   rule must still win, or the Message section renders on top of the IOC
   workbench instead of replacing it. */
body.deck #tabContent { display: block; height: auto; min-height: 0; }
/* Invariant: a hidden element stays hidden - full stop. Deck section rules use
   ID selectors with display overrides (e.g. #emailRender { display:block },
   #tabContent { display:block }); an ID selector out-specifies the .hidden /
   [hidden] class, which would otherwise un-hide content that JS just hid (the
   "Message stacks on IOCs" / "view switcher won't swap" class of bug). This one
   rule makes hiding win everywhere, so deck ID overrides can be added freely. */
body.deck [hidden],
body.deck .hidden { display: none !important; }
/* Old switcher CSS gave every view button a flex-basis and the strip a margin. */
body.deck .email-view-switcher { margin-top: 0; border: none; background: none; padding: 0; flex-wrap: nowrap; }
body.deck .email-view-switcher button {
    flex: none;
    border: none; border-radius: 999px;
    background: none; color: var(--deck-mute);
    font-size: 0.76rem; font-weight: 700;
    padding: 0.35rem 0.75rem; cursor: pointer; font-family: inherit;
    box-shadow: none;
}
body.deck .email-view-switcher button.tab-active { background: rgba(53, 224, 255, 0.12); color: var(--deck-accent); }
/* Message pane: plain frame, full-width iframe. */
body.deck .email-content-frame {
    margin-top: 0; border: none; border-radius: 0; background: none;
    display: block; flex: none; overflow: visible;
}
body.deck #emailRender {
    display: block; width: 100%; min-height: 70vh; border: none;
    background: #ffffff; border-radius: 14px;
    box-shadow: 0 18px 45px rgba(2, 6, 14, 0.55);
}
body.deck .email-content-frame pre { max-height: 72vh; overflow: auto; border-radius: 14px; }
body.deck .deck-message-bar { border: 1px solid var(--deck-hair); border-radius: 999px; background: var(--deck-panel); padding: 0.3rem 0.3rem 0.3rem 1rem; width: fit-content; gap: 1rem; flex-wrap: nowrap; }
body.deck .deck-message-bar .deck-kicker { white-space: nowrap; }

/* --- IOC workbench (flat deck table) ---------------------------------------- */
.deck-ioc { display: grid; gap: 0.9rem; max-width: none; }
.deck-ioc-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.deck-ioc-filters { margin-bottom: 0; }
.deck-ioc-filters .ioc-filter-btn span { margin-left: 0.3rem; opacity: 0.65; }
.deck-ioc-search {
    flex: 1 1 12rem; min-width: 9rem;
    background: var(--deck-panel); color: var(--deck-ink);
    border: 1px solid var(--deck-hair); border-radius: 999px;
    padding: 0.45rem 0.9rem; font-family: inherit; font-size: 0.82rem; outline: none;
}
.deck-ioc-search:focus { border-color: rgba(53, 224, 255, 0.4); }
.deck-ioc-toggle { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--deck-mute); font-size: 0.76rem; cursor: pointer; white-space: nowrap; }
.deck-ioc-table { overflow: hidden; }
.deck-ioc-headrow, .deck-ioc-row {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) 4.5rem 6.5rem minmax(6rem, 10rem) minmax(10rem, 12rem);
    gap: 0.8rem;
    align-items: center;
    padding: 0.55rem 1rem;
}
.deck-ioc-headrow {
    border-bottom: 1px solid var(--deck-hair);
    background: rgba(6, 9, 17, 0.5);
    padding: 0.6rem 1rem;
}
.deck-ioc-headrow > span {
    color: var(--deck-mute);
    font-family: var(--deck-mono);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.deck-ioc-row { border-bottom: 1px solid rgba(6, 9, 17, 0.5); cursor: pointer; transition: background 0.15s; }
.deck-ioc-row:hover { background: rgba(53, 224, 255, 0.03); }
.deck-ioc-value {
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--deck-mono); font-size: 0.78rem; color: #dbe6f5;
}
.deck-ioc-type { color: var(--deck-mute); font-family: var(--deck-mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.deck-ioc-source { color: var(--deck-mute); font-size: 0.74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-ioc-actions { display: inline-flex; gap: 0.3rem; justify-content: flex-end; }
.deck-ioc-actions .copy-ioc, .deck-ioc-actions .scan-url {
    border: 1px solid rgba(140, 170, 220, 0.2); background: none; color: var(--deck-soft);
    padding: 0.24rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
    cursor: pointer; font-family: inherit; white-space: nowrap;
}
.deck-ioc-actions .deck-open-safe {
    border: none; background: var(--deck-accent); color: #04121a;
    padding: 0.28rem 0.6rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800;
    cursor: pointer; font-family: inherit; white-space: nowrap;
}
/* Checkbox chip: plain box in the table (the old "Select" chip is retired). */
.deck-ioc-headrow .ioc-select-control span,
.deck-ioc-row .ioc-select-control span { display: none; }
.deck-ioc-headrow .ioc-select-control, .deck-ioc-row .ioc-select-control {
    display: inline-flex; border: none; background: none; padding: 0; cursor: pointer;
}

/* Floating selection bar (sticky above the bottom of the scroll column). */
.deck-ioc-float {
    position: sticky; bottom: 0.5rem; z-index: 5;
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    border: 1px solid rgba(53, 224, 255, 0.3); border-radius: 999px;
    background: rgba(14, 21, 35, 0.95); backdrop-filter: blur(12px);
    box-shadow: 0 18px 45px rgba(2, 6, 14, 0.55);
    padding: 0.55rem 0.65rem 0.55rem 1.1rem; width: fit-content;
}
.deck-ioc-float.is-empty { border-color: var(--deck-hair); box-shadow: none; opacity: 0.75; }
.deck-ioc-float > strong { color: var(--deck-accent); font-size: 0.9rem; }
.deck-ioc-float > span { color: var(--deck-mute); font-size: 0.78rem; }
body.deck .ioc-rep-btn {
    border: 1px solid rgba(140, 170, 220, 0.2); background: none; color: #dbe6f5;
    padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 0.76rem; font-weight: 700;
    cursor: pointer; font-family: inherit; white-space: nowrap;
}
body.deck .ioc-rep-btn.scan {
    border: none; background: linear-gradient(135deg, var(--deck-accent), #12b6da);
    color: #04121a; font-weight: 800;
}
body.deck .ioc-rep-btn.subtle { color: var(--deck-mute); }
body.deck .ioc-rep-btn:disabled { opacity: 0.45; cursor: default; }
body.deck .ioc-filter-btn {
    border: none; border-radius: 999px; background: none; color: var(--deck-mute);
    font-size: 0.76rem; font-weight: 700; padding: 0.35rem 0.75rem;
    cursor: pointer; font-family: inherit;
}
body.deck .ioc-filter-btn.tab-active { background: rgba(53, 224, 255, 0.12); color: var(--deck-accent); }

@media (max-width: 640px) {
    .deck-shell,
    .deck-shell.rail-collapsed { grid-template-columns: 52px minmax(0, 1fr); }
    .deck-rail { padding: 0.65rem 5px; }
    .deck-rail-brand { justify-content: center; padding: 0; }
    .deck-rail-brand img { width: 28px; height: 28px; }
    .deck-rail-label,
    .deck-rail-toggle { display: none; }
    .deck-rail-btn { justify-content: center; padding: 0; }
    .deck-header { align-items: flex-start; flex-wrap: wrap; gap: 0.45rem; padding: 0.65rem 0.75rem; }
    .deck-header-title { flex: 1 0 100%; width: 100%; }
    .deck-header-title h1 { font-size: 1.05rem; }
    .deck-header-meta { gap: 0.5rem; font-size: 0.65rem; }
    .deck-status-pill { max-width: 100%; font-size: 0.66rem; }
    .deck-new-scan { display: none; }
    .deck-content { padding: 0.75rem; }
    .deck-card-pad { padding: 1rem; }
    .deck-tiles { gap: 0.65rem; }
    .deck-tile { padding: 0.8rem; }
    .deck-fact { grid-template-columns: 4.5rem minmax(0, 1fr); }
    .deck-ind-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0.6rem; padding: 0.62rem 0.8rem; }
    .deck-ind-type,
    .deck-ind-source { display: none; }
    #messagePane { min-width: 0; width: 100%; }
    body.deck .deck-message-bar {
        width: 100%;
        box-sizing: border-box;
        border-radius: 14px;
        flex-wrap: wrap;
        padding: 0.55rem;
        gap: 0.45rem;
    }
    body.deck .deck-message-bar .deck-kicker { flex: 1 0 100%; }
    body.deck .email-view-switcher { width: 100%; flex-wrap: wrap; }
    body.deck .email-view-switcher button { flex: 1 1 calc(50% - 0.15rem); }
    .deck-ioc-headrow { display: none; }
    .deck-ioc-row {
        grid-template-columns: 1.5rem minmax(0, 1fr) auto;
        gap: 0.45rem;
        align-items: center;
        padding: 0.65rem 0.75rem;
    }
    .deck-ioc-row .deck-ioc-type,
    .deck-ioc-row .deck-ioc-source { display: none; }
    .deck-ioc-actions {
        grid-column: 2 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
