/* =============================================================================
   AGB REDESIGN — body.agb-page
   Date: 2026-05-07 · Clean rewrite per admin_redesign_playbook.md
   (customer-page adaptation). Replaces all earlier strip / doc-toc artifacts
   end-to-end. Mirrors the impressum/datenschutz family so the three legal
   pages share one rhythm.

   Paradigm: "Legal contract — eyebrow byline · giant H1 · sticky table-of-
              contents rail · hairline-numbered articles + subsections ·
              provider ledger · reading-progress + back-to-top."
              No card-on-card. Hairlines and air separate sections.

   Owns: page shell, top rail, hero, TOC, article sections + subsections,
         provider ledger, reading-progress, back-to-top, footer, language-
         menu restyle, cookie-info-banner restyle, RTL + Cairo, reduced
         motion.

   Reused from legal-core.css (shared with kontakt/impressum/datenschutz):
     * { box-sizing: border-box }, body padding+gradient, @font-face Cairo,
     anchor base color. Everything else is owned here under the
     body.agb-page scope.
   ============================================================================= */

/* §1 — Scoped tokens (light only — page meta sets color-scheme: light) */
body.agb-page {
  --agb-content-max: min(1180px, 100%);
  --agb-stack-gap: clamp(28px, 4vw, 44px);
  --agb-section-gap: clamp(20px, 2.6vw, 32px);
  --agb-prose-max: 70ch;

  --agb-ink: #0f172a;
  --agb-ink-strong: #050b16;
  --agb-ink-muted: #5a6473;
  --agb-ink-subtle: #8a94a3;
  --agb-hairline: rgba(15, 23, 42, 0.10);
  --agb-hairline-strong: rgba(15, 23, 42, 0.18);

  --agb-accent: #1a73e8;
  --agb-accent-strong: #0f5bcc;
  --agb-accent-soft: rgba(26, 115, 232, 0.10);
  --agb-accent-soft-hover: rgba(26, 115, 232, 0.16);
  --agb-accent-on: #ffffff;

  --agb-radius-pill: 999px;
  --agb-radius-md: 12px;
  --agb-radius-sm: 8px;
  --agb-radius-lg: 18px;

  --agb-touch: 44px;
  --agb-touch-sm: 38px;

  --agb-cairo-stack: "Cairo", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --agb-system-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
}

/* §2 — Strip (additive, scoped). Earlier attempts used either
   `body.agb-page * { all: revert !important }` (nuking every svg/img) or
   a parallel `agb-doc__*` paradigm. Both are wiped. The new partial simply
   does NOT use any of the legacy classes (top-bar / card / section-stack /
   subsection / badge / agb-footer-links / page-actions / inline-link /
   agb-doc*), so we just override the body essentials (font + ink) here.
   The legacy class definitions still live in legal-core.css for siblings;
   they are harmless because the new markup does not apply them. */
body.agb-page {
  color: var(--agb-ink);
  font-family: var(--agb-system-stack);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* §3 — Page shell + skip link + top rail.
   Specificity bumped to (0,3,0) via `body.agb-page.page-shell` so we win
   over batch7-polish.css's `body.page-shell .page-width { max-width: 100% }`
   rule that would otherwise un-constrain the content frame. */
body.agb-page.page-shell .page-width,
body.agb-page .page-width {
  width: 100%;
  max-width: var(--agb-content-max);
  margin-inline: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--agb-stack-gap);
}

body.agb-page .skip-link {
  position: absolute;
  inset-inline-start: 12px;
  inset-block-start: 12px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--agb-ink-strong);
  color: #fff;
  border-radius: var(--agb-radius-md);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.16s ease;
}
body.agb-page .skip-link:focus {
  transform: translateY(0);
}

body.agb-page .agb-toprail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 6px;
  border-block-end: 1px solid var(--agb-hairline);
}
body.agb-page .agb-toprail__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--agb-touch);
  padding-inline: 6px;
  color: var(--agb-ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--agb-radius-md);
  transition: color 0.16s ease;
}
body.agb-page .agb-toprail__back:hover,
body.agb-page .agb-toprail__back:focus-visible {
  color: var(--agb-accent-strong);
  outline: none;
}
body.agb-page .agb-toprail__back-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* §4 — Hero block (eyebrow byline + giant H1 + lead + meta tags) */
body.agb-page .agb-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-block-end: 8px;
}
body.agb-page .agb-hero__eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--agb-ink-subtle);
}
body.agb-page .agb-hero__eyebrow-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--agb-ink-subtle);
}
body.agb-page .agb-hero__title {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.04;
  color: var(--agb-ink-strong);
  max-width: 22ch;
  word-break: break-word;
  overflow-wrap: anywhere;
}
body.agb-page .agb-hero__lead {
  margin: 0;
  color: var(--agb-ink-muted);
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.55;
  max-width: 60ch;
}
body.agb-page .agb-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--agb-ink-muted);
}
body.agb-page .agb-hero__meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
body.agb-page .agb-hero__meta li + li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--agb-ink-subtle);
  margin-inline-end: 4px;
}
body.agb-page .agb-hero__meta-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--agb-accent);
}

/* §5 — Article frame (mobile single-column; desktop adds sticky TOC rail) */
body.agb-page .agb-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--agb-stack-gap);
  align-items: start;
}

/* §6 — TOC. Mobile: horizontal chip rail with edge-fade mask.
        Desktop (≥1024): vertical list inside a sticky rounded panel. */
body.agb-page .agb-toc {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-block: 14px;
  border-block-start: 1px solid var(--agb-hairline);
  border-block-end: 1px solid var(--agb-hairline);
}
body.agb-page .agb-toc__label {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--agb-ink-subtle);
}
body.agb-page .agb-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 12px,
    #000 calc(100% - 24px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0,
    #000 12px,
    #000 calc(100% - 24px),
    transparent 100%
  );
}
body.agb-page .agb-toc__list::-webkit-scrollbar {
  display: none;
}
body.agb-page .agb-toc__item {
  scroll-snap-align: start;
  flex: 0 0 auto;
}
body.agb-page .agb-toc__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--agb-touch-sm);
  padding-inline: 12px;
  border-radius: var(--agb-radius-pill);
  border: 1px solid var(--agb-hairline);
  background: #ffffff;
  color: var(--agb-ink-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
body.agb-page .agb-toc__link:hover,
body.agb-page .agb-toc__link:focus-visible {
  color: var(--agb-accent-strong);
  border-color: var(--agb-accent);
  background: var(--agb-accent-soft);
  outline: none;
}
body.agb-page .agb-toc__link[aria-current="true"],
body.agb-page .agb-toc__link.is-active {
  color: var(--agb-accent-strong);
  border-color: var(--agb-accent);
  background: var(--agb-accent-soft-hover);
}
body.agb-page .agb-toc__num {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--agb-ink-subtle);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}
body.agb-page .agb-toc__link[aria-current="true"] .agb-toc__num,
body.agb-page .agb-toc__link.is-active .agb-toc__num {
  color: var(--agb-accent-strong);
}

/* §7 — Article: sections + subsections + lists + inline links */
body.agb-page .agb-article {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}
body.agb-page .agb-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-block: clamp(20px, 3vw, 32px);
  border-block-end: 1px solid var(--agb-hairline);
  scroll-margin-block-start: 64px;
}
body.agb-page .agb-section:first-child {
  padding-block-start: clamp(8px, 2vw, 16px);
}
body.agb-page .agb-section:last-child {
  border-block-end: 0;
}
body.agb-page .agb-section__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}
body.agb-page .agb-section__num {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--agb-ink-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
body.agb-page .agb-section__title {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--agb-ink-strong);
  line-height: 1.2;
  max-width: 32ch;
  flex: 1 1 auto;
  min-width: 0;
}
body.agb-page .agb-section__lede {
  margin: 0;
  color: var(--agb-ink);
  max-width: var(--agb-prose-max);
  font-size: 1rem;
}
body.agb-page .agb-section p {
  margin: 0;
  color: var(--agb-ink);
  max-width: var(--agb-prose-max);
}
body.agb-page .agb-section p + p {
  margin-block-start: 8px;
}
body.agb-page .agb-section a {
  color: var(--agb-accent-strong);
  text-decoration: none;
  border-block-end: 1px solid currentColor;
  padding-block-end: 1px;
  transition: color 0.16s ease;
}
body.agb-page .agb-section a:hover,
body.agb-page .agb-section a:focus-visible {
  color: var(--agb-ink-strong);
  outline: none;
}

body.agb-page .agb-subsection {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 12px;
  scroll-margin-block-start: 64px;
}
body.agb-page .agb-subsection + .agb-subsection {
  border-block-start: 1px dashed var(--agb-hairline);
}
body.agb-page .agb-subsection__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
body.agb-page .agb-subsection__num {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--agb-ink-subtle);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 2.6em;
}
body.agb-page .agb-subsection__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--agb-ink-strong);
  letter-spacing: -0.005em;
}
body.agb-page .agb-subsection p {
  color: var(--agb-ink-muted);
}
body.agb-page .agb-subsection a {
  color: var(--agb-accent-strong);
  text-decoration: none;
  border-block-end: 1px solid currentColor;
  padding-block-end: 1px;
  transition: color 0.16s ease;
}
body.agb-page .agb-subsection a:hover,
body.agb-page .agb-subsection a:focus-visible {
  color: var(--agb-ink-strong);
  outline: none;
}

/* §8 — Provider ledger (Anbieterinformationen) */
body.agb-page .agb-ledger {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
body.agb-page .agb-ledger__row {
  display: grid;
  grid-template-columns: minmax(140px, 32%) 1fr;
  gap: 12px 18px;
  align-items: baseline;
  padding-block: 12px;
  border-block-end: 1px solid var(--agb-hairline);
}
body.agb-page .agb-ledger__row:last-child {
  border-block-end: 0;
}
body.agb-page .agb-ledger__label {
  color: var(--agb-ink-muted);
  font-weight: 600;
  font-size: 0.92rem;
  margin: 0;
}
body.agb-page .agb-ledger__value {
  color: var(--agb-ink-strong);
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
body.agb-page .agb-ledger__value-secondary {
  display: block;
  margin-block-start: 2px;
  color: var(--agb-ink-muted);
  font-weight: 500;
  font-size: 0.92rem;
}
body.agb-page .agb-ledger__value a {
  color: var(--agb-accent-strong);
  text-decoration: none;
  border-block-end: 1px solid currentColor;
  padding-block-end: 1px;
}
body.agb-page .agb-ledger__value a:hover,
body.agb-page .agb-ledger__value a:focus-visible {
  color: var(--agb-ink-strong);
}

/* §9 — Reading-progress bar + back-to-top */
body.agb-page .agb-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 2px;
  z-index: 50;
  background: transparent;
  pointer-events: none;
}
body.agb-page .agb-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, var(--agb-accent), var(--agb-accent-strong));
  transition: width 0.12s linear;
  transform-origin: 0 50%;
}

body.agb-page .agb-toplink {
  position: fixed;
  inset-block-end: 18px;
  inset-inline-end: 18px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--agb-hairline-strong);
  background: rgba(255, 255, 255, 0.94);
  color: var(--agb-ink-strong);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
body.agb-page .agb-toplink[data-visible="true"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
body.agb-page .agb-toplink:hover,
body.agb-page .agb-toplink:focus-visible {
  border-color: var(--agb-accent);
  color: var(--agb-accent-strong);
  outline: none;
}
body.agb-page .agb-toplink__icon {
  width: 18px;
  height: 18px;
}

/* §10 — Footer (matches impressum/datenschutz siblings — plain centred text
   links + small muted copyright. No pill chrome, no border, no background.) */
body.agb-page .agb-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-block: 14px 6px;
  margin-block-start: 8px;
}
body.agb-page .agb-footer__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 18px;
}
body.agb-page .agb-footer__link {
  color: var(--agb-ink-muted);
  font-weight: 400;
  font-size: 0.86rem;
  text-decoration: none;
  padding: 2px 0;
  background: transparent;
  border: 0;
  transition: color 0.16s ease;
}
body.agb-page .agb-footer__link:hover,
body.agb-page .agb-footer__link:focus-visible {
  color: var(--agb-ink-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  outline: none;
}
body.agb-page .agb-footer__link[aria-current="page"] {
  color: var(--agb-ink);
  font-weight: 500;
}
body.agb-page .agb-footer__note {
  margin: 0;
  text-align: center;
  color: var(--agb-ink-subtle);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  unicode-bidi: plaintext;
}
body.agb-page .agb-footer__note strong {
  color: var(--agb-ink-muted);
  font-weight: 500;
}

/* Platform attribution ("Ein Service von gastrozukunft.de") is appended to
   the body by restaurant-profile.js. Match the page content cap so the row
   aligns with the footer above it. */
body.agb-page .gz-platform-attribution {
  max-width: var(--agb-content-max);
  margin-inline: auto;
}

/* §11 — Language menu restyle (overrides legal-core defaults inside the
   agb-page scope so the slim toprail aesthetic is consistent with siblings). */
body.agb-page .rt-lang-menu {
  position: relative;
  z-index: 40;
}
body.agb-page .rt-lang-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--agb-touch-sm);
  padding: 6px 10px;
  border-radius: var(--agb-radius-pill);
  border: 1px solid var(--agb-hairline-strong);
  background: #ffffff;
  color: var(--agb-ink);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
body.agb-page .rt-lang-menu__toggle:hover,
body.agb-page .rt-lang-menu__toggle:focus-visible {
  border-color: var(--agb-accent);
  color: var(--agb-accent-strong);
  outline: none;
}
body.agb-page .rt-lang-menu__toggle img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
body.agb-page .rt-lang-menu__chevron {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.16s ease;
}
body.agb-page .rt-lang-menu[data-open="true"] .rt-lang-menu__chevron {
  transform: rotate(180deg);
}
body.agb-page .rt-lang-menu__dropdown {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  inset-inline-start: auto;
  min-width: 180px;
  max-height: min(320px, 70vh);
  overflow: auto;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border-radius: var(--agb-radius-md);
  background: #ffffff;
  border: 1px solid var(--agb-hairline-strong);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16);
}
body.agb-page .rt-lang-menu[data-open="true"] .rt-lang-menu__dropdown {
  display: flex;
}
body.agb-page .rt-lang-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: var(--agb-touch-sm);
  width: 100%;
  border: 0;
  padding: 8px 10px;
  border-radius: var(--agb-radius-sm);
  background: transparent;
  color: var(--agb-ink);
  font-size: 0.9rem;
  text-align: start;
  cursor: pointer;
}
body.agb-page .rt-lang-menu__item img {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
}
body.agb-page .rt-lang-menu__item:hover,
body.agb-page .rt-lang-menu__item:focus-visible {
  background: var(--agb-accent-soft);
  color: var(--agb-accent-strong);
  outline: none;
}
body.agb-page .rt-lang-menu__item[aria-current="true"] {
  background: var(--agb-accent-soft-hover);
  color: var(--agb-accent-strong);
  font-weight: 700;
}
body.agb-page .rt-lang-menu__item[data-lang="ar"] {
  font-family: var(--agb-cairo-stack);
}

/* §12 — Cookie info banner (existing JS, restyled to match the page) */
body.agb-page .cookie-info-banner {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 3000;
  display: none;
  padding-block: 14px;
  padding-block-end: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-inline: clamp(16px, 4vw, 32px);
  background: #ffffff;
  border-block-start: 1px solid var(--agb-hairline-strong);
  box-shadow: 0 -16px 32px rgba(15, 23, 42, 0.10);
  color: var(--agb-ink);
}
body.agb-page .cookie-info-banner--visible {
  display: block;
}
body.agb-page .cookie-info-banner-inner {
  max-width: var(--agb-content-max);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
body.agb-page .cookie-info-text {
  margin: 0;
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--agb-ink);
}
body.agb-page .cookie-info-text a {
  color: var(--agb-accent-strong);
  text-decoration: none;
  border-block-end: 1px solid currentColor;
}
body.agb-page .cookie-info-text a:hover,
body.agb-page .cookie-info-text a:focus-visible {
  color: var(--agb-ink-strong);
}
body.agb-page .cookie-info-button {
  border: 0;
  border-radius: var(--agb-radius-pill);
  background: var(--agb-accent);
  color: var(--agb-accent-on);
  font-weight: 700;
  min-height: var(--agb-touch);
  padding: 10px 22px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, transform 0.16s ease;
}
body.agb-page .cookie-info-button:hover,
body.agb-page .cookie-info-button:focus-visible {
  background: var(--agb-accent-strong);
  transform: translateY(-1px);
  outline: none;
}

/* §13 — Desktop layout (≥1024): TOC becomes a sticky right rail next to the
        article. Mobile/tablet stays single-column with the chip rail above. */
@media (min-width: 1024px) {
  body.agb-page .agb-frame {
    grid-template-columns: minmax(0, 1fr) 232px;
    column-gap: 56px;
    row-gap: var(--agb-stack-gap);
  }
  body.agb-page .agb-article {
    grid-column: 1;
    grid-row: 1;
  }
  body.agb-page .agb-toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    inset-block-start: 24px;
    align-self: start;
    flex-direction: column;
    padding: 16px 14px;
    border: 1px solid var(--agb-hairline);
    border-radius: var(--agb-radius-md);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  body.agb-page .agb-toc__list {
    flex-direction: column;
    overflow: visible;
    mask-image: none;
    -webkit-mask-image: none;
    scroll-snap-type: none;
    gap: 4px;
  }
  body.agb-page .agb-toc__item {
    flex: 0 0 auto;
    width: 100%;
  }
  body.agb-page .agb-toc__link {
    width: 100%;
    justify-content: flex-start;
    border: 0;
    background: transparent;
    border-radius: var(--agb-radius-sm);
    padding-inline: 10px;
    padding-block: 6px;
    min-height: 36px;
    font-size: 0.92rem;
    line-height: 1.3;
    white-space: normal;
    text-align: start;
  }
  body.agb-page .agb-toc__link:hover,
  body.agb-page .agb-toc__link:focus-visible {
    background: var(--agb-accent-soft);
  }
  body.agb-page .agb-toc__link[aria-current="true"],
  body.agb-page .agb-toc__link.is-active {
    background: var(--agb-accent-soft-hover);
    border-inline-start: 2px solid var(--agb-accent);
    padding-inline-start: 8px;
    border-radius: 0 var(--agb-radius-sm) var(--agb-radius-sm) 0;
  }
}

/* §14 — Tablet refinements (641-1023px) */
@media (min-width: 641px) and (max-width: 1023px) {
  body.agb-page .agb-section__head {
    align-items: baseline;
  }
}

/* §15 — Mobile refinements (≤640px). Re-set every desktop property the rule
        cares about per playbook A12 (desktop leakage is the #1 redesign bug). */
@media (max-width: 640px) {
  body.agb-page {
    --agb-stack-gap: 26px;
  }
  body.agb-page .page-width {
    gap: var(--agb-stack-gap);
  }
  body.agb-page .agb-toprail {
    flex-wrap: nowrap;
    gap: 8px;
    padding-block: 4px;
  }
  body.agb-page .agb-toprail__back {
    font-size: 0.92rem;
    min-height: var(--agb-touch);
    padding-inline: 6px;
  }
  body.agb-page .rt-lang-menu__toggle [data-rt-lang-current] {
    display: none;
  }
  body.agb-page .rt-lang-menu__toggle {
    min-height: var(--agb-touch-sm);
    padding: 6px 10px;
  }
  body.agb-page .agb-hero {
    gap: 12px;
  }
  body.agb-page .agb-hero__title {
    max-width: none;
    font-size: clamp(1.95rem, 8vw, 2.6rem);
  }
  body.agb-page .agb-hero__meta {
    font-size: 0.88rem;
  }
  body.agb-page .agb-section {
    padding-block: 22px;
  }
  body.agb-page .agb-section__title {
    max-width: none;
  }
  body.agb-page .agb-ledger__row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding-block: 14px;
  }
  body.agb-page .agb-ledger__label {
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  body.agb-page .agb-footer__nav {
    gap: 4px 16px;
  }
  body.agb-page .cookie-info-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  body.agb-page .cookie-info-button {
    width: 100%;
    text-align: center;
  }
  body.agb-page .agb-toplink {
    inset-block-end: calc(18px + env(safe-area-inset-bottom, 0px));
    inset-inline-end: 14px;
  }
}

/* §16 — RTL discipline (Arabic). Logical CSS already covers most things;
        these are the explicit physical-axis overrides scoped at html level
        so the rules also reach side-sheets/popovers if any are added later. */
html[dir="rtl"] body.agb-page .agb-toprail__back-icon,
html[lang="ar"] body.agb-page .agb-toprail__back-icon {
  transform: scaleX(-1);
}
html[dir="rtl"] body.agb-page .agb-toc__list,
html[lang="ar"] body.agb-page .agb-toc__list {
  mask-image: linear-gradient(
    to left,
    transparent 0,
    #000 12px,
    #000 calc(100% - 24px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to left,
    transparent 0,
    #000 12px,
    #000 calc(100% - 24px),
    transparent 100%
  );
}
@media (min-width: 1024px) {
  html[dir="rtl"] body.agb-page .agb-toc__list,
  html[lang="ar"] body.agb-page .agb-toc__list {
    mask-image: none;
    -webkit-mask-image: none;
  }
}
html[dir="rtl"] body.agb-page .agb-progress__bar,
html[lang="ar"] body.agb-page .agb-progress__bar {
  margin-inline-start: auto;
  margin-inline-end: 0;
}

/* §17 — Cairo font for every Arabic glyph in the page scope.
        `font-family: inherit` on form controls preserves Cairo through
        inputs/buttons/selects/textarea (legal-core sets that already, kept
        here for defensiveness in case the page is loaded without the shared
        file). */
html[lang="ar"] body.agb-page,
html[dir="rtl"] body.agb-page,
body.agb-page.cairo-font {
  font-family: var(--agb-cairo-stack);
}
html[lang="ar"] body.agb-page button,
html[lang="ar"] body.agb-page input,
html[lang="ar"] body.agb-page select,
html[lang="ar"] body.agb-page textarea,
html[dir="rtl"] body.agb-page button,
html[dir="rtl"] body.agb-page input,
html[dir="rtl"] body.agb-page select,
html[dir="rtl"] body.agb-page textarea {
  font-family: inherit;
}
/* Phone numbers stay LTR even in Arabic context (per
   feedback_numbers_never_translated_arabic + bidi readability). */
html[lang="ar"] body.agb-page .js-restaurant-phone,
html[dir="rtl"] body.agb-page .js-restaurant-phone {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* §18 — Reduced motion + focus rings */
@media (prefers-reduced-motion: reduce) {
  body.agb-page .agb-toplink,
  body.agb-page .agb-progress__bar,
  body.agb-page .agb-toc__link,
  body.agb-page .agb-footer__link,
  body.agb-page .rt-lang-menu__chevron,
  body.agb-page .agb-toprail__back {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body.agb-page :focus-visible {
  outline: 2px solid var(--agb-accent);
  outline-offset: 2px;
  border-radius: var(--agb-radius-sm);
}
body.agb-page .agb-toprail__back:focus-visible,
body.agb-page .agb-toc__link:focus-visible,
body.agb-page .agb-footer__link:focus-visible,
body.agb-page .rt-lang-menu__toggle:focus-visible,
body.agb-page .cookie-info-button:focus-visible,
body.agb-page .agb-toplink:focus-visible {
  outline-offset: 3px;
}
