/* Rule manuscript: an explanatory document, not an imitation application screen. */
.rig { position: relative; width: 840px; margin: 34px auto 0; padding-bottom: 22px; text-align: left; overflow: visible; }
.paper-wrap { position: relative; perspective: 1800px; min-width: 0; }
.paper-under {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 12px;
  bottom: -10px;
  border-radius: var(--r-card);
  background: var(--bg-panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  transform: rotateX(4deg);
  transform-origin: 50% 100%;
}
.paper {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  transform: rotateX(4deg);
  transform-origin: 50% 100%;
}
.paper-head { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 10px 20px; background: var(--bg-panel); color: var(--text); border-bottom: 1px solid var(--border); }
.paper-head svg { width: 15px; height: 15px; color: var(--accent); }
.paper-file { font-family: var(--font-mono); font-size: var(--size-code); font-weight: var(--weight-semibold); }
.paper-kind { font-size: var(--size-label); color: var(--text-muted); }
.paper-kind::before { content: "·"; margin-right: 10px; color: var(--border); font-weight: var(--weight-strong); }
.paper-body {
  padding-top: 14px;
  padding-bottom: 14px;
  overflow-x: auto;
  background: linear-gradient(to right, var(--bg-panel) 0 52px, var(--border) 52px 53px, var(--transparent) 53px);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--size-code);
  line-height: 25px;
}
.ln { position: relative; display: grid; grid-template-columns: 52px minmax(0, 330px) 1fr; align-items: center; min-height: 25px; }
.ln-no { padding-right: 12px; text-align: right; font-size: var(--size-xs); color: var(--text-muted); user-select: none; }
.ln-code { padding-left: 20px; white-space: pre; overflow-wrap: normal; }
.ln-note { font-family: var(--font-body); font-size: var(--size-label); color: var(--text-muted); }
.ln--final { background: var(--bg-panel-2); color: var(--text); }
.ln--final::before { content: ""; position: absolute; left: 51px; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.ln--final .ln-no { color: var(--accent); font-weight: var(--weight-semibold); }
.ln--final .ln-note { color: var(--accent-dark); font-weight: var(--weight-semibold); }
.t-sec, .t-pol { color: var(--accent-dark); font-weight: var(--weight-strong); }
.t-op { color: var(--text-muted); }
.t-val, .t-type { color: var(--accent); }
.t-type { font-weight: var(--weight-semibold); }
.float {
  position: absolute;
  z-index: 3;
  width: 284px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
}
.float-verify { left: -256px; bottom: 0; }
.float-order { right: -256px; top: -22px; }
.float-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 15px 18px 11px; }
.float-title { font-family: var(--font-display); font-size: var(--size-brand); font-weight: var(--weight-display); letter-spacing: var(--track-cjk); }
.float-tag { padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-panel); color: var(--accent-dark); font-family: var(--font-mono); font-size: var(--size-tiny); font-weight: var(--weight-semibold); }
.glist { margin: 0 12px 12px; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); overflow: hidden; }
.glist li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; }
.glist li + li { border-top: 1px solid var(--border); }
.glist-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.glist-k { font-size: var(--size-tiny); color: var(--text-muted); line-height: 1.4; }
.glist-v { font-size: var(--size-label); font-weight: var(--weight-semibold); color: var(--text); line-height: 1.45; overflow-wrap: anywhere; }
.glist-v--mono { font-family: var(--font-mono); }
.ok-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.chev { width: 12px; height: 12px; flex-shrink: 0; color: var(--text-muted); }
.order { position: relative; margin: 2px 18px 0; padding: 4px 0; list-style: none; }
.order::before { content: ""; position: absolute; left: 5px; top: 16px; bottom: 16px; border-left: 1px dashed var(--accent); opacity: .55; }
.order li { position: relative; display: flex; align-items: center; gap: 13px; min-height: 30px; font-family: var(--font-mono); font-size: var(--size-label); }
.ring { position: relative; z-index: 1; width: 11px; height: 11px; flex-shrink: 0; border-radius: var(--r-circle); border: 1.5px solid var(--accent); background: var(--bg); }
.order-type { flex: 1; font-weight: var(--weight-semibold); }
.order-ref { font-size: var(--size-tiny); color: var(--text-muted); }
.order .is-final .ring { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.order .is-final .order-type { color: var(--accent-dark); font-weight: var(--weight-strong); }
.order .is-final .order-ref { color: var(--accent); }
.float-note { margin: 8px 18px 16px; padding-top: 10px; border-top: 1px solid var(--border); font-size: var(--size-xs); line-height: 1.6; color: var(--text-muted); }
.peek { position: relative; z-index: 1; margin: 30px 24px 0; padding: 64px 40px 96px; background: var(--bg-panel); color: var(--text); border-radius: var(--r-panel); text-align: center; }
.peek-eyebrow { font-family: var(--font-mono); font-size: var(--size-xs); font-weight: var(--weight-semibold); letter-spacing: var(--track-index); color: var(--accent); }
.peek h2 { margin: 10px 0 0; }

/* Six-entry directory with a large floating detail surface. */
.feature-tabs { display: grid; grid-template-columns: minmax(0, .38fr) minmax(0, .62fr); gap: 40px; align-items: start; }
.feature-tabs > * { min-width: 0; }
.feature-index[role="tablist"] { display: flex; flex-direction: column; gap: 4px; }
.feature-tab {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 2px 12px;
  width: 100%;
  min-height: 76px;
  padding: 14px 20px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--transparent);
  color: var(--text);
  text-align: left;
}
.feature-tab[aria-selected="true"] { background: var(--bg-panel); color: var(--text); }
.feature-tab[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; background: var(--accent); }
.tab-number { grid-row: span 2; font-family: var(--font-mono); font-size: var(--size-xs); color: var(--accent); padding-top: 3px; }
.tab-title { font-weight: var(--weight-strong); }
.tab-summary { color: var(--text-muted); font-size: var(--size-sm); }
.feature-detail { position: relative; padding-bottom: 52px; }
.feature-panel { min-height: 340px; padding: 40px; }
.feature-panel p { line-height: 1.9; }
.code-strip { display: block; margin-top: 24px; padding: 16px; background: var(--bg-panel); color: var(--accent-dark); border-radius: var(--r-sm); overflow-x: auto; font-family: var(--font-mono); font-size: var(--size-code); }
.code-strip code { white-space: pre; overflow-wrap: normal; }
.feature-note {
  position: relative;
  width: min(85%, 320px);
  margin: -12px 0 0 auto;
  padding: 18px 22px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-float);
  transform: rotate(-2deg);
  font-size: var(--size-sm);
}
.tabs-row[role="tablist"] { display: flex; gap: 8px; overflow-x: auto; padding: 4px; }
.tabs-row [role="tab"] { flex-shrink: 0; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text); }
.tabs-row [aria-selected="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
[role="tabpanel"] { min-width: 0; }

/* Put a sticky TOC directly inside the container spanning all sections. */
.toc { position: sticky; top: 12px; z-index: 10; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); color: var(--text); box-shadow: var(--shadow-card); }
.toc ul { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.toc li { flex-shrink: 0; }
.toc a { display: block; min-height: 44px; padding: 10px 16px; border-radius: var(--r-sm); font-size: var(--size-sm); }
.toc a:hover, .toc a[aria-current] { background: var(--bg-panel); color: var(--accent-dark); }
.toc--flow { position: static; }

.faq-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); color: var(--text); }
.faq-item + .faq-item { margin-top: 12px; }
.faq-item summary { position: relative; list-style: none; padding: 20px 54px 20px 24px; font-weight: var(--weight-strong); cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; top: 19px; right: 24px; color: var(--accent); font-family: var(--font-mono); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 24px 24px; color: var(--text-muted); }
.faq-answer > * + * { margin-top: 12px; }
.term-card { min-width: 0; }
.term-card dt { margin-bottom: 12px; font-family: var(--font-mono); font-size: var(--size-intro); font-weight: var(--weight-strong); color: var(--accent-dark); overflow-wrap: anywhere; }
.term-card dd { margin: 0; color: var(--text-muted); line-height: 1.85; }

.app-store-button { min-height: 50px; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-btn); }
.app-store-button:hover { background: var(--accent-dark); color: var(--on-accent); }
.app-store-button svg { width: 18px; height: 18px; }
.store-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.store-copy small { font-size: var(--size-tiny); font-weight: var(--weight-medium); }
.store-copy strong { font-size: var(--size-button); font-weight: var(--weight-strong); }
.store-cta-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; }
.store-cta-card h2, .store-cta-card h3 { margin-top: 0; }
.fact-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.fact-row > * { min-width: 0; max-width: 100%; }
.fact-row--start { justify-content: flex-start; }
.badge { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 10px; border-radius: var(--r-pill); background: var(--bg-panel); color: var(--accent-dark); font-size: var(--size-xs); font-weight: var(--weight-semibold); overflow-wrap: anywhere; }
.badge--success { background: var(--bg); color: var(--success); border: 1px solid var(--success); }
.badge--warn { background: var(--bg); color: var(--text); border: 1px solid var(--warn); }
.badge--error { background: var(--bg); color: var(--error); border: 1px solid var(--error); }

/* Screenshot images retain the complete original 750 × 1334 frame. */
.official-shot { width: 100%; max-width: 280px; margin: 0 auto; padding: 0; flex-shrink: 0; min-width: 0; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: var(--r-shot); }
.official-shot figcaption { margin-top: 12px; font-size: var(--size-xs); line-height: 1.7; color: var(--text-muted); }
.official-shot { outline: 1px solid var(--border); outline-offset: -1px; border-radius: var(--r-shot); }
.official-shot:has(figcaption) { outline: none; }
.shot-row { display: flex; align-items: flex-start; justify-content: center; gap: 32px; }
.shot-row > * { min-width: 0; }
.device-card { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; }
.device-card > svg { width: 48px; height: 58px; color: var(--accent); }
.device-card h3 { margin: 0 0 10px; }
.device-card .device-link { display: inline-flex; min-height: 44px; align-items: center; margin-top: 12px; color: var(--accent); font-weight: var(--weight-strong); }
.article-card { display: flex; flex-direction: column; gap: 16px; }
.article-card h3 { margin: 0; font-size: var(--size-intro); line-height: 1.5; }
.article-card p { flex-grow: 1; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: var(--size-xs); color: var(--text-muted); }
.article-card > a:last-child { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); font-weight: var(--weight-strong); }
.callout { padding: 22px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--r-md); background: var(--bg-panel); color: var(--text); }
.callout p + p { margin-top: 12px; }
.callout--warning { border-left-color: var(--warn); }
.callout-title { display: block; margin-bottom: 8px; font-weight: var(--weight-strong); }

/* Deliberately available only by explicit markup on article pages. */
.dl-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  min-height: 56px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--accent-dark);
  box-shadow: var(--shadow-float);
  font-size: var(--size-sm);
  font-weight: var(--weight-strong);
}
.dl-fab svg { width: 22px; height: 22px; }
.has-article-fab { padding-bottom: 88px; }

.table-scroll { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--size-sm); }
.data-table th, .data-table td,
.prose table th, .prose table td {
  min-width: 7em;
  padding: 14px 18px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}
.data-table th, .prose table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-strong); }
.data-table td, .prose table td { background: var(--bg); color: var(--text); }
.prose table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  overscroll-behavior-inline: contain;
}
.data-table code, .prose table code { overflow-wrap: anywhere; white-space: normal; }

/* Preview-only furniture, kept external to the demonstration document. */
.preview-section { padding-top: 72px; padding-bottom: 72px; }
.preview-section h2 { margin-top: 0; }
.preview-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { padding: 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); color: var(--text); min-width: 0; }
.swatch-chip { height: 64px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.swatch code { font-size: var(--size-xs); }
.swatch-bg { background: var(--bg); color: var(--text); }
.swatch-panel { background: var(--bg-panel); color: var(--text); }
.swatch-panel-2 { background: var(--bg-panel-2); color: var(--text); }
.swatch-border { background: var(--border); color: var(--text); }
.swatch-accent { background: var(--accent); color: var(--on-accent); }
.swatch-dark { background: var(--accent-dark); color: var(--on-accent); }
.swatch-text { background: var(--text); color: var(--on-accent); }
.swatch-muted { background: var(--text-muted); color: var(--on-accent); }
.swatch-success { background: var(--success); color: var(--on-accent); }
.swatch-warn { background: var(--warn); color: var(--text); }
.swatch-error { background: var(--error); color: var(--on-accent); }
.swatch-soft { background: var(--accent-soft); color: var(--text); }
.swatch-faint { background: var(--accent-faint); color: var(--text); }
.swatch-success-soft { background: var(--success-soft); color: var(--text); }
.swatch-veil { background: var(--veil); color: var(--text); }
.shot-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 750 / 1334;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-shot);
  background: var(--bg-panel);
  color: var(--text-muted);
  text-align: center;
  font-size: var(--size-sm);
}
.preview-type h1 { margin-top: 0; }
.preview-footer { margin-top: 0; }

@media (min-width: 1200px) {
  .rig-floats { display: contents; }
}
@media (max-width: 1399px) {
  .rig { width: 740px; }
  .ln { grid-template-columns: 52px minmax(0, 320px) 1fr; }
}
@media (max-width: 1199px) {
  .rig { width: auto; max-width: 760px; margin-left: auto; margin-right: auto; padding-bottom: 0; }
  .float { position: relative; left: auto; right: auto; top: auto; bottom: auto; width: auto; }
  .rig-floats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
  .feature-tabs { gap: 24px; }
}
@media (max-width: 768px) {
  .feature-tabs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .feature-index[role="tablist"] { flex-direction: row; overflow-x: auto; padding-bottom: 8px; }
  .feature-tab { width: 200px; flex-shrink: 0; }
  .feature-panel { padding: 28px; min-height: 0; }
  .preview-palette { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .store-cta-card { grid-template-columns: minmax(0, 1fr); }
  .peek { margin: 24px 12px 0; padding: 48px 20px 72px; }
  .rig { margin-left: 16px; margin-right: 16px; }
  .ln { grid-template-columns: 40px 1fr; min-width: 390px; }
  .paper-body { background: linear-gradient(to right, var(--bg-panel) 0 40px, var(--border) 40px 41px, var(--transparent) 41px); color: var(--text); font-size: var(--size-code-sm); }
  .ln--final::before { left: 39px; }
  .ln-code { padding-left: 12px; }
  .ln-note { display: none; }
  .rig-floats { grid-template-columns: minmax(0, 1fr); }
  .paper, .paper-under { transform: none; }
  .paper-head { flex-wrap: wrap; gap: 6px 10px; }
}
@media (max-width: 640px) {
  .feature-note { transform: none; }
  .shot-row { flex-direction: column; align-items: center; }
  .official-shot { flex-shrink: 0; }
  .fact-row { flex-direction: row; flex-wrap: wrap; }
  .device-card { grid-template-columns: 40px minmax(0, 1fr); }
  .device-card > svg { width: 36px; height: 48px; }
  .preview-section { padding-top: 48px; padding-bottom: 48px; }
}