/* Agent door page only. Shared pieces live in styles.css. Everything here is .pa- prefixed. */

/* ---------- hero ---------- */
.pa-hero .lead { max-width: 50ch; }
.pa-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.pa-hero__hosts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pa-hero__hosts li { padding: 6px 13px; border-radius: 999px; background: var(--page); border: 1px solid var(--line-soft); font-size: 0.84rem; font-weight: 550; color: var(--ink); letter-spacing: -0.01em; }

/* small pill buttons used across the page */
.pa-mini { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--hover); color: var(--ink); font-size: 0.84rem; font-weight: 600; flex: none; transition: background 0.2s, transform 0.35s var(--ease); }
.pa-mini:hover { background: var(--line-soft); }
.pa-mini:active { transform: scale(0.97); }
.pa-mini svg { width: 15px; height: 15px; }

/* ---------- 2. one picture ---------- */
.pa-map { position: relative; background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-md); padding: clamp(22px, 3.4vw, 48px); overflow: hidden; }
.pa-map__grid {
  display: grid; align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(28px, 0.7fr) minmax(0, 1.25fr) minmax(28px, 0.7fr) minmax(0, 1fr);
  grid-template-rows: auto 64px auto;
  grid-template-areas: "a l1 g l2 e" ". . v . ." ". . y . .";
}
.pa-node { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 20px 14px; border-radius: 20px; background: var(--inset); color: var(--ink); min-width: 0; transition: box-shadow 0.4s var(--ease), background 0.4s; }
@supports (corner-shape: squircle) { .pa-node { corner-shape: squircle; border-radius: 34px; } }
.pa-node b { font-size: clamp(1rem, 1.4vw, 1.2rem); letter-spacing: -0.02em; font-weight: 620; }
.pa-node small { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.pa-node__ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--page); color: var(--ink); box-shadow: var(--shadow-sm); }
.pa-node__ic svg { width: 21px; height: 21px; }
.pa-node__ic--brand { background: var(--accent); color: #fff; }
.pa-node--a { grid-area: a; }
.pa-node--e { grid-area: e; }
.pa-node--y { grid-area: y; }
.pa-node--g { grid-area: g; padding: 28px 18px; background: var(--ink); color: var(--canvas); box-shadow: var(--shadow-lg); }
.pa-node--g small { color: color-mix(in srgb, var(--canvas) 72%, transparent); }
.pa-node--g .pa-node__ic { width: 52px; height: 52px; background: var(--accent); color: #fff; box-shadow: none; }
.pa-node--g .pa-node__ic svg { width: 25px; height: 25px; }
.pa-node--g b { font-size: clamp(1.2rem, 1.9vw, 1.6rem); }
.pa-node__say:empty { visibility: hidden; }
.pa-node__say { display: inline-flex; align-items: center; height: 24px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.04em; padding: 0 10px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; transition: background 0.3s, color 0.3s; }
.pa-node--g .pa-node__say { background: color-mix(in srgb, var(--canvas) 14%, transparent); color: var(--canvas); }
.pa-node__say.is-ok { background: var(--ok-soft); color: var(--ok); }
.pa-node__say.is-warn { background: var(--warn-soft); color: var(--warn); }
.pa-node--g .pa-node__say.is-warn { background: #e7a13c; color: #2a1c00; }
.pa-node--g .pa-node__say.is-ok { background: #0b6b39; color: #fff; }
.pa-node.is-hot { box-shadow: 0 0 0 2px var(--accent-text), var(--shadow-md); }
.pa-node--g.is-hot { box-shadow: 0 0 0 3px var(--p2), var(--shadow-lg); }

.pa-when-wild { display: none; }
.pa[data-mode="wild"] .pa-when-wild { display: inline; }
.pa[data-mode="wild"] .pa-when-check { display: none; }

.pa-link { position: relative; align-self: stretch; display: grid; place-items: center; --p: 1; }
.pa-link i { display: block; background: var(--line); border-radius: 2px; }
.pa-link--l1 { grid-area: l1; }
.pa-link--l2 { grid-area: l2; }
.pa-link--v { grid-area: v; }
.pa-link--l1 i, .pa-link--l2 i { width: 100%; height: 2px; transform-origin: 0 50%; transform: scaleX(var(--p)); background: linear-gradient(90deg, var(--line), var(--accent-line)); }
.pa-link--v i { width: 2px; height: 100%; transform-origin: 50% 0; transform: scaleY(var(--p)); background: repeating-linear-gradient(180deg, var(--line) 0 5px, transparent 5px 10px); }

.pa-dots { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.pa-dot { position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; font-family: var(--mono); font-size: 0.68rem; font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-md); transform: translate(-50%, -50%); opacity: 0; }
.pa-dot::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pa-dot--read { background: var(--page); color: var(--ok); box-shadow: var(--shadow-md), 0 0 0 1px var(--ok-soft); }
.pa-dot--write { background: var(--page); color: var(--warn); box-shadow: var(--shadow-md), 0 0 0 1px var(--warn-soft); }
.pa-dot--yes { background: var(--ok); color: #fff; }

.pa-map__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(22px, 3vw, 36px); padding-top: 18px; border-top: 1px solid var(--line-soft); }
.pa-map__cap { font-size: clamp(1rem, 1.4vw, 1.15rem); color: var(--ink); font-weight: 550; letter-spacing: -0.015em; min-height: 1.5em; }

.pa-legend3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(12px, 1.6vw, 20px); }
.pa-legend3 > div { padding: 20px 22px; background: var(--page); border: 1px solid var(--line-soft); display: grid; gap: 10px; justify-items: start; }
.pa-legend3 p { color: var(--muted); font-size: 0.97rem; line-height: 1.45; }

/* ---------- 3. conversation simulator ---------- */
.pa-sim { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: clamp(16px, 2.4vw, 32px); align-items: start; }
.pa-sim__side { display: grid; gap: 16px; position: sticky; top: 92px; }
.pa-tabs { display: grid; gap: 6px; }
.pa-tabs button { text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--page); border: 1px solid var(--line-soft); color: var(--ink); font-weight: 600; font-size: 0.98rem; letter-spacing: -0.015em; transition: background 0.25s, color 0.25s, transform 0.35s var(--ease), box-shadow 0.25s; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pa-tabs button::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; flex: none; transition: background 0.25s; }
.pa-tabs button:hover { transform: translateX(2px); box-shadow: var(--shadow-sm); }
.pa-tabs button[aria-selected="true"] { background: var(--ink); color: var(--canvas); border-color: var(--ink); }
.pa-tabs button[aria-selected="true"]::after { background: var(--accent); }

.pa-log { background: var(--page); border: 1px solid var(--line-soft); padding: 16px; display: grid; gap: 10px; }
.pa-log__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; color: var(--muted); }
.pa-log__top b { color: var(--ink); font-size: 0.95rem; letter-spacing: -0.015em; }
.pa-log__list { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.pa-log__list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 9px 11px; border-radius: 12px; background: var(--inset); font-size: 0.82rem; color: var(--ink); line-height: 1.3; }
.pa-log__list li small { grid-column: 1; font-family: var(--mono); font-size: 0.66rem; color: var(--muted); }
.pa-log__list li.is-undone { opacity: 0.6; }
.pa-log__list li.is-undone span { text-decoration: line-through; text-decoration-color: var(--faint); }
.pa-log__list li .pa-mini { grid-column: 2; grid-row: 1 / span 2; height: 28px; padding: 0 11px; font-size: 0.76rem; background: var(--page); box-shadow: 0 0 0 1px var(--line); }
.pa-log__list .pa-log__empty { display: block; background: none; color: var(--faint); padding: 4px 2px; font-size: 0.84rem; }

.pa-chat { grid-template-rows: auto minmax(0, 1fr) auto; height: 640px; padding-bottom: 14px; }
.pa-chat__status { display: inline-flex; align-items: center; gap: 7px; }
.pa-chat__status i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pa-chat__body { display: grid; align-content: start; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding: 4px 4px 12px; margin: 0 -4px; scrollbar-width: thin; }
.pa-chat__body:focus-visible { outline-offset: -2px; }
.pa-chat__body > * { min-width: 0; }
.pa-chat__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pa-chat__hint { font-size: 0.8rem; color: var(--faint); }
.pa-chat .msg { max-width: 86%; }
.pa-chat .msg--ai { justify-self: start; }
.pa-chat .toolcall { justify-self: start; max-width: 100%; }
.toolcall .pa-args { color: #b9bec4; overflow-wrap: anywhere; min-width: 0; }
.toolcall .pa-run { margin-left: auto; color: #9aa0a6; }
.toolcall .pa-ro { font-size: 0.64rem; padding: 2px 8px; border-radius: 999px; background: rgba(111, 214, 163, 0.14); color: #6fd6a3; letter-spacing: 0.04em; }
.toolcall .pa-wr { font-size: 0.64rem; padding: 2px 8px; border-radius: 999px; background: rgba(231, 193, 106, 0.15); color: #e7c16a; letter-spacing: 0.04em; }
.toolcall .pa-res { flex-basis: 100%; color: #d7dadd; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); white-space: pre-wrap; }
.pa-chat .proposal { justify-self: stretch; }
.pa-why { font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.pa-tilde { background: color-mix(in srgb, var(--p3) 16%, transparent); color: var(--ink); }
.diff > div { overflow-wrap: anywhere; }
.proposal .pa-done { display: none; font-size: 0.88rem; font-weight: 600; color: var(--ok); }
.proposal.is-accepted .pa-done, .proposal.is-declined .pa-done, .proposal.is-undone .pa-done { display: block; }
.proposal.is-declined .pa-done, .proposal.is-undone .pa-done { color: var(--muted); }
.proposal.is-accepted .proposal__btns, .proposal.is-declined .proposal__btns, .proposal.is-undone .proposal__btns { display: none; }
.proposal.is-undone { opacity: 0.7; box-shadow: 0 0 0 1.5px var(--line), var(--shadow-sm); }
.proposal.is-accepted .proposal__top { color: var(--ok); }
.proposal__btns .btn:disabled { opacity: 0.5; cursor: default; }
.pa-typing { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--inset); justify-self: start; border-bottom-left-radius: 6px; }
.pa-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: pa-bob 1s var(--ease) infinite; }
.pa-typing i:nth-child(2) { animation-delay: 0.15s; } .pa-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pa-bob { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
.msg .caret { display: inline-block; width: 2px; height: 1em; background: currentColor; vertical-align: -0.15em; margin-left: 1px; animation: blink 1s steps(1) infinite; }

/* ---------- 4. the gate ---------- */
.pa-modes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 2vw, 24px); }
.pa-mode { position: relative; padding: clamp(24px, 3vw, 40px); background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); display: grid; gap: 12px; align-content: start; transition: box-shadow 0.45s var(--ease), opacity 0.45s; }
.pa-mode h3 { font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -0.04em; font-weight: 620; color: var(--ink); line-height: 1; }
.pa-mode p { color: var(--muted); font-size: 1.05rem; line-height: 1.45; max-width: 40ch; }
.pa-mode__tag { justify-self: start; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.pa-mode__tag--soft { background: var(--hover); color: var(--muted); }
.pa[data-mode="check"] [data-mode-card="check"], .pa[data-mode="wild"] [data-mode-card="wild"] { box-shadow: 0 0 0 2px var(--accent-text), var(--shadow-md); }

.pa-demo { margin-top: clamp(14px, 2vw, 24px); padding: clamp(20px, 3vw, 36px); background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-md); display: grid; gap: clamp(20px, 2.6vw, 30px); }
.pa-switch { position: relative; justify-self: center; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--inset); width: min(100%, 380px); }
.pa-switch button { position: relative; z-index: 1; height: 42px; padding: 0 16px; border-radius: 999px; font-size: 0.95rem; font-weight: 600; color: var(--muted); transition: color 0.3s; white-space: nowrap; }
.pa-switch button[aria-checked="true"] { color: var(--canvas); }
.pa-switch__pill { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--ink); box-shadow: var(--shadow-sm); transition: transform 0.5s var(--ease); }
.pa[data-mode="wild"] .pa-switch__pill { transform: translateX(100%); }
.pa-demo__row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr); gap: clamp(14px, 2vw, 28px); align-items: center; }
.pa-demo__ask { display: grid; gap: 8px; }
.pa-demo__ask small { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.pa-demo__ask .toolcall .pa-args { flex-basis: 100%; }
.pa-demo__arrow { width: 44px; height: 44px; border-radius: 50%; background: var(--inset); display: grid; place-items: center; color: var(--ink); }
.pa-demo__arrow svg { width: 18px; height: 18px; }
.pa-demo__out { display: grid; }
.pa-out { grid-area: 1 / 1; padding: 16px; border-radius: 18px; background: var(--page); display: grid; gap: 10px; align-content: start; transition: opacity 0.4s var(--ease), transform 0.5s var(--ease), visibility 0.4s; }
.pa-out b { color: var(--ink); font-size: 0.98rem; letter-spacing: -0.015em; }
.pa-out--check { box-shadow: 0 0 0 1.5px var(--accent-line), var(--shadow-md); }
.pa-out--wild { box-shadow: 0 0 0 1.5px var(--ok), var(--shadow-md); }
.pa-out .proposal__top.pa-ok { color: var(--ok); }
.pa-out__note { font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.pa-out__note code { font-size: 0.78rem; color: var(--ink); }
.pa[data-mode="check"] .pa-out--wild, .pa[data-mode="wild"] .pa-out--check { opacity: 0; visibility: hidden; transform: translateY(8px) scale(0.98); }

.pa-locks { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(14px, 2vw, 24px); }
.pa-lock { padding: 24px; background: var(--page); border: 1px solid var(--line-soft); display: grid; gap: 10px; align-content: start; }
.pa-lock__n { font-family: var(--mono); font-size: 0.74rem; color: var(--accent-text); letter-spacing: 0.06em; }
.pa-lock b { font-size: 1.12rem; letter-spacing: -0.02em; color: var(--ink); }
.pa-lock p { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.pa-lock code, .pa-legend3 code { font-size: 0.84em; color: var(--ink); background: var(--hover); padding: 1px 6px; border-radius: 6px; }

/* ---------- 5. operations ---------- */
.pa-ops-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: clamp(32px, 5vw, 64px); }
.pa-total { display: flex; align-items: end; gap: 16px; flex: none; }
.pa-total__n { font-size: clamp(5rem, 12vw, 10.5rem); font-weight: 640; letter-spacing: -0.075em; line-height: 0.8; color: var(--ink); font-variant-numeric: tabular-nums; }
.pa-total__l { font-size: 1.1rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; line-height: 1.2; padding-bottom: 6px; }
.pa-total__l small { font-weight: 450; font-size: 0.82rem; color: var(--muted); letter-spacing: 0; }

.pa-better { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); margin-bottom: clamp(12px, 1.6vw, 20px); }
.pa-tile { min-height: 380px; }
.pa-tile .tile__tag { overflow-wrap: anywhere; }
.pa-mini-list { display: grid; gap: 6px; }
.pa-mini-list .tk { padding: 9px 12px; font-size: 0.88rem; }
.pa-capbar { margin-top: 6px; }
.pa-capbar i { position: relative; }
.pa-capbar .cap { position: absolute; top: -4px; bottom: -4px; width: 0; border-left: 2px dashed var(--ink); z-index: 2; }
.pa-tile .typed { min-height: 0; margin-bottom: 10px; }
.pa-tile .filterbox { margin-bottom: 10px; }

.pa-explorer { background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); padding: clamp(18px, 2.6vw, 34px); }
.pa-explorer__bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.pa-search { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 999px; background: var(--inset); color: var(--muted); border: 1px solid transparent; transition: border-color 0.2s, background 0.2s; }
.pa-search:focus-within { border-color: var(--accent-text); background: var(--page); }
.pa-search svg { width: 18px; height: 18px; flex: none; }
.pa-search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 0.98rem; color: var(--ink); outline: none; }
.pa-search input::placeholder { color: var(--faint); }
.pa-search input::-webkit-search-cancel-button { filter: grayscale(1); }
.pa-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-pills button { height: 38px; padding: 0 14px; border-radius: 999px; background: var(--inset); color: var(--muted); font-size: 0.88rem; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; transition: background 0.2s, color 0.2s; }
.pa-pills button em { font-style: normal; font-family: var(--mono); font-size: 0.72rem; opacity: 0.8; }
.pa-pills button:hover { color: var(--ink); }
.pa-pills button[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }
.pa-explorer__count { margin: 16px 0 4px; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.05em; color: var(--faint); text-transform: uppercase; }
.pa-groups { columns: 3 280px; column-gap: clamp(14px, 2vw, 28px); }
.pa-group { break-inside: avoid; padding-top: 18px; }
.pa-group[hidden] { display: none; }
.pa-group h3 { font-size: 0.78rem; font-family: var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); font-weight: 500; margin-bottom: 8px; }
.pa-group ul { display: grid; gap: 6px; }
.pa-op { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--inset); }
.pa-op[hidden] { display: none; }
.pa-op > code { font-size: 0.84rem; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.pa-op p { grid-column: 1 / -1; font-size: 0.88rem; color: var(--muted); line-height: 1.4; }
.pa-op p code { font-size: 0.82em; color: var(--ink); }
.pa-cls { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.03em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pa-op[data-cls="read"] .pa-cls { background: var(--ok-soft); color: var(--ok); }
.pa-op[data-cls="idem"] .pa-cls { background: var(--accent-soft); color: var(--accent-text); }
.pa-op[data-cls="destr"] .pa-cls { background: var(--danger-soft); color: var(--danger); }
.pa-op mark { background: var(--warn-soft); color: inherit; border-radius: 3px; }
.pa-empty { padding: 30px 4px 10px; color: var(--muted); }
.pa-explorer__key { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 0.86rem; color: var(--muted); line-height: 1.5; }
.pa-explorer__key b { color: var(--ink); font-weight: 600; }

/* ---------- 6. connect ---------- */
.pa-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.6vw, 20px); counter-reset: none; }
.pa-step { padding: clamp(22px, 2.6vw, 30px); background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); display: grid; gap: 10px; align-content: start; min-width: 0; }
.pa-step__n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--canvas); font-weight: 650; font-size: 0.95rem; }
.pa-step b { font-size: 1.3rem; letter-spacing: -0.03em; color: var(--ink); font-weight: 620; }
.pa-step p { color: var(--muted); font-size: 0.95rem; line-height: 1.4; }
.pa-step__jump { justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; font-size: 0.95rem; color: var(--accent-text); }
.pa-step__jump svg { width: 15px; height: 15px; }

.pa-code { position: relative; min-width: 0; }
.pa-code pre { margin: 0; padding: 14px 92px 14px 16px; border-radius: 14px; background: #0b0b0b; color: #e4e6e8; border: 1px solid var(--stage-line); font-family: var(--mono); font-size: 0.8rem; line-height: 1.6; overflow-x: auto; white-space: pre; scrollbar-width: thin; }
.pa-copy { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #f2f2f2; font-size: 0.76rem; font-weight: 600; transition: background 0.2s; }
.pa-copy:hover { background: rgba(255, 255, 255, 0.18); }
.pa-copy svg { width: 14px; height: 14px; }
.pa-copy.is-done { background: #1f6f47; }
.pa-copy:focus-visible { outline-color: #fff; }

.pa-hosts { margin-top: clamp(14px, 2vw, 24px); background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-md); padding: clamp(16px, 2.4vw, 28px); display: grid; gap: 18px; min-width: 0; scroll-margin-top: 90px; }
.pa-hosts__tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -4px; padding: 4px; }
.pa-hosts__tabs::-webkit-scrollbar { display: none; }
.pa-hosts__tabs button { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--inset); color: var(--muted); font-size: 0.92rem; font-weight: 600; transition: background 0.2s, color 0.2s; }
.pa-hosts__tabs button:hover { color: var(--ink); }
.pa-hosts__tabs button[aria-selected="true"] { background: var(--ink); color: var(--canvas); }
.pa-hosts__panels { display: grid; min-width: 0; }
.pa-host { display: grid; gap: 12px; align-content: start; min-width: 0; }
.pa-host[hidden] { display: none; }
.pa-host__where { color: var(--body); font-size: 0.98rem; line-height: 1.5; }
.pa-host__where b { color: var(--ink); }
.pa-host__where code, .pa-host__note code, .pa-connect-sec .fineprint code { font-size: 0.86em; color: var(--ink); background: var(--hover); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.pa-host__note { font-size: 0.86rem; color: var(--faint); }

/* ---------- 7. command line ---------- */
.pa-cli-sec { overflow: hidden; }
.pa-cli { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.pa-cli__copy { display: grid; gap: 22px; }
.pa-cmds { display: grid; gap: 4px; }
.pa-cmds button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 14px; border-radius: 12px; color: var(--stage-ink); text-align: left; transition: background 0.2s; }
.pa-cmds button:hover { background: rgba(255, 255, 255, 0.06); }
.pa-cmds button.is-on { background: rgba(255, 255, 255, 0.1); }
.pa-cmds code { font-size: 0.86rem; color: var(--stage-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pa-cmds span { font-size: 0.84rem; color: var(--stage-muted); white-space: nowrap; flex: none; }
.pa-cmds button:focus-visible { outline-color: var(--stage-accent); }
.pa-cli__note { font-size: 0.9rem; color: var(--stage-muted); line-height: 1.5; }
.pa-cli__note code { color: var(--stage-ink); background: rgba(255, 255, 255, 0.08); padding: 1px 6px; border-radius: 6px; font-size: 0.86em; }
.pa-term-wrap { min-width: 0; }
.pa-term { border-radius: 20px; background: #080808; border: 1px solid var(--stage-line); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.55); overflow: hidden; }
@supports (corner-shape: squircle) { .pa-term { corner-shape: squircle; border-radius: 34px; } }
.pa-term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--stage-line); }
.pa-term__bar i { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.pa-term__bar span { margin-left: auto; margin-right: auto; transform: translateX(-24px); font-family: var(--mono); font-size: 0.72rem; color: var(--stage-muted); }
.pa-term__body { height: 440px; border: 0; border-radius: 0; overflow: auto; font-size: 0.8rem; padding: 18px 20px; scrollbar-width: thin; }
.pa-term__body pre { margin: 0; font: inherit; white-space: pre; }
.pa-term__cap { margin-top: 12px; font-size: 0.8rem; color: var(--stage-muted); }
.term .pa-p { color: #6fd6a3; }
.term .pa-cmd { color: #f4f4f3; }

/* ---------- 8. doors ---------- */
.pa-doors { display: grid; justify-items: center; }
.pa-manifest { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 20px 28px; background: var(--ink); color: var(--canvas); box-shadow: var(--shadow-lg); max-width: 560px; position: relative; z-index: 1; }
.pa-manifest code { font-size: 0.8rem; color: color-mix(in srgb, var(--canvas) 70%, transparent); }
.pa-manifest b { font-size: clamp(1.05rem, 1.6vw, 1.3rem); letter-spacing: -0.02em; font-weight: 620; }
.pa-doors__wires { width: 100%; height: 64px; display: block; }
.pa-doors__wires path { fill: none; stroke: var(--line); stroke-width: 2; vector-effect: non-scaling-stroke; }
.pa-doors__row { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 20px); }
.pa-door { padding: clamp(20px, 2.4vw, 28px); background: var(--page); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); display: grid; gap: 10px; align-content: start; }
.pa-door__ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.pa-door__ic svg { width: 20px; height: 20px; }
.pa-door b { font-size: 1.15rem; letter-spacing: -0.02em; color: var(--ink); }
.pa-door p { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

.pa-live { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(12px, 1.6vw, 20px); margin-top: clamp(40px, 6vw, 80px); }
.pa-live__lead { padding: clamp(24px, 3vw, 40px); background: var(--stage); color: var(--stage-ink); border: 1px solid var(--stage-line); display: grid; gap: 14px; align-content: start; }
.pa-live__lead .tile__tag { color: var(--stage-accent); }
.pa-live__lead h3 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); letter-spacing: -0.035em; line-height: 1.08; font-weight: 620; color: var(--stage-ink); text-wrap: balance; }
.pa-live__lead p { color: var(--stage-muted); }
.pa-feats { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.4vw, 16px); }
.pa-feats li { padding: 18px 20px; background: var(--page); border: 1px solid var(--line-soft); display: grid; gap: 6px; align-content: start; min-width: 0; }
.pa-feats li:last-child { grid-column: 1 / -1; }
.pa-feats b { color: var(--ink); font-size: 1.02rem; letter-spacing: -0.015em; }
.pa-feats p { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }
.pa-feats code { font-size: 0.84em; color: var(--ink); overflow-wrap: anywhere; }

/* ---------- 9. closing CTA ---------- */
.pa-cta { padding: clamp(40px, 7vw, 96px) clamp(22px, 5vw, 72px); background: var(--stage); border: 1px solid var(--stage-line); display: grid; justify-items: center; text-align: center; gap: 22px; }
.pa-cta .h2 { color: var(--stage-ink); max-width: 16ch; }
.pa-cta .lead { color: var(--stage-muted); text-align: center; max-width: 44ch; }
.pa-cta__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pa-cta .btn--primary { background: var(--stage-ink); color: #0e0e0e; }
.pa-cta .btn--ghost { background: rgba(255, 255, 255, 0.1); color: var(--stage-ink); }
.pa-cta .btn--ghost:hover { background: rgba(255, 255, 255, 0.16); }
.pa-cta .btn:focus-visible { outline-color: var(--stage-accent); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .pa-sim { grid-template-columns: 1fr; }
  .pa-sim__side { display: contents; }
  .pa-tabs { order: 0; }
  .pa-chat { order: 1; }
  .pa-tabs { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter); }
  .pa-tabs::-webkit-scrollbar { display: none; }
  .pa-tabs button { flex: none; white-space: nowrap; border-radius: 999px; padding: 11px 16px; font-size: 0.92rem; }
  .pa-tabs button::after { display: none; }
  .pa-tabs button:hover { transform: none; }
  .pa-log { order: 2; }
  .pa-log__list { max-height: 180px; }
  .pa-locks { grid-template-columns: 1fr 1fr; }
  .pa-better { grid-template-columns: 1fr 1fr; }
  .pa-better .pa-tile:last-child { grid-column: 1 / -1; min-height: 0; }
  .pa-cli { grid-template-columns: 1fr; }
  .pa-live { grid-template-columns: 1fr; }
  .pa-doors__row { grid-template-columns: 1fr 1fr; }
  .pa-doors__wires { display: none; }
  .pa-manifest { margin-bottom: clamp(14px, 2vw, 24px); }
}
@media (max-width: 900px) {
  .pa-ops-head { flex-direction: column; align-items: start; gap: 22px; }
  .pa-steps { grid-template-columns: 1fr; }
  .pa-demo__row { grid-template-columns: 1fr; }
  .pa-demo__arrow { justify-self: center; transform: rotate(90deg); }
}
@media (max-width: 760px) {
  .pa-map__grid {
    grid-template-columns: minmax(0, 1fr) 26px minmax(0, 0.82fr);
    grid-template-rows: auto 44px auto 44px auto;
    grid-template-areas: "a . ." "l1 . ." "g v y" "l2 . ." "e . .";
  }
  .pa-link--l1 i, .pa-link--l2 i { width: 2px; height: 100%; transform-origin: 50% 0; transform: scaleY(var(--p)); background: linear-gradient(180deg, var(--line), var(--accent-line)); }
  .pa-link--v i { width: 100%; height: 2px; transform-origin: 0 50%; transform: scaleX(var(--p)); background: repeating-linear-gradient(90deg, var(--line) 0 5px, transparent 5px 10px); }
  .pa-node { padding: 14px 10px; }
  .pa-node--g { padding: 18px 10px; }
  .pa-node small { font-size: 0.74rem; }
  .pa-node__say { font-size: 0.6rem; padding: 3px 8px; }
  .pa-map__foot { flex-direction: column; align-items: start; }
  .pa-legend3 { grid-template-columns: 1fr; }
  .pa-modes { grid-template-columns: 1fr; }
  .pa-locks { grid-template-columns: 1fr; }
  .pa-better { grid-template-columns: 1fr; }
  .pa-better .pa-tile { min-height: 0; }
  .pa-chat { height: 600px; }
  .pa-chat .msg { max-width: 94%; }
  .pa-chat__hint { font-size: 0.74rem; }
  .pa-doors__row { grid-template-columns: 1fr; }
  .pa-feats { grid-template-columns: 1fr; }
  .pa-term__body { height: 400px; font-size: 0.7rem; padding: 14px; }
  .pa-term__body pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .pa-cmds span { display: none; }
  .pa-total__n { font-size: 6rem; }
  .pa-pills { gap: 5px; }
  .pa-pills button { height: 34px; padding: 0 11px; font-size: 0.82rem; }
  .pa-search { max-width: none; }
  .pa-code pre { font-size: 0.74rem; padding-inline: 14px; }
}

/* ---------- motion fallbacks ---------- */
.no-gsap .pa-link { --p: 1 !important; }
@media (prefers-reduced-motion: reduce) {
  .js .pa-link { --p: 1; }
  .pa-typing i { animation: none; opacity: 0.7; }
}

/* ---------- overrides for the shared inline-code rule ---------- */
.pa p code, .pa li code, .pa small code { white-space: normal; overflow-wrap: anywhere; }
.pa .pa-op > code, .pa .pa-cmds code { background: none; padding: 0; border-radius: 0; font-size: 0.84rem; }
.pa .pa-cmds code { white-space: nowrap; }
.pa .pa-cli__note code { background: rgba(255, 255, 255, 0.08); color: var(--stage-ink); }
.pa .pa-live__lead code { color: var(--stage-ink); }
.pa-better .tile { grid-column: auto; }
.pa pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; font-weight: 400; color: inherit; white-space: inherit; }
.pa-code pre { padding: 46px 18px 16px; white-space: pre; }
.pa-verdict { color: var(--danger); margin-bottom: 14px; }
