body {
  margin: 0;
  background: #0a0e14;
  color: #d9e6f2;
  font-family: Arial, sans-serif;
}

.ed-shell {
  padding: 28px;
}

.ed-header {
  display: flex;
  align-items: center;
  gap: 28px;

  padding: 28px;

  background: linear-gradient(
    90deg,
    rgba(255, 180, 0, 0.08),
    rgba(0, 229, 255, 0.04),
    transparent
  );

  border: 1px solid rgba(255, 180, 0, 0.2);
}

.archive-logo {
  width: 90px;
  height: 90px;

  flex-shrink: 0;
}

.ed-header-content {
  flex: 1;
}

.ed-kicker {
  color: #ffb400;
  letter-spacing: 3px;
  font-size: 12px;
}

h1 {
  margin: 8px 0;
  color: #f5f0df;
}

.ed-panel,
.ed-list,
.ed-output {
  border: 1px solid #263545;
  background: #0f151d;
  padding: 18px;
}

button {
  background: #101820;
  border: 1px solid #ffb400;
  color: #ffb400;
  padding: 10px 16px;
  cursor: pointer;
  margin-left: 12px;
}

button:hover {
  background: #302715;
}

.ed-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
}

.conv-item {
  border: 1px solid #263545;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}

.conv-item:hover {
  border-color: #00e5ff;
}

.ed-placeholder {
  opacity: 0.5;
}

.ed-dossier h2 {
  color: #ffb400;
}

.ed-message {
  border-left: 3px solid #263545;
  padding: 12px;
  margin: 14px 0;
  background: #0b1118;
}

.ed-role-user {
  border-left-color: #ffb400;
}

.ed-role-assistant {
  border-left-color: #00e5ff;
}

.ed-message-head {
  display: flex;
  justify-content: space-between;
  color: #9fb3c8;
  font-size: 13px;
  margin-bottom: 8px;
}

pre {
  background: #05080c;
  border: 1px solid #263545;
  padding: 12px;
  overflow-x: auto;
  color: #d7f7ff;
}

.ed-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.ed-stat {
  border: 1px solid #263545;
  background: #0b1118;
  padding: 14px;
}

.ed-stat span {
  display: block;
  color: #9fb3c8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.ed-stat strong {
  color: #ffb400;
  font-size: 18px;
}

.ed-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;

  display: flex;
  align-items: center;
  gap: 12px;

  margin: 18px 0 22px;
  padding: 12px;

  background: rgba(10, 14, 20, 0.96);
  border: 1px solid #263545;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}

#searchBox {
  flex: 1;
  background: #05080c;
  border: 1px solid #263545;
  color: #d9e6f2;
  padding: 12px 14px;
  font-size: 14px;
}

#searchBox:focus {
  outline: none;
  border-color: #00e5ff;
}

#searchCount {
  min-width: 100px;
  color: #ffb400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

mark {
  background: #ffb400;
  color: #05080c;
  padding: 1px 3px;
  border-radius: 2px;
}

* {
  box-sizing: border-box;
}

.ed-grid {
  grid-template-columns: 340px minmax(0, 1fr);
}

.ed-output,
.ed-dossier,
.ed-message,
.ed-message-body,
.ed-message-raw {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre,
code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-x: auto;
}

.ed-toolbar button {
  margin-left: 0;
  padding: 10px 12px;
}

.ed-search-hit {
  background: #ffb400;
  color: #05080c;
  padding: 1px 3px;
  border-radius: 2px;
}

.ed-current-hit {
  background: #00e5ff;
  color: #05080c;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.75);
}

#prevMatchBtn,
#nextMatchBtn {
  min-width: 70px;
  margin-left: 0;
}

@media print {
  body {
    background: #ffffff;
    color: #000000;
  }

  .ed-header,
  .ed-panel,
  .ed-list,
  .ed-toolbar {
    display: none !important;
  }

  .ed-grid {
    display: block;
  }

  .ed-output {
    border: none;
    background: #ffffff;
    color: #000000;
    padding: 0;
  }

  .ed-dossier {
    color: #000000;
    background: #ffffff;
  }

  .ed-kicker {
    color: #000000;
    letter-spacing: 2px;
  }

  h1,
  h2 {
    color: #000000;
  }

  .ed-stats {
    grid-template-columns: repeat(3, 1fr);
    page-break-inside: avoid;
  }

  .ed-stat {
    border: 1px solid #999;
    background: #ffffff;
  }

  .ed-stat span,
  .ed-stat strong {
    color: #000000;
  }

  .ed-message {
    margin: 18px 0;
    padding: 14px 16px;
    border: 1px solid #999;
    background: #ffffff;
    color: #000000;
    border-left: 3px solid #000000;
    page-break-inside: avoid;
  }

  .ed-message-head {
    color: #000000;
  }

  .ed-role-user {
    border-left: 8px solid #000000;
    background: #f3f3f3;
  }

  .ed-role-assistant {
    border-left: 8px solid #666666;
    background: #ffffff;
  }

  .ed-message-head {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6px;
    margin-bottom: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .ed-role-user .ed-message-head strong::before {
    content: "QUESTION / ";
  }

  .ed-role-assistant .ed-message-head strong::before {
    content: "RESPONSE / ";
  }

  pre,
  code {
    background: #f4f4f4;
    color: #000000;
    border: 1px solid #ccc;
    white-space: pre-wrap;
  }

  mark,
  .ed-search-hit,
  .ed-current-hit {
    background: transparent;
    color: inherit;
    box-shadow: none;
    padding: 0;
  }
}

.role-label {
  margin-left: 14px;
  color: #9fb3c8;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.role-label input {
  margin-left: 6px;
  background: #05080c;
  border: 1px solid #263545;
  color: #d9e6f2;
  padding: 8px 10px;
  width: 120px;
}

#applyRoleNamesBtn {
  margin-left: 10px;
}

.conv-header {
  display: flex;

  gap: 10px;

  align-items: center;
}

.favorite-star {
  color: #ffb400;

  cursor: pointer;

  font-size: 18px;

  user-select: none;
}

.favorite-star:hover {
  transform: scale(1.2);
}

.conv-item.active {
  border-color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  box-shadow: inset 3px 0 0 #00e5ff;
}

.ed-message {
  position: relative;
  margin: 22px 0;
  padding: 18px 18px 18px 22px;
  border: 1px solid #263545;
  border-left-width: 6px;
  background: #0b1118;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.ed-role-user {
  border-left-color: #ffb400;
  background: linear-gradient(90deg, rgba(255, 180, 0, 0.08), #0b1118 28%);
}

.ed-role-assistant {
  border-left-color: #00e5ff;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.07), #0b1118 28%);
}

.ed-role-tool,
.ed-role-system {
  border-left-color: #8b5cf6;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.08), #0b1118 28%);
  opacity: 0.85;
}

.ed-message-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(159, 179, 200, 0.18);
}

.ed-message-head strong {
  font-size: 12px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.ed-role-user .ed-message-head strong {
  color: #ffb400;
}

.ed-role-assistant .ed-message-head strong {
  color: #00e5ff;
}

.ed-role-tool .ed-message-head strong,
.ed-role-system .ed-message-head strong {
  color: #b99cff;
}

.ed-message-body {
  line-height: 1.55;
}

.ed-message::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 18px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(159, 179, 200, 0.25),
    transparent
  );
}

.hide-tools .ed-role-tool,
.hide-tools .ed-role-system {
  display: none !important;
}

@media print {
  .ed-message,
  .ed-role-user,
  .ed-role-assistant,
  .ed-role-tool,
  .ed-role-system {
    background: #ffffff !important;
    color: #000000 !important;
    box-shadow: none !important;
    border: 1px solid #999 !important;
    border-left-width: 8px !important;
  }

  .ed-role-user {
    border-left-color: #000000 !important;
  }

  .ed-role-assistant {
    border-left-color: #666666 !important;
  }

  .ed-role-tool,
  .ed-role-system {
    border-left-color: #999999 !important;
  }

  .ed-message-head {
    color: #000000 !important;
    border-bottom: 1px solid #cccccc !important;
  }

  .ed-message-head strong,
  .ed-message-head span,
  .ed-message-body,
  .ed-message-raw {
    color: #000000 !important;
  }

  .ed-role-user .ed-message-head strong::before {
    content: "QUESTION / ";
  }

  .ed-role-assistant .ed-message-head strong::before {
    content: "RESPONSE / ";
  }

  .ed-role-tool .ed-message-head strong::before,
  .ed-role-system .ed-message-head strong::before {
    content: "SYSTEM / ";
  }
}

.list-section-title {
  margin: 18px 0 10px;
  color: #ffb400;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid #263545;
  padding-bottom: 6px;
}

.selection-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 10px 0 16px;
}

.selection-bar button {
  margin-left: 0;
  padding: 8px 10px;
  font-size: 11px;
}

#selectedCount {
  color: #ffb400;
  font-size: 12px;
  text-transform: uppercase;
}

.conv-select {
  accent-color: #ffb400;
}

.master-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid #263545;
}

.master-toc li {
  margin: 8px 0;
}

@media print {
  .role-label,
  #userRoleName,
  #assistantRoleName,
  #applyRoleNamesBtn {
    display: none !important;
  }
}

.tag-panel {
  border: 1px solid #263545;
  background: #0b1118;
  padding: 14px;
  margin: 18px 0;
}

.tag-row {
  display: flex;
  gap: 10px;
}

#tagInput {
  flex: 1;
  background: linear-gradient(180deg, #c8cfd8, #dfe3e7) !important;
  border: 1px solid #263545;
  color: #d9e6f2;
  padding: 10px 12px;
}

.tag-list {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill,
.item-tags span {
  border: 1px solid #ffb400;
  color: #ffb400;
  background: rgba(255, 180, 0, 0.08);
  padding: 4px 8px;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.remove-tag {
  margin-left: 6px;
  border: none;
  background: transparent;
  color: #ffb400;
  cursor: pointer;
  padding: 0 2px;
}

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.notes-panel {
  margin: 18px 0;

  border: 1px solid #263545;

  background: #0b1118;

  padding: 16px;
}

#missionNote {
  width: 100%;

  min-height: 120px;

  resize: vertical;

  background: linear-gradient(180deg, #c8cfd8, #dfe3e7) !important;

  color: #d9e6f2;

  border: 1px solid #263545;

  padding: 12px;
}

#saveNoteBtn {
  margin-top: 12px;
}

.item-note {
  margin-top: 8px;

  color: #9fb3c8;

  font-size: 11px;

  font-style: italic;
}

.role-filter-hidden {
  display: none !important;
}

.scope-btn.active {
  background: #302715;
  border-color: #00e5ff;
  color: #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.35);
}

.message-avatar {
  width: 32px;
  height: 32px;

  border-radius: 50%;

  object-fit: cover;

  border: 1px solid rgba(255, 180, 0, 0.35);

  margin-right: 10px;
}

.msg-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 180, 0, 0.45);
  background: #05080c;
}

/* UNIT-01 FINAL LAYOUT OVERRIDE */

.ed-stats {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(115px, 1fr)) !important;
  gap: 10px !important;
  align-items: stretch !important;
}

.ed-stat {
  min-height: 68px !important;
  padding: 12px !important;
  display: grid !important;
  grid-template-rows: 32px 1fr !important;
  align-items: end !important;
}

.ed-stat span {
  min-height: 32px !important;
  margin: 0 !important;
  line-height: 1.15 !important;
  display: flex !important;
  align-items: flex-start !important;
}

.ed-stat strong {
  align-self: end !important;
  line-height: 1 !important;
}

.ed-shell,
.ed-grid,
.ed-output,
.ed-panel {
  max-width: 100%;
  box-sizing: border-box;
}

.ed-grid {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
}

.ed-output {
  min-width: 0;
  overflow-x: hidden;
}

.ed-dossier {
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .ed-grid {
    grid-template-columns: 1fr;
  }

  .ed-list {
    max-height: none;
  }

  .role-label {
    margin-bottom: 8px;
  }
}

.ed-panel {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px 14px !important;
}

.role-label {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  white-space: nowrap !important;
}

.role-label input[type="checkbox"] {
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

.avatar-toggle {
  gap: 6px !important;
}

@media print {
  #jsonInput,
  #loadBtn,
  #conversationSearch,
  .selection-bar,
  .role-label,
  #applyRoleNamesBtn,
  #identityPreset,
  #showAvatars {
    display: none !important;
  }
}

@media print {
  .ed-shell,
  .ed-grid,
  .ed-output,
  .ed-dossier,
  .master-dossier,
  .master-section {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
  }

  .ed-output::before,
  .ed-output::after,
  .ed-dossier::before,
  .ed-dossier::after,
  .master-dossier::before,
  .master-dossier::after {
    display: none !important;
    content: none !important;
  }
}

@media print {
  .master-dossier > header,
  .master-section > header {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
  }
}

/* UNIT-01 PRINT FINAL OVERRIDE */

@media print {
  .ed-panel {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    overflow: hidden !important;
  }
}

.ed-role-user .ed-message-head strong::before {
  content: "QUESTION / ";
}

.ed-role-assistant .ed-message-head strong::before {
  content: "RESPONSE / ";
}

.ed-role-tool .ed-message-head strong::before,
.ed-role-system .ed-message-head strong::before {
  content: "SYSTEM / ";
}

@media print {
  .ed-message::before {
    content: attr(data-print-label) " / ";
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
  }

  .ed-message-head strong::before {
    content: none !important;
  }
}

/* =========================================================
   Archive Commander Standalone Settings + Themes
========================================================= */
.ed-header {
  position: relative;
}
.ed-app-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.ed-app-actions button {
  margin-left: 0;
  white-space: nowrap;
}
.ed-load-panel {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin: 22px 0;
}
.ed-panel-kicker {
  color: #ffb400;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 800;
  margin-bottom: 8px;
}
.ed-load-panel p {
  margin: 0;
  color: #b9cce0;
  line-height: 1.55;
}
.ed-load-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.ed-load-controls button {
  margin-left: 0;
}
.ed-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
}
.ed-modal.is-open {
  display: block;
}
.ed-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(7px);
}
.ed-modal-panel {
  position: relative;
  width: min(920px, 92vw);
  max-height: 88vh;
  overflow: auto;
  margin: 6vh auto;
  padding: 32px;
  background: linear-gradient(180deg, #0b1118, #05080d);
  border: 1px solid rgba(255, 180, 0, 0.55);
  box-shadow:
    0 0 60px rgba(0, 0, 0, 0.75),
    0 0 28px rgba(255, 180, 0, 0.08);
  color: #e8eef5;
}
.ed-modal-panel h2 {
  margin: 8px 0 24px;
  color: #ffb400;
  letter-spacing: 1.4px;
}
.ed-modal-close {
  position: absolute;
  right: 18px;
  top: 14px;
  margin: 0;
  border-color: #263545;
  color: #d9e6f2;
  font-size: 22px;
  line-height: 1;
  padding: 6px 12px;
}
.ed-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px;
}
.ed-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #cfe3f2;
  font-size: 13px;
  letter-spacing: 0.6px;
}
.ed-settings-grid label.check {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.ed-settings-grid select,
.ed-settings-grid input[type="text"],
.ed-settings-grid input:not([type]) {
  background: #05080c;
  border: 1px solid #263545;
  color: #d9e6f2;
  padding: 11px 12px;
  min-height: 42px;
}
.ed-settings-grid input[type="file"] {
  background: #05080c;
  border: 1px solid #263545;
  color: #9fb3c8;
  padding: 10px;
}
.ed-settings-grid select:focus,
.ed-settings-grid input:focus {
  outline: none;
  border-color: #00e5ff;
  box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}
.ed-modal-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(159, 179, 200, 0.18);
}
.ed-modal-actions button {
  margin-left: 0;
}
.ed-settings-status {
  color: #00e5ff;
  letter-spacing: 1px;
  font-size: 12px;
  text-transform: uppercase;
}
.ed-info-panel {
  max-width: 720px;
}
.ed-info-panel p,
.ed-info-panel li {
  color: #cfe3f2;
  line-height: 1.65;
}
body[data-theme="dark"] {
  background: #05070b;
  color: #e5edf5;
}
body[data-theme="dark"] .ed-header,
body[data-theme="dark"] .ed-panel,
body[data-theme="dark"] .ed-list,
body[data-theme="dark"] .ed-output,
body[data-theme="dark"] .ed-stat,
body[data-theme="dark"] .conv-item {
  background: #070b12;
  border-color: #223142;
}
body[data-theme="light"] {
  background: #f4f6f8;
  color: #111927;
}
body[data-theme="light"] .ed-header,
body[data-theme="light"] .ed-panel,
body[data-theme="light"] .ed-list,
body[data-theme="light"] .ed-output,
body[data-theme="light"] .ed-stat,
body[data-theme="light"] .conv-item {
  background: #ffffff;
  color: #111927;
  border-color: #ccd6e0;
}
body[data-theme="light"] h1,
body[data-theme="light"] h2,
body[data-theme="light"] .ed-dossier h2 {
  color: #111927;
}
body[data-theme="light"] .ed-message {
  background: #ffffff;
  color: #111927;
  border-color: #ccd6e0;
}
body[data-theme="light"] .ed-message-body,
body[data-theme="light"] .ed-message-raw,
body[data-theme="light"] .ed-output p,
body[data-theme="light"] .ed-list small {
  color: #111927;
}
body[data-theme="light"] input,
body[data-theme="light"] select {
  background: #ffffff !important;
  color: #111927 !important;
  border-color: #ccd6e0 !important;
}
body[data-theme="light"] .ed-modal-panel {
  background: #ffffff;
  color: #111927;
}
body[data-theme="light"] .ed-info-panel p,
body[data-theme="light"] .ed-info-panel li,
body[data-theme="light"] .ed-settings-grid label {
  color: #111927;
}
@media (max-width: 900px) {
  .ed-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .ed-app-actions {
    justify-content: flex-start;
  }
  .ed-load-panel {
    flex-direction: column;
    align-items: flex-start;
  }
  .ed-settings-grid {
    grid-template-columns: 1fr;
  }
  .ed-modal-panel {
    margin: 3vh auto;
    padding: 24px;
  }
}

/* =========================================================
   v1.1 Transcript action alignment
========================================================= */
.transcript-head {
  margin-top: 22px;
}
.transcript-head h2 {
  margin: 0 0 14px;
}
.transcript-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 22px;
}
.transcript-filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.transcript-action-row .scope-btn {
  margin-left: 0;
}
.export-pdf-btn {
  margin-left: auto !important;
  white-space: nowrap;
}
@media (max-width: 760px) {
  .transcript-action-row {
    flex-direction: column;
    align-items: stretch;
  }
  .transcript-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .export-pdf-btn {
    width: 100%;
  }
}

.ed-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 140px;
  height: 36px;

  padding: 0 18px;

  border: 1px solid #ffb400;

  background: transparent;

  color: darkslategray;

  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;

  cursor: pointer;

  transition: all 0.2s ease;
}

.ed-upload-btn:hover {
  background: rgba(255, 180, 0, 0.08);

  box-shadow:
    0 0 10px rgba(255, 180, 0, 0.25),
    inset 0 0 10px rgba(255, 180, 0, 0.08);
}

.ed-upload-btn:active {
  transform: translateY(1px);
}

/* =========================================================
   v1.2: Transcript label de-duplication
   The translated label is rendered by archive.js. Disable legacy
   CSS pseudo-prefixes so labels don't appear as QUESTION / FRAGE.
========================================================= */
.ed-role-user .ed-message-head strong::before,
.ed-role-assistant .ed-message-head strong::before,
.ed-role-tool .ed-message-head strong::before,
.ed-role-system .ed-message-head strong::before,
.ed-message::before {
  content: "" !important;
  display: none !important;
}

@media print {
  .ed-role-user .ed-message-head strong::before,
  .ed-role-assistant .ed-message-head strong::before,
  .ed-role-tool .ed-message-head strong::before,
  .ed-role-system .ed-message-head strong::before,
  .ed-message::before {
    content: "" !important;
    display: none !important;
  }
}

/* =========================================================
   v1.3 Light Theme Refinement
   Clean ink-saver surface, no tactical black blocks on light UI
========================================================= */

body[data-theme="light"] {
  background: #f4f6f8 !important;
  color: #111927 !important;
}

body[data-theme="light"] .ed-shell {
  background: #f4f6f8 !important;
}

body[data-theme="light"] .ed-header,
body[data-theme="light"] .ed-panel,
body[data-theme="light"] .ed-load-panel,
body[data-theme="light"] .ed-list,
body[data-theme="light"] .ed-output,
body[data-theme="light"] .ed-dossier,
body[data-theme="light"] .ed-stat,
body[data-theme="light"] .conv-item,
body[data-theme="light"] .ed-toolbar,
body[data-theme="light"] .ed-tag-panel,
body[data-theme="light"] .ed-notes-panel,
body[data-theme="light"] .transcript-action-row,
body[data-theme="light"] .ed-modal-panel {
  background: #ffffff !important;
  color: #111927 !important;
  border-color: #cbd6e2 !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06) !important;
}

body[data-theme="light"] .tag-panel {
  background: #d6dde5 !important;
}

body[data-theme="light"] .notes-panel {
  background: #d6dde5 !important;
}

body[data-theme="light"] .ed-panel-kicker,
body[data-theme="light"] .ed-kicker,
body[data-theme="light"] .list-section-title,
body[data-theme="light"] .ed-modal-panel h2,
body[data-theme="light"] .ed-notes-panel > label,
body[data-theme="light"] .ed-dossier h2,
body[data-theme="light"] .transcript-head h2 {
  color: #9a6a00 !important;
  -webkit-text-fill-color: #9a6a00 !important;
}

body[data-theme="light"] .ed-load-panel p,
body[data-theme="light"] .ed-output p,
body[data-theme="light"] .ed-message-body,
body[data-theme="light"] .ed-message-raw,
body[data-theme="light"] .ed-message-head,
body[data-theme="light"] .ed-list small,
body[data-theme="light"] .ed-info-panel p,
body[data-theme="light"] .ed-info-panel li,
body[data-theme="light"] .ed-settings-grid label {
  color: #243447 !important;
  -webkit-text-fill-color: #243447 !important;
}

body[data-theme="light"] .ed-stat span,
body[data-theme="light"] .role-label,
body[data-theme="light"] .ed-message-head span,
body[data-theme="light"] #searchCount,
body[data-theme="light"] #selectedCount {
  color: #60758a !important;
  -webkit-text-fill-color: #60758a !important;
}

body[data-theme="light"] .ed-stat strong,
body[data-theme="light"] .favorite-star {
  color: #9a6a00 !important;
  -webkit-text-fill-color: #9a6a00 !important;
}

body[data-theme="light"] input,
body[data-theme="light"] select,
body[data-theme="light"] textarea,
body[data-theme="light"] #searchBox,
body[data-theme="light"] #conversationSearch,
body[data-theme="light"] .ed-settings-grid select,
body[data-theme="light"] .ed-settings-grid input[type="text"],
body[data-theme="light"] .ed-settings-grid input:not([type]),
body[data-theme="light"] .ed-settings-grid input[type="file"] {
  background: #ffffff !important;
  color: #111927 !important;
  border-color: #b8c7d6 !important;
  box-shadow: none !important;
}

body[data-theme="light"] input::placeholder,
body[data-theme="light"] textarea::placeholder {
  color: #7b8ea3 !important;
  opacity: 1 !important;
}

body[data-theme="light"] button,
body[data-theme="light"] .scope-btn,
body[data-theme="light"] .export-pdf-btn {
  background: #ffffff !important;
  color: #805800 !important;
  border-color: #9a6a00 !important;
  box-shadow: none !important;
}

body[data-theme="light"] button:hover,
body[data-theme="light"] .scope-btn:hover,
body[data-theme="light"] .scope-btn.active,
body[data-theme="light"] .export-pdf-btn:hover {
  background: #f1e4c7 !important;
  color: #111927 !important;
  border-color: #00a8c8 !important;
}

body[data-theme="light"] .ed-role-user {
  background: linear-gradient(
    90deg,
    rgba(154, 106, 0, 0.1),
    #ffffff 28%
  ) !important;
  border-left-color: #9a6a00 !important;
}

body[data-theme="light"] .ed-role-assistant {
  background: linear-gradient(
    90deg,
    rgba(0, 168, 200, 0.1),
    #ffffff 28%
  ) !important;
  border-left-color: #00a8c8 !important;
}

body[data-theme="light"] .ed-role-tool,
body[data-theme="light"] .ed-role-system {
  background: linear-gradient(
    90deg,
    rgba(107, 70, 193, 0.1),
    #ffffff 28%
  ) !important;
  border-left-color: #6b46c1 !important;
}

body[data-theme="light"] .ed-role-user .ed-message-head strong {
  color: #805800 !important;
  -webkit-text-fill-color: #805800 !important;
}

body[data-theme="light"] .ed-role-assistant .ed-message-head strong {
  color: #007f99 !important;
  -webkit-text-fill-color: #007f99 !important;
}

body[data-theme="light"] .ed-role-tool .ed-message-head strong,
body[data-theme="light"] .ed-role-system .ed-message-head strong {
  color: #5b36b3 !important;
  -webkit-text-fill-color: #5b36b3 !important;
}

body[data-theme="light"] pre,
body[data-theme="light"] code {
  background: #f2f5f8 !important;
  color: #111927 !important;
  border-color: #cbd6e2 !important;
}

body[data-theme="light"] mark,
body[data-theme="light"] .ed-search-hit {
  background: #ffe29a !important;
  color: #111927 !important;
}

body[data-theme="light"] .ed-current-hit {
  background: #a7f3ff !important;
  color: #111927 !important;
  box-shadow: 0 0 10px rgba(0, 168, 200, 0.35) !important;
}

body[data-theme="light"] .ed-role-user .ed-message-head strong,
body[data-theme="light"] .ed-role-assistant .ed-message-head strong,
body[data-theme="light"] .ed-role-tool .ed-message-head strong,
body[data-theme="light"] .ed-role-system .ed-message-head strong {
  color: #222 !important;
}

/* =========================================================
   v1.4 Classified Theme
   Purple Blacksite Mode
========================================================= */

body[data-theme="classified"] {
  background: radial-gradient(
    circle at top,
    #1c0741 0%,
    #05070a 72%
  ) !important;
  color: #d8c28a !important;
}

body[data-theme="classified"] .ed-shell {
  background: transparent !important;
}

body[data-theme="classified"] .ed-header,
body[data-theme="classified"] .ed-panel,
body[data-theme="classified"] .ed-load-panel,
body[data-theme="classified"] .ed-list,
body[data-theme="classified"] .ed-output,
body[data-theme="classified"] .ed-dossier,
body[data-theme="classified"] .ed-stat,
body[data-theme="classified"] .conv-item,
body[data-theme="classified"] .ed-toolbar,
body[data-theme="classified"] .tag-panel,
body[data-theme="classified"] .notes-panel,
body[data-theme="classified"] .transcript-action-row,
body[data-theme="classified"] .ed-modal-panel {
  background: linear-gradient(180deg, #1c0741 0%, #06090d 100%) !important;
  color: #d8c28a !important;
  border-color: #8a3ffc !important;
  box-shadow: 0 0 28px rgba(138, 63, 252, 0.22) !important;
}

body[data-theme="classified"] h1,
body[data-theme="classified"] h2,
body[data-theme="classified"] .ed-dossier h2,
body[data-theme="classified"] .ed-kicker,
body[data-theme="classified"] .ed-panel-kicker,
body[data-theme="classified"] .list-section-title {
  color: #ffb400 !important;
}

body[data-theme="classified"] p,
body[data-theme="classified"] li,
body[data-theme="classified"] .ed-message-body,
body[data-theme="classified"] .ed-message-raw,
body[data-theme="classified"] .ed-message-head,
body[data-theme="classified"] .ed-settings-grid label {
  color: #d8c28a !important;
}

body[data-theme="classified"] input,
body[data-theme="classified"] select,
body[data-theme="classified"] textarea,
body[data-theme="classified"] #searchBox,
body[data-theme="classified"] #conversationSearch {
  background: #05070a !important;
  color: #d8c28a !important;
  border-color: #8a3ffc !important;
}

body[data-theme="classified"] button,
body[data-theme="classified"] .scope-btn,
body[data-theme="classified"] .export-pdf-btn {
  background: #120529 !important;
  color: #c6ac79 !important;
  border-color: #8a3ffc !important;
}

body[data-theme="classified"] button:hover,
body[data-theme="classified"] .scope-btn:hover,
body[data-theme="classified"] .scope-btn.active,
body[data-theme="classified"] .export-pdf-btn:hover {
  background: #2a0a5f !important;
  color: #ffb400 !important;
  box-shadow: 0 0 14px rgba(138, 63, 252, 0.45) !important;
}

body[data-theme="dark"] {
  background: #05070b;
  color: #d5d9de;
}

body[data-theme="dark"] .ed-header,
body[data-theme="dark"] .ed-panel,
body[data-theme="dark"] .ed-list,
body[data-theme="dark"] .ed-output,
body[data-theme="dark"] .ed-stat,
body[data-theme="dark"] .conv-item {
  background: #070b12;
  border-color: #2f3945;
}

body[data-theme="dark"] .ed-kicker,
body[data-theme="dark"] .ed-panel-kicker,
body[data-theme="dark"] .list-section-title,
body[data-theme="dark"] h1,
body[data-theme="dark"] h2 {
  color: #c4c9cf !important;
}

body[data-theme="dark"] button,
body[data-theme="dark"] .scope-btn,
body[data-theme="dark"] .export-pdf-btn {
  background: #10151d;
  color: #c4c9cf;
  border-color: #505865;
}

body[data-theme="dark"] button:hover,
body[data-theme="dark"] .scope-btn:hover,
body[data-theme="dark"] .scope-btn.active,
body[data-theme="dark"] .export-pdf-btn:hover {
  background: #1a212b;
  color: #ffffff;
  border-color: #7c8796;
  box-shadow: none;
}

body[data-theme="dark"] .ed-role-user {
  border-left-color: #6f7782;
  background: linear-gradient(90deg, rgba(111, 119, 130, 0.1), #0b1118 28%);
}

body[data-theme="dark"] .ed-role-assistant {
  border-left-color: #9ca3af;
  background: linear-gradient(90deg, rgba(156, 163, 175, 0.08), #0b1118 28%);
}

body[data-theme="dark"] .ed-role-user .ed-message-head strong,
body[data-theme="dark"] .ed-role-assistant .ed-message-head strong,
body[data-theme="dark"] .ed-role-tool .ed-message-head strong,
body[data-theme="dark"] .ed-role-system .ed-message-head strong {
  color: #c4c9cf !important;
}

@media print {
  .transcript-action-row,
  .transcript-filter-row,
  .scope-btn,
  .export-pdf-btn {
    display: none !important;
  }
}

/* =========================================================
   Mobile Layout – Tag Panel
========================================================= */

@media (max-width: 768px) {
  .tag-row {
    flex-direction: column;
    align-items: stretch;
  }

  #tagInput {
    width: 100%;
  }

  #addTagBtn {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
}



/* =========================================================
   v1.5 ED File Picker
   Replaces native Browse / No file selected with tactical UI
========================================================= */
.ed-file-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ed-file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px;
  background: #05080c;
  border: 1px solid #263545;
  box-shadow: inset 0 0 18px rgba(0, 229, 255, 0.035);
}

.ed-file-picker input[type="file"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ed-file-trigger {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid #ffb400;
  background: linear-gradient(180deg, rgba(255, 180, 0, 0.09), rgba(255, 180, 0, 0.025));
  color: #ffb400 !important;
  -webkit-text-fill-color: #ffb400 !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.ed-file-trigger::before {
  content: "▣";
  margin-right: 8px;
  color: #00e5ff;
  -webkit-text-fill-color: #00e5ff;
}

.ed-file-trigger:hover,
.ed-file-picker:focus-within .ed-file-trigger {
  border-color: #00e5ff;
  color: #f5f0df !important;
  -webkit-text-fill-color: #f5f0df !important;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.13), rgba(255, 180, 0, 0.035));
  box-shadow:
    0 0 14px rgba(0, 229, 255, 0.18),
    inset 0 0 12px rgba(0, 229, 255, 0.06);
}

.ed-file-trigger:active {
  transform: translateY(1px);
}

.ed-file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9fb3c8;
  -webkit-text-fill-color: #9fb3c8;
  font-size: 12px;
  letter-spacing: 0.4px;
}

.ed-file-picker.has-file {
  border-color: rgba(0, 229, 255, 0.48);
  box-shadow:
    inset 0 0 18px rgba(0, 229, 255, 0.06),
    0 0 14px rgba(0, 229, 255, 0.08);
}

.ed-file-picker.has-file .ed-file-name {
  color: #d9e6f2;
  -webkit-text-fill-color: #d9e6f2;
}

body[data-theme="light"] .ed-file-picker {
  background: #ffffff !important;
  border-color: #b8c7d6 !important;
  box-shadow: none !important;
}

body[data-theme="light"] .ed-file-trigger {
  background: #ffffff !important;
  color: #805800 !important;
  -webkit-text-fill-color: #805800 !important;
  border-color: #9a6a00 !important;
}

body[data-theme="light"] .ed-file-trigger:hover,
body[data-theme="light"] .ed-file-picker:focus-within .ed-file-trigger {
  background: #f1e4c7 !important;
  color: #111927 !important;
  -webkit-text-fill-color: #111927 !important;
  border-color: #00a8c8 !important;
}

body[data-theme="light"] .ed-file-name {
  color: #60758a !important;
  -webkit-text-fill-color: #60758a !important;
}

body[data-theme="classified"] .ed-file-picker {
  background: #05070a !important;
  border-color: #8a3ffc !important;
  box-shadow: inset 0 0 18px rgba(138, 63, 252, 0.12) !important;
}

body[data-theme="classified"] .ed-file-trigger {
  background: #120529 !important;
  border-color: #8a3ffc !important;
  color: #c6ac79 !important;
  -webkit-text-fill-color: #c6ac79 !important;
}

body[data-theme="classified"] .ed-file-trigger:hover,
body[data-theme="classified"] .ed-file-picker:focus-within .ed-file-trigger {
  background: #2a0a5f !important;
  color: #ffb400 !important;
  -webkit-text-fill-color: #ffb400 !important;
  box-shadow: 0 0 14px rgba(138, 63, 252, 0.45) !important;
}

@media (max-width: 640px) {
  .ed-file-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .ed-file-trigger {
    width: 100%;
  }
}


/* =========================================================
   ED TACTICAL UI 2.0 — Commander Core Override
   Reference: dashboard mockup / tactical HUD direction
========================================================= */
:root{
  --ed-bg:#05080c;
  --ed-surface:#080d14;
  --ed-surface-2:#0b1118;
  --ed-panel:#0b1118;
  --ed-panel-soft:#101720;
  --ed-border:rgba(198,172,121,.28);
  --ed-border-cyan:rgba(0,216,255,.55);
  --ed-gold:#c6ac79;
  --ed-gold-hot:#ffcc47;
  --ed-gold-deep:#a7803f;
  --ed-cyan:#00d8ff;
  --ed-cyan-soft:rgba(0,216,255,.12);
  --ed-text:#edf4ff;
  --ed-muted:#8fa0b3;
  --ed-radius:8px;
  --ed-radius-lg:12px;
  --ed-shadow:0 0 28px rgba(0,0,0,.52), inset 0 0 22px rgba(0,216,255,.025);
}

body{
  background:
    radial-gradient(circle at 24% 0%, rgba(0,216,255,.045), transparent 30%),
    radial-gradient(circle at 78% 18%, rgba(198,172,121,.065), transparent 36%),
    var(--ed-bg) !important;
  color:var(--ed-text) !important;
}

.ed-shell{
  padding:18px !important;
  max-width:1600px;
  margin:0 auto;
}

.ed-header,
.ed-panel,
.ed-list,
.ed-output,
.ed-modal-panel,
.tag-panel,
.notes-panel,
.ed-toolbar,
.transcript-action-row,
.conv-item,
.ed-stat{
  background:linear-gradient(180deg, rgba(12,18,26,.98), rgba(5,8,12,.98)) !important;
  border:1px solid rgba(198,172,121,.22) !important;
  border-radius:var(--ed-radius) !important;
  box-shadow:var(--ed-shadow) !important;
}

.ed-header{
  padding:22px 26px !important;
  gap:22px !important;
  border-radius:var(--ed-radius-lg) !important;
}

.archive-logo{
  width:74px !important;
  height:74px !important;
  filter:drop-shadow(0 0 12px rgba(198,172,121,.25));
}

.ed-kicker,
.ed-panel-kicker,
.list-section-title{
  color:var(--ed-gold-hot) !important;
  letter-spacing:.22em !important;
  font-size:11px !important;
  font-weight:800 !important;
}

h1,
.ed-modal-panel h2{
  color:var(--ed-text) !important;
  letter-spacing:.02em;
  text-shadow:0 0 18px rgba(198,172,121,.12);
}

.ed-header-content h1{
  font-size:28px !important;
  margin:5px 0 8px !important;
}

.ed-header-content p,
.ed-load-panel p{
  color:#cfd8e3 !important;
}

.ed-app-actions button,
button,
.scope-btn,
.export-pdf-btn,
.ed-btn,
.ed-file-trigger{
  background:linear-gradient(180deg, rgba(12,18,26,.96), rgba(5,8,12,.96)) !important;
  color:var(--ed-text) !important;
  border:1px solid rgba(143,160,179,.35) !important;
  border-radius:6px !important;
  min-height:36px;
  padding:0 16px !important;
  margin-left:0 !important;
  font-size:12px !important;
  font-weight:700 !important;
  letter-spacing:.02em !important;
  text-transform:none !important;
  transition:all .18s ease !important;
}

button:hover,
.scope-btn:hover,
.ed-app-actions button:hover,
.ed-btn:hover,
.ed-file-trigger:hover{
  border-color:var(--ed-cyan) !important;
  color:var(--ed-cyan) !important;
  box-shadow:0 0 18px rgba(0,216,255,.12), inset 0 0 18px rgba(0,216,255,.045) !important;
  transform:translateY(-1px);
}

#loadDemoBtn,
#printPdfBtn,
.export-pdf-btn,
#saveNoteBtn,
#saveSettingsBtn{
  color:var(--ed-gold-hot) !important;
  border-color:var(--ed-gold-deep) !important;
  background:linear-gradient(180deg, rgba(167,128,63,.18), rgba(7,11,16,.98)) !important;
}

#loadDemoBtn::before{ content:none !important; }

#loadDemoBtn:hover,
#printPdfBtn:hover,
.export-pdf-btn:hover,
#saveNoteBtn:hover,
#saveSettingsBtn:hover{
  color:#fff3bf !important;
  border-color:var(--ed-gold-hot) !important;
  box-shadow:0 0 22px rgba(198,172,121,.18), inset 0 0 18px rgba(198,172,121,.06) !important;
}

.ed-load-panel{
  padding:18px !important;
  justify-content:space-between !important;
}

.ed-load-controls{
  display:flex !important;
  align-items:center !important;
  gap:16px !important;
  justify-content:flex-end !important;
}

input,
textarea,
select,
#conversationSearch,
#searchBox,
#tagInput,
#missionNote{
  background:linear-gradient(180deg, #080d14, #05080c) !important;
  color:var(--ed-text) !important;
  border:1px solid rgba(143,160,179,.28) !important;
  border-radius:6px !important;
  min-height:40px;
  box-shadow:inset 0 0 18px rgba(0,216,255,.025) !important;
}

input:focus,
textarea:focus,
select:focus,
#conversationSearch:focus,
#searchBox:focus,
#tagInput:focus,
#missionNote:focus{
  outline:none !important;
  border-color:var(--ed-cyan) !important;
  box-shadow:0 0 0 1px rgba(0,216,255,.25), 0 0 18px rgba(0,216,255,.10) !important;
}

.ed-grid{
  grid-template-columns:minmax(270px, 330px) minmax(0, 1fr) !important;
  gap:18px !important;
}

.ed-list{
  padding:18px !important;
}

.ed-output{
  padding:24px !important;
}

.conv-item{
  padding:14px !important;
  margin-bottom:10px !important;
  border-color:rgba(143,160,179,.25) !important;
}

.conv-item:hover,
.conv-item.active{
  border-color:var(--ed-cyan) !important;
  background:linear-gradient(90deg, rgba(0,216,255,.12), rgba(8,13,20,.98)) !important;
  box-shadow:0 0 18px rgba(0,216,255,.12), inset 3px 0 0 var(--ed-cyan) !important;
}

.favorite-star,
#selectedCount,
.ed-stat strong{
  color:var(--ed-gold-hot) !important;
}

.ed-stats{
  gap:12px !important;
}

.ed-stat{
  min-height:76px !important;
  padding:15px !important;
}

.ed-stat span{
  color:var(--ed-cyan) !important;
  font-size:11px !important;
  letter-spacing:.08em !important;
}

.ed-message{
  background:linear-gradient(180deg, rgba(12,18,26,.98), rgba(7,11,16,.98)) !important;
  border:1px solid rgba(143,160,179,.22) !important;
  border-left-width:4px !important;
  border-radius:8px !important;
}

.ed-role-user{ border-left-color:var(--ed-gold-hot) !important; }
.ed-role-assistant{ border-left-color:var(--ed-cyan) !important; }

.ed-role-user .ed-message-head strong,
.ed-role-assistant .ed-message-head strong{
  color:var(--ed-cyan) !important;
}

.ed-modal-panel{
  border-color:rgba(198,172,121,.55) !important;
}

.ed-modal-close{
  min-width:42px !important;
  height:42px !important;
  color:var(--ed-text) !important;
}

.ed-file-picker{
  display:flex !important;
  align-items:center !important;
  gap:14px !important;
  min-height:58px;
  padding:8px !important;
  background:linear-gradient(180deg, #080d14, #05080c) !important;
  border:1px solid rgba(143,160,179,.28) !important;
  border-radius:6px !important;
}

.ed-file-picker input[type="file"]{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

.ed-file-trigger{
  color:var(--ed-gold-hot) !important;
  border-color:var(--ed-gold-deep) !important;
  text-transform:uppercase !important;
  min-width:150px;
  justify-content:center;
  display:inline-flex !important;
  align-items:center !important;
}

.ed-file-name{
  color:#b8c7d6 !important;
  font-size:13px;
}

/* ED Tactical Select — reusable replacement for native selects */
.ed-tselect{
  position:relative;
  min-width:220px;
  height:44px;
  display:inline-block;
}

.ed-tselect select{
  position:absolute !important;
  opacity:0 !important;
  pointer-events:none !important;
  width:1px !important;
  height:1px !important;
}

.ed-tselect-btn{
  width:100%;
  height:44px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:0 14px 0 16px;
  color:var(--ed-text);
  background:linear-gradient(180deg, #080d14 0%, #05080c 100%);
  border:1px solid rgba(198,172,121,.42);
  border-radius:6px;
  cursor:pointer;
  font-size:13px;
  box-shadow:inset 0 0 18px rgba(0,216,255,.03);
  transition:all .18s ease;
}

.ed-tselect-chevron{
  width:14px;
  height:14px;
  flex:0 0 14px;
  background-repeat:no-repeat;
  background-position:center;
  background-size:14px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23C6AC79' d='M7 9l5 6 5-6z'/%3E%3C/svg%3E");
  transition:transform .18s ease, filter .18s ease;
}

.ed-tselect.is-open .ed-tselect-chevron{
  transform:rotate(180deg);
  filter:drop-shadow(0 0 6px rgba(0,216,255,.65));
}

.ed-tselect:hover .ed-tselect-btn,
.ed-tselect.is-open .ed-tselect-btn{
  border-color:var(--ed-cyan);
  box-shadow:0 0 18px rgba(0,216,255,.12), inset 0 0 18px rgba(0,216,255,.04);
}

.ed-tselect-menu{
  position:absolute;
  z-index:100000;
  left:0;
  right:0;
  top:calc(100% + 6px);
  max-height:270px;
  overflow:auto;
  display:none;
  padding:6px;
  background:linear-gradient(180deg, #09101a, #05080c);
  border:1px solid rgba(0,216,255,.38);
  border-radius:8px;
  box-shadow:0 18px 42px rgba(0,0,0,.65), 0 0 22px rgba(0,216,255,.12);
}

.ed-tselect.is-open .ed-tselect-menu{ display:block; }

.ed-tselect-option{
  padding:10px 12px;
  border-radius:6px;
  color:#cfd8e3;
  cursor:pointer;
  font-size:13px;
}

.ed-tselect-option:hover,
.ed-tselect-option.is-selected{
  color:var(--ed-cyan);
  background:linear-gradient(90deg, rgba(0,216,255,.14), transparent);
}

.ed-tselect-option.is-selected{
  box-shadow:inset 3px 0 0 var(--ed-cyan);
}

.ed-tselect-option.is-disabled{
  opacity:.45;
  cursor:not-allowed;
}

/* Size control for settings modal selects */
.ed-settings-grid .ed-tselect{
  width:100%;
  min-width:0;
}

.ed-load-controls .ed-tselect{
  min-width:240px;
}

@media(max-width:900px){
  .ed-load-controls{ justify-content:flex-start !important; width:100%; }
  .ed-load-controls .ed-tselect{ width:100%; }
  #loadDemoBtn{ width:100%; }
  .ed-grid{ grid-template-columns:1fr !important; }
}


#ed-toast {
  position: fixed;
  bottom: 25px;
  right: 25px;

  width: 340px;

  background: #070b10;
  border: 1px solid #ffb400;

  padding: 14px 16px;

  z-index: 999999;

  opacity: 0;
  transform: translateY(20px);

  transition: all .25s ease;

  pointer-events: none;

  box-shadow:
    0 0 15px rgba(255,180,0,.25),
    0 0 40px rgba(255,180,0,.10);
}

#ed-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.ed-toast-title {
  color: #ffb400;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-size: 12px;
}

.ed-toast-text {
  color: #bcd6df;
  font-size: 13px;
}


/* =========================================================
   ED Footer
========================================================= */

.ed-footer{
    margin-top:60px;
    width:100%;
    background:linear-gradient(180deg,#141920 0%,#10151c 100%);
    border-top:1px solid rgba(255,180,0,.18);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.02),
        0 -8px 25px rgba(0,0,0,.35);
}

.ed-footer-inner{
    max-width:1280px;
    margin:0 auto;
    padding:18px 24px;
    text-align:center;
    color:#C6AC79;
    font-size:15px;
    letter-spacing:.4px;
	transition:.35s;
}

.ed-footer-inner:hover{
    color:#ffd36a;
    text-shadow:0 0 10px rgba(255,180,0,.35);
}


/* =========================================================
   ED Tactical UI 2.0 — Light Mode Final Override
========================================================= */

body[data-theme="light"] {
  background: #f4f6f8 !important;
  color: #0f1724 !important;
}

body[data-theme="light"] .ed-header h1,
body[data-theme="light"] h1 {
  color: #111927 !important;
  -webkit-text-fill-color: #111927 !important;
  text-shadow: none !important;
}

body[data-theme="light"] .ed-header-content p,
body[data-theme="light"] .ed-load-panel p,
body[data-theme="light"] .ed-placeholder {
  color: #40546a !important;
  -webkit-text-fill-color: #40546a !important;
}

body[data-theme="light"] .ed-header,
body[data-theme="light"] .ed-panel,
body[data-theme="light"] .ed-load-panel,
body[data-theme="light"] .ed-list,
body[data-theme="light"] .ed-output,
body[data-theme="light"] .ed-dossier,
body[data-theme="light"] .ed-modal-panel,
body[data-theme="light"] .tag-panel,
body[data-theme="light"] .notes-panel,
body[data-theme="light"] .ed-toolbar,
body[data-theme="light"] .transcript-action-row,
body[data-theme="light"] .conv-item,
body[data-theme="light"] .ed-stat {
  background: #ffffff !important;
  color: #111927 !important;
  border-color: #cbd6e2 !important;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .07) !important;
}

body[data-theme="light"] .ed-tselect-btn,
body[data-theme="light"] .ed-tselect-menu {
  background: #ffffff !important;
  color: #111927 !important;
  border-color: #b8c7d6 !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12) !important;
}

body[data-theme="light"] .ed-tselect-option {
  color: #243447 !important;
}

body[data-theme="light"] .ed-tselect-option:hover,
body[data-theme="light"] .ed-tselect-option.is-selected {
  color: #007f99 !important;
  background: linear-gradient(90deg, rgba(0,168,200,.12), transparent) !important;
  box-shadow: inset 3px 0 0 #00a8c8 !important;
}

body[data-theme="light"] .ed-tselect-chevron {
  filter: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%239A6A00' d='M7 9l5 6 5-6z'/%3E%3C/svg%3E") !important;
}

body[data-theme="light"] .ed-footer {
  background: #ffffff !important;
  border-top: 1px solid #cbd6e2 !important;
  box-shadow: 0 -10px 28px rgba(15, 23, 42, .06) !important;
}

body[data-theme="light"] .ed-footer-inner {
  color: #805800 !important;
  text-shadow: none !important;
}

body[data-theme="light"] #ed-toast {
  background: #ffffff !important;
  color: #111927 !important;
  border-color: #9a6a00 !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .14) !important;
}

body[data-theme="light"] .ed-toast-text {
  color: #40546a !important;
}


/* =========================================================
   ED Tactical UI — TRUE DARK MODE
========================================================= */

body[data-theme="dark"]{
    background:#050505 !important;
    color:#ececec;
}

/* Background */

body[data-theme="dark"]::before,
body[data-theme="dark"]::after{
    display:none !important;
}

/* Panels */

body[data-theme="dark"] .ed-header,
body[data-theme="dark"] .ed-panel,
body[data-theme="dark"] .ed-load-panel,
body[data-theme="dark"] .ed-list,
body[data-theme="dark"] .ed-output,
body[data-theme="dark"] .ed-dossier,
body[data-theme="dark"] .ed-modal-panel,
body[data-theme="dark"] .ed-stat,
body[data-theme="dark"] .conv-item,
body[data-theme="dark"] .tag-panel,
body[data-theme="dark"] .notes-panel,
body[data-theme="dark"] .transcript-action-row{

    background:#111111 !important;
    border:1px solid #2f2f2f !important;
    box-shadow:none !important;
}

/* Header */

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3{

    color:#f2f2f2 !important;
    text-shadow:none !important;
}

body[data-theme="dark"] .ed-kicker{

    color:#8b8b8b !important;
}

body[data-theme="dark"] p,
body[data-theme="dark"] span,
body[data-theme="dark"] label{

    color:#bdbdbd !important;
}

/* Inputs */

body[data-theme="dark"] input,
body[data-theme="dark"] textarea,
body[data-theme="dark"] select{

    background:#181818 !important;
    color:#efefef !important;
    border:1px solid #383838 !important;
}

body[data-theme="dark"] input:focus,
body[data-theme="dark"] textarea:focus,
body[data-theme="dark"] select:focus{

    border-color:#777 !important;
    box-shadow:none !important;
}

/* Tactical Select */

body[data-theme="dark"] .ed-tselect-btn{

    background:#181818 !important;
    border:1px solid #383838 !important;
    color:#efefef !important;
}

body[data-theme="dark"] .ed-tselect-menu{

    background:#151515 !important;
    border:1px solid #383838 !important;
    box-shadow:0 18px 30px rgba(0,0,0,.55);
}

body[data-theme="dark"] .ed-tselect-option{

    color:#cfcfcf !important;
}

body[data-theme="dark"] .ed-tselect-option:hover{

    background:#242424 !important;
    color:#ffffff !important;
}

body[data-theme="dark"] .ed-tselect-option.is-selected{

    background:#2c2c2c !important;
    color:#ffffff !important;
}

/* Buttons */

body[data-theme="dark"] button,
body[data-theme="dark"] .ed-btn,
body[data-theme="dark"] .ed-file-trigger{

    background:#1b1b1b !important;
    border:1px solid #444 !important;
    color:#dddddd !important;
    box-shadow:none !important;
}

body[data-theme="dark"] button:hover,
body[data-theme="dark"] .ed-btn:hover,
body[data-theme="dark"] .ed-file-trigger:hover{

    background:#282828 !important;
    border-color:#777 !important;
    color:#ffffff !important;
}

/* Stats */

body[data-theme="dark"] .stat-value{

    color:#ffffff !important;
}

/* Links */

body[data-theme="dark"] a{

    color:#d5d5d5;
}

body[data-theme="dark"] a:hover{

    color:#ffffff;
}

/* Footer */

body[data-theme="dark"] .ed-footer{

    background:#090909 !important;
    border-top:1px solid #2a2a2a !important;
}

body[data-theme="dark"] .ed-footer-inner{

    color:#8b8b8b !important;
}

/* Toast */

body[data-theme="dark"] #ed-toast{

    background:#151515 !important;
    border:1px solid #444 !important;
}

body[data-theme="dark"] .ed-toast-title{

    color:#ffffff !important;
}

body[data-theme="dark"] .ed-toast-text{

    color:#bcbcbc !important;
}


/* =========================================================
   PRINT / PDF CLEANUP — no UI controls, no tactical shadows
========================================================= */

@media print {

  button,
  .ed-btn,
  .scope-btn,
  .export-pdf-btn,
  #addTagBtn,
  #saveNoteBtn,
  .tag-row button,
  .notes-panel button,
  .transcript-action-row,
  .transcript-filter-row,
  .ed-toolbar,
  .selection-bar,
  .ed-app-actions,
  .ed-load-panel,
  .ed-footer,
  #ed-toast {
    display: none !important;
    visibility: hidden !important;
  }

  .ed-shell,
  .ed-output,
  .ed-dossier,
  .ed-panel,
  .ed-stat,
  .tag-panel,
  .notes-panel,
  .ed-message,
  .conv-item {
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
  }

  .ed-output,
  .ed-dossier {
    background: #fff !important;
    border: none !important;
  }

  .tag-panel,
  .notes-panel {
    background: #fff !important;
    border: 1px solid #ddd !important;
  }

  body {
    background: #fff !important;
  }
}


/* =========================================================
   PDF Color Palette
========================================================= */

@media print {

  /* Überschriften */

  h1,
  h2,
  h3{
      color:#111 !important;
  }

  /* Kleine Rubriken */

  .section-label,
  .ed-kicker,
  .dossier-label{
      color:#8a6a2c !important;
      letter-spacing:.14em;
  }

  /* Transcript */

  .message-role,
  .speaker-label{

      color:#2f6f88 !important;
      font-weight:700;
  }

  /* Zahlen */

  .stat-value{

      color:#8a6a2c !important;
  }

  .stat-label{

      color:#5c6d7a !important;
  }

  /* User links */

  .message.user{

      border-left:4px solid #c8a35a !important;
  }

  /* Assistant */

  .message.assistant{

      border-left:4px solid #5b89a3 !important;
  }

  /* Transcript Titel */

  .transcript-title{

      color:#a06d00 !important;
  }

}


@media print {

  .stat-label,
  .ed-stat-label,
  .metric-label,
  .overview-stat .label,
  .stat-card .label,
  .stats-grid .label,
  .stats-grid small,
  .stats-grid span:first-child {

      color:#5c6d7a !important;
  }

}


/* FINAL PRINT COLOR OVERRIDE */
@media print {

  .ed-stat span,
  .ed-stat span *,
  .ed-stat > span,
  .ed-stats .ed-stat span {
    color: #5c6d7a !important;
    -webkit-text-fill-color: #5c6d7a !important;
  }

  .ed-role-user .ed-message-head strong,
  .ed-role-assistant .ed-message-head strong,
  .ed-message-head strong {
    color: #2f5f73 !important;
    -webkit-text-fill-color: #2f5f73 !important;
  }

  .ed-role-user {
    border-left-color: #b89446 !important;
  }

  .ed-role-assistant {
    border-left-color: #5b89a3 !important;
  }

}



body[data-theme="light"] #tagInput {
  flex: 1;
  background: linear-gradient(180deg, #c8cfd8, #dfe3e7) !important;
  border: 1px solid #263545;
  color: #242729 !important;
  padding: 10px 12px;
}

body[data-theme="light"] #missionNote {
  flex: 1;
  background: linear-gradient(180deg, #c8cfd8, #dfe3e7) !important;
  border: 1px solid #263545;
  color: #242729 !important;
  padding: 10px 12px;
}


body[data-theme="tactical"] input,
body[data-theme="tactical"] textarea,
body[data-theme="tactical"] select{

    background:#181818 !important;
    color:#efefef !important;
    border:1px solid #383838 !important;
}


/* Active Transcript Filter */
.scope-btn.active{
    background: linear-gradient(180deg,#1d3f4d 0%, #10232c 100%) !important;
    color:#ffffff !important;
    border:1px solid #00d8ff !important;
	position:relative;

    box-shadow:
        0 0 0 1px rgba(0,216,255,.20),
        0 0 12px rgba(0,216,255,.45),
        inset 0 1px 0 rgba(255,255,255,.10);

    font-weight:700;
}

.scope-btn.active::before{
    content:"";
    position:absolute;
    left:0;
    top:0;
    width:100%;
    height:3px;

    background:#00d8ff;
    box-shadow:0 0 8px rgba(0,216,255,.8);
	transform:translateY(-1px);
}

.single-toc {
display: none;
}
@media print {
.single-toc {
display: block;
}
}


@media print {
  .message-avatar,
  .avatar,
  .avatar-img,
  .msg-identity img {
    display: none !important;
  }
}


@media print {
  .tag-panel,
  .ed-stats,
  .notes-panel,
  .single-toc {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .single-toc {
    margin-top: 24px !important;
    margin-bottom: 28px !important;
  }

  .transcript-head {
    margin-top: 28px !important;
  }
}


@media print {
  body[data-theme="tactical"] {
    background: #0a0e14 !important;
    color: #eaf6ff !important;
  }

  body[data-theme="tactical"] .ed-dossier,
  body[data-theme="tactical"] .ed-message,
  body[data-theme="tactical"] .ed-stats,
  body[data-theme="tactical"] .tag-panel,
  body[data-theme="tactical"] .notes-panel {
    background: #101722 !important;
    color: #eaf6ff !important;
    border-color: rgba(0,216,255,.28) !important;
    box-shadow: none !important;
  }

  body[data-theme="tactical"] h1,
  body[data-theme="tactical"] h2,
  body[data-theme="tactical"] .ed-kicker {
    color: #f4c95d !important;
  }
}

.single-toc a {
  color: inherit;
  text-decoration: none;
}

.single-toc a:hover {
  color: #00d8ff;
  text-decoration: underline;
}
/* =========================================================
   UNIT-01 v1.0.1 Archive PDF Engine Patch
   Tactical print styling, clickable TOC visibility, Firefox size guard
========================================================= */

@media screen {
  .single-toc {
    display: none !important;
  }
}

.single-toc a,
.master-toc a {
  color: inherit;
  text-decoration: none;
}

.single-toc a:hover,
.master-toc a:hover {
  color: var(--ed-cyan, #00d8ff) !important;
  text-decoration: underline;
}

.scope-btn.active {
  position: relative;
  background: linear-gradient(180deg, #1d3f4d 0%, #10232c 100%) !important;
  color: #ffffff !important;
  border: 1px solid var(--ed-cyan, #00d8ff) !important;
  box-shadow:
    0 0 0 1px rgba(0,216,255,.20),
    0 0 12px rgba(0,216,255,.45),
    inset 0 1px 0 rgba(255,255,255,.10) !important;
  font-weight: 800 !important;
  transform: translateY(-1px);
}

.scope-btn.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: var(--ed-cyan, #00d8ff);
  box-shadow: 0 0 8px rgba(0,216,255,.8);
}

@media print {
  /* Firefox PDF size guard: do not embed repeated avatar bitmaps in PDFs */
  .message-avatar,
  .avatar,
  .avatar-img,
  .msg-identity img {
    display: none !important;
  }

  body[data-theme="tactical"] {
    background: #ffffff !important;
    color: #111927 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body[data-theme="tactical"] .ed-shell,
  body[data-theme="tactical"] .ed-grid,
  body[data-theme="tactical"] .ed-output,
  body[data-theme="tactical"] .ed-dossier,
  body[data-theme="tactical"] .master-dossier,
  body[data-theme="tactical"] .master-section {
    background: #ffffff !important;
    color: #111927 !important;
    border: none !important;
    box-shadow: none !important;
  }

  body[data-theme="tactical"] .ed-dossier > header,
  body[data-theme="tactical"] .master-section > header {
    margin-bottom: 18px !important;
    padding-bottom: 12px !important;
    border-bottom: 3px solid #111927 !important;
    background: #ffffff !important;
  }

  body[data-theme="tactical"] .ed-kicker {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
    letter-spacing: 3px !important;
    font-weight: 900 !important;
  }

  body[data-theme="tactical"] h1 {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }

  body[data-theme="tactical"] h2,
  body[data-theme="tactical"] .transcript-head h2 {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body[data-theme="tactical"] .single-toc {
    display: block !important;
    margin: 22px 0 26px !important;
    padding: 18px 24px !important;
    background: #111927 !important;
    color: #8fdcff !important;
    border-left: 5px solid #8fdcff !important;
    border-radius: 10px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body[data-theme="tactical"] .single-toc h2,
  body[data-theme="tactical"] .master-dossier > h2 {
    color: #f4d27a !important;
    -webkit-text-fill-color: #f4d27a !important;
    margin-top: 0 !important;
  }

  body[data-theme="tactical"] .single-toc li,
  body[data-theme="tactical"] .single-toc a,
  body[data-theme="tactical"] .master-toc li,
  body[data-theme="tactical"] .master-toc a {
    color: #8fdcff !important;
    -webkit-text-fill-color: #8fdcff !important;
    line-height: 1.45 !important;
  }

  body[data-theme="tactical"] .master-toc {
    margin: 16px 0 26px !important;
    padding: 18px 24px 18px 42px !important;
    background: #111927 !important;
    color: #8fdcff !important;
    border-left: 5px solid #8fdcff !important;
    border-radius: 10px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body[data-theme="tactical"] .ed-stats,
  body[data-theme="tactical"] .tag-panel,
  body[data-theme="tactical"] .notes-panel {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body[data-theme="tactical"] .ed-stat,
  body[data-theme="tactical"] .tag-panel,
  body[data-theme="tactical"] .notes-panel {
    background: #ffffff !important;
    color: #111927 !important;
    border: 1px solid #d0d7de !important;
    box-shadow: none !important;
  }

  body[data-theme="tactical"] .ed-stat span {
    color: #5d6b7a !important;
    -webkit-text-fill-color: #5d6b7a !important;
  }

  body[data-theme="tactical"] .ed-stat strong {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body[data-theme="tactical"] .ed-message {
    background: #ffffff !important;
    color: #111927 !important;
    border: 1px solid #d0d7de !important;
    border-left-width: 6px !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  body[data-theme="tactical"] .ed-role-user {
    border-left-color: #1683ff !important;
  }

  body[data-theme="tactical"] .ed-role-assistant {
    border-left-color: #d4a017 !important;
  }

  body[data-theme="tactical"] .ed-role-tool,
  body[data-theme="tactical"] .ed-role-system {
    border-left-color: #8b5cf6 !important;
  }

  body[data-theme="tactical"] .ed-message-head {
    color: #111927 !important;
    border-bottom: 1px solid #d0d7de !important;
  }

  body[data-theme="tactical"] .ed-role-user .ed-message-head strong {
    color: #1683ff !important;
    -webkit-text-fill-color: #1683ff !important;
  }

  body[data-theme="tactical"] .ed-role-assistant .ed-message-head strong {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body[data-theme="tactical"] .ed-message-body,
  body[data-theme="tactical"] .ed-message-raw {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }

  body[data-theme="tactical"] pre,
  body[data-theme="tactical"] code {
    background: #f4f6f8 !important;
    color: #111927 !important;
    border: 1px solid #d0d7de !important;
  }
}

@media print {
body[data-theme="tactical"] #tagInput {
  flex: 1;
  background: linear-gradient(180deg, #c8cfd8, #dfe3e7) !important;
  border: 1px solid #263545;
  color: #242729 !important;
  padding: 10px 12px;
}

body[data-theme="tactical"] #missionNote {
  flex: 1;
  background: linear-gradient(180deg, #c8cfd8, #dfe3e7) !important;
  border: 1px solid #263545;
  color: #242729 !important;
  padding: 10px 12px;
}
}


@media print {
  body[data-theme="tactical"] .ed-stats {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  body[data-theme="tactical"] .ed-stat {
    background: #ffffff !important;
    color: #0b1118 !important;
    border: 1px solid #cbd6e2 !important;
    box-shadow: none !important;
  }

  body[data-theme="tactical"] .ed-stat span {
    color: #52657a !important;
  }

  body[data-theme="tactical"] .ed-stat strong {
    color: #a7803f !important;
  }
}

/* =========================================================
   UNIT-01 FINAL ONLINE DEMO PRINT THEMES
   Uses JS-set body classes, not UI data-theme.
   This overrides older global/data-theme print blocks above.
========================================================= */

@media print {
  body.archive-printing {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body.archive-printing .message-avatar,
  body.archive-printing .avatar,
  body.archive-printing .avatar-img,
  body.archive-printing .msg-identity img {
    display: none !important;
  }

  body.archive-printing .ed-header,
  body.archive-printing .ed-panel,
  body.archive-printing .ed-list,
  body.archive-printing .ed-toolbar,
  body.archive-printing .transcript-action-row,
  body.archive-printing .transcript-filter-row,
  body.archive-printing .scope-btn,
  body.archive-printing .export-pdf-btn,
  body.archive-printing #jsonInput,
  body.archive-printing #loadBtn,
  body.archive-printing #conversationSearch,
  body.archive-printing .selection-bar,
  body.archive-printing .role-label,
  body.archive-printing #applyRoleNamesBtn,
  body.archive-printing #identityPreset,
  body.archive-printing #showAvatars {
    display: none !important;
  }

  body.archive-printing .ed-grid {
    display: block !important;
  }

  body.archive-printing .single-toc {
    display: block !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body.archive-printing .single-toc a,
  body.archive-printing .master-toc a {
    text-decoration: none !important;
  }

  body.archive-printing .ed-stats,
  body.archive-printing .tag-panel,
  body.archive-printing .notes-panel {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body.archive-printing .ed-message {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  /* INK / LIGHT — clean paper mode */
  body.print-theme-ink,
  body.print-theme-ink .ed-shell,
  body.print-theme-ink .ed-grid,
  body.print-theme-ink .ed-output,
  body.print-theme-ink .ed-dossier,
  body.print-theme-ink .master-dossier,
  body.print-theme-ink .master-section {
    background: #ffffff !important;
    color: #111927 !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.print-theme-ink .ed-dossier > header,
  body.print-theme-ink .master-section > header {
    background: #ffffff !important;
    border-bottom: 3px solid #111927 !important;
    padding-bottom: 12px !important;
    margin-bottom: 18px !important;
  }

  body.print-theme-ink h1 {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }

  body.print-theme-ink h2,
  body.print-theme-ink .transcript-head h2,
  body.print-theme-ink .ed-kicker {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body.print-theme-ink .single-toc,
  body.print-theme-ink .master-toc {
    background: #ffffff !important;
    color: #111927 !important;
    border-left: 4px solid #9ca3af !important;
    border-radius: 0 !important;
    padding: 18px 24px !important;
    box-shadow: none !important;
  }

  body.print-theme-ink .single-toc h2,
  body.print-theme-ink .master-dossier > h2 {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body.print-theme-ink .single-toc li,
  body.print-theme-ink .single-toc a,
  body.print-theme-ink .master-toc li,
  body.print-theme-ink .master-toc a {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }

  body.print-theme-ink .ed-stat,
  body.print-theme-ink .tag-panel,
  body.print-theme-ink .notes-panel,
  body.print-theme-ink .ed-message {
    background: #ffffff !important;
    color: #111927 !important;
    border: 1px solid #d0d7de !important;
    box-shadow: none !important;
  }

  body.print-theme-ink .ed-stat span,
  body.print-theme-ink .ed-message-head span {
    color: #5d6b7a !important;
    -webkit-text-fill-color: #5d6b7a !important;
  }

  body.print-theme-ink .ed-stat strong,
  body.print-theme-ink .ed-role-assistant .ed-message-head strong {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body.print-theme-ink .ed-role-user {
    border-left: 6px solid #1683ff !important;
  }

  body.print-theme-ink .ed-role-assistant {
    border-left: 6px solid #d4a017 !important;
  }

  body.print-theme-ink .ed-role-user .ed-message-head strong {
    color: #1683ff !important;
    -webkit-text-fill-color: #1683ff !important;
  }

  body.print-theme-ink .ed-message-body,
  body.print-theme-ink .ed-message-raw {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }

  /* DARK — graphite dossier, visibly different from ink */
  body.print-theme-dark,
  body.print-theme-dark .ed-shell,
  body.print-theme-dark .ed-grid,
  body.print-theme-dark .ed-output,
  body.print-theme-dark .ed-dossier,
  body.print-theme-dark .master-dossier,
  body.print-theme-dark .master-section {
    background: #ffffff !important;
    color: #16181d !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.print-theme-dark .ed-dossier > header,
  body.print-theme-dark .master-section > header {
    background: #ffffff !important;
    border-bottom: 3px solid #2f343b !important;
    padding-bottom: 12px !important;
    margin-bottom: 18px !important;
  }

  body.print-theme-dark h1 {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
  }

  body.print-theme-dark h2,
  body.print-theme-dark .transcript-head h2,
  body.print-theme-dark .ed-kicker {
    color: #5f6670 !important;
    -webkit-text-fill-color: #5f6670 !important;
  }

  body.print-theme-dark .single-toc,
  body.print-theme-dark .master-toc {
    background: #2b3038 !important;
    color: #e5e7eb !important;
    border-left: 6px solid #8b949e !important;
    border-radius: 10px !important;
    padding: 18px 24px !important;
    box-shadow: none !important;
  }

  body.print-theme-dark .single-toc h2,
  body.print-theme-dark .master-dossier > h2 {
    color: #f3f4f6 !important;
    -webkit-text-fill-color: #f3f4f6 !important;
  }

  body.print-theme-dark .single-toc li,
  body.print-theme-dark .single-toc a,
  body.print-theme-dark .master-toc li,
  body.print-theme-dark .master-toc a {
    color: #d1d5db !important;
    -webkit-text-fill-color: #d1d5db !important;
  }

  body.print-theme-dark .ed-stat,
  body.print-theme-dark .tag-panel,
  body.print-theme-dark .notes-panel,
  body.print-theme-dark .ed-message {
    background: #f7f7f8 !important;
    color: #16181d !important;
    border: 1px solid #c9cdd3 !important;
    box-shadow: none !important;
  }

  body.print-theme-dark .ed-role-user {
    border-left: 6px solid #4b5563 !important;
  }

  body.print-theme-dark .ed-role-assistant {
    border-left: 6px solid #9ca3af !important;
  }

  body.print-theme-dark .ed-message-head,
  body.print-theme-dark .ed-message-body,
  body.print-theme-dark .ed-message-raw {
    color: #16181d !important;
    -webkit-text-fill-color: #16181d !important;
  }

  body.print-theme-dark .ed-message-head strong {
    color: #374151 !important;
    -webkit-text-fill-color: #374151 !important;
  }

  body.print-theme-dark .ed-stat span {
    color: #5f6670 !important;
    -webkit-text-fill-color: #5f6670 !important;
  }

  body.print-theme-dark .ed-stat strong {
    color: #374151 !important;
    -webkit-text-fill-color: #374151 !important;
  }

  /* TACTICAL — matches Export Commander: white report, dark-blue TOC card */
  body.print-theme-tactical,
  body.print-theme-tactical .ed-shell,
  body.print-theme-tactical .ed-grid,
  body.print-theme-tactical .ed-output,
  body.print-theme-tactical .ed-dossier,
  body.print-theme-tactical .master-dossier,
  body.print-theme-tactical .master-section {
    background: #ffffff !important;
    color: #111927 !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.print-theme-tactical .ed-dossier > header,
  body.print-theme-tactical .master-section > header {
    background: #ffffff !important;
    border-bottom: 3px solid #111927 !important;
    padding-bottom: 12px !important;
    margin-bottom: 18px !important;
  }

  body.print-theme-tactical .ed-kicker {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
    letter-spacing: 3px !important;
    font-weight: 900 !important;
  }

  body.print-theme-tactical h1 {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }

  body.print-theme-tactical h2,
  body.print-theme-tactical .transcript-head h2 {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body.print-theme-tactical .single-toc,
  body.print-theme-tactical .master-toc {
    background: #111927 !important;
    color: #8fdcff !important;
    border-left: 6px solid #00d8ff !important;
    border-radius: 10px !important;
    padding: 18px 24px !important;
    box-shadow: none !important;
  }

  body.print-theme-tactical .single-toc h2,
  body.print-theme-tactical .master-dossier > h2 {
    color: #f4d27a !important;
    -webkit-text-fill-color: #f4d27a !important;
    margin-top: 0 !important;
  }

  body.print-theme-tactical .single-toc li,
  body.print-theme-tactical .single-toc a,
  body.print-theme-tactical .master-toc li,
  body.print-theme-tactical .master-toc a {
    color: #8fdcff !important;
    -webkit-text-fill-color: #8fdcff !important;
    line-height: 1.45 !important;
  }

  body.print-theme-tactical .ed-stats {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  body.print-theme-tactical .ed-stat,
  body.print-theme-tactical .tag-panel,
  body.print-theme-tactical .notes-panel,
  body.print-theme-tactical .ed-message {
    background: #ffffff !important;
    color: #111927 !important;
    border: 1px solid #d0d7de !important;
    box-shadow: none !important;
  }

  body.print-theme-tactical .ed-stat span,
  body.print-theme-tactical .ed-message-head span {
    color: #5d6b7a !important;
    -webkit-text-fill-color: #5d6b7a !important;
  }

  body.print-theme-tactical .ed-stat strong {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body.print-theme-tactical .ed-role-user {
    border-left: 6px solid #1683ff !important;
  }

  body.print-theme-tactical .ed-role-assistant {
    border-left: 6px solid #d4a017 !important;
  }

  body.print-theme-tactical .ed-role-tool,
  body.print-theme-tactical .ed-role-system {
    border-left: 6px solid #8b5cf6 !important;
  }

  body.print-theme-tactical .ed-message-head {
    color: #111927 !important;
    border-bottom: 1px solid #d0d7de !important;
  }

  body.print-theme-tactical .ed-role-user .ed-message-head strong {
    color: #1683ff !important;
    -webkit-text-fill-color: #1683ff !important;
  }

  body.print-theme-tactical .ed-role-assistant .ed-message-head strong {
    color: #a7803f !important;
    -webkit-text-fill-color: #a7803f !important;
  }

  body.print-theme-tactical .ed-message-body,
  body.print-theme-tactical .ed-message-raw {
    color: #111927 !important;
    -webkit-text-fill-color: #111927 !important;
  }
}


.ed-avatar-preview {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(0, 229, 255, 0.65);
  background: #05080c;
  box-shadow:
    0 0 10px rgba(0, 229, 255, 0.22),
    inset 0 0 8px rgba(255, 180, 0, 0.08);
}
