:root {
  color-scheme: dark;
  --bg: #090c10;
  --panel: #0f1419;
  --panel-strong: #151b21;
  --line: #25303a;
  --line-soft: #1b232b;
  --text: #f2f0e9;
  --muted: #8e9aa4;
  --faint: #5d6972;
  --amber: #f5b642;
  --amber-soft: #3a2b13;
  --mint: #7fe2ba;
  --red: #ef7d70;
  --radius: 14px;
  --mono: "SFMono-Regular", "Cascadia Code", "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -10%, rgba(245, 182, 66, .08), transparent 34rem),
    var(--bg);
  font-family: var(--sans);
}

button, input { font: inherit; }

.app-shell { width: min(1500px, 100%); margin: 0 auto; padding: 0 32px 48px; }

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border: 1px solid #805d23; transform: rotate(45deg); display: grid; place-items: center; }
.brand-mark i { width: 11px; height: 11px; background: var(--amber); box-shadow: 0 0 22px rgba(245, 182, 66, .4); }
.brand b, .brand small { display: block; }
.brand b { font: 800 15px/1 var(--mono); letter-spacing: .16em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.privacy-badge, .state-badge, .count-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 20, 25, .75);
  font: 700 11px/1 var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.privacy-badge { padding: 9px 12px; }
.privacy-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px rgba(127, 226, 186, .5); }

.ingest-panel {
  padding: 54px 0 44px;
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(480px, 1.15fr);
  align-items: end;
  gap: 64px;
}

.eyebrow { margin: 0 0 12px; color: var(--amber); font: 700 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 650px; margin: 0; font-size: clamp(34px, 4.2vw, 62px); line-height: .98; letter-spacing: -.05em; }

.url-form label { display: block; margin-bottom: 10px; color: var(--muted); font: 700 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.input-row { display: flex; padding: 6px; border: 1px solid #36424c; border-radius: 12px; background: #0b0f13; box-shadow: 0 16px 50px rgba(0,0,0,.2); }
.input-row:focus-within { border-color: #8b682c; box-shadow: 0 0 0 3px rgba(245, 182, 66, .08); }
.input-row input { min-width: 0; flex: 1; border: 0; outline: 0; padding: 11px 13px; color: var(--text); background: transparent; }
.input-row input::placeholder { color: #5f6870; }
.input-row button { border: 0; border-radius: 8px; padding: 12px 18px; color: #171208; background: var(--amber); font-weight: 800; cursor: pointer; }
.input-row button:hover { background: #ffc75c; }
.input-row button:disabled { cursor: wait; opacity: .62; }
.reference-field { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(11, 15, 19, .72); }
.reference-field label { margin-bottom: 7px; color: var(--faint); font-size: 9px; }
.reference-field input { width: 100%; border: 0; outline: 0; padding: 0; color: var(--muted); background: transparent; font: 10px/1.4 var(--mono); }
.reference-field:focus-within { border-color: #42725f; box-shadow: 0 0 0 3px rgba(127, 226, 186, .06); }
.reference-field:focus-within label { color: var(--mint); }
.form-meta { min-height: 28px; display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.form-meta p { margin: 10px 2px 0; color: var(--faint); font-size: 12px; }
.request-status { text-align: right; }
.request-status[data-kind="success"] { color: var(--mint); }
.request-status[data-kind="error"] { color: var(--red); }
.request-status[data-kind="loading"] { color: var(--amber); }

.workspace { display: grid; grid-template-columns: 350px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); min-height: 490px; }
.pull-panel { border-right: 1px solid var(--line); background: #0c1014; }
.analysis-panel { min-width: 0; }
.section-heading { min-height: 68px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line-soft); }
.section-heading > div { display: flex; align-items: center; gap: 11px; }
.section-heading h2 { margin: 0; font-size: 13px; letter-spacing: .02em; }
.step-number { color: var(--amber); font: 700 10px/1 var(--mono); }
.count-badge, .state-badge { padding: 7px 9px; }
.state-badge { color: var(--mint); }
.state-badge[data-kind="loading"] { color: var(--amber); }
.state-badge[data-kind="error"] { color: var(--red); }
.state-badge[data-kind="success"] { color: var(--mint); }
.empty-pulls { min-height: 420px; padding: 38px; display: grid; place-content: center; text-align: center; color: var(--faint); }
.empty-pulls p { max-width: 190px; margin: 14px 0 0; font-size: 13px; line-height: 1.6; }
.empty-glyph { color: var(--amber); font: 32px/1 var(--mono); }

.mechanic-primer { padding: clamp(28px, 5vw, 70px); display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(32px, 6vw, 90px); align-items: center; min-height: 420px; }
.primer-copy h3 { margin: 0 0 18px; font-size: clamp(26px, 3vw, 42px); line-height: 1.04; letter-spacing: -.035em; }
.primer-copy > p:last-child { margin: 0; max-width: 470px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.sequence { position: relative; list-style: none; margin: 0; padding: 0; }
.sequence::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 1px; background: var(--line); }
.sequence li { position: relative; display: grid; grid-template-columns: 36px 1fr; column-gap: 16px; align-items: center; padding: 11px 0; }
.sequence li > span { z-index: 1; grid-row: 1 / span 2; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--faint); font: 700 10px/1 var(--mono); }
.sequence b { font-size: 14px; }
.sequence small { margin-top: 3px; color: var(--faint); font-size: 11px; }
.sequence li.active > span { border-color: #886526; color: var(--amber); background: var(--amber-soft); }
.sequence li.active b { color: var(--amber); }

.report-context { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.report-context span, .report-context strong, .report-context small { display: block; }
.report-code { margin-bottom: 8px; color: var(--amber); font: 700 9px/1 var(--mono); letter-spacing: .08em; }
.report-context strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.report-context small { margin-top: 6px; color: var(--faint); font-size: 10px; text-transform: capitalize; }
.pull-list { max-height: 720px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #38434b transparent; }
.pull-item { width: 100%; min-height: 72px; padding: 14px 17px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 0; border-bottom: 1px solid var(--line-soft); color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.pull-item:hover { background: #12181d; }
.pull-item.selected { background: linear-gradient(90deg, rgba(245, 182, 66, .13), transparent 85%); box-shadow: inset 3px 0 var(--amber); }
.pull-id { color: var(--faint); font: 700 11px/1 var(--mono); }
.pull-item.selected .pull-id { color: var(--amber); }
.pull-main { min-width: 0; }
.pull-main b, .pull-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pull-main b { font-size: 12px; }
.pull-main small { margin-top: 5px; color: var(--faint); font: 10px/1.2 var(--mono); text-transform: uppercase; }
.pull-progress { min-width: 52px; padding: 6px 7px; border: 1px solid #3d2928; border-radius: 6px; color: var(--red); background: #1d1515; font: 700 9px/1 var(--mono); text-align: center; text-transform: uppercase; }
.pull-progress.kill { border-color: #244837; color: var(--mint); background: #112019; }

.analysis-loading, .analysis-message { min-height: 420px; padding: 48px; display: grid; place-content: center; text-align: center; }
.analysis-loading h3, .analysis-message h3 { margin: 4px 0 12px; font-size: 28px; letter-spacing: -.03em; }
.analysis-loading > p:last-child, .analysis-message > p { max-width: 520px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.65; }
.loader { width: 34px; height: 34px; margin: 0 auto 26px; border: 2px solid var(--line); border-top-color: var(--amber); border-radius: 50%; animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.message-icon { width: 42px; height: 42px; margin: 0 auto 24px; display: grid; place-items: center; border: 1px solid #71413d; border-radius: 50%; color: var(--red); background: #241716; font: 700 18px/1 var(--mono); }
.error-message .eyebrow { color: var(--red); }
.analysis-message .message-note { margin-top: 20px; color: var(--faint); font-size: 11px; }

.result-header { padding: 34px clamp(22px, 4vw, 50px); display: flex; align-items: end; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--line-soft); background: linear-gradient(130deg, rgba(245,182,66,.055), transparent 55%); }
.result-header h3 { margin: 0; font-size: clamp(28px, 3.4vw, 46px); line-height: 1; letter-spacing: -.04em; }
.result-header p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.result-header a { flex: none; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font: 700 10px/1 var(--mono); text-decoration: none; text-transform: uppercase; }
.result-header a:hover { border-color: #826125; color: var(--amber); }
.result-actions { min-width: min(330px, 100%); display: flex; align-items: end; gap: 10px; }
.pull-switcher { min-width: 0; flex: 1; }
.pull-switcher span { display: block; margin-bottom: 7px; color: var(--faint); font: 700 8px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.pull-switcher select { width: 100%; min-height: 34px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: 0; color: var(--text); background: #0b1014; font: 700 10px/1 var(--mono); cursor: pointer; }
.pull-switcher select:focus { border-color: #826125; box-shadow: 0 0 0 3px rgba(245, 182, 66, .08); }

.total-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.total-grid > div { min-width: 0; padding: 22px clamp(16px, 2.5vw, 28px); border-right: 1px solid var(--line-soft); }
.total-grid > div:last-child { border-right: 0; }
.total-grid span, .total-grid strong, .total-grid small { display: block; }
.total-grid span { color: var(--faint); font: 700 9px/1 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.total-grid strong { margin-top: 11px; overflow: hidden; text-overflow: ellipsis; color: var(--text); font: 600 clamp(21px, 2.25vw, 33px)/1 var(--mono); letter-spacing: -.05em; }
.total-grid small { margin-top: 8px; color: var(--faint); font-size: 10px; }
.total-grid .primary-total strong { color: var(--mint); }

.detected-sequence, .intervals { padding: 30px clamp(18px, 4vw, 50px); border-bottom: 1px solid var(--line); }
.subheading { margin-bottom: 22px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font: 700 9px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.subheading > div { display: flex; align-items: center; gap: 10px; }
.subheading h4 { margin: 0; color: var(--text); font: 700 12px/1 var(--sans); letter-spacing: 0; text-transform: none; }
.detected-sequence ol { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; }
.detected-sequence li { position: relative; min-width: 136px; flex: 1; display: grid; grid-template-columns: 28px 1fr; column-gap: 9px; align-items: center; }
.detected-sequence li:not(:last-child)::after { content: ""; position: absolute; z-index: 0; left: 28px; right: 0; top: 14px; height: 1px; background: var(--line); }
.detected-sequence li > span { z-index: 1; grid-row: 1 / span 3; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--faint); font: 700 8px/1 var(--mono); }
.detected-sequence li.shockwave > span { border-color: #896628; color: var(--amber); background: var(--amber-soft); }
.detected-sequence li b { z-index: 1; width: fit-content; padding-right: 8px; background: var(--panel); font-size: 10px; }
.detected-sequence li time { color: var(--text); font: 700 10px/1.5 var(--mono); }
.detected-sequence li small { color: var(--faint); font-size: 9px; }

.intervals { padding-bottom: 42px; background: #0d1216; }
.interval-card { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel); }
.interval-heading { padding: 21px 22px; display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-soft); }
.interval-heading h4 { margin: 0; font: 700 22px/1 var(--sans); letter-spacing: -.03em; }
.interval-heading h4 span { margin: 0 5px; color: var(--amber); }
.interval-time { text-align: right; }
.interval-time b, .interval-time span { display: block; }
.interval-time b { color: var(--amber); font: 700 15px/1 var(--mono); }
.interval-time span { margin-top: 7px; color: var(--faint); font: 9px/1 var(--mono); }
.interval-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line-soft); background: #0d1216; }
.interval-summary > div { padding: 16px 20px; border-right: 1px solid var(--line-soft); }
.interval-summary > div:last-child { border-right: 0; }
.interval-summary span, .interval-summary strong { display: block; }
.interval-summary span { color: var(--faint); font: 700 8px/1 var(--mono); text-transform: uppercase; }
.interval-summary strong { margin-top: 8px; font: 700 16px/1 var(--mono); }
.interval-summary > div:first-child strong { color: var(--mint); }

.ability-header, .ability-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(150px, 1fr) minmax(80px, .7fr) 100px 90px; column-gap: 16px; align-items: center; }
.ability-header { min-height: 40px; padding: 0 20px; color: var(--faint); background: #0b1014; font: 700 8px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.ability-header span:nth-last-child(-n+2) { text-align: right; }
.ability-row { min-height: 62px; padding: 10px 20px; border-top: 1px solid var(--line-soft); }
.ability-row > strong, .ability-row > span { font: 700 11px/1 var(--mono); text-align: right; }
.ability-row > strong { color: var(--mint); }
.ability-row > span { color: var(--muted); }
.ability-label { min-width: 0; display: flex; gap: 10px; align-items: center; }
.ability-label b, .ability-label small, .provider small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ability-label b { font-size: 11px; }
.ability-label small, .provider small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.ability-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px rgba(127,226,186,.3); }
.ability-dot.pet { background: var(--amber); box-shadow: 0 0 8px rgba(245,182,66,.3); }
.provider { position: relative; min-width: 0; padding-right: 40px; font-size: 10px; }
.provider em { position: absolute; top: 50%; right: 0; transform: translateY(-50%); padding: 4px 5px; border: 1px solid #715522; border-radius: 4px; color: var(--amber); font: normal 700 7px/1 var(--mono); text-transform: uppercase; }
.healing-bar { width: 100%; height: 4px; border: 0; border-radius: 9px; overflow: hidden; background: #202a30; }
.healing-bar::-webkit-progress-bar { background: #202a30; }
.healing-bar::-webkit-progress-value { border-radius: 9px; background: var(--mint); }
.healing-bar::-moz-progress-bar { border-radius: 9px; background: var(--mint); }
.ability-total { min-height: 56px; padding: 0 20px; display: grid; grid-template-columns: 1fr 100px 90px; gap: 16px; align-items: center; border-top: 1px solid var(--line); background: #12181d; }
.ability-total b { font-size: 11px; }
.ability-total strong, .ability-total span { font: 700 12px/1 var(--mono); text-align: right; }
.ability-total strong { color: var(--mint); }
.ability-total span { color: var(--muted); }
.no-healing { padding: 34px; color: var(--faint); font-size: 12px; text-align: center; }

.diagnosis-section, .survival-section, .comparison-section, .batch-section, .accretion-section, .healing-summary {
  padding: 32px clamp(18px, 4vw, 50px);
  border-bottom: 1px solid var(--line);
}
.diagnosis-section { background: linear-gradient(145deg, rgba(239, 125, 112, .035), transparent 52%); }
.verdict-banner { margin-bottom: 20px; padding: 24px 26px; border: 1px solid var(--line); border-radius: 12px; background: #0b1014; }
.verdict-banner.critical { border-color: #58332f; box-shadow: inset 4px 0 var(--red); }
.verdict-banner.controlled { border-color: #285040; box-shadow: inset 4px 0 var(--mint); }
.verdict-banner span { color: var(--red); font: 700 9px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.verdict-banner.controlled span { color: var(--mint); }
.verdict-banner h4 { max-width: 900px; margin: 10px 0 0; font-size: clamp(18px, 2.25vw, 29px); line-height: 1.25; letter-spacing: -.025em; }

.finding-list { display: grid; gap: 10px; }
.finding-card { padding: 18px 20px; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 15px; border: 1px solid var(--line-soft); border-radius: 10px; background: #0d1216; }
.finding-marker { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font: 800 12px/1 var(--mono); }
.finding-card.critical .finding-marker { border-color: #71413d; color: var(--red); background: #241716; }
.finding-card.consequence .finding-marker { border-color: #765923; color: var(--amber); background: var(--amber-soft); }
.finding-card.controlled .finding-marker { border-color: #2f614c; color: var(--mint); background: #12241c; }
.finding-card.context .finding-marker, .finding-card.observation .finding-marker, .finding-card.warning .finding-marker { border-color: #765923; color: var(--amber); background: var(--amber-soft); }
.finding-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.finding-meta span, .finding-meta b { font: 700 8px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.finding-meta span { color: var(--faint); }
.finding-meta b { color: var(--muted); }
.finding-card.critical .finding-meta b { color: var(--red); }
.finding-card.consequence .finding-meta b { color: var(--amber); }
.finding-card.warning .finding-meta b { color: var(--amber); }
.finding-card.controlled .finding-meta b { color: var(--mint); }
.finding-card h4 { margin: 8px 0 7px; font-size: 15px; }
.finding-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.finding-card small { display: block; margin-top: 9px; color: var(--faint); font-size: 10px; line-height: 1.55; }

.survival-section { background: linear-gradient(150deg, rgba(245,182,66,.055), transparent 50%), #0b1014; }
.survival-lede { padding: 22px 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 30px; align-items: center; border: 1px solid #56441f; border-radius: 11px 11px 0 0; background: #101419; }
.survival-lede h4 { margin: 7px 0 8px; font-size: clamp(18px, 2vw, 26px); }
.survival-lede p:last-child { max-width: 850px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.checkpoint-route { min-width: 220px; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: baseline; }
.checkpoint-route span { grid-column: 1 / -1; margin-bottom: 6px; color: var(--amber); font: 800 9px/1 var(--mono); text-transform: uppercase; }
.checkpoint-route b { color: var(--text); font: 800 15px/1.2 var(--mono); text-align: right; }
.checkpoint-route i { color: var(--faint); font: normal 8px/1 var(--mono); text-transform: uppercase; }
.survival-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-top: 0; background: #0c1115; }
.survival-metrics > div { min-width: 0; padding: 17px 18px; display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; border-right: 1px solid var(--line-soft); }
.survival-metrics > div:last-child { border-right: 0; }
.survival-metrics span { grid-column: 1 / -1; margin-bottom: 4px; color: var(--faint); font: 700 8px/1 var(--mono); text-transform: uppercase; }
.survival-metrics strong, .survival-metrics b { font: 800 14px/1 var(--mono); text-align: right; }
.survival-metrics strong { color: var(--red); }
.survival-metrics b { color: var(--mint); }
.survival-metrics em { color: var(--faint); font: normal 7px/1 var(--mono); text-transform: uppercase; }
.survival-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 14px; margin-top: 14px; }
.ability-difference-card, .missing-actions-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #0d1216; }
.ability-difference-card > header { min-height: 54px; padding: 0 17px; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.ability-difference-card > header > div:first-child span, .ability-difference-card > header > div:first-child b { display: block; }
.ability-difference-card > header > div:first-child span, .missing-actions-card > header span { color: var(--amber); font: 800 9px/1 var(--mono); text-transform: uppercase; }
.ability-difference-card > header > div:first-child b, .missing-actions-card > header b { margin-top: 5px; color: var(--faint); font: 700 8px/1 var(--mono); }
.ability-difference-card > header > div:last-child { display: grid; grid-template-columns: repeat(3, 1fr); color: var(--faint); font: 700 7px/1 var(--mono); text-align: right; text-transform: uppercase; }
.survival-ability-row { min-height: 53px; padding: 9px 17px; display: grid; grid-template-columns: minmax(170px, 1fr) 86px 86px 86px; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.survival-ability-row:last-child { border-bottom: 0; }
.survival-ability-row.missing, .survival-ability-row.lower { background: linear-gradient(90deg, rgba(239,125,112,.06), transparent 48%); }
.survival-ability-row.composition { opacity: .68; }
.survival-ability-row > div b, .survival-ability-row > div small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.survival-ability-row > div b { font-size: 10px; }
.survival-ability-row > div small { margin-top: 4px; color: var(--faint); font: 7px/1 var(--mono); text-transform: uppercase; }
.survival-ability-row strong, .survival-ability-row > span, .survival-ability-row em { font: 700 10px/1 var(--mono); text-align: right; }
.survival-ability-row strong { color: var(--amber); }
.survival-ability-row > span { color: var(--mint); }
.survival-ability-row em { color: var(--muted); font-style: normal; }
.survival-ability-row.missing em, .survival-ability-row.lower em { color: var(--red); }
.missing-actions-card > header { min-height: 54px; padding: 0 17px; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line-soft); }
.missing-action { padding: 13px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; border-bottom: 1px solid var(--line-soft); }
.missing-action > span { color: var(--text); font-weight: 800; }
.missing-action b { color: var(--red); font: 700 9px/1 var(--mono); }
.missing-action small { grid-column: 1 / -1; color: var(--faint); font: 7px/1.3 var(--mono); text-transform: uppercase; }
.missing-action.composition b { color: var(--muted); }
.protection-gap { padding: 17px; background: var(--amber-soft); }
.protection-gap span, .protection-gap b, .protection-gap small { display: block; }
.protection-gap span { color: var(--amber); font: 800 7px/1 var(--mono); text-transform: uppercase; }
.protection-gap b { margin-top: 7px; font-size: 12px; }
.protection-gap small { margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.survival-actions { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #0d1216; }
.survival-actions > div { padding: 15px 16px; display: grid; grid-template-columns: 24px 1fr; gap: 10px; border-right: 1px solid var(--line-soft); }
.survival-actions > div:last-child { border-right: 0; }
.survival-actions span { color: var(--amber); font: 800 8px/1.5 var(--mono); }
.survival-actions p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.survival-actions p b { display: block; margin-bottom: 3px; color: var(--text); }
.comparison-caveat { margin: 11px 3px 0; color: var(--faint); font-size: 8px; line-height: 1.55; }

.comparison-section { background: #0d1216; }
.comparison-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.comparison-metric { min-width: 0; padding: 17px 18px; display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: baseline; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.comparison-metric:nth-child(3n) { border-right: 0; }
.comparison-metric:nth-last-child(-n+3) { border-bottom: 0; }
.comparison-metric > span { grid-column: 1 / -1; margin-bottom: 5px; color: var(--faint); font: 700 8px/1 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.comparison-metric strong, .comparison-metric b { overflow: hidden; text-overflow: ellipsis; font: 700 15px/1 var(--mono); white-space: nowrap; }
.comparison-metric strong { color: var(--amber); }
.comparison-metric b { color: var(--mint); }
.comparison-metric em { color: var(--faint); font: normal 8px/1 var(--mono); text-transform: uppercase; }
.comparison-metric.critical { box-shadow: inset 3px 0 var(--red); }
.comparison-metric.critical strong { color: var(--red); }
.comparison-metric.good { box-shadow: inset 3px 0 var(--mint); }

.comparison-timeline { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: #090d11; overflow: hidden; }
.timeline-scale, .timeline-compare-row { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; }
.timeline-scale > div { position: relative; height: 17px; border-bottom: 1px solid var(--line-soft); }
.timeline-scale > div span { position: absolute; bottom: 5px; transform: translateX(-50%); color: var(--faint); font: 7px/1 var(--mono); }
.timeline-scale > div span:first-child { transform: none; }
.timeline-compare-row { padding: 16px 0 12px; align-items: start; border-bottom: 1px solid var(--line-soft); }
.timeline-row-label b, .timeline-row-label span { display: block; }
.timeline-row-label b { color: var(--amber); font: 800 10px/1 var(--mono); text-transform: uppercase; }
.timeline-compare-row.reference .timeline-row-label b { color: var(--mint); }
.timeline-row-label span { margin-top: 6px; color: var(--faint); font-size: 9px; }
.timeline-track { position: relative; height: 22px; margin-top: 1px; background: repeating-linear-gradient(90deg, var(--line-soft) 0 1px, transparent 1px 25%); }
.timeline-track::after { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 1px; background: #323c44; }
.timeline-duration { position: absolute; z-index: 1; left: 0; top: 8px; height: 5px; border-radius: 4px; background: rgba(245, 182, 66, .25); }
.reference .timeline-duration { background: rgba(127, 226, 186, .24); }
.timeline-point { position: absolute; z-index: 3; top: 5px; width: 12px; height: 12px; transform: translateX(-50%) rotate(45deg); border: 2px solid #0a0e12; background: var(--muted); box-shadow: 0 0 0 1px var(--line); cursor: help; }
.timeline-point.anchor { left: 0 !important; transform: rotate(45deg); background: var(--text); }
.timeline-point.black-hole { width: 15px; height: 15px; top: 3px; border-radius: 50%; transform: translateX(-50%); background: #87929b; }
.timeline-point.accretion { border-radius: 50%; transform: translateX(-50%); background: #9d77d0; }
.timeline-point.clear { border-radius: 50%; transform: translateX(-50%); background: #be9de9; }
.timeline-point.initial-earthquake { width: 15px; height: 15px; top: 3px; background: #d98b5f; }
.timeline-point.kefka { background: var(--amber); }
.timeline-point.save { border-radius: 50%; transform: translateX(-50%); background: #6ca5d9; }
.timeline-point.premature-save { border-radius: 50%; transform: translateX(-50%); background: var(--red); }
.timeline-point.tankbuster { width: 15px; height: 15px; top: 3px; background: #d35858; }
.timeline-point.earthquake { background: #d98b5f; }
.timeline-point.critical { background: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 12px rgba(239, 125, 112, .5); }
.timeline-end { position: absolute; z-index: 2; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); background: var(--red); }
.timeline-end::after { content: "wipe"; position: absolute; top: -13px; left: 4px; color: var(--red); font: 700 7px/1 var(--mono); text-transform: uppercase; }
.timeline-key { grid-column: 2; margin-top: 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.timeline-chip { padding: 5px 6px; border: 1px solid var(--line-soft); border-radius: 5px; color: var(--muted); background: #0d1216; font: 8px/1 var(--mono); }
.timeline-chip b { margin-right: 5px; color: var(--faint); }
.timeline-chip.critical { border-color: #5e3632; color: var(--red); }
.timeline-legend { padding: 12px 0 0 132px; display: flex; flex-wrap: wrap; gap: 14px; color: var(--faint); font: 8px/1 var(--mono); text-transform: uppercase; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.timeline-legend i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--muted); }
.timeline-legend i.clear { border-radius: 50%; transform: none; background: #be9de9; }
.timeline-legend i.initial-earthquake { background: #d98b5f; }
.timeline-legend i.kefka { background: var(--amber); }
.timeline-legend i.save { border-radius: 50%; transform: none; background: #6ca5d9; }
.timeline-legend i.premature-save { border-radius: 50%; transform: none; background: var(--red); }
.timeline-legend i.tankbuster { background: #d35858; }
.timeline-legend i.earthquake { background: #d98b5f; }

.batch-columns, .accretion-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.batch-column, .accretion-column { min-width: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0d1216; }
.batch-column > header, .accretion-column > header { padding: 16px 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--line-soft); }
.batch-column > header span { color: var(--amber); font: 800 9px/1 var(--mono); text-transform: uppercase; }
.batch-column.reference > header span { color: var(--mint); }
.batch-column > header b { font-size: 12px; }
.batch-column > header small { color: var(--faint); font: 8px/1 var(--mono); }
.batch-column ol { max-height: 520px; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.save-batch { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.save-batch:last-child { border-bottom: 0; }
.save-batch.critical { background: linear-gradient(90deg, rgba(239,125,112,.09), transparent); box-shadow: inset 3px 0 var(--red); }
.save-batch > div { display: flex; justify-content: space-between; gap: 12px; }
.save-batch > div span, .save-batch time { color: var(--faint); font: 700 8px/1 var(--mono); text-transform: uppercase; }
.save-batch p { margin: 9px 0; font-size: 11px; line-height: 1.45; }
.save-batch p small { color: var(--faint); font: 8px/1 var(--mono); }
.unprotected-hit { margin: 9px 0; padding: 8px 9px; display: flex; justify-content: space-between; gap: 10px; border: 1px solid #5e3632; border-radius: 5px; color: var(--red); background: #211514; }
.unprotected-hit b, .unprotected-hit span { font: 700 7px/1.25 var(--mono); }
.unprotected-hit b { text-transform: uppercase; }
.save-batch footer { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: center; }
.save-batch footer b, .save-batch footer span, .save-batch footer em { font: 700 8px/1 var(--mono); }
.save-batch footer b { color: #6ca5d9; }
.save-batch footer span { color: #d98b5f; }
.save-batch footer em { color: var(--faint); font-style: normal; text-align: right; }
.save-batch.critical footer em { color: var(--red); }
.no-batches { padding: 28px; color: var(--faint); font-size: 11px; text-align: center; }

.accretion-section { background: #0d1216; }
.accretion-column > header { grid-template-columns: 1fr auto; }
.accretion-column > header b { color: var(--amber); font: 800 10px/1 var(--mono); text-transform: uppercase; }
.accretion-column.reference > header b { color: var(--mint); }
.accretion-column > header span { color: var(--faint); font: 8px/1 var(--mono); }
.accretion-person { padding: 15px 18px; display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.accretion-person:last-child { border-bottom: 0; }
.role-pill { padding: 5px 6px; border: 1px solid #4a385f; border-radius: 5px; color: #c8abea; font: 700 7px/1 var(--mono); text-align: center; text-transform: uppercase; }
.accretion-person div b, .accretion-person div small { display: block; }
.accretion-person div b { font-size: 11px; }
.accretion-person div small { margin-top: 4px; color: var(--faint); font-size: 9px; }
.accretion-person time { color: var(--muted); font: 8px/1 var(--mono); }

.healing-summary { padding-inline: 0; padding-bottom: 0; }
.healing-summary > .subheading { padding: 0 clamp(18px, 4vw, 50px); }
.total-grid.embedded { border-top: 1px solid var(--line); }
.healing-intervals { padding: 10px clamp(18px, 4vw, 50px) 34px; background: #0d1216; }
.healing-intervals .interval-card { margin-top: 20px; }

.method-note { margin: 28px clamp(18px, 4vw, 50px) 38px; padding: 18px 20px; display: grid; grid-template-columns: 120px 1fr; gap: 20px; border: 1px solid var(--line-soft); border-radius: 9px; background: #0b1014; }
.method-note b { color: var(--amber); font: 700 9px/1.5 var(--mono); text-transform: uppercase; }
.method-note p { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.65; }
.method-note a { color: var(--mint); text-decoration: none; }
.method-note a:hover { text-decoration: underline; }

.footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; color: var(--faint); font: 700 9px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.footer a { color: var(--faint); text-decoration: none; }
.footer a:hover { color: var(--amber); }

@media (max-width: 900px) {
  .app-shell { padding-inline: 18px; }
  .ingest-panel { grid-template-columns: 1fr; gap: 28px; padding-top: 38px; }
  .workspace { grid-template-columns: 1fr; }
  .pull-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .empty-pulls { min-height: 150px; }
  .pull-list { max-height: 330px; }
  .mechanic-primer { grid-template-columns: 1fr; }
  .total-grid { grid-template-columns: repeat(2, 1fr); }
  .total-grid > div:nth-child(2) { border-right: 0; }
  .total-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .ability-header, .healing-bar { display: none; }
  .ability-row { grid-template-columns: minmax(160px, 1fr) minmax(140px, .8fr) 95px 85px; }
  .ability-total { grid-template-columns: 1fr 95px 85px; }
  .survival-lede { grid-template-columns: 1fr; }
  .checkpoint-route { min-width: 0; max-width: 300px; }
  .survival-metrics { grid-template-columns: repeat(2, 1fr); }
  .survival-metrics > div:nth-child(2) { border-right: 0; }
  .survival-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .survival-grid { grid-template-columns: 1fr; }
  .comparison-metrics { grid-template-columns: repeat(2, 1fr); }
  .comparison-metric:nth-child(3n) { border-right: 1px solid var(--line-soft); }
  .comparison-metric:nth-child(2n) { border-right: 0; }
  .comparison-metric:nth-last-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .comparison-metric:nth-last-child(-n+2) { border-bottom: 0; }
  .timeline-scale, .timeline-compare-row { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
  .timeline-legend { padding-left: 98px; }
}

@media (max-width: 560px) {
  .app-shell { padding-inline: 12px; }
  .privacy-badge { font-size: 0; gap: 0; }
  .input-row { display: grid; }
  .input-row button { width: 100%; }
  .form-meta { display: block; }
  .request-status { text-align: left; }
  .result-header { align-items: start; flex-direction: column; }
  .result-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .result-header a { text-align: center; }
  .total-grid { grid-template-columns: 1fr; }
  .total-grid > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .interval-heading { align-items: start; flex-direction: column; }
  .interval-time { text-align: left; }
  .interval-summary { grid-template-columns: repeat(2, 1fr); }
  .interval-summary > div:nth-child(2) { border-right: 0; }
  .interval-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .ability-row { grid-template-columns: minmax(150px, 1fr) 82px 72px; gap: 10px; }
  .provider { grid-column: 1 / -1; grid-row: 2; padding-left: 17px; }
  .ability-total { grid-template-columns: 1fr 82px 72px; gap: 10px; }
  .survival-lede { padding: 18px; }
  .survival-metrics { grid-template-columns: 1fr; }
  .survival-metrics > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .survival-metrics > div:last-child { border-bottom: 0; }
  .ability-difference-card { overflow-x: auto; }
  .ability-difference-card > header, .survival-ability-list { min-width: 620px; }
  .survival-actions { grid-template-columns: 1fr; }
  .survival-actions > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .survival-actions > div:last-child { border-bottom: 0; }
  .comparison-metrics, .batch-columns, .accretion-columns { grid-template-columns: 1fr; }
  .comparison-metric { border-right: 0; }
  .comparison-metric:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .comparison-metric:last-child { border-bottom: 0; }
  .comparison-timeline { padding: 14px 10px; overflow-x: auto; }
  .timeline-scale, .timeline-compare-row { min-width: 620px; }
  .timeline-legend { min-width: 620px; padding-left: 98px; }
  .finding-card { grid-template-columns: 1fr; }
  .finding-marker { width: 28px; height: 28px; }
  .verdict-banner { padding: 20px; }
  .accretion-person { grid-template-columns: 58px minmax(0, 1fr); }
  .accretion-person time { grid-column: 2; }
  .method-note { grid-template-columns: 1fr; gap: 8px; }
  .footer { align-items: start; flex-direction: column; justify-content: center; gap: 9px; }
}
