/* Consumer-rights page: a key-rights ledger up front, then the full law and
   regulation with a sticky, searchable article index. Uses the shared
   interior palette (--ui-*); amber marks amended articles only. */
.ac-page:has(.cr-page) { overflow-x: clip; }

.cr-page {
  --cr-panel: var(--ui-subtle, #f3f8f9);
  --cr-text: var(--ui-text, #2c4569);
  --cr-muted: var(--ui-muted, #526e7a);
  --cr-line: var(--ui-line, rgb(44 69 105 / 16%));
  --cr-accent: var(--ui-link, #167879);
  --cr-accent-soft: var(--ui-accent-soft, rgb(51 181 182 / 10%));
  --cr-amber: #faa831;
  color: var(--cr-text);
}

:root[data-theme="dark"] .cr-page { --cr-panel: #152d43; }

.cr-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Hero */
.cr-hero { padding-block: 130px 48px; }

.cr-back {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--cr-accent);
  font-size: 0.8125rem;
}

.cr-page .cr-hero__title {
  max-width: 18ch;
  margin: 0;
  color: var(--cr-text);
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: balance;
}

.cr-page .cr-hero__lede {
  max-width: 56ch;
  margin: 20px 0 0;
  color: var(--cr-muted);
  font-size: 1rem;
  line-height: 2;
}

.cr-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.cr-doc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 220px;
  padding: 14px 20px;
  border: 1px solid var(--cr-line);
  border-inline-start: 3px solid var(--cr-accent);
  border-radius: 14px;
  color: var(--cr-text);
  transition: border-color 0.2s ease;
}

.cr-doc strong { font-size: 1rem; }
.cr-doc span { color: var(--cr-muted); font-size: 0.8125rem; }
.cr-doc:hover { border-color: var(--cr-accent); }

/* Key-rights ledger */
.cr-page .cr-section-title {
  margin: 0;
  color: var(--cr-text);
  font-family: 'Lalezar', 'Vazirmatn', sans-serif;
  font-size: clamp(1.625rem, 3vw, 2.25rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
}

.cr-rights { padding-bottom: 72px; }

.cr-ledger {
  margin: 20px 0 0;
  padding: 6px 28px;
  border-radius: 22px;
  background: var(--cr-panel);
  list-style: none;
}

.cr-ledger__row {
  display: grid;
  grid-template-columns: minmax(12rem, 15rem) minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px 32px;
  padding-block: 18px;
}

.cr-ledger__row + .cr-ledger__row { border-top: 1px solid var(--cr-line); }

.cr-ledger__figure {
  color: var(--cr-accent);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.6;
}

.cr-page .cr-ledger__text {
  max-width: 62ch;
  margin: 0;
  color: var(--cr-text);
  font-size: 0.9375rem;
  line-height: 1.9;
}

.cr-ledger__source {
  color: var(--cr-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--cr-line);
  text-underline-offset: 5px;
}

.cr-ledger__source:hover { color: var(--cr-accent); text-decoration-color: currentColor; }

.cr-page .cr-disclaimer {
  margin: 14px 0 0;
  color: var(--cr-muted);
  font-size: 0.8125rem;
}

/* Full text with index */
.cr-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 56px;
  padding-bottom: 110px;
}

.cr-toc {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-inline-end: 6px;
  scrollbar-width: thin;
}

.cr-search input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--cr-line);
  border-radius: 12px;
  background: var(--cr-panel);
  color: var(--cr-text);
  font: inherit;
  font-size: 0.875rem;
}

.cr-search input::placeholder { color: var(--cr-muted); }
.cr-search input:focus { outline: none; border-color: var(--cr-accent); box-shadow: 0 0 0 3px var(--cr-accent-soft); }

.cr-page .cr-search__status {
  margin: 8px 0 0;
  color: var(--cr-muted);
  font-size: 0.75rem;
}

.cr-toc__group { margin-top: 20px; }

.cr-toc__group summary {
  display: flex;
  justify-content: space-between;
  padding-block: 6px;
  border-bottom: 1px solid var(--cr-line);
  color: var(--cr-text);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.cr-toc__group summary::-webkit-details-marker { display: none; }
.cr-toc__group summary span { color: var(--cr-muted); font-weight: 400; }

.cr-toc ol { margin: 8px 0 0; padding: 0; list-style: none; }

.cr-toc a {
  display: flex;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--cr-muted);
  font-size: 0.8125rem;
  line-height: 1.7;
}

.cr-toc a span { flex: none; width: 1.5rem; color: var(--cr-accent); font-weight: 700; }
.cr-toc a:hover { color: var(--cr-text); }
.cr-toc a[aria-current="true"] { background: var(--cr-accent-soft); color: var(--cr-text); }

.cr-document + .cr-document { margin-top: 72px; }

.cr-document__head { padding-bottom: 18px; border-bottom: 3px solid var(--cr-line); }
.cr-page .cr-document__head p { margin: 4px 0 0; color: var(--cr-muted); font-size: 0.875rem; }

.cr-page .cr-document__preamble,
.cr-page .cr-document__closing {
  max-width: 70ch;
  margin: 24px 0 0;
  color: var(--cr-muted);
  font-size: 0.875rem;
  line-height: 2;
}

.cr-article {
  padding-block: 28px;
  scroll-margin-top: 110px;
}

.cr-article + .cr-article { border-top: 1px solid var(--cr-line); }

.cr-article__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.cr-article__no { color: var(--cr-accent); font-size: 0.875rem; font-weight: 700; }

.cr-page .cr-article__title {
  margin: 0;
  color: var(--cr-text);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
}

.cr-amended {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--cr-amber);
  color: #2c4569;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.9;
}

.cr-page .cr-article p {
  max-width: 70ch;
  margin: 0;
  color: var(--cr-text);
  font-size: 1rem;
  line-height: 2.1;
  text-align: justify;
  text-justify: inter-word;
}

.cr-items {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.cr-items li {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 8px;
}

.cr-items__label { color: var(--cr-accent); font-weight: 700; line-height: 2.1; }
.cr-items strong { font-weight: 700; }

.cr-note {
  max-width: 70ch;
  margin-top: 14px;
  padding: 12px 18px;
  border-inline-start: 3px solid var(--cr-accent);
  border-radius: 10px;
  background: var(--cr-panel);
}

.cr-note__label { color: var(--cr-accent); font-size: 0.8125rem; font-weight: 700; }
.cr-note .cr-amended { margin-inline-start: 8px; }
.cr-page .cr-note p { color: var(--cr-muted); font-size: 0.9375rem; }

.cr-sales-notes { max-width: 70ch; margin-top: 18px; }
.cr-sales-notes h4 { margin: 0 0 6px; font-size: 0.9375rem; font-weight: 700; }

.cr-sales-notes ul {
  margin: 0;
  padding-inline-start: 20px;
  color: var(--cr-muted);
  font-size: 0.9375rem;
  line-height: 2;
}

.cr-page .cr-empty {
  padding: 40px 0;
  color: var(--cr-muted);
  text-align: center;
}

.cr-page [hidden] { display: none !important; }

@media (max-width: 960px) {
  .cr-body { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .cr-toc { position: static; max-height: none; overflow: visible; }
  .cr-ledger__row { grid-template-columns: minmax(0, 1fr) auto; }
  .cr-page .cr-ledger__text { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 640px) {
  .cr-hero { padding-block: 110px 36px; }
  .cr-doc { flex: 1 1 100%; }
  .cr-ledger { padding: 4px 18px; }
  .cr-ledger__row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cr-page .cr-ledger__text { grid-row: auto; }
  .cr-page .cr-article p { text-align: start; }
}

/* While searching, keep only matching articles and their document heading. */
.cr-page.is-searching :is(.cr-document__preamble, .cr-document__closing) { display: none; }
