:root {
  --paper: #edefea;
  --sheet: #f7f8f4;
  --ink: #17262f;
  --ink-2: #51636c;
  --rule: #c8cdc5;
  --lapis: #1d4e89;
  --ochre: #94670f;
  --verdigris: #2b6a58;
  --rubric: #a3322b;
  --focus: #b8892b;
  --on-fill: #f7f8f4;
  --naskh: "Amiri", "Noto Naskh Arabic", "Scheherazade New", "Traditional Arabic", "Geeza Pro", "Segoe UI", serif;
  --sans: "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif;
}
:root:not([data-theme="light"]) { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #111b20; --sheet: #17252b; --ink: #e3e8e2; --ink-2: #9db0b6; --rule: #2b3b42;
    --lapis: #86aee4; --ochre: #dba746; --verdigris: #6fbaa3; --rubric: #e5857d; --focus: #d9a441; --on-fill: #111b20;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.7 var(--sans); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }

.site { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .9rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--rule); background: var(--sheet); }
.site-name { font-family: var(--naskh); font-weight: 700; font-size: 1.6rem; color: var(--ink); text-decoration: none; }
.site nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site nav a { color: var(--ink-2); }
.foot { border-top: 1px solid var(--rule); padding: 1.5rem clamp(1rem, 4vw, 3.5rem) 3rem; color: var(--ink-2); font-size: .9rem; }
.foot p { margin: 0 0 .4rem; max-width: 52rem; }
.foot a { color: inherit; }

.debate-list { list-style: none; margin: .5rem 0 1rem; padding: 0; }
.debate-link { display: block; padding: .7rem .25rem; border-top: 1px solid var(--rule); color: inherit; text-decoration: none; }
.debate-link:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.debate-motion { display: block; font-family: var(--naskh); font-size: 1.25rem; line-height: 1.7; }
.debate-meta { color: var(--ink-2); font-size: .88rem; }
.section-title { font-size: 1.2rem; margin: 2.5rem 0 .5rem; }
.page-title { font-family: var(--naskh); font-size: 2rem; margin-bottom: 1rem; }
.pager { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.pager-pages { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.pager-pages a, .pager-pages strong { min-width: 2.1rem; padding: .15rem .45rem; text-align: center; border: 1px solid var(--rule); border-radius: 3px; }
.pager-pages a { color: var(--lapis); text-decoration: none; }
.pager-pages a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.pager-pages strong { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager-pages .gap { color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search { display: flex; gap: .5rem; margin: .75rem 0 .25rem; }
.search .input { flex: 1; min-width: 0; }
.results-summary { margin: .9rem 0 .25rem; color: var(--ink-2); }
.results-summary a { color: var(--lapis); }
.debate-sides { display: block; color: var(--ink-2); font-family: var(--naskh); font-size: 1.05rem; line-height: 1.8; }
.result-snippet { display: block; margin: .15rem 0 .1rem; font-family: var(--naskh); font-size: 1.08rem; line-height: 1.95; }
mark { background: color-mix(in srgb, var(--focus) 38%, transparent); color: inherit; border-radius: 2px; padding: 0 .12em; }

.main { padding: 1.5rem clamp(1rem, 4vw, 3.5rem) 4rem; max-width: 74rem; margin-inline: auto; }
.masthead { display: flex; align-items: baseline; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.mark { font-family: var(--naskh); font-weight: 700; font-size: 3.4rem; line-height: 1.3; }
.tagline { color: var(--ink-2); max-width: 36rem; }

/* the warning that these are not religious rulings: always on the page, never dismissed */
.warning { border: 2px solid var(--ochre); border-inline-start-width: 8px; background: var(--sheet); padding: .9rem 1.1rem 1rem;
  margin-bottom: 2rem; }
.warning-title { font-family: var(--naskh); font-size: 1.35rem; font-weight: 700; color: var(--ochre); }
.warning-text { font-family: var(--naskh); font-size: 1.2rem; line-height: 2; max-width: 52rem; }
.verdict-warning { border: 1px solid var(--ochre); border-inline-start-width: 6px; padding: .5rem .9rem; margin: .5rem 0 1rem;
  font-family: var(--naskh); font-size: 1.1rem; line-height: 1.9; background: var(--sheet); }

.field { display: block; margin-bottom: 1.25rem; }
.field-name { display: block; font-weight: 700; margin-bottom: .3rem; }
.hint { color: var(--ink-2); font-size: .9rem; margin-top: .25rem; }
.input { width: 100%; padding: .5rem .65rem; background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; }
.input-ar { font-family: var(--naskh); font-size: 1.3rem; line-height: 1.8; }
.input-ltr { direction: ltr; text-align: start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.row-inline { display: flex; gap: 2rem; flex-wrap: wrap; align-items: flex-start; }
.narrow { max-width: 20rem; }

.btn { padding: .6rem 1.2rem; border-radius: 3px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); }
.linkish { background: none; border: 0; padding: 0; color: var(--lapis); text-decoration: underline; cursor: pointer; }
.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.75rem; }
.problem { color: var(--rubric); font-weight: 700; }
.ok-note { color: var(--verdigris); }
.banner { border: 1px solid var(--rubric); border-inline-start-width: 5px; padding: .6rem .9rem; margin-bottom: 1.25rem; background: var(--sheet); }
.banner-info { border-color: var(--ochre); }
.banner small { display: block; color: var(--ink-2); margin-top: .25rem; direction: ltr; text-align: start; overflow-wrap: anywhere; }

/* the running debate */
.statusbar { position: sticky; top: 0; z-index: 4; background: var(--paper); border-bottom: 1px solid var(--rule); padding: .75rem 0;
  display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.status-now { font-weight: 700; flex: 1 1 18rem; }
.status-stat { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pulse { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--verdigris); margin-inline-end: .5rem; }
@media (prefers-reduced-motion: no-preference) { .pulse.live { animation: beat 1.4s ease-in-out infinite; } }
@keyframes beat { 50% { opacity: .25; } }
.motion-line { font-family: var(--naskh); font-size: 1.8rem; line-height: 1.8; margin: 1.25rem 0 .25rem; }
.sides { color: var(--ink-2); font-family: var(--naskh); font-size: 1.15rem; line-height: 1.9; }
.watching { color: var(--ink-2); margin-top: .5rem; }
.activity { margin-top: 1rem; }
.follow { display: inline-flex; gap: .4rem; align-items: center; color: var(--ink-2); cursor: pointer; }
.activity summary { cursor: pointer; color: var(--ink-2); }
.log { margin: .5rem 0 0; padding: .6rem .8rem; height: 16rem; overflow: auto; overscroll-behavior: contain; background: var(--sheet);
  border: 1px solid var(--rule); font-size: .88rem; line-height: 1.7; list-style: none; }
.log li { white-space: pre-wrap; overflow-wrap: anywhere; }
.log-phase { font-weight: 700; margin-top: .35rem; }

/* a speech reads like a page of a classical book: the text beside the clerk's glosses in the margin */
.transcript { margin-top: 1.5rem; }
.speech { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 2rem; padding: 1.75rem 0; border-top: 1px solid var(--rule); }
.speech-a { --side: var(--lapis); }
.speech-b { --side: var(--ochre); }
.speech-body { border-inline-start: 4px solid var(--side); padding-inline-start: 1.25rem; min-width: 0; }
.speech-title { font-family: var(--naskh); font-size: 1.5rem; font-weight: 700; color: var(--side); margin-bottom: .6rem; }
.ar p { font-family: var(--naskh); font-size: 1.32rem; line-height: 2.15; max-width: 40em; margin-bottom: .6rem; }
.evidence { margin-top: 1rem; }
.evidence-title { font-family: var(--naskh); font-weight: 700; font-size: 1.1rem; margin-bottom: .3rem; }
.cite { font-family: var(--naskh); font-size: 1.15rem; line-height: 1.9; margin-bottom: .5rem; }
.cite-ref { font-weight: 700; color: var(--side); margin-inline-end: .4rem; }
.hadith-link, .quran-link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.hadith-link:hover, .quran-link:hover { text-decoration-thickness: 2px; }
.margin { font-family: var(--naskh); font-size: 1.02rem; line-height: 1.85; min-width: 0; }
.gloss { border-inline-start: 3px solid var(--tone, var(--ink-2)); padding-inline-start: .65rem; margin-bottom: 1rem; }
.gloss-error { --tone: var(--rubric); }
.gloss-warning { --tone: var(--ochre); }
.gloss-ok { --tone: var(--verdigris); }
.gloss-head { font-weight: 700; color: var(--tone, var(--ink)); }
.gloss small { display: block; font-family: var(--sans); font-size: .8rem; color: var(--ink-2); }
.audit { margin-top: 1rem; font-family: var(--naskh); }
.audit summary { cursor: pointer; color: var(--ink-2); }
.audit-find { font-size: 1.05rem; line-height: 1.9; margin-top: .4rem; }
.verdict { border-top: 3px double var(--ink); margin-top: 1rem; padding-top: 1.5rem; }
.verdict-title { font-family: var(--naskh); font-size: 2rem; font-weight: 700; }
.verdict-winner { font-family: var(--naskh); font-size: 1.5rem; margin: .25rem 0 .75rem; }
.scores { border-collapse: collapse; margin: 1rem 0; font-family: var(--naskh); font-size: 1.1rem; }
.scores th, .scores td { padding: .25rem 0 .25rem 1.25rem; text-align: start; border-bottom: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.checks { font-family: var(--naskh); font-size: 1.05rem; line-height: 1.9; padding-inline-start: 1.2rem; }

/* the admin panel */
.admin-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-bar .grow { flex: 1 1 auto; }
.gate { min-height: 100vh; display: grid; place-items: center; }          /* /admin before signing in: a password field, nothing else */
.gate form { width: min(20rem, calc(100vw - 2rem)); }
.panel { background: var(--sheet); border: 1px solid var(--rule); padding: 1.25rem 1.25rem 1rem; margin-bottom: 1.75rem; }
.panel h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.roles { width: 100%; border-collapse: collapse; margin-top: .25rem; }
.roles th { text-align: start; font-weight: 700; padding: .35rem 0 .35rem .6rem; color: var(--ink-2); font-size: .9rem; }
.roles td { padding: .45rem 0 .45rem .6rem; border-top: 1px solid var(--rule); vertical-align: top; }
.role-name { font-weight: 700; padding-top: .9rem !important; white-space: nowrap; }
.combo { position: relative; min-width: 15rem; }
.input-num { width: 7.5rem; }
.combo-list { position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 2px); max-height: 18rem; overflow: auto; margin: 0; padding: 0;
  list-style: none; background: var(--sheet); border: 1px solid var(--ink-2); border-radius: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.combo-opt { padding: .4rem .65rem; cursor: pointer; border-bottom: 1px solid var(--rule); }
.combo-opt[aria-selected="true"] { background: var(--lapis); color: var(--on-fill); }
.combo-opt[aria-selected="true"] .combo-sub { color: inherit; opacity: .85; }
.combo-name { display: block; font-weight: 700; direction: ltr; text-align: start; }
.combo-sub { display: block; color: var(--ink-2); font-size: .85rem; direction: ltr; text-align: start; }
.price { color: var(--ink-2); font-size: .85rem; margin-top: .25rem; min-height: 1.3em; }
.load { display: flex; gap: 2rem; flex-wrap: wrap; }
.load strong { font-variant-numeric: tabular-nums; }

@media (max-width: 56rem) {
  .two { grid-template-columns: 1fr; }
  .speech { grid-template-columns: 1fr; gap: 1rem; }
  .roles, .roles tbody, .roles tr, .roles td { display: block; }
  .roles thead { display: none; }
  .roles td { border-top: 0; padding: .25rem 0; }
  .roles tr { border-top: 1px solid var(--rule); padding: .6rem 0; }
  .role-name { padding-top: .25rem !important; }
  .mark { font-size: 2.6rem; }
}
