/* The rendered legal pages' own layout (`:server:api`'s LegalPageRenderer), over common.css's palette,
   fonts and shell: one soft blue title card for every page, the contents in a white card, each
   section in its own white card with a light-blue number, steps, tables, folded questions, and the
   app's embedded frame. */

/* Nothing here is meant to be scrolled sideways (common.css clips the page): a wide table scrolls
   inside its own frame. */
/* The title on the soft hero (common.css), its icon on a white square. */
.title { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1.25rem; align-items: center; }
.title .summary { margin: 0; }
.icon { flex: none; display: flex; align-items: center; justify-content: center; grid-row: 1 / 3; align-self: start;
        width: 3.5rem; height: 3.5rem; border-radius: 1rem; background: var(--card); color: var(--primary); }
.icon svg { width: 1.75rem; height: 1.75rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The text: "Last updated", then each section in its own white card (common.css's `sheet`). */
.text { display: flex; flex-direction: column; gap: 1rem; }
.sec h2 { display: flex; align-items: flex-start; gap: .875rem; font-size: 1.375rem; line-height: 1.4; margin: 0 0 1rem 0; }
/* At least a circle, wider for two digits («١٢»). Mada: a numeral. */
h2 .n { flex: none; min-width: 2.25rem; height: 2.25rem; line-height: 2.25rem; padding: 0 .25rem; box-sizing: border-box;
        text-align: center; border-radius: 999px; background: var(--primary-soft); color: var(--primary-soft-ink);
        font-family: var(--digits); font-size: 1rem; font-weight: 600; }
h3 { font-size: 1.0625rem; font-weight: 600; margin: 1.25rem 0 .25rem 0; }
.prose p, .prose li { color: var(--ink-2); }
.sec p + p, .sec p + ul, .sec ul + p { margin-top: .875rem; }
.sec a { text-decoration: underline; text-underline-offset: 3px; }
strong { color: var(--ink); }
/* A reference code inside an Arabic sentence keeps its own order (GRD-… never flips its dash). */
code { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
/* Numbered steps (common.css's `counted`): the number beside its step, so a procedure reads as one. */
ol.steps { margin: .75rem 0; }
ol.steps li { display: flex; align-items: flex-start; gap: .75rem; margin-bottom: .75rem; }
/* Tables: a rounded frame, hairlines between rows, no grid. */
.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: 1rem; margin: 1rem 0; background: var(--card); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: .6rem .8rem; font-size: .9375rem; text-align: start; vertical-align: top;
         border-top: 1px solid var(--line); }
th { border-top: 0; background: var(--tint); color: var(--ink); }
/* The owner's rule: anything still awaiting a decision is red, wherever it appears, with a dotted
   underline so it does not rest on colour alone. */
.tbd { color: var(--error); text-decoration: underline dotted; text-underline-offset: 4px; }

/* Questions as grouped rows, the apps' `GroupedRow`: one white row each, a hair apart, the group's ends
   rounded. A section that holds them is not a card itself. `details` needs no script, which these pages may not carry. */
.grouped { display: flex; flex-direction: column; gap: 3px; }
.grouped > * { background: var(--card); border-radius: .375rem; }
.grouped > :first-child { border-start-start-radius: var(--radius); border-start-end-radius: var(--radius); }
.grouped > :last-child { border-end-start-radius: var(--radius); border-end-end-radius: var(--radius); }
.sec:has(> .qa) { background: none; padding: 0; }
.qa { margin: 1rem 0; }
.qa details { padding: 0 1.25rem; }
/* Flex, not a float: a floated marker pushed an Arabic line past the page and clipped its first letters. */
details summary { font-size: 1rem; font-weight: 600; color: var(--ink); min-height: 3.5rem; box-sizing: border-box;
                  padding: .75rem 0; cursor: pointer; list-style: none;
                  display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
details summary::-webkit-details-marker { display: none; }
/*
 * The chevron is a character, not an icon file. `direction: ltr` on the marker alone, because
 * U+203A is bidi-mirrored: in an Arabic run the browser flips it before the rotation, so both
 * states pointed the wrong way. A box of its own, so the rotated glyph's corners are not clipped.
 */
details summary::after { content: "\203A"; direction: ltr; flex: none;
                         display: flex; align-items: center; justify-content: center;
                         width: 1.5rem; height: 1.5rem;
                         font-size: 1.25rem; line-height: 1; color: var(--ink-2);
                         transform: rotate(90deg); transition: transform 150ms; }
details[open] summary::after { transform: rotate(-90deg); }
details > *:not(summary) { margin-top: 0; margin-bottom: 1rem; }

/*
 * The contents, after the title in the source so a keyboard reaches the page's heading first. On a
 * phone, a closed "On this page" that opens without script; from 900 px, a white card beside the
 * text on the start side, staying in view. Two copies of one list, one shown at a time.
 */
.toc { margin: 0 0 1rem 0; }
.toc-side { display: none; }
.toc-fold { background: var(--card); border-radius: var(--radius); padding: 0 1.25rem; }
.toc-fold summary { font-size: .9375rem; }
.toc-title { margin: 0 .75rem .75rem .75rem; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .375rem .75rem; box-sizing: border-box;
         border-radius: 1.375rem; color: var(--ink); font-size: .9375rem; line-height: 1.4; text-decoration: none; }
.toc a:hover { background: var(--tint); }
.toc .n { flex: none; min-width: 1.25rem; color: var(--ink-2); font-family: var(--digits);
          font-size: .8125rem; font-weight: 600; }
/* The row of the section the address names is chosen, as the apps' chosen tab; with no fragment,
   none is. No script: the section the address targets marks its own row. One rule per section, as
   many as LegalPageRenderer.MARKED_CONTENTS_ROWS (PublicWebDriftTest holds the two together). */
.doc:has(.sec:nth-of-type(1) > h2:target) .toc li:nth-child(1) a,
.doc:has(.sec:nth-of-type(2) > h2:target) .toc li:nth-child(2) a,
.doc:has(.sec:nth-of-type(3) > h2:target) .toc li:nth-child(3) a,
.doc:has(.sec:nth-of-type(4) > h2:target) .toc li:nth-child(4) a,
.doc:has(.sec:nth-of-type(5) > h2:target) .toc li:nth-child(5) a,
.doc:has(.sec:nth-of-type(6) > h2:target) .toc li:nth-child(6) a,
.doc:has(.sec:nth-of-type(7) > h2:target) .toc li:nth-child(7) a,
.doc:has(.sec:nth-of-type(8) > h2:target) .toc li:nth-child(8) a,
.doc:has(.sec:nth-of-type(9) > h2:target) .toc li:nth-child(9) a,
.doc:has(.sec:nth-of-type(10) > h2:target) .toc li:nth-child(10) a,
.doc:has(.sec:nth-of-type(11) > h2:target) .toc li:nth-child(11) a,
.doc:has(.sec:nth-of-type(12) > h2:target) .toc li:nth-child(12) a,
.doc:has(.sec:nth-of-type(13) > h2:target) .toc li:nth-child(13) a,
.doc:has(.sec:nth-of-type(14) > h2:target) .toc li:nth-child(14) a,
.doc:has(.sec:nth-of-type(15) > h2:target) .toc li:nth-child(15) a,
.doc:has(.sec:nth-of-type(16) > h2:target) .toc li:nth-child(16) a { background: var(--peach); color: var(--peach-ink); font-weight: 600; }

@media (min-width: 56.25em) {
  .with-contents { max-width: 75rem; }
  .page { padding-inline: 2.5rem; }
  .sec h2 { font-size: 1.5rem; }
  .doc { display: grid; grid-template-columns: 18.75rem minmax(0, 1fr); grid-template-areas: "toc title" "toc text";
         column-gap: 3rem; align-items: start; }
  .doc > .title { grid-area: title; }
  .doc > .text { grid-area: text; }
  .toc { grid-area: toc; position: sticky; top: 6rem; max-height: calc(100vh - 7.5rem); overflow-y: auto; margin: .5rem 0 0 0;
         padding: 1.5rem 1rem; box-sizing: border-box; border-radius: var(--radius); background: var(--card);
         animation: fade .6s var(--ease) .2s both; }
  .toc-fold { display: none; }
  .toc-side { display: block; }
}

/* Inside the app's sheet (`embedded`) the sheet draws the ground, the margins and the cards, and a
   second one inside it reads as an iframe. */
.embedded body { background: transparent; }
.embedded .page { padding: 0 0 2rem 0; }
.embedded .sec { background: transparent; padding: 0; }
.embedded .text { gap: 1.75rem; }
.embedded .tbl, .embedded .qa details { background: transparent; padding-inline: 0; }
.embedded .qa details + details { border-top: 1px solid var(--line); }
.embedded .published span { background: var(--tint); }
