/* U plan site shell styles, contract v1 (spec 8.6 and 8.9).
   Only the parts that 8.9 gives to the shell: article body after the lead,
   sources, feed, end of feed, footer, the reward entry and panel, info,
   language and not-found pages. Colours come only from the contract
   variables (light and dark sets are defined once, in CONTRACT_CSS);
   logical properties keep right-to-left pages correct. */

.a-body { font-size: 17px; line-height: 1.6; }
.a-body p { margin: 0 0 16px; }
.a-h { margin: 32px 0 12px; font-size: 21px; line-height: 1.35; font-weight: 700; }
.a-list { margin: 0 0 16px; padding-inline-start: 24px; }
.a-list li { margin: 0 0 8px; }
.a-chart { margin: 24px 0; }
.a-src { margin: 32px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-muted); }
.a-src-h { margin: 0 0 8px; font-size: 14px; line-height: 1.5; font-weight: 700; color: var(--u-fg); }
.a-src ol { margin: 0; padding-inline-start: 20px; }
.a-src li { margin: 0 0 4px; overflow-wrap: anywhere; }
.a-upd { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-accent); }

.feed { margin: 40px 0 0; padding: 0; list-style: none; border-block-start: 1px solid var(--u-line); }
.fc { margin: 0; border-block-end: 1px solid var(--u-line); }
.fc-link {
  display: grid; grid-template-columns: minmax(0, 1fr) 96px; column-gap: 16px;
  min-height: 44px; padding: 16px 0; color: var(--u-fg); text-decoration: none;
}
.fc-link:visited { color: var(--u-fg); }
.fc-img { grid-column: 2; grid-row: 1 / span 3; width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.fc-title { grid-column: 1; margin: 0; font-size: 18px; line-height: 1.35; font-weight: 700; }
.fc-sum {
  grid-column: 1; margin: 4px 0 0; overflow: hidden; font-size: 14px; line-height: 1.5; color: var(--u-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1;
}
.fc-meta { grid-column: 1; margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-accent); }
.fc-lead .fc-link { grid-template-columns: minmax(0, 1fr); }
.fc-lead .fc-img { grid-column: 1; grid-row: auto; width: 100%; height: auto; margin: 0 0 12px; }

.end { margin: 24px 0; font-size: 14px; line-height: 1.5; text-align: center; color: var(--u-muted); }
.foot {
  display: flex; flex-wrap: wrap; gap: 0 20px; margin: 40px 0 0;
  padding-block: 16px calc(16px + env(safe-area-inset-bottom));
  border-block-start: 1px solid var(--u-line); font-size: 14px; line-height: 1.5; color: var(--u-muted);
}
.foot a { display: inline-block; min-height: 44px; line-height: 44px; }
/* Site pages put the footer straight under <body>, after <main>: same column
   as the content of #u-main (640 wide less the side padding, centred), so the
   links never touch the screen edge and the top line matches the light page
   footer, which sits inside .rest. */
body > .foot {
  width: calc(100% - 2 * var(--u-pad)); max-width: calc(var(--u-w) - 2 * var(--u-pad)); margin-inline: auto;
}

.rw { min-height: var(--u-rs-h); }
.rw [hidden] { display: none !important; }
.rw-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  box-sizing: border-box; width: 100%; min-height: var(--u-rs-h); margin: 0; padding: 0;
  border: 0; border-block: 1px solid var(--u-line); background: transparent; color: var(--u-fg);
  font: inherit; font-size: 17px; line-height: 1.35; font-weight: 600; text-align: start; cursor: pointer;
}
.rw-entry { min-width: 0; }
.rw-chev {
  flex: none; width: 8px; height: 8px; margin-block-start: -4px;
  border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg);
}
.rw-toggle[aria-expanded="true"] .rw-chev { margin-block-start: 4px; transform: rotate(225deg); }
[dir="rtl"] .rw-chev { transform: rotate(-45deg); }
[dir="rtl"] .rw-toggle[aria-expanded="true"] .rw-chev { transform: rotate(135deg); }
.rw-panel { padding: 16px 0 24px; border-block-end: 1px solid var(--u-line); font-size: 17px; line-height: 1.6; }
.rw-rules { margin: 0 0 16px; }
.rw-label { display: block; margin: 0 0 8px; font-weight: 600; }
.rw-input {
  display: block; box-sizing: border-box; width: 100%; min-height: 48px; margin: 0; padding: 0 12px;
  border: 1px solid var(--u-muted); border-radius: 8px; background: var(--u-bg); color: var(--u-fg);
  font: inherit; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere;
}
.rw-hint { margin: 8px 0 16px; font-size: 14px; line-height: 1.5; color: var(--u-muted); }
.rw-btn {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-width: 44px; min-height: 48px; margin-block: 0 8px; margin-inline: 0 8px; padding: 0 20px;
  border: 1px solid var(--u-fg); border-radius: 8px; background: transparent; color: var(--u-fg);
  font: inherit; font-size: 16px; line-height: 1.2; font-weight: 600; text-decoration: none; cursor: pointer;
}
.rw-btn:visited { color: var(--u-fg); }
.rw-primary { background: var(--u-fg); color: var(--u-bg); }
.rw-secondary { background: transparent; color: var(--u-fg); }
.rw-progress {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px;
  margin: 16px 0; font-size: 14px; line-height: 1.5;
}
.rw-progress dt { color: var(--u-muted); }
.rw-progress dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rw-share { margin: 16px 0 0; }
.rw-out { margin: 8px 0 0; }
.rw-out .rw-input { margin-block-start: 8px; }
.rw-disclosure { margin: 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-muted); }
.rw-status { min-height: 21px; margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--u-fg); }

.info { font-size: 17px; line-height: 1.6; }
.info h1 { margin: 24px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 700; }
.info h2 { margin: 32px 0 12px; font-size: 21px; line-height: 1.35; font-weight: 700; }
.info p, .info ul, .info ol { margin: 0 0 16px; }
.info ul, .info ol { padding-inline-start: 24px; }
.langs { font-size: 17px; line-height: 1.6; }
.langs h1 { margin: 24px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 700; }
.langs ul { margin: 0; padding: 0; list-style: none; }
.langs li { border-block-end: 1px solid var(--u-line); }
.langs a { display: block; min-height: 44px; padding: 12px 0; font-size: 18px; line-height: 1.35; }
/* No padding on .nf: it is #u-main, whose side padding comes from the contract
   (an id rule a class rule cannot override); the title keeps its own space. */
.nf { font-size: 17px; line-height: 1.6; }
.nf h1 { margin: 24px 0 16px; font-size: 28px; line-height: 1.25; font-weight: 700; }
