/* ============================================================
   components.css — cards, buttons, chips, tables, modal, toast,
   counsel drawer
   ============================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px 24px;
}
.card-title {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  color: var(--text); margin-bottom: 16px;
}
.card-title svg { width: 15px; height: 15px; color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px; font-weight: 400; letter-spacing: 0.015em;
  cursor: pointer; transition: all .16s; white-space: nowrap;
}
.btn:hover { border-color: var(--border-bright); color: var(--text); background: var(--surface-2); }
.btn svg { width: 13px; height: 13px; }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-primary {
  background: linear-gradient(140deg, var(--gold-bright), #a9853f);
  border-color: transparent;
  color: #17120a; font-weight: 500;
  box-shadow: 0 2px 12px rgba(201,169,98,0.28), inset 0 1px 0 rgba(255,255,255,0.3);
}
.btn-primary:hover {
  background: linear-gradient(140deg, #ecd28c, #b8914a);
  color: #17120a;
  box-shadow: 0 3px 18px rgba(201,169,98,0.42), inset 0 1px 0 rgba(255,255,255,0.35);
}

.btn-analyze {
  border-color: var(--border-gold);
  background: rgba(201,169,98,0.07);
  color: var(--gold-bright);
}
.btn-analyze:hover {
  background: rgba(201,169,98,0.15);
  border-color: var(--gold-soft);
  color: var(--gold-bright);
  box-shadow: var(--glow-gold);
}

/* ---------- Filters ---------- */
.filter-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-pill {
  font-size: 11px; font-weight: 300; letter-spacing: 0.03em;
  padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all .15s;
  user-select: none;
}
.filter-pill:hover { border-color: var(--border-bright); color: var(--text); }
.filter-pill.on {
  background: rgba(201,169,98,0.12);
  border-color: var(--border-gold);
  color: var(--gold-bright);
}
.filter-pill.dim { opacity: 0.4; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 9px; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 6px;
}
.chip-active  { background: rgba(143,206,159,0.1); color: var(--green); border: 1px solid rgba(143,206,159,0.22); }
.chip-review  { background: rgba(143,212,222,0.1); color: var(--cyan); border: 1px solid rgba(143,212,222,0.22); }
.chip-hold    { background: rgba(224,170,94,0.1); color: var(--amber); border: 1px solid rgba(224,170,94,0.22); }
.chip-archive { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }
.chip-priv    { background: rgba(224,122,112,0.1); color: var(--red); border: 1px solid rgba(224,122,112,0.24); }
.chip-pri-high{ background: rgba(224,122,112,0.1); color: var(--red); border: 1px solid rgba(224,122,112,0.24); }
.chip-pri-med { background: rgba(224,170,94,0.1); color: var(--amber); border: 1px solid rgba(224,170,94,0.22); }
.chip-pri-low { background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
thead th {
  font-family: var(--mono); font-size: 8.5px; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-3);
  text-align: left; padding: 13px 20px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 15px 20px; font-size: 12.5px; color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
tbody tr { transition: background .14s; }
tbody tr:hover { background: rgba(255,255,255,0.018); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Progress ---------- */
.progress {
  height: 4px; background: var(--surface-3);
  border-radius: 3px; overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  transition: width .5s cubic-bezier(.2,.7,.3,1);
}

/* ---------- Stats ---------- */
.stat-value {
  font-family: var(--serif); font-size: 32px; font-weight: 500;
  color: var(--text); line-height: 1;
}
.stat-value span { font-size: 15px; color: var(--text-3); }

/* ---------- Toggle ---------- */
.toggle {
  width: 36px; height: 20px; border-radius: 12px;
  background: var(--surface-3); border: 1px solid var(--border);
  position: relative; cursor: pointer; transition: all .2s; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text-3); transition: all .2s;
}
.toggle.on { background: rgba(201,169,98,0.25); border-color: var(--border-gold); }
.toggle.on::after { left: 18px; background: var(--gold-bright); }

/* ---------- Empty state ---------- */
.empty-state {
  padding: 44px 20px; text-align: center;
  color: var(--text-3); font-size: 12.5px; font-weight: 300;
  font-family: var(--serif); font-style: italic; font-size: 15px;
}
.empty-state .hint {
  display: block; margin-top: 10px;
  font-family: var(--mono); font-style: normal;
  font-size: 8.5px; letter-spacing: 0.26em; color: var(--text-3);
  opacity: 0.75;
}

/* ---------- Toast ---------- */
.toast-stack {
  position: fixed; bottom: 26px; right: 26px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px; max-width: 420px;
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(13,15,23,0.97);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-2);
  animation: toastIn .3s cubic-bezier(.2,.8,.3,1.1);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.toast-icon { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.toast-icon svg { width: 100%; height: 100%; }
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.info    .toast-icon { color: var(--cyan); }
.toast-title { font-size: 12.5px; font-weight: 400; color: var(--text); }
.toast-sub { font-size: 11px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }

/* ---------- Modal ---------- */
.ml-modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(4,5,9,0.84);
  display: grid; place-items: center;
  opacity: 0; transition: opacity .2s;
}
.ml-modal-overlay.show { opacity: 1; }
.ml-modal {
  width: min(480px, 92vw);
  background: #0d0f16;
  border: 1px solid var(--border-bright);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  transform: translateY(14px) scale(0.98);
  transition: transform .22s cubic-bezier(.2,.8,.3,1.05);
}
.ml-modal-overlay.show .ml-modal { transform: none; }
/* A tall dialog never runs off the screen: the header and the buttons
   stay in view and the fields between them scroll. Without this, a
   dialog taller than the window (opening a case on a laptop screen)
   had its "Open" button below the bottom edge and out of reach. */
.ml-modal { max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.ml-modal-head, .ml-modal-foot { flex-shrink: 0; }
.ml-modal > .ml-modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
.ml-modal.wide { width: min(760px, 94vw); }
.ml-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 26px 0;
}
.ml-modal-head h3 { font-size: 21px; font-weight: 500; }
.ml-modal-x {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: none; color: var(--text-3); cursor: pointer;
  display: grid; place-items: center;
}
.ml-modal-x:hover { background: var(--surface-2); color: var(--text); }
.ml-modal-x svg { width: 15px; height: 15px; }
.ml-modal-body { padding: 20px 26px; display: flex; flex-direction: column; gap: 15px; }
.ml-modal-field { display: flex; flex-direction: column; gap: 7px; }
.ml-modal-field span {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-3);
}
.ml-modal-field input, .ml-modal-field select, .ml-modal-field textarea {
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px; color: var(--text);
  font-size: 13px; font-weight: 300; outline: none;
  transition: border-color .15s;
}
.ml-modal-field input:focus, .ml-modal-field select:focus, .ml-modal-field textarea:focus {
  border-color: var(--border-gold);
}
.ml-modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 4px 26px 24px;
}

/* ============================================================
   COUNSEL DRAWER — the AI, summoned anywhere
   ============================================================ */
.counsel-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(4,5,9,0.6);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.counsel-scrim.show { opacity: 1; pointer-events: auto; }

.counsel-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 100;
  width: min(500px, 94vw);
  background: rgba(10,12,18,0.97);
  border-left: 1px solid var(--border-gold);
  box-shadow: -30px 0 80px rgba(0,0,0,0.55);
  display: flex; flex-direction: column;
  transform: translateX(102%);
  transition: transform .32s cubic-bezier(.2,.8,.25,1);
}
.counsel-drawer.open { transform: none; }

.counsel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.counsel-head h2 {
  font-size: 22px; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.counsel-head h2 svg { width: 18px; height: 18px; color: var(--gold); }
.counsel-head p {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--text-3); margin-top: 4px;
}
.counsel-close {
  width: 32px; height: 32px; border-radius: 9px; border: none;
  background: none; color: var(--text-3); cursor: pointer;
  display: grid; place-items: center;
}
.counsel-close:hover { background: var(--surface-2); color: var(--text); }
.counsel-close svg { width: 16px; height: 16px; }

.ai-model-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.18em;
  padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-2); background: var(--surface);
}

.chat-scroll {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 16px;
}

.msg { max-width: 100%; }
.msg-role {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.2em;
  color: var(--text-3); margin-bottom: 7px; text-transform: uppercase;
}
.msg-role svg { width: 11px; height: 11px; }
.msg.a .msg-role { color: var(--gold); }
.msg-body {
  font-size: 13px; font-weight: 300; line-height: 1.7; color: var(--text-2);
}
.msg.u .msg-body {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; color: var(--text);
}
.msg-body strong { color: var(--text); font-weight: 500; }
.msg-body em { color: var(--cyan); font-style: normal; cursor: pointer; }
.msg-citations { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.citation {
  font-family: var(--mono); font-size: 9px;
  padding: 3px 9px; border-radius: 6px;
  background: rgba(143,212,222,0.08);
  border: 1px solid rgba(143,212,222,0.2);
  color: var(--cyan); cursor: pointer; transition: all .14s;
}
.citation:hover { background: rgba(143,212,222,0.16); }

.typing { display: flex; gap: 5px; padding: 8px 2px; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold); opacity: 0.4;
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

.counsel-input-wrap {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}
.ai-input {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 10px 10px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.ai-input:focus-within { border-color: var(--border-gold); box-shadow: var(--glow-gold); }
.ai-input textarea {
  flex: 1; background: none; border: none; outline: none; resize: none;
  color: var(--text); font-size: 13px; font-weight: 300; line-height: 1.5;
  max-height: 120px;
}
.ai-input textarea::placeholder { color: var(--text-3); }
.ai-send {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: linear-gradient(140deg, var(--gold-bright), #a9853f);
  color: #17120a; cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
  transition: all .15s;
  box-shadow: 0 2px 10px rgba(201,169,98,0.3);
}
.ai-send:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(201,169,98,0.45); }
.ai-send:disabled { opacity: .4; transform: none; }
.ai-send svg { width: 15px; height: 15px; }

.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.suggest-pill {
  font-size: 10.5px; font-weight: 300; padding: 5px 12px;
  border-radius: 99px; border: 1px solid var(--border);
  color: var(--text-2); cursor: pointer; transition: all .14s;
}
.suggest-pill:hover { border-color: var(--border-gold); color: var(--gold-bright); }

/* Engine selector (drawer footer) */
.engine-select { display: flex; gap: 8px; padding: 0 20px 14px; }
.engine-opt {
  flex: 1; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; cursor: pointer; transition: all .14s;
  background: var(--surface);
}
.engine-opt:hover { border-color: var(--border-bright); }
.engine-opt.on { border-color: var(--border-gold); background: rgba(201,169,98,0.07); }
.engine-opt-top { display: flex; align-items: center; gap: 7px; }
.engine-radio {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--border-bright); transition: all .12s; flex-shrink: 0;
}
.engine-opt.on .engine-radio { border-color: var(--gold); background: var(--gold); }
.engine-name { font-size: 11.5px; color: var(--text); font-weight: 400; }
.engine-sub {
  font-family: var(--mono); font-size: 8px; color: var(--text-3);
  margin-top: 3px; padding-left: 17px; letter-spacing: 0.04em;
}

/* Row actions, shared */
.row-action {
  font-family: var(--mono); font-size: 9.5px;
  color: var(--text-3); cursor: pointer; margin-left: 10px;
  padding: 4px 8px; border-radius: 6px; border: 1px solid transparent;
  white-space: nowrap; transition: all .14s;
}
.row-action:hover { color: var(--cyan); border-color: var(--border-bright); }
.row-action.danger:hover { color: var(--red); border-color: rgba(224,122,112,0.3); }

/* Drop overlay */
.drop-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(4,5,9,0.92);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drop-overlay.show { opacity: 1; pointer-events: auto; }
.drop-overlay-inner {
  text-align: center; color: var(--gold);
  border: 1px dashed var(--border-gold);
  border-radius: 24px; padding: 70px 100px;
  background: rgba(201,169,98,0.04);
}
.drop-overlay-inner svg { width: 44px; height: 44px; margin-bottom: 18px; }
.drop-overlay-inner h2 { font-size: 30px; font-weight: 500; }
.drop-overlay-inner p {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  color: var(--text-2); margin-top: 10px; text-transform: uppercase;
}

/* ---------- Evidence intake (Matters page) ---------- */
.dropzone {
  padding: 34px 24px; text-align: center; cursor: pointer;
  border: 1px dashed var(--border-bright);
  border-radius: var(--r-lg);
  margin: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: all .2s; color: var(--text-2);
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(201,169,98,0.05), transparent 70%);
}
/* The custody field sits above the dropzone in the same card, so the
   dropzone has to give up the space rather than keep height:100% and
   clip its own format list off the bottom edge. */
.intake-card { display: flex; flex-direction: column; }
.intake-card .dropzone {
  flex: 1 1 auto; height: auto; min-height: 200px; padding: 24px 20px;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--border-gold);
  background:
    radial-gradient(400px 200px at 50% 0%, rgba(201,169,98,0.1), transparent 70%);
  box-shadow: var(--glow-gold);
}
.dropzone svg { width: 30px; height: 30px; color: var(--gold); margin-bottom: 14px; }
.dropzone-title { font-family: var(--serif); font-size: 17px; color: var(--text); }
.dropzone-link { color: var(--gold); font-style: italic; }
.dropzone-sub {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.14em;
  color: var(--text-3); margin-top: 10px; line-height: 1.9; text-transform: uppercase;
}

.doc-list { display: flex; flex-direction: column; gap: 4px; }
.doc-item {
  padding: 8px 11px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; transition: all .13s;
}
.doc-item:hover { background: var(--surface-2); border-color: var(--border); }
.doc-name {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.doc-meta {
  display: flex; gap: 9px; margin-top: 3px; padding-left: 18px;
  font-family: var(--mono); font-size: 8.5px; color: var(--text-3);
}
.doc-badge.priv {
  font-size: 7.5px; padding: 1px 5px; border-radius: 4px;
  background: rgba(224,122,112,0.12); color: var(--red);
  letter-spacing: 0.1em;
}
.corpus-empty {
  padding: 24px 12px; text-align: center;
  font-family: var(--serif); font-style: italic;
  font-size: 13px; color: var(--text-3); line-height: 1.7;
}

/* ---------- Document viewer ---------- */
.viewer-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4,5,9,0.88);
  display: grid; place-items: center;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.viewer-overlay.show { opacity: 1; pointer-events: auto; }
.viewer {
  width: min(880px, 94vw); height: min(84vh, 900px);
  background: #0c0e15;
  border: 1px solid var(--border-bright);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; overflow: hidden;
}
.viewer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 26px; border-bottom: 1px solid var(--border);
}
.viewer-head-info h3 { font-size: 20px; font-weight: 500; }
.viewer-head-meta {
  display: flex; gap: 16px; margin-top: 5px;
  font-family: var(--mono); font-size: 9.5px; color: var(--text-3);
}
.viewer-close {
  width: 34px; height: 34px; border-radius: 9px; border: none;
  background: none; color: var(--text-3); cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.viewer-close:hover { background: var(--surface-2); color: var(--text); }
.viewer-close svg { width: 16px; height: 16px; }
.viewer-flags {
  padding: 10px 26px; background: rgba(224,122,112,0.05);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 5px;
}
.viewer-flag {
  border-left: 2px solid var(--red); padding: 3px 10px;
  font-size: 11px; color: var(--text-2); display: flex; gap: 7px;
  font-family: var(--mono);
}
.viewer-flag-more { font-size: 9.5px; color: var(--text-3); padding-left: 12px; font-family: var(--mono); }
.viewer-body {
  flex: 1; overflow-y: auto; padding: 24px 26px;
  font-family: var(--mono); font-size: 12px; line-height: 1.8;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}
.viewer-body .flag-hit, .flag-hit {
  background: rgba(224,122,112,0.2); color: #ffc4be;
  border-radius: 3px; padding: 0 3px;
}
.viewer-foot {
  display: flex; justify-content: space-between;
  padding: 12px 26px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 8.5px; letter-spacing: 0.1em;
  color: var(--text-3);
}

/* ===========================================================
   Storage alarm — a failed write to the evidence database.
   Deliberately hard to ignore: everything the user does while
   this is up is being recorded in memory only.
   =========================================================== */
.storage-alarm {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9000;
  display: flex; align-items: flex-start; gap: 13px;
  padding: 15px 20px;
  background: linear-gradient(180deg, rgba(224,122,112,.16), rgba(224,122,112,.11));
  border-top: 1px solid rgba(224,122,112,.5);
  box-shadow: 0 -8px 40px rgba(0,0,0,.5);
  animation: storage-alarm-in .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes storage-alarm-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.storage-alarm > svg {
  width: 21px; height: 21px; flex-shrink: 0; color: var(--red); margin-top: 1px;
}
.storage-alarm > div { flex: 1; min-width: 0; }
.storage-alarm b {
  display: block; font-family: var(--serif); font-size: 15px;
  color: var(--red); margin-bottom: 4px; font-weight: 500;
}
.storage-alarm span {
  display: block; font-size: 12px; line-height: 1.6; color: var(--text-2); max-width: 88ch;
}
.storage-alarm em {
  display: block; margin-top: 5px; font-style: normal;
  font-family: var(--mono); font-size: 10px; color: var(--text-3); word-break: break-word;
}
.storage-alarm-x {
  flex-shrink: 0; align-self: center;
  padding: 7px 14px; border-radius: var(--r-sm); cursor: pointer;
  background: transparent; border: 1px solid rgba(224,122,112,.45);
  color: var(--red); font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase;
  transition: background .18s;
}
.storage-alarm-x:hover { background: rgba(224,122,112,.14); }

@media (max-width: 700px) {
  .storage-alarm { flex-wrap: wrap; }
  .storage-alarm-x { margin-left: auto; }
}

/* ===========================================================
   Team mode — the badge, sign-in, and the conflict alarm.
   =========================================================== */
.team-badge {
  padding: 11px 12px; margin-bottom: 12px;
  border-radius: var(--r-sm); border: 1px solid var(--border);
  background: var(--surface-2);
}
.team-badge .tb-row { display: flex; align-items: flex-start; gap: 9px; }
.team-badge .tb-dot {
  width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex-shrink: 0;
}
.team-badge.on  .tb-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(143,206,159,.16); }
.team-badge.off .tb-dot { background: var(--text-3); }
.team-badge b {
  display: block; font-family: var(--mono); font-size: 9.5px;
  letter-spacing: .09em; text-transform: uppercase; font-weight: 600;
  color: var(--text-2); margin-bottom: 3px;
}
.team-badge.on b { color: var(--green); }
.team-badge span:not(.tb-dot) {
  display: block; font-size: 10.5px; line-height: 1.45; color: var(--text-3);
}
.team-badge .tb-act {
  display: block; width: 100%; margin-top: 9px; padding: 6px 8px;
  border-radius: 5px; cursor: pointer;
  background: transparent; border: 1px solid var(--border-bright);
  color: var(--text-2); font-family: var(--mono); font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .18s, color .18s;
}
.team-badge .tb-act:hover { border-color: var(--border-gold); color: var(--gold); }

.tm-lead { font-size: 12px; line-height: 1.6; color: var(--text-3); margin-bottom: 14px; }
.tm-err  { min-height: 16px; margin-top: 10px; font-size: 11.5px; color: var(--red); }
.tm-empty { font-size: 12px; line-height: 1.6; color: var(--text-3); padding: 12px 0; }
.tm-matters { display: flex; flex-direction: column; gap: 7px; max-height: 46vh; overflow-y: auto; }
.tm-matter {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 11px 13px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .18s, background .18s;
}
.tm-matter:hover { border-color: var(--border-gold); background: rgba(201,169,98,.05); }
.tm-matter b { display: block; font-family: var(--serif); font-size: 14px; color: var(--text); }
.tm-matter span {
  display: block; margin-top: 3px; font-family: var(--mono); font-size: 10px; color: var(--text-3);
}

/* The conflict alarm. Someone else's call is already recorded and
   yours was refused — the reviewer has to see both. */
.conflict-alarm {
  position: fixed; right: 20px; bottom: 20px; z-index: 8900;
  max-width: 460px;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 15px 17px; border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(224,170,94,.15), rgba(224,170,94,.09));
  border: 1px solid rgba(224,170,94,.45);
  box-shadow: 0 14px 44px rgba(0,0,0,.5);
  animation: conflict-in .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes conflict-in {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.conflict-alarm > svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--amber); margin-top: 1px; }
.conflict-alarm > div { flex: 1; min-width: 0; }
.conflict-alarm b {
  display: block; font-family: var(--serif); font-size: 14.5px;
  color: var(--amber); margin-bottom: 5px; font-weight: 500;
}
.conflict-alarm span { display: block; font-size: 11.5px; line-height: 1.6; color: var(--text-2); }
.conflict-alarm em {
  font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--gold);
}
.ca-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 8px; }
.ca-cols > div {
  padding: 8px 10px; border-radius: 5px;
  background: rgba(0,0,0,.22); border: 1px solid var(--border);
}
.ca-cols span {
  font-family: var(--mono); font-size: 8.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3);
}
.ca-cols b {
  display: block; margin-top: 3px; font-family: var(--sans); font-size: 11px;
  color: var(--text); font-weight: 400; line-height: 1.4;
}
.ca-hint { color: var(--text-3) !important; font-size: 10.5px !important; }
.conflict-x {
  flex-shrink: 0; align-self: flex-start;
  padding: 5px 10px; border-radius: 5px; cursor: pointer;
  background: transparent; border: 1px solid rgba(224,170,94,.4);
  color: var(--amber); font-family: var(--mono); font-size: 9px;
  letter-spacing: .08em; text-transform: uppercase;
  transition: background .18s;
}
.conflict-x:hover { background: rgba(224,170,94,.14); }

@media (max-width: 600px) {
  .conflict-alarm { right: 12px; left: 12px; max-width: none; }
  .ca-cols { grid-template-columns: 1fr; }
}

/* ---------- who this material came from ----------
   Deliberately loud when empty. Evidence ingested without a
   custodian cannot be attributed to anybody, and the cost of that
   only becomes visible weeks later when a hold covers nothing. */
.dz-custody {
  padding: 13px 16px 11px; border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.015);
}
.dz-custody label {
  display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--text-2); margin-bottom: 6px;
}
.dz-custody input {
  width: 100%; padding: 8px 11px; border-radius: var(--r-sm);
  background: #0A0D11; border: 1px solid var(--border); color: var(--text-1);
  font-family: var(--sans, inherit); font-size: 13px;
}
.dz-custody select {
  width: 100%; padding: 8px 11px; border-radius: var(--r-sm);
  background: #0A0D11; border: 1px solid var(--border); color: var(--text-1);
  font-family: var(--sans, inherit); font-size: 13px;
}
.dz-custody input:focus,
.dz-custody select:focus { outline: none; border-color: var(--brass, #c9a962); }
.dz-custody-note { margin: 7px 0 0; font-size: 11px; line-height: 1.55; }
.dz-custody-note.set  { color: var(--text-2); }
.dz-custody-note.warn { color: var(--amber, #d9a441); }

/* ---------- native data or processed data ---------- */
.dz-kind { padding: 11px 16px 12px; border-bottom: 1px solid var(--border); }
.dz-kind-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--text-2); margin-bottom: 7px;
}
.dz-kind-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dz-kind-opt {
  text-align: left; cursor: pointer; padding: 9px 11px; border-radius: var(--r-sm);
  background: #0A0D11; border: 1px solid var(--border); color: var(--text-2);
  font-family: var(--sans, inherit); transition: border-color .15s, background .15s;
}
.dz-kind-opt b { display: block; font-size: 13px; font-weight: 600; color: var(--text-1, var(--text)); margin-bottom: 3px; }
.dz-kind-opt span { display: block; font-size: 11px; line-height: 1.45; }
.dz-kind-opt:hover { border-color: var(--border-bright); }
.dz-kind-opt.on {
  border-color: var(--brass, #c9a962); background: rgba(201,169,98,.08);
  box-shadow: inset 0 0 0 1px rgba(201,169,98,.25);
}
.dz-kind-opt.on b { color: var(--gold, #c9a962); }
.dz-kind-opt:focus-visible { outline: 2px solid var(--brass, #c9a962); outline-offset: 2px; }
@media (max-width: 720px) { .dz-kind-opts { grid-template-columns: 1fr; } }
.dropzone.processed { border-style: solid; border-color: rgba(201,169,98,.35); }
.dz-processed-note { display: none; margin: 9px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--text-2); }
/* Processed data names its own custodians and languages. */
.intake-card.kind-processed label[for="upCustodian"], .intake-card.kind-processed #upCustodian,
.intake-card.kind-processed label[for="upLanguage"], .intake-card.kind-processed #upLanguage,
.intake-card.kind-processed #upCustodyNote { display: none; }
.intake-card.kind-processed .dz-processed-note { display: block; }

/* the processed-data dialog (importview.js) */
.imp-from { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin: 12px 0 8px; }
.imp-from .imp-map input { flex: 1; min-width: 0; padding: 7px 10px; border-radius: var(--r-sm); background: #0A0D11;
  border: 1px solid var(--border); color: var(--text-1, var(--text)); font-size: 13px; }
.imp-check { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-2); line-height: 1.45; cursor: pointer; }
.imp-check input { margin-top: 2px; accent-color: var(--brass, #c9a962); }
.imp-work { font-size: 12px; line-height: 1.55; color: var(--text-2); padding: 8px 11px; margin-bottom: 10px;
  border-left: 3px solid var(--brass, #c9a962); background: rgba(201,169,98,.06); border-radius: 4px; }
.imp-work.none { border-left-color: var(--border-bright); background: rgba(255,255,255,.02); }
.imp-native { font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold, #c9a962);
  border: 1px solid rgba(201,169,98,.4); padding: 1px 5px; border-radius: 4px; margin-left: 6px; }
.imp-dprior { font-size: 11px; color: var(--gold, #c9a962); margin: 2px 0; }
@media (max-width: 720px) { .imp-from { grid-template-columns: 1fr; } }

/* ===========================================================
   Where a document was collected from.

   One copy of a set of identical bytes is reviewed; every place
   it was found is recorded. This is the panel that puts that in
   front of the reviewer rather than only in the report.

   Styled as a quiet fact, not a warning. A document held by four
   custodians is not a problem — it is often the most ordinary
   thing in a collection, and occasionally the whole case.
   =========================================================== */
.viewer-occ {
  margin: 0 0 4px;
  padding: 10px 14px;
  border: 1px solid var(--line, #252d38);
  border-radius: 8px;
  background: var(--surface-2, #151a21);
  font-size: 12px;
}
.viewer-occ-head {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  font-weight: 600; color: var(--text-1, #e8e6e1);
  padding-bottom: 7px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line, #252d38);
}
.viewer-occ-head span {
  font-weight: 400; font-size: 11px; color: var(--text-3, #8c94a2);
  margin-left: auto;
}
.viewer-occ-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 3px 0; line-height: 1.5;
}
.viewer-occ-cust {
  flex: 0 0 auto; min-width: 190px;
  color: var(--text-1, #e8e6e1);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
}
.viewer-occ-name {
  flex: 1 1 auto; min-width: 0;
  color: var(--text-2, #b3bac6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer-occ-at {
  flex: 0 0 auto;
  color: var(--text-3, #8c94a2);
  font-variant-numeric: tabular-nums; font-size: 11px;
}

@media (max-width: 720px) {
  .viewer-occ-row { flex-direction: column; gap: 0; padding: 6px 0; }
  .viewer-occ-cust { min-width: 0; }
  .viewer-occ-head span { margin-left: 0; width: 100%; }
}

/* Production dialog: why the volume's dates are in this time zone. */
.pr-tz-note { font-size: 12px; line-height: 1.6; color: var(--text-2); margin: -4px 0 6px; }
.pr-tz-note.warn { color: var(--amber, #d4a24c); }

/* Viewer: copies of one file coded differently, until decided. */
.viewer-conflict { margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--gold); border-radius: 8px;
  font-size: 12.5px; line-height: 1.55; color: var(--text-1, inherit); background: rgba(212,162,76,.08); }
.viewer-conflict b { color: var(--gold); margin-right: 4px; }
.viewer-conflict span { display: block; color: var(--text-3); margin-top: 3px; }

/* ---------- The desktop application's licence key screen (js/licencegate.js) ---------- */
.lg {
  position: fixed; inset: 0; z-index: 10000; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(201,169,98,.10), transparent 60%), var(--bg, #07080d);
}
.lg-card {
  width: min(560px, 100%); padding: 34px 34px 28px; border-radius: 16px;
  background: var(--glass, rgba(13,15,23,.92)); border: 1px solid var(--border-gold, rgba(201,169,98,.28));
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.lg-mark { font: 500 13px/1 var(--serif, serif); letter-spacing: .28em; color: var(--text, #ece9e1); margin-bottom: 22px; }
.lg-mark span { color: var(--gold, #c9a962); }
.lg h1 { font: 400 30px/1.15 var(--serif, serif); color: var(--text, #ece9e1); margin: 0 0 10px; }
.lg-lead, .lg-why, .lg-note { font: 13.5px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); margin: 0 0 8px; }
.lg-lead b { color: var(--gold-bright, #e2c47e); font-weight: 500; font-family: var(--mono, monospace); }
.lg-why { color: var(--amber, #e0aa5e); margin-bottom: 18px; }
.lg-label { display: block; font: 500 10px/1 var(--mono, monospace); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3, #8a877b); margin-bottom: 8px; }
.lg-key {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 92px; padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2, rgba(255,255,255,.04)); border: 1px solid var(--border-bright, rgba(255,255,255,.12));
  color: var(--text, #ece9e1); font: 13px/1.6 var(--mono, monospace); word-break: break-all; outline: none;
}
.lg-key:focus { border-color: var(--gold, #c9a962); box-shadow: 0 0 0 3px rgba(201,169,98,.15); }
.lg-err { min-height: 20px; margin: 8px 0 6px; font: 13px/1.45 var(--sans, sans-serif); color: var(--red, #e07a70); }
.lg-go {
  width: 100%; padding: 13px 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-bright, #e2c47e), var(--gold, #c9a962)); color: #1a1407;
  font: 600 14px/1 var(--sans, sans-serif); letter-spacing: .02em;
}
.lg-go:disabled { opacity: .6; cursor: progress; }
.lg-go:focus-visible { outline: 2px solid var(--gold-bright, #e2c47e); outline-offset: 3px; }
.lg-note { margin-top: 16px; font-size: 12px; color: var(--text-3, #8a877b); }

/* ---------- A legal case shows no investigation tools (js/casekind.js) ----------
   Red flags and risk scores are still computed on intake; a legal case
   only keeps them out of sight, so "Upgrade to investigation" shows them
   at once. */
body[data-casekind="legal"] .fraud-only { display: none !important; }
body:not([data-casekind="legal"]) .legal-only { display: none !important; }
body[data-casekind="legal"] .flag-hit { background: none !important; color: inherit !important; padding: 0 !important; }
.case-kind-upgrade {
  margin-left: auto; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-gold, rgba(201,169,98,.28)); background: rgba(201,169,98,.08);
  color: var(--gold-bright, #e2c47e); font: 500 10.5px/1.2 var(--sans, sans-serif); white-space: nowrap;
}
.case-kind-upgrade:hover { background: rgba(201,169,98,.16); }
.kind-up { font: 13.5px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); margin: 8px 0; }
.kind-up-list { margin: 6px 0 10px 18px; padding: 0; font: 13px/1.6 var(--sans, sans-serif); color: var(--text-2, #a9a698); }
.kind-up-list b, .kind-up b { color: var(--text, #ece9e1); font-weight: 500; }

/* ---------- First start: who you are, then the first case (js/firstrun.js) ---------- */
.fr {
  /* Under the dialogs (200) and the messages (300): joining a shared
     case file from here opens its dialog on top. */
  position: fixed; inset: 0; z-index: 190; display: grid; place-items: center; padding: 24px; overflow-y: auto;
  background: radial-gradient(1200px 600px at 50% -10%, rgba(201,169,98,.10), transparent 60%), var(--bg, #07080d);
}
.fr-card {
  width: min(760px, 100%); padding: 36px 36px 30px; border-radius: 16px;
  background: var(--glass, rgba(13,15,23,.92)); border: 1px solid var(--border-gold, rgba(201,169,98,.28));
  box-shadow: 0 30px 90px rgba(0,0,0,.55);
}
.fr-mark { font: 500 13px/1 var(--serif, serif); letter-spacing: .28em; color: var(--text, #ece9e1); margin-bottom: 22px; }
.fr-mark span { color: var(--gold, #c9a962); }
.fr h1 { font: 400 32px/1.15 var(--serif, serif); color: var(--text, #ece9e1); margin: 0 0 10px; }
.fr-lead, .fr-note { font: 14px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); margin: 0 0 20px; }
.fr-note { font-size: 12px; color: var(--text-3, #8a877b); margin: 18px 0 0; }
.fr-roles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.fr-role {
  display: flex; flex-direction: column; gap: 8px; text-align: left; cursor: pointer; padding: 22px 20px; border-radius: 12px;
  background: var(--surface-2, rgba(255,255,255,.04)); border: 1px solid var(--border-bright, rgba(255,255,255,.12)); color: inherit;
  transition: border-color .15s, background .15s, transform .15s;
}
.fr-role:hover, .fr-role:focus-visible { border-color: var(--gold, #c9a962); background: rgba(201,169,98,.07); outline: none; transform: translateY(-1px); }
.fr-role[aria-checked="true"] { border-color: var(--gold, #c9a962); }
.fr-role-title { font: 400 22px/1.2 var(--serif, serif); color: var(--text, #ece9e1); }
.fr-role-what { font: 500 13px/1.45 var(--sans, sans-serif); color: var(--gold-bright, #e2c47e); }
.fr-role-gets { font: 13px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); }
.fr-form { display: flex; flex-direction: column; gap: 4px; }
.fr-form .ml-modal-field input, .fr-form .ml-modal-field select { width: 100%; box-sizing: border-box; }
.fr-kind { font: 13px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); margin: 10px 0 0; padding: 10px 12px;
  border-radius: 9px; background: rgba(201,169,98,.06); border: 1px solid rgba(201,169,98,.18); }
.fr-kind b { color: var(--text, #ece9e1); font-weight: 500; }
.fr-err { min-height: 20px; margin: 8px 0 4px; font: 13px/1.45 var(--sans, sans-serif); color: var(--red, #e07a70); }
.fr-go {
  padding: 13px 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-bright, #e2c47e), var(--gold, #c9a962)); color: #1a1407;
  font: 600 14px/1 var(--sans, sans-serif);
}
.fr-go:focus-visible { outline: 2px solid var(--gold-bright, #e2c47e); outline-offset: 3px; }
.fr-back { margin-top: 10px; align-self: center; background: none; border: 0; cursor: pointer;
  color: var(--text-3, #8a877b); font: 12px/1.4 var(--sans, sans-serif); text-decoration: underline; }
@media (max-width: 640px) { .fr-roles { grid-template-columns: 1fr; } .fr-card { padding: 26px 20px; } }
.fr-join { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, rgba(255,255,255,.06));
  font: 12.5px/1.5 var(--sans, sans-serif); color: var(--text-3, #8a877b); }
.fr-join button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--gold-bright, #e2c47e);
  font: inherit; text-decoration: underline; }
.fr-full { margin-top: 14px; font: 12.5px/1.5 var(--sans, sans-serif); color: var(--text-3, #8a877b); }
.fr-full button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--text-2, #a9a698);
  font: inherit; text-decoration: underline; }

/* ---- a picture in the evidence, shown as the picture (js/picture.js) ---- */
.wlx-picture { margin: 0 0 14px; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  background-color: #0b0d12;
  background-image: linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.035) 75%),
                    linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.035) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
  text-align: center; overflow: auto; }
.viewer-picture.wlx-picture { margin: 0 20px 14px; }
.wlx-picture-img { display: block; margin: 0 auto; max-width: 100%; max-height: 70vh; min-height: 120px; object-fit: contain; cursor: zoom-in; border-radius: 4px; }
.wlx-picture-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px;
  font: 12px/1.4 var(--sans, sans-serif); color: var(--text-3, #8a877b); }
.wlx-picture-open { min-height: 34px; padding: 6px 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-2, rgba(255,255,255,.14)); background: var(--surface-2, rgba(255,255,255,.04));
  color: var(--text, #ece9e1); font: 500 12.5px/1 var(--sans, sans-serif); }
.wlx-picture-open:hover, .wlx-picture-open:focus-visible { border-color: var(--gold, #c9a962); color: var(--gold-bright, #e2c47e); }

/* The full-screen picture viewer (js/picture.js openViewer). */
.wlx-lb { position: fixed; inset: 0; z-index: 10000; display: flex; flex-direction: column;
  background: rgba(6, 7, 10, .96); color: #ece9e1; font-family: var(--sans, sans-serif); }
.wlx-lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.wlx-lb-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.wlx-lb-title b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.wlx-lb-size { font-size: 12px; color: #a9a698; white-space: nowrap; }
.wlx-lb-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wlx-lb-tools button { min-width: 44px; min-height: 40px; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: #ece9e1; font: 500 14px/1 var(--sans, sans-serif); }
.wlx-lb-tools button:hover, .wlx-lb-tools button:focus-visible { border-color: #c9a962; color: #e2c47e; outline: none; }
.wlx-lb-tools .wlx-lb-close { margin-left: 8px; }
.wlx-lb-pct { min-width: 52px; text-align: center; font-size: 13px; color: #d8d4c8; font-variant-numeric: tabular-nums; }
.wlx-lb-stage { position: relative; flex: 1; overflow: hidden; cursor: grab; touch-action: none; user-select: none;
  background-image: linear-gradient(45deg, rgba(255,255,255,.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.03) 75%),
                    linear-gradient(45deg, rgba(255,255,255,.03) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.03) 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px; }
.wlx-lb-stage.dragging { cursor: grabbing; }
.wlx-lb-img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; transform-origin: center center;
  box-shadow: 0 8px 40px rgba(0,0,0,.5); pointer-events: none; }
.wlx-lb-hint { padding: 8px 16px; font-size: 12px; color: #a9a698; text-align: center; border-top: 1px solid rgba(255,255,255,.06); }
@media (max-width: 700px) { .wlx-lb-hint { display: none; } .wlx-lb-title b { max-width: 90vw; } }
.wlx-picture-note { font: 12.5px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); padding: 18px 8px; }

/* ---- the case file evidence goes into, and a whole folder (js/upload.js) ---- */
.dz-case { display: flex; gap: 8px; align-items: stretch; }
.dz-case select { flex: 1; min-width: 0; }
.dz-case-new { flex: none; padding: 0 12px; border-radius: var(--r-sm, 6px); border: 1px solid var(--border-gold, rgba(201,169,98,.35));
  background: rgba(201,169,98,.08); color: var(--gold-bright, #e2c47e); font: 12px var(--sans, sans-serif); cursor: pointer; white-space: nowrap; }
.dz-case-new:hover { background: rgba(201,169,98,.16); }
.dropzone-folder { font: 12px/1.5 var(--sans, sans-serif); color: var(--text-3, #8a877b); margin: -2px 0 10px; }
button.dropzone-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--gold); font-style: italic; text-decoration: underline; }
.dropzone.no-case { opacity: .55; }
.case-first-lead { color: var(--text-2); font-size: 13px; line-height: 1.6; margin: 0 0 14px; }
.case-first-none { color: var(--text-2); font-size: 13px; margin: 0 0 12px; }
.case-first-new { margin-top: 2px; }

/* ---- the Assistant log (js/ailogview.js) ---- */
p.al-scope { color: var(--text-3); font-size: 12.5px; line-height: 1.6; margin: -6px 0 14px; max-width: 70em; }
.al-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.al-filters input[type=search] { flex: 1 1 260px; min-width: 200px; }
.al-filters input, .al-filters select { padding: 8px 11px; border-radius: var(--r-sm, 6px); background: #0A0D11; border: 1px solid var(--border);
  color: var(--text); font: 13px var(--sans, sans-serif); }
.al-date { font: 11px var(--mono, monospace); color: var(--text-3); display: inline-flex; gap: 6px; align-items: center; }
.al-count { font-size: 10px; letter-spacing: .12em; color: var(--text-3); margin: 6px 0 8px; text-transform: uppercase; }
.al-list { display: flex; flex-direction: column; gap: 6px; }
.al-row { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.al-row[open] { border-color: var(--border-gold, rgba(201,169,98,.35)); }
.al-row summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 118px 170px 160px 150px 1fr; gap: 10px;
  align-items: center; padding: 10px 14px; font-size: 12.5px; }
.al-row summary::-webkit-details-marker { display: none; }
.al-when { font: 11px var(--mono, monospace); color: var(--text-3); }
.al-who, .al-case { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-q { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-out { font: 10px var(--mono, monospace); letter-spacing: .04em; padding: 3px 8px; border-radius: 99px; justify-self: start; border: 1px solid; }
.al-out.ok { color: #8fce9f; border-color: rgba(143,206,159,.35); }
.al-out.info { color: #8fd4de; border-color: rgba(143,212,222,.3); }
.al-out.warn { color: #e0aa5e; border-color: rgba(224,170,94,.35); }
.al-out.bad { color: #e07a70; border-color: rgba(224,122,112,.35); }
.al-body { padding: 4px 16px 14px; border-top: 1px solid var(--border); }
.al-sec { font: 10px var(--mono, monospace); letter-spacing: .14em; text-transform: uppercase; color: var(--gold, #c9a962); margin: 12px 0 5px; }
.al-text { white-space: pre-wrap; line-height: 1.6; font-size: 13px; color: var(--text); max-height: 420px; overflow: auto; }
.al-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.al-chip { font: 11px var(--mono, monospace); padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.al-checks { font-size: 12.5px; color: var(--text-2); }
.al-struck div { display: flex; gap: 10px; justify-content: space-between; font-size: 12px; margin-top: 4px; }
.al-struck s { color: #e07a70; } .al-struck span { color: var(--text-3); flex: none; max-width: 40%; text-align: right; }
.al-meta { margin-top: 12px; font: 10.5px var(--mono, monospace); color: var(--text-3); }
.al-empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; border: 1px dashed var(--border); border-radius: 10px; }
@media (max-width: 1100px) { .al-row summary { grid-template-columns: 110px 1fr 140px; } .al-who, .al-case { display: none; } }
.rv-more { display: block; width: calc(100% - 16px); margin: 8px; padding: 9px; border-radius: 8px; border: 1px dashed var(--border);
  background: transparent; color: var(--text-2); font: 11px var(--mono, monospace); letter-spacing: .04em; cursor: pointer; }
.rv-more:hover { color: var(--gold-bright, #e2c47e); border-color: var(--border-gold, rgba(201,169,98,.35)); }
.ui-more { display: block; width: 100%; margin: 8px 0; padding: 9px; border-radius: 8px; border: 1px dashed var(--border);
  background: transparent; color: var(--text-2); font: 11px var(--mono, monospace); letter-spacing: .04em; cursor: pointer; }
.ui-more:hover { color: var(--gold-bright, #e2c47e); border-color: var(--border-gold, rgba(201,169,98,.35)); }

/* ---------- a document brought in as processed data (viewer.js) ---------- */
.viewer-earlier { margin: 0 22px 10px; padding: 9px 13px; border-radius: var(--r-sm);
  border: 1px solid rgba(201,169,98,.3); background: rgba(201,169,98,.05); font-size: 12px; line-height: 1.55; color: var(--text-2); }
.viewer-earlier .ve-head { font-weight: 600; color: var(--gold, #c9a962); }
.viewer-earlier .ve-head span { font-weight: 400; color: var(--text-3); margin-left: 8px; font-family: var(--mono); font-size: 10px; }
.viewer-earlier .ve-row { margin-top: 3px; }
.viewer-earlier .ve-row b { color: var(--text-1, var(--text)); font-weight: 500; }
.viewer-earlier .ve-notes { font-style: italic; }
.viewer-earlier .ve-quiet { color: var(--text-3); font-size: 11px; }
.viewer-earlier .ve-ok { color: var(--green, #6fbf8a); }
.viewer-earlier .ve-bad { color: var(--red, #e06c6c); font-weight: 600; }

/* ---------- page images of a processed document (viewer.js) ---------- */
.viewer-pages { margin: 0 22px 10px; border: 1px solid var(--border); border-radius: var(--r-sm); background: rgba(255,255,255,.02); }
.viewer-pages .vp-bar { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); }
.viewer-pages .vp-bar b { color: var(--text-1, var(--text)); font-weight: 600; }
.viewer-pages .vp-bar > span:first-of-type { color: var(--text-3); flex: 1; }
.viewer-pages .vp-bar .btn { padding: 2px 10px; min-width: 0; }
.viewer-pages .vp-at { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.viewer-pages .vp-page { max-height: 62vh; overflow: auto; padding: 10px; background: #e9e7e1; text-align: center; }
.viewer-pages .vp-canvas { max-width: 100%; height: auto; box-shadow: 0 2px 10px rgba(0,0,0,.25); background: #fff; }
.viewer-pages .vp-pdf { width: 100%; height: 60vh; border: 0; background: #fff; }
.viewer-pages .vp-wait { padding: 30px; color: #555; font-size: 12px; }
.viewer-pages .vp-note { margin-top: 6px; font-size: 11px; color: #6b5420; }

/* ---------- a page a person reads (viewer.js) ---------- */
.viewer-reading { margin: 0 22px 10px; padding: 10px 13px; border-radius: var(--r-sm);
  border: 1px solid rgba(111,191,138,.35); background: rgba(111,191,138,.05); font-size: 12px; color: var(--text-2); }
.viewer-reading .vr-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-1, var(--text)); font-weight: 500; }
.viewer-reading .vr-head span { color: var(--text-2); font-weight: 400; }
.viewer-reading .vr-head .btn { margin-left: auto; padding: 2px 10px; }
.viewer-reading .vr-text { margin-top: 7px; white-space: pre-wrap; font-size: 13px; line-height: 1.55; color: var(--text-1, var(--text)); }
.viewer-reading .vr-quiet { margin-top: 5px; font-size: 11px; color: var(--text-3); }
.viewer-reading .vr-input { width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: #0A0D11;
  border: 1px solid var(--border); color: var(--text-1, var(--text)); font: 13px/1.5 var(--sans, inherit); resize: vertical; }
.viewer-reading .vr-actions { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.viewer-reading .vr-attempt { margin-top: 8px; font-size: 11px; color: var(--text-3); }
.viewer-reading .vr-attempt pre { white-space: pre-wrap; font: 11px/1.45 var(--mono); color: var(--text-3); margin: 4px 0 8px; max-height: 160px; overflow: auto; }

/* ---------- The safe copy (js/autosave.js) ---------- */
.save-state {
  height: 30px; padding: 0 12px; margin-right: 6px; border-radius: 9px;
  font: 500 12px/1 var(--sans); letter-spacing: .01em; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  white-space: nowrap; transition: all .18s;
}
.save-state:hover { border-color: var(--border-bright); color: var(--text); }
.save-state.saved { color: var(--green); }
.save-state.dirty { color: var(--gold-bright); border-color: var(--border-gold); }
.save-state.saving { color: var(--text-2); }
.save-state.failed { color: var(--red); border-color: rgba(224,122,112,.4); }
.wlx-restore {
  position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center;
  background: rgba(5,6,10,.92); color: var(--text); font: 500 16px/1.5 var(--sans);
  padding: 24px; text-align: center;
}

/* The handling policy, at the top of the case files page. */
.policy-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 6px;
  margin: 0 0 16px; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 11.5px; color: var(--text-2);
}
.policy-strip .ps-title {
  display: inline-flex; align-items: center; gap: 7px; margin-right: 2px;
  font: 600 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold);
}
.policy-strip .ps-title svg { width: 14px; height: 14px; }
.policy-strip .ps-item { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; white-space: nowrap; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.policy-strip .ps-item::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.policy-strip .ps-item.on::before { background: var(--green); }
.policy-strip .ps-item.manual::before { background: var(--amber); }

/* Download links for a production (js/production.js) */
.pr-link-lead { font-size: 13.5px; line-height: 1.65; color: var(--text-2); margin: 0 0 14px; }
.pr-link-l { display: block; font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin: 12px 0 6px; }
.pr-link-row { display: flex; gap: 8px; }
.pr-link-row input { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--border-bright); background: var(--surface-2); color: var(--text); font: 12.5px/1.3 var(--mono); }
.pr-link-row input.pr-pass { font-size: 18px; letter-spacing: .2em; color: var(--gold-bright); }
.pr-link-note { font-size: 12px; color: var(--text-3); margin-top: 14px; line-height: 1.6; }
.pr-shares { width: 100%; border-collapse: collapse; font-size: 13px; }
.pr-shares th, .pr-shares td { text-align: left; padding: 9px 8px; border-top: 1px solid var(--border); vertical-align: top; }
.pr-shares th { font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.pr-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- AI reading (js/aireadview.js) ---------- */
.rv-airead { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 12.5px; color: var(--text-2); }
.rv-airead .ar-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ar-title { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.ar-sub { font-size: 11px; color: var(--text-3); }
.rv-airead .ar-one { margin-left: auto; height: 26px; font-size: 11.5px; }
.ar-class { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin-bottom: 6px; }
.ar-chip { padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: 11.5px; color: var(--text); white-space: nowrap; }
.ar-chip.rel-yes { border-color: var(--border-gold); color: var(--gold-bright); }
.ar-chip.rel-no { color: var(--text-3); }
.ar-why { color: var(--text-2); }
.ar-q { color: var(--text); font-style: italic; }
.ar-note { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }
.ar-list { margin-top: 8px; }
.ar-lt { font: 600 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 5px; }
.ar-li { padding: 3px 0; line-height: 1.5; }
.ar-li b { color: var(--text); font-weight: 600; }
.ar-lead { font-size: 13.5px; line-height: 1.65; color: var(--text-2); margin: 0 0 12px; }
.ar-engine { font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ar-grid > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12.5px; color: var(--text-2); }
.ar-grid b { color: var(--text); font-size: 15px; }
.ar-now { font: 12px/1.5 var(--mono); color: var(--text-2); margin-bottom: 10px; }
.ar-err { color: var(--red); }
.ar-actions { display: flex; gap: 8px; }
.ar-empty { font-size: 12.5px; color: var(--text-3); padding: 6px 0; }
.ar-ctr { padding: 12px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.ar-ctr.st-dismissed { opacity: .55; }
.ar-ctr-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ar-ctr-top b { color: var(--text); }
.ar-ref { font: 11px/1 var(--mono); color: var(--gold); }
.ar-state { margin-left: auto; font-size: 11px; color: var(--text-3); }
.ar-ctr.st-confirmed .ar-state { color: var(--gold-bright); }
.ar-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 760px) { .ar-pair { grid-template-columns: 1fr; } }
.ar-side { padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 5px; }
.ar-doc { font: 11px/1.3 var(--mono); color: var(--gold); cursor: pointer; }
.ar-doc:hover { text-decoration: underline; }
.ar-acts { display: flex; gap: 6px; margin-top: 8px; }
.ar-acts .btn { height: 26px; font-size: 11.5px; }

/* ---- The demonstration case and its tour (js/democase.js, js/demotour.js) ---- */
.fr-demo { margin-top: 10px; font: 12.5px/1.5 var(--sans, sans-serif); color: var(--text-3, #8a877b); }
.fr-demo button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--gold-bright, #e2c47e);
  font: inherit; text-decoration: underline; }
.wt { position: fixed; inset: 0; z-index: 12000; pointer-events: none; }
.wt-ring { position: fixed; border-radius: 10px; border: 2px solid var(--gold-bright, #e2c47e);
  box-shadow: 0 0 0 9999px rgba(6, 8, 12, .55); transition: top .25s, left .25s, width .25s, height .25s; }
.wt-ring.none { top: 50% !important; left: 50% !important; width: 0 !important; height: 0 !important; border: 0; }
.wt-card { position: fixed; width: min(380px, calc(100vw - 24px)); pointer-events: auto;
  background: #11131b; color: var(--text, #ece9e1); border: 1px solid var(--border-gold, rgba(201,169,98,.28));
  border-radius: 12px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.45); transition: top .25s, left .25s; }
.wt-step { font: 600 11px/1.4 var(--mono, monospace); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-bright, #e2c47e); }
.wt-title { margin: 6px 0 6px; font: 600 17px/1.3 var(--serif, Georgia, serif); }
.wt-text { margin: 0 0 14px; font: 13.5px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); }
.wt-foot { display: flex; align-items: center; gap: 8px; }
.wt-sp { flex: 1; }
.wt-end { background: none; border: 0; padding: 0; cursor: pointer; font: 12.5px var(--sans, sans-serif);
  color: var(--text-3, #8a877b); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .wt-ring, .wt-card { transition: none; } }

/* ---- A recording in the viewer (js/speech.js) ---- */
.viewer-media { margin: 0 0 12px; padding: 12px 14px; border: 1px solid var(--border-bright, rgba(255,255,255,.12)); border-radius: 10px; background: var(--surface-2, rgba(255,255,255,.04)); }
.vm-line { font: 12.5px/1.55 var(--sans, sans-serif); color: var(--text-2, #a9a698); margin-bottom: 10px; }
.vm-player { width: 100%; max-height: 360px; display: block; }
.vm-actions { margin-top: 10px; }
.vm-quiet { font: 12px var(--sans, sans-serif); color: var(--text-3, #6c6a5f); }

/* ---- More hits from the server (js/searchview.js) ---- */
.sr-more { margin: 14px 0 6px; text-align: center; }

/* ---- Hits found in a translation (js/search.js) ---- */
.sr-via, .sr-via-tag { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--cyan); }
.sr-via-tag { border: 1px solid var(--cyan-soft); border-radius: 4px; padding: 0 5px; }
