:root {
  --ink: #17221d;
  --muted: #67736d;
  --paper: #f4f2eb;
  --panel: #fffdf8;
  --line: #dcd8cc;
  --green: #23624c;
  --green-soft: #dfeee6;
  --gold: #bd7b26;
  --gold-soft: #f7ead8;
  --red: #a44538;
  --red-soft: #f6e4df;
  --shadow: 0 16px 40px rgba(30, 45, 37, .07);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .28; background-image: radial-gradient(#8f9a93 0.6px, transparent 0.6px); background-size: 18px 18px; }
.masthead { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 18px max(24px, calc((100vw - 1440px)/2)); border-bottom: 1px solid var(--line); background: rgba(255,253,248,.9); backdrop-filter: blur(14px); }
.brand { display: flex; gap: 13px; align-items: center; }
.mark { display: grid; place-items: center; width: 45px; height: 45px; color: #fff; background: var(--green); font-family: Georgia, serif; font-weight: 700; border-radius: 50% 50% 48% 52%; }
h1,h2,h3,p { margin: 0; }
h1 { font: 600 19px/1.1 Georgia, serif; }
h2 { margin-top: 7px; font: 500 clamp(29px,4vw,48px)/1.08 Georgia, serif; letter-spacing: -.025em; }
h3 { margin-top: 4px; font: 500 25px/1.15 Georgia, serif; }
.eyebrow { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.live-state { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca49f; box-shadow: 0 0 0 4px #e3e5e2; }
.dot.live { background: #2e9c72; box-shadow: 0 0 0 4px #d9eee6; }
main { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 28px 24px 64px; }
.panel { background: rgba(255,253,248,.95); border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero { display: flex; justify-content: space-between; gap: 36px; align-items: end; padding: 34px 38px; border-radius: 2px 34px 2px 2px; }
.muted { color: var(--muted); font-size: 12px; }
#request-id { margin-top: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.status-stack { width: min(330px,36%); }
.status,.stage { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 7px 11px; color: var(--muted); background: #ecece8; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.status.processing,.stage.processing { color: #8a5919; background: var(--gold-soft); }
.status.completed,.stage.completed { color: var(--green); background: var(--green-soft); }
.status.failed,.stage.failed { color: var(--red); background: var(--red-soft); }
.progress-track { height: 7px; margin: 15px 0 8px; overflow: hidden; background: #e6e5df; border-radius: 99px; }
.progress-bar { width: 0; height: 100%; background: linear-gradient(90deg,var(--green),#53a780); transition: width .4s ease; }
.summary-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 12px 0; }
.metric { min-height: 134px; padding: 20px; border-top: 3px solid #c9d8d0; }
.metric.payment { border-top-color: #dfb471; }
.metric p { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.metric strong { display: block; overflow-wrap: anywhere; margin: 12px 0 8px; font: 500 27px/1 Georgia, serif; }
.metric span { color: var(--muted); font-size: 11px; }
.workspace { display: grid; grid-template-columns: minmax(0,2.1fr) minmax(300px,.9fr); gap: 12px; align-items: start; }
.main-column { display: grid; gap: 12px; }
.section-card { padding: 27px; }
.section-heading { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 24px; }
.sticky { position: sticky; top: 16px; }
.task-list { display: grid; gap: 8px; }
.task { padding: 0; border: 1px solid var(--line); background: #fff; }
.task summary { display: grid; grid-template-columns: 34px 1fr auto 18px; gap: 12px; align-items: center; padding: 13px 14px; cursor: pointer; list-style: none; }
.task summary::-webkit-details-marker { display: none; }
.task summary::after { content: "+"; grid-column: 4; color: var(--muted); font-weight: 800; }
.task[open] summary::after { content: "−"; }
.task .task-state { grid-column: 3; grid-row: 1; margin-right: 22px; }
.task-detail { padding: 2px 15px 15px 60px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.task-detail > p { margin-bottom: 10px; }
.task-detail dl { display: grid; grid-template-columns: 1fr 2fr; gap: 5px 12px; margin: 0; }
.task-detail dl div { display: contents; }
.task-detail dt { font-weight: 750; }
.task-detail dd { margin: 0; overflow-wrap: anywhere; }
.task-index { display: grid; place-items: center; width: 29px; height: 29px; color: var(--muted); background: var(--paper); border-radius: 50%; font: 700 11px Georgia,serif; }
.task strong { display: block; font-size: 13px; }
.task p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.task-state { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.task.completed .task-state { color: var(--green); }
.task.researching .task-state { color: var(--gold); }
.task.failed .task-state { color: var(--red); }
.filter input { width: 180px; padding: 9px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.fact-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.fact { padding: 16px; border-left: 3px solid #9fbbae; background: #f9f8f3; }
.fact .path { color: var(--green); font: 700 10px ui-monospace,monospace; text-transform: uppercase; }
.fact .value { margin: 9px 0; overflow-wrap: anywhere; font: 500 17px/1.35 Georgia,serif; }
.fact .meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 10px; }
.fact a { display: block; overflow: hidden; margin-top: 9px; color: var(--green); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 13px; margin-top: 18px; color: var(--muted); font-size: 11px; }
.pagination button,.secondary-button { padding: 7px 11px; color: var(--green); background: #fff; border: 1px solid var(--line); cursor: pointer; }
.pagination button:disabled { cursor: not-allowed; opacity: .45; }
.activity-notice { margin: -8px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.agent-activity { max-height: 560px; overflow: auto; user-select: text; }
.activity-session + .activity-session { margin-top: 16px; }
.activity-session-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.activity-timeline { margin: 0; padding: 0 0 0 22px; border-left: 2px solid #d9e5de; list-style: none; }
.activity-timeline li { position: relative; padding: 10px 12px; }
.activity-timeline li::before { content: ""; position: absolute; left: -28px; top: 17px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); }
.activity-timeline strong { display: block; font-size: 12px; }
.activity-timeline p { margin: 4px 0; color: #46514b; font-size: 11px; line-height: 1.5; }
.activity-timeline time { color: var(--muted); font: 9px ui-monospace,monospace; }
.analysis-card { min-height: 330px; }
.conclusion { padding: 22px; border-left: 4px solid var(--green); background: var(--green-soft); }
.conclusion strong { display: block; margin-bottom: 8px; font: 600 22px Georgia,serif; text-transform: capitalize; }
.conclusion p { line-height: 1.6; }
.analysis-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-top: 12px; }
.analysis-block { padding: 18px; background: #f8f6ef; border: 1px solid var(--line); }
.analysis-block h4 { margin: 0 0 13px; font: 600 12px Georgia,serif; text-transform: uppercase; letter-spacing: .08em; }
.analysis-block dl { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin: 0; font-size: 12px; }
.analysis-block dd { margin: 0; font-weight: 700; text-align: right; }
.analysis-block ul { margin: 0; padding-left: 18px; color: #3e4843; font-size: 12px; line-height: 1.55; }
.details { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.details div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.details dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.details dd { margin: 5px 0 0; overflow-wrap: anywhere; font: 600 13px ui-monospace,monospace; }
.privacy-note { margin-top: 21px; padding: 15px; color: #4f5b55; background: #edf1ee; font-size: 11px; line-height: 1.5; }
.privacy-note p { margin-top: 5px; }
.followup-intro { max-width: 850px; margin: -8px 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
#followup-form { display: grid; gap: 11px; }
#followup-form > label,#followup-form legend { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
#followup-prompt { width: 100%; min-height: 112px; resize: vertical; padding: 14px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: 13px/1.5 inherit; }
#followup-prompt,.paid-followup textarea,.followup-item { user-select: text; }
.copy-row { display: flex; justify-content: flex-end; }
#followup-prompt:focus { outline: 2px solid #8bb7a4; outline-offset: 1px; }
#followup-form fieldset { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 13px 15px; border: 1px solid var(--line); }
#followup-form fieldset label { color: #3e4843; font-size: 12px; }
.followup-actions { display: flex; align-items: center; gap: 14px; }
.followup-actions button { padding: 11px 16px; color: #fff; background: var(--green); border: 0; cursor: pointer; font-weight: 750; }
.followup-actions button:disabled { cursor: not-allowed; opacity: .5; }
#followup-message { color: var(--muted); font-size: 12px; }
.charge-boundary { margin: 18px 0; padding: 14px 16px; color: #614416; background: var(--gold-soft); font-size: 12px; line-height: 1.5; }
.charge-boundary p { margin-top: 4px; }
.followup-history { display: grid; gap: 9px; }
.followup-item { padding: 16px; border: 1px solid var(--line); background: #faf9f4; }
.followup-item-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.followup-item > p { margin: 10px 0 8px; font-size: 13px; line-height: 1.5; }
.followup-item small { color: var(--muted); }
.paid-followup { margin-top: 12px; padding: 12px; color: #614416; background: var(--gold-soft); font-size: 11px; }
.paid-followup { display: grid; gap: 9px; }
.paid-followup label { color: #614416; font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.paid-followup textarea { width: 100%; resize: vertical; padding: 9px; color: var(--ink); background: #fff; border: 1px solid var(--line); font: 11px/1.4 ui-monospace,monospace; }
.payment-button { width: fit-content; padding: 11px 16px; color: #fff; background: var(--gold); border: 0; cursor: pointer; font-weight: 800; }
.payment-button:disabled { cursor: not-allowed; opacity: .5; }
.empty { padding: 34px 10px; color: var(--muted); font: italic 15px Georgia,serif; text-align: center; }
footer { position: relative; z-index: 1; padding: 24px; color: var(--muted); border-top: 1px solid var(--line); background: #eeece4; font-size: 10px; text-align: center; }
@media (max-width: 980px) { .summary-grid { grid-template-columns: repeat(2,1fr); } .workspace { grid-template-columns: 1fr; } .sticky { position: static; } }
@media (max-width: 640px) { .masthead { padding: 14px 16px; } main { padding: 16px 12px 44px; } .hero { display: block; padding: 25px 20px; } .status-stack { width: 100%; margin-top: 24px; } .summary-grid,.fact-list,.analysis-grid { grid-template-columns: 1fr; } .section-card { padding: 20px; } .section-heading { align-items: flex-start; } .filter input { width: 130px; } }

.billing-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; margin:18px 0; }
.billing-grid label { display:flex; flex-direction:column; gap:6px; }
.billing-grid input, select, #opportunity-fields input { padding:10px; border:1px solid #cbd5e1; border-radius:7px; max-width:100%; }
.billing-grid .consent { grid-column:1/-1; display:block; font-size:.9rem; }
#payment-element, #link-authentication { max-width:600px; margin:16px 0; }
[hidden] { display:none !important; }
#recovery-response { display:block; width:100%; min-height:130px; margin:10px 0; padding:12px; border:1px solid var(--line); border-radius:7px; font:inherit; resize:vertical; }
#recovery-questions li { margin:8px 0; }
#recovery-form > label { display:block; margin-top:16px; font-weight:600; }

.billing-panel { margin-bottom:24px; }
.billing-panel h2 { margin:8px 0 20px; }
.billing-panel h3 { margin-top:22px; }
.billing-panel p { margin:12px 0; line-height:1.6; color:var(--muted); font-size:13px; }
.billing-panel select { margin-left:8px; font:inherit; background:#fff; border:1px solid var(--line); padding:10px; }
.billing-panel button { padding:12px 18px; width:fit-content; color:#fff; background:var(--green); border:0; cursor:pointer; font-weight:750; font-size:13px; }
.billing-panel button:disabled { opacity:.5; cursor:not-allowed; }
.billing-panel label { font-size:13px; line-height:1.5; }
.billing-panel input { font:inherit; min-width:0; }
.billing-panel input:focus { outline:2px solid #8bb7a4; outline-offset:1px; }
#opportunity-fields label { display:block; margin:14px 0; }
@media(max-width:640px) { .billing-grid { grid-template-columns:1fr; } .billing-panel select { display:block; margin:8px 0; width:100%; } }
/* Private purchase results remain readable on narrow screens. */
.purchase-result { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }

.report-card { border-top: 1px solid var(--line, #dce5eb); margin-top: 1.25rem; padding: 1rem 0; }
.report-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.report-actions a { color: var(--accent, #197c85); text-decoration: underline; }
