/* Charts and data blocks of the generated pages (seo/kit.mjs). Tokens come
   from site.css; this sheet adds no hues of its own. */
.page.data { max-width: 860px; }
.page.boards { max-width: 1280px; }
.page.player { max-width: 1180px; }
.page.boards h1, .page.player h1 { margin-bottom: 8px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 1.2rem 0; }
.tiles div { background: var(--shelf); border: 1px solid var(--waterline); border-radius: var(--r-l); padding: .7rem 1rem; }
.tiles dt { color: var(--text-3); font-size: 15px; line-height: 1.4; }
.tiles dd { color: var(--text); font-size: 1.5rem; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tiles small { font-size: 15px; font-weight: 400; color: var(--text-2); }

table.chart { width: 100%; border-collapse: collapse; font-size: 16.5px; margin: .8rem 0; }
table.chart th, table.chart td { padding: .3rem .5rem; border-bottom: 1px solid var(--hair); text-align: start; font-weight: 400; color: var(--text-2); }
table.chart thead th { color: var(--text-3); font-size: 15px; white-space: nowrap; }
table.chart tbody th { color: var(--text); white-space: nowrap; }
table.chart td.n { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.chart td.bar { width: 55%; min-width: 120px; padding-inline: .25rem; }
table.chart td.bar i { display: inline-block; height: 12px; background: var(--c, var(--h1)); border-radius: 2px; vertical-align: middle; min-width: 1px; }
table.stack td.bar { white-space: nowrap; width: 38%; }
table.stack td.bar i { border-radius: 0; }
table.stack td.bar i:first-child { border-start-start-radius: 2px; border-end-start-radius: 2px; }
table.stack td.bar i:last-child { border-start-end-radius: 2px; border-end-end-radius: 2px; }
table.chart .dot { display: inline-block; width: 12px; height: 12px; margin-inline-end: 8px; vertical-align: -1px; }

.share { display: flex; height: 18px; border-radius: 4px; overflow: hidden; margin: 1rem 0 .4rem; background: var(--shoal); }
.share i { min-width: 1px; }

.cols { margin: 1rem 0; }
.cols div { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--waterline); }
.cols i { flex: 1 1 0; background: var(--c, var(--h1)); border-radius: 2px 2px 0 0; min-height: 1px; }
.cols figcaption { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 15px; padding-top: 4px; }

svg.outline { width: 100%; height: auto; max-height: 520px; margin: 1.2rem auto; }
svg.outline .out { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
svg.outline .in { fill: var(--accent-subtle); stroke: color-mix(in srgb, var(--accent) 42%, transparent); stroke-width: 1; transition: fill .15s; }
@media (hover: hover) and (pointer: fine) { svg.outline .in:hover { fill: var(--accent); } }

/* in-page section links, as a row of pills; the one being read is filled */
.prose .toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2rem 0; padding: 0; list-style: none; }
.prose .toc li { margin: 0; }
.toc a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 .9rem; border: 1px solid var(--waterline); border-radius: 999px; background: var(--shelf);
  color: var(--text); text-decoration: none; font-size: 16px; font-weight: 600; white-space: nowrap; transition: background-color .2s, color .2s, border-color .2s, scale .14s var(--ease); }
.toc a[aria-current="true"] { background: var(--pill); border-color: var(--pill); color: var(--on-pill); }
.toc a:active { scale: .97; }
@media (hover: hover) and (pointer: fine) { .toc a:not([aria-current="true"]):hover { border-color: var(--accent); color: var(--text); } }
@media (pointer: coarse) { .toc a { min-height: 44px; } }
.prose h3 { font-size: 1.05rem; margin: 1.8rem 0 .2rem; color: var(--text); }
.prose h3 + .muted { margin-bottom: .4rem; }

/* Governorate pages (seo/gov_pages.mjs): a board of cards. The map leads with
   the localities beside it; the land card takes the full width. */
.boards .lead { margin-top: .8rem; max-width: 62em; }
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 1.4rem; }
.panel { min-width: 0; background: var(--shelf); border: 1px solid var(--waterline); border-radius: var(--r-l); padding: 18px 20px 20px; scroll-margin-top: calc(var(--head) + 16px); }
.prose .panel > h2 { margin: 0 0 .7rem; padding: 0; border: 0; font-size: 1.25rem; }
.panel > :last-child, .panel .subs > div > :last-child { margin-bottom: 0; }
.panel figure { margin: .4rem 0 1rem; }
.panel svg.outline { margin: 0 auto .6rem; max-height: 460px; }
.panel .tiles div { background: var(--shoal); }
.panel .cta { margin-top: 1rem; margin-bottom: 1.2rem; }
/* a long governorate name wraps inside the button instead of pushing past the card */
.panel .cta .btn { white-space: normal; text-align: center; padding-block: 8px; line-height: 1.4; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; }
.pair .scroll { margin: 0; }
.pair small { display: block; color: var(--text-3); font-size: 14px; line-height: 1.35; }
.prose details .pair { margin-top: .2rem; }
.subs > div { break-inside: avoid; }
.subs > div > h3:first-child { margin-top: 1.2rem; }
@media (min-width: 640px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  /* the second table continues the first: its header is not repeated */
  .pair .scroll + .scroll thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* fourteen section links are one swipeable row, not six lines */
  .boards .toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .boards .toc::-webkit-scrollbar { display: none; }
  .panel { padding: 16px 14px 18px; }
}
@media (min-width: 1000px) {
  /* cards keep their own height: a short one is not stretched to its neighbour's */
  .board { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: dense; align-items: start; }
  .panel { grid-column: span 3; }
  .panel.tall { grid-column: span 2; grid-row: span 2; }
  .panel.main, .panel.tall + .panel.main + .panel { grid-column: span 4; }
  .panel.full { grid-column: 1 / -1; }
  .subs { columns: 2; column-gap: 40px; }
  .panel.full > ul, .panel.full > p { max-width: 70em; }
}

/* Boundary export tool (/svg-maps). */
.svgtool { margin: 1.4rem 0; }
.svgtool .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; align-items: end; }
.svgtool label { display: grid; gap: 4px; color: var(--text-2); font-size: 16.5px; }
.svgtool label.check { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.svgtool select, .svgtool input[type="color"] { width: 100%; min-height: 44px; background: var(--shelf); color: var(--text); border: 1px solid var(--waterline); border-radius: var(--r-m); padding: 0 10px; font: inherit; }
.svgtool input[type="color"] { padding: 4px; cursor: pointer; }
.svgtool .check input[type="color"] { width: 52px; }
.svgtool input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.svgtool input[type="range"] { accent-color: var(--accent); min-height: 44px; }
.svgtool .preview { margin: 1.2rem 0; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-l);
  background: repeating-conic-gradient(var(--shelf) 0 25%, var(--shoal) 0 50%) 0 0 / 20px 20px; }
.svgtool .preview svg { width: 100%; height: auto; max-height: 70vh; margin: 0 auto; }

/* Tutorials (/tutorials/…, assets/tutorial.js). Without the script the steps
   are a plain numbered list with their screenshots. */
.tut { margin: 1.2rem 0 1.6rem; }
.prose .tut-steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 2rem; }
.tut-steps > li { counter-increment: step; margin: 0; display: grid; gap: .8rem; scroll-margin-top: calc(var(--head) + 16px); }
.tut figure { position: relative; margin: 0; border: 1px solid var(--waterline); border-radius: var(--r-l); overflow: hidden; background: var(--shelf); }
.tut figure img { width: 100%; height: auto; border: 0; border-radius: 0; }
.tut-steps h3 { margin: 0; font-size: 1.15rem; }
.tut-steps h3::before, .tut-go::before { content: counter(step); flex: none; display: inline-grid; place-items: center; width: 1.7em; height: 1.7em; margin-inline-end: .5em;
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .85em; font-weight: 800; font-variant-numeric: tabular-nums; }
/* where to press: a ring at --x/--y, in percent of the screenshot */
.spot { position: absolute; left: var(--x); top: var(--y); width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 999px;
  border: 3px solid var(--selected); box-shadow: 0 0 0 2px rgba(2, 15, 31, .7); pointer-events: none; }
.tut.run .now .spot { animation: spot 1.6s var(--ease) infinite; }
@keyframes spot { 0% { transform: scale(.7); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
/* steps shot on a phone: the screenshot stands beside its text */
.tut-steps > li.phone { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.tut.phone figure { border-radius: 26px; border: 6px solid #111B27; }
.tut-steps > li.phone figure { border-radius: 26px; border: 6px solid #111B27; }
@media (max-width: 640px) { .tut-steps > li.phone { grid-template-columns: 1fr; } .tut-steps > li.phone figure { max-width: 260px; margin-inline: auto; } }

/* The player: the steps as a list on the start side, the current screenshot
   beside it. On a phone the screenshot comes first, then the list. */
.tut-bar { display: flex; align-items: center; gap: 8px; }
.tut-btn { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 999px; border: 1px solid var(--waterline); background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color .2s, color .2s, scale .14s var(--ease); }
.tut-btn:active { scale: .94; }
.tut-btn svg { width: 20px; height: 20px; }
.tut-count { color: var(--text-3); font-size: 16px; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: center; }
.tut-all { margin-inline-start: auto; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 16.5px; cursor: pointer; text-decoration: underline; text-underline-offset: .28em; }
.tut-go { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.tut.all .tut-go { cursor: default; }
.tut.on .tut-steps h3::before { content: none; }
.tut.on:not(.all) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px 32px; align-items: start; }
.tut.on:not(.all) .tut-bar { grid-column: 1 / -1; }
.tut.on:not(.all) .tut-steps { gap: 2px; }
.tut.on:not(.all) .tut-steps > li { display: block; padding: 2px 10px; border: 1px solid transparent; border-radius: var(--r-l); }
.tut.on:not(.all) .tut-steps > li > figure, .tut.on:not(.all) .tut-steps > li:not(.now) p { display: none; }
.tut.on:not(.all) .tut-steps h3 { font-size: 1.1rem; color: var(--text-2); }
.tut.on:not(.all) .tut-steps p { padding-inline-start: 2.25rem; padding-bottom: 12px; font-size: 17px; color: var(--text); }
/* upcoming: an outlined number; current: the filled pill; done: a tick */
.tut.on:not(.all) .tut-go::before { background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--shoal-2); }
.tut.on:not(.all) li.now { background: var(--shelf); border-color: var(--waterline); }
.tut.on:not(.all) li.now h3 { color: var(--text); }
.tut.on:not(.all) li.now .tut-go::before { background: var(--pill); color: var(--on-pill); box-shadow: none; }
.tut.on:not(.all) li.done .tut-go::before { content: ""; box-shadow: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23020F1F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 62% no-repeat; }
:root[data-theme="light"] .tut.on:not(.all) li.done .tut-go::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
/* while it advances by itself, a line fills under the open step over the dwell */
.tut.auto.run:not(.all) li.now { background-image: linear-gradient(var(--accent), var(--accent)); background-repeat: no-repeat; background-position: right bottom; background-size: 0% 2px;
  animation: tut-dwell var(--dwell, 6s) linear forwards; }
[dir="ltr"] .tut.auto.run:not(.all) li.now { background-position: left bottom; }
@keyframes tut-dwell { to { background-size: 100% 2px; } }
.tut-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hair); }
.tut-nav svg { width: 18px; height: 18px; flex: none; }
.tut-view { display: grid; order: -1; }
.tut-bar { order: -2; }
.tut-view figure { grid-area: 1 / 1; opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s .3s; }
.tut-view figure.now { opacity: 1; visibility: visible; transition: opacity .3s var(--ease); }
.tut.phone .tut-view figure { width: min(100%, 300px); margin-inline: auto; }
.tut.all .tut-view, .tut.all .tut-nav, .tut.all .tut-count, .tut.all .tut-play { display: none; }
@media (min-width: 900px) {
  .tut.on:not(.all) { grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); }
  .tut.on.phone:not(.all) { grid-template-columns: minmax(0, 1fr) 320px; }
  .tut-view { order: 0; position: sticky; top: calc(var(--head) + 16px); }
}
@media (hover: hover) and (pointer: fine) {
  .tut-btn:hover { color: var(--text); background: var(--accent-subtle); }
  .tut.on:not(.all) li:not(.now) .tut-go:hover { color: var(--text); }
  .cards a:hover { border-color: var(--accent); }
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 1.4rem 0; padding: 0; list-style: none; }
.prose .cards li { margin: 0; }
.cards a { display: grid; gap: 6px; height: 100%; padding: 12px; border: 1px solid var(--waterline); border-radius: var(--r-l); background: var(--shelf); text-decoration: none; color: var(--text-2);
  transition: border-color .2s, scale .14s var(--ease); }
.cards a:active { scale: .98; }
.cards img { border-radius: var(--r-m); aspect-ratio: 16 / 10; object-fit: cover; object-position: top; width: 100%; }
.cards strong { color: var(--text); }
@media (prefers-reduced-motion: reduce) {
  .tut.run .now .spot { animation: none; }
  .tut-view figure, .tut-view figure.now { transition: none; }
  .tut.auto.run:not(.all) li.now { animation: none; }
  .toc a:active, .tut-btn:active, .cards a:active { scale: 1; }
}
.prose details { margin: .4rem 0 1rem; }
.prose summary { cursor: pointer; color: var(--accent); font-size: 16.5px; min-height: 44px; display: flex; align-items: center; }
