/* Fieldnote chat UI.
 *
 * Organised as: tokens -> layout -> sidebar -> conversation -> markdown ->
 * progress -> outcomes -> composer -> responsive.
 *
 * The palette is deliberately achromatic. This is a tool for reading numbers
 * off crop simulations, and a tinted surface competes with the only thing on
 * screen that should carry meaning -- the result. Hue is spent in exactly one
 * place: a system fault, which must never be mistakable for a finished run.
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=IBM+Plex+Sans:wght@400;450;500;600;700&display=swap');

/* ---- tokens ------------------------------------------------------------- */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #f7f7f8;
  --raised: #ffffff;
  --bubble: #f4f4f4;

  --text: #0d0d0d;
  --text-soft: #5d5d5d;
  --text-faint: #8e8e8e;

  --line: #e5e5e5;
  --line-strong: #d0d0d0;

  --invert-bg: #0d0d0d;
  --invert-text: #ffffff;

  /* The only hues in the system, both heavily desaturated. */
  --caution: #8a6410;
  --fault: #b42318;

  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 10px;
  --radius-lg: 16px;
  --measure: 720px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #212121;
  --surface: #181818;
  --raised: #2a2a2a;
  --bubble: #303030;

  --text: #ececec;
  --text-soft: #b4b4b4;
  --text-faint: #8e8e8e;

  --line: #3a3a3a;
  --line-strong: #4d4d4d;

  --invert-bg: #ffffff;
  --invert-text: #0d0d0d;

  --caution: #d9a441;
  --fault: #f27b72;
}

* { box-sizing: border-box; }

/* Several controls below set an explicit `display`, which outranks the user
 * agent's rule for the `hidden` attribute. Without this the stop button sits
 * next to send on a page that is not generating anything. */
[hidden] { display: none !important; }

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

button, input, textarea { font-family: inherit; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

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

.app-shell { display: flex; min-height: 100dvh; }

.main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100dvh;
}

.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 18; }

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

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  background: var(--surface);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-y: auto;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }

.brand-mark {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--invert-bg);
  color: var(--invert-text);
  display: grid; place-items: center;
  font-size: 14px;
}

.brand-text strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.brand-text span { display: block; font-size: 11.5px; color: var(--text-faint); }

.new-chat {
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--text);
  border-radius: var(--radius);
  padding: 9px 11px;
  text-align: left;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
}
.new-chat:hover { background: var(--bubble); }
.new-chat span { font-size: 15px; margin-right: 6px; }

.sidebar-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-faint);
  margin: 22px 8px 6px;
}

.chat-list { display: flex; flex-direction: column; gap: 1px; max-height: 32vh; overflow-y: auto; }
.chat-empty { margin: 2px 8px; font-size: 13px; color: var(--text-faint); }

.chat-item { display: flex; align-items: center; border-radius: 8px; }
.chat-item:hover { background: var(--bubble); }
.chat-item.active { background: var(--bubble); }

.chat-open {
  flex: 1; min-width: 0;
  border: 0; background: none; cursor: pointer;
  text-align: left;
  padding: 8px;
  font-size: 13.5px;
  color: var(--text-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-item.active .chat-open { color: var(--text); }

.chat-delete {
  border: 0; background: none; cursor: pointer;
  color: var(--text-faint); font-size: 16px; line-height: 1;
  padding: 6px 8px; border-radius: 6px;
  opacity: 0;
}
.chat-item:hover .chat-delete, .chat-delete:focus-visible { opacity: 1; }
.chat-delete:hover { color: var(--text); }

.suggestion-list { display: flex; flex-direction: column; gap: 1px; }
.suggestion {
  border: 0; background: none; cursor: pointer;
  text-align: left; padding: 8px; border-radius: 8px;
  color: var(--text-soft); font-size: 13.5px;
}
.suggestion:hover { background: var(--bubble); color: var(--text); }
.suggestion:disabled, .starter:disabled { opacity: .45; cursor: not-allowed; }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 12px 8px 4px;
  color: var(--text-faint);
  font-size: 12px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.sidebar-bottom small { width: 100%; font-size: 11.5px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint); }

/* ---- topbar ------------------------------------------------------------- */

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-title {
  flex: 1; min-width: 0; margin: 0;
  font-size: 14px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.icon-button {
  border: 0;
  background: none;
  color: var(--text-soft);
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 15px;
  flex: 0 0 auto;
}
.icon-button:hover { background: var(--bubble); color: var(--text); }
.drawer-toggle { display: none; }

.banner {
  margin: 12px auto 0;
  max-width: var(--measure);
  width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--caution);
  color: var(--text-soft);
  font-size: 13.5px;
}

/* ---- conversation ------------------------------------------------------- */

.conversation {
  flex: 1;
  overflow-y: auto;
  padding: 24px 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome { margin: auto; max-width: var(--measure); text-align: center; padding: 16px 0 48px; }
.welcome.hidden { display: none; }
.welcome-icon {
  width: 40px; height: 40px; margin: 0 auto 18px;
  border-radius: 11px; background: var(--invert-bg); color: var(--invert-text);
  display: grid; place-items: center; font-size: 19px;
}
.welcome h2 { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin: 0 0 10px; }
.welcome-copy { color: var(--text-soft); font-size: 14.5px; max-width: 54ch; margin: 0 auto; }

.starter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 28px;
}
.starter {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 13px;
  text-align: left;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
  color: inherit;
}
.starter:hover { background: var(--surface); border-color: var(--line-strong); }
.starter strong { font-size: 13.5px; font-weight: 550; }
.starter span { font-size: 12.5px; color: var(--text-faint); }

.message-row { display: flex; gap: 12px; max-width: var(--measure); width: 100%; margin: 0 auto; }
.message-row.user { justify-content: flex-end; }

.avatar {
  width: 26px; height: 26px; flex: 0 0 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  display: grid; place-items: center; font-size: 12px;
  margin-top: 3px;
}

.bubble { min-width: 0; }
.message-row.user .bubble {
  background: var(--bubble);
  padding: 10px 15px;
  border-radius: var(--radius-lg);
  max-width: 80%;
}
.message-row.user .bubble p { margin: 0; white-space: pre-wrap; }
.message-row.assistant .bubble { flex: 1; }

/* ---- markdown ----------------------------------------------------------- */

.markdown { font-variant-numeric: tabular-nums; }
.markdown > *:first-child { margin-top: 0; }
.markdown > *:last-child { margin-bottom: 0; }
.markdown p { margin: 0 0 14px; max-width: 74ch; }
.markdown h3, .markdown h4, .markdown h5, .markdown h6 {
  margin: 24px 0 8px; line-height: 1.35; font-weight: 600; letter-spacing: -.01em;
}
.markdown h3 { font-size: 18px; }
.markdown h4 { font-size: 15.5px; }
.markdown ul, .markdown ol { margin: 0 0 14px; padding-left: 20px; max-width: 74ch; }
.markdown li { margin: 5px 0; }
.markdown blockquote {
  margin: 0 0 14px; padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line-strong); color: var(--text-soft);
}
.markdown hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.markdown a { color: var(--text); text-underline-offset: 3px; }
.markdown code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: .5px 4px; border-radius: 5px;
}
.markdown strong { font-weight: 600; }

.code-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0 0 14px;
}
.code-block code { background: none; border: 0; padding: 0; font-size: 12.5px; line-height: 1.65; }

.table-scroll { overflow-x: auto; margin: 0 0 16px; }
/* min-width rather than width: columns size to their content and only stretch
 * to fill when the table is narrower than the bubble, so a two-column result
 * does not end up with one enormous label column. */
.markdown table { border-collapse: collapse; min-width: 100%; font-size: 13.5px; }
.markdown th, .markdown td {
  padding: 8px 14px 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.markdown th {
  font-weight: 550; white-space: nowrap;
  color: var(--text-soft);
  border-bottom-color: var(--line-strong);
}
.markdown td { font-variant-numeric: tabular-nums; }
.markdown tbody tr:last-child td { border-bottom: 0; }

/* ---- progress trace ----------------------------------------------------- */

.progress-trace { color: var(--text-soft); }
.progress-label { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }

.progress-spinner {
  width: 12px; height: 12px; flex: 0 0 12px;
  border: 1.5px solid var(--line-strong); border-top-color: var(--text);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.progress-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.progress-step { display: flex; align-items: baseline; gap: 9px; font-size: 13px; color: var(--text-faint); }
.progress-step.running { color: var(--text-soft); }
.progress-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: var(--line-strong); }
.progress-step.running .progress-dot { background: var(--text-soft); animation: pulse 1.2s ease-in-out infinite; }
.progress-step.done .progress-dot { background: var(--text-soft); }
.progress-step.warned .progress-dot { background: var(--caution); }
.progress-detail { color: var(--text-faint); }
@keyframes pulse { 50% { opacity: .3; } }

.run-trace { margin: 16px 0 0; font-size: 12.5px; }
.run-trace summary { cursor: pointer; color: var(--text-faint); }
.run-trace .progress-steps { margin-top: 10px; }

/* ---- outcome states ----------------------------------------------------- */

/* Structure, not colour: a rule and a label carry the state. Only a system
 * fault gets a hue, because it is the one outcome the reader must not skim
 * past as though the run had finished normally. */
.outcome {
  border-left: 2px solid var(--line-strong);
  padding: 2px 0 2px 14px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--text-soft);
  display: flex; flex-direction: column; gap: 5px;
  align-items: flex-start;
}
.outcome strong { font-size: 13.5px; font-weight: 600; color: var(--text); }
.outcome-caution { border-left-color: var(--caution); }
.outcome-caution strong { color: var(--caution); }
.outcome-danger { border-left-color: var(--fault); }
.outcome-danger strong { color: var(--fault); }

.outcome-list { margin: 0; padding-left: 18px; }
.outcome-hint { font-size: 12.5px; color: var(--text-faint); }

.outcome-form { display: flex; gap: 8px; margin-top: 4px; width: 100%; max-width: 440px; }
.outcome-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px; padding: 8px 11px; font-size: 13.5px;
}
.outcome-input::placeholder { color: var(--text-faint); }

.outcome-submit, .outcome-action {
  border: 0;
  background: var(--invert-bg);
  color: var(--invert-text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.outcome-submit:hover, .outcome-action:hover { opacity: .85; }

.outcome-chip {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.outcome-chip:hover { background: var(--surface); }

/* ---- message actions and provenance ------------------------------------- */

.message-actions { display: flex; align-items: center; gap: 2px; margin-top: 14px; flex-wrap: wrap; }

.message-action {
  border: 0;
  background: none;
  color: var(--text-faint);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.message-action:hover { background: var(--bubble); color: var(--text); }
.icon { width: 14px; height: 14px; fill: currentColor; }
.icon.small { width: 13px; height: 13px; }

.provenance {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-faint);
}
.provenance code {
  font-family: var(--mono);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 5px; padding: 1.5px 5px;
}
.provenance-count { font-variant-numeric: tabular-nums; }

/* ---- feedback ----------------------------------------------------------- */

.feedback { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: 8px; }
.feedback-buttons { display: inline-flex; gap: 2px; }

.feedback-button {
  border: 0; background: none; color: var(--text-faint);
  border-radius: 7px; padding: 5px 7px; cursor: pointer;
  display: inline-flex; align-items: center;
}
.feedback-button:hover { background: var(--bubble); color: var(--text); }
.feedback-button.chosen { color: var(--text); background: var(--bubble); }
.feedback-button svg { width: 15px; height: 15px; fill: currentColor; }

.feedback-status { font-size: 11.5px; color: var(--text-faint); }

/* The note appears under the thumbs and is never in anyone's way: the vote is
 * already saved, so ignoring this row costs nothing. */
.feedback-note { display: flex; gap: 6px; width: 100%; max-width: 420px; margin-top: 6px; }
.feedback-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 7px 10px; font-size: 13px;
}
.feedback-input::placeholder { color: var(--text-faint); }
.feedback-send {
  border: 0; background: var(--invert-bg); color: var(--invert-text);
  border-radius: 8px; padding: 7px 13px; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.feedback-send:hover { opacity: .85; }
.feedback-send:disabled { opacity: .5; cursor: not-allowed; }

/* ---- technical details -------------------------------------------------- */

.technical-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12.5px;
}
.technical-details summary { cursor: pointer; color: var(--text-faint); }
.attempt-detail { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.attempt-detail > span { color: var(--text-faint); font-size: 11.5px; }
.attempt-detail pre, .technical-details pre {
  margin: 0; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  overflow-x: auto; font-size: 12px; line-height: 1.6;
  font-family: var(--mono);
}
.safe-error { color: var(--fault); margin: 10px 0 0; }
.plot-warning { color: var(--caution); margin: 10px 0 0; }

/* ---- plots -------------------------------------------------------------- */

.plot-card { margin: 18px 0 0; padding: 0; }
.plot-card img {
  width: 100%; border-radius: var(--radius);
  border: 1px solid var(--line); cursor: zoom-in; display: block;
  background: #fff;
}
.plot-card figcaption { color: var(--text-faint); font-size: 12px; margin-top: 8px; }
.plot-actions { margin-top: 6px; }
.plot-download { font-size: 12.5px; color: var(--text); text-underline-offset: 3px; }

.plot-dialog {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 0; max-width: 92vw; max-height: 92vh; background: var(--bg);
}
.plot-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.plot-dialog img { display: block; max-width: 92vw; max-height: 92vh; }
.plot-close {
  position: absolute; top: 10px; right: 10px;
  border: 1px solid var(--line); border-radius: 50%; width: 30px; height: 30px;
  background: var(--bg); color: var(--text); cursor: pointer; font-size: 16px;
}

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

.composer-wrap { padding: 8px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); }

.composer {
  max-width: var(--measure);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
}
.composer:focus-within { border-color: var(--text-soft); }

.composer textarea {
  flex: 1;
  border: 0;
  resize: none;
  background: none;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  padding: 9px 0;
  max-height: 200px;
  outline: none;
}
.composer textarea::placeholder { color: var(--text-faint); }

.mic, .send, .stop {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%;
  border: 0;
  background: none;
  color: var(--text-soft);
  cursor: pointer;
  display: grid; place-items: center;
  position: relative;
}
.mic svg, .send svg, .stop svg { width: 17px; height: 17px; fill: currentColor; }
.mic:hover { background: var(--bubble); color: var(--text); }
.send, .stop { background: var(--invert-bg); color: var(--invert-text); }
.send:hover, .stop:hover { opacity: .85; }
.mic:disabled, .send:disabled { opacity: .35; cursor: not-allowed; }
.mic.listening { color: var(--text); background: var(--bubble); }

/* The ring scales with measured input loudness, so the user can see the
 * microphone is actually hearing them rather than trusting a static icon. */
.mic-level {
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 1.5px solid var(--text-soft);
  opacity: 0;
  transform: scale(calc(1 + var(--level, 0) * .2));
  transition: transform .08s linear, opacity .2s ease;
  pointer-events: none;
}
.mic.listening .mic-level { opacity: calc(.3 + var(--level, 0) * .7); }

.composer-note {
  max-width: var(--measure);
  margin: 9px auto 0;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  min-height: 16px;
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .drawer-open .sidebar { transform: none; }
  .drawer-toggle { display: grid; }
  .conversation { padding: 18px 16px 4px; }
  .welcome h2 { font-size: 23px; }
  .banner { width: calc(100% - 32px); }
  .message-row.user .bubble { max-width: 88%; }
  /* Touch targets stay at least 44px on a phone held in a field. */
  .mic, .send, .stop { width: 40px; height: 40px; flex-basis: 40px; }
  .provenance { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* ---- admin dashboard ---------------------------------------------------- */

.admin-body { padding: 28px 24px 64px; max-width: 1240px; margin: 0 auto; }

.admin-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.admin-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.admin-sub { color: var(--text-soft); font-size: 13.5px; margin: 4px 0 0; }
.admin-header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.admin-link {
  color: var(--text); font-size: 13px; text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 12px;
}
.admin-link:hover { background: var(--surface); }

.admin-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 20px;
}
.admin-stat { background: var(--bg); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.admin-stat-value { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.admin-stat-label { font-size: 11.5px; color: var(--text-faint); }

.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin-filters input[type="search"], .admin-filters select {
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 8px 11px; font-size: 13.5px;
}
.admin-filters input[type="search"] { flex: 1; min-width: 220px; }
.admin-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }

.admin-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left; font-weight: 550; color: var(--text-soft);
  padding: 10px 14px; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table .numeric { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.admin-row { cursor: pointer; }
.admin-row:hover, .admin-row.open { background: var(--surface); }
.admin-when { color: var(--text-faint); white-space: nowrap; }
.admin-question { max-width: 420px; }
.admin-note-cell { max-width: 260px; color: var(--text-soft); }
.admin-muted { color: var(--text-faint); }

.admin-tag {
  font-size: 11.5px; border: 1px solid var(--line-strong); border-radius: 5px;
  padding: 1.5px 7px; white-space: nowrap; color: var(--text-soft);
}
/* Only a fault is coloured, for the same reason it is in the chat view. */
.admin-tag-failed { border-color: var(--fault); color: var(--fault); }
.admin-tag-partial { border-color: var(--caution); color: var(--caution); }

.admin-rating { font-size: 12px; white-space: nowrap; }
.admin-rating-down { color: var(--fault); }

.admin-detail > td { background: var(--surface); }
.admin-answer { font-size: 13.5px; margin-bottom: 12px; }
.admin-note {
  border-left: 2px solid var(--line-strong); padding: 2px 0 2px 12px;
  margin-bottom: 14px; display: flex; flex-direction: column; gap: 3px;
}
.admin-note strong { font-size: 12px; }
.admin-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-faint); }
.admin-meta-label { margin-right: 6px; }
.admin-meta code { font-family: var(--mono); }

.admin-empty { padding: 22px 16px; color: var(--text-faint); font-size: 13.5px; margin: 0; }

.admin-login-body { display: grid; place-items: center; min-height: 100dvh; }
.admin-login {
  display: flex; flex-direction: column; gap: 10px; width: min(320px, 90vw);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.admin-login h1 { font-size: 19px; margin: 0; font-weight: 600; }
.admin-login input {
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--text);
  border-radius: 8px; padding: 9px 11px; font-size: 14px;
}
.admin-login button {
  border: 0; background: var(--invert-bg); color: var(--invert-text);
  border-radius: 8px; padding: 9px; font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.admin-error { color: var(--fault); font-size: 13px; margin: 0; }

@media (max-width: 720px) {
  .admin-body { padding: 20px 14px 48px; }
  .admin-question, .admin-note-cell { max-width: none; }
}
