/* Post-specific styles: ageval */
:root { --ag: #3b5bdb; --ag-ink: #2a43a8; --ag-soft: #e8edfd; --ok: #3f8a4c; --ok-soft: #e3f1e5; --bad: #c4553f; --bad-soft: #f8e4df; --gold: #b7791f; --gold-soft: #fbf0dc;
  --h-pi: #2b6cb0; --h-oc: #d9772b; --h-ms: #3f8a6a; --h-http: #7a5bb0; }

pre.code { margin: 4px 0 20px; padding: 16px 18px; border-radius: 12px; background: #1c222b; color: #dde3ea; font: 12.5px/1.7 var(--b-mono); overflow-x: auto; white-space: pre; }
pre.code code { background: none; border: 0; border-radius: 0; color: inherit; padding: 0; font: inherit; }

/* ---------- Figure 1: one Attempt ---------- */
.a1 { border: 1px solid var(--b-line); border-radius: 16px; background: #fff; padding: 16px 18px 18px; }
.a1-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; }
.a1-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.a1-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 14px; font-weight: 600; color: var(--b-mute); background: none; border: 1px solid transparent; border-radius: 10px; padding: 7px 12px 9px 8px; cursor: pointer; }
.a1-tab:hover { color: var(--b-ink); background: var(--b-panel); }
.a1-tn { display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; font-size: 11.5px; background: var(--b-panel2); color: var(--b-mute); }
.a1-prog { position: absolute; left: 8px; right: 12px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--b-line); overflow: hidden; }
.a1-prog::after { content: ""; position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: var(--ag); }
.a1[data-phase="0"] .a1-tab[data-go="0"], .a1[data-phase="1"] .a1-tab[data-go="1"], .a1[data-phase="2"] .a1-tab[data-go="2"], .a1[data-phase="3"] .a1-tab[data-go="3"], .a1[data-phase="4"] .a1-tab[data-go="4"] { color: var(--b-ink); background: #fff; border-color: var(--b-line); }
.a1[data-phase="0"] .a1-tab[data-go="0"] .a1-tn, .a1[data-phase="1"] .a1-tab[data-go="1"] .a1-tn, .a1[data-phase="2"] .a1-tab[data-go="2"] .a1-tn, .a1[data-phase="3"] .a1-tab[data-go="3"] .a1-tn, .a1[data-phase="4"] .a1-tab[data-go="4"] .a1-tn { background: var(--ag); color: #fff; }

.a1-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .95fr); gap: 14px; align-items: stretch; min-height: 372px; }
.a1-box { position: relative; border-radius: 12px; background: #161b23; color: #d7dde6; padding: 12px 14px; overflow: hidden; }
.a1-ev { border-radius: 12px; background: var(--b-panel); border: 1px solid var(--b-line); padding: 12px 14px; }
.a1-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 10px !important; color: inherit !important; }
.a1-box .a1-h { color: #9fb0c6 !important; }
.a1-ev .a1-h { color: var(--b-mute) !important; }
.a1-kind { font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; font-family: var(--b-mono); font-size: 11px; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .08); }
.a1-ev .a1-kind { background: #fff; border: 1px solid var(--b-line); }
.a1-tree { list-style: none; margin: 0; padding: 0; font: 12.5px/1.75 var(--b-mono); }
.a1-tree li { padding-left: 16px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a1-tree li::before { content: "·"; position: absolute; left: 4px; color: #6b7a8f; }
.a1-tree li.a1-dir { padding-left: 0; color: #fff; font-weight: 600; margin-top: 4px; }
.a1-tree li.a1-dir::before { content: none; }
.a1-ev .a1-tree li { color: var(--b-ink); }
.a1-ev .a1-tree li::before { content: "+"; color: var(--ag); }
.a1-tree .a1-new { color: #9be3a8; }
.a1-tree .a1-gold { color: #f3c879; }
.a1-by { font-family: inherit; font-size: 10.5px; color: #7f8ea3; margin-left: 4px; }
.a1-cnt { color: var(--b-mute); font-size: 11px; }
.a1-agent { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; background: rgba(59, 91, 219, .22); color: #dfe6ff; font-size: 12.5px; font-weight: 600; }
.a1-dot { width: 8px; height: 8px; border-radius: 50%; background: #8fa9ff; box-shadow: 0 0 0 0 rgba(143, 169, 255, .6); }
.a1.working .a1-dot { animation: a1pulse 1.1s ease-out infinite; }
@keyframes a1pulse { to { box-shadow: 0 0 0 8px rgba(143, 169, 255, 0); } }
.a1-st { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.a1-stopped { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(22, 27, 35, .9); color: #c9d3df; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .4s; }
.a1-stopped code { background: rgba(255, 255, 255, .1); border: 0; color: #fff; margin-left: 4px; }
.a1.off .a1-stopped { opacity: 1; }
.a1-mid { position: relative; display: flex; flex-direction: column; }
.a1-pane { display: none; flex: 1; }
.a1[data-phase="0"] .a1-pane[data-pane="0"], .a1[data-phase="1"] .a1-pane[data-pane="1"], .a1[data-phase="2"] .a1-pane[data-pane="2"], .a1[data-phase="3"] .a1-pane[data-pane="3"], .a1[data-phase="4"] .a1-pane[data-pane="4"] { display: block; }
.a1-k { font: 700 12px/1.3 var(--b-mono); color: var(--ag-ink) !important; margin: 0 0 8px !important; }
.a1-code { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #f6f8fb; border: 1px solid var(--b-line); font: 11.5px/1.6 var(--b-mono); color: #3a4250; white-space: pre !important; overflow-x: auto; }
.a1-code b { color: var(--ag-ink); font-weight: 700; }
.a1-code .c { color: #8a93a2; }
.a1-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.a1-checks li { position: relative; padding-left: 22px; font-size: 13px; line-height: 1.45; color: var(--b-text); }
.a1-checks li::before { content: "✓"; position: absolute; left: 2px; top: 0; color: var(--ok); font-weight: 700; }
.a1-t { font-size: 13.5px !important; line-height: 1.55; margin: 0 0 9px !important; }
.a1-verdict { display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 10px; background: var(--ok-soft); font: 600 12.5px var(--b-mono); color: #2f7a3e; }
.a1-verdict b { padding: 2px 10px; border-radius: 7px; background: var(--ok); color: #fff; letter-spacing: .04em; }
.a1-goldcard { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 8px 11px; border-radius: 10px; border: 1px dashed #d9b46a; background: #fffaf0; font-size: 12.5px; color: #6b4e14; transition: background .4s, border-color .4s; }
.a1-goldcard svg { width: 15px; height: 15px; flex: none; color: var(--gold); }
.a1-goldcard b { font-family: var(--b-mono); font-weight: 600; }
.a1-goldcard em { font-style: normal; color: #8a6a2a; margin-left: 4px; }
.a1-goldcard.up { border-style: solid; background: var(--gold-soft); }
.a1 .fx { will-change: opacity; }

/* ---------- Figure 2: composition ---------- */
.a2-ctl { display: grid; gap: 8px; margin-bottom: 16px; }
.a2-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 10px; }
.a2-l { font-size: 12.5px; font-weight: 700; color: var(--b-mute); }
.a2-row .seg { flex-wrap: wrap; }
.a2-out { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.1fr); gap: 14px; }
.a2-k { font: 700 12px/1.3 var(--b-mono); color: var(--b-mute) !important; margin: 0 0 8px !important; }
.a2-files { list-style: none; margin: 0; padding: 0; font: 12.5px/2 var(--b-mono); color: var(--b-ink); }
.a2-files li { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--b-line); }
.a2-files span { font-family: inherit; font-size: 10.5px; color: var(--ok); font-weight: 600; }
.a2-yaml { margin: 0; padding: 10px 12px; border-radius: 10px; background: #1c222b; color: #dde3ea; font: 12px/1.65 var(--b-mono); white-space: pre; overflow-x: auto; min-height: 190px; }
.a2-yaml .ln { display: block; border-radius: 3px; }
.a2-yaml .ln.chg { animation: a2flash 1.4s ease-out; }
@keyframes a2flash { 0% { background: rgba(243, 200, 121, .45); } 100% { background: transparent; } }
.a2-lock { font-size: 13px; line-height: 1.5; }
.a2-lock ul { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 5px; }
.a2-lock li { position: relative; padding-left: 22px; color: var(--b-text); }
.a2-lock li::before { position: absolute; left: 2px; font-weight: 700; }
.a2-lock li.ok::before { content: "✓"; color: var(--ok); }
.a2-lock li.no::before { content: "✕"; color: var(--bad); }
.a2-lock code { font-size: .86em; }
.a2-res { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; font: 600 12.5px var(--b-mono); }
.a2-res.ok { background: var(--ok-soft); color: #2f7a3e; } .a2-res.no { background: var(--bad-soft); color: #b0472f; }

/* ---------- Figure 3: recovery ---------- */
.a3-cmd { margin: 10px 0 0 !important; padding: 8px 12px; border-radius: 9px; background: #1c222b; color: #dde3ea !important; font: 12px/1.6 var(--b-mono); white-space: pre-wrap; word-break: break-word; min-height: 2.2em; }
.a3-cmd .p { color: #8fa9ff; }
.a3-note { font-size: 13.5px !important; color: var(--b-text) !important; margin: 10px 2px 0 !important; line-height: 1.55; min-height: 4.6em; }
.a5-note { font-size: 13px !important; color: var(--b-mute) !important; margin: 6px 2px 0 !important; }

@media (max-width: 720px) {
  .a1 { padding: 12px 10px 14px; }
  .a1-main { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .a1-box { min-height: 250px; }
  .a1-tab { font-size: 12.5px; padding: 6px 8px 8px 6px; }
  .a2-out { grid-template-columns: minmax(0, 1fr); }
  .a2-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* ---------- Figure 4: results heatmap ---------- */
.b4-scale { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--b-mute); }
.b4-scale i { display: block; width: 120px; height: 10px; border-radius: 3px; }
#fig-4 .seg { flex-wrap: wrap; }
