/* r6 lane D — trust pages, states and disabled services.
   Consumes the frozen r6 tokens defined in styles.css (A):
   --news --ink --ink-2 --rule --signal --red --blue --studio --studio-2 --mute.
   No other colours, no decorative depth, no pill shapes. Radius stays 0–4px.
   Marked elements carry data-r6d-proposal / data-r6d-optional; the adapter
   removes them when the build may not render that copy. */

[data-r6d] {
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: anywhere;
}

[data-r6d] [hidden] {
  display: none;
}

[data-r6d] a:focus-visible,
[data-r6d] button:focus-visible,
[data-r6d] summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* --- more menu: the visible no-JS list and the sheet content --- */
.r6d-more-fallback {
  margin: 0;
  padding: 0;
}

.r6d-more-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.r6d-more-menu li {
  border-top: 1px solid var(--rule);
}

.r6d-more-menu a,
.r6d-sheet-nav a {
  display: block;
  min-height: 44px;
  padding: 11px 4px;
  color: var(--ink);
  font-size: 16px;
  line-height: 26px;
}

.r6d-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  padding: 16px;
  background: var(--news);
  border-top: 1px solid var(--ink);
}

.r6d-sheet[hidden] {
  display: none;
}

.r6d-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.r6d-sheet-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 30px;
}

.r6d-sheet-nav a {
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

/* --- buttons and controls (standalone targets are 44×44 minimum) ---
   Text contrast per state, from the guide's sRGB tokens:
   unpressed ink-on-news 17.26 · unpressed hover ink-on-rule 13.20 ·
   pressed news-on-ink 17.26 · pressed hover stays news-on-ink (the general
   hover background applies to unpressed, enabled controls only) ·
   disabled ink-2-on-news 8.79. Every pair stays ≥ 4.5:1. */
.r6d-button {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 16px;
  color: var(--ink);
  font-size: 16px;
  line-height: 26px;
  background: var(--news);
  border: 1px solid var(--ink);
  border-radius: 2px;
  transition: background 120ms ease;
  cursor: pointer;
}

.r6d-button[aria-pressed="true"] {
  color: var(--news);
  background: var(--ink);
}

.r6d-button:disabled {
  color: var(--ink-2);
  background: var(--news);
  border-color: var(--rule);
  cursor: default;
}

@media (hover: hover) {
  .r6d-button:hover:not([aria-pressed="true"]):not(:disabled) {
    background: var(--rule);
  }
}

.r6d-controls {
  margin: 16px 0 0;
}

/* --- page sections and notices --- */
/* D2: one selector, data-r6d-part, is the section boundary in templates,
   slot-contract.json and the planned renderer. An emptied part is removed by
   the renderer; this rule only hides a leftover empty one. */
[data-r6d-part] {
  margin: 0 0 24px;
}

[data-r6d-part] h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 30px;
}

[data-r6d-part] p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 30px;
}

.r6d-notice {
  margin: 0 0 24px;
  padding: 12px 16px;
  font-size: 17px;
  line-height: 30px;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

[data-r6d-part]:empty,
.r6d-notice:empty {
  display: none;
}

/* --- corrections: red belongs to corrections only --- */
.r6d-corrections {
  margin: 0;
}

.r6d-correction-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.r6d-correction {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  border-left: 2px solid var(--red);
  padding-left: 12px;
}

.r6d-correction p {
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 30px;
}

.r6d-correction a {
  color: var(--blue);
}

.r6d-correction time {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-2);
}

.r6d-corrections-preserved p {
  font-size: 17px;
  line-height: 30px;
}

.r6d-corrections:empty,
.r6d-corrections-empty:empty,
.r6d-corrections-preserved:empty {
  display: none;
}

/* --- states: empty, late, offline, error, loading --- */
.r6d-state {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 2px;
}

.r6d-state h1,
.r6d-state h2 {
  margin: 8px 0;
  font-size: 20px;
  line-height: 30px;
}

.r6d-state h1 {
  font-size: 22px;
  line-height: 32px;
}

.r6d-state p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 30px;
}

.r6d-state-action {
  margin-top: 8px;
}

.r6d-state-action:empty {
  display: none;
}

.r6d-state-action a {
  display: inline-block;
  min-height: 44px;
  min-width: 44px;
  padding: 11px 16px;
  color: var(--ink);
  font-size: 16px;
  line-height: 26px;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 2px;
}

/* the skeleton is the final layout shape; it never loops or delays reading */
.r6d-skeleton-bar {
  height: 16px;
  margin: 12px 0;
  background: var(--rule);
  border-radius: 2px;
}

.r6d-skeleton-bar--short {
  width: 60%;
}

.r6d-state-page {
  min-height: 40vh;
}

.r6d-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
}

/* --- disabled email and alert services (no form, no address, no permission) --- */
.r6d-service {
  margin: 0 0 24px;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
}

.r6d-service h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 30px;
}

.r6d-service p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 30px;
}

.r6d-service[hidden] {
  display: none;
}

/* --- mascot slot: a stable neutral shape until rights-cleared art is bound --- */
.r6d-mascot {
  display: inline-block;
  width: 48px;
  height: 48px;
  margin: 0 12px 0 0;
  vertical-align: middle;
  background: var(--news);
  border: 1px solid var(--rule);
  border-radius: 2px;
}

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

/* Body and deck role: 17/30 up to 899 px, 18/32 from 900 px (guide §3). */
@media (min-width: 900px) {
  [data-r6d-part] p,
  .r6d-notice,
  .r6d-state p,
  .r6d-service p,
  .r6d-correction p,
  .r6d-corrections-preserved p {
    font-size: 18px;
    line-height: 32px;
  }
}
