/* LOOPLY moderation console.
 *
 * The tokens are the ones the website and the app use — screenshots/design-tokens.json — so
 * the console looks like part of LOOPLY rather than like a different product. Everything else
 * is deliberately plain: this is a tool for reading text somebody typed in anger and deciding
 * what to do about it, and a dense table beats a dashboard.
 *
 * There is no JavaScript on any page of this service, which is what lets the
 * Content-Security-Policy forbid script outright. Keep it that way.
 */

:root {
  --brand-indigo: #4A44E8;
  --background: #F4F5FA;
  --surface: #FFFFFF;
  --surface-raised: #ECEEF6;
  --separator: #E1E4EE;
  --text-primary: #10131A;
  --text-secondary: #69707F;
  --positive: #12996E;
  --warning: #C97A12;
  --danger: #D4304A;
  --radius: 12px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background);
}

a { color: var(--brand-indigo); }

/* --- Bar ------------------------------------------------------------------ */

.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--separator);
}

.wordmark {
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  color: var(--text-primary);
}
.wordmark span { font-weight: 500; letter-spacing: 0; color: var(--text-secondary); }

.bar nav { display: flex; gap: 16px; margin-right: auto; }
.bar nav a { text-decoration: none; font-weight: 600; }
.bar .who { color: var(--text-secondary); margin-right: 8px; }

.count {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  text-align: center;
}

main { max-width: 1080px; margin: 0 auto; padding: 24px; }
footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 48px;
  color: var(--text-secondary);
  font-size: 13px;
}

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.crumbs { color: var(--text-secondary); font-size: 13px; margin: 0 0 8px; }
.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); font-size: 13px; }
.hint { color: var(--text-secondary); font-size: 13px; margin: 4px 0 12px; }

/* --- Cards and columns ---------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}

.columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

/* --- Tables --------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }
table.card { display: table; padding: 0; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--separator); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
tbody tr:last-child td { border-bottom: none; }
tr.dim td { opacity: .55; }
tr.subrow td { background: var(--surface-raised); }
td.note { color: var(--text-secondary); max-width: 320px; }
td.actions { white-space: nowrap; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 6px 0; border-bottom: 1px solid var(--separator); }
.list li:last-child { border-bottom: none; }

dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--text-secondary); font-size: 13px; }
dd { margin: 0; }

.quote {
  display: block;
  margin-top: 4px;
  padding: 6px 10px;
  border-left: 3px solid var(--separator);
  background: var(--surface-raised);
  border-radius: 0 6px 6px 0;
  /* Reported text is other people's words, sometimes deliberately laid out to mislead. It is
     rendered as plain text in a box that makes clear where it starts and stops. */
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Tags ----------------------------------------------------------------- */

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}
.tag.bad { background: #FBE4E8; color: var(--danger); }
.tag.open { background: #E4EAFD; color: var(--brand-indigo); }

/* --- Forms ---------------------------------------------------------------- */

.form { display: block; margin-top: 12px; }
.form label, .filters label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.form label.check { font-weight: 400; }

input, select, textarea {
  font: inherit;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--separator);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
}
input[type="checkbox"] { width: auto; margin-right: 6px; }

button {
  font: inherit;
  font-weight: 600;
  padding: 8px 16px;
  margin-top: 12px;
  border: none;
  border-radius: 8px;
  background: var(--brand-indigo);
  color: #fff;
  cursor: pointer;
}
button.danger { background: var(--danger); }
button.link {
  background: none;
  color: var(--brand-indigo);
  padding: 0;
  margin: 0 10px 0 0;
  font-weight: 500;
}
button.link.danger { color: var(--danger); }

.button {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--brand-indigo);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
}

.inline { display: inline; }
.inline label { display: inline; margin-right: 6px; }
.inline input { width: auto; display: inline-block; }
.inline button { margin-top: 0; }

.filters {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.filters label { margin: 0 0 4px; }
.filters input, .filters select { width: auto; min-width: 200px; }
.filters button { margin-top: 0; }

/* --- Notices -------------------------------------------------------------- */

.notice {
  padding: 10px 14px;
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-weight: 500;
}
.notice.ok { background: #E1F3EC; color: var(--positive); }
.notice.bad { background: #FBE4E8; color: var(--danger); }

/* --- Chat ----------------------------------------------------------------- */

.chat { list-style: none; margin: 0; padding: 0; }
.chat li {
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--surface-raised);
}
.chat li.focus { background: #E4EAFD; box-shadow: inset 3px 0 0 var(--brand-indigo); }
.chat li.hidden { opacity: .5; }
.chat li p { margin: 4px 0; white-space: pre-wrap; word-break: break-word; }

/* --- Sign in -------------------------------------------------------------- */

.signin {
  max-width: 360px;
  margin: 64px auto;
  background: var(--surface);
  border: 1px solid var(--separator);
  border-radius: var(--radius);
  padding: 24px;
}
.signin h1 { font-size: 20px; }
.signin label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 4px; }
.signin button { width: 100%; }

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0C0E14;
    --surface: #151823;
    --surface-raised: #1E2230;
    --separator: #2A2F3F;
    --text-primary: #F2F4FA;
    --text-secondary: #9AA3B5;
  }
  .tag.bad { background: #3A1B22; }
  .tag.open { background: #1E2450; color: #A9B2FF; }
  .notice.ok { background: #12291F; }
  .notice.bad { background: #3A1B22; }
  .chat li.focus { background: #1E2450; }
  a, button.link, .button { color: #A9B2FF; }
}
