/* Stylesheet lives in a file, not a <style> block: the console runs under
   `style-src 'self'`, which blocks inline styles along with inline scripts. */

:root {
  color-scheme: light dark;
  --line: color-mix(in srgb, currentColor 15%, transparent);
  --muted: color-mix(in srgb, currentColor 60%, transparent);
  --panel: color-mix(in srgb, currentColor 5%, transparent);
}

body {
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

header nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

main {
  padding: 1.25rem;
  max-width: 1100px;
}

a {
  color: inherit;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  text-align: left;
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.tag-human {
  border-color: currentColor;
  font-weight: 600;
}

.flash {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  background: var(--panel);
}

.banner {
  padding: 0.6rem 0.85rem;
  border: 1px solid currentColor;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 1.5rem;
}

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

.thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.msg {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  max-width: 80%;
  /* Customer text is untrusted and arbitrary: wrap it rather than letting a
     long unbroken string blow out the layout. */
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.msg-client {
  align-self: flex-start;
}

.msg-bot,
.msg-agent {
  align-self: flex-end;
  background: var(--panel);
}

.msg-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.msg-redacted {
  font-style: italic;
  color: var(--muted);
}

textarea,
input[type="text"],
input[type="password"] {
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: inherit;
  box-sizing: border-box;
}

button {
  font: inherit;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: inherit;
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.field-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.field-list li {
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
