/* X "Lights out" palette. */
:root {
  --bg: #000;
  --bg-hover: #080808;
  --bg-raised: #16181c;
  --bg-input: #202327;
  --line: #2f3336;
  --text: #e7e9ea;
  --muted: #71767b;
  --blue: #1d9bf0;
  --blue-hover: #1a8cd8;
  --green: #00ba7c;
  --yellow: #ffd400;
  --red: #f4212e;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 15px/1.35 "TwitterChirp", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 53px; padding: 0 16px;
  background: rgba(0, 0, 0, .65);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 20px; letter-spacing: -.3px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; fill: var(--text); }
.account { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.account img { width: 32px; height: 32px; border-radius: 50%; }
.account .who { font-weight: 700; font-size: 14px; }

/* Column */
.column { max-width: 600px; margin: 0 auto; min-height: calc(100vh - 53px); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
@media (max-width: 640px) { .column { border: 0; } }

.hero { padding: 28px 16px 20px; border-bottom: 1px solid var(--line); }
.hero h1 { margin: 0 0 4px; font-size: 31px; font-weight: 800; letter-spacing: -.5px; }
.hero > p { margin: 0 0 20px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 16px; border-radius: 9999px; border: 1px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background-color .15s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--blue-hover); }
.btn-light { background: var(--text); color: #0f1419; }
.btn-light:hover { background: #d7dbdc; }
.btn-outline { background: transparent; color: var(--text); border-color: #536471; }
.btn-outline:hover { background: rgba(239, 243, 244, .1); }
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.linkish { color: var(--blue); cursor: pointer; }
.linkish:hover { text-decoration: underline; }

/* Search */
.search { display: flex; gap: 10px; }
.search-box {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px;
  height: 44px; padding: 0 16px; border-radius: 9999px;
  background: var(--bg-input); border: 1px solid transparent;
}
.search-box:focus-within { background: var(--bg); border-color: var(--blue); }
.search-box svg { width: 18px; height: 18px; fill: var(--muted); margin-right: 10px; flex: none; }
.search-box:focus-within svg { fill: var(--blue); }
.search-box .at { color: var(--muted); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; }
.search .btn { height: 44px; padding: 0 20px; }

.modes { display: inline-flex; margin-top: 14px; padding: 3px; border-radius: 9999px; background: var(--bg-raised); }
.modes button {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border: 0; border-radius: 9999px;
  background: transparent; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.modes button[aria-checked="true"] { background: var(--text); color: #0f1419; }
.modes .tag { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 9999px; border: 1px solid currentColor; opacity: .8; }
.hint { margin: 10px 0 0; font-size: 13px; min-height: 18px; }

/* Results */
#results:empty { display: none; }
.profile { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); }
.avatar { flex: none; width: 56px; height: 56px; border-radius: 50%; background: var(--bg-input); object-fit: cover; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: var(--muted); }
.profile .name { font-weight: 800; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.profile .meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 14px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: var(--bg-raised); color: var(--muted); vertical-align: 2px; margin-left: 6px; }
.summary { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary b { color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0; }
.entry { position: relative; display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); transition: background-color .15s; }
.entry:hover { background: var(--bg-hover); }
.rail { flex: none; width: 40px; display: flex; justify-content: center; }
.dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-raised); color: var(--muted); font-weight: 800; }
.entry.current .dot { background: var(--blue); color: #fff; }
.dot svg { width: 20px; height: 20px; fill: currentColor; }
.body { flex: 1; min-width: 0; }
.line1 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.handle { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.dates { margin-top: 2px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 9999px; border: 1px solid var(--line); color: var(--muted); }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; }
.pill.high { background: rgba(0, 186, 124, .15); color: var(--green); }
.pill.medium { background: rgba(255, 212, 0, .12); color: var(--yellow); }
.pill.low { background: rgba(244, 33, 46, .14); color: #ff6b75; }
.pill.now { background: rgba(29, 155, 240, .15); color: var(--blue); }
.evidence { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 14px; }

.change { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.change .rail svg { width: 16px; height: 16px; fill: var(--muted); }
.change.warn { color: var(--yellow); }

.entry.missing .dot { background: transparent; border: 1px dashed #536471; }

.section { padding: 16px; border-bottom: 1px solid var(--line); }
.section h2 { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
.section ul { margin: 0; padding-left: 18px; }
.section li { margin: 6px 0; color: var(--muted); }
.section li b { color: var(--text); }
.callout { margin: 16px; padding: 12px 14px; border-radius: 12px; background: var(--bg-raised); color: var(--muted); font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }

.notice { padding: 28px 16px; border-bottom: 1px solid var(--line); }
.notice h2 { margin: 0 0 6px; font-size: 20px; font-weight: 800; }
.notice p { margin: 0 0 14px; color: var(--muted); }
.notice.error h2 { color: #ff6b75; }

/* Loading */
.loading { padding: 18px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(29, 155, 240, .25); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.skeleton .a { width: 40px; height: 40px; border-radius: 50%; }
.skeleton .b { flex: 1; display: grid; gap: 8px; align-content: start; }
.skeleton .a, .skeleton i { background: var(--bg-raised); animation: pulse 1.4s ease-in-out infinite; }
.skeleton i { display: block; height: 12px; border-radius: 6px; }
.skeleton .w40 { width: 40%; } .skeleton .w55 { width: 55%; } .skeleton .w70 { width: 70%; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .spinner, .skeleton .a, .skeleton i { animation: none; } }

.foot { padding: 20px 16px 40px; }
.foot p { margin: 12px 0 0; line-height: 1.5; }

.drop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(91, 112, 131, .4); }
.drop div { padding: 28px 36px; border-radius: var(--radius); background: var(--bg); border: 2px dashed var(--blue); font-weight: 800; font-size: 18px; }

button:focus-visible, a:focus-visible, .linkish:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .search .btn { padding: 0 16px; }
}
