@font-face { font-family: "Archivo"; src: url("fonts/archivo-latin-standard-normal.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Spline Sans Mono"; src: url("fonts/spline-sans-mono-latin-wght-normal.woff2") format("woff2"); font-weight: 300 700; 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; }

:root {
  --paper: #f5f6f8;
  --rule: #dfe3ea;
  --ink: #161a22;
  --muted: #667085;
  --pen: #2453d6;
  --pen-soft: rgb(36 83 214 / 0.09);
  --ui: "Archivo", "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: var(--ui);
  --mono: "Spline Sans Mono", "Readex Pro", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --row: 30px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e1116;
    --rule: #232a35;
    --ink: #e6e9ef;
    --muted: #8a93a3;
    --pen: #7da2ff;
    --pen-soft: rgb(125 162 255 / 0.12);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body { margin: 0; background: var(--paper); color: var(--ink); font: 400 14px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 2px; border-radius: 2px; }

.app { display: flex; flex-direction: column; min-height: 100dvh; }

.bar { display: flex; align-items: baseline; gap: 6px 22px; flex-wrap: wrap; padding: 14px 24px 8px; }
.brand { margin: 0; font: 800 26px/1 var(--ui); font-stretch: 75%; letter-spacing: -0.01em; text-transform: uppercase; }
.brand i { font-style: normal; color: var(--pen); }
.file { margin: 0; flex: 1; min-width: 0; color: var(--muted); font: 500 13px var(--ui); }
.file b { color: var(--ink); font-weight: 700; }
.bar-meta { color: var(--muted); font-size: 12.5px; }

.tools { display: flex; justify-content: space-between; align-items: center; gap: 10px 20px; flex-wrap: wrap; padding: 0 24px 10px; }
.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.purpose { margin: 0; color: var(--muted); font-size: 14px; }
.ghost, .ink, .fix { padding: 7px 12px; border: 1.5px solid var(--ink); border-radius: 2px; background: transparent; font: 600 12.5px var(--ui); cursor: pointer; }
.ghost:hover { background: var(--ink); color: var(--paper); }
.ink { background: var(--pen); border-color: var(--pen); color: #fff; }
.ink:hover { filter: brightness(1.1); }
.ink:disabled { opacity: 0.35; cursor: default; filter: none; }
.ghost:focus-within { outline: 2px solid var(--pen); outline-offset: 2px; }
.link { padding: 0; border: 0; background: none; color: var(--pen); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Findings: what breaks, and what one click fixes */
.findings { display: grid; grid-template-columns: 1fr 1fr; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); }
.findings .col { padding: 10px 24px 12px; min-width: 0; }
.findings .col + .col { border-inline-start: 1px solid var(--rule); }
.findings h2 { margin: 0 0 6px; font: 800 12px/1 var(--ui); font-stretch: 85%; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.findings ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.findings li { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 14px; }
.findings li .n { min-width: 6ch; text-align: end; font: 700 14px var(--mono); font-variant-numeric: tabular-nums; color: var(--pen); }
.findings li .what { flex: 1; min-width: 0; }
.findings li .what small { color: var(--muted); font-size: 12.5px; }
.findings li.none { color: var(--muted); }
.findings li.done .n, .findings li.done .what { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--rule); }
.findings li.done .fix { border-color: var(--rule); color: var(--muted); }
.fix { padding: 4px 12px; border-color: var(--pen); color: var(--pen); }
.fix:hover { background: var(--pen); color: #fff; }
.tag { padding: 2px 8px; border-radius: 2px; background: var(--pen-soft); color: var(--pen); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* The sheet fills the rest of the screen and scrolls inside */
.sheet { position: relative; flex: 1; min-height: 320px; display: flex; }
.drop { flex: 1; display: grid; place-content: center; text-align: center; margin: 12px 24px 24px; border: 2px dashed var(--rule); border-radius: 2px;
  background: repeating-linear-gradient(to bottom, transparent 0 29px, var(--rule) 29px 30px); }
.drop.over { border-color: var(--pen); background-color: var(--pen-soft); }
.drop-big { margin: 0; font: 800 clamp(30px, 5vw, 56px)/1 var(--ui); font-stretch: 70%; text-transform: uppercase; }
.drop-small { margin: 10px 0 0; color: var(--muted); }

/* Columns stay in file order on the Arabic page too */
.grid { position: absolute; inset: 0; overflow: auto; font: 400 12.5px var(--mono); direction: ltr; }
.row, .head-row { display: grid; grid-template-columns: var(--cols); width: max-content; min-width: 100%; }
.head { position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
.body { position: relative; }
.row { position: absolute; left: 0; height: var(--row); border-bottom: 1px solid var(--rule); }

.cell { min-width: 0; padding: 0 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: var(--row); border-right: 1px solid var(--rule); }
.cell.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell.none::before { content: "—"; color: var(--rule); }
.cell.flag { color: var(--pen); background: var(--pen-soft); font-weight: 600; }
.cell.idx { position: sticky; left: 0; z-index: 1; background: var(--paper); color: var(--muted); text-align: right; border-right: 3px double var(--muted); }
.cell.idx.flag { color: var(--pen); }
.cell.extra { color: var(--pen); font-style: italic; }

.hcell { min-width: 0; padding: 8px 10px 8px; border-right: 1px solid var(--rule); font-family: var(--ui); }
.hcell.idx { position: sticky; left: 0; z-index: 1; background: var(--paper); border-right: 3px double var(--muted); }
.hcell b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 14px/1.2 var(--ui); font-stretch: 85%; }
.hcell .kind { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: 0.04em; }
.hcell .warn { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--pen); font-size: 12px; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 22px; margin: 0; padding: 9px 16px; border-radius: 2px; background: var(--ink); color: var(--paper); font: 600 13px var(--ui); transform: translate(-50%, 14px); 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: 600px) {
  .app { height: 100dvh; }
}
@media (max-width: 700px) {
  .bar, .tools { padding-inline: 16px; }
  .findings { grid-template-columns: 1fr; }
  .findings .col { padding-inline: 16px; }
  .findings .col + .col { border-inline-start: 0; border-top: 1px solid var(--rule); }
  .drop { margin: 10px 16px 16px; }
  .file { flex-basis: 100%; order: 3; }
  .sheet { min-height: 70dvh; }
}

.lang { margin-inline-start: 10px; font-weight: 600; color: var(--ink); unicode-bidi: isolate; }
:lang(ar) :is(.brand, .findings h2, .hcell .kind, .faq h2) { letter-spacing: 0; }
:lang(ar) .findings h2 { font-size: 13px; text-transform: none; }
/* Arabic labels under a column name read right to left, in the column's own left-to-right box */
:lang(ar) .hcell :is(.kind, .warn) { direction: rtl; text-align: left; }

/* 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; }
