:root {
  color-scheme: light;
  --paper: #ebe8df;
  --surface: #fffdf7;
  --soft: #dfe2dc;
  --ink: #171816;
  --muted: #6c736d;
  --line: #c5cbc3;
  --red: #ff6049;
  --lime: #aaff2c;
  --blue: #6874f7;
  --purple: #8d5cf6;
  --yellow: #ffd967;
  --green: #07876f;
  --mono: "IBM Plex Mono", monospace;
  --sans: "DM Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
button, input { font: inherit; }
button { color: inherit; }
.page { width: min(100% - 36px, 1600px); margin-inline: auto; padding: 20px 0 44px; }

.hero { min-height: 250px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; padding: 0 12px 28px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--green); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.eyebrow i { position: relative; width: 18px; height: 18px; border: 2px solid var(--blue); border-radius: 4px; box-shadow: 5px 5px 0 var(--lime); }
.eyebrow i::after { content: ""; position: absolute; inset: 4px -8px -8px 4px; border: 2px solid var(--red); border-radius: 4px; }
h1 { margin: 14px 0 0; font-size: clamp(54px, 7.4vw, 118px); line-height: .88; letter-spacing: 0; white-space: nowrap; }
.lead { margin: 18px 0 0; color: var(--muted); font-size: 20px; font-weight: 800; }
.lead code { padding: 3px 7px; border-radius: 8px; color: white; background: var(--red); font-family: var(--mono); font-size: .8em; }
.lead strong { color: var(--ink); }
.hero-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-bottom: 2px; }
.support-chip, .top-button { min-height: 46px; padding: 0 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-size: 11px; font-weight: 800; white-space: nowrap; }
.support-chip { display: inline-flex; align-items: center; color: var(--green); background: #e4fff6; }
.top-button { cursor: pointer; }
.top-button:hover { border-color: var(--ink); }
.top-button.dark { color: white; background: var(--ink); border-color: var(--ink); }

.inspector-shell, .bookmarklet-panel, .trigger-panel, .code-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 28px; background: var(--surface); }
.section-heading { min-height: 94px; display: flex; align-items: center; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); }
.section-number { flex: 0 0 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; color: white; background: var(--red); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.section-heading p, .panel-heading p { margin: 0; color: var(--green); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.section-heading h2 { margin: 4px 0 0; font-size: clamp(22px, 2vw, 32px); line-height: 1.1; }
.heading-metrics { display: flex; gap: 8px; margin-left: auto; }
.heading-metrics span { padding: 10px 13px; border-radius: 999px; color: var(--muted); background: #f0f1ec; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.heading-metrics span.danger { color: white; background: var(--red); }
.heading-metrics i { margin-right: 4px; color: var(--blue); font-style: normal; }
.heading-metrics .danger i { color: white; }

.inspector-layout { display: grid; grid-template-columns: 292px minmax(520px, 1fr) 310px; min-height: 840px; }
.controls { border-right: 1px solid var(--line); background: #f6f3eb; }
.control-section { padding: 22px 20px 24px; border-bottom: 1px solid var(--line); }
.control-section:last-child { border-bottom: 0; }
.control-kicker { margin: 0; color: var(--green); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .13em; }
.control-section h3 { margin: 6px 0 15px; font-size: 16px; }
.preset-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-list button { min-width: 0; min-height: 55px; display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 0 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); cursor: pointer; text-align: left; }
.preset-list button:first-child { grid-column: 1 / -1; }
.preset-list button span { grid-row: 1 / 3; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #e9ece6; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.preset-list button b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.preset-list button small { color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.preset-list button[aria-pressed="true"] { color: white; border-color: var(--ink); background: var(--ink); }
.preset-list button[aria-pressed="true"] span { color: var(--ink); background: var(--lime); }
.preset-list button[aria-pressed="true"] small { color: #afb6b0; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #e8eae5; }
.mode-switch button { min-height: 38px; border: 0; border-radius: 8px; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.mode-switch button[aria-pressed="true"] { color: white; background: var(--blue); }
.control-check { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 11px; margin-top: 16px; cursor: pointer; }
.control-check input { width: 36px; height: 21px; margin: 0; appearance: none; border: 1px solid var(--line); border-radius: 999px; background: #bbc1ba; cursor: pointer; }
.control-check input::after { content: ""; display: block; width: 15px; height: 15px; margin: 2px; border-radius: 50%; background: white; transition: transform .18s ease; }
.control-check input:checked { background: var(--blue); }
.control-check input:checked::after { transform: translateX(15px); }
.control-check b, .control-check small { display: block; }
.control-check b { font-size: 11px; }
.control-check small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; font-weight: 700; }
.action-section > p:not(.control-kicker) { margin: -4px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.55; font-weight: 700; }
.scan-button, .fix-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--ink); border-radius: 12px; font-size: 12px; font-weight: 900; cursor: pointer; }
.scan-button { color: var(--ink); background: var(--lime); box-shadow: 0 5px 0 var(--ink); }
.scan-button:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.scan-button span { font-size: 18px; }
.fix-button { margin-top: 12px; color: white; background: var(--blue); }
.fix-button.is-active { color: var(--ink); background: var(--yellow); }

.workspace { min-width: 0; display: grid; grid-template-rows: 54px minmax(0, 1fr); padding: 16px; background: var(--soft); }
.browser-bar { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border: 1px solid #b9c0b8; border-radius: 17px 17px 0 0; background: #d2d6cf; }
.browser-address, .browser-state { display: flex; align-items: center; min-width: 0; }
.browser-address { gap: 7px; color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.browser-address i { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.browser-address i:nth-child(2) { background: var(--yellow); }
.browser-address i:nth-child(3) { background: #55c99f; }
.browser-address span { overflow: hidden; margin-left: 4px; text-overflow: ellipsis; white-space: nowrap; }
.browser-state { gap: 7px; font-family: var(--mono); font-size: 9px; font-weight: 700; }
.browser-state span, .browser-state strong { padding: 7px 10px; border-radius: 999px; color: white; background: var(--green); }
.browser-state strong { background: var(--red); }
.browser-state strong[data-state="safe"] { color: var(--ink); background: var(--lime); }

.scene-stage { position: relative; min-height: 750px; overflow: hidden; border: 1px solid #b9c0b8; border-radius: 0 0 17px 17px; background-color: #f8f6ef; background-image: linear-gradient(rgb(23 24 22 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(23 24 22 / 5%) 1px, transparent 1px); background-size: 26px 26px; perspective: 1500px; }
.depth-scale { position: absolute; z-index: 40; top: 18px; left: 18px; display: none; align-items: center; gap: 7px; color: var(--muted); font-family: var(--mono); font-size: 8px; font-weight: 700; }
.depth-scale i { width: 74px; height: 8px; background: linear-gradient(90deg, var(--red), var(--purple), var(--blue)); clip-path: polygon(0 50%, 100% 0, 100% 100%); }
.scene[data-view="layers"] ~ .stage-help { color: var(--blue); }
.scene-stage:has(.scene[data-view="layers"]) .depth-scale { display: flex; }
.scene { position: absolute; inset: 34px 38px 58px; display: grid; place-items: center; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.demo-page { position: relative; width: min(100%, 830px); height: 610px; overflow: hidden; border: 2px solid var(--ink); border-radius: 18px; background: #f9f5eb; box-shadow: 12px 14px 0 rgb(23 24 22 / 13%); font-family: var(--sans); transform: translateZ(0); transform-style: preserve-3d; transition: transform .5s ease, box-shadow .5s ease; }
.scene[data-view="layers"] { transform: translateY(42px) rotateX(55deg) rotateZ(-24deg) scale(.72); }
.scene[data-view="layers"] .demo-page { overflow: visible; box-shadow: 24px 34px 0 rgb(23 24 22 / 10%); }
.scene[data-view="layers"] .demo-card-grid { transform-style: preserve-3d; }
.scene[data-view="layers"] .context-node[data-context="true"] { transform: translateZ(calc(var(--depth) * 18px)); box-shadow: 0 12px 26px rgb(23 24 22 / 12%); }
.context-node { transform-style: preserve-3d; transition: transform .5s ease, outline-color .18s ease, box-shadow .18s ease; }
.scene[data-labels="true"] .context-node[data-context="true"] { outline: 2px solid var(--purple); outline-offset: -2px; }
.scene[data-labels="true"] .context-node[data-context="true"]::before { content: attr(data-context-label); position: absolute; z-index: 99; top: 7px; left: 7px; padding: 4px 6px; border-radius: 999px; color: white; background: var(--purple); font-family: var(--mono); font-size: 7px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.scene .context-node.is-selected { outline: 5px solid var(--red) !important; outline-offset: -5px; }
.scene .context-node.is-selected::before { color: white !important; background: var(--red) !important; }
.scene.is-scanning .context-node[data-context="true"] { animation: context-flash .55s ease 2; }
@keyframes context-flash { 50% { filter: brightness(1.25); outline-width: 7px; } }

.demo-site-header { position: absolute; z-index: 10; inset: 0 0 auto; height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 2px solid var(--ink); background: #f9f5eb; font-family: var(--mono); font-size: 8px; font-weight: 700; }
.demo-site-header a { color: inherit; text-decoration: none; }
.demo-site-header nav { display: flex; align-items: center; gap: 16px; }
.demo-site-header button { min-height: 29px; padding: 0 10px; border: 0; border-radius: 999px; color: white; background: var(--ink); font-size: 8px; font-weight: 700; }
.demo-site-shell { position: absolute; inset: 62px 0 0; background: #f9f5eb; }
.demo-hero { position: relative; min-height: 314px; overflow: hidden; padding: 38px 35px; border-bottom: 2px solid var(--ink); background: var(--lime); }
.demo-hero > p { position: relative; z-index: 2; margin: 0; font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.demo-hero h3 { position: relative; z-index: 2; margin: 23px 0 20px; font-size: 55px; line-height: .83; letter-spacing: 0; text-transform: uppercase; }
.demo-hero button { position: relative; z-index: 2; min-height: 38px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: #f9f5eb; font-size: 9px; font-weight: 900; }
.hero-orbit { position: absolute; right: 45px; top: 48px; width: 215px; height: 215px; border: 3px solid var(--ink); border-radius: 50%; background: var(--blue); }
.hero-orbit i { position: absolute; inset: 28px; border: 3px solid var(--ink); border-radius: 50%; background: var(--red); }
.hero-orbit b { position: absolute; right: 18px; top: 18px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ink); font-family: var(--mono); font-size: 9px; }
.demo-card-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
.demo-card { position: relative; min-height: 148px; padding: 20px; border: 2px solid var(--ink); border-radius: 14px; background: var(--surface); }
.demo-card:nth-child(2) { z-index: 2; background: var(--blue); }
.demo-card span { font-family: var(--mono); font-size: 8px; font-weight: 700; }
.demo-card h4 { margin: 19px 0 0; font-size: 24px; line-height: .92; }
.demo-card button { position: absolute; right: 14px; bottom: 14px; border: 0; background: transparent; font-size: 9px; font-weight: 800; text-decoration: underline; }
.bug-tooltip { position: absolute; z-index: 999; top: 54px; left: calc(100% - 56px); width: 172px; min-height: 48px; display: none; place-items: center; border: 2px solid var(--ink); border-radius: 10px; color: white; background: var(--red); font-family: var(--mono); font-size: 8px; font-weight: 700; }
.bug-popover-wrap { position: absolute; z-index: 0; left: calc(50% - 75px); bottom: 26px; display: none; opacity: .98; }
.bug-popover-wrap > button { min-height: 36px; border: 2px solid var(--ink); border-radius: 999px; background: var(--yellow); font-size: 9px; font-weight: 900; }
.bug-popover { position: absolute; z-index: 1000; left: 90px; bottom: 18px; width: 155px; display: grid; gap: 8px; padding: 14px; border: 2px solid var(--ink); border-radius: 12px; background: var(--surface); font-size: 9px; }
.bug-popover b { font-size: 11px; }
.bug-fixed { position: fixed; z-index: 9999; right: 22px; bottom: 20px; width: 150px; min-height: 62px; display: none; align-items: center; gap: 8px; padding: 11px; border: 2px solid var(--ink); border-radius: 13px; color: white; background: var(--red); }
.bug-fixed b { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--lime); font-size: 8px; }
.bug-fixed span { font-size: 9px; font-weight: 800; }
.bug-modal { position: absolute; z-index: 9999; inset: 0; display: none; place-items: center; padding: 26px; background: rgb(23 24 22 / 72%); }
.modal-dialog { position: relative; width: min(100%, 405px); padding: 26px; border: 2px solid var(--ink); border-radius: 16px; background: var(--surface); box-shadow: 9px 9px 0 var(--red); }
.modal-dialog > span { color: var(--green); font-family: var(--mono); font-size: 8px; font-weight: 700; }
.modal-dialog > button { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border: 0; border-radius: 50%; color: white; background: var(--ink); font-size: 18px; }
.modal-dialog h4 { margin: 18px 0 11px; font-size: 33px; line-height: .9; }
.modal-dialog p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; font-weight: 700; }
.modal-dialog > b { display: inline-block; margin-top: 17px; font-size: 10px; }
.isolation-demo { position: absolute; inset: 34px; display: none; overflow: hidden; padding: 36px; border: 2px solid var(--ink); border-radius: 20px; background: var(--yellow); isolation: isolate; }
.isolation-demo i { position: absolute; z-index: -1; border-radius: 50%; }
.isolation-demo i:first-child { width: 310px; height: 310px; right: -45px; top: -80px; background: var(--blue); }
.isolation-demo i:nth-child(2) { width: 240px; height: 240px; right: 80px; bottom: -110px; background: var(--red); }
.isolation-demo b, .isolation-demo p { position: relative; z-index: 1; display: block; max-width: 330px; }
.isolation-demo b { margin-top: 115px; font-family: var(--mono); font-size: 14px; }
.isolation-demo p { margin: 13px 0 0; font-size: 24px; line-height: 1.15; font-weight: 900; }

.scene[data-scenario="modal"] .bug-modal { display: grid; }
.scene:not([data-view="layers"])[data-scenario="modal"] .demo-site-shell { transform: translateZ(0); }
.scene[data-scenario="tooltip"] .bug-tooltip { display: grid; }
.scene[data-scenario="tooltip"] .demo-card:first-child { z-index: 0; }
.scene:not([data-view="layers"])[data-scenario="tooltip"] .demo-card:first-child { transform: translateZ(0); }
.scene[data-scenario="popover"] .bug-popover-wrap { display: block; }
.scene[data-scenario="popover"] .demo-card:nth-child(2) { z-index: 2; }
.scene[data-scenario="fixed"] .bug-fixed { display: flex; }
.scene:not([data-view="layers"])[data-scenario="fixed"] .demo-site-shell { transform: translateZ(0); }
.scene[data-scenario="isolated"] .demo-hero, .scene[data-scenario="isolated"] .demo-card-grid { display: none; }
.scene[data-scenario="isolated"] .isolation-demo { display: block; }

.scene.is-fixed[data-scenario="modal"] .bug-modal { animation: resolved-modal .28s cubic-bezier(.2,.75,.25,1); }
.scene[data-view="layers"].is-fixed[data-scenario="modal"] .bug-modal { --depth: 9 !important; }
.scene.is-fixed[data-scenario="tooltip"] .demo-card:first-child { z-index: 3; }
.scene[data-view="layers"].is-fixed[data-scenario="tooltip"] .demo-card:first-child { --depth: 4 !important; }
.scene.is-fixed[data-scenario="popover"] .bug-popover-wrap { z-index: 3; opacity: 1; }
.scene[data-view="layers"].is-fixed[data-scenario="popover"] .bug-popover-wrap { --depth: 4 !important; }
.scene.is-fixed[data-scenario="fixed"] .demo-site-shell { transform: none; }
.scene[data-view="layers"].is-fixed[data-scenario="fixed"] .bug-fixed { --depth: 9 !important; }
.scene.is-fixed[data-scenario="isolated"] .isolation-demo { isolation: isolate; }

@keyframes resolved-modal {
  from { opacity: .72; }
  to { opacity: 1; }
}

.stage-help { position: absolute; z-index: 50; right: 18px; bottom: 14px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }

.diagnosis { min-width: 0; border-left: 1px solid var(--line); background: #20231f; color: white; }
.diagnosis-heading { min-height: 90px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px; border-bottom: 1px solid #3b403b; }
.diagnosis-heading p, .diagnosis-section > p:first-child { margin: 0; color: #8d9690; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .11em; }
.diagnosis-heading h3 { overflow: hidden; margin: 5px 0 0; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.diagnosis-heading > span { flex: 0 0 auto; padding: 7px 9px; border-radius: 999px; color: white; background: var(--red); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.diagnosis-heading > span[data-state="safe"] { color: var(--ink); background: var(--lime); }
.diagnosis-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #3b403b; }
.diagnosis-summary div { min-width: 0; padding: 15px 10px; border-right: 1px solid #3b403b; }
.diagnosis-summary div:last-child { border-right: 0; }
.diagnosis-summary span { display: block; color: #8d9690; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.diagnosis-summary b { display: block; overflow: hidden; margin-top: 6px; color: var(--lime); font-family: var(--mono); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.diagnosis-section { padding: 17px; border-bottom: 1px solid #3b403b; }
.context-tree { display: grid; gap: 6px; margin-top: 13px; }
.competing-context { margin-top: 15px; padding-top: 13px; border-top: 1px solid #3b413c; }
.competing-context > p { color: #a5ada6 !important; }
.competing-context[hidden] { display: none; }
.tree-node { --indent: 0; width: 100%; min-width: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px 8px 8px calc(8px + var(--indent) * 11px); border: 1px solid #454c46; border-radius: 9px; color: white; background: #292d29; cursor: pointer; text-align: left; }
.tree-node.is-current { border-color: var(--red); background: #3a2925; }
.tree-node > span { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: var(--ink); background: var(--purple); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.tree-node b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tree-node small { color: var(--lime); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.reason-section h4 { margin: 12px 0 7px; color: var(--lime); font-size: 15px; line-height: 1.25; }
.reason-section > p:last-child { margin: 0; color: #bcc4bd; font-size: 10px; line-height: 1.55; font-weight: 700; }
.fix-section pre { min-height: 84px; overflow: auto; margin: 12px 0; padding: 12px; border: 1px solid #454c46; border-radius: 10px; color: #f4f5f2; background: #151815; font-family: var(--mono); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.fix-section button { width: 100%; min-height: 39px; border: 0; border-radius: 9px; color: var(--ink); background: var(--lime); font-size: 10px; font-weight: 900; cursor: pointer; }

.bookmarklet-panel { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(430px, .95fr); margin-top: 18px; }
.bookmarklet-intro { padding: 28px; color: white; background: var(--purple); }
.bookmarklet-intro > p:first-child { margin: 0; color: var(--lime); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.bookmarklet-intro h2 { margin: 7px 0 0; font-size: clamp(25px, 2.5vw, 38px); line-height: 1.12; }
.bookmarklet-lead { margin: 11px 0 0; color: #f1ebff; font-size: 12px; line-height: 1.55; font-weight: 700; }
.bookmarklet-action { min-height: 105px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-top: 24px; padding: 15px; border: 2px solid var(--ink); border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 6px 6px 0 var(--ink); }
.bookmarklet-action > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: white; background: var(--red); font-size: 22px; font-weight: 900; }
.bookmarklet-action b, .bookmarklet-action small { display: block; }
.bookmarklet-action b { font-size: 13px; }
.bookmarklet-action small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; font-weight: 700; }
.bookmarklet-action a { min-height: 52px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 2px solid var(--ink); border-radius: 13px; color: white; background: var(--purple); box-shadow: 0 5px 0 var(--ink); font-size: 12px; font-weight: 900; text-decoration: none; white-space: nowrap; cursor: grab; }
.bookmarklet-action a:active { cursor: grabbing; transform: translateY(3px); box-shadow: 0 2px 0 var(--ink); }
.bookmarklet-guide { display: flex; flex-direction: column; padding: 25px; background: #f6f3eb; }
.bookmarklet-guide ol { display: grid; gap: 12px; margin: 0; padding: 0 0 18px; list-style: none; }
.bookmarklet-guide li { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 12px; }
.bookmarklet-guide li > span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; color: var(--purple); background: white; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.bookmarklet-guide li b { font-size: 12px; }
.bookmarklet-guide li p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; font-weight: 700; }
.bookmarklet-fallback { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: auto; padding-top: 19px; border-top: 1px solid var(--line); }
.bookmarklet-fallback b { font-size: 11px; }
.bookmarklet-fallback p { max-width: 380px; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; font-weight: 700; }
.bookmarklet-fallback button { flex: 0 0 auto; min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; color: white; background: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; }
.bookmarklet-scope { margin: 12px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; font-weight: 700; }

.details-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; margin-top: 18px; }
.trigger-panel, .code-panel { min-height: 520px; padding: 24px; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 25px; }
.panel-heading > span { padding: 8px 10px; border-radius: 999px; color: var(--purple); background: #eee8ff; font-family: var(--mono); font-size: 10px; font-weight: 700; }
.panel-heading button { min-height: 38px; padding: 0 13px; border: 0; border-radius: 10px; color: white; background: var(--ink); font-size: 10px; font-weight: 800; cursor: pointer; }
.trigger-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 24px; }
.trigger-grid > * { min-height: 92px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f7f5ee; text-align: left; }
.trigger-grid button { cursor: pointer; }
.trigger-grid button:hover { border-color: var(--purple); background: #f2edff; }
.trigger-grid code { color: var(--purple); font-family: var(--mono); font-size: 11px; font-weight: 700; }
.trigger-grid span { margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }
.trigger-note { margin: 18px 2px 0; padding: 14px; border-left: 4px solid var(--lime); color: var(--muted); background: #f3f5ef; font-size: 11px; line-height: 1.55; font-weight: 700; }
.code-tabs { display: flex; gap: 4px; margin-top: 22px; padding: 4px; border-radius: 11px; background: #e8eae5; }
.code-tabs button { flex: 1; min-height: 37px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 700; cursor: pointer; }
.code-tabs button[aria-selected="true"] { color: white; background: var(--purple); }
.code-panel > pre { height: 315px; overflow: auto; margin: 12px 0 0; padding: 19px; border: 1px solid #333a35; border-radius: 14px; color: #eaf1ea; background: #151816; font-family: var(--mono); font-size: 11px; line-height: 1.65; tab-size: 2; }
.code-panel pre code { font: inherit; }
.code-note { margin: 13px 3px 0; color: var(--muted); font-size: 10px; line-height: 1.45; font-weight: 700; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 30px 8px 0; color: var(--muted); font-family: var(--mono); font-size: 10px; font-weight: 700; }
.page-footer p { margin: 0; }
.page-footer div { display: flex; align-items: center; gap: 16px; }
.page-footer a { color: inherit; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 1000; padding: 12px 16px; border: 2px solid var(--ink); border-radius: 12px; color: white; background: var(--ink); font-size: 11px; font-weight: 800; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .18s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .inspector-layout { grid-template-columns: 270px minmax(470px, 1fr); }
  .diagnosis { grid-column: 1 / -1; display: grid; grid-template-columns: 270px 1fr 1fr; border-top: 1px solid var(--line); border-left: 0; }
  .diagnosis-heading { border-right: 1px solid #3b403b; }
  .diagnosis-summary { border-right: 1px solid #3b403b; }
  .diagnosis-section { border-right: 1px solid #3b403b; }
  .diagnosis .fix-section { border-right: 0; }
  .context-tree { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 980px) {
  .hero { min-height: 0; display: block; padding-top: 30px; }
  h1 { font-size: clamp(47px, 9.8vw, 90px); }
  .hero-actions { justify-content: flex-start; margin-top: 20px; }
  .inspector-layout { display: block; }
  .controls { display: grid; grid-template-columns: 1fr 1fr 1fr; border-right: 0; border-bottom: 1px solid var(--line); }
  .control-section { border-right: 1px solid var(--line); }
  .workspace { min-height: 820px; }
  .diagnosis { display: grid; grid-template-columns: 1fr 1fr; }
  .diagnosis-heading, .diagnosis-summary { border-right: 0; }
  .diagnosis-heading { border-bottom: 1px solid #3b403b; }
  .diagnosis-summary { border-bottom: 1px solid #3b403b; }
  .diagnosis-section { border-right: 0; }
  .bookmarklet-panel, .details-grid { grid-template-columns: 1fr; }
  .bookmarklet-guide { min-height: 285px; }
  .trigger-panel, .code-panel { min-height: 0; }
}

@media (max-width: 680px) {
  .page { width: min(100% - 12px, 520px); padding-top: 10px; }
  .hero { padding: 18px 4px 20px; }
  h1 { margin-top: 12px; font-size: clamp(30px, 9.6vw, 58px); }
  .lead { margin-top: 13px; font-size: 14px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .support-chip { grid-column: 1 / -1; justify-content: center; }
  .support-chip, .top-button { min-height: 42px; padding-inline: 10px; font-size: 10px; }
  .inspector-shell, .bookmarklet-panel, .trigger-panel, .code-panel { border-radius: 20px; }
  .section-heading { min-height: 82px; gap: 11px; padding: 13px; }
  .section-number { flex-basis: 44px; height: 44px; }
  .section-heading h2 { font-size: 18px; }
  .heading-metrics { display: none; }
  .controls { display: block; }
  .control-section { border-right: 0; }
  .preset-list button:first-child { grid-column: auto; }
  .workspace { min-height: 700px; padding: 8px; grid-template-rows: 46px minmax(0, 1fr); }
  .browser-bar { padding-inline: 10px; }
  .browser-state span { display: none; }
  .scene-stage { min-height: 640px; overflow: auto; }
  .scene { inset: 30px 18px 60px; width: 650px; place-items: start; transform-origin: left top; }
  .demo-page { width: 650px; height: 540px; transform: scale(.71); transform-origin: left top; }
  .scene[data-view="layers"] { width: 650px; transform: translate(38px, 75px) rotateX(55deg) rotateZ(-24deg) scale(.52); }
  .scene[data-view="layers"] .demo-page { transform: none; }
  .stage-help { left: 14px; right: auto; max-width: 310px; }
  .diagnosis { display: block; }
  .diagnosis-heading, .diagnosis-summary, .diagnosis-section { border-right: 0; }
  .context-tree { grid-template-columns: 1fr; }
  .bookmarklet-intro, .bookmarklet-guide, .trigger-panel, .code-panel { padding: 20px 16px; }
  .bookmarklet-action { grid-template-columns: 36px minmax(0, 1fr); }
  .bookmarklet-action > span { width: 36px; height: 36px; }
  .bookmarklet-action a { grid-column: 1 / -1; width: 100%; }
  .bookmarklet-guide { min-height: 0; }
  .bookmarklet-fallback { display: block; }
  .bookmarklet-fallback button { width: 100%; margin-top: 12px; }
  .trigger-grid { grid-template-columns: 1fr; }
  .panel-heading { align-items: flex-start; }
  .panel-heading h2 { font-size: 21px; }
  .code-panel > pre { height: 380px; padding: 14px; font-size: 10px; }
  .page-footer { display: block; line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
