/*
 * Wasla's own components, on top of koydam.css tokens and admin.css.
 * The game colours (teal tiles, indigo solved tiles) appear only where the
 * panel shows what the app will draw.
 */

:root {
  --wz-teal: #14a49e;
  --wz-indigo: #4e4a8c;
  --wz-board: #d6eeea;
}

.wz-ar, .wz-answer, .wz-answer-input { font-family: "Noto Kufi Arabic", "Geeza Pro", Tahoma, sans-serif; }
.wz-ar { direction: rtl; unicode-bidi: plaintext; }
.wz-answer { font-weight: 700; font-size: 1.05rem; direction: rtl; unicode-bidi: isolate; }
.wz-answer-input { font-size: 1.4rem; font-weight: 700; }
.wz-search { max-width: 22rem; }

/* A question picture, framed and zoomed the way the app frames it. */
.wz-frame {
  --wz-size: 180px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--wz-size);
  max-width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--kd-radius-sm);
  background: var(--kd-surface-2);
  border: 1px solid var(--kd-line);
  color: var(--kd-faint);
  vertical-align: middle;
}
.wz-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--wz-zoom, 1));
  transform-origin: var(--wz-x, 50%) var(--wz-y, 50%);
  transition: transform var(--kd-fast) var(--kd-ease), transform-origin var(--kd-fast) var(--kd-ease);
}
.wz-frame.wz-xs { --wz-size: 36px; border-radius: 8px; }
.wz-frame.wz-sm { --wz-size: 48px; border-radius: 8px; }
.wz-frame.wz-lg { --wz-size: 260px; }
.wz-badge {
  position: absolute; inset-inline-end: 3px; bottom: 3px;
  padding: 0 4px; border-radius: 6px;
  background: rgba(11, 18, 32, .72); color: #fff;
  font-size: 10px; font-weight: 600; line-height: 1.5;
}
.wz-xs .wz-badge { display: none; }

/* Zoom editor */
.wz-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; align-items: start; }
.wz-source { position: relative; cursor: crosshair; border-radius: var(--kd-radius-sm); overflow: hidden; border: 1px solid var(--kd-line); background: var(--kd-surface-2); }
.wz-source img { display: block; width: 100%; height: auto; }
.wz-dot {
  position: absolute; left: var(--wz-x, 50%); top: var(--wz-y, 50%);
  width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border: 3px solid #fff; border-radius: 50%;
  background: var(--kd-accent);
  box-shadow: 0 0 0 1px rgba(11, 18, 32, .35), 0 2px 6px rgba(11, 18, 32, .3);
  pointer-events: none;
}
.wz-letters { font-weight: 600; color: var(--kd-ink-2); }

/* Grid preview: column 1 is the right edge, as in the app. */
.wz-board {
  overflow-x: auto;
  padding: 1.25rem;
  border-radius: var(--kd-radius);
  background: var(--wz-board);
  display: grid;
  justify-content: center;
}
.wz-grid {
  direction: rtl;
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(var(--wz-cols), 40px);
  grid-template-rows: repeat(var(--wz-rows), 40px);
}
.wz-cell {
  position: relative;
  display: grid; place-items: center;
  border-radius: 5px;
  background: var(--wz-indigo);
  color: #fff;
  font-family: "Noto Kufi Arabic", "Geeza Pro", Tahoma, sans-serif;
  font-size: 1.15rem; font-weight: 800;
}
.wz-cell small {
  position: absolute; top: 1px; inset-inline-start: 3px;
  font-family: var(--bs-font-sans-serif);
  font-size: 9px; font-weight: 600; opacity: .75;
}

/* Question picker */
.wz-picker { max-height: 32rem; overflow-y: auto; overflow-x: hidden; display: grid; gap: 2px; }
.wz-pick {
  display: flex; align-items: center; gap: .6rem;
  padding: .4rem .5rem;
  border-radius: var(--kd-radius-sm);
  cursor: pointer;
}
.wz-pick:hover { background: var(--kd-surface); }
.wz-pick .form-check-input { flex-shrink: 0; margin: 0; }
.wz-pick .min-w-0 { min-width: 0; flex: 1 1 auto; }
.wz-pick .kd-tag, .wz-pick .wz-frame { flex-shrink: 0; }

/* ── v2 ───────────────────────────────────────────────────────────────────── */

/* How the answer is played, under the answer field. */
.wz-play { min-height: 1.6rem; margin-top: .35rem; font-size: .9rem; color: var(--kd-muted); font-family: "Noto Kufi Arabic", "Geeza Pro", Tahoma, sans-serif; }
.wz-play.is-folded { color: var(--kd-accent-ink); }
.wz-fold-note {
  display: block;
  margin-top: .4rem; padding: .45rem .6rem;
  border-radius: var(--kd-radius-sm);
  background: var(--kd-accent-soft); color: var(--kd-accent-ink);
  font-size: .8rem;
}
.wz-fold-note .lucide { vertical-align: -2px; margin-inline-end: .25rem; }

.wz-emoji-input { font-size: 1.3rem; }
.wz-emoji { font-size: 1.1rem; letter-spacing: .05em; }

/* A blurred picture question, as the app first shows it. */
.wz-frame.is-blurred img { filter: blur(10px); }

.wz-audio { width: 100%; }
.wz-audio-sm { width: 180px; height: 32px; vertical-align: middle; }

/* Difficulty chip: kd-tag has ok and warn; hard needs red. */
.wz-tag-hard { background: #fef2f2; border-color: #fecaca; color: var(--kd-danger); }

/* Settings: the 7-day reward cycle in one row. */
.wz-reward-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: .4rem; }
.wz-reward-day { display: grid; gap: .15rem; }
.wz-reward-day small { font-size: .7rem; color: var(--kd-muted); }

/* Stats */
.wz-stats th a { color: inherit; text-decoration: none; white-space: nowrap; }
.wz-stats th a:hover { color: var(--kd-ink); }
.wz-stats-clue { max-width: 18rem; }
.wz-stats a.wz-answer { color: var(--kd-ink); text-decoration: none; }
.wz-stats a.wz-answer:hover { color: var(--kd-accent-ink); }
.wz-help-mix { max-width: 15rem; margin-inline-start: auto; line-height: 1.35; }
.wz-rate {
  display: inline-block; width: 44px; height: 6px; margin-inline-end: .35rem;
  border-radius: 99px; background: var(--kd-surface-2); overflow: hidden; vertical-align: middle;
}
.wz-rate-bar { display: block; height: 100%; width: var(--wz-rate); background: var(--wz-teal); }

/* Import preview */
.wz-import td { vertical-align: top; }
.wz-row-error { background: #fffafa; }
.wz-error-text { color: var(--kd-danger); max-width: 16rem; margin-top: .2rem; }

/* Legal pages: koydam.css tokens, no admin shell. */
.wz-legal-body { background: var(--kd-surface); color: var(--kd-ink-2); margin: 0; font-family: Inter, system-ui, sans-serif; }
.wz-legal { max-width: 46rem; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.wz-legal-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: 1.5rem; font-weight: 800; color: var(--kd-ink); font-family: "Noto Kufi Arabic", Inter, sans-serif; }
.wz-legal-head small { font-weight: 600; color: var(--kd-muted); font-family: Inter, sans-serif; }
.wz-legal-nav { display: flex; gap: 1rem; margin-inline-start: auto; font-size: .85rem; font-weight: 600; }
.wz-legal a { color: var(--kd-accent-ink); }
.wz-legal-section {
  background: var(--kd-bg); border: 1px solid var(--kd-line); border-radius: var(--kd-radius);
  padding: 1.5rem 1.6rem; box-shadow: var(--kd-shadow); line-height: 1.75;
}
.wz-legal-section[lang="ar"] { font-family: "Noto Kufi Arabic", "Geeza Pro", Tahoma, sans-serif; line-height: 2; }
.wz-legal-section h1 { font-size: 1.5rem; font-weight: 800; color: var(--kd-ink); margin: 0 0 .25rem; }
.wz-legal-section h2 { font-size: 1.05rem; font-weight: 700; color: var(--kd-ink); margin: 1.4rem 0 .4rem; }
.wz-legal-section ul { padding-inline-start: 1.3rem; }
.wz-legal-meta { color: var(--kd-faint); font-size: .85rem; }
.wz-legal-mail { font-size: 1.15rem; font-weight: 700; }
.wz-legal-rule { border: 0; margin: 1.5rem 0; }
.wz-legal-foot { margin-top: 2rem; text-align: center; font-size: .8rem; color: var(--kd-faint); }

/* ── v3 ───────────────────────────────────────────────────────────────────── */

/* Challenge landing page (/c/:level): standalone, phone-first, the game's colours. */
.wz-challenge-body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .28) 0 38%, transparent 38%),
    linear-gradient(62deg, transparent 55%, rgba(255, 255, 255, .2) 55%),
    #d6eeea;
  color: #1f2d3a;
  font-family: Tajawal, "Geeza Pro", Tahoma, sans-serif;
}
.wz-challenge { max-width: 26rem; margin: 0 auto; padding: 1.5rem 1rem 2rem; display: grid; gap: 1.1rem; }
.wz-challenge-brand { display: flex; align-items: center; justify-content: center; gap: .5rem; font-family: Lalezar, Tajawal, sans-serif; font-size: 2rem; color: #0e7f7a; }
.wz-challenge-card {
  background: #fff; border-radius: 26px; padding: 1.6rem 1.25rem 1.4rem; text-align: center;
  box-shadow: 0 8px 16px rgba(14, 127, 122, .16);
}
.wz-challenge-kicker {
  display: inline-block; margin: 0 0 .6rem; padding: .25rem 1rem .15rem;
  border: 2.5px solid #1f2d3a; border-radius: 99px; background: #14a49e; color: #fff;
  font-weight: 800; box-shadow: 0 3px 0 #1f2d3a;
}
.wz-challenge-title { margin: 0 0 1rem; font-family: Lalezar, Tajawal, sans-serif; font-weight: 400; font-size: 2.3rem; line-height: 1.2; color: #0e7f7a; }
.wz-challenge-score { display: flex; justify-content: center; gap: .75rem; margin-bottom: 1rem; }
.wz-challenge-stat { flex: 1 1 0; display: grid; gap: .2rem; padding: .7rem .5rem; border-radius: 16px; background: #eeedfb; }
.wz-challenge-stat-value { font-size: 1.8rem; font-weight: 900; color: #4e4a8c; line-height: 1.2; }
.wz-challenge-stat-label { font-size: .85rem; font-weight: 700; color: #5d7c80; }
.wz-challenge-stars { font-size: 1.7rem; line-height: 1.25; letter-spacing: .1em; color: #c9c6ec; }
.wz-challenge-star.is-earned { color: #f5c33b; }
.wz-challenge-text { margin: 0 0 1.2rem; font-size: 1.15rem; font-weight: 700; }
.wz-challenge-actions { display: grid; gap: .8rem; }
.wz-challenge-btn {
  display: block; padding: .85rem 1rem .7rem; border: 2.5px solid #1f2d3a; border-radius: 18px;
  font-size: 1.2rem; font-weight: 800; text-decoration: none; box-shadow: 0 4px 0 #1f2d3a;
  transition: transform .1s ease, box-shadow .1s ease;
}
.wz-challenge-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #1f2d3a; }
.wz-challenge-btn-primary { background: #f5c33b; color: #1f2d3a; }
.wz-challenge-btn-store { background: #fff; color: #1f2d3a; font-size: 1rem; }
.wz-challenge-foot { text-align: center; font-size: .85rem; color: #5d7c80; }
.wz-challenge-foot a { color: #0e7f7a; }

/* Notifications */
.wz-tabs { border-radius: var(--kd-radius-sm); overflow: hidden; max-width: 22rem; border: 1px solid var(--kd-line); }
.wz-level-input { max-width: 9rem; }
.wz-notification-cell { max-width: 20rem; }
.wz-device-id { max-width: 9rem; }
.wz-push-preview {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .75rem .9rem; border-radius: 18px; background: var(--kd-surface-2);
  font-family: "Noto Kufi Arabic", "Geeza Pro", Tahoma, sans-serif;
}
.wz-push-preview img { border-radius: 8px; flex-shrink: 0; }
.wz-push-title { font-weight: 700; color: var(--kd-ink); }
.wz-push-body { font-size: .9rem; color: var(--kd-ink-2); white-space: pre-wrap; }

/* Players */
.wz-chart-wrap { width: 100%; overflow-x: auto; }
.wz-chart { display: block; width: 100%; min-width: 520px; height: auto; }
.wz-chart-bar { fill: var(--wz-teal); }
.wz-chart-bar:hover { fill: #0e7f7a; }
.wz-chart-grid { stroke: var(--kd-line); stroke-width: 1; }
.wz-chart-base { stroke: var(--kd-muted); stroke-width: 1; }
.wz-chart-axis { fill: var(--kd-muted); font-size: 11px; font-family: Inter, system-ui, sans-serif; }
.wz-funnel-col { width: 38%; min-width: 9rem; }
.wz-funnel { position: relative; display: block; height: 14px; border-radius: 99px; background: var(--kd-surface-2); overflow: hidden; }
.wz-funnel-open, .wz-funnel-done { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--wz-share, 0%); border-radius: 99px; }
.wz-funnel-open { background: #b8e3df; }
.wz-funnel-done { background: var(--wz-teal); }
.wz-drop-row { background: #fffbeb; }
.wz-drop-cell { color: var(--kd-danger); font-weight: 700; }
.wz-help-row { display: grid; grid-template-columns: 9.5rem 1fr 5.5rem; align-items: center; gap: .6rem; }
.wz-help-row .ad-meter, .wz-share-fill { display: block; }
.wz-share-fill { width: var(--wz-share, 0%); background: var(--wz-teal); }
/* KPI cards whose label wraps keep their number on the same baseline as the rest. */
.wz-kpi { display: flex; flex-direction: column; justify-content: space-between; }

/* Level page picker: the level's questions, then the ones still free to add. */
.wz-pick-group { display: grid; gap: 2px; }
.wz-pick-group + .wz-pick-group { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--kd-line); }
.wz-pick-group .ad-section-label { margin-bottom: .25rem; }

/* Word search preview: the app's mint ground, a cream board, Tajawal letters
   and one soft stroke per hidden word. Column 0 is the right edge (dir="rtl"
   on the grid); the strokes' coordinates already count from the right. */
.ws-layout { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.ws-stage {
  flex: 0 0 auto;
  width: min(100%, 460px);
  padding: 1.25rem;
  border-radius: 28px;
  background: #d6eeea;
}
.ws-head { display: flex; justify-content: center; margin-bottom: .9rem; }
.ws-theme {
  padding: .3rem 1.1rem;
  border-radius: 99px;
  background: #fff;
  border: 2px solid #1f2d3a;
  color: #1f2d3a;
  font-family: Tajawal, "Geeza Pro", Tahoma, sans-serif;
  font-size: 1.15rem; font-weight: 800;
}
.ws-board {
  padding: 12px;
  border-radius: 22px;
  background: #fffdf6;
  border: 2px solid #1f2d3a;
  box-shadow: 0 4px 0 #1f2d3a;
}
.ws-grid {
  position: relative;
  display: grid;
  /* minmax(0, …): a wide letter must not push a 10-column board past its frame. */
  grid-template-columns: repeat(var(--ws-size), minmax(0, 1fr));
}
.ws-cell {
  aspect-ratio: 1;
  display: grid; place-items: center;
  color: #1f2d3a;
  font-family: Tajawal, "Geeza Pro", Tahoma, sans-serif;
  font-size: clamp(1rem, 4.2vw, 1.6rem); font-weight: 800;
  line-height: 1;
  position: relative; z-index: 1;
}
.ws-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.ws-lines line { stroke-width: .72; stroke-linecap: round; stroke-opacity: .42; }
.ws-side { flex: 1 1 22rem; min-width: 0; }
.ws-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--ws-colour); opacity: .75; vertical-align: middle; }
.ws-arrow { font-size: 1.1rem; }

/* Daily puzzle schedule and editor. */
.ws-stage-compact .ws-cell { font-size: clamp(.95rem, 3.2vw, 1.45rem); }
.ws-loading { opacity: .55; transition: opacity var(--kd-fast) var(--kd-ease); }
.ws-words-input { min-height: 14rem; font-size: 1.05rem; line-height: 1.7; }
.ws-past > summary { cursor: pointer; list-style: none; }
.ws-past > summary::-webkit-details-marker { display: none; }
.ws-past:not([open]) > summary { border-bottom: 0; }
.ws-past-chevron { transition: transform var(--kd-fast) var(--kd-ease); }
.ws-past[open] .ws-past-chevron { transform: rotate(90deg); }
/* A radio picker drawn as a button group: the chosen one is ink, like btn-kd. */
.btn-check:checked + .btn-kd-outline { background: var(--kd-ink); border-color: var(--kd-ink); color: #fff; }

/* Bulk actions on the questions list: a bar that stays in view while rows are ticked. */
.wz-bulk { position: sticky; top: calc(var(--ad-topbar-h, 60px) + .5rem); z-index: 1020; padding: .6rem .8rem; }
.wz-bulk.is-active { box-shadow: 0 0 0 2px var(--kd-ink); }
.wz-bulk-field { width: auto; min-width: 9rem; }
.wz-bulk-group { display: inline-flex; gap: .35rem; align-items: center; }

/* The day's ladder: its rungs in order, wrapping on a narrow screen. */
.wz-ladder { display: flex; flex-wrap: wrap; gap: .35rem; }
.wz-ladder .kd-tag { white-space: nowrap; }

/* Category buttons above the questions list. */
.wz-categories { display: flex; flex-wrap: wrap; gap: .4rem; }
.wz-category-count { opacity: .7; font-weight: 600; margin-inline-start: .25rem; }
.wz-check { width: 2rem; }

/* Pasted questions: room to read Arabic lines. */
.wz-paste { font-size: 1rem; line-height: 1.7; }

/* The import preview's editable rows. */
.wz-import-answer { min-width: 9rem; font-weight: 700; }
.wz-import-title { min-width: 8rem; }
.wz-import-clue { min-width: 16rem; resize: vertical; }
.wz-import-level { width: 4.5rem; }
.wz-row-remove { padding: .1rem .3rem; }

/* Titles page. */
.wz-titles-add { max-width: 28rem; }
.wz-title-rename { width: 12rem; }
.wz-row-import { padding: .1rem .35rem; margin-inline-end: .35rem; }
.wz-import-status { min-width: 9rem; max-width: 16rem; }

/* The public picture-credits table. */
.wz-credits { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .95rem; }
.wz-credits th, .wz-credits td { text-align: start; padding: .4rem .6rem; border-bottom: 1px solid #e5e7eb; }
.wz-credits th { font-weight: 700; }

/* The bulk bar's pickers (level, title) dressed like the outline buttons beside them. */
.wz-bulk .form-select {
  background-color: #fff;
  border: 1px solid var(--kd-line-strong);
  border-radius: 10px;
  color: var(--kd-ink);
  font-size: .875rem;
  font-weight: 550;
  min-height: 2.05rem;
  padding-block: .3rem;
  padding-inline-start: .75rem;
  cursor: pointer;
  box-shadow: none;
  transition: background-color var(--kd-fast) var(--kd-ease), border-color var(--kd-fast) var(--kd-ease);
}
.wz-bulk .form-select {
  /* The chevron, drawn in the ink colour, on the side the text ends. */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%230b1220' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-size: 12px 10px;
  /* The panel reads right to left, so the chevron sits at the inline end —
     the left — where the padding for it is. Pinning it to the right put it on
     top of the first letter, and «اللغز…» read «للغز…». */
  background-position: left .7rem center;
  padding-inline-end: 2rem;
  appearance: none;
}
.wz-bulk .form-select:dir(ltr) { background-position: right .7rem center; }
.wz-bulk .form-select:hover { background-color: var(--kd-surface); border-color: var(--kd-ink); }
.wz-bulk .form-select:focus-visible { border-color: var(--kd-ink); box-shadow: 0 0 0 3px rgba(11, 18, 32, .12); outline: none; }

/* A question's difficulty beside its title. */
.wz-diff { margin-inline-start: .25rem; }

/* Upload a picture straight from a questions-list row. */
.wz-upload { cursor: pointer; gap: .35rem; white-space: nowrap; }
.wz-upload.is-busy { opacity: .55; pointer-events: none; }

/* Back to top, bottom corner of every panel page. */
.wz-to-top {
  position: fixed;
  inset-block-end: 1.25rem;
  inset-inline-end: 1.25rem;
  z-index: 1035;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--kd-line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--kd-ink);
  box-shadow: 0 6px 20px rgba(11, 18, 32, .12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(.5rem);
  transition: opacity var(--kd-fast) var(--kd-ease), transform var(--kd-fast) var(--kd-ease), visibility var(--kd-fast);
}
.wz-to-top.is-shown { opacity: 1; visibility: visible; transform: none; }
.wz-to-top:hover { background: var(--kd-surface); border-color: var(--kd-ink); }

/* Generate levels: the categories a level draws one question from. */
.wz-generate-categories { display: flex; flex-wrap: wrap; gap: .4rem; }
.wz-generate-category {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .6rem;
  border: 1px solid var(--kd-line);
  border-radius: var(--kd-radius-sm);
  cursor: pointer;
}
.wz-generate-category:hover { border-color: var(--kd-line-strong); }
.wz-generate-field { display: grid; gap: .2rem; min-width: 8rem; }
.wz-generate-category.is-disabled { opacity: .45; cursor: not-allowed; }

/* ===================================================================== *
 *  شبّك — the panel wears the game's clothes.
 *
 *  koydam.css is written entirely in `--kd-*` tokens, so the whole shell
 *  can be re-coloured from here without touching the shared stylesheet
 *  (which five other panels read). What tokens cannot express — the ink
 *  outline and the ledge under every plate, the two game faces — is added
 *  below, class by class, using the names admin.css already defines.
 * ===================================================================== */

:root {
  /* The game's palette, from Wasla/DesignSystem/Palette.swift */
  --wz-ink: #1f2d3a;
  --wz-teal-deep: #0e7f7a;
  --wz-gold: #f5c33b;
  --wz-gold-light: #ffe79a;
  --wz-coral: #ff7a59;
  --wz-green: #2e9b74;
  --wz-green-deep: #1f7155;
  --wz-red: #d8483b;
  --wz-paper: #ffffff;
  --wz-board-1: #e9f6f3;
  /* Every plate in the app is drawn with this border and this ledge. */
  --wz-line: 2px;
  --wz-ledge: 3px;

  /* Shell tokens */
  --kd-bg: var(--wz-board-1);
  --kd-surface: var(--wz-paper);
  --kd-surface-2: var(--wz-board);
  --kd-ink: var(--wz-ink);
  --kd-ink-2: #2b3f4d;
  --kd-muted: #5d7c80;
  --kd-faint: #8aa7ab;
  --kd-line: #cfe4e0;
  --kd-line-strong: #a9cfc9;
  --kd-accent: var(--wz-teal);
  --kd-accent-ink: var(--wz-teal-deep);
  --kd-accent-soft: var(--wz-board-1);
  --kd-ok: var(--wz-green-deep);
  --kd-warn: #8a5300;
  --kd-danger: var(--wz-red);
  --kd-radius: 18px;
  --kd-radius-sm: 12px;
  --kd-radius-lg: 24px;
  --kd-shadow: 0 var(--wz-ledge) 0 rgba(31, 45, 58, .16);
  --kd-shadow-lift: 0 6px 0 rgba(31, 45, 58, .18);
  --bs-body-font-family: "Tajawal", "Noto Kufi Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background:
    radial-gradient(120% 80% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 60%),
    var(--kd-bg);
}

/* Lalezar is the app's display face: titles, figures, the brand. */
.ad-page-title, .ad-kpi-value, .ad-brand, .kd-h1, .kd-h2, .kd-h3, .kd-h4, .wz-display {
  font-family: "Lalezar", "Tajawal", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}
.ad-page-title { color: var(--wz-teal-deep); font-size: 1.65rem; }
.ad-kpi-value { color: var(--wz-ink); }

/* ----------------------------------------------------------- shell ---- */

.ad-sidebar {
  background: var(--wz-paper);
  border-right: var(--wz-line) solid var(--wz-ink);
}
.ad-brand {
  background: var(--wz-teal);
  color: var(--wz-paper);
  border-bottom: var(--wz-line) solid var(--wz-ink);
  font-size: 1.25rem;
}
.ad-brand small { color: rgba(255, 255, 255, .75); }
.ad-nav-label { color: var(--wz-teal-deep); letter-spacing: .08em; }
.ad-nav-link { border-radius: var(--kd-radius-sm); font-weight: 700; color: var(--kd-ink-2); }
.ad-nav-link:hover { background: var(--wz-board-1); color: var(--wz-ink); }
/* The chosen page is a tile, like a pressed piece in the game. */
.ad-nav-link.is-active {
  background: var(--wz-gold-light);
  color: var(--wz-ink);
  border: var(--wz-line) solid var(--wz-ink);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
  margin-bottom: var(--wz-ledge);
}
.ad-nav-link.is-active .lucide { color: var(--wz-ink); }
.ad-nav-link.is-active .ad-badge { background: var(--wz-ink); color: var(--wz-paper); }
.ad-sidebar-foot { border-top: var(--wz-line) solid var(--kd-line); }

.ad-topbar {
  background: rgba(233, 246, 243, .9);
  border-bottom: var(--wz-line) solid var(--wz-ink);
}

/* ------------------------------------------------------ plates -------- */

.ad-card, .ad-kpi, .ad-login-card, .ad-editor, .ad-preview, .ad-drop {
  border: var(--wz-line) solid var(--wz-ink);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
  background: var(--wz-paper);
}
/*
 * The shared head spreads its children to both ends, which is right for a head
 * that carries buttons — those all claim the far end with `me-auto` — but threw
 * a bare title across the card, away from its own icon. Start at the start.
 */
.ad-card-head {
  border-bottom: var(--wz-line) solid var(--kd-line);
  justify-content: flex-start;
}
.ad-table thead th {
  background: var(--wz-board);
  color: var(--wz-teal-deep);
  border-bottom: var(--wz-line) solid var(--kd-line);
  letter-spacing: .04em;
}
.ad-table tbody td { border-top: 1px solid var(--kd-line); }
.ad-table tbody tr:hover > td { background: var(--wz-board-1); }

/* Status pills: the game's own faces, outlined like its badges. */
.ad-status {
  border: 1.5px solid var(--wz-ink);
  font-weight: 800;
  padding: .12rem .55rem;
}
.ad-status-published { background: var(--wz-green); color: #fff; }
.ad-status-draft     { background: var(--wz-board); color: var(--kd-ink-2); }
.ad-status-archived  { background: var(--wz-red); color: #fff; }
.ad-status-sent      { background: var(--wz-gold-light); color: #6b4300; }

/* ------------------------------------------------------ controls ------ */

/* Every button is one of the game's plates: a face, an ink border, a ledge
   under it, and a press that drops the plate onto the ledge. */
.btn-kd, .btn-kd-accent, .btn-kd-outline, .btn-kd-danger {
  border: var(--wz-line) solid var(--wz-ink);
  border-radius: var(--kd-radius-sm);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
  font-weight: 800;
  transform: translateY(0);
  transition: transform var(--kd-fast) var(--kd-ease), box-shadow var(--kd-fast) var(--kd-ease);
}
.btn-kd:active, .btn-kd-accent:active, .btn-kd-outline:active, .btn-kd-danger:active {
  transform: translateY(var(--wz-ledge));
  box-shadow: 0 0 0 var(--wz-ink);
}
/* koydam.css styles `:hover` and `:focus-visible` together, and a pseudo-class
   beats a plain class — so a focused button fell back to the old ink palette
   until these said otherwise. */
.btn-kd { background: var(--wz-gold); color: var(--wz-ink); }
.btn-kd:hover, .btn-kd:focus-visible { background: var(--wz-gold-light); border-color: var(--wz-ink); color: var(--wz-ink); }
.btn-kd-accent { background: var(--wz-teal); color: var(--wz-paper); }
.btn-kd-accent:hover, .btn-kd-accent:focus-visible { background: var(--wz-teal-deep); border-color: var(--wz-ink); color: var(--wz-paper); }
.btn-kd-outline { background: var(--wz-paper); color: var(--wz-ink); }
.btn-kd-outline:hover, .btn-kd-outline:focus-visible { background: var(--wz-board-1); border-color: var(--wz-ink); color: var(--wz-ink); }
.btn-kd-danger { background: var(--wz-red); color: #fff; }
.btn-kd-danger:hover, .btn-kd-danger:focus-visible { background: #b93a2f; border-color: var(--wz-ink); color: #fff; }
.btn-kd-ghost { color: var(--wz-teal-deep); font-weight: 700; }
.btn-kd-ghost:hover, .btn-kd-ghost:focus-visible { background: var(--wz-board-1); color: var(--wz-ink); }

.form-control, .form-select {
  border: var(--wz-line) solid var(--kd-line-strong);
  border-radius: var(--kd-radius-sm);
  font-weight: 500;
}
.form-control:focus, .form-select:focus {
  border-color: var(--wz-teal);
  box-shadow: 0 0 0 3px rgba(20, 164, 158, .18);
}
.form-label { font-weight: 700; color: var(--kd-ink-2); }
.wz-date { max-width: 11rem; }
.wz-rank-col { width: 3.5rem; }

/* ------------------------------------------------- right to left ------- */
/*
 * admin.css was written for a left-hand sidebar with physical offsets, so the
 * few rules that pin things to a side are mirrored here rather than there —
 * the other panels that read it are still left to right.
 */
[dir="rtl"] .ad-sidebar {
  inset: 0 0 0 auto;
  border-right: 0;
  border-left: var(--wz-line) solid var(--wz-ink);
}
[dir="rtl"] .ad-main { margin-left: 0; margin-right: var(--ad-sidebar-w); }
[dir="rtl"] .ad-nav-link .ad-badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .wz-to-top { right: auto; left: 1rem; }

@media (max-width: 991.98px) {
  [dir="rtl"] .ad-sidebar { transform: translateX(100%); }
  [dir="rtl"] .ad-sidebar.is-open { transform: translateX(0); }
  [dir="rtl"] .ad-main { margin-right: 0; }
}

/*
 * Numbers, dates, ids and code read left to right inside an Arabic page — but
 * the same boxes also hold Arabic (a format example, "لا شيء مخطَّط"), and
 * forcing them left to right turned that back to front. `plaintext` takes the
 * direction from what is actually in the box, one box at a time.
 */
[dir="rtl"] .kd-mono,
[dir="rtl"] .ad-kpi-value,
[dir="rtl"] code { unicode-bidi: plaintext; }
[dir="rtl"] .wz-ltr { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .ad-kpi-value,
[dir="rtl"] .wz-ltr-start { text-align: right; }

/*
 * A number column in an Arabic table still reads from the right: `text-end`
 * means "the far side" in Bootstrap, and mirroring it left every count hugging
 * the left edge of its cell while the rest of the row read the other way.
 */
[dir="rtl"] .ad-table .text-end,
[dir="rtl"] .ad-table th.text-end,
[dir="rtl"] .ad-table td.text-end { text-align: right !important; }

/*
 * Bootstrap here is the left-to-right build, where `ms-*` and `me-*` are plain
 * `margin-left` / `margin-right` rather than logical properties. In an Arabic
 * page that puts every `ms-auto` on the wrong side, so the utilities the panel
 * actually uses are mirrored — the markup keeps saying "start" and "end" and
 * now means it.
 */
[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .me-auto { margin-right: 0 !important; margin-left: auto !important; }
[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .ps-2 { padding-left: 0 !important; padding-right: .5rem !important; }
[dir="rtl"] .pe-2 { padding-right: 0 !important; padding-left: .5rem !important; }
[dir="rtl"] .text-start { text-align: right !important; }
[dir="rtl"] .text-end { text-align: left !important; }
@media (min-width: 992px) {
  [dir="rtl"] .ms-lg-2 { margin-left: 0 !important; margin-right: .5rem !important; }
}

/* ---------------------------------------------------- no phantom scroll -- */
/*
 * The off-canvas sidebar parks itself at `translateX(100%)`. In a left-to-right
 * page that is off the left edge, which browsers ignore; in a right-to-left one
 * it is off the RIGHT edge, which is scrollable — so every page opened on a
 * phone started scrolled sideways, with the cards cut off at both sides.
 */
html[dir="rtl"] { overflow-x: hidden; }

/* -------------------------------------------------- controls, all of them -- */

/* Every button is a plate: a ghost with no edge looked broken beside its
   neighbours, and on a pale card it read as plain text. */
.btn-kd-ghost {
  border: var(--wz-line) solid var(--kd-line-strong);
  border-radius: var(--kd-radius-sm);
  background: var(--wz-paper);
  box-shadow: 0 2px 0 rgba(31, 45, 58, .12);
}
.btn-kd-ghost:hover, .btn-kd-ghost:focus-visible { background: var(--wz-board-1); border-color: var(--wz-ink); color: var(--wz-ink); }
.btn:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
  outline: 3px solid rgba(20, 164, 158, .35);
  outline-offset: 1px;
}

/* A select is drawn like the other plates, and its arrow follows the text. */
.form-select {
  background-image: linear-gradient(45deg, transparent 50%, var(--wz-ink) 50%),
                    linear-gradient(135deg, var(--wz-ink) 50%, transparent 50%);
  background-position: left 1.05rem top 55%, left .75rem top 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-left: 2.2rem;
  padding-right: .75rem;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(31, 45, 58, .12);
}
[dir="ltr"] .form-select,
.form-select[dir="ltr"] {
  background-position: right 1.05rem top 55%, right .75rem top 55%;
  padding-right: 2.2rem;
  padding-left: .75rem;
}
/* The open list is the browser's own window; these are the parts it does let a
   page colour. */
.form-select option { background: var(--wz-paper); color: var(--wz-ink); font-weight: 600; }
.form-select option:checked { background: var(--wz-board); }

.form-control, .form-select { box-shadow: 0 2px 0 rgba(31, 45, 58, .12); }
.form-control::placeholder { color: var(--kd-faint); font-weight: 500; }

/* Ticks and radios in the pack's ink, filled teal. */
.form-check-input {
  border: var(--wz-line) solid var(--wz-ink);
  width: 1.15em;
  height: 1.15em;
  margin-top: .1em;
}
.form-check-input:checked { background-color: var(--wz-teal); border-color: var(--wz-ink); }
.form-check-input:focus { border-color: var(--wz-ink); box-shadow: 0 0 0 3px rgba(20, 164, 158, .25); }
.form-range::-webkit-slider-thumb { background: var(--wz-teal); border: 2px solid var(--wz-ink); }
.form-range::-moz-range-thumb { background: var(--wz-teal); border: 2px solid var(--wz-ink); }

/* Bootstrap's own overlays, on the rare page that uses one. */
.dropdown-menu {
  border: var(--wz-line) solid var(--wz-ink);
  border-radius: var(--kd-radius-sm);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
  padding: .35rem;
}
.dropdown-item { border-radius: 10px; font-weight: 700; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--wz-board-1); color: var(--wz-ink); }
.dropdown-item.active, .dropdown-item:active { background: var(--wz-gold-light); color: var(--wz-ink); }
.modal-content {
  border: var(--wz-line) solid var(--wz-ink);
  border-radius: var(--kd-radius-lg);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
}
.modal-header, .modal-footer { border-color: var(--kd-line); }
.modal-backdrop.show { background: rgba(31, 45, 58, .45); opacity: 1; }

/* ------------------------------------------------------- the ask box ----- */
/*
 * `window.confirm` is a browser box with none of the panel around it, and in an
 * Arabic page it even asks in the browser's language. This is the same question
 * on one of the game's plates.
 */
.wz-dialog {
  border: 0;
  background: transparent;
  padding: 0;
  max-width: min(30rem, calc(100vw - 2rem));
}
.wz-dialog::backdrop { background: rgba(31, 45, 58, .45); }
.wz-dialog-card {
  background: var(--wz-paper);
  border: var(--wz-line) solid var(--wz-ink);
  border-radius: var(--kd-radius-lg);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
  padding: 1.35rem 1.35rem 1.1rem;
  display: grid;
  gap: 1.1rem;
}
.wz-dialog-text {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--wz-ink);
  line-height: 1.7;
}
.wz-dialog-actions { display: flex; gap: .6rem; justify-content: flex-end; }

/*
 * A search bar, not an editor's toolbar.
 *
 * admin.css's `.ad-toolbar` is built to sit on top of `.ad-editor`: it has no
 * bottom border and square bottom corners, and it strips the border and colour
 * off any button inside it. Used around the question search that read as a box
 * with its contents hanging out of the open bottom edge, and a search button
 * with no edge at all — so the search bar has its own plate instead.
 */
.wz-toolbar {
  padding: .6rem;
  border: var(--wz-line) solid var(--kd-line-strong);
  border-radius: var(--kd-radius);
  background: var(--wz-paper);
  box-shadow: 0 var(--wz-ledge) 0 rgba(31, 45, 58, .1);
}

/* The avatar catalogue: a wall of ids, the locked ones marked. */
.wz-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: .5rem;
}
.wz-avatar-cell {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .55rem;
  border: 1.5px solid var(--kd-line);
  border-radius: var(--kd-radius-sm);
  background: var(--wz-paper);
}
.wz-avatar-cell.is-locked { border-color: var(--wz-gold); background: #fffaf0; }
.wz-avatar-id { font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-avatar-worn { margin-inline-start: auto; font-weight: 800; font-size: .8rem; color: var(--wz-teal-deep); }

/* The game's own icons, where the panel has them. They carry their own colour
   and outline, so they are placed rather than tinted. */
.wz-i {
  display: inline-block;
  vertical-align: -0.22em;
  flex: none;
}
.ad-nav-link .wz-i { margin-inline-end: .1rem; }

/* The mark in an empty picture frame: a question with no picture. */
.wz-none-mark { font-size: .72rem; font-weight: 800; color: var(--kd-faint); }

/* ------------------------------------------------------- the logo ------- */
/*
 * The app's logo, in CSS: three game pieces that overlap and lean a little,
 * each with the pack's ink border and the ledge under it. Drawn rather than
 * shipped as a picture so it stays sharp at any size and needs no file.
 */
.wz-logo {
  display: inline-flex;
  align-items: center;
  direction: rtl;
  padding-bottom: 3px;
  flex: none;
}
.wz-logo-tile {
  width: var(--wz-tile);
  height: var(--wz-tile);
  display: grid;
  place-items: center;
  border: 2px solid var(--wz-ink);
  border-radius: calc(var(--wz-tile) * 0.26);
  box-shadow: 0 3px 0 var(--wz-ink);
  font-family: "Tajawal", sans-serif;
  font-weight: 900;
  font-size: calc(var(--wz-tile) * 0.56);
  line-height: 1;
  color: #fff;
  /* The letter is outlined in ink, as the app outlines it. */
  -webkit-text-stroke: calc(var(--wz-tile) * 0.03) var(--wz-ink);
  paint-order: stroke fill;
  text-shadow: 0 calc(var(--wz-tile) * 0.04) 0 rgba(31, 45, 58, .35);
  margin-inline-start: calc(var(--wz-tile) * -0.12);
}
.wz-logo-tile:first-child { margin-inline-start: 0; }
/* The shine the app draws across the top of a piece. */
.wz-logo-tile::before {
  content: "";
  position: absolute;
  width: 58%;
  height: 13%;
  border-radius: 99px;
  background: rgba(255, 255, 255, .34);
  transform: translateY(calc(var(--wz-tile) * -0.29));
}
.wz-logo-tile { position: relative; overflow: hidden; }
.wz-logo-a { background: linear-gradient(180deg, #2cc4bb, var(--wz-teal)); transform: rotate(-7deg); z-index: 3; }
.wz-logo-b { background: linear-gradient(180deg, #ffe79a, var(--wz-gold)); transform: rotate(5deg) translateY(-6%); z-index: 2; }
.wz-logo-c { background: linear-gradient(180deg, #6e69b8, var(--wz-indigo)); transform: rotate(-4deg) translateY(2%); z-index: 1; }

/* On the teal brand bar the tiles carry the bar, so the wordmark sits beside them. */
.ad-brand .wz-logo { margin-inline-end: .1rem; }

/* The brand bar holds the logo alone, so it is centred and given room. */
.wz-brand { justify-content: center; padding-block: 1.15rem 1.3rem; }
.wz-brand .wz-logo { margin-inline-end: 0; }

/* The tagline ribbon under the pieces, as the app draws it: the display face in
   white on an indigo plate, tucked a little under the pieces. */
.wz-logo-wrap {
  --wz-tile: 26px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex: none;
}
.wz-logo-tagline {
  position: relative;
  z-index: 4;
  margin-top: calc(var(--wz-tile) * -0.12);
  padding: calc(var(--wz-tile) * 0.08) calc(var(--wz-tile) * 0.34) calc(var(--wz-tile) * 0.12);
  border: 2px solid var(--wz-ink);
  border-radius: 99px;
  background: var(--wz-indigo);
  box-shadow: 0 3px 0 var(--wz-ink);
  font-family: "Lalezar", "Tajawal", sans-serif;
  font-size: calc(var(--wz-tile) * 0.34);
  line-height: 1.25;
  color: #fff;
  white-space: nowrap;
}

/* ----------------------------------------------------- scrollbars ------- */
/*
 * Two problems in one: macOS draws overlay scrollbars, which float *over* a
 * card and sit on its ink border, and the default grey belongs to no part of
 * this design. Styling them takes them out of the content and into the pack's
 * colours — a mint track and a teal thumb, rounded like everything else.
 */
* { scrollbar-width: thin; scrollbar-color: var(--wz-teal) var(--wz-board); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--wz-board); border-radius: 99px; }
::-webkit-scrollbar-thumb {
  background: var(--wz-teal);
  border: 3px solid var(--wz-board);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--wz-teal-deep); }
::-webkit-scrollbar-corner { background: transparent; }

/* The page keeps room for its scrollbar, so nothing shifts when it appears. */
html { scrollbar-gutter: stable; }

/* A card holds its contents inside its own border: a table header's fill used
   to paint over the rounded ink corner, and a scrolling table's bar sat on it.
   The ledge underneath is the card's own shadow, so it is not clipped. */
.ad-card { overflow: hidden; }

/* The scrolling parts inside a card get the thin bar, tucked away from the edge. */
.ad-table-wrap, .ad-nav, textarea.form-control { scrollbar-width: thin; }

/* ------------------------------------------------- the page heading ----- */
/*
 * The display face has tall ascenders, and the bar's fixed 60px cut the tops
 * off them — «الألغاز» arrived with its alef shaved. The bar grows with its
 * contents now, and the heading sits on the page's own icon, on a plate.
 */
.ad-topbar {
  height: auto;
  min-height: var(--ad-topbar-h);
  padding-block: .6rem .7rem;
  align-items: center;
}
.ad-page-title {
  line-height: 1.45;
  padding-top: .1rem;
}
.ad-page-sub { margin-top: 0; }

.wz-page-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: var(--wz-line) solid var(--wz-ink);
  border-radius: 14px;
  background: var(--wz-paper);
  box-shadow: 0 var(--wz-ledge) 0 var(--wz-ink);
  margin-bottom: 3px;
}
@media (max-width: 575.98px) {
  .wz-page-icon { display: none; }
}

/* ------------------------------------------------------ signing in ------ */
/*
 * The way into the panel looks like the game it administers: the mint ground
 * with its light falling from above, the logo and its ribbon, and one paper
 * plate holding the form.
 */
.wz-auth {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
  background:
    radial-gradient(120% 70% at 50% -10%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    var(--wz-board-1);
}
.wz-auth-card {
  width: min(24rem, 100%);
  background: var(--wz-paper);
  border: var(--wz-line) solid var(--wz-ink);
  border-radius: var(--kd-radius-lg);
  box-shadow: 0 5px 0 var(--wz-ink);
  padding: 1.6rem 1.5rem 1.7rem;
  text-align: center;
}
.wz-auth-logo { margin-bottom: 1rem; }
.wz-auth-lede {
  color: var(--kd-muted);
  font-size: .92rem;
  font-weight: 500;
  margin: 0 0 1.25rem;
}
/* "أو" on the line between the two ways in. */
.wz-auth-or {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.1rem 0;
  color: var(--kd-faint);
  font-size: .82rem;
  font-weight: 700;
}
.wz-auth-or::before,
.wz-auth-or::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--kd-line);
  border-radius: 99px;
}
.wz-auth-foot { font-size: .82rem; color: var(--kd-muted); margin: 0; }
.wz-auth-foot a { color: var(--wz-teal-deep); font-weight: 700; }

.wz-marathon { margin: 0; padding-inline-start: 1.2rem; display: grid; gap: .3rem; }
.wz-marathon li { line-height: 1.5; }

/* The word search's chooser: a box per category, two to a row on a wide panel. */
.wz-ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem; }
.wz-ws-pick {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: 0;
  padding: .45rem .6rem;
  border: var(--wz-line) solid var(--kd-line);
  border-radius: var(--kd-radius-sm);
  background: var(--kd-surface);
  cursor: pointer;
}
.wz-ws-pick:hover { border-color: var(--wz-teal-deep); }
.wz-ws-pick:has(input:checked) { background: var(--kd-accent-soft); border-color: var(--wz-indigo); }
.wz-ws-pick input { flex: none; margin: 0; }
.wz-ws-name { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; min-width: 0; }
.wz-ws-open { flex: none; margin-inline-start: auto; display: inline-flex; }

/* The sound library's players and their source lines. */
.wz-audio { display: block; width: min(260px, 100%); height: 32px; margin-top: .35rem; }
.wz-audio-src { max-width: 260px; }
.wz-audio-cat { width: 9rem; }
.wz-audio-note { width: 10rem; }

/* Auditioning a YouTube candidate in the panel, in YouTube's own player. */
.wz-yt-stage { margin-top: .75rem; font-size: .85rem; color: var(--kd-muted); }
.wz-yt-stage iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: var(--wz-line) solid var(--kd-line);
  border-radius: var(--kd-radius-sm);
}

/* Picking which difficulties a generated run is drawn from. */
.wz-grades { display: flex; gap: .35rem; }
.wz-grade {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  padding: .3rem .6rem;
  border: var(--wz-line) solid var(--kd-line);
  border-radius: var(--kd-radius-sm);
  background: var(--kd-surface);
  cursor: pointer;
  font-size: .85rem;
}
.wz-grade:has(input:checked) { background: var(--kd-accent-soft); border-color: var(--wz-indigo); }
.wz-grade input { margin: 0; }

/* Mixing grades inside one generated level: the amount sits inside its chip,
   so the row is one height whether a chip holds a tick box or a number. */
.wz-mix-count {
  width: 2.5rem;
  padding: .05rem .2rem;
  text-align: center;
  font: inherit;
  color: var(--kd-ink);
  background: var(--kd-surface);
  border: var(--wz-line) solid var(--kd-line);
  border-radius: 7px;
}
.wz-mix-count:focus { outline: 2px solid var(--wz-teal-deep); outline-offset: 1px; }

/* «كم لغزاً» and «أسئلة في اللغز» wear the chips' metrics, so the whole
   generator row is one height rather than two. */
.wz-generate-num {
  width: 5.5rem;
  height: 2.25rem;
  padding: .3rem .6rem;
  font-size: .85rem;
  color: var(--kd-ink);
  background: var(--kd-surface);
  border: var(--wz-line) solid var(--kd-line);
  border-radius: var(--kd-radius-sm);
}
.wz-generate-num:focus { outline: 2px solid var(--wz-teal-deep); outline-offset: 1px; }
[data-mix-fields].is-off { opacity: .45; }
