/* Tokens from TOKENS.md (www Tailbliss / Tailwind indigo). Same hex as Keycloak theme. */
:root {
  --trp-primary: #4f46e5;
  --trp-primary-hover: #4338ca;
  --trp-surface: #ffffff;
  --trp-text: #111827;
  --trp-font: ui-sans-serif, system-ui, sans-serif;
  --trp-muted: #6b7280;
  --trp-bg: #eef2ff;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--trp-font);
  color: var(--trp-text);
  background: var(--trp-bg);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: baseline;
  padding: 1rem 1.25rem;
  background: var(--trp-surface);
  border-bottom: 1px solid #e5e7eb;
}

.wordmark {
  font-weight: 700;
  color: var(--trp-primary);
  text-decoration: none;
  font-size: 1.25rem;
}

.product { color: var(--trp-muted); }
.user { margin-left: auto; }

main {
  max-width: 70rem;
  margin: 0 auto;
  padding: 1.25rem;
}

.article {
  max-width: 70ch;
  line-height: 1.55;
  background: var(--trp-surface);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
}

.card {
  background: var(--trp-surface);
  padding: 1.5rem;
  border-radius: 12px;
  max-width: 32rem;
}

.flash {
  margin: 0;
  padding: 0.75rem 1.25rem;
  background: #e0e7ff;
  color: var(--trp-text);
}

.btn {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: var(--trp-surface);
  color: var(--trp-text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary {
  background: var(--trp-primary);
  border-color: var(--trp-primary);
  color: #fff;
}

.btn.primary:hover { background: var(--trp-primary-hover); }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #e5e7eb;
}

.tone-ready { background: #c7d2fe; }
.tone-ok { background: #bbf7d0; }
.tone-pending { background: #fde68a; }
.tone-warn { background: #fed7aa; }
.tone-danger { background: #fecaca; }
.tone-neutral { background: #e5e7eb; }

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

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

.diff-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.diff-pane {
  background: var(--trp-surface);
  border-radius: 8px;
  overflow: auto;
}

.diff-lines { list-style: none; margin: 0; padding: 0; font-family: ui-monospace, monospace; font-size: 0.85rem; }
.diff-lines li { display: grid; grid-template-columns: 3rem 1fr; gap: 0.5rem; padding: 0.1rem 0.4rem; }
.diff-lines pre { margin: 0; white-space: pre-wrap; }
.diff-equal { background: transparent; }
.diff-replace, .diff-delete { background: #fee2e2; }
.diff-insert { background: #dcfce7; }
.diff-delete pre { text-decoration: line-through; }

.threads { list-style: none; padding: 0; }
.threads li { background: var(--trp-surface); margin: 0.5rem 0; padding: 0.75rem; border-radius: 8px; }
blockquote { margin: 0.5rem 0; color: var(--trp-muted); border-left: 3px solid var(--trp-primary); padding-left: 0.75rem; }

table { width: 100%; border-collapse: collapse; background: var(--trp-surface); }
th, td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid #e5e7eb; }

.review-list { list-style: none; padding: 0; }
.review-list li { background: var(--trp-surface); margin: 0.5rem 0; padding: 0.75rem 1rem; border-radius: 8px; display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: baseline; }

.bytes { white-space: pre-wrap; background: var(--trp-surface); padding: 1rem; overflow: auto; }

@media (max-width: 720px) {
  .diff-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  main { padding: 0.75rem; }
  .site-header { padding: 0.75rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --trp-surface: #111827;
    --trp-text: #f9fafb;
    --trp-bg: #020617;
    --trp-muted: #9ca3af;
  }
  .site-header, table, th, td { border-color: #374151; }
  .flash { background: #312e81; color: #eef2ff; }
  .diff-delete, .diff-replace { background: #7f1d1d; }
  .diff-insert { background: #14532d; }
}

@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  .article { max-width: none; box-shadow: none; }
}
