/* Blocked for India Hate — global styles
   Layout mirrors blockedforaireply.com: one 42rem timeline column, X-style
   rows, pill buttons, tabs, search, and an indented evidence list.
   Saffron (#FF9933) is the brand accent; the rest follows the X-style palette. */

/* ---------------------------------------------------------------- tokens */
:root {
  --bg: #ffffff;
  --ink: #0f1419;
  --sub: #536471;
  --line: #eff3f4;
  --border: #cfd9de;
  --field: #eff3f4;
  --hover: #f7f9f9;
  --saffron: #ff9933;
  --saffron-deep: #c2610a;
  --saffron-soft: #fff1e0;
  --red: #f4212e;
  --red-bg: #fdeced;
  --green: #00ba7c;
  --scrim: rgba(91, 112, 131, 0.45);
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
  font: 16px / 1.45 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --scrim: rgba(91, 112, 131, 0.35);
    --bg: #000000;
    --ink: #e7e9ea;
    --sub: #939ea6;
    --line: #2f3336;
    --border: #536471;
    --field: #202327;
    --hover: #111315;
    --saffron-soft: #3a2a15;
    --red: #f4626b;
    --red-bg: #2a1213;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --scrim: rgba(91, 112, 131, 0.35);
  --bg: #000000;
  --ink: #e7e9ea;
  --sub: #939ea6;
  --line: #2f3336;
  --border: #536471;
  --field: #202327;
  --hover: #111315;
  --saffron-soft: #3a2a15;
  --red: #f4626b;
  --red-bg: #2a1213;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
}

h1,
h2,
h3,
p,
ul,
ol,
dl {
  margin: 0;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button,
summary {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--saffron);
  outline-offset: 2px;
}

/* The single centered timeline column — 42rem (~672px) on desktop, full width
   on mobile, with a hairline left/right border like the reference. */
.column {
  width: min(100%, 42rem);
  min-height: 100vh;
  margin: auto;
  border-inline: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.pad {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

@media (min-width: 42rem) {
  .pad {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
  z-index: 50;
  background: var(--bg);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ---------------------------------------------------------------- hero */
.home-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  padding-block: 1.5rem 1rem;
}

.home {
  display: block;
  color: inherit;
  text-decoration: none;
}

.logo {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 0.6rem;
}

h1 {
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.sub {
  display: block;
  margin-top: 0.15rem;
}

.home-head .sub {
  max-width: 42ch;
  margin: 0.3rem auto 0;
  font-size: 0.9375rem;
  color: var(--sub);
}

.sub,
.meta,
.right small,
.contact,
footer,
.pager,
.intro {
  font-size: 0.8125rem;
  color: var(--sub);
}

/* ---------------------------------------------------------------- pills / buttons */
.head-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pill,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 650;
  text-decoration: none;
  list-style: none;
}

.pill::-webkit-details-marker {
  display: none;
}

.pill.hl,
.btn.solid,
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.pill.hl:hover,
.btn.solid:hover,
.btn-primary:hover {
  background: var(--ink);
  opacity: 0.9;
}

.icon-btn {
  width: 44px;
  padding: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.pill:hover,
.btn:hover {
  background: var(--hover);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--border);
}

.btn-small {
  min-height: 36px;
  padding: 0.3rem 0.8rem;
  font-size: 0.8125rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

/* ---------------------------------------------------------------- exports + tabs */
.exports {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  padding-block: 0.4rem;
  font-size: 0.875rem;
  color: var(--sub);
}

.exports a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--ink);
  font-weight: 600;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button,
.tabs a {
  position: relative;
  flex: 1 0 auto;
  white-space: nowrap;
  padding: 0.75rem 0.85rem;
  text-align: center;
  text-decoration: none;
  color: var(--sub);
  font-size: 0.9rem;
  font-weight: 600;
  background: none;
  border: 0;
}

.tabs [aria-current='true'],
.tabs [aria-selected='true'] {
  color: var(--ink);
}

.tabs [aria-current='true']::after,
.tabs [aria-selected='true']::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 3rem;
  height: 4px;
  transform: translateX(-50%);
  background: var(--saffron);
  border-radius: 4px;
}

/* ---------------------------------------------------------------- tools (search + sort) */
.tools {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-block: 0.75rem 0.5rem;
}

.search {
  display: flex;
  align-items: center;
  background: var(--field);
  border-radius: 999px;
  overflow: hidden;
}

.search:focus-within {
  outline: 2px solid var(--saffron);
  outline-offset: 1px;
}

.search input,
.search button {
  background: transparent;
  border: 0;
  color: var(--ink);
  height: 44px;
}

.search input {
  flex: 1;
  min-width: 0;
  padding: 0 1rem;
  outline: none;
}

.search input::placeholder {
  color: var(--sub);
}

.search button {
  display: grid;
  place-items: center;
  width: 48px;
  color: var(--sub);
}

.sortbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--sub);
}

.sortbar .total {
  margin-right: auto;
  font-size: 0.875rem;
  color: var(--sub);
}

@media (max-width: 34rem) {
  .sortbar {
    flex-wrap: wrap;
  }
  .sortbar .total {
    flex-basis: 100%;
  }
  .sortbar .sort {
    flex: 1 1 0;
    min-width: 0;
  }
}

.sort {
  min-height: 36px;
  padding: 0.25rem 2rem 0.25rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%),
    linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

/* ---------------------------------------------------------------- account list */
.accounts,
.replies,
.evidence {
  list-style: none;
  padding: 0;
}

.account {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-block: 0.8rem;
  text-decoration: none;
  color: inherit;
}

.account > div {
  min-width: 0;
  flex: 1;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.who > div {
  min-width: 0;
}

.avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--field);
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sub);
  text-decoration: none;
  align-self: flex-start;
}

.account strong {
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.meta {
  display: block;
  margin-top: 0.15rem;
}

/* Indented evidence list, like the reference's reply list. */
.evidence-list {
  display: block;
  margin-top: 0.35rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--line);
}

.evidence-item {
  display: block;
  white-space: pre-wrap;
  font-size: 0.875rem;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.evidence-item + .evidence-item {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.evidence-item a {
  color: var(--saffron-deep);
  text-decoration: none;
}

.evidence-item a:hover {
  text-decoration: underline;
}

/* status badge on the right of the row */
.right {
  flex: 0 0 auto;
  text-align: right;
  font-size: 0.95rem;
  font-weight: 600;
}

.right small {
  display: block;
  font-weight: 400;
}

.tag {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: var(--field);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.75rem;
}

.tag.lv,
.tag-danger {
  background: var(--red-bg);
  color: var(--red);
}

.tag-warn {
  background: var(--saffron-soft);
  color: var(--saffron-deep);
}

.tag-muted {
  background: var(--field);
  color: var(--sub);
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--sub);
}

/* ---------------------------------------------------------------- pager + footer */
.pager,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pager {
  padding-block: 0.8rem;
}

.pager a,
.pager button,
footer a,
footer button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  font-size: inherit;
}

.pager button:disabled {
  text-decoration: none;
  opacity: 0.5;
  cursor: not-allowed;
}

.pager div,
footer nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

footer {
  padding-block: 0.75rem 1.75rem;
  border-top: 1px solid var(--line);
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--sub);
  line-height: 1.55;
}

footer .legal {
  flex-basis: 100%;
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
}

footer strong {
  color: var(--ink);
}

/* ---------------------------------------------------------------- sub-page scaffolding */
.page-head {
  padding-block: 1.25rem 0.5rem;
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
}

.back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  text-decoration: none;
}

.intro {
  padding-bottom: 0.9rem;
  max-width: 62ch;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin: 0.75rem 0;
}

.notice {
  background: var(--saffron-soft);
  color: var(--saffron-deep);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--saffron-soft);
}

/* ---------------------------------------------------------------- forms */
.field {
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
  font-size: 0.875rem;
}

.field .hint {
  font-size: 0.8125rem;
  color: var(--sub);
  margin: 0.35rem 0 0;
}

.field input,
.field select,
.field textarea,
input.field,
select.field,
textarea.field {
  width: 100%;
  min-width: 0;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--ink);
  background: var(--bg);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--saffron);
  box-shadow: 0 0 0 1px var(--saffron);
  outline: none;
}

code {
  background: var(--field);
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

.form-status {
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  margin: 1rem 0;
  display: none;
  font-size: 0.9rem;
}

.form-status[data-state='ok'] {
  display: block;
  background: color-mix(in srgb, var(--green) 15%, transparent);
  color: var(--ink);
}

.form-status[data-state='error'] {
  display: block;
  background: var(--red-bg);
  color: var(--red);
}

.turnstile-slot {
  margin: 1rem 0;
  min-height: 65px;
}

/* ---------------------------------------------------------------- account detail */
.profile {
  padding-block: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.profile h1 {
  overflow-wrap: anywhere;
}

.account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.meta-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  margin: 1rem 0 1.5rem;
}

@media (min-width: 30rem) {
  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.meta-grid dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sub);
}

.meta-grid dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.evidence-list-page {
  padding-left: 1.1rem;
  margin: 0 0 1rem;
  list-style: none;
}

.evidence-list-page li {
  margin-bottom: 0.4rem;
  word-break: break-all;
  font-size: 0.9rem;
}

.criteria {
  padding-left: 1.1rem;
}

.criteria li {
  margin-bottom: 0.55rem;
}

.leaderboard {
  padding-left: 1.25rem;
  margin: 0;
}

.leaderboard li {
  margin-bottom: 0.35rem;
}

/* ---------------------------------------------------------------- dialog */
dialog {
  width: min(calc(100% - 32px), 30rem);
  max-height: calc(100% - 32px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg);
  color: var(--ink);
  padding: 0;
}

dialog::backdrop {
  background: var(--scrim);
}

.dlg {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.dlg-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.dlg h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.dlg p {
  font-size: 0.875rem;
  color: var(--sub);
}

.prompt-box {
  background: var(--field);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 16rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: flex-end;
}

/* ---------------------------------------------------------------- admin */
.admin-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 42rem) {
  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.queue-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  background: var(--bg);
}

.queue-item .queue-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--sub);
  margin-bottom: 0.35rem;
}

.queue-item a.queue-link {
  word-break: break-all;
  font-size: 0.9rem;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.queue-actions input,
.queue-actions select {
  flex: 1 1 10rem;
  font-size: 0.88rem;
  min-height: 36px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.section-head h2 {
  margin: 0;
}

.counter {
  font-size: 0.8rem;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

table.admin-table th,
table.admin-table td {
  text-align: left;
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.admin-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sub);
}

/* ---------------------------------------------------------------- util */
.muted {
  color: var(--sub);
}

.small {
  font-size: 0.875rem;
}

.hidden {
  display: none !important;
}

.toast {
  font-size: 0.8125rem;
  color: var(--saffron-deep);
  min-height: 1.2em;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
