.tabs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.tabs > * { min-width: 0; }
.tabs [role="tablist"] { display: flex; flex-direction: column; gap: 6px; }
.tabs [role="tab"] {
  position: relative; width: 100%; min-height: 52px; padding: 13px 18px;
  background: var(--clear); color: var(--text-muted); border: 0;
  font-size: 16px; font-weight: var(--weight-normal); text-align: left;
}
.tabs [role="tab"]::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  background: var(--clear); color: var(--text);
}
.tabs [role="tab"][aria-selected="true"] { color: var(--text); font-weight: var(--weight-heavy); }
.tabs [role="tab"][aria-selected="true"]::before { background: var(--accent); color: var(--on-accent); }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tabpanel"] {
  min-width: 0; padding: 40px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-soft);
}
.tabs [role="tabpanel"]:not([hidden]) { animation: panel-opacity var(--duration-fast) var(--ease); }
.tabs [role="tabpanel"] h3 { font-weight: var(--weight-heavy); }
.tabs [role="tabpanel"] p { color: var(--text-muted); line-height: 1.85; }
.tabs [role="tabpanel"] pre { border: 0; }
@keyframes panel-opacity { from { opacity: .5; } to { opacity: 1; } }

.toc {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  margin-block: 28px 48px; padding: 18px;
  background: var(--bg-panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-card);
}
.toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 2px; font-size: 14px; text-decoration: none; }
.toc--sticky { position: sticky; top: calc(var(--header-h) + 12px); z-index: 5; }
.faq-item { padding-block: 22px; border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  position: relative; padding-right: 32px; font-weight: var(--weight-bold);
  cursor: pointer; list-style: none; min-height: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 2px; top: 0; color: var(--accent-dark); font-size: 22px; line-height: 1.2; }
.faq-item[open] summary::after { content: "−"; }
.faq-item__body { padding-top: 18px; max-width: 760px; color: var(--text-muted); }
.faq-item__body > :last-child { margin-bottom: 0; }
.term-card { scroll-margin-top: calc(var(--header-h) + 24px); }
.term-card__category { margin-bottom: 12px; font-size: 12px; color: var(--text-muted); }
.term-card h3 { font-family: var(--font-mono); font-size: 20px; overflow-wrap: anywhere; }
.term-card p { color: var(--text-muted); }
.term-card code { color: var(--text); }

.store-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 56px; max-width: 100%; padding: 10px 22px;
  border: 1px solid var(--clear); border-radius: var(--r-btn);
  background: var(--accent-dark); color: var(--on-accent); box-shadow: var(--shadow-btn);
  text-decoration: none; line-height: 1.2; transition: box-shadow var(--duration-fast) var(--ease);
}
.store-button:hover { background: var(--accent-dark); color: var(--on-accent); box-shadow: var(--shadow-ipad); }
.store-button svg { width: 26px; height: 28px; flex-shrink: 0; }
.store-button__copy { display: block; text-align: left; }
.store-button__top { display: block; margin-bottom: 3px; font-size: 11px; font-weight: var(--weight-medium); }
.store-button__bottom { display: block; font-size: 17px; font-weight: var(--weight-bold); }
.facts {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
  list-style: none; margin: 24px 0 0; padding: 0;
}
.facts li, .tag {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg); color: var(--text); font-size: 12px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.facts__key { color: var(--text-muted); }
.facts__dot { width: 6px; height: 6px; border-radius: var(--r-circle); background: var(--accent); color: var(--on-accent); flex-shrink: 0; }
.official-shots { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 32px; }
.official-shot { width: 100%; max-width: 280px; min-width: 0; margin: 0; flex-shrink: 0; }
.official-shot img { display: block; width: 100%; height: auto; border-radius: var(--r-shot); }
.official-shot { filter: none; }
.official-shot img, .shot-placeholder { outline: 1px solid var(--border); }
.official-shot figcaption { margin-top: 14px; font-size: 13px; line-height: 1.7; color: var(--text-muted); }
.shot-placeholder {
  width: 100%; aspect-ratio: 750 / 1334;
  display: grid; align-content: center; justify-items: center; gap: 12px;
  padding: 24px; text-align: center;
  background: var(--bg-panel); color: var(--text-muted); border-radius: var(--r-shot);
}
.shot-placeholder strong { color: var(--text); font-family: var(--font-mono); font-size: 22px; }
.device-card { display: flex; align-items: flex-start; gap: 24px; }
.device-card__icon { width: 44px; height: 58px; color: var(--text-muted); flex-shrink: 0; }
.device-card__body { min-width: 0; }
.device-card p { color: var(--text-muted); }
.device-card a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 14px; font-weight: var(--weight-bold); }
.article-card { display: flex; flex-direction: column; align-items: flex-start; }
.article-card .tag { margin-bottom: 24px; }
.article-card h3 { font-size: 21px; line-height: 1.5; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { color: var(--text-muted); }
.article-card__link { margin-top: auto; min-height: 44px; display: inline-flex; align-items: center; font-size: 14px; text-decoration: none; }
.callout {
  margin: 28px 0; padding: 22px 26px; background: var(--bg-panel-2); color: var(--text);
  border-left: 3px solid var(--accent); border-radius: var(--r-card); line-height: 1.8;
}
.callout > :last-child { margin-bottom: 0; }
.callout__title { display: block; margin-bottom: 6px; font-weight: var(--weight-heavy); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th, .data-table td, .prose table th, .prose table td, .reading table th, .reading table td {
  min-width: 7em; padding: 16px 20px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border); overflow-wrap: normal; word-break: normal;
}
.data-table th, .prose table th, .reading table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-bold); }
.data-table td, .prose table td, .reading table td { background: var(--bg); color: var(--text); }
.prose table, .reading table {
  display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  max-width: 100%; min-width: 0; border-collapse: collapse;
}
.data-table code, .prose table code, .reading table code { overflow-wrap: anywhere; white-space: normal; }
.dl-fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  z-index: var(--z-fab); display: inline-flex; align-items: center; gap: 10px;
  max-width: calc(100% - 40px); min-height: 52px; padding: 12px 18px;
  background: var(--bg); color: var(--accent-dark);
  border: 1px solid var(--border); border-radius: var(--r-btn); box-shadow: var(--shadow-ipad);
  font-size: 14px; font-weight: var(--weight-bold); text-decoration: none;
}
.dl-fab svg { width: 21px; height: 21px; flex-shrink: 0; }
.article-store { margin-top: 64px; }
.article-store p { max-width: 620px; color: var(--text-muted); }
.article-store .store-button { margin-top: 8px; }

.hero {
  position: relative; min-height: calc(900px - var(--header-h));
  padding: 40px 24px 0;
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
  background: var(--bg); color: var(--text);
}
.horizon { position: absolute; left: 0; right: 0; bottom: 0; height: 400px; z-index: 0; pointer-events: none; overflow: hidden; }
.horizon::before {
  content: ""; position: absolute; left: -50%; right: -50%; bottom: -40px; height: 680px;
  background-image: linear-gradient(var(--grid-line) 1px, var(--clear) 1px), linear-gradient(90deg, var(--grid-line) 1px, var(--clear) 1px);
  background-size: 64px 64px; background-position: center bottom;
  transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: radial-gradient(ellipse 46% 88% at 50% 100%, var(--mask-solid) 30%, var(--clear) 74%);
  mask-image: radial-gradient(ellipse 46% 88% at 50% 100%, var(--mask-solid) 30%, var(--clear) 74%);
}
.hero__copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 100%; }
.badge {
  display: inline-flex; align-items: center; gap: 9px; max-width: 100%;
  margin: 0; padding: 5px 13px 5px 11px;
  font-size: 13px; color: var(--text-muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r-pill); box-shadow: var(--shadow-soft);
}
.badge__dot { position: relative; width: 7px; height: 7px; border-radius: var(--r-circle); background: var(--accent); color: var(--on-accent); flex-shrink: 0; }
.badge__dot::after { content: ""; position: absolute; inset: -5px; border-radius: var(--r-circle); background: var(--accent-soft); color: var(--text); animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.55); opacity: 0; } 50% { transform: scale(1.2); opacity: 1; } }
.hero__title { margin: 22px 0 0; font-size: var(--fs-h1); font-weight: var(--weight-heavy); line-height: 1.12; letter-spacing: var(--tracking-title); color: var(--text); }
.hero__title em { font-style: normal; color: var(--accent); }
.hero__lead { margin: 20px 0 0; max-width: 820px; font-size: 16px; line-height: 1.6; color: var(--text-muted); }
.hero__lead strong { color: var(--text); }
.proto-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.proto-row li { font-family: var(--font-mono); font-size: 12px; line-height: 1.4; color: var(--text); padding: 4px 11px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-pill); max-width: 100%; overflow-wrap: anywhere; }
.proto-row .proto-row__label { font-family: var(--font-body); color: var(--text-muted); border-color: var(--clear); background: var(--clear); padding-right: 2px; }
.device-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 22px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--text); }
.device-row li, .device-row a { display: inline-flex; align-items: center; gap: 6px; }
.device-row a { color: var(--text); text-decoration: none; min-height: 28px; }
.device-row a:hover { color: var(--accent-dark); }
.device-row svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.device-row .device-row__sep { width: 1px; height: 14px; background: var(--border); color: var(--text); }
.device-row .store-pill { gap: 5px; padding: 3px 11px 3px 9px; border: 1px solid var(--border); border-radius: var(--r-pill); font-weight: 600; }

.rig { position: relative; z-index: 1; width: 656px; height: 432px; margin: 32px 0 0; flex-shrink: 0; }
.rig::after { content: ""; position: absolute; z-index: -1; left: 4%; right: 2%; bottom: -20px; height: 40px; background: radial-gradient(ellipse at center, var(--floor-shadow), var(--clear) 70%); }
.ipad { position: absolute; top: 0; left: 96px; width: 560px; height: 410px; padding: 14px; background: var(--bg); color: var(--text); border: 1.5px solid var(--device-line); border-radius: var(--r-ipad); box-shadow: var(--shadow-ipad); }
.ipad::before { content: ""; position: absolute; top: 4.5px; left: 50%; width: 4px; height: 4px; border-radius: var(--r-circle); background: var(--device-line); transform: translateX(-50%); }
.ipad::after { content: ""; position: absolute; top: -3.5px; right: 74px; width: 34px; height: 2px; border-radius: var(--r-hardware); background: var(--device-line); }
.ipad__screen { position: relative; width: 100%; height: 100%; border-radius: var(--r-screen); background: var(--bg-panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--hairline); overflow: hidden; }
.manual__head { display: flex; justify-content: space-between; margin: 0 22px; padding: 15px 22px 9px 4px; border-bottom: 1px solid var(--hairline); font-size: 9.5px; letter-spacing: .14em; color: var(--text-muted); }
.manual__body { padding: 20px 46px 0 84px; }
.manual__title { margin: 0; font-size: 17px; font-weight: var(--weight-heavy); letter-spacing: -.02em; line-height: 1.3; color: var(--text); }
.manual__sub { margin: 5px 0 0; font-size: 11px; line-height: 1.5; color: var(--text-muted); }
.rules { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: ln; border-top: 1px solid var(--hairline); }
.rules li { counter-increment: ln; display: flex; align-items: center; height: 27px; border-bottom: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 11.5px; color: var(--text); }
.rules li::before { content: counter(ln); flex-shrink: 0; width: 28px; height: 100%; padding-right: 8px; margin-right: 12px; line-height: 26px; text-align: right; font-size: 10px; color: var(--text-muted); background: var(--bg-panel); }
.rules code { font: inherit; white-space: nowrap; }
.rules .kw { color: var(--accent-dark); font-weight: 600; }
.rules .sec { font-weight: var(--weight-bold); }
.rules .is-comment code { color: var(--text-muted); }
.manual__note { margin: 12px 0 0; max-width: 370px; font-size: 11px; line-height: 1.6; color: var(--text-muted); }
.manual__note b { color: var(--text); }
.manual__foot { position: absolute; left: 84px; right: 46px; bottom: 15px; display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--hairline); font-size: 9.5px; letter-spacing: .08em; color: var(--text-muted); }
.manual__foot span:last-child { font-family: var(--font-mono); letter-spacing: 0; }
.manual__tab { position: absolute; right: 0; top: 66px; width: 21px; padding: 12px 0; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl; font-size: 10px; font-weight: var(--weight-bold); letter-spacing: .24em; color: var(--text); background: var(--bg-panel); border: 1px solid var(--hairline); border-right: 0; border-radius: var(--r-tab); box-shadow: inset 2px 0 0 var(--accent); }
.iphone { position: absolute; left: 0; bottom: 0; z-index: 2; width: 176px; height: 352px; padding: 8px; background: var(--bg); color: var(--text); border: 1.5px solid var(--device-line); border-radius: var(--r-iphone); box-shadow: var(--shadow-iphone); }
.iphone::before, .iphone::after { content: ""; position: absolute; width: 2px; border-radius: var(--r-hardware); background: var(--device-line); }
.iphone::before { left: -3.5px; top: 86px; height: 26px; }
.iphone::after { right: -3.5px; top: 108px; height: 44px; }
.iphone__screen { position: relative; height: 100%; padding: 34px 9px 0; border-radius: var(--r-iphone-screen); background: var(--bg-panel); color: var(--text); box-shadow: inset 0 0 0 1px var(--hairline); overflow: hidden; }
.iphone__island { position: absolute; top: 9px; left: 50%; width: 46px; height: 13px; border-radius: var(--r-pill); background: var(--bg); color: var(--text); border: 1px solid var(--device-line); transform: translateX(-50%); }
.iphone__home { position: absolute; bottom: 7px; left: 50%; width: 52px; height: 4px; border-radius: var(--r-pill); background: var(--device-line); transform: translateX(-50%); }
.store-card { text-align: center; }
.store-card__icon { display: block; width: 44px; height: 44px; margin: 0 auto; border-radius: var(--r-circle); background: linear-gradient(150deg, var(--bg), var(--bg-panel-2)); color: var(--text); box-shadow: var(--shadow-icon); }
.store-card__name { margin: 8px 0 0; font-size: 13px; font-weight: var(--weight-heavy); letter-spacing: -.02em; line-height: 1.25; color: var(--text); }
.store-card__meta { margin: 2px 0 0; font-size: 9.5px; line-height: 1.3; color: var(--text-muted); }
.group-label { margin: 14px 0 5px 6px; font-size: 9px; line-height: 1; letter-spacing: .06em; color: var(--text-muted); }
.group { margin: 0; padding: 0; list-style: none; background: var(--bg); color: var(--text); border-radius: var(--r-card); box-shadow: var(--shadow-soft); }
.group li { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; }
.group li + li::before { content: ""; position: absolute; top: 0; left: 10px; right: 0; height: 1px; background: var(--hairline); }
.group__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.group__k { font-size: 8.5px; line-height: 1.3; color: var(--text-muted); }
.group__v { font-size: 10px; font-weight: 600; line-height: 1.3; color: var(--text); }
.group__v--mono { font-family: var(--font-mono); font-weight: var(--weight-medium); }
.group__chevron { flex-shrink: 0; color: var(--chevron); font-size: 14px; }
.group-foot { margin: 8px 6px 0; font-size: 8.5px; line-height: 1.45; color: var(--text-muted); }
.peek { padding-top: 160px; padding-bottom: 140px; text-align: center; }
.peek__title { margin: 10px 0 0; font-size: 30px; }
.peek__text { margin: 14px auto 0; max-width: 620px; color: var(--text-muted); }

.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { margin: 0; min-width: 0; }
.swatch__paint { display: block; height: 80px; border: 1px solid var(--border); border-radius: var(--r-card); }
.swatch figcaption { padding-top: 8px; font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.paint-bg { background: var(--bg); color: var(--text); }
.paint-panel { background: var(--bg-panel); color: var(--text); }
.paint-panel-2 { background: var(--bg-panel-2); color: var(--text); }
.paint-border { background: var(--border); color: var(--text); }
.paint-accent { background: var(--accent); color: var(--text); }
.paint-accent-dark { background: var(--accent-dark); color: var(--on-accent); }
.paint-text { background: var(--text); color: var(--on-accent); }
.paint-muted { background: var(--text-muted); color: var(--on-accent); }
.paint-success { background: var(--success); color: var(--text); }
.paint-warn { background: var(--warn); color: var(--text); }
.paint-error { background: var(--error); color: var(--text); }
.paint-hairline { background: var(--hairline); color: var(--text); }
.paint-device { background: var(--device-line); color: var(--text); }
.paint-grid { background: var(--grid-line); color: var(--text); }
.paint-chevron { background: var(--chevron); color: var(--text); }
.paint-white { background: var(--on-accent); color: var(--text); }
.paint-mask { background: var(--mask-solid); color: var(--on-accent); }
.paint-soft { background: var(--accent-soft); color: var(--text); }
.paint-floor { background: var(--floor-shadow); color: var(--text); }
.paint-veil { background: var(--veil); color: var(--text); }
.paint-clear { background: var(--clear); color: var(--text); }
.preview-stack > * + * { margin-top: 28px; }
.preview-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.type-sample { margin-top: 30px; }
.type-sample--h1 { font-size: var(--fs-h1); font-weight: var(--weight-heavy); line-height: 1.12; }
.type-sample--mono { font-family: var(--font-mono); font-size: 14px; }
.preview-caption { margin-top: 24px; font-size: 13px; color: var(--text-muted); }
.preview-footer-mark { width: 28px; height: 28px; }

@media (max-width: 900px) {
  .rig { transform: scale(.82); transform-origin: top center; margin-bottom: -78px; }
  .tabs { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
  .tabs [role="tabpanel"] { padding: 28px; }
  .swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero { min-height: 0; padding: 28px 18px 40px; }
  .hero__title { margin-top: 18px; }
  .cta-row { margin-top: 20px; }
  .hero__lead { font-size: 15px; }
  .device-row { gap: 12px 16px; }
  .rig { width: 560px; transform: scale(.6); margin: 28px 0 -173px; }
  .ipad { left: 0; }
  .iphone { left: auto; right: -30px; bottom: -34px; transform: scale(.62); transform-origin: bottom right; }
  .peek { padding-top: 120px; padding-bottom: 100px; }
  .peek__title { font-size: 24px; }
  .tabs { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tabs [role="tablist"] { gap: 0; }
  .tabs [role="tab"] { min-height: 46px; padding-block: 11px; font-size: 14px; }
  .tabs [role="tabpanel"] { padding: 24px; }
  .toc--sticky { position: static; }
  .official-shots { flex-direction: column; align-items: center; }
  .facts { flex-direction: row; gap: 6px; }
  .facts li { font-size: 11px; padding: 4px 9px; }
  .device-card { gap: 18px; }
  .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .callout { padding: 20px; }
}
@media (max-width: 380px) {
  .rig { transform: scale(.48); margin-bottom: -225px; }
}
@media (prefers-reduced-motion: reduce) {
  .badge__dot::after { animation: none; opacity: .6; transform: none; }
  .tabs [role="tabpanel"]:not([hidden]) { animation: none; }
}