:root {
  --ink: #0f171e;
  --panel: #151f28;
  --panel-2: #1a2833;
  --line: #253744;
  --line-soft: #1e2d39;
  --text: #dbe6eb;
  --muted: #7b95a3;
  --teal: #39c5bb;
  --rose: #e8557f;
  --amber: #d99e58;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --r: 3px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* ---------- sign in ---------- */

.gate { min-height: 100%; display: grid; place-items: center; padding: 24px; }

.gate-box {
  width: min(22rem, 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--panel);
  padding: 1.6rem;
}

.gate-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -.01em;
  margin: 0 0 1.2rem;
}

.gate-error {
  border-left: 2px solid var(--rose);
  padding: .1rem 0 .1rem .7rem;
  margin: 0 0 1.2rem;
  font-size: .9rem;
  color: var(--muted);
}

.btn {
  display: block;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--teal);
  border-radius: var(--r);
  color: var(--teal);
  padding: .5rem 1rem;
  font-weight: 600;
}
.btn:hover { background: var(--teal); color: #06231f; }

/* ---------- shell ---------- */

.app { min-height: 100%; display: flex; flex-direction: column; }

.top {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: .7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  flex: none;
}

.top-title {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
}

.top-file { margin: 0; font-size: .78rem; color: var(--muted); }

.top-stats { display: flex; gap: 1.4rem; margin-left: auto; }

.stat b {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  display: block;
  line-height: 1.15;
}
.stat span { font-size: .75rem; color: var(--muted); }
.stat.accept b { color: var(--teal); }
.stat.deny b { color: var(--rose); }

.top-user { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.top-user img { border-radius: 50%; }

.btn-quiet {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .2rem .55rem;
  color: var(--muted);
  cursor: pointer;
  font-size: .8rem;
}
.btn-quiet:hover { color: var(--text); border-color: var(--muted); }

/* ---------- one application at a time ---------- */

.stage { flex: 1; width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 2rem; }

.pager {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 0 .2rem;
}

.nav {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  width: 2.1rem;
  height: 2.1rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.nav:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.nav:disabled { opacity: .3; cursor: default; }

.position { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

.detail-inner { padding: 1rem 0 4rem; }

.applicant {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -.015em;
  line-height: 1.15;
  margin: 0;
}

.applicant-meta {
  color: var(--muted);
  font-size: .82rem;
  margin: .2rem 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.qa { border-top: 1px solid var(--line); padding: 1rem 0; }
.qa dt { font-weight: 600; font-size: .88rem; color: var(--muted); margin-bottom: .25rem; }
.qa dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.section-head {
  font-family: var(--display);
  font-weight: 600;
  font-size: .95rem;
  margin: 2rem 0 .7rem;
}

.votes { display: flex; flex-wrap: wrap; gap: .4rem; }

.vote {
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .35rem .9rem;
  cursor: pointer;
  color: var(--muted);
}
.vote:hover { color: var(--text); }
.vote .n { font-variant-numeric: tabular-nums; opacity: .7; margin-left: .4rem; }
.vote[data-v="accept"].is-mine { border-color: var(--teal); color: var(--teal); }
.vote[data-v="unsure"].is-mine { border-color: var(--amber); color: var(--amber); }
.vote[data-v="deny"].is-mine { border-color: var(--rose); color: var(--rose); }

.comment { border-top: 1px solid var(--line-soft); padding: .8rem 0; display: flex; gap: .7rem; }
.comment img { border-radius: 50%; flex: none; }
.comment-body { min-width: 0; flex: 1; }

.comment-head { display: flex; align-items: baseline; gap: .55rem; font-size: .82rem; }
.comment-author { font-weight: 600; font-size: .9rem; }
.comment-when { color: var(--muted); }

.comment-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.comment-delete {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: .78rem;
  margin-left: auto;
  padding: 0;
}
.comment-delete:hover { color: var(--rose); }

.comment-none { color: var(--muted); border-top: 1px solid var(--line-soft); padding: .8rem 0; margin: 0; }

.composer { margin-top: .9rem; }

.composer textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .5rem .65rem;
}
.composer textarea::placeholder { color: var(--muted); }

.composer-row { display: flex; align-items: center; gap: .8rem; margin-top: .5rem; }

.composer button {
  background: none;
  border: 1px solid var(--teal);
  border-radius: var(--r);
  color: var(--teal);
  font-weight: 600;
  padding: .3rem 1rem;
  cursor: pointer;
}
.composer button:hover:not(:disabled) { background: var(--teal); color: #06231f; }
.composer button:disabled { opacity: .4; cursor: default; }

.hint { color: var(--rose); font-size: .8rem; }

.placeholder { padding: 1.5rem 0; color: var(--muted); }
code { background: var(--panel-2); padding: .05rem .3rem; border-radius: var(--r); font-size: .9em; }

.flash { animation: flash .4s ease-out; }
@keyframes flash { from { background: rgba(57,197,187,.14); } to { background: transparent; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: .6rem 1.2rem; }
  .top-stats { order: 3; width: 100%; margin-left: 0; gap: 1.1rem; }
  .stage { padding: 0 1rem; }
  .applicant { font-size: 1.35rem; }
}
