@font-face { font-family: "Special Elite"; src: url("fonts/special-elite-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Readex Pro"; src: url("fonts/readex-pro-arabic-wght-normal.woff2") format("woff2"); font-weight: 160 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* A printed case file: white sheet, black rules, one marker yellow. Light only, on purpose. */
  --ground: #ffffff;
  --paper: #ffffff;
  --ink: #0a0a0a;
  --muted: #5e5e5e;
  --line: #d9d9d9;
  --bar: #0a0a0a;
  --highlight: #ffe14d;
  --highlight-ink: #0a0a0a;
  --display: "Special Elite", "Readex Pro", "Courier New", monospace; /* Courier New has monospaced Arabic: Readex first */
  --ui: "Schibsted Grotesk", "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Readex Pro", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body { margin: 0; background: var(--ground); color: var(--ink); font: 400 14.5px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: inherit; text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
code { font: 500 0.92em var(--mono); background: color-mix(in srgb, var(--ink) 7%, transparent); padding: 1px 5px; border-radius: 0; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 0; }

.bar { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 16px; flex-wrap: wrap; padding: 14px 28px 10px; }
.brand { margin: 0; font: 400 30px/1 var(--display); letter-spacing: 0.02em; }
.brand i { font-style: normal; background: var(--highlight); color: var(--highlight-ink); padding: 0 4px; margin: 0 1px; border-radius: 0; }
.bar-meta { color: var(--muted); font-size: 12.5px; }
.subbar { flex-basis: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.tagline { margin: 2px 0 0; font-size: 15px; font-weight: 500; }
.vis { font: 700 13px/1 var(--ui); padding: 9px 16px; border-radius: 0; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); cursor: pointer; }
.vis[aria-pressed="false"] { background: transparent; color: var(--ink); }
.vis:hover { opacity: 0.85; }

.stack { display: grid; gap: 16px; padding: 0 28px 16px; min-height: 0; }

/* Editors with a redacting mirror behind a transparent textarea */
.editors { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; gap: 10px 24px; min-height: 0; }
.editor { display: flex; flex-direction: column; min-height: 0; border-top: 3px solid var(--ink); padding: 8px 0 0; }
.editor-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.editor-head label { font: 600 13.5px/1 var(--mono); display: inline-flex; align-items: center; }
.hint { font: 400 12px var(--ui); color: var(--muted); margin-inline-start: 6px; }
.tally { font: 500 12px var(--mono); color: var(--muted); }
.field { position: relative; flex: 1; min-height: 120px; border: 1px solid var(--ink); background: var(--paper); }
.mirror, .field textarea {
  position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; padding: 10px 12px; border: 0; border-radius: 0;
  font: 400 12.5px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; tab-size: 4;
}
.mirror { overflow: hidden; pointer-events: none; color: var(--ink); }
.mirror .k { font-weight: 600; }
.mirror .eq { color: var(--muted); }
.mirror .c { color: var(--muted); font-style: italic; }
.mirror .redact { background: var(--bar); border-radius: 0; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mirror .miss { background: var(--highlight); color: var(--highlight-ink); border-radius: 0; }
.mirror .extra { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
.field textarea { resize: none; background: transparent; color: transparent; caret-color: var(--ink); overflow: auto; scrollbar-width: none; }
.field textarea::-webkit-scrollbar { display: none; }
.field textarea::placeholder { color: var(--muted); font: 400 13.5px var(--ui); }
.field textarea::selection { background: color-mix(in srgb, var(--highlight) 70%, transparent); color: transparent; }
.field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.tools { grid-column: 1 / -1; display: flex; gap: 14px; align-items: center; justify-content: flex-end; margin-top: -2px; }
.primary { font: 700 13px/1 var(--ui); padding: 9px 14px; border: 0; border-radius: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
.primary:hover { opacity: 0.85; }
.link { font: 600 12.5px/1 var(--ui); background: none; border: 0; padding: 6px 2px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; cursor: pointer; }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Report: six cells, all visible at once */
.step { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-inline-end: 8px; border-radius: 0; background: var(--ink); color: var(--paper); font: 400 14px var(--display); vertical-align: 1px; }
.report { display: flex; flex-direction: column; min-height: 0; border-top: 3px solid var(--ink); padding: 10px 0 8px; }
.report-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; padding-bottom: 6px; }
.report-head h2 { margin: 0; font: 400 17px/1 var(--display); letter-spacing: 0.03em; }
.status { margin: 0; color: var(--muted); font-size: 13px; }
.status strong { color: var(--ink); }
.status.good { color: var(--ink); font-weight: 600; }

.cells { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
@media (min-width: 1000px) { .cells { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); } }
.cell { display: flex; flex-direction: column; min-height: 0; padding: 10px 12px 6px; border-inline-start: 1px solid var(--ink); }
.cell:first-child { border-inline-start: 0; padding-inline-start: 0; }
.cell header { display: flex; align-items: baseline; gap: 8px; padding-bottom: 6px; }
.cell header b { min-width: 2ch; font: 400 24px/1 var(--display); color: var(--muted); }
.cell header h3 { margin: 0; font: 700 11.5px/1.2 var(--ui); letter-spacing: 0.12em; text-transform: uppercase; }
.cell .foot { align-self: flex-start; margin-top: 4px; }
.cell.on header b { color: var(--ink); }
.cell.on[data-group="missing"] header b { background: var(--highlight); color: var(--highlight-ink); padding: 0 4px; margin-inline-start: -4px; border-radius: 0; }
.list { flex: 1; min-height: 0; overflow: auto; }
.item { padding: 5px 0; border-top: 1px solid var(--line); }
.item .key { display: block; font: 600 12.5px/1.4 var(--mono); word-break: break-all; }
.item .key mark { background: var(--highlight); color: var(--highlight-ink); padding: 0 4px; border-radius: 0; }
.item .detail { display: block; color: var(--muted); font-size: 12px; line-height: 1.4; }
.item .detail em { font-style: normal; color: var(--ink); font-family: var(--mono); }
.lvl { font: 700 10.5px var(--ui); letter-spacing: 0.1em; text-transform: uppercase; margin-inline-end: 6px; }
.lvl { color: var(--muted); }
.secret, .shown { vertical-align: -2px; border-radius: 0; }
.secret { display: inline-block; min-width: 5ch; height: 1em; background: var(--bar); }
.shown { padding: 0 4px; font: 500 12px var(--mono); color: var(--ink); background: color-mix(in srgb, var(--highlight) 45%, transparent); word-break: break-all; }
.dups { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
.none { margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.cell.waiting { opacity: 0.55; }

.toast { position: fixed; left: 50%; bottom: 24px; margin: 0; padding: 10px 16px; border-radius: 0; background: var(--ink); color: var(--paper); font: 600 13px var(--ui); transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 900px) and (min-height: 660px) {
  .app { height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .stack { grid-template-rows: minmax(0, 1fr) minmax(210px, 40%); }
  .field { min-height: 56px; }
}
@media (max-width: 899px), (max-height: 659px) {
  .cells { grid-template-rows: none; }
  .list { overflow: visible; }
  .field { min-height: 160px; }
}
@media (max-width: 700px) {
  .bar, .stack { padding-inline: 14px; }
  .editors { grid-template-columns: 1fr; }
  .cells { grid-template-columns: 1fr; }
  .cell, .cell:first-child { border-inline-start: 0; border-top: 1px solid var(--line); padding: 10px 0 6px; }
}

/* Questions under the tool: for people who scroll, and for search engines */
.faq { max-width: 920px; margin: 0 auto; padding: 56px 20px 64px; }
.faq h2 { margin: 0 0 20px; font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; }
.faq-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px 32px; }
.faq h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.faq p { margin: 0; color: var(--muted); line-height: 1.6; }

/* Arabic page: letter spacing breaks the joins between Arabic letters. The files stay left to right. */
:lang(ar) :is(.report-head h2, .cell header h3, .lvl, .faq h2) { letter-spacing: 0; }
[dir="rtl"] .field textarea::placeholder { direction: rtl; text-align: right; }
code, bdi { direction: ltr; unicode-bidi: isolate; } /* .env stays .env inside Arabic text */
.lang { margin-inline-start: 10px; font-weight: 600; color: var(--ink); unicode-bidi: isolate; }

