:root {
  --bg: #14131a;
  --panel: #1f1d29;
  --panel-2: #2a2838;
  --text: #f0eef7;
  --muted: #8a87a3;
  --accent: #c89bff;
  --accent-2: #ffd166;
  --good: #6cd97e;
  --bad: #ff7a7a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin:0; background:var(--bg); color:var(--text); font:16px/1.45 -apple-system,BlinkMacSystemFont,"SF Pro",Inter,sans-serif; }
a { color: var(--accent); }
button, input, textarea, select {
  font: inherit; color: inherit;
  background: var(--panel-2); border: 1px solid #3a3850; border-radius: 10px;
  padding: 10px 12px;
}
button { cursor: pointer; background: var(--accent); color: #1a1226; border: none; font-weight: 600; }
button.ghost { background: transparent; border: 1px solid #3a3850; color: var(--text); font-weight: 500; }
button.bad { background: transparent; border: 1px solid #5a3030; color: var(--bad); }
header {
  display:flex; align-items:center; gap:12px; padding: env(safe-area-inset-top,12px) 16px 12px;
  background: var(--panel); position: sticky; top:0; z-index:5;
}
header h1 { font-size: 18px; margin:0; flex:1; }
nav.tabs { display:flex; gap:6px; padding: 8px 12px; background: var(--panel); }
nav.tabs button { background: transparent; color: var(--muted); border:none; padding: 8px 12px; border-radius:10px; }
nav.tabs button.active { background: var(--panel-2); color: var(--text); }
main { padding: 12px 12px 80px; max-width: 760px; margin: 0 auto; }
.card { background: var(--panel); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display:flex; gap:12px; }
.card img { width: 92px; height: 138px; object-fit: cover; border-radius: 10px; background:#000; flex: 0 0 auto; }
.card .meta { flex:1; min-width:0; }
.card h3 { margin:0 0 4px; font-size: 17px; }
.card .sub { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.card .reason { font-size: 14px; margin: 6px 0 10px; }
.card .actions { display:flex; flex-wrap:wrap; gap:6px; }
.card .actions button { padding: 7px 10px; font-size: 13px; border-radius: 9px; }
.row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.stars { display:inline-flex; gap:4px; }
.stars button { background: transparent; border:none; padding:2px; font-size: 22px; color: #4a4860; }
.stars button.on { color: var(--accent-2); }
label { display:block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=text], textarea, select { width: 100%; }
textarea { min-height: 70px; resize: vertical; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display:flex; align-items:flex-end; justify-content:center; z-index: 20; }
.modal .sheet { width: 100%; max-width: 560px; background: var(--panel); border-radius: 18px 18px 0 0; padding: 18px 16px env(safe-area-inset-bottom,20px); }
.toast { position: fixed; left:50%; bottom: 20px; transform: translateX(-50%); background: var(--panel-2); padding: 10px 14px; border-radius: 12px; z-index: 30; }
.empty { color: var(--muted); text-align:center; padding: 40px 20px; }
.spinner { display:inline-block; width:14px; height:14px; border:2px solid var(--muted); border-top-color: var(--accent); border-radius:50%; animation: spin 0.8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.search-results { display:flex; flex-direction:column; gap:6px; margin-top:6px; }
.search-results .hit { display:flex; gap:10px; padding:8px; background: var(--panel-2); border-radius:10px; cursor:pointer; }
.search-results .hit img { width:44px; height:66px; object-fit:cover; border-radius:6px; background:#000; }
.list-row { display:flex; gap:10px; align-items:center; padding:10px; background: var(--panel); border-radius: 12px; margin-bottom:8px; }
.list-row .t { flex:1; min-width:0; }
.list-row .t b { display:block; }
.list-row .t .s { color: var(--muted); font-size: 12px; }
.badge { background: var(--panel-2); padding:2px 8px; border-radius:8px; font-size: 12px; color: var(--muted); }

/* Banners (offline / degraded LLM) */
.banner {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.35;
}
.banner.offline { background: #3a2a14; color: #ffd9a8; border: 1px solid #6b4a1f; }
.banner.degraded { background: #2a2440; color: #d6ccff; border: 1px solid #4a3f7a; }
