:root {
  --bg: #f6f7f9; --bg-elev: #ffffff; --bg-sunk: #eceef1; --border: #e0e2e7;
  --text: #181a1f; --text-mut: #6b7078; --accent: #4f46e5; --accent-weak: #eeecfd;
  --ok: #16a34a; --warn: #d97706; --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1013; --bg-elev: #191b20; --bg-sunk: #111318; --border: #2a2d34;
    --text: #eef0f3; --text-mut: #8b909b; --accent: #8b7ffb; --accent-weak: #241f3d;
  }
}
* { box-sizing: border-box; }
/* .login-screen/.topbar/.modal-bg all set display:flex on the class itself —
   without this, that permanently beats the [hidden] attribute's native
   display:none (author CSS always wins over the UA stylesheet, regardless
   of specificity), so toggling .hidden in JS silently did nothing visually. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1, h2 { margin: 0; }
.topbar { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.topbar h1 { font-size: 18px; }
.topbar .sub { color: var(--text-mut); font-size: 12.5px; flex: 1; min-width: 200px; }
input, select { font: inherit; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-sunk); color: var(--text); }
button { font: inherit; font-weight: 600; padding: 8px 14px; border-radius: var(--radius-sm); border: none; background: var(--accent); color: #fff; cursor: pointer; }
button:hover { opacity: .9; }
button.secondary { background: var(--bg-sunk); color: var(--text); }
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 340px; }
.login-card h1 { font-size: 20px; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-mut); margin-bottom: 4px; }
.field input { width: 100%; }
.error-msg { color: #dc2626; font-size: 12.5px; margin-top: 8px; min-height: 1em; }
main { max-width: 1100px; margin: 0 auto; padding: 20px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 900px) { .grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card h2 { font-size: 14px; margin-bottom: 10px; }
.filters { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.filters input { flex: 1; min-width: 100px; }
.list { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow-y: auto; }
.item { padding: 10px; border-radius: var(--radius-sm); background: var(--bg-sunk); cursor: pointer; }
.item:hover { background: var(--accent-weak); }
.item .t { font-weight: 600; }
.item .m { color: var(--text-mut); font-size: 12px; margin-top: 2px; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--accent-weak); color: var(--accent); margin-right: 4px; }
.empty { color: var(--text-mut); font-size: 13px; padding: 10px 0; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 10; }
.modal { background: var(--bg-elev); border-radius: var(--radius); padding: 20px; max-width: 560px; width: 100%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow); }
.timeline-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.timeline-item:last-child { border-bottom: none; }
.timeline-item .when { color: var(--text-mut); font-size: 11.5px; }
.timeline-item .why { color: var(--text-mut); font-size: 12px; font-style: italic; margin-top: 3px; }
.close-btn { float: right; background: none; color: var(--text-mut); font-size: 18px; padding: 0 4px; }
