/* CordVault application shell refresh — loaded last on purpose. */
:root {
  --cv-bg: #070a12;
  --cv-sidebar: #0a0e18;
  --cv-panel: #101624;
  --cv-panel-raised: #141b2b;
  --cv-panel-hover: #171f31;
  --cv-line: rgba(145, 158, 196, .17);
  --cv-line-strong: rgba(145, 158, 196, .29);
  --cv-text: #f4f6fc;
  --cv-muted: #9ca8c3;
  --cv-subtle: #6f7b97;
  --cv-blue: #7788ff;
  --cv-blue-bright: #9ba8ff;
  --cv-blue-soft: rgba(119, 136, 255, .12);
  --cv-green: #5bdaa6;
  --cv-red: #ff7188;
  --cv-amber: #f6bd6b;
  --cv-radius: 14px;
  --cv-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}

html, body { min-width: 320px; min-height: 100%; }
body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 72% -20%, rgba(67, 83, 190, .15), transparent 34rem),
    linear-gradient(180deg, #080b14, var(--cv-bg));
  color: var(--cv-text);
  font-size: 16px;
  letter-spacing: -.006em;
}
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ui-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Full-width chrome */
.topbar { height: 76px; padding: 0; background: rgba(6, 9, 17, .9); }
.topbar-inner {
  width: 100%;
  max-width: none;
  height: 76px;
  padding: 0 clamp(20px, 2.1vw, 40px);
}
.brand-logo { width: 44px; height: 44px; border-radius: 13px; }
.brand-copy strong { font-size: 17px !important; }
.brand-copy small { color: #7f8aa7; font-size: 11px !important; letter-spacing: .1em; }
.account { gap: 12px; }
.account-avatar { width: 36px; height: 36px; }
.account-name { color: #c8cee0; font-size: 14px !important; }
.quiet-button {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-color: var(--cv-line);
  color: #aeb8cf;
  font-size: 13px !important;
}
.quiet-button .ui-icon { width: 16px; height: 16px; }

.workspace-shell {
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 76px);
  margin: 0;
  grid-template-columns: 272px minmax(0, 1fr);
  background: transparent;
}
.workspace-sidebar {
  top: 76px;
  height: calc(100vh - 76px);
  padding: 24px 18px 20px;
  overflow-y: auto;
  border-right: 1px solid var(--cv-line);
  background: linear-gradient(180deg, rgba(12, 17, 29, .98), rgba(7, 11, 19, .99));
}
.server-switcher {
  min-height: 70px;
  padding: 11px;
  gap: 11px;
  border: 1px solid var(--cv-line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.server-switcher:hover { transform: translateY(-1px); border-color: var(--cv-line-strong); background: rgba(255,255,255,.04); }
.server-switcher > span { width: 42px; height: 42px; border-radius: 11px; font-size: 13px !important; }
.server-switcher > div { min-width: 0; }
.server-switcher strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px !important; }
.server-switcher small { font-size: 11px !important; }
.server-switcher > .ui-icon { width: 17px; height: 17px; color: #77829c; }

.workspace-nav { margin-top: 24px; gap: 4px; }
.workspace-nav a {
  min-height: 46px;
  padding: 0 13px;
  gap: 12px;
  border-radius: 10px;
  color: #9ca7c0;
  font-size: 14px !important;
  font-weight: 650;
}
.workspace-nav a .ui-icon { width: 19px; height: 19px; color: #6f7b98; transition: color .18s ease; }
.workspace-nav a:hover { color: #eef1fa; background: rgba(255,255,255,.04); }
.workspace-nav a:hover .ui-icon { color: #aab5d1; }
.workspace-nav a.active {
  color: #fff;
  border-color: rgba(123, 140, 255, .24);
  background: linear-gradient(90deg, rgba(119,136,255,.17), rgba(119,136,255,.065));
  box-shadow: inset 3px 0 var(--cv-blue), 0 8px 24px rgba(0,0,0,.12);
}
.workspace-nav a.active .ui-icon { color: var(--cv-blue-bright); }
.sidebar-foot { padding: 18px 10px 2px; border-top-color: var(--cv-line); }
.sidebar-foot strong { font-size: 13px !important; }
.sidebar-foot small { color: #7d88a2; font-size: 11px !important; }
.pulse-dot { width: 9px; height: 9px; box-shadow: 0 0 0 5px rgba(80,214,160,.08), 0 0 16px rgba(80,214,160,.28); }

.workspace-main {
  width: 100%;
  min-width: 0;
  padding: 38px clamp(26px, 2.7vw, 52px) 72px;
}
.workspace-main > * { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.site-main, footer { width: calc(100% - clamp(40px, 5vw, 96px)); max-width: none; }

/* Shared page hierarchy */
.workspace-header { margin-bottom: 26px; align-items: center; }
.workspace-header h1,
.event-hero h1,
.case-hero h1,
.alert-hero h1 {
  color: var(--cv-text);
  font-size: clamp(30px, 2.6vw, 43px) !important;
  line-height: 1.08;
  letter-spacing: -.04em;
}
.workspace-header p:not(.eyebrow), .event-hero p, .case-hero p, .alert-hero p {
  color: var(--cv-muted);
  font-size: 15px !important;
  line-height: 1.55;
}
.eyebrow {
  color: #91a0ff !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  letter-spacing: .15em;
}
.context-back, .back-link {
  margin-bottom: 22px;
  color: #a6b0ca;
  font-size: 13px !important;
  font-weight: 650;
}
.context-back:hover, .back-link:hover { color: #fff; }

.surface,
.activity-panel,
.case-list,
.alert-list,
.case-hero,
.alert-hero,
.login-shell {
  border-color: var(--cv-line);
  border-radius: var(--cv-radius);
  background: linear-gradient(145deg, rgba(17,23,38,.97), rgba(12,17,29,.97));
  box-shadow: var(--cv-shadow);
}
.surface-head { min-height: 72px; padding: 18px 21px; border-bottom-color: var(--cv-line); }
.surface-head h2 { font-size: 19px !important; letter-spacing: -.025em; }
.surface-head > a, .surface-head > span { font-size: 12px !important; }

.primary-action, .secondary-action, .save-button, .discord-button,
.add-app-button, .open-vault, button {
  min-height: 42px;
  border-radius: 10px;
  font-size: 13px !important;
  font-weight: 750;
}
.primary-action { padding: 0 17px; box-shadow: 0 10px 28px rgba(75,91,214,.22); }
button, .primary-action, .save-button { transition: transform .16s ease, filter .16s ease, box-shadow .16s ease; }
button:hover, .primary-action:hover, .save-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
button:active, .primary-action:active, .save-button:active { transform: translateY(0); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(139,155,255,.38);
  outline-offset: 2px;
}
input, select, textarea,
.case-form-main input, .case-form-main select, .case-form-main textarea,
.case-hero input, .case-hero select, .inline-add input,
.note-composer textarea, .entity-form input, .entity-form select {
  min-height: 43px;
  padding: 10px 12px;
  border-color: var(--cv-line-strong);
  border-radius: 9px;
  background: #090e19;
  color: #e8ebf5;
  font-size: 13px !important;
}
textarea { min-height: 112px; line-height: 1.55; }

/* Data cards and rows */
.metric-grid, .case-facts, .alert-facts, .case-summary, .alert-summary, .integrity-summary { gap: 12px; }
.metric-grid article, .case-facts article, .alert-facts article,
.case-summary article, .alert-summary article, .integrity-summary article {
  min-height: 105px;
  padding: 18px;
  border-color: var(--cv-line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(20,27,43,.94), rgba(14,20,34,.94));
}
.metric-grid strong, .case-summary strong, .alert-summary strong { font-size: 28px !important; }
.metric-grid small, .case-facts small, .alert-facts small,
.case-summary small, .alert-summary small { color: #8995b1; font-size: 12px !important; }
.metric-grid em, .case-facts span, .alert-facts span,
.case-summary span, .alert-summary span { color: #75819c; font-size: 11px !important; }
.metric-icon .ui-icon, .summary-icon .ui-icon { width: 18px; height: 18px; }
.summary-icon { display: grid; place-items: center; }
.server-search > .ui-icon { width: 17px; height: 17px; flex: 0 0 auto; }
.add-app-button .ui-icon { width: 17px; height: 17px; }

.evidence-row { min-height: 80px; padding-top: 14px; padding-bottom: 14px; transition: background .16s ease; }
.evidence-row:hover, .alert-row:hover, .case-row:hover { background: rgba(119,136,255,.055); }
.evidence-main strong { color: #f0f2f9; font-size: 13px !important; }
.evidence-main small, .actor-cell small, .evidence-row time { font-size: 11px !important; }
.actor-cell strong { font-size: 12px !important; }
.alert-row, .case-row { min-height: 102px; padding: 18px 20px; }
.alert-copy strong, .case-row > div > strong { font-size: 15px !important; }
.alert-copy p, .case-row p { color: #96a2bd; font-size: 13px !important; }
.case-marker, .alert-symbol { border-radius: 11px; }
.case-marker .ui-icon, .alert-symbol .ui-icon { width: 19px; height: 19px; }
.preserved-icon .ui-icon { width: 20px; height: 20px; }
.friendly-empty > span .ui-icon, .empty-icon .ui-icon { width: 21px; height: 21px; }

.case-hero, .alert-hero { padding: 24px; }
.case-hero { grid-template-columns: minmax(0,1fr) minmax(390px, .52fr); }
.case-hero small, .alert-hero small { color: #75819d; font-size: 11px !important; }
.case-layout { gap: 16px; }
.case-primary, .case-rail { gap: 16px; }
.narrative { padding: 15px 24px; }
.narrative-item { min-height: 96px; padding: 15px 0 18px 40px; grid-template-columns: 170px 1fr; }
.narrative-item time { font-size: 11px !important; }
.narrative-item strong, .entity-list strong { font-size: 13px !important; }
.narrative-item p { color: #a1acc4; font-size: 13px !important; }
.integrity-strip { padding: 20px; border-radius: 14px; }
.integrity-strip h2 { font-size: 21px !important; }
.integrity-strip > p { color: #8f9ab5; font-size: 13px !important; line-height: 1.6; }
.export-actions button, .export-actions a { min-height: 42px; padding: 0 13px; display: inline-flex; align-items: center; }

.filter-surface, .timeline-lookup, .settings-section, .case-form-main, .case-create-help { padding: 24px; }
.search-field, .server-search { min-height: 44px; }
.filter-row label > span, .settings-control > label, .case-form-main label, .case-hero label { font-size: 12px !important; }
.settings-section { grid-template-columns: minmax(0, 1fr) minmax(360px, .55fr); }
.settings-copy h2 { font-size: 18px !important; }
.settings-copy p { font-size: 13px !important; }
.settings-copy > span { width: 36px; height: 36px; font-size: 11px !important; }
.friendly-toggles label { min-height: 64px; padding: 13px 14px; }
.friendly-toggles strong { font-size: 13px !important; }
.friendly-toggles small, .settings-control small { font-size: 11px !important; }

.risk-badge, .source-badge, .severity-label, .status-label {
  padding: 5px 8px;
  font-size: 10px !important;
  letter-spacing: .04em;
}
.identity-chip, .health-pill, .live-indicator { font-size: 12px !important; }
.copy-button, .event-actions > a { min-height: 40px; padding: 0 13px; display: inline-flex; align-items: center; }
.raw-grid pre, .diff-line pre, .diff-line code, pre { font-size: 12px !important; line-height: 1.6; }

/* Knowledge Base */
.kb-header { align-items: flex-end; }
.kb-search-panel {
  margin-bottom: 32px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: center;
  border-color: rgba(119, 136, 255, .25);
  background: linear-gradient(135deg, rgba(29, 38, 69, .96), rgba(14, 20, 34, .97));
}
.kb-search-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #aab5ff;
  background: rgba(119,136,255,.13);
}
.kb-search-icon .ui-icon { width: 21px; height: 21px; }
.kb-search-panel label { display: block; margin-bottom: 7px; color: #dce1f2; font-size: 13px !important; font-weight: 750; }
.kb-search-panel input { width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent; font-size: 15px !important; }
.kb-search-panel input:focus { outline: 0; }
.kb-search-panel kbd { padding: 5px 9px; border: 1px solid var(--cv-line-strong); border-radius: 7px; color: #8793af; background: rgba(0,0,0,.18); font-size: 12px !important; }
.kb-quick-start { margin-bottom: 34px; }
.kb-section-heading { margin-bottom: 15px; }
.kb-section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.kb-step-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kb-step-grid a {
  min-height: 108px;
  padding: 17px;
  display: flex;
  gap: 13px;
  border: 1px solid var(--cv-line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(18,25,41,.94), rgba(13,18,31,.94));
  transition: transform .17s ease, border-color .17s ease, background .17s ease;
}
.kb-step-grid a:hover { transform: translateY(-2px); border-color: rgba(119,136,255,.38); background: var(--cv-panel-hover); }
.kb-step-grid a > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; color: #b8c1ff; background: var(--cv-blue-soft); font-size: 12px !important; font-weight: 800; }
.kb-step-grid strong, .kb-step-grid small { display: block; }
.kb-step-grid strong { margin: 3px 0 7px; font-size: 13px !important; }
.kb-step-grid small { color: #8793ae; font-size: 11px !important; line-height: 1.5; }

.kb-layout { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 20px; align-items: start; }
.kb-toc { position: sticky; top: 100px; padding: 19px; box-shadow: none; }
.kb-toc nav { margin-top: 13px; display: grid; gap: 2px; }
.kb-toc a { padding: 9px 10px; border-radius: 8px; color: #929db7; font-size: 12px !important; line-height: 1.35; }
.kb-toc a:hover { color: #fff; background: var(--cv-blue-soft); }
.kb-content { width: auto; max-width: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.kb-topic { padding: 27px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 18px; scroll-margin-top: 100px; box-shadow: 0 12px 36px rgba(0,0,0,.16); }
.kb-topic-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: #a9b4ff; background: linear-gradient(145deg, rgba(119,136,255,.17), rgba(119,136,255,.07)); }
.kb-topic-icon .ui-icon { width: 21px; height: 21px; }
.kb-topic-body h2 { margin: 3px 0 10px; font-size: 23px !important; letter-spacing: -.03em; }
.kb-topic-body > p { max-width: 900px; color: #a2adc4; font-size: 14px !important; line-height: 1.7; }
.kb-topic-body code { padding: 2px 5px; border: 1px solid var(--cv-line); border-radius: 5px; color: #bdc6ff; background: rgba(0,0,0,.2); font-size: 12px !important; }
.kb-callout { margin: 18px 0; padding: 16px 17px; border: 1px solid rgba(119,136,255,.23); border-left: 3px solid var(--cv-blue); border-radius: 10px; background: rgba(119,136,255,.065); }
.kb-callout.warning { border-color: rgba(246,189,107,.22); border-left-color: var(--cv-amber); background: rgba(246,189,107,.055); }
.kb-callout strong { display: block; margin-bottom: 5px; font-size: 13px !important; }
.kb-callout p { margin: 0; color: #9ea9c2; font-size: 13px !important; line-height: 1.6; }
.kb-checklist { margin: 18px 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.kb-checklist li { position: relative; padding: 13px 14px 13px 42px; border: 1px solid var(--cv-line); border-radius: 10px; background: rgba(255,255,255,.018); }
.kb-checklist li::before { content: "✓"; position: absolute; left: 15px; top: 14px; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--cv-green); background: rgba(91,218,166,.1); font-size: 10px; font-weight: 900; }
.kb-checklist strong, .kb-checklist span { display: block; }
.kb-checklist strong { margin-bottom: 3px; font-size: 13px !important; }
.kb-checklist span { color: #8f9ab4; font-size: 12px !important; line-height: 1.5; }
.kb-note { margin: 16px 0 0 !important; padding-left: 13px; border-left: 2px solid #53607c; color: #828eaa !important; font-size: 12px !important; }
.kb-definition-grid { margin: 18px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.kb-definition-grid > div { padding: 14px; border: 1px solid var(--cv-line); border-radius: 10px; background: rgba(255,255,255,.018); }
.kb-definition-grid strong, .kb-definition-grid span { display: block; }
.kb-definition-grid strong { margin-bottom: 5px; color: #dfe4f4; font-size: 12px !important; }
.kb-definition-grid span { color: #8d99b3; font-size: 12px !important; line-height: 1.55; }
.kb-levels { margin: 18px 0; display: grid; gap: 8px; }
.kb-levels > div { padding: 13px 15px; display: grid; grid-template-columns: 125px 1fr; gap: 14px; border: 1px solid var(--cv-line); border-left-width: 3px; border-radius: 9px; }
.kb-levels .confirmed { border-left-color: var(--cv-green); }
.kb-levels .likely { border-left-color: var(--cv-blue); }
.kb-levels .inferred { border-left-color: var(--cv-amber); }
.kb-levels .unknown { border-left-color: #68748f; }
.kb-levels strong { font-size: 12px !important; }
.kb-levels span { color: #909bb5; font-size: 12px !important; line-height: 1.5; }
.kb-steps { margin: 19px 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; list-style: none; }
.kb-steps li { padding: 14px; display: flex; gap: 12px; border: 1px solid var(--cv-line); border-radius: 10px; }
.kb-steps li > span { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: #b3bdff; background: var(--cv-blue-soft); font-size: 11px !important; font-weight: 800; }
.kb-steps strong { font-size: 12px !important; }
.kb-steps p { margin: 4px 0 0; color: #8995ae; font-size: 12px !important; line-height: 1.5; }
.kb-export-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.kb-export-grid > div { padding: 15px; border: 1px solid var(--cv-line); border-radius: 10px; background: rgba(255,255,255,.018); }
.kb-export-grid strong, .kb-export-grid span { display: block; }
.kb-export-grid strong { margin-bottom: 5px; color: #bdc6ff; font-size: 13px !important; }
.kb-export-grid span { color: #8d99b3; font-size: 11px !important; line-height: 1.5; }
.kb-faq { margin-top: 18px; display: grid; gap: 8px; }
.kb-faq details { overflow: hidden; border: 1px solid var(--cv-line); border-radius: 10px; background: rgba(255,255,255,.014); }
.kb-faq summary { padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 15px; cursor: pointer; color: #dce1f0; font-size: 13px !important; font-weight: 700; list-style: none; }
.kb-faq summary::-webkit-details-marker { display: none; }
.kb-faq summary span { color: #8996b2; font-size: 18px !important; font-weight: 400; transition: transform .18s ease; }
.kb-faq details[open] summary span { transform: rotate(45deg); }
.kb-faq details p { margin: 0; padding: 0 15px 15px; color: #919db7; font-size: 12px !important; line-height: 1.65; }
.kb-glossary { margin: 18px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kb-glossary > div { padding: 13px 14px; border: 1px solid var(--cv-line); border-radius: 9px; }
.kb-glossary dt { margin-bottom: 4px; color: #dce1f0; font-size: 12px !important; font-weight: 750; }
.kb-glossary dd { margin: 0; color: #8995ae; font-size: 11px !important; line-height: 1.55; }
.kb-no-results { padding: 60px 25px; text-align: center; }
.kb-no-results > .ui-icon { width: 30px; height: 30px; color: #7f8baa; }
.kb-no-results h2 { margin: 14px 0 6px; font-size: 20px; }
.kb-no-results p { margin: 0; color: var(--cv-muted); font-size: 13px !important; }

/* Optional message evidence */
.message-settings-controls { display: grid; gap: 14px; }
.message-disclosure { padding: 15px; display: flex; gap: 13px; border: 1px solid rgba(246,189,107,.24); border-radius: 11px; background: rgba(246,189,107,.055); }
.message-disclosure > .ui-icon { width: 21px; height: 21px; flex: 0 0 auto; color: var(--cv-amber); }
.message-disclosure strong { display: block; margin-bottom: 4px; font-size: 13px !important; }
.message-disclosure p { margin: 0; color: #9ca7bf; font-size: 12px !important; line-height: 1.55; }
.message-readiness { display: flex; flex-wrap: wrap; gap: 7px; }
.message-readiness span { padding: 6px 9px; border-radius: 999px; font-size: 10px !important; font-weight: 750; }
.message-readiness .ready { color: #7ce1b4; background: rgba(91,218,166,.1); }
.message-readiness .blocked { color: #ff91a3; background: rgba(255,113,136,.1); }
.message-readiness .neutral { color: #a3aec8; background: rgba(255,255,255,.055); }
.message-retention-grid { grid-template-columns: 1fr 1fr; }
.message-consent { padding: 14px; display: flex; align-items: flex-start; gap: 11px; border: 1px solid var(--cv-line); border-radius: 10px; cursor: pointer; }
.message-consent input { width: 17px; min-height: 17px; flex: 0 0 auto; accent-color: var(--cv-blue); }
.message-consent strong, .message-consent small { display: block; }
.message-consent strong { margin-bottom: 3px; font-size: 12px !important; }
.message-consent small { color: #8b97b0; font-size: 11px !important; line-height: 1.5; }
.message-privacy-banner { margin-bottom: 15px; padding: 20px; display: flex; gap: 16px; border-color: rgba(119,136,255,.27); }
.message-privacy-banner > .ui-icon { width: 28px; height: 28px; flex: 0 0 auto; color: #9ca8ff; }
.message-privacy-banner h2 { margin: 3px 0 6px; font-size: 20px !important; }
.message-privacy-banner p:last-child { margin: 0; color: #98a4bd; font-size: 13px !important; line-height: 1.6; }
.message-summary { margin-bottom: 15px; display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; }
.message-summary article { min-height: 100px; padding: 17px; border: 1px solid var(--cv-line); border-radius: 12px; background: var(--cv-panel); }
.message-summary small, .message-summary strong, .message-summary span { display: block; }
.message-summary small { color: #7f8ba7; font-size: 11px !important; }
.message-summary strong { margin: 7px 0 5px; font-size: 18px !important; }
.message-summary span { color: #6f7b96; font-size: 11px !important; }
.message-records { overflow: hidden; }
.message-record-list > a { min-height: 82px; padding: 14px 19px; display: grid; grid-template-columns: 40px minmax(230px,1.1fr) minmax(230px,1fr) minmax(175px,.7fr) auto; gap: 14px; align-items: center; border-top: 1px solid var(--cv-line); transition: background .16s ease; }
.message-record-list > a:hover { background: rgba(119,136,255,.055); }
.message-record-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: #a7b2ff; background: var(--cv-blue-soft); }
.message-record-icon .ui-icon { width: 18px; height: 18px; }
.message-record-list strong, .message-record-list small, .message-record-list span { display: block; }
.message-record-list strong { margin-bottom: 5px; font-size: 13px !important; }
.message-record-list small, .message-record-list span, .message-record-list time { color: #7f8ba6; font-size: 11px !important; }
.message-record-meta span { margin-bottom: 5px; color: #aeb7cc; }
.message-record-list i { color: #78849f; font-style: normal; }
.message-admin-grid { margin-top: 15px; display: grid; grid-template-columns: minmax(0,1fr) minmax(360px,.75fr); gap: 15px; align-items: start; }
.message-deletion-panel, .access-ledger, .deletion-ledger { overflow: hidden; }
.message-deletion-panel form { padding: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.message-deletion-panel label { display: grid; gap: 7px; }
.message-deletion-panel label:first-child { grid-column: 1/-1; }
.message-deletion-panel label > span { color: #8793ae; font-size: 11px !important; font-weight: 700; }
.message-danger-note { grid-column: 1/-1; padding: 13px 14px; border: 1px solid rgba(255,113,136,.2); border-radius: 9px; background: rgba(255,113,136,.055); }
.message-danger-note strong { color: #ff9bab; font-size: 12px !important; }
.message-danger-note p { margin: 5px 0 0; color: #9a8792; font-size: 11px !important; line-height: 1.55; }
.danger-action { grid-column: 1/-1; color: #fff; background: linear-gradient(135deg,#d94e68,#ad344d); }
.access-ledger > div:last-child, .deletion-ledger > div:last-child { display: grid; }
.access-ledger article, .deletion-ledger article { padding: 12px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; border-top: 1px solid var(--cv-line); }
.access-ledger article strong, .deletion-ledger article strong { font-size: 12px !important; }
.access-ledger article span, .deletion-ledger article span { color: #a0aac0; font-size: 11px !important; }
.access-ledger article small, .deletion-ledger article small { grid-column: 1/-1; color: #6f7b96; font-size: 10px !important; }
.deletion-ledger { margin-top: 15px; }
.message-facts strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.retained-content { margin-bottom: 15px; overflow: hidden; }
.retained-content.has-content { border-color: rgba(119,136,255,.26); }
.content-diff { display: grid; grid-template-columns: 1fr 1fr; }
.content-diff article { min-width: 0; }
.content-diff article + article { border-left: 1px solid var(--cv-line); }
.content-diff small { padding: 10px 15px; display: block; color: #7f8ba7; font-size: 10px !important; font-weight: 750; text-transform: uppercase; }
.content-diff pre { min-height: 130px; max-height: 360px; border: 0; border-top: 1px solid var(--cv-line); border-radius: 0; background: #080d17; color: #d5daea; }
.sensitive-view-notice { margin: 0; padding: 11px 15px; border-top: 1px solid rgba(119,136,255,.18); color: #9ba7c2; background: rgba(119,136,255,.055); font-size: 11px !important; }
.message-content-error { padding: 22px; }
.message-content-error strong { color: #ff91a3; }
.message-content-error p { margin: 6px 0 0; color: #9a8792; font-size: 12px !important; }
.attachment-evidence { overflow: hidden; }
.attachment-grid { padding: 14px; display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.attachment-grid article { padding: 14px; border: 1px solid var(--cv-line); border-radius: 9px; background: rgba(255,255,255,.018); }
.attachment-grid strong, .attachment-grid span, .attachment-grid small { display: block; }
.attachment-grid strong { font-size: 12px !important; }
.attachment-grid span { margin: 5px 0; color: #9ba6be; font-size: 11px !important; }
.attachment-grid small { color: #6f7b96; font-size: 10px !important; }

/* Better wide-screen use without making long-form copy unreadable. */
@media (min-width: 1680px) {
  .workspace-shell { grid-template-columns: 288px minmax(0, 1fr); }
  .workspace-main { padding-left: 54px; padding-right: 54px; }
  .case-layout { grid-template-columns: minmax(0, 1.75fr) minmax(360px, .62fr); }
}

@media (max-width: 1180px) {
  .workspace-shell { grid-template-columns: 238px minmax(0, 1fr); }
  .workspace-main { padding-left: 24px; padding-right: 24px; }
  .workspace-nav a { padding-left: 11px; font-size: 13px !important; }
  .case-hero { grid-template-columns: 1fr; }
  .kb-step-grid { grid-template-columns: 1fr 1fr; }
  .message-summary { grid-template-columns: 1fr 1fr; }
  .message-admin-grid { grid-template-columns: 1fr; }
  .message-record-list > a { grid-template-columns: 40px 1fr auto; }
  .message-record-meta, .message-record-list time { display: none; }
}

@media (max-width: 760px) {
  .topbar, .topbar-inner { height: 68px; }
  .topbar-inner { padding: 0 14px; }
  .brand-logo { width: 38px; height: 38px; }
  .workspace-shell { display: block; }
  .workspace-sidebar {
    top: 68px;
    width: 100%;
    height: auto;
    padding: 9px 12px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--cv-line);
  }
  .workspace-nav { gap: 5px; scrollbar-width: none; }
  .workspace-nav::-webkit-scrollbar { display: none; }
  .workspace-nav a { min-height: 40px; padding: 0 12px; }
  .workspace-nav a .ui-icon { display: block; width: 17px; height: 17px; }
  .workspace-main { padding: 26px 16px 52px; }
  .workspace-header { align-items: flex-start; }
  .workspace-header h1, .event-hero h1, .case-hero h1, .alert-hero h1 { font-size: 30px !important; }
  .case-hero, .alert-hero { padding: 18px; }
  .surface-head { padding: 16px; }
  .narrative { padding: 12px 16px; }
  .narrative-item { grid-template-columns: 1fr; }
  .site-main, footer { width: calc(100% - 28px); }
  .kb-layout { grid-template-columns: 1fr; }
  .kb-toc { position: static; }
  .kb-toc nav { grid-template-columns: 1fr 1fr; }
  .kb-topic { padding: 20px; }
}

@media (max-width: 520px) {
  .brand-copy small, .account-name { display: none; }
  .quiet-button { width: 40px; padding: 0; justify-content: center; font-size: 0 !important; }
  .quiet-button .ui-icon { width: 18px; height: 18px; }
  .workspace-main { padding-left: 12px; padding-right: 12px; }
  .metric-grid, .case-facts, .alert-facts, .case-summary, .alert-summary, .integrity-summary { grid-template-columns: 1fr; }
  .kb-search-panel { grid-template-columns: 40px minmax(0,1fr); padding: 14px; }
  .kb-search-panel kbd { display: none; }
  .kb-step-grid, .kb-definition-grid, .kb-steps, .kb-export-grid, .kb-glossary, .kb-toc nav { grid-template-columns: 1fr; }
  .kb-topic { grid-template-columns: 1fr; }
  .kb-topic-icon { width: 40px; height: 40px; }
  .kb-levels > div { grid-template-columns: 1fr; gap: 4px; }
  .message-summary, .message-deletion-panel form, .content-diff, .attachment-grid, .message-retention-grid { grid-template-columns: 1fr; }
  .message-deletion-panel label:first-child, .message-danger-note, .danger-action { grid-column: auto; }
  .content-diff article + article { border-left: 0; border-top: 1px solid var(--cv-line); }
}
