:root {
  --blue: #1f4e8c; --blue-d: #163a69; --blue-l: #e8eef7;
  --grey: #5f6b7a; --grey-l: #f2f4f7; --line: #d9dee5; --ink: #161616; --white: #ffffff;
  --warn: #8a5a00; --warn-l: #fff6e0; --bad: #9b1c1c; --bad-l: #fdecec; --ok: #1f6b3a; --ok-l: #e8f5ec;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grey-l); color: var(--ink); }
body { font-family: "Almarai", "IBM Plex Sans", Arial, sans-serif; font-size: 15px; line-height: 1.6; }
html[lang="en"] body { font-family: "IBM Plex Sans", "Almarai", Arial, sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
.bar { position: sticky; top: 0; z-index: 5; background: var(--blue); color: var(--white); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 16px; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; }
.link, .lang { background: transparent; border: 1px solid rgba(255,255,255,.45); color: var(--white); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.link[aria-current="page"] { background: var(--white); color: var(--blue); }
main { max-width: 980px; margin: 0 auto; padding: 16px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
h1 { font-size: 20px; margin: 0 0 8px; color: var(--blue-d); }
h2 { font-size: 17px; margin: 0 0 8px; color: var(--blue-d); }
h3 { font-size: 15px; margin: 12px 0 6px; color: var(--blue-d); }
.muted { color: var(--grey); font-size: 13px; }
.row-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.num { font-weight: 800; color: var(--blue); font-size: 22px; }
.decision { font-size: 17px; font-weight: 700; margin: 6px 0 10px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: var(--blue-l); color: var(--blue-d); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.pill.warn { background: var(--warn-l); color: var(--warn); }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0 2px; }
.progress > span { display: block; height: 100%; background: var(--blue); }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: start; vertical-align: top; }
th { font-size: 13px; color: var(--grey); font-weight: 700; }
.chip { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px;
  font-weight: 800; font-family: "IBM Plex Sans", Arial, sans-serif; background: var(--grey-l); color: var(--grey); border: 1px solid var(--line); }
.chip.D { background: var(--blue); color: var(--white); border-color: var(--blue); }
.chip.R, .chip.A { background: var(--blue-l); color: var(--blue-d); border-color: #b9c9e2; }
.chip.P, .chip.I { background: var(--white); color: var(--blue-d); border-color: #b9c9e2; }
.changed { font-size: 12px; color: var(--warn); }
.lock { font-size: 12px; color: var(--grey); }
select.letter { width: 64px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn { border: 1px solid var(--blue); background: var(--white); color: var(--blue); border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 700; }
.btn.primary { background: var(--blue); color: var(--white); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
label { display: block; font-weight: 700; margin: 10px 0 4px; }
input[type=text], textarea, select.full { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); }
textarea { min-height: 80px; resize: vertical; }
.notice { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.notice.bad { background: var(--bad-l); color: var(--bad); }
.notice.ok { background: var(--ok-l); color: var(--ok); }
.notice.warn { background: var(--warn-l); color: var(--warn); }
.ref { border-inline-start: 3px solid var(--blue); background: var(--grey-l); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.ref .quote { margin: 4px 0; }
.ref .quote.ar { direction: rtl; text-align: right; font-family: "Almarai", Arial, sans-serif; }
.ref .quote.en { direction: ltr; text-align: left; font-family: "IBM Plex Sans", Arial, sans-serif; }
.ref a { color: var(--blue); word-break: break-all; }
details summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.cell { border: 1px solid var(--line); border-radius: 8px; padding: 6px 0; text-align: center; background: var(--white); cursor: pointer; font-family: "IBM Plex Sans", Arial, sans-serif; }
.cell.done { background: var(--ok-l); border-color: #b5dcc2; }
.cell.prop { background: var(--warn-l); border-color: #ecd49a; }
.cell.here { outline: 2px solid var(--blue); }
.foot { text-align: center; color: var(--grey); font-size: 12px; padding: 16px; }
ol.rules li { margin-bottom: 10px; white-space: pre-line; }
@media (max-width: 640px) {
  .hide-sm { display: none; }
  th, td { padding: 7px 4px; }
}
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 10px; padding: 10px 14px; min-height: 44px; cursor: pointer; font-weight: 700; touch-action: manipulation; }
.choice[aria-checked="true"] { background: var(--blue); color: var(--white); border-color: var(--blue); }
.picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pick { min-width: 42px; min-height: 40px; border: 1px solid var(--line); background: var(--white); color: var(--blue-d); border-radius: 8px; cursor: pointer; font-weight: 800; font-family: "IBM Plex Sans", Arial, sans-serif; touch-action: manipulation; }
.pick.on { background: var(--blue); color: var(--white); border-color: var(--blue); }
button { touch-action: manipulation; }
.chip.wide { width: auto; min-width: 30px; padding: 0 6px; font-size: 12px; white-space: nowrap; }
.pick { padding: 0 8px; }
