:root {
  --bg: #000;
  --fg: #fff;
  --dim: #8b8b8b;
  --faint: #5c5c5c;
  --line: #1f1f1f;
  --line-strong: #333;
  --raised: #0b0b0b;
  --radius: 18px;
  --display: 'Cal Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); color: var(--fg); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg); }
h1, h2 { font-weight: 400; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; }
h2 { font-size: 1.5rem; line-height: 1.2; }
p { margin: 0; }

.dim { color: var(--dim); }
.small { font-size: 0.875rem; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace; font-size: 0.9em; }

/* ---------- Header ---------- */

.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.05rem; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { border-radius: 50%; }
.account-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* ---------- Layout ---------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}
.center-page {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 48px 16px;
}
.page-head { margin-bottom: 28px; display: grid; gap: 8px; }
.stack { display: grid; gap: 16px; }
.back { display: inline-block; margin-bottom: 24px; color: var(--dim); text-decoration: none; }
.back:hover { color: var(--fg); }

.footer {
  padding: 24px 16px 32px;
  text-align: center;
  color: var(--faint);
  font-size: 0.8125rem;
}

/* ---------- Landing / message ---------- */

.hero {
  max-width: 520px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 20px;
}
.hero p { color: var(--dim); font-family: var(--text); font-size: 1.0625rem; }
.hero .fine { font-size: 0.8125rem; color: var(--faint); }
.hero-logo { margin-bottom: 8px; }
.hero-small { margin: 48px auto; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--fg);
  color: var(--bg);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-lg { padding: 14px 26px; font-size: 1.0625rem; }
.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
}
.link:hover { color: var(--fg); }

/* ---------- Cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 16px;
}
.card-quiet { margin-bottom: 16px; }
.empty { text-align: center; padding: 48px 24px; gap: 8px; }

.case-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.eyebrow { color: var(--dim); font-size: 0.8125rem; margin-bottom: 4px; }
.reason { font-family: var(--text); color: #d6d6d6; }

.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.facts div { display: grid; }
.facts dt { color: var(--dim); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; }

.chip {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.chip-bad { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.chip-good { border-color: var(--fg); }
.chip-muted { color: var(--dim); }

/* Appeal timeline: your appeal → staff reply → compensation */
.timeline {
  position: relative;
  display: grid;
  gap: 18px;
  padding: 18px 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.timeline::before {
  /* the line joining the avatars */
  content: '';
  position: absolute;
  left: 33px;
  top: 36px;
  bottom: 36px;
  width: 1px;
  background: var(--line-strong);
}
.t-item { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.t-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  box-shadow: 0 0 0 4px var(--raised);
}
.t-avatar-blank { display: grid; place-items: center; border: 1px solid var(--line-strong); }
.t-avatar-wait {
  display: block;
  border: 1px dashed var(--line-strong);
}
.t-body { display: grid; gap: 8px; min-width: 0; padding-top: 1px; }
.t-text { font-family: var(--text); color: #d6d6d6; white-space: pre-wrap; overflow-wrap: anywhere; }
.t-aside { padding-left: 50px; }

.profile { display: grid; gap: 1px; }
.profile-id { display: flex; align-items: center; gap: 6px; }
.profile-name { font-size: 1rem; }
.profile-role { color: var(--dim); font-size: 0.8125rem; }
.badge { width: 16px; height: 16px; flex-shrink: 0; }
.chip-inline { justify-self: start; }

details summary {
  color: var(--dim);
  font-size: 0.875rem;
  cursor: pointer;
  list-style: none;
  width: fit-content;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸ '; }
details[open] summary::before { content: '▾ '; }
details summary:hover { color: var(--fg); }
details[open] { display: grid; gap: 8px; }

.card-actions { display: flex; justify-content: flex-end; }

.reply-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card { scroll-margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.notice {
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-family: var(--text);
}
.notice-error { border-color: var(--fg); margin: 0; display: grid; gap: 4px; }

/* ---------- Form ---------- */

.form { gap: 24px; }
.field { display: grid; gap: 8px; }
.field-boxed { background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
label { font-size: 1rem; }
.hint { color: var(--dim); font-size: 0.8125rem; font-family: var(--text); }

textarea, input[type=text] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: 1rem/1.5 var(--text);
  resize: vertical;
  transition: border-color 0.15s;
}
textarea:focus, input[type=text]:focus { outline: none; border-color: var(--fg); }
::placeholder { color: var(--faint); }

.check { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.check input {
  appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  display: grid;
  place-content: center;
  cursor: pointer;
}
.check input:checked { background: var(--fg); border-color: var(--fg); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid var(--bg); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.form-actions { display: flex; justify-content: flex-end; }

@media (max-width: 560px) {
  .page { padding-top: 32px; }
  .card { padding: 18px; }
  .account-name { display: none; }
  .case-top { flex-direction: column-reverse; gap: 10px; }
  .form-actions .btn, .card-actions .btn { width: 100%; }
}
