:root {
    --ink: #172033;
    --muted: #596578;
    --paper: #f4f1ea;
    --surface: #fffdf8;
    --line: #d4cdbf;
    --blue: #07518f;
    --blue-soft: #e5f1fb;
    --amber: #a64b00;
    --amber-soft: #fff0d3;
    --green: #236b3a;
    --green-soft: #e7f5eb;
    --red: #9d261d;
    --red-soft: #fee9e7;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.55; }
a { color: var(--blue); }
.shell { width: min(1100px, calc(100% - 2rem)); margin: 0 auto; }
header { padding: 1.5rem 0 2rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.back-link { display: inline-block; margin-bottom: 1.5rem; font-weight: 800; text-decoration: none; }
.eyebrow { margin: 0 0 .5rem; color: var(--amber); font: 900 .75rem/1.3 var(--mono); letter-spacing: .11em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: .4rem; font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1; letter-spacing: -.04em; }
h2 { margin-bottom: .75rem; font-size: clamp(1.6rem, 3.3vw, 2.4rem); line-height: 1.1; letter-spacing: -.03em; }
.lede { max-width: 800px; margin-bottom: 1rem; color: var(--muted); font-size: 1.1rem; }
.badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.badges span { padding: .35rem .6rem; border: 1px solid #bbc9d8; border-radius: .35rem; background: var(--blue-soft); font-size: .82rem; font-weight: 800; }
.badges .state.completed { border-color: #96c7a3; background: var(--green-soft); color: var(--green); }
.badges .state.rejected { border-color: #e1aaa4; background: var(--red-soft); color: var(--red); }
.badges .state.setup_required { border-color: #e0bb81; background: var(--amber-soft); color: #6a3500; }
main > section { padding: 2.5rem 0; border-bottom: 1px solid var(--line); }
.outcome { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem; align-items: center; }
.outcome > div p { max-width: 780px; color: var(--muted); }
.outcome > div p:last-child { margin-bottom: 0; color: var(--ink); font-weight: 700; }
.primary-action, .secondary-action, button { display: inline-block; border: 0; border-radius: .45rem; background: var(--blue); color: white; padding: .8rem 1rem; font: inherit; font-weight: 850; text-decoration: none; cursor: pointer; }
.secondary-action { border: 2px solid var(--blue); background: transparent; color: var(--blue); }
.source-search > p:not(.eyebrow) { max-width: 800px; color: var(--muted); }
.message, .source-result { margin-top: 1.25rem; padding: 1rem; border-left: 5px solid var(--amber); background: var(--surface); }
.message p, .source-result p { margin-bottom: 0; }
.message.error { border-left-color: var(--red); background: var(--red-soft); color: var(--red); }
.source-result { border-left-color: var(--green); }
.source-result dl, .work-program dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; }
.source-result dl div, .work-program dl div { padding: .75rem; background: #f1f4f7; }
dt { color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
dd { margin: .2rem 0 0; font-weight: 800; }
.source-result li + li { margin-top: .4rem; }
.boundary { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); }
.work-program { margin: 2rem 0 4rem; padding: 1rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface); }
.work-program summary { cursor: pointer; color: var(--blue); font-weight: 850; }
.work-program dl { margin-bottom: 0; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #ffad21; outline-offset: 3px; }
footer { padding: 2rem 0; border-top: 1px solid var(--line); background: #e7e1d5; }
footer .shell { display: flex; justify-content: space-between; gap: 1rem; }

@media (max-width: 700px) {
    .outcome { grid-template-columns: 1fr; }
    footer .shell { flex-direction: column; }
}
