/* ==========================================================================
   A2 Enterprise AI — web platform
   Brand: Navy #0E2A5C, Orange #F7941D, Gray #6E7288, Blue #4086AD,
          Light blue #D5E7F0, Light gray #CCD3E0
   ========================================================================== */

:root {
  --navy: #0E2A5C;
  --navy-80: #24406E;
  --orange: #F7941D;
  --gray: #6E7288;
  --blue: #4086AD;
  --lt-blue: #D5E7F0;
  --lt-gray: #CCD3E0;

  --bg: #FFFFFF;
  --bg-sidebar: #0E2A5C;
  --bg-subtle: #F6F8FB;
  --border: #E3E8F0;
  --text: #1E2430;
  --text-muted: #6E7288;

  /* Brand font for the wordmark and headings; a system stack for reading.
     Change --font-ui to Verdana if full brand-font fidelity is preferred. */
  --font-brand: Verdana, Geneva, sans-serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;

  --sidebar-w: 268px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(14,42,92,.06), 0 4px 12px rgba(14,42,92,.06);
}

* { box-sizing: border-box; }

html, body, #root {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }
a { color: var(--blue); }

/* ------------------------------------------------------------- layout ---- */

.app { display: flex; height: 100%; overflow: hidden; }

/* ------------------------------------------------------------ sidebar ---- */

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: margin-left .18s ease;
}

.brand {
  padding: 18px 18px 14px;
  border-bottom: 2px solid var(--orange);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-mark {
  font-family: var(--font-brand);
  font-weight: bold;
  font-size: 15px;
  letter-spacing: .04em;
  color: #fff;
}
.brand-sub {
  font-size: 11px;
  color: var(--lt-gray);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.new-chat {
  margin: 14px;
  padding: 10px 14px;
  background: var(--orange);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.new-chat:hover { filter: brightness(1.07); }
.new-chat:disabled { opacity: .5; cursor: not-allowed; }

.conv-list { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.conv-list::-webkit-scrollbar { width: 8px; }
.conv-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 4px; }

.conv-group {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(213,231,240,.55);
  padding: 14px 10px 6px;
}

.conv {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--lt-gray);
  font-size: 13.5px;
  cursor: pointer;
  position: relative;
}
.conv:hover { background: rgba(255,255,255,.08); color: #fff; }
.conv.active { background: rgba(247,148,29,.16); color: #fff; }
.conv.active::before {
  content: "";
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px; background: var(--orange);
}
.conv-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-actions { display: none; gap: 2px; }
.conv:hover .conv-actions, .conv.active .conv-actions { display: flex; }
.icon-btn {
  background: none; border: 0; color: rgba(255,255,255,.6);
  padding: 2px 4px; border-radius: 4px; font-size: 13px; line-height: 1;
}
.icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }

.sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.12);
  padding: 12px 16px;
  font-size: 12px;
  color: var(--lt-gray);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-foot .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot a { color: var(--lt-gray); text-decoration: none; font-size: 11px; }
.sidebar-foot a:hover { color: #fff; text-decoration: underline; }

/* ---------------------------------------------------------------- main --- */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px;
  flex: 0 0 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: #fff;
}
.hamburger { display: none; background: none; border: 0; font-size: 18px; color: var(--navy); }

.topbar-spacer { flex: 1; }
.conv-name { font-size: 13.5px; color: var(--text-muted); max-width: 40%;
             overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ messages --- */

.scroll { flex: 1; overflow-y: auto; }
.thread { max-width: 780px; margin: 0 auto; padding: 28px 24px 40px; }

.empty { text-align: center; padding: 76px 20px; color: var(--text-muted); }
.empty h2 {
  font-family: var(--font-brand);
  color: var(--navy);
  font-size: 19px;
  letter-spacing: .02em;
  margin: 0 0 8px;
}
.empty p { margin: 0 auto; max-width: 460px; font-size: 14px; }
.starter-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.starter {
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; font-size: 13px; color: var(--navy);
}
.starter:hover { border-color: var(--orange); background: #FFF9F1; }

.msg { margin-bottom: 26px; }
.msg-role {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 6px; font-weight: 700;
}
.msg.user .bubble {
  background: var(--lt-blue);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.msg.assistant .msg-role { color: var(--orange); }
.bubble > *:first-child { margin-top: 0; }
.bubble > *:last-child { margin-bottom: 0; }

.bubble p { margin: 0 0 12px; }
.bubble ul, .bubble ol { margin: 0 0 12px; padding-left: 22px; }
.bubble li { margin-bottom: 4px; }
.bubble li::marker { color: var(--orange); }
.bubble h1, .bubble h2, .bubble h3, .bubble h4 {
  font-family: var(--font-brand);
  color: var(--navy);
  margin: 20px 0 8px;
  line-height: 1.3;
}
.bubble h1 { font-size: 19px; } .bubble h2 { font-size: 17px; }
.bubble h3 { font-size: 15.5px; } .bubble h4 { font-size: 14.5px; }
.bubble strong { color: var(--navy); }
.bubble blockquote {
  margin: 0 0 12px; padding: 2px 0 2px 14px;
  border-left: 3px solid var(--orange); color: var(--text-muted);
}
.bubble code {
  font-family: var(--font-mono); font-size: 12.5px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
.bubble pre {
  background: #0B1D3F; border-radius: var(--radius);
  padding: 14px 16px; overflow-x: auto; margin: 0 0 14px;
  position: relative;
}
.bubble pre code {
  background: none; border: 0; padding: 0;
  color: #DCE6F5; font-size: 12.5px; line-height: 1.55;
}
.bubble table {
  border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 13.5px;
}
.bubble th {
  background: var(--navy); color: #fff; text-align: left;
  padding: 8px 10px; font-weight: 600;
}
.bubble td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.bubble tr:nth-child(even) td { background: var(--bg-subtle); }
.bubble hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.copy-code {
  position: absolute; top: 8px; right: 8px;
  background: rgba(255,255,255,.12); color: #DCE6F5;
  border: 0; border-radius: 6px; padding: 4px 9px; font-size: 11px;
  opacity: 0; transition: opacity .12s;
}
.bubble pre:hover .copy-code { opacity: 1; }
.copy-code:hover { background: rgba(255,255,255,.24); }

.caret {
  display: inline-block; width: 7px; height: 15px;
  background: var(--orange); margin-left: 2px;
  vertical-align: text-bottom; animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.activity {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--orange);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .25 } 50% { opacity: 1 } }

.files { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.file-link {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid var(--border); border-left: 3px solid var(--orange);
  border-radius: 8px; padding: 9px 13px; text-decoration: none;
  color: var(--navy); font-size: 13.5px; background: #fff; box-shadow: var(--shadow);
  max-width: 460px;
}
.file-link:hover { background: #FFF9F1; }
.file-meta { color: var(--text-muted); font-size: 11.5px; }
.unbranded { color: var(--orange); font-size: 11.5px; }

.meta-row {
  margin-top: 10px; font-size: 11.5px; color: var(--text-muted);
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.pill {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 8px; background: var(--bg-subtle);
}
.pill.kb { border-color: var(--blue); color: var(--blue); }
.pill.err { border-color: var(--orange); color: var(--orange); }

.error-box {
  border: 1px solid var(--orange); background: #FFF6EA;
  border-radius: var(--radius); padding: 11px 14px; font-size: 13.5px;
  color: var(--navy); margin-top: 8px;
}

/* ------------------------------------------------------------ composer --- */

.composer-wrap { border-top: 1px solid var(--border); background: #fff; }
.composer { max-width: 780px; margin: 0 auto; padding: 14px 24px 20px; }
.composer-box {
  display: flex; align-items: flex-end; gap: 8px;
  border: 1px solid var(--lt-gray); border-radius: 14px;
  padding: 8px 8px 8px 14px; background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.composer-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(64,134,173,.12);
}
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none;
  font-family: inherit; font-size: 15px; line-height: 1.55;
  max-height: 200px; padding: 6px 0; color: var(--text);
  background: transparent;
}
.send-btn, .stop-btn {
  border: 0; border-radius: 10px; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex: 0 0 auto;
}
.send-btn { background: var(--navy); color: #fff; }
.send-btn:disabled { background: var(--lt-gray); cursor: not-allowed; }
.send-btn:not(:disabled):hover { background: var(--navy-80); }
.stop-btn { background: var(--orange); color: #fff; }
.composer-hint {
  font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 8px;
}

/* -------------------------------------------------------------- mobile --- */

.scrim { display: none; }

@media (max-width: 820px) {
  .sidebar {
    position: fixed; z-index: 30; top: 0; bottom: 0; left: 0;
    margin-left: calc(-1 * var(--sidebar-w));
    box-shadow: 0 0 40px rgba(0,0,0,.28);
  }
  .sidebar.open { margin-left: 0; }
  .hamburger { display: block; }
  .scrim.show {
    display: block; position: fixed; inset: 0; z-index: 20;
    background: rgba(14,42,92,.42);
  }
  .thread { padding: 20px 16px 32px; }
  .composer { padding: 12px 16px 16px; }
  .route-note { display: none; }
  .conv-name { display: none; }
}

/* ------------------------------------------------------- attachments ----- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips-msg { margin-top: 10px; margin-bottom: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 5px 8px 5px 10px; font-size: 12.5px;
  max-width: 330px;
}
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); }
.chip-note { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.chip-pending { opacity: .7; }
.chip-err { border-left-color: var(--orange); }
.chip-err .chip-note { color: var(--orange); }
.chip-x {
  background: none; border: 0; color: var(--text-muted);
  font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 4px;
}
.chip-x:hover { background: var(--lt-gray); color: var(--navy); }

.attach-btn {
  background: none; border: 0; font-size: 16px; padding: 6px 4px;
  color: var(--text-muted); flex: 0 0 auto; border-radius: 8px;
}
.attach-btn:hover:not(:disabled) { background: var(--bg-subtle); color: var(--navy); }
.attach-btn:disabled { opacity: .4; cursor: not-allowed; }

.composer-box.dragging {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(247,148,29,.16);
  background: #FFFCF7;
}

.attach-note {
  margin-top: 8px; font-size: 11.5px; color: var(--text-muted);
  border-left: 2px solid var(--lt-gray); padding-left: 8px;
}

/* ---------------------------------------------------- projects + panels -- */

.proj-block { border-bottom: 1px solid rgba(255,255,255,.12); padding: 0 8px 10px; }
.proj-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(213,231,240,.55); padding: 12px 10px 6px;
}
.proj {
  display: flex; align-items: center; gap: 6px; position: relative;
  padding: 7px 10px; border-radius: 8px; color: var(--lt-gray);
  font-size: 13.5px; cursor: pointer; flex-wrap: wrap;
}
.proj:hover { background: rgba(255,255,255,.08); color: #fff; }
.proj.active { background: rgba(247,148,29,.16); color: #fff; }
.proj.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 2px; background: var(--orange);
}
.proj-meta { font-size: 11px; color: rgba(213,231,240,.6); }
.proj .conv-actions { display: none; }
.proj:hover .conv-actions, .proj.active .conv-actions { display: flex; }

.cap-bar {
  flex: 0 0 100%; height: 3px; background: rgba(255,255,255,.14);
  border-radius: 2px; overflow: hidden; margin-top: 4px;
}
.cap-bar.wide { flex: 1; height: 7px; background: var(--lt-gray); margin: 0; }
.cap-fill { height: 100%; background: var(--orange); }
.cap-fill.over { background: #C0392B; }

.proj-pill {
  font-size: 12px; background: var(--lt-blue); color: var(--navy);
  border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}

.panel {
  position: absolute; top: 56px; right: 0; bottom: 0; width: 440px;
  max-width: 100%; background: #fff; border-left: 1px solid var(--border);
  box-shadow: -8px 0 28px rgba(14,42,92,.10); z-index: 15;
  display: flex; flex-direction: column;
}
.main { position: relative; }
.panel-head {
  flex: 0 0 46px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; background: var(--navy); color: #fff;
  font-family: var(--font-brand); font-size: 13px; letter-spacing: .03em;
}
.icon-btn.dark { color: rgba(255,255,255,.75); font-size: 18px; }
.icon-btn.dark:hover { background: rgba(255,255,255,.16); color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 18px 28px; }
.panel-body h4 {
  font-family: var(--font-brand); color: var(--navy); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase;
  margin: 22px 0 6px; padding-bottom: 5px; border-bottom: 2px solid var(--orange);
}
.panel-body h4:first-child { margin-top: 0; }
.panel-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.panel-text {
  width: 100%; font-family: var(--font-ui); font-size: 13.5px; line-height: 1.5;
  border: 1px solid var(--lt-gray); border-radius: 8px; padding: 9px 11px;
  resize: vertical; color: var(--text);
}
.panel-text:focus { outline: none; border-color: var(--blue);
                    box-shadow: 0 0 0 3px rgba(64,134,173,.12); }
.panel-actions { display: flex; gap: 8px; margin: 10px 0 4px; flex-wrap: wrap; }
.btn-primary, .btn-secondary, .btn-danger {
  font-size: 13px; border: 0; border-radius: 8px; padding: 8px 14px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:disabled { background: var(--lt-gray); cursor: not-allowed; }
.btn-secondary { background: var(--bg-subtle); color: var(--navy); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--orange); }
.btn-danger { background: #fff; color: #C0392B; border: 1px solid #E8C4BF; }
.btn-danger:hover { background: #FDF3F2; }

.cap-table { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.cap-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cap-name {
  flex: 0 0 54px; font-size: 12px; font-weight: 600; color: var(--navy);
  text-transform: uppercase; letter-spacing: .04em;
}
.cap-num { flex: 0 0 42px; text-align: right; font-size: 12px; color: var(--text-muted); }
.cap-note { flex: 0 0 100%; font-size: 11px; color: var(--text-muted); padding-left: 62px; }

.file-rows { display: flex; flex-direction: column; gap: 4px; }
.file-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  border-left: 3px solid var(--blue);
}
.file-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-meta { font-size: 11px; color: var(--text-muted); }
.file-row .icon-btn { color: var(--text-muted); }
.file-row .icon-btn:hover { background: var(--lt-gray); color: var(--navy); }

@media (max-width: 820px) {
  .panel { width: 100%; top: 56px; }
  .proj-pill { display: none; }
}

/* ------------------------------------------------------ search + admin --- */

.search-box { padding: 12px 12px 4px; }
.search-box input {
  width: 100%; font-family: var(--font-ui); font-size: 13px;
  padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: #fff;
}
.search-box input::placeholder { color: rgba(213,231,240,.55); }
.search-box input:focus {
  outline: none; border-color: var(--orange); background: rgba(255,255,255,.13);
}
.hidden { display: none; }

.search-hit { flex-direction: column; align-items: flex-start; gap: 3px; padding: 9px 10px; }
.hit-title {
  font-size: 13px; color: #fff; display: flex; align-items: center; gap: 6px;
  width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hit-count {
  background: var(--orange); color: #fff; border-radius: 999px;
  font-size: 10px; padding: 0 6px; flex: 0 0 auto;
}
.hit-snip {
  font-size: 11.5px; color: rgba(213,231,240,.78); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hit-role { color: var(--orange); font-weight: 600; margin-right: 5px; }

.foot-links { display: flex; gap: 10px; }

.panel.wide { width: 640px; }
.admin-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 8px; margin-bottom: 12px;
}
.admin-cell {
  border: 1px solid var(--border); border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px;
}
.admin-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.admin-v { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.admin-v.good { color: #1E7A4B; }
.admin-v.bad { color: #C0392B; }
.admin-note { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.admin-note.bad { color: #C0392B; }

.admin-route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.admin-route .admin-note { flex: 0 0 100%; padding-left: 62px; }
.btn-tiny {
  font-size: 11px; border: 1px solid var(--border); background: #fff;
  color: var(--navy); border-radius: 6px; padding: 3px 8px;
}
.btn-tiny:hover { border-color: var(--orange); background: #FFF9F1; }

.cap-editor {
  border: 1px solid var(--orange); background: #FFFCF7;
  border-radius: 8px; padding: 12px 14px; margin: 12px 0;
}
.cap-editor h4 { margin-top: 0; }
.cap-input {
  font-family: var(--font-ui); font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--lt-gray); border-radius: 8px; width: 160px; margin-right: 8px;
}
.cap-input.wide { width: calc(100% - 176px); min-width: 180px; }
.cap-input:focus { outline: none; border-color: var(--blue); }

@media (max-width: 820px) { .panel.wide { width: 100%; } }

/* -------------------------------------------------- message copy actions -- */

.msg-actions {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  opacity: 0; transition: opacity .12s;
}
.msg:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }

.act-done { font-size: 11.5px; color: #1E7A4B; font-weight: 600; }

/* Touch devices have no hover, so keep the actions visible. */
@media (hover: none) {
  .msg-actions { opacity: 1; }
}

/* ------------------------------------------------ admin project table ---- */

.admin-controls { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.admin-search {
  flex: 1; min-width: 150px; font-family: var(--font-ui); font-size: 12.5px;
  padding: 6px 10px; border: 1px solid var(--lt-gray); border-radius: 8px;
}
.admin-search:focus { outline: none; border-color: var(--blue); }
.admin-select {
  font-family: var(--font-ui); font-size: 12.5px; padding: 6px 8px;
  border: 1px solid var(--lt-gray); border-radius: 8px; background: #fff;
  color: var(--navy);
}

.ptable { display: flex; flex-direction: column; gap: 3px; }
.prow { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.prow.open { border-color: var(--blue); }
.prow-main {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  cursor: pointer; font-size: 12.5px;
}
.prow-main:hover { background: var(--bg-subtle); }
.prow-caret { flex: 0 0 10px; color: var(--text-muted); font-size: 10px; }
.prow-name {
  flex: 1 1 130px; min-width: 0; font-weight: 600; color: var(--navy);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prow-owner {
  flex: 0 1 110px; min-width: 0; color: var(--text-muted); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.prow-num {
  flex: 0 0 auto; min-width: 34px; text-align: right;
  color: var(--text-muted); font-size: 11.5px;
}
.cap-bar.mini { flex: 0 0 60px; height: 5px; background: var(--lt-gray); margin: 0; }
.prow-tag {
  flex: 0 0 auto; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--lt-blue); color: var(--navy); border-radius: 999px; padding: 1px 7px;
}
.prow-tag.bad { background: #FDECEA; color: #C0392B; }
.prow-detail {
  padding: 8px 10px 10px 28px; border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

/* ------------------------------------- response card with visible copy --- */

.card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: #fff; box-shadow: 0 1px 2px rgba(14,42,92,.04);
}
.cardhead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 7px 10px 7px 14px;
  background: var(--bg-subtle); border-bottom: 1px solid var(--border);
}
.cardlabel {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 700; color: var(--orange);
}
.cardactions { display: flex; align-items: center; gap: 6px; }
.cardbody { padding: 14px 16px 16px; }
.cardbody .bubble > *:first-child { margin-top: 0; }

/* copy buttons: always visible, in the header */
.copy-code {
  position: static; opacity: 1;
  font-family: var(--font-ui); font-size: 11.5px;
  background: #fff; color: var(--navy);
  border: 1px solid var(--lt-gray); border-radius: 7px;
  padding: 3px 10px; line-height: 1.5;
}
.copy-code:hover { border-color: var(--orange); background: #FFFCF7; }
.copy-code.ghost { color: var(--text-muted); }

/* code block container, matching the response card */
.codewrap {
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin: 0 0 14px;
}
.codehead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px 5px 12px; background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.codelang {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); letter-spacing: .03em;
}
.codewrap pre { margin: 0; border-radius: 0; }
.codewrap pre .copy-code { display: none; }

.msg.assistant .msg-role { display: none; }
.prow-num.wide { min-width: 74px; }
.copy-code:disabled {
  opacity: .45; cursor: not-allowed; border-color: var(--border); background: #fff;
}
.copy-code:disabled:hover { background: #fff; border-color: var(--border); }

/* ------------------------------------------------------- search clearing -- */

.search-box { position: relative; }
.search-clear {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; color: rgba(213,231,240,.75);
  font-size: 17px; line-height: 1; padding: 2px 5px; border-radius: 5px;
}
.search-clear:hover { background: rgba(255,255,255,.16); color: #fff; }

.conv-group.search-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.search-exit {
  background: none; border: 0; color: var(--orange);
  font-family: var(--font-ui); font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 4px; border-radius: 5px; flex: 0 0 auto;
}
.search-exit:hover { background: rgba(247,148,29,.16); }

/* ------------------------------------------------------------ model picker -- */

.picker { position: relative; display: flex; align-items: center; gap: 8px; }
.picker-label {
  font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.picker-btn {
  display: flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--lt-gray); border-radius: 10px;
  padding: 6px 10px 6px 12px; font-family: var(--font-ui);
  box-shadow: 0 1px 2px rgba(14,42,92,.05);
}
.picker-btn:hover:not(:disabled) { border-color: var(--orange); background: #FFFCF7; }
.picker-btn.open { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(64,134,173,.12); }
.picker-btn:disabled { opacity: .55; cursor: not-allowed; }
.picker-name { font-size: 14px; font-weight: 600; color: var(--navy); }
.picker-caret { font-size: 10px; color: var(--text-muted); margin-left: 2px; }

.picker-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  width: 232px; max-width: 88vw; background: #fff;
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(14,42,92,.16); overflow: hidden;
}
.picker-head {
  padding: 8px 14px; background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.picker-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; background: #fff; border: 0;
  border-bottom: 1px solid var(--border); padding: 10px 14px;
}
.picker-item:last-child { border-bottom: 0; }
.picker-item:hover:not(:disabled) { background: #FFFCF7; }
.picker-item.active { background: var(--lt-blue); }
.picker-item.off { opacity: .5; cursor: not-allowed; }
.picker-item-name { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.picker-check {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  background: var(--orange); color: #fff; border-radius: 999px; padding: 1px 7px;
}
.picker-off {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  background: #FDECEA; color: #C0392B; border-radius: 999px; padding: 1px 7px;
}

@media (max-width: 820px) {
  .picker-menu { width: 220px; }
}

/* ------------------------------------------------- full-file analysis ----- */

.analysis-head {
  font-size: 12px; color: var(--navy); background: var(--lt-blue);
  border-radius: 8px; padding: 6px 11px; margin-bottom: 10px;
  display: inline-block;
}

.codepanel {
  border: 1px solid var(--border); border-radius: 10px;
  margin: 0 0 12px; overflow: hidden; background: var(--bg-subtle);
}
.codepanel summary {
  cursor: pointer; padding: 7px 12px; font-size: 11.5px;
  color: var(--text-muted); background: var(--bg-subtle);
  border-bottom: 1px solid transparent;
}
.codepanel[open] summary { border-bottom-color: var(--border); }
.codepanel summary:hover { color: var(--navy); }
.codepanel pre {
  margin: 0; background: #0B1D3F; border-radius: 0;
  max-height: 300px; overflow: auto; padding: 12px 14px;
}
.codepanel pre code {
  color: #DCE6F5; font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
}

.elapsed {
  font-variant-numeric: tabular-nums; color: var(--text-muted);
  font-size: 11.5px; margin-left: 2px;
}

/* ------------------------------------------- files held by a conversation -- */

.ctxbar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 7px 4px 0; font-family: var(--font-ui);
}
.ctxbar-label {
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.ctxchip {
  font-size: 11.5px; color: var(--navy); background: var(--lt-blue);
  border-radius: 999px; padding: 2px 10px;
}
.ctxclear {
  background: none; border: 0; color: var(--text-muted);
  font-size: 11px; text-decoration: underline; padding: 2px 4px;
}
.ctxclear:hover { color: #C0392B; }

/* ------------------------------------------------------------- files panel -- */

.ftable { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 4px 0 14px; }
.ftable th {
  text-align: left; font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border); padding: 5px 8px 5px 0; font-weight: 700;
}
.ftable td { padding: 7px 8px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.ftable a { color: var(--navy); text-decoration: none; border-bottom: 1px solid var(--lt-gray); }
.ftable a:hover { color: var(--orange); border-bottom-color: var(--orange); }
.fnum { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); white-space: nowrap; }
.fconv { color: var(--text-muted); max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact { text-align: right; white-space: nowrap; }
.ftag {
  font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase;
  background: var(--lt-gray); color: var(--navy);
  border-radius: 999px; padding: 1px 6px; margin-left: 6px;
}
.danger-sm, .cancel-sm {
  font-family: var(--font-ui); font-size: 11px; border-radius: 6px;
  padding: 2px 8px; border: 1px solid var(--border); background: #fff;
}
.danger-sm { border-color: #C0392B; color: #C0392B; }
.danger-sm:hover { background: #FDECEA; }
.cancel-sm { color: var(--text-muted); }
.cancel-sm:hover { border-color: var(--orange); color: var(--navy); }
.warn-note {
  font-size: 12px; color: var(--navy); background: #FFF8EC;
  border-left: 3px solid var(--orange); border-radius: 6px;
  padding: 8px 11px; margin: 0 0 12px;
}
.muted.small { font-size: 11.5px; }

/* --------------------------------------------------- admin storage section -- */

.admin-btn {
  font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  color: var(--navy); background: #fff; border: 1px solid var(--lt-gray);
  border-radius: 8px; padding: 6px 13px; margin: 2px 0 14px;
}
.admin-btn:hover { border-color: var(--orange); background: #FFFCF7; }

.statgrid { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.stat {
  flex: 1 1 150px; border: 1px solid var(--border); border-left: 3px solid var(--blue);
  border-radius: 8px; padding: 8px 11px; background: #fff;
}
.stat-k {
  display: block; font-size: 10px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.stat-v { display: block; font-size: 17px; font-weight: 600; color: var(--navy); }
.stat-n { display: block; font-size: 11px; color: var(--text-muted); line-height: 1.4; }

.allfiles summary {
  cursor: pointer; font-size: 11.5px; color: var(--text-muted);
  padding: 5px 0; margin-bottom: 4px;
}
.allfiles summary:hover { color: var(--navy); }

.fdate {
  color: var(--text-muted); font-variant-numeric: tabular-nums;
  white-space: nowrap; font-size: 11.5px;
}
.fsort { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.fsort-label {
  font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.fsort select {
  font-family: var(--font-ui); font-size: 12px; color: var(--navy);
  border: 1px solid var(--lt-gray); border-radius: 7px; padding: 3px 8px; background: #fff;
}

.chip-warn {
  font-size: 10.5px; color: #8A5A00; background: #FFF4DC;
  border-radius: 999px; padding: 1px 7px; margin-left: 5px; white-space: nowrap;
}

/* ------------------------------------------------ a route without vision -- */

.novision {
  font-size: 12.5px; line-height: 1.5; color: var(--navy);
  background: #FFF8EC; border-left: 3px solid var(--orange);
  border-radius: 8px; padding: 9px 12px; margin: 0 0 12px;
}
.novision strong { color: var(--navy); }
.novision-btn {
  display: block; margin-top: 8px; font-family: var(--font-ui); font-size: 12px;
  font-weight: 600; color: #fff; background: var(--orange);
  border: 0; border-radius: 7px; padding: 5px 12px;
}
.novision-btn:hover { background: #E07E00; }

.picker-novis {
  font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase;
  background: #FFF4DC; color: #8A5A00; border-radius: 999px; padding: 1px 7px;
}

/* --------------------------------------------- moving a chat to a project -- */

.movebox {
  margin: 2px 0 6px 14px; padding: 5px 0;
  border-left: 2px solid var(--orange);
}
.movebox-label {
  font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; padding: 0 0 3px 9px;
}
.movebox-item {
  display: block; width: calc(100% - 9px); margin-left: 9px; text-align: left;
  font-family: var(--font-ui); font-size: 12px; color: #fff;
  background: none; border: 0; border-radius: 6px; padding: 4px 8px;
}
.movebox-item:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.movebox-item:disabled { color: rgba(255,255,255,.4); }
.movebox-item.detach { color: #FFC9A8; }
.movebox-empty {
  font-size: 11.5px; color: rgba(255,255,255,.55); padding: 2px 0 2px 9px;
}

.attachchats { margin-top: 10px; }

.rename-input {
  flex: 1; min-width: 0; font-family: var(--font-ui); font-size: 13px;
  font-weight: 600; color: #fff; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 3px 8px;
}
.rename-input:focus { outline: none; border-color: var(--orange); }

/* ------------------------------------- telling Instructions from Memory --- */

.panel-hint.subtle { color: var(--text-muted); font-size: 11.5px; }
.memory-peek {
  font-size: 12.5px; line-height: 1.55; color: var(--navy);
  background: var(--lt-blue); border-left: 3px solid var(--blue);
  border-radius: 6px; padding: 8px 11px; margin: 0 0 6px;
  white-space: pre-wrap; max-height: 140px; overflow: auto;
}
.linklike {
  background: none; border: 0; padding: 0; font-family: var(--font-ui);
  font-size: 11.5px; color: var(--orange); text-decoration: underline;
}
.linklike:hover { color: var(--navy); }

/* ===========================================================================
   COMPARISON — one question, every available route

   The grid is not three columns. It is auto-fit with a minimum width, so the
   count comes from the markup and a fourth agent wraps to a second row instead
   of squeezing the other three. On a narrow screen they stack, which is what
   auto-fit does at that width without a separate rule.
   =========================================================================== */

.cmp-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 8px; padding: 5px 11px;
  font: 600 12px/1 var(--font-ui);
  color: var(--gray); background: #fff;
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.cmp-toggle:hover:not(.off) { border-color: var(--blue); color: var(--navy); }
.cmp-toggle.on {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.cmp-toggle.off { opacity: .45; cursor: not-allowed; }
.cmp-toggle-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lt-gray); flex: 0 0 auto;
}
.cmp-toggle.on .cmp-toggle-dot { background: var(--orange); }

.cmp { width: 100%; }

.cmp-status {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 10px; font: 12px/1.4 var(--font-ui); color: var(--text-muted);
}
.cmp-count { font-weight: 600; color: var(--navy); }
.cmp-waiting { color: var(--text-muted); }
.cmp-skip {
  background: none; border: none; padding: 0;
  font: 600 12px/1 var(--font-ui); color: var(--orange);
  text-decoration: underline; cursor: pointer;
}

.cmp-grid {
  display: grid; gap: 12px; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.cmp-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; box-shadow: var(--shadow); overflow: hidden;
  min-width: 0;                 /* long code lines must not widen the column */
}
.cmp-card.chosen { border-color: var(--orange); border-width: 2px; }
.cmp-card.failed { background: var(--bg-subtle); }

.cmp-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.cmp-name {
  font: 700 12px/1 var(--font-brand); letter-spacing: .04em;
  text-transform: uppercase; color: var(--navy);
}
.cmp-state {
  margin-left: auto; font: 11px/1 var(--font-ui); color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 5px;
}
.cmp-state.err { color: #B4232A; font-weight: 600; }
.cmp-chosen {
  font: 700 10px/1 var(--font-ui); letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--orange);
  padding: 3px 7px; border-radius: 999px;
}

.cmp-body {
  padding: 12px; font-size: 14px; min-width: 0;
  /* Tall answers scroll inside their own card so three cards stay comparable
     rather than one making the page enormous. */
  max-height: 460px; overflow-y: auto; overscroll-behavior: contain;
}
.cmp-body pre { max-width: 100%; overflow-x: auto; }

.cmp-foot {
  padding: 10px 12px; border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}
.cmp-use { width: 100%; font-size: 13px; }

.cmp-note {
  margin: 10px 0 0; font: 12px/1.5 var(--font-ui); color: var(--text-muted);
}

/* ---- the answers not chosen, on a turn already decided ---- */

.cmp-others { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.cmp-others-btn {
  background: none; border: none; padding: 0;
  font: 600 12px/1 var(--font-ui); color: var(--blue);
  cursor: pointer; text-decoration: underline;
}
.cmp-others-body { margin-top: 10px; display: grid; gap: 10px; }
.cmp-other {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; background: var(--bg-subtle); min-width: 0;
}
.cmp-other-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}

@media (max-width: 640px) {
  /* One card at a time on a phone, and shorter so the status line and the next
     card's heading stay reachable without a long scroll. */
  .cmp-grid { grid-template-columns: 1fr; }
  .cmp-body { max-height: 320px; }
  .cmp-toggle { margin-left: 6px; padding: 5px 9px; }
}

/* A comparison answer that arrived but was degraded — an unclean stream close,
   or text with no token usage reported. Shown rather than hidden: the first live
   comparisons produced perfect-looking cards with no cost recorded, and finding
   that in the workbook a day later is worse than a line on the card. */
.cmp-degraded {
  margin-top: 10px; padding: 8px 10px;
  border-left: 3px solid var(--orange); background: var(--bg-subtle);
  font: 12px/1.5 var(--font-ui); color: var(--text-muted);
}

/* ===========================================================================
   SHARING — members, shared conversations, and the read-only view
   =========================================================================== */

.mem { margin-top: 18px; }
.mem-list { display: grid; gap: 4px; margin: 8px 0; }
.mem-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-subtle);
  font: 13px/1.3 var(--font-ui);
}
.mem-name { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mem-role {
  margin-left: auto; font: 700 10px/1 var(--font-ui); letter-spacing: .05em;
  text-transform: uppercase; color: var(--gray);
  border: 1px solid var(--lt-gray); border-radius: 999px; padding: 3px 7px;
}
.mem-role.owner { color: #fff; background: var(--navy); border-color: var(--navy); }
.mem-x {
  background: none; border: none; cursor: pointer; padding: 0 2px;
  font-size: 16px; line-height: 1; color: var(--gray);
}
.mem-x:hover { color: #B4232A; }
.mem-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.mem-select {
  flex: 1 1 160px; min-width: 0; padding: 6px 8px;
  font: 13px/1.2 var(--font-ui);
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.mem-open { margin-top: 6px; }

.shared-box { margin-top: 18px; }
.shared-list { display: grid; gap: 4px; margin-top: 8px; }
.shared-row {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; cursor: pointer;
  font: 13px/1.3 var(--font-ui);
}
.shared-row:hover { border-color: var(--blue); background: var(--bg-subtle); }
.shared-title { color: var(--text); min-width: 0; overflow: hidden;
                white-space: nowrap; text-overflow: ellipsis; }
.shared-by { margin-left: auto; color: var(--text-muted); font-size: 12px;
             white-space: nowrap; }
.shared-data {
  font: 700 9px/1 var(--font-ui); letter-spacing: .05em; text-transform: uppercase;
  color: #fff; background: var(--gray); padding: 3px 6px; border-radius: 999px;
}

/* a shared conversation is marked in the sidebar so its author can see it */
.row-shared {
  font: 700 9px/1 var(--font-ui); letter-spacing: .05em; text-transform: uppercase;
  color: var(--orange); border: 1px solid var(--orange);
  border-radius: 999px; padding: 2px 5px; margin-left: 6px; flex: 0 0 auto;
}

.movebox-label.share { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.movebox-item.share.on { color: var(--orange); font-weight: 600; }

/* read-only view of someone else's conversation */
.panel.wide { max-width: 760px; width: min(760px, 96vw); }
.ro-banner {
  padding: 9px 12px; margin-bottom: 12px;
  border-left: 3px solid var(--navy); background: var(--lt-blue);
  font: 13px/1.5 var(--font-ui); color: var(--text);
}
.ro-data {
  padding: 9px 12px; margin-bottom: 12px;
  border-left: 3px solid var(--orange); background: var(--bg-subtle);
  font: 12px/1.5 var(--font-ui); color: var(--text-muted);
}
.ro-thread { display: grid; gap: 14px; }

/* new shared conversations, and a project somebody shared with you.
   Chosen over email deliberately: a conversation title is content, and pushing
   it into a mailbox would disclose more than the notification is about. */
.proj-new {
  font: 700 9px/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--orange); border-radius: 999px;
  padding: 3px 6px; margin-left: 6px; flex: 0 0 auto;
}
.proj-shared {
  font: 700 9px/1 var(--font-ui); letter-spacing: .04em; text-transform: uppercase;
  color: var(--lt-blue); border: 1px solid var(--lt-blue);
  border-radius: 999px; padding: 2px 5px; margin-left: 6px; flex: 0 0 auto;
}

/* admin: sharing overview */
.adm-tiles { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.adm-tile {
  flex: 1 1 120px; padding: 10px 12px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-subtle);
}
.adm-tile-n { font: 700 22px/1.1 var(--font-brand); color: var(--navy); }
.adm-tile-l {
  font: 11px/1.3 var(--font-ui); color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em; margin-top: 4px;
}
.adm-table { width: 100%; border-collapse: collapse; font: 12px/1.4 var(--font-ui); }
.adm-table th {
  text-align: left; padding: 7px 8px; background: var(--navy); color: #fff;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: 10px;
}
.adm-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.adm-table tr:nth-child(even) td { background: var(--bg-subtle); }
.adm-table td.adm-warn { color: #B4232A; font-weight: 600; }

/* the member picker: type to filter, because a dropdown does not survive
   three hundred people */
.mem-avail {
  display: block; margin-top: 4px; font-size: 11px; color: var(--text-muted);
}
.mem-find {
  width: 100%; padding: 7px 10px; font: 13px/1.3 var(--font-ui);
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.mem-find:focus { outline: none; border-color: var(--blue); }
.mem-results {
  margin-top: 6px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
  overscroll-behavior: contain;
}
.mem-result {
  display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left;
  padding: 7px 10px; background: #fff; border: none; cursor: pointer;
  border-bottom: 1px solid var(--border); font: 13px/1.3 var(--font-ui);
}
.mem-result:last-child { border-bottom: none; }
.mem-result:hover:not(:disabled) { background: var(--lt-blue); }
.mem-result-name { color: var(--text); }
.mem-result-upn {
  margin-left: auto; font-size: 11px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%;
}
.mem-more {
  padding: 6px 10px; font: 11px/1.3 var(--font-ui); color: var(--text-muted);
  background: var(--bg-subtle);
}
.mem-add { display: block; }
.mem-add-foot {
  display: flex; align-items: center; gap: 10px; margin-top: 8px;
}

/* the directory note, visible without opening the picker */
.mem-note {
  border-left: 3px solid var(--orange); background: var(--bg-subtle);
  padding: 7px 10px; margin: 0 0 8px;
}

/* header row for the admin tables — two unlabelled numbers were read as
   message counts when they mean projects owned and project characters */
.prow.head .prow-main {
  background: var(--navy); border-radius: var(--radius) var(--radius) 0 0;
}
.prow.head .prow-name,
.prow.head .prow-owner,
.prow.head .prow-num {
  color: #fff; font: 700 10px/1.2 var(--font-ui);
  letter-spacing: .05em; text-transform: uppercase;
}
