/* CrimeEye Live — standalone dark theme, matching the CrimeEye app. */
:root {
  color-scheme: dark;
  --ink: #ffffff;
  --muted: #b8c0cc;
  --line: #303640;
  --panel: #111419;
  --soft: #181d24;
  --field: #0b0d10;
  --accent: #b51f2a;
  --accent-bright: #d52b38;
  --amber: #f0b64d;
  --green: #22c55e;
  --live: #e11d2e;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #000;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: #fff;
}

/* ---------- Header ---------- */
.live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) 18px 14px;
  background: #050608;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 64px;
  height: auto;
  background: #000;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 800;
  font-size: 1.1rem;
}

.live-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--muted);
}

.live-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(225, 29, 46, 0.55);
  animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 46, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(225, 29, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 46, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot {
    animation: none;
  }
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

#reportView {
  max-width: 720px;
  margin: 0 auto;
}

.panel {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 20px;
  margin-bottom: 18px;
}

.panel.narrow {
  max-width: 460px;
  margin: 40px auto 18px;
}

h1 {
  margin: 0 0 6px;
  font-size: 1.6rem;
}

h2 {
  margin: 0 0 6px;
  font-size: 1.2rem;
}

h3 {
  margin: 20px 0 8px;
  font-size: 1rem;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fineprint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.error {
  margin: 0;
  color: var(--accent-bright);
}

/* ---------- Forms ---------- */
form,
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--field);
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 400;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--field);
  padding: 10px;
  font-weight: 400;
}

fieldset.categories {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.categories legend {
  font-weight: 700;
  padding: 0;
  margin-bottom: 8px;
}

label.choice {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}

input[type="radio"],
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.file-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.important {
  border: 1px solid var(--amber);
  padding: 12px 14px;
  font-size: 0.92rem;
}

.important p {
  margin: 4px 0 0;
}

.token {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
  background: var(--field);
  border: 1px solid var(--line);
  padding: 10px 12px;
}

.inline-form {
  flex-direction: row;
  gap: 8px;
}

.inline-form input {
  flex: 1;
  min-width: 0;
}

.status-result {
  margin: 12px 0 0;
  font-weight: 600;
}

/* ---------- Buttons ---------- */
button {
  cursor: pointer;
}

button.primary {
  min-height: 48px;
  border: 1px solid var(--accent-bright);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: 0 18px;
}

button.primary:hover {
  background: var(--accent-bright);
}

button.secondary {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-weight: 700;
  padding: 0 14px;
}

button.secondary:hover {
  background: var(--field);
}

button.danger {
  min-height: 40px;
  border: 1px solid var(--accent-bright);
  background: transparent;
  color: var(--accent-bright);
  font-weight: 700;
  padding: 0 14px;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
}

.link-button {
  border: 0;
  background: none;
  color: #fff;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 8px;
  margin: 0 auto 18px;
  max-width: 720px;
}

.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  padding: 0 18px;
}

.tab.is-active {
  color: #fff;
  background: var(--soft);
  border-color: #fff;
}

/* ---------- Review dashboard ---------- */
.filter {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.filter select {
  width: auto;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
  align-items: start;
}

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

.review-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 12px 14px;
}

.row.is-active {
  border-color: var(--accent-bright);
}

.row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.row-snippet,
.row-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.chip {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border: 1px solid var(--line);
}

.chip.is-pending {
  border-color: var(--amber);
  color: var(--amber);
}

.chip.is-done {
  border-color: var(--green);
  color: var(--green);
}

.chip.is-rejected {
  border-color: var(--accent-bright);
  color: var(--accent-bright);
}

.detail {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 18px;
}

.detail h2 {
  margin: 2px 0 8px;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 14px 0 0;
}

.facts dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.facts dd {
  margin: 0;
}

.description {
  white-space: pre-wrap;
  margin: 0;
}

.evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.evidence img,
.evidence video {
  max-width: 100%;
  max-height: 280px;
  border: 1px solid var(--line);
}

.audit {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--muted);
}

.audit li {
  margin-bottom: 4px;
}

/* ---------- Footer ---------- */
.live-footer {
  padding: 18px 16px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.live-footer p {
  margin: 4px 0;
}

.live-footer a {
  color: var(--muted);
}

/* The big card title: "CrimeEye" with a red recording dot and "Live" under it. */
.live-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.1;
}

.live-line.is-large {
  gap: 9px;
  font-size: 1.15rem;
  color: var(--ink);
}

.live-line.is-large .live-dot {
  width: 12px;
  height: 12px;
}

.tagline {
  margin: 0 0 8px;
  font-weight: 600;
}

/* ---------- Local news ---------- */
.news-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-list li {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 14px;
}

.news-list a {
  font-weight: 700;
  text-decoration: none;
}

.news-list a:hover {
  text-decoration: underline;
}

.news-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.area-text {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.stack input,
.stack textarea {
  width: 100%;
}

.comment-toggle {
  margin-top: 8px;
}

.comment-box {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.comment {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.comment-form {
  margin-top: 10px;
}

.comment-form textarea {
  min-height: 80px;
}

.flagged {
  color: var(--accent-bright);
  font-weight: 700;
}
