/* ═══════════════════════════════════════════
   TOKENS
═══════════════════════════════════════════ */
:root {
  --bg0:        #03050a;
  --bg1:        #0b0e15;
  --bg2:        #10141f;
  --text:       #eef1fb;
  --muted:      #b3b9d4;
  --purple:     #9c54d6;
  --purple-dim: rgba(156,84,214,0.18);
  --green:      #8eb658;
  --green-dim:  rgba(142,182,88,0.15);
  --amber:      #d6a030;
  --amber-dim:  rgba(214,160,48,0.14);
  --red:        #d65454;
  --red-dim:    rgba(214,84,84,0.14);
  --bar:        rgba(243,247,255,0.95);
  --edge:       rgba(255,255,255,0.07);
  --r:          10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

/* ═══════════════════════════════════════════
   A — BODY
═══════════════════════════════════════════ */
.App-Ax {
  font-family: "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #020307, #070913, #04060a);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   B — SHELL
═══════════════════════════════════════════ */
.Shell-Bx {
  position: relative;
  width: 100%;
  height: 100vh;
  max-width: 100%;
  padding: 10px 10px 56px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  border: 1px solid rgba(160,165,178,0.42);
  border-radius: 7px;
}

/* ═══════════════════════════════════════════
   C — HERO
═══════════════════════════════════════════ */
.Hero-Cx {
  text-align: center;
  padding: 10px 8px 4px;
  display: grid;
  gap: 4px;
  justify-items: center;
}

.Logo-Do  { height: 32px; }
.AuxFull-Do {
  height: 64px;
  max-width: 260px;
  object-fit: contain;
  justify-self: center;
  filter: brightness(1.18) contrast(1.08) drop-shadow(0 0 5px rgba(156,84,214,0.22));
}
.AuxFlat-Do {
  height: 26px;
  max-width: 150px;
  object-fit: contain;
  filter: brightness(1.16) contrast(1.06) drop-shadow(0 0 4px rgba(156,84,214,0.18));
}
.Subtitle-Do {
  font-size: 10px;
  letter-spacing: .32em;
  color: #7c84b0;
}

/* ═══════════════════════════════════════════
   C — CONNECTION
═══════════════════════════════════════════ */
.Connection-Cx {
  padding: 6px 8px;
  display: grid;
  gap: 4px;
}

.Connection-Cx.connected {
  padding: 2px 8px;
}

.Connection-Cx.connected .Row-Dx {
  display: none;
}

.Connection-Cx.connected .StatusRow-Dx {
  min-height: 18px;
}

/* D — ROW */
.Row-Dx {
  display: grid;
  grid-template-columns: 1fr 70px 32px;
  gap: 5px;
  align-items: end;
}

/* D — HOST / PORT */
.Host-Dx,
.Port-Dx {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.Label-Eo {
  font-size: 9px;
  letter-spacing: .15em;
  color: #7c84b0;
}

.Input-Eo {
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid var(--edge);
  background: var(--bg2);
  color: var(--text);
  font-size: 12px;
}

.Save-Do {
  height: 26px;
  border-radius: 5px;
  border: 1px solid var(--edge);
  background: var(--purple-dim);
  color: var(--purple);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}
.Save-Do:hover { background: rgba(156,84,214,0.32); }

/* O — STATUS */
/* D — STATUS ROW */
.StatusRow-Dx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.Status-Do {
  font-size: 9px;
  color: var(--muted);
  flex: 1;
}
.Ticker-Dx {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--green);
  mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
}
.TickerTrack-Ex {
  display: inline-block;
  white-space: nowrap;
  min-width: 100%;
  font-size: 10px;
  letter-spacing: .09em;
  color: var(--green);
  text-shadow: 0 0 5px rgba(142,182,88,0.34);
  animation: ticker-slide 36s linear infinite, ticker-flicker 3.7s steps(9,end) infinite;
}
.TickerTrack-Ex.bad {
  color: var(--red);
  text-shadow: 0 0 5px rgba(214,84,84,0.28);
}
@keyframes ticker-slide {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
@keyframes ticker-flicker {
  0%, 19%, 23%, 41%, 46%, 73%, 100% { opacity: .9; filter: brightness(1); }
  20%, 44%, 74% { opacity: .72; filter: brightness(.82); }
  21%, 45%, 76% { opacity: .96; filter: brightness(1.15); }
}
.Refresh-Eo {
  font-size: 14px;
  line-height: 1;
  padding: 1px 5px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.Refresh-Eo:hover { color: var(--green); background: var(--green-dim); }
.Refresh-Eo.spinning { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── UPDATE FLASH ── */
@keyframes badge-pop {
  0%   { transform: scale(1);    background: radial-gradient(circle,#c387ff,#672a96); }
  40%  { transform: scale(1.35); background: radial-gradient(circle,#fff,#9c54d6); }
  100% { transform: scale(1);    background: radial-gradient(circle,#c387ff,#672a96); }
}
@keyframes bar-flash {
  0%   { opacity: 0.82; }
  50%  { opacity: 1; filter: brightness(1.8); }
  100% { opacity: 0.82; filter: brightness(1); }
}
.badge-updated {
  animation: badge-pop 0.4s ease-out forwards;
}
.bars-updated .monitor-segment.on {
  animation: bar-flash 0.5s ease-out forwards;
}

.Name-Eo {
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.AiRef-Eo {
  font-size: 9px;
  letter-spacing: .08em;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  text-align: right;
  text-decoration: underline;
  text-decoration-color: rgba(179,185,212,0.3);
  text-underline-offset: 2px;
  transition: color 0.15s;
  align-self: end;
}
.AiRef-Eo:hover { color: var(--purple); text-decoration-color: var(--purple); }

/* ═══════════════════════════════════════════
   C — MONITOR
═══════════════════════════════════════════ */
.Monitor-Cx {
  position: relative;
  overflow: hidden;
  height: 132px;
  padding: 0;
  border-radius: 0;
  border: 1px solid #555;
  background: #000;
  box-shadow:
    inset 0 14px 22px rgba(255,255,255,0.025),
    inset 0 -12px 16px rgba(0,0,0,0.9);
}

/* D — HEAD */
.Head-Dx {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}

.Monitor-Cx .Head-Dx {
  position: absolute;
  inset: 6px 12px auto 12px;
  z-index: 3;
  letter-spacing: .32em;
  color: #7c84b0;
  text-transform: uppercase;
  pointer-events: none;
}

.Monitor-Cx .Label-Eo {
  font-size: 10px;
  letter-spacing: .34em;
  color: #7c84b0;
  text-shadow: 0 0 8px rgba(0,0,0,0.7);
}

/* D — INDICATOR */
.Indicator-Dx {
  display: flex;
  align-items: center;
  gap: 6px;
}

.Dot-Eo {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f8ffd5 0%, #b6ff84 42%, #62d85e 76%, #1d6b22 100%);
  box-shadow:
    0 0 0 1px rgba(9, 58, 16, 0.72),
    0 0 8px rgba(170,255,96,0.65),
    0 0 16px rgba(94,216,122,0.36);
}
.Dot-Eo.sending {
  background: radial-gradient(circle at 40% 35%, #fff4c8 0%, #ffd66e 38%, #d6a030 72%, #7a4a09 100%);
  box-shadow:
    0 0 0 1px rgba(122,74,9,0.72),
    0 0 8px rgba(255,214,110,0.65),
    0 0 16px rgba(214,160,48,0.45);
  animation: pulse 0.6s ease-in-out infinite alternate;
}

.State-Eo { font-size: 10px; letter-spacing: .14em; }
.State-Eo.sending { color: var(--amber); }

@keyframes pulse { to { opacity: 0.4; } }

/* D — BARS */
.Bars-Dx {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 104px;
  display: flex;
  gap: 2px;
  align-items: flex-end;
  z-index: 1;
}

/* individual stacked columns built by JS */
.monitor-bar-el {
  flex: 1;
  height: 104px;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  opacity: 0.9;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.monitor-segment {
  width: 100%;
  height: 6px;
  border-radius: 0;
  background: #07030b;
  opacity: 0.18;
  box-shadow: none;
  transition: opacity 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.monitor-segment.on { opacity: 1; }
.monitor-bar-el .monitor-segment:nth-child(1).on {
  background: linear-gradient(180deg, #7730a8 0%, #672899 55%, #4f1d82 100%);
}
.monitor-bar-el .monitor-segment:nth-child(2).on {
  background: linear-gradient(180deg, #873fb8 0%, #7430a8 55%, #5a238e 100%);
}
.monitor-bar-el .monitor-segment:nth-child(3).on,
.monitor-bar-el .monitor-segment:nth-child(4).on,
.monitor-bar-el .monitor-segment:nth-child(5).on,
.monitor-bar-el .monitor-segment:nth-child(6).on {
  background: linear-gradient(180deg, #c5a2d6 0%, #a979c9 58%, #8e59ba 100%);
}
.monitor-bar-el .monitor-segment:nth-child(7).on,
.monitor-bar-el .monitor-segment:nth-child(8).on {
  background: linear-gradient(180deg, #f6ecf8 0%, #eee2f1 55%, #d9c7e4 100%);
}
.monitor-bar-el .monitor-segment:nth-child(9).on,
.monitor-bar-el .monitor-segment:nth-child(10).on {
  background: linear-gradient(180deg, #ffffff 0%, #f7edf8 55%, #ead4ef 100%);
}
.monitor-bar-el .monitor-segment:nth-child(11).on,
.monitor-bar-el .monitor-segment:nth-child(12).on,
.monitor-bar-el .monitor-segment:nth-child(13).on {
  background: linear-gradient(180deg, #f05bd2 0%, #e658c7 55%, #d948b8 100%);
}

/* ═══════════════════════════════════════════
   C — TRANSPORT
═══════════════════════════════════════════ */
.Transport-Cx {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  height: 60px;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--edge);
  background: #05070c;
}

.Transport-Cx button {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  transition: background 0.15s;
}
.Transport-Cx button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.Transport-Cx button:hover     { background: rgba(255,255,255,0.06); }
.Eject-Do:hover                { background: rgba(214,84,84,0.18) !important; }

/* ═══════════════════════════════════════════
   C — CHANGES
═══════════════════════════════════════════ */
.Changes-Cx {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(120,128,150,0.22);
  background: linear-gradient(180deg, rgba(12,15,24,0.92), rgba(5,7,12,0.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -12px 24px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.ChangesScroll-Dx {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

/* D — TOP */
.Top-Dx {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.Title-Eo {
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--muted);
}

.Badge-Eo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, #c387ff, #672a96);
  font-size: 11px;
  font-weight: 700;
}

.Empty-Do {
  text-align: center;
  color: #5a6080;
  padding: 12px 0;
  font-size: 12px;
}

/* D — READY */
.Ready-Dx {
  display: grid;
  gap: 4px;
}

/* D — INCOMPLETE */
.Incomplete-Dx {
  display: grid;
  gap: 4px;
}

/* E — TOGGLE / HEADER rows */
.Toggle-Ex,
.Header-Ex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(120,128,150,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
  transition: background 0.15s;
}
.Toggle-Ex:hover,
.Header-Ex:hover { background: rgba(255,255,255,0.06); }

/* F — labels inside toggle/header */
.Toggle-Ex .Label-Fo {
  font-size: 9px;
  letter-spacing: .2em;
  font-weight: 700;
  color: var(--green);
}
.Header-Ex .Label-Fo {
  font-size: 9px;
  letter-spacing: .2em;
  font-weight: 700;
  color: var(--amber);
}
.Count-Fo {
  font-size: 10px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 1px 7px;
}

/* D — CARDS containers */
.Cards-Dx {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
}
.Cards-Dx.collapsed { display: none; }
.Cards-Dx.condensed {
  gap: 4px;
}

/* O — SEND between sections */
.Send-Do {
  width: 100%;
  border: none;
  background: transparent;
  padding: 2px 0;
  cursor: pointer;
}
.Send-Do img {
  width: 100%;
  display: block;
  height: 40px;
  object-fit: contain;
}

/* ═══════════════════════════════════════════
   CARDS — built by JS, use simple selectors
   Depth: card=C, internals=D/E
═══════════════════════════════════════════ */
.card {
  width: 100%;
  min-width: 0;
  border-radius: 7px;
  border: 1px solid rgba(120,128,150,0.18);
  background: linear-gradient(180deg, rgba(17,21,32,0.94), rgba(10,12,20,0.96));
  padding: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}
.card.selected  { border-color: var(--purple); background: rgba(156,84,214,0.08); }
.card:hover     { border-color: rgba(255,255,255,0.14); }

/* ready card — compact row */
.card-ready {
  display: grid;
  gap: 6px;
  padding: 6px 8px;
}
.card-ready-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.card-ready .title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  font-size: 11px;
  line-height: 1.3;
  color: var(--text);
}
.card-ready .pill {
  align-self: center;
}
.ready-details {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}
.ready-file {
  font-size: 11px;
  color: var(--text);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 6px 8px;
  overflow-wrap: anywhere;
}

/* unready card — expanded grid */
.card-ready.condensed {
  padding: 5px 7px;
}
.card-ready.condensed .card-ready-head {
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 6px;
}
.card-ready.condensed .file-icon {
  width: 16px;
  height: 20px;
}
.card-ready.condensed .title {
  -webkit-line-clamp: 1;
  font-size: 10px;
  line-height: 1.2;
}
.card-ready.condensed .card-subline {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-ready.condensed .pill {
  font-size: 8px;
  padding: 1px 6px;
}

.card-unready {
  display: grid;
  gap: 8px;
  padding: 9px;
}

.card-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}
.card-copy { min-width: 0; display: grid; gap: 3px; }
.card-title  {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-subline {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.card-meta   { font-size: 9px; color: var(--muted); margin-top: 2px; text-transform: uppercase; letter-spacing: .1em; }
.file-icon {
  width: 18px;
  height: 24px;
  object-fit: contain;
  display: block;
  align-self: start;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.45));
}

.pill {
  max-width: 100%;
  font-size: 9px; letter-spacing: .1em;
  padding: 2px 7px; border-radius: 20px;
  border: 1px solid rgba(156,84,214,0.4);
  color: var(--purple); background: var(--purple-dim);
  white-space: nowrap; flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill.unassigned { border-color: rgba(214,160,48,0.4); color: var(--amber); background: var(--amber-dim); }

.flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; padding: 2px 7px; border-radius: 10px;
  border: 1px solid rgba(214,84,84,0.4);
  color: var(--red); background: var(--red-dim); letter-spacing: .08em;
  white-space: nowrap; flex-shrink: 0;
}

/* missing button */
.missing {
  display: flex; align-items: center; gap: 6px;
  background: var(--red-dim);
  border: 1px solid rgba(214,84,84,0.35);
  border-radius: 6px; padding: 5px 8px;
  cursor: pointer; width: 100%; text-align: left;
  color: var(--red); font-size: 10px; letter-spacing: .1em;
  transition: background 0.15s;
}
.missing:hover { background: rgba(214,84,84,0.25); }
.missing .icon { font-size: 14px; }
.missing-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.missing-tag {
  font-size: 9px; padding: 1px 5px; border-radius: 10px;
  border: 1px solid rgba(214,84,84,0.4);
  color: var(--red); text-transform: uppercase; letter-spacing: .1em;
}

/* phrase context */
.phrase {
  width: 100%;
  min-width: 0;
  background: rgba(214,160,48,0.07);
  border: 1px solid rgba(214,160,48,0.2);
  border-radius: 6px; padding: 7px 9px;
  font-size: 11px; color: #d4c08a; line-height: 1.5;
  overflow-wrap: anywhere;
}
.phrase .label {
  font-size: 9px; letter-spacing: .15em; color: var(--amber);
  margin-bottom: 4px; display: block;
}
.phrase-pair { display: grid; gap: 4px; margin-top: 4px; }
.phrase-item {
  background: rgba(255,255,255,0.04); border-radius: 4px;
  padding: 4px 7px; font-size: 10px; color: var(--muted);
}
.phrase-item strong { color: var(--text); }

/* filepath section */
.section-label {
  font-size: 9px; letter-spacing: .15em; color: var(--muted); margin-bottom: 3px;
}
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  font-size: 10px; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--edge); background: rgba(255,255,255,0.04);
  color: var(--muted); cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}
.chip.active  { border-color: var(--green); color: var(--green); background: var(--green-dim); }
.chip:hover   { border-color: rgba(255,255,255,0.2); color: var(--text); }

/* file autocomplete */
.autocomplete { position: relative; }
.file-input {
  width: 100%; padding: 4px 7px; border-radius: 5px;
  border: 1px solid var(--edge); background: rgba(255,255,255,0.03);
  color: var(--muted); font-size: 11px;
}
.file-input::placeholder { color: #40465e; }
.file-input:focus { outline: none; border-color: rgba(156,84,214,0.4); color: var(--text); }

.ac-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg1);
  border: 1px solid rgba(156,84,214,0.3);
  border-radius: 6px; max-height: 140px; overflow-y: auto;
  z-index: 50; display: none;
}
.ac-list.open { display: block; }
.ac-item {
  padding: 5px 9px; font-size: 10px; color: var(--muted);
  cursor: pointer; font-family: "Consolas", monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac-item:hover, .ac-item.focus { background: var(--purple-dim); color: var(--text); }
.ac-item .hi { color: var(--purple); font-weight: 700; }

/* assign controls */
.assign { display: grid; gap: 5px; }
.action-select {
  width: 100%; padding: 4px 6px; border-radius: 5px;
  border: 1px solid rgba(214,160,48,0.3);
  background: var(--bg2); color: var(--text); font-size: 11px;
}
.radio-row { display: flex; gap: 5px; }
.radio {
  flex: 1; padding: 3px 0; border-radius: 5px;
  border: 1px solid var(--edge); background: rgba(255,255,255,0.03);
  color: var(--muted); font-size: 10px; cursor: pointer; transition: background 0.12s;
}
.radio.active { border-color: var(--purple); color: var(--purple); background: var(--purple-dim); }

/* manifest preview */
.preview-label {
  font-size: 9px; letter-spacing: .15em; color: var(--muted); margin-bottom: 2px;
}
.preview {
  width: 100%;
  min-width: 0;
  background: rgba(0,0,0,0.35); border-radius: 6px; padding: 6px 8px;
  font-size: 10px; font-family: "Consolas", "Cascadia Code", monospace;
  color: #9aa8cc; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  max-height: 96px; overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.05); line-height: 1.5;
}

/* ═══════════════════════════════════════════
   B — OVERLAY
═══════════════════════════════════════════ */
.Overlay-Bx {
  position: fixed; inset: 0;
  background: rgba(2,3,8,0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.Overlay-Bx.hidden { display: none !important; }

/* C — MODAL */
.Modal-Cx {
  background: var(--bg1);
  border: 1px solid rgba(156,84,214,0.3);
  border-radius: 12px;
  width: 100%; max-height: 70vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

/* D — HEAD (reused) */
.Modal-Cx .Head-Dx {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--edge);
  font-size: 10px;
  letter-spacing: .22em;
  color: var(--purple);
}

/* E — CLOSE */
.Close-Eo {
  border: none; background: none;
  color: var(--muted); cursor: pointer;
  font-size: 14px; padding: 2px 6px; border-radius: 4px;
}
.Close-Eo:hover { background: rgba(255,255,255,0.07); color: var(--text); }

/* D — BODY (reused) */
.Modal-Cx .Body-Dx {
  padding: 12px 14px;
  overflow-y: auto;
  display: grid;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

/* evidence sentences */
.evidence {
  padding: 5px 8px; border-radius: 5px;
  border-left: 2px solid rgba(156,84,214,0.4);
  background: rgba(255,255,255,0.02);
}
.evidence .hl {
  color: var(--green); font-weight: 600;
  background: var(--green-dim); border-radius: 3px; padding: 0 3px;
}

/* ai ref modal body items */
.Desc-Eo   { font-size: 11px; color: var(--muted); }
.Option-Eo {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text); cursor: pointer;
}
.Option-Eo input { accent-color: var(--purple); cursor: pointer; }
.Copy-Eo {
  width: 100%; padding: 8px; border-radius: 6px;
  border: 1px solid rgba(156,84,214,0.4);
  background: var(--purple-dim); color: var(--purple);
  font-size: 12px; letter-spacing: .1em; cursor: pointer;
  transition: background 0.15s;
}
.Copy-Eo:hover { background: rgba(156,84,214,0.32); }
.Confirm-Eo { text-align: center; color: var(--green); font-size: 12px; padding: 4px 0; }

.CardMenu-Bx {
  position: fixed;
  min-width: 170px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 10, 18, 0.98);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 60;
}
.CardMenu-Eo {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11px;
}
.CardMenu-Eo:hover {
  background: rgba(156,84,214,0.18);
}

/* ═══════════════════════════════════════════
   C — FOOTER
═══════════════════════════════════════════ */
.Footer-Cx {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  pointer-events: none;
  z-index: 20;
}
.Banner-Do {
  height: 48px;
  opacity: 0.8;
}

/* ═══════════════════════════════════════════
   SCROLLBAR
═══════════════════════════════════════════ */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(156,84,214,0.3); border-radius: 4px; }