/* =========================================================================
   Jamaity — application layer

   Everything the static style guide did not need: form controls, filter
   panels, pagination, the single-record layout, the onboarding wizard and the
   role dashboards. Same tokens, same rules — no physical directions, chrome
   on the raw type scale, logical corners.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Skip link — first thing in the tab order, invisible until focused.
   ------------------------------------------------------------------------- */

.c-skip {
  position: absolute;
  inset-block-start: var(--sp-2);
  inset-inline-start: var(--sp-2);
  z-index: var(--z-toast);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-pill);
  background: var(--surface-brand);
  color: var(--text-on-brand);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.c-skip:focus { transform: none; color: var(--text-on-brand); }

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

.c-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding-inline: var(--sp-4);
  padding-block: var(--sp-2);
  border: var(--stroke) solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs-raw);
  font-weight: var(--fw-semibold);
  color: var(--text-link);
  cursor: pointer;
}
.c-select:hover { background: var(--surface-brand-soft); }
.c-select select {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding-inline-end: var(--sp-1);
}
.c-select select:focus-visible { outline: none; }
.c-select:focus-within { box-shadow: var(--focus-ring); }

.c-input {
  inline-size: 100%;
  padding: var(--sp-3) var(--sp-5);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text);
}
.c-input::placeholder { color: var(--text-subtle); }
.c-input:focus-visible {
  outline: none;
  border-color: var(--border-brand);
  box-shadow: 0 0 0 3px var(--surface-brand-soft);
}
textarea.c-input, select.c-input { border-radius: var(--radius-lg); }
textarea.c-input { min-block-size: 130px; resize: vertical; }

.c-label {
  display: block;
  font-size: var(--fs-xs-raw);
  font-weight: var(--fw-semibold);
  color: var(--ink-700);
  margin-block-end: var(--sp-2);
}
:root[data-theme="dark"] .c-label { color: var(--text-muted); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-label { color: var(--text-muted); }
}

.c-hint { font-size: var(--fs-xs-raw); color: var(--text-muted); margin-block-start: var(--sp-2); }

/* Form-level message — a refused sign-in, a rejected sign-up.
   Built on the amber pair rather than a new red one: --warn and --warn-bg are
   already contrast-checked in both themes, and a form that came back with a
   correction to make is a warning, not a failure of the system. */
.c-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  line-height: var(--lh-snug, 1.4);
}
.c-note .icon { flex: none; margin-block-start: 0.1em; }
.c-note--error { background: var(--warn-bg); color: var(--warn); }

.c-formgrid { display: grid; gap: var(--sp-5); }
@media (min-width: 640px) { .c-formgrid--2 { grid-template-columns: 1fr 1fr; } }
.c-formgrid .c-field--wide { grid-column: 1 / -1; }

/* Filter chip — a checkbox that looks like a tag. */
.c-chip { display: inline-flex; cursor: pointer; }
.c-chip input { position: absolute; opacity: 0; inline-size: 0; block-size: 0; }
.c-chip span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding-block: calc(var(--sp-1) - 1px);
  padding-inline: var(--sp-3);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs-raw);
  color: var(--text-muted);
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.c-chip:hover span { border-color: var(--border-strong); color: var(--text); }
.c-chip input:checked + span {
  background: var(--surface-brand);
  border-color: transparent;
  color: var(--text-on-brand);
}
.c-chip input:focus-visible + span { box-shadow: var(--focus-ring); }

/* -------------------------------------------------------------------------
   Filter panel
   ------------------------------------------------------------------------- */

.c-filters {
  display: grid;
  gap: var(--sp-6);
  padding: var(--sp-6);
  margin-block-start: var(--sp-4);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-sunken);
}
.c-filters[hidden] { display: none; }
.c-filters__group { border: 0; padding: 0; margin: 0; }
.c-filters__legend {
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-block-end: var(--sp-3);
  padding: 0;
}
[lang="ar"] .c-filters__legend, [dir="rtl"] .c-filters__legend { text-transform: none; letter-spacing: 0; }
.c-filters__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding-block-start: var(--sp-4);
  border-block-start: var(--stroke) solid var(--border);
}

/* -------------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------------- */

.c-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-block-start: var(--sp-12);
  padding-block-start: var(--sp-6);
  border-block-start: var(--stroke) solid var(--border);
}
.c-pager__pages { display: flex; align-items: center; gap: var(--sp-1); }
.c-pager__page {
  display: grid;
  place-items: center;
  min-inline-size: 38px;
  block-size: 38px;
  padding-inline: var(--sp-2);
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-decoration: none;
}
.c-pager__page:hover { background: var(--surface-sunken); color: var(--text); }
.c-pager__page.is-current { background: var(--surface-brand); color: var(--text-on-brand); }
.c-pager__gap { color: var(--text-subtle); padding-inline: var(--sp-1); }
.c-btn.is-disabled { opacity: .45; pointer-events: none; }
[dir="rtl"] .c-pager__prev, [dir="rtl"] .c-pager__next { scale: -1 1; }
@media (max-width: 560px) {
  .c-pager { flex-wrap: wrap; justify-content: center; }
  .c-pager__pages { order: -1; inline-size: 100%; justify-content: center; }
}

/* -------------------------------------------------------------------------
   Single record

   Hero band and content are ONE section with ONE background. The previous
   build had them as two and the seam was visible; this keeps them merged by
   construction.
   ------------------------------------------------------------------------- */

.c-single__band {
  position: relative;
  overflow: hidden;
  background: var(--surface-brand);
  color: var(--text-on-brand);
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}
.c-single__band > * { position: relative; z-index: 1; }
.c-single__band :is(h1, h2, h3) { color: inherit; }
.c-single__band .u-eyebrow { color: var(--text-on-brand-muted); }
.c-single__band .c-tag { border-color: var(--border-on-brand); color: var(--text-on-brand-muted); }

.c-single__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs-raw);
  color: var(--text-on-brand-muted);
  margin-block-end: var(--sp-5);
}
.c-single__crumbs a { color: inherit; text-decoration: none; }
.c-single__crumbs a:hover { color: var(--text-on-brand); }
.c-single__crumbs span { opacity: .55; }

.c-single__title { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.1; max-inline-size: 22ch; }

.c-single__strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5) var(--sp-10);
  margin-block-start: var(--sp-8);
  padding-block-start: var(--sp-6);
  border-block-start: var(--stroke) solid var(--border-on-brand);
}
.c-single__fact { display: flex; flex-direction: column; gap: 2px; }
.c-single__fact dt { font-size: var(--fs-2xs-raw); color: var(--text-on-brand-muted); letter-spacing: var(--tracking-wide); }
.c-single__fact dd { margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }

.c-single__layout { display: grid; gap: var(--sp-10); padding-block: var(--section-y); }
@media (min-width: 960px) { .c-single__layout { grid-template-columns: minmax(0, 1fr) 330px; gap: var(--sp-16); } }

.c-prose { max-inline-size: var(--measure); }
.c-prose > * + * { margin-block-start: var(--sp-5); }
.c-prose h2 { font-size: var(--fs-xl); margin-block-start: var(--sp-10); }
.c-prose h3 { font-size: var(--fs-lg); margin-block-start: var(--sp-8); }
.c-prose ul { display: flex; flex-direction: column; gap: var(--sp-3); }
.c-prose li { display: flex; gap: var(--sp-3); }
.c-prose li::before {
  content: "";
  flex: none;
  inline-size: 6px; block-size: 6px;
  border-radius: var(--radius-pill);
  background: var(--shape-accent);
  margin-block-start: 0.62em;
}

.c-aside { display: flex; flex-direction: column; gap: var(--sp-5); }
.c-panel {
  padding: var(--sp-6);
  border: var(--stroke) solid var(--border);
  background: var(--surface-raised);
  border-start-start-radius: var(--radius-xl);
  border-start-end-radius: var(--radius-xl);
  border-end-end-radius: var(--radius-xl);
  border-end-start-radius: var(--radius-sm);
}
.c-panel__title {
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-block-end: var(--sp-4);
}
[lang="ar"] .c-panel__title, [dir="rtl"] .c-panel__title { text-transform: none; letter-spacing: 0; }

/* Definition rows inside a panel: the theme already draws a bottom border on
   each row, so never add a top one — that was a real double-rule bug. */
.c-facts { display: flex; flex-direction: column; }
.c-facts__row {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding-block: var(--sp-3);
  border-block-end: var(--stroke) solid var(--border);
  font-size: var(--fs-sm);
}
.c-facts__row:last-child { border-block-end: 0; padding-block-end: 0; }
.c-facts__row dt { color: var(--text-muted); flex: none; }
.c-facts__row dd { margin: 0; font-weight: var(--fw-semibold); text-align: end; }

/* -------------------------------------------------------------------------
   Wizard
   ------------------------------------------------------------------------- */

.c-wizard { display: grid; gap: var(--sp-10); padding-block: var(--section-y); }
@media (min-width: 900px) { .c-wizard { grid-template-columns: 260px minmax(0, 1fr); gap: var(--sp-16); } }

.c-steps { display: flex; flex-direction: column; gap: 0; }
@media (min-width: 900px) { .c-steps { position: sticky; inset-block-start: var(--sp-8); align-self: start; } }

.c-step { display: flex; gap: var(--sp-4); padding-block: var(--sp-3); position: relative; }
.c-step__dot {
  flex: none;
  inline-size: 26px; block-size: 26px;
  display: grid; place-items: center;
  border-radius: var(--radius-pill);
  border: var(--stroke-bold) solid var(--border-strong);
  background: var(--surface);
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  z-index: 1;
}
/* The connector stops short of both dots — the open-gap rule at 1px scale. */
.c-step:not(:last-child)::before {
  content: "";
  position: absolute;
  inset-block: calc(var(--sp-3) + 30px) calc(var(--sp-3) - 4px);
  inset-inline-start: 12.5px;
  inline-size: var(--stroke);
  background: var(--border);
}
.c-step__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); }
.c-step__sub { font-size: var(--fs-xs-raw); color: var(--text-subtle); }
.c-step.is-done .c-step__dot { background: var(--surface-accent); border-color: transparent; color: var(--text-on-accent); }
.c-step.is-current .c-step__dot { background: var(--surface-brand); border-color: transparent; color: var(--text-on-brand); }
.c-step.is-current .c-step__label { color: var(--text); }

.c-wizard__panel {
  padding: clamp(var(--sp-6), 4vw, var(--sp-10));
  border: var(--stroke) solid var(--border);
  background: var(--surface-raised);
  border-radius: var(--radius-2xl);
}
.c-wizard__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-block-start: var(--sp-8);
  padding-block-start: var(--sp-6);
  border-block-start: var(--stroke) solid var(--border);
}

/* Role picker */
.c-roles { display: grid; gap: var(--sp-3); }
@media (min-width: 620px) { .c-roles { grid-template-columns: 1fr 1fr; } }
.c-role {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: var(--stroke-bold) solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.c-role:hover { border-color: var(--border-strong); }
.c-role input { position: absolute; opacity: 0; }
.c-role:has(input:checked) { border-color: var(--border-brand); background: var(--surface-brand-soft); }
.c-role:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.c-role__name { font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.c-role__desc { font-size: var(--fs-xs-raw); color: var(--text-muted); }

/* -------------------------------------------------------------------------
   Imported record bodies — the source's typography, overruled

   Catalogue bodies are harvested HTML written in a dozen different editors
   over ten years. They arrive carrying `style="color:#003366"`, Word's
   `font-family: Calibri`, `text-align: justify`, hard-coded pixel sizes and
   the odd <font> tag. Rendered as-is, two listings side by side look like two
   different websites, and the navy inline colour is invisible on the dark
   theme.

   So the record supplies the WORDS and the theme supplies the typography.
   `!important` is not laziness here: an inline style attribute beats any
   selector, and this is precisely the case the keyword exists for.

   Scoped to .c-prose--record so that written pages — where the block editor's
   colours and alignment are the owner's deliberate choice — are untouched.
   ------------------------------------------------------------------------- */

.c-prose--record :is(p, span, div, li, td, th, h1, h2, h3, h4, h5, h6, font, a, strong, em, b, i, u) {
  /* Inherit, not a fixed colour: that resolves to near-black on the light
     theme and near-white on the dark one, which is what was asked for. */
  color: inherit !important;
  background-color: transparent !important;
  font-family: inherit !important;
  /* Sizes come from the prose scale. A 8pt Word paragraph and a 24px heading
     pasted into the same body are the main reason these read as broken. */
  font-size: inherit !important;
  line-height: inherit !important;
}

/* Alignment follows the reading direction, always. `start` rather than left,
   so an Arabic record reads right-aligned from the same declaration.
   Justified text — which most of the harvest uses — produces rivers of white
   space at these measures and is worse again in Arabic. */
.c-prose--record :is(p, li, div, td, th, h1, h2, h3, h4, h5, h6) {
  text-align: start !important;
}

/* Links keep their own colour: stripping that too would leave them
   indistinguishable from the text around them. */
.c-prose--record a { color: var(--text-link, var(--brand-600)) !important; }

/* Headings get a restrained scale of their own, not `revert`.
   `revert` handed them back the prose styles, which are built for a hand-
   written page — and the harvest uses <h1> as "make this bigger", so a label
   line like "Type de contrat :" rendered at 34px, twice the body and larger
   than the record's own title. jam_demote_headings() pushes the levels down;
   these sizes keep even the top one modest, because nothing inside an imported
   body outranks the page. */
.c-prose--record :is(h1, h2, h3) {
  font-size: var(--fs-lg) !important;
  line-height: var(--lh-snug, 1.3) !important;
  margin-block: var(--sp-8) var(--sp-3);
}
.c-prose--record :is(h4, h5, h6) {
  font-size: var(--fs-base) !important;
  line-height: var(--lh-snug, 1.3) !important;
  margin-block: var(--sp-6) var(--sp-2);
}
.c-prose--record :is(h1, h2, h3, h4, h5, h6) { font-weight: var(--fw-bold); }

/* Emphasis survives, since that is usually what the heading was standing in
   for. Everything else about it is now the theme's. */
.c-prose--record :is(b, strong) { font-weight: var(--fw-semibold); }

/* The harvest is full of empty paragraphs and list items used as spacing. */
.c-prose--record :is(p, li, div):empty { display: none; }

/* Imported markup routinely nests a bare <img> at its source pixel width. */
.c-prose--record img {
  max-inline-size: 100%;
  block-size: auto;
  border-radius: var(--radius-lg);
}

.c-prose--record table { inline-size: 100%; border-collapse: collapse; }
.c-prose--record :is(td, th) {
  border: var(--stroke) solid var(--border);
  padding: var(--sp-2) var(--sp-3);
}

/* -------------------------------------------------------------------------
   Application form — closed until asked for

   <details>, so the disclosure works with no JavaScript, is keyboard-operable
   and is announced as expandable without a single aria attribute. The summary
   is styled as a panel with a button in it; the button is a <span> because a
   real one inside a <summary> is two nested controls and screen readers
   disagree about what gets announced.
   ------------------------------------------------------------------------- */

.c-apply {
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface-raised);
  overflow: clip;
}

.c-apply__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: clamp(var(--sp-5), 3vw, var(--sp-8));
  cursor: pointer;
  list-style: none;
  transition: background var(--dur-fast) var(--ease-out);
}
.c-apply__summary::-webkit-details-marker { display: none; }
.c-apply__summary:hover { background: var(--surface-sunken, var(--surface)); }
.c-apply__summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.c-apply__lead { display: grid; gap: var(--sp-2); }
.c-apply__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); }

.c-apply__deadline {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-muted);
}
/* A week out, the deadline stops being a fact and becomes the reason to act. */
.c-apply__deadline.is-soon { color: var(--warn); font-weight: var(--fw-semibold); }

/* The chevron turns instead of the label changing: the label is the action,
   and "Déposer ma candidature" is still what the control does once open. */
.c-apply__cta .icon { transition: rotate var(--dur-base) var(--ease-out); }
.c-apply[open] .c-apply__cta .icon { rotate: 180deg; }

/* The bot trap.
   NOT `left: -9999px`. Under RTL the document's overflow runs the other way,
   so a far-left element extends the scrollable area instead of leaving it —
   measured at 9999px of horizontal scroll on every Arabic opportunity page.
   Clipping to a 1px box is direction-agnostic and still leaves a real,
   focusable, fillable input for a script to take the bait on. */
.c-honeypot {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The publisher's note. Marked as quoted rather than styled as another
   paragraph, because it is someone else speaking inside our form. */
.c-apply__intro {
  border-inline-start: var(--stroke-bold) solid var(--border-brand, var(--border-strong));
  padding-inline-start: var(--sp-4);
  margin-block-end: var(--sp-8);
}
.c-apply__intro p { margin-block: var(--sp-2) 0; font-size: var(--fs-sm); }
.c-apply__intro p:last-child { margin-block-end: 0; }

.c-apply__body {
  padding: 0 clamp(var(--sp-5), 3vw, var(--sp-8)) clamp(var(--sp-6), 3vw, var(--sp-8));
  border-block-start: var(--stroke) solid var(--border);
  padding-block-start: var(--sp-8);
}

@media (prefers-reduced-motion: reduce) {
  .c-apply__cta .icon { transition: none; }
}

/* -------------------------------------------------------------------------
   Claim an existing directory entry, at sign-up
   ------------------------------------------------------------------------- */

.c-claim { position: relative; }

.c-claim__results {
  position: absolute;
  inset-inline: 0;
  z-index: 20;
  margin: var(--sp-1) 0 0;
  padding: var(--sp-1);
  list-style: none;
  max-block-size: 16rem;
  overflow-y: auto;
  border: var(--stroke) solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg, 0 12px 32px hsl(225 40% 10% / .16));
}

.c-claim__result button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  inline-size: 100%;
  padding: var(--sp-2) var(--sp-3);
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: inherit;
  text-align: start;
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
.c-claim__result button:hover,
.c-claim__result button:focus-visible { background: var(--surface-sunken, var(--surface)); }

/* A record somebody already owns stays listed rather than being filtered out:
   seeing it and being told it is taken answers the question, where a silently
   missing row just looks like the search is broken. */
.c-claim__result.is-taken button { opacity: .5; cursor: not-allowed; }

.c-claim__city { font-size: var(--fs-2xs-raw); color: var(--text-muted); }

.c-claim__picked {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-block: var(--sp-2) 0;
  padding: var(--sp-3);
  border-radius: var(--radius-lg);
  background: var(--ok-bg);
  color: var(--ok);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.c-claim__picked .c-btn { margin-inline-start: auto; color: inherit; }

/* -------------------------------------------------------------------------
   Dashboard: records, applications, alerts, claims, and the editor
   ------------------------------------------------------------------------- */

.c-dashsection { margin-block-start: var(--sp-12); }
.c-dashsection__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-block-end: var(--sp-5);
}
.c-dashsection__title { font-size: var(--fs-lg); margin: 0; }

.c-tag--warn { background: var(--warn-bg); color: var(--warn); }
.c-chip__n { opacity: .6; font-size: var(--fs-2xs-raw); }

/* An application is a letter, so it opens rather than sitting expanded:
   forty of them expanded is a page nobody scrolls. */
.c-appcard {
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-lg);
  margin-block-end: var(--sp-3);
  background: var(--surface-raised);
}
.c-appcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4);
  cursor: pointer;
  list-style: none;
}
.c-appcard__head::-webkit-details-marker { display: none; }
.c-appcard__body {
  padding: 0 var(--sp-4) var(--sp-4);
  border-block-start: var(--stroke) solid var(--border);
  padding-block-start: var(--sp-4);
}

/* --- the editor ---------------------------------------------------------- */

.c-editor {
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-2xl);
  background: var(--surface-raised);
  padding: clamp(var(--sp-5), 3vw, var(--sp-8));
}
.c-editor__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-block-end: var(--sp-6);
}

.c-editor__tabs { display: flex; gap: var(--sp-2); margin-block-end: var(--sp-5); flex-wrap: wrap; }
.c-editor__tab {
  padding: var(--sp-2) var(--sp-4);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.c-editor__tab[aria-selected="true"] {
  background: var(--surface-brand);
  border-color: transparent;
  color: var(--text-on-brand);
}
/* The count of what is missing in THAT language, so the tab itself says
   where to go rather than making someone open all three. */
.c-editor__gap {
  display: inline-grid;
  place-items: center;
  inline-size: 1.25em;
  block-size: 1.25em;
  margin-inline-start: var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--warn);
  color: #fff;
  font-size: var(--fs-2xs-raw);
}

.c-editor__pane[hidden] { display: none; }
.c-editor__field { margin-block-end: var(--sp-5); }

.c-editor__meta {
  border: 0;
  border-block-start: var(--stroke) solid var(--border);
  margin: var(--sp-8) 0 0;
  padding: var(--sp-6) 0 0;
}

.c-editor__q {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border: var(--stroke) solid var(--border);
  border-radius: var(--radius-lg);
  margin-block-end: var(--sp-3);
}

.c-editor__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin-block-start: var(--sp-8);
  padding-block-start: var(--sp-6);
  border-block-start: var(--stroke) solid var(--border);
}

.c-editor__danger { margin-block-start: var(--sp-6); text-align: center; }
.c-editor__danger .c-btn { color: var(--warn); }

/* -------------------------------------------------------------------------
   Written pages — legal, accessibility, FAQ
   ------------------------------------------------------------------------- */

/* Its own row under the four columns. These are obligations, not navigation;
   as a fifth column the privacy policy would sit among the archives. */
.c-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-5);
  margin-block-start: var(--sp-10);
  padding-block-start: var(--sp-5);
  border-block-start: var(--stroke) solid var(--border);
  font-size: var(--fs-xs-raw);
}
.c-footer__legal a { color: var(--text-muted); text-decoration: none; }
.c-footer__legal a:hover { color: var(--text); text-decoration: underline; }

.c-toc { position: sticky; inset-block-start: var(--sp-8); }
.c-toc__list {
  margin: 0;
  padding-inline-start: var(--sp-5);
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}
.c-toc__list a { color: var(--text-muted); text-decoration: none; }
.c-toc__list a:hover { color: var(--text); text-decoration: underline; }

/* A measure, and room to breathe between sections. A privacy policy is read
   end to end by someone looking for one clause; the headings have to be
   findable while scrolling past at speed. */
.c-prose--legal { max-inline-size: 68ch; }
.c-prose--legal h2 { margin-block-start: var(--sp-12); scroll-margin-block-start: var(--sp-8); }
.c-prose--legal h3 { margin-block-start: var(--sp-8); }
.c-prose--legal ul { margin-block: var(--sp-4); }
.c-prose--legal li { margin-block-end: var(--sp-2); }

/* -------------------------------------------------------------------------
   Auth layout — /connexion/ and /inscription/

   A split screen: the catalogue on one side, the form on the other. These are
   the only two pages on the site with no header and no footer, which is the
   whole idea — a visitor here has already decided where they are going, and a
   six-link nav above the password field is six chances to leave.

   The panel is not decoration. It shows real projects and events from the
   catalogue, so the question a sign-up form always raises — what is behind
   this? — is answered while someone types rather than after they commit.

   Below 960px the panel is dropped rather than stacked. Stacked, it becomes a
   full-width image a visitor has to scroll past to reach the field they came
   for, on the devices least able to afford the download.
   ------------------------------------------------------------------------- */

.c-auth {
  display: grid;
  min-block-size: 100dvh;
  background: var(--surface-sunken, var(--surface));
}
@media (min-width: 960px) {
  .c-auth {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    /* start, not the default stretch: the panel has to be allowed to be
       SHORTER than the row for sticky to have anywhere to stick. Stretched to
       a 1600px sign-up row it would simply scroll away with the form. */
    align-items: start;
  }
}

/* --- the panel ----------------------------------------------------------- */

.c-auth__aside {
  display: none;
  position: relative;
  overflow: clip;
  margin: var(--sp-3);
  border-radius: var(--radius-2xl);
  background: var(--brand-700, var(--surface-brand));
  isolation: isolate;
}
@media (min-width: 960px) {
  .c-auth__aside {
    display: block;
    /* One screen, pinned, while the form beside it scrolls on its own. The
       sign-up wizard is taller than the viewport and the panel has no reason
       to travel with it: it is context, not content, and a photograph sliding
       up out of view while someone fills in step three is just motion.

       The offset repeats the margin rather than relying on it. Chrome pins the
       BORDER edge at the offset, not the margin edge, so `inset: 0` measured
       the panel flush to the top of the window with a double gap underneath. */
    position: sticky;
    inset-block-start: var(--sp-3);
    block-size: calc(100dvh - var(--sp-3) * 2);
  }
}

.c-auth__slides { position: absolute; inset: 0; }

.c-auth__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  /* Slow, because it runs behind someone reading and typing: a quick cut in
     the corner of the eye pulls attention off the field. */
  transition: opacity 1.4s var(--ease-out);
}
.c-auth__slide.is-on { opacity: 1; }

.c-auth__slide img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  /* A photograph has no contrast contract with the text over it, so the scrim
     below does the work and the image is held back to meet it. */
  filter: saturate(0.85) brightness(0.72);
}

/* The scrim is on the PANEL, not on each slide: one gradient that the slides
   cross-fade underneath, rather than four that fade with them and let the
   text lose its background mid-transition. */
.c-auth__aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsl(225 45% 8% / .92) 0%, hsl(225 45% 8% / .5) 45%, hsl(225 45% 8% / .62) 100%);
  pointer-events: none;
}

/* The caption sits at the TOP and the pitch at the bottom — opposite ends,
   so neither needs to know how tall the other is. They were both anchored to
   the bottom with a 9rem reserve between them, which is the kind of number
   that holds until something wraps: at a 620px-tall window the claim ran to
   two lines and the record title landed underneath it. */
.c-auth__cap {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 2;
  padding: var(--sp-6);
  color: hsl(0 0% 100% / .72);
  display: grid;
  gap: var(--sp-1);
}
.c-auth__captitle {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: hsl(0 0% 100% / .9);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.c-auth__pitch {
  position: absolute;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 3;
  padding: var(--sp-8);
  color: #fff;
}
.c-auth__claim {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight, 1.15);
  margin: 0;
  text-wrap: balance;
}
.c-auth__sub {
  margin-block: var(--sp-3) 0;
  font-size: var(--fs-sm);
  color: hsl(0 0% 100% / .72);
  max-inline-size: 46ch;
}

.c-auth__dots { display: flex; gap: var(--sp-2); margin-block-start: var(--sp-6); }
.c-auth__dot {
  inline-size: 28px;
  block-size: 3px;
  border-radius: var(--radius-pill);
  background: hsl(0 0% 100% / .28);
  transition: background var(--dur-base) var(--ease-out);
}
.c-auth__dot.is-on { background: hsl(0 0% 100% / .9); }

/* --- the form side ------------------------------------------------------- */

.c-auth__panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--sp-6);
  /* Its own full screen at minimum, so the short sign-in page still fills the
     viewport now that the grid no longer stretches its columns. */
  min-block-size: 100dvh;
  padding: var(--sp-4) var(--sp-4) var(--sp-6);
  background: var(--surface);
}
@media (min-width: 960px) { .c-auth__panel { padding: var(--sp-5) var(--sp-8) var(--sp-8); } }

.c-auth__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }

/* align-self start, not centre: on the sign-up wizard the content is taller
   than the viewport, and centring it would push the first step off the top. */
.c-auth__body {
  inline-size: 100%;
  max-inline-size: 30rem;
  margin-inline: auto;
  align-self: center;
  padding-block: var(--sp-6);
}
.c-auth__body:has(.c-wizard) { max-inline-size: 38rem; align-self: start; }

.c-auth__brand { display: inline-flex; flex: none; }
.c-auth__brand img { block-size: 30px; inline-size: auto; }

.c-auth__back {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-block-end: var(--sp-6);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  text-decoration: none;
}
.c-auth__back:hover { color: var(--text); }

.c-auth__legal { margin: 0; font-size: var(--fs-2xs-raw); color: var(--text-subtle); text-align: center; }

/* --- the wizard, inside the panel ---------------------------------------- */

/* The 260px step rail does not fit half a screen, and the panel it sat in was
   a card inside a card. Here the rail is a row of connected dots above a
   borderless panel: the same four states, none of the furniture. */
.c-auth .c-wizard { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); padding-block: 0; }
.c-auth .c-steps { flex-direction: row; position: static; gap: var(--sp-2); }
.c-auth .c-step { flex: 1; padding-block: 0; align-items: center; }
.c-auth .c-step > span:last-child { display: none; }
.c-auth .c-step:not(:last-child)::before {
  inset-block: 11px auto;
  inset-inline: 34px 0;
  inline-size: auto;
  block-size: var(--stroke);
}
.c-auth .c-wizard__panel { padding: 0; border: 0; background: none; border-radius: 0; }

@media (prefers-reduced-motion: reduce) {
  .c-auth__slide { transition: none; }
}

/* -------------------------------------------------------------------------
   Dashboard
   ------------------------------------------------------------------------- */

.c-dash { display: grid; gap: var(--sp-8); padding-block: var(--sp-10) var(--section-y); }
@media (min-width: 900px) { .c-dash { grid-template-columns: 250px minmax(0, 1fr); gap: var(--sp-12); } }

.c-dashnav { display: flex; flex-direction: column; gap: var(--sp-1); }
@media (min-width: 900px) { .c-dashnav { position: sticky; inset-block-start: var(--sp-8); align-self: start; } }
@media (max-width: 899px) {
  .c-dashnav { flex-direction: row; overflow-x: auto; gap: var(--sp-2); padding-block-end: var(--sp-2); }
}

.c-dashnav__link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.c-dashnav__link:hover { background: var(--surface-sunken); color: var(--text); }
.c-dashnav__link.is-current { background: var(--surface-brand); color: var(--text-on-brand); }
.c-dashnav__count { margin-inline-start: auto; font-size: var(--fs-2xs-raw); opacity: .8; }

.c-dashhead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-block-end: var(--sp-8);
}

/* Table — rows, not a spreadsheet. */
.c-table { inline-size: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.c-table th {
  text-align: start;
  font-size: var(--fs-2xs-raw);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  padding-block: var(--sp-3);
  border-block-end: var(--stroke) solid var(--border);
  white-space: nowrap;
}
[lang="ar"] .c-table th, [dir="rtl"] .c-table th { text-transform: none; letter-spacing: 0; }
.c-table td { padding-block: var(--sp-4); border-block-end: var(--stroke) solid var(--border); vertical-align: middle; }
.c-table tbody tr:hover { background: var(--surface-sunken); }
.c-table__title { font-weight: var(--fw-semibold); }
.c-table__title a { color: inherit; text-decoration: none; }
.c-table__title a:hover { color: var(--text-link); }
.c-table__meta { font-size: var(--fs-xs-raw); color: var(--text-muted); }
.c-table__end { text-align: end; white-space: nowrap; }

/* Below 760px the table stops being a table and becomes stacked rows. */
@media (max-width: 760px) {
  .c-table, .c-table tbody, .c-table tr, .c-table td { display: block; inline-size: 100%; }
  .c-table thead { display: none; }
  .c-table tr { padding-block: var(--sp-4); border-block-end: var(--stroke) solid var(--border); }
  .c-table td { border: 0; padding-block: var(--sp-1); }
  .c-table__end { text-align: start; }
}

.c-empty {
  display: grid;
  place-items: center;
  gap: var(--sp-4);
  padding: var(--sp-16) var(--sp-6);
  text-align: center;
  border: var(--stroke) dashed var(--border-strong);
  border-radius: var(--radius-xl);
}
.c-empty__title { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.c-empty p { color: var(--text-muted); font-size: var(--fs-sm); max-inline-size: 42ch; }
