/* MedAtlas web chat. Palette and type follow www.covariance.gr:
   navy #060020, slate #2d4156, cyan accent #23b3e8, greys, Open Sans.
   The logo's blue gradient and lime bar provide the secondary accents. */
@font-face {
  font-family: "Open Sans";
  src: url("/static/OpenSans.woff2") format("woff2");
  font-weight: 300 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --navy: #060020;
  --slate: #2d4156;
  --deep-blue: #0f4c6e;
  --cyan: #23b3e8;
  --cyan-dark: #1693c2;
  --lime: #8cc63f;
  --text: #333333;
  --muted: #666666;
  --faint: #999999;
  --line: #e9eaee;
  --bg: #f4f5f8;
  --card: #ffffff;
  --user-bubble: #2d4156;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(6, 0, 32, .06), 0 4px 16px rgba(6, 0, 32, .06);
  --font: "Open Sans", "Segoe UI", Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.brand { font-weight: 700; letter-spacing: .2px; color: var(--navy); }
.brand span { color: var(--cyan); }

/* Buttons: uppercase CTAs like the site's "CONTACT US TODAY" */
.btn-primary {
  border: 0;
  border-radius: 4px;
  background: var(--cyan);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: 13px;
  padding: 12px 18px;
  transition: background .15s;
}
.btn-primary:hover { background: var(--cyan-dark); }
.btn-primary:disabled { background: #9fd8ee; cursor: progress; }
.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--slate);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan-dark); }
.icon-btn { border: 0; background: transparent; padding: 6px; border-radius: 6px; }
.icon-btn svg { width: 22px; height: 22px; stroke: var(--slate); stroke-width: 2; fill: none; stroke-linecap: round; }

/* ---------- Login ---------- */
.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 15% 20%, rgba(35, 179, 232, .25), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(140, 198, 63, .12), transparent 40%),
    linear-gradient(160deg, var(--navy) 0%, #0b1a3a 55%, var(--slate) 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
  text-align: center;
}
.login-logo { border-radius: 50%; }
.login-card h1 { margin: 10px 0 2px; font-size: 30px; }
.login-sub { margin: 0 0 24px; color: var(--muted); }
.login-card form { text-align: left; display: flex; flex-direction: column; }
.login-card label { font-size: 13px; font-weight: 600; color: var(--slate); margin: 10px 0 6px; }
.login-card input {
  border: 1px solid #cccccc;
  border-radius: 4px;
  padding: 11px 12px;
  background: #fafafa;
}
.login-card input:focus { border-color: var(--cyan); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(35, 179, 232, .18); }
.login-card .btn-primary { margin-top: 20px; padding: 13px; }
.error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
.login-note { margin: 20px 0 0; font-size: 12px; color: var(--faint); }
.powered { color: rgba(255, 255, 255, .65); font-size: 12px; margin-top: 22px; letter-spacing: .3px; }
.powered strong { color: #fff; letter-spacing: 1.5px; }

/* ---------- App shell ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: 60px 1fr;
  grid-template-areas: "top top" "side main";
}
.topbar {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  background: #fff;
  border-bottom: 3px solid var(--cyan);
  box-shadow: 0 1px 0 var(--line);
  z-index: 3;
}
.menu-btn { display: none; }
.topbar-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.topbar-brand img { border-radius: 50%; }
.brand .alpha { margin-left: 2px; font-size: .6em; font-weight: 600; font-style: italic; color: var(--lime); vertical-align: super; line-height: 0; }
.dept-pill {
  background: rgba(35, 179, 232, .12);
  color: var(--deep-blue);
  border: 1px solid rgba(35, 179, 232, .35);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40vw;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#logout-btn { border-color: #b9c0cc; color: var(--navy); font-weight: 600; background: #fff; }
#logout-btn:hover { border-color: var(--cyan); color: var(--cyan-dark); background: rgba(35, 179, 232, .06); }
.user { color: var(--muted); font-size: 13px; }

.sidebar {
  grid-area: side;
  background: var(--navy);
  color: #d9dce6;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.new-chat { width: 100%; }
.side-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: #8a90a6;
  margin: 22px 6px 8px;
  font-weight: 700;
}
.conv-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.conv-list li button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d9dce6;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid transparent;
}
.conv-list li button:hover { background: rgba(255, 255, 255, .06); }
.conv-list li.active button { background: rgba(35, 179, 232, .14); border-left-color: var(--lime); color: #fff; }
.side-foot { font-size: 12px; color: #8a90a6; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.side-foot p { margin: 0 0 8px; }
.side-foot strong { color: #fff; }
.scrim { display: none; }

/* ---------- Chat ---------- */
.chat { grid-area: main; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 28px 24px 12px; }
.messages > * { max-width: 860px; margin-left: auto; margin-right: auto; }

.welcome { text-align: center; padding: 6vh 8px 20px; color: var(--muted); }
.welcome img { border-radius: 50%; }
.welcome h2 { color: var(--navy); font-size: 26px; margin: 12px 0 6px; font-weight: 700; }
.welcome h2 span { color: var(--cyan); }
.welcome p { max-width: 560px; margin: 0 auto; }
.examples { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.examples button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  color: var(--slate);
  box-shadow: var(--shadow);
}
.examples button:hover { border-color: var(--cyan); color: var(--cyan-dark); }

.msg { display: flex; margin: 0 auto 18px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  background: var(--user-bubble);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 16px;
  max-width: 78%;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.msg.bot .card {
  background: var(--card);
  border-radius: 4px 14px 14px 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--cyan);
  padding: 14px 18px;
  max-width: 100%;
  min-width: 0;
  flex: 1;
}
.msg.bot.refusal .card { border-left-color: var(--faint); color: var(--muted); }
.msg.bot.failed .card { border-left-color: var(--danger); }
.answer p { margin: 0 0 10px; }
.answer p:last-child { margin-bottom: 0; }
.answer ul, .answer ol { margin: 0 0 10px; padding-left: 22px; }
.answer li { margin: 3px 0; }
.answer h3, .answer h4 { color: var(--navy); margin: 12px 0 6px; font-size: 15.5px; }
.answer code { background: var(--bg); padding: 1px 5px; border-radius: 3px; font-size: 13.5px; }
.cite {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin: 0 1px;
  border: 0;
  border-radius: 9px;
  background: rgba(35, 179, 232, .15);
  color: var(--deep-blue);
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  vertical-align: 2px;
}
.cite:hover { background: var(--cyan); color: #fff; }

.sources { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.sources summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--slate);
  list-style: none;
}
.sources summary::-webkit-details-marker { display: none; }
.sources summary::before { content: "▸ "; color: var(--cyan); }
.sources[open] summary::before { content: "▾ "; }
.source {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  transition: border-color .3s, box-shadow .3s;
}
.source.flash { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(35, 179, 232, .2); }
.source-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.source-num { font-weight: 700; color: var(--cyan-dark); }
.source-name { font-weight: 600; color: var(--navy); word-break: break-word; }
.source-meta { color: var(--faint); font-size: 12px; }
/* Preview: the top of the excerpt at readable width, faded at the cut; click for the whole region. */
.source-img-btn { position: relative; display: block; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; cursor: zoom-in; width: 100%; max-width: 640px; max-height: 220px; overflow: hidden; line-height: 0; }
.source-img-btn::after { content: "Μεγέθυνση ⤢"; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; display: flex;
  align-items: flex-end; justify-content: flex-end; padding: 0 10px 6px; font-size: 11.5px; font-weight: 600; line-height: 1;
  color: var(--deep-blue); background: linear-gradient(rgba(255, 255, 255, 0), #fff 80%); }
.source-img-btn:hover { border-color: var(--cyan); }
.source-img { display: block; width: 100%; height: auto; }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(6, 0, 32, .78); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox figure { margin: 0; position: relative; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 110px); background: #fff; border-radius: 4px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lightbox figcaption { color: #fff; font-size: 13px; margin-top: 10px; text-align: center; word-break: break-word; }
.lightbox-close { position: absolute; top: -14px; right: -14px; width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: #fff; color: var(--navy); font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.lightbox-close:hover { background: var(--cyan); color: #fff; }
.source-snippet { margin: 6px 0 0; color: var(--muted); white-space: pre-wrap; max-height: 7.5em; overflow: hidden; }
.msg-meta { font-size: 11.5px; color: var(--faint); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.feedback { display: inline-flex; align-items: center; gap: 4px; }
.fb-label { font-size: 12px; color: var(--faint); margin-right: 4px; }
.fb { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px; line-height: 0; }
.fb svg { width: 17px; height: 17px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linejoin: round; }
.fb.down svg { transform: scaleY(-1); }
.fb:hover { border-color: var(--line); }
.fb:hover svg { stroke: var(--slate); }
.fb.on svg { fill: var(--cyan); stroke: var(--cyan-dark); }
.fb.down.on svg { fill: #e8a39b; stroke: var(--danger); }

.typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); opacity: .35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; background: var(--deep-blue); }
.typing i:nth-child(3) { animation-delay: .4s; background: var(--lime); }
@keyframes blink { 50% { opacity: 1; transform: translateY(-2px); } }
.typing-label { font-size: 13px; color: var(--faint); margin-left: 8px; }

.composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 860px;
  width: calc(100% - 48px);
  margin: 8px auto 0;
  background: #fff;
  border: 1px solid #d5d8df;
  border-radius: 12px;
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow);
}
.composer:focus-within { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(35, 179, 232, .15); }
.composer textarea { flex: 1; border: 0; resize: none; outline: none; padding: 8px 0; max-height: 200px; background: transparent; }
.send { width: 42px; height: 42px; border: 0; border-radius: 8px; background: var(--cyan); display: grid; place-items: center; flex: none; }
.send:hover { background: var(--cyan-dark); }
.send:disabled { background: #b8e3f3; cursor: progress; }
.send svg { width: 20px; height: 20px; fill: #fff; }
.composer-hint { text-align: center; font-size: 11.5px; color: var(--faint); margin: 6px 0 12px; }

/* ---------- Admin: ratings ---------- */
.app.admin-mode { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
.app.admin-mode .sidebar, .app.admin-mode .chat, .app.admin-mode .menu-btn, .app.admin-mode .scrim { display: none !important; }
.admin { grid-area: main; overflow-y: auto; min-width: 0; }
.admin-inner { max-width: 1140px; margin: 0 auto; padding: 26px 24px 40px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-head h2 { margin: 0; color: var(--navy); font-size: 24px; }
.admin-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; max-width: 620px; }
.admin-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 13px; color: var(--slate); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--navy); color: #fff; }
.btn-link { text-decoration: none; display: inline-block; padding: 9px 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; border-top: 3px solid var(--cyan); }
.stat.good { border-top-color: var(--lime); }
.stat.bad { border-top-color: var(--danger); }
.stat.warn { border-top-color: #e6a23c; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; color: var(--slate); }
.panel-note { margin: -4px 0 10px; font-size: 12.5px; color: var(--faint); }
.table-wrap { overflow-x: auto; }
.panel table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 13.5px; }
.panel th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--line); padding: 8px 10px; white-space: nowrap; }
.panel td { border-bottom: 1px solid var(--line); padding: 8px 10px; vertical-align: top; }
.panel tr:last-child td { border-bottom: 0; }
.panel .num { text-align: right; white-space: nowrap; }
.panel td.doc { word-break: break-word; }
.panel td.empty, .recent li.empty { color: var(--faint); text-align: center; padding: 18px; }
.muted { color: var(--faint); font-size: 12px; }
.bar { display: inline-block; width: 90px; height: 8px; background: #f3d6d2; border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.bar span { display: block; height: 100%; background: var(--lime); }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.recent li:last-child { border-bottom: 0; }
.recent .when { color: var(--faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.recent .who { font-weight: 600; color: var(--navy); }
.recent .docs { color: var(--muted); flex: 1 1 100%; padding-left: 28px; word-break: break-word; }
.tag { font-size: 11px; background: #fff4e0; color: #9a6400; border-radius: 9px; padding: 1px 8px; }

/* ---------- Admin console ---------- */
.admin { display: flex; flex-direction: column; }
.tabs { display: flex; gap: 2px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; position: sticky; top: 0; z-index: 2; }
.tabs button { border: 0; background: transparent; padding: 13px 16px 11px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--cyan); }
.admin-inner { width: 100%; }
.error.banner { background: #fdecea; border: 1px solid #f5c6c0; border-radius: 6px; padding: 10px 14px; margin: 0 0 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 .panel { margin-bottom: 16px; }
.svc { list-style: none; margin: 0; padding: 0; }
.svc li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.svc li:last-child { border-bottom: 0; }
.svc-name { flex: 1; font-weight: 600; color: var(--navy); }
.svc-state { color: var(--muted); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.ok { background: var(--lime); box-shadow: 0 0 0 3px rgba(140, 198, 63, .2); }
.dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(192, 57, 43, .2); }
.dot.idle { background: #e6a23c; }
.kv { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; padding: 6px 0; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { font-weight: 600; color: var(--navy); text-align: right; }
.ok-txt { color: #4d8a14 !important; }
.bad-txt { color: var(--danger) !important; }
.meter { display: block; height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 2px 0 12px; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--deep-blue)); }
.meter.hot span { background: var(--danger); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.panel-head h3 { margin: 0; }
.panel-head input[type=search] { border: 1px solid #ccc; border-radius: 4px; padding: 7px 10px; min-width: 240px; }
.btn-ghost.sm { padding: 4px 9px; font-size: 12px; }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
.actions { white-space: nowrap; }
.actions .btn-ghost + .btn-ghost { margin-left: 4px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 9px; padding: 1px 9px; white-space: nowrap; }
.pill.ok { background: #eaf5dc; color: #4d8a14; }
.pill.warn { background: #fff4e0; color: #9a6400; }
.pill.bad { background: #fdecea; color: var(--danger); }
.pill.idle { background: var(--bg); color: var(--muted); }
.panel tr.sel td { background: rgba(35, 179, 232, .07); }
.panel tr.off td { opacity: .6; }
.panel tfoot td { border-bottom: 0; padding-top: 10px; }
.nowrap { white-space: nowrap; }
.upload { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; margin-bottom: 8px; }
.upload label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--slate); }
.upload select { border: 1px solid #ccc; border-radius: 4px; padding: 9px 10px; background: #fff; min-width: 260px; font-size: 14px; font-weight: 400; color: var(--text); }
.drop { flex: 1 1 280px; border: 2px dashed #cdd3dc; border-radius: 8px; background: #fafbfc; justify-content: center; align-items: center;
  text-align: center; padding: 12px; cursor: pointer; min-height: 62px; font-weight: 400 !important; color: var(--muted) !important; font-size: 13.5px !important; }
.drop.over, .drop:hover { border-color: var(--cyan); background: rgba(35, 179, 232, .05); }
.drop input { display: none; }
.upload .btn-primary { align-self: flex-end; padding: 12px 18px; }
.job { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; background: #fafbfc; }
.job-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.job-sum { margin: 6px 0 0; font-size: 13px; }
.job details { margin-top: 6px; font-size: 13px; }
.job summary { cursor: pointer; color: var(--slate); font-weight: 600; font-size: 12px; }
.log { background: var(--navy); color: #d9dce6; border-radius: 6px; padding: 10px; font-size: 11.5px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.secret { background: #fffbe6; border: 1px solid #f2d675; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.secret code { font-size: 15px; background: #fff; padding: 2px 8px; border-radius: 4px; border: 1px solid #f2d675; user-select: all; }
.secret p { margin: 6px 0 8px; font-size: 13px; color: var(--muted); }
code { font-size: 12.5px; }

/* ---------- Contradictions ---------- */
#cf-filter { margin: 0 0 14px; }
.cf-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cf-head strong { color: var(--navy); font-size: 15px; }
.cf-expl { margin: 8px 0 12px; color: var(--text); }
.cf-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.cf-side { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fafbfc; min-width: 0; }
.cf-label { font-size: 11px; font-weight: 700; color: var(--cyan-dark); letter-spacing: 1px; }
.cf-quote { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--danger); background: #fff; font-size: 14px; color: var(--navy); }
.cf-ctx { margin-top: 8px; font-size: 13px; color: var(--muted); }
.cf-ctx summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--slate); }
.cf-ctx mark { background: #ffe58a; color: inherit; padding: 0 2px; }
.cf-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.cf-note { flex: 1 1 260px; border: 1px solid #ccc; border-radius: 4px; padding: 6px 9px; font-size: 13px; }
button:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .menu-btn { display: block; }
  .user { display: none; }
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar-brand .brand { display: none; }
  .dept-pill { flex: 1 1 auto; min-width: 0; max-width: none; }
  .topbar-right { margin-left: 0; flex: none; }
  .btn-ghost { padding: 6px 9px; }
  .sidebar {
    position: fixed;
    top: 63px;
    bottom: 0;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .2s;
    z-index: 5;
  }
  .sidebar.open { transform: none; }
  .scrim { display: block; position: fixed; inset: 63px 0 0 0; background: rgba(6, 0, 32, .4); z-index: 4; }
  .messages { padding: 18px 12px 8px; }
  .composer { width: calc(100% - 24px); }
  .msg.user .bubble { max-width: 90%; }
  .admin-inner { padding: 18px 14px 32px; }
  .tabs { padding: 0 6px; }
  .tabs button { padding: 12px 10px 10px; font-size: 13px; }
  .upload select { min-width: 0; width: 100%; }
  .upload label { width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
