/* Rome workshop: student app. Mobile first: one column, one thing per screen. */
:root {
  --navy: #001D41; --teal: #00AFAA; --teal-dark: #008985; --teal-soft: #E3F6F5;
  --ink: #001D41; --ink-2: #5B6573; --ink-3: #8A93A0; --line: #DDE2E8; --bg: #F4F6F8; --surface: #fff; --red: #D0392E;
  --r: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 400 17px/1.45 "Avenir Next", Avenir, "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
main, .top-row, .steps, .bar-in { width: 100%; max-width: 560px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
main { flex: 1; padding-top: 28px; padding-bottom: 32px; outline: none; }
main > * { animation: in .22s ease-out both; }
/* Movement only, never opacity: if the animation is paused, the screen is still readable. */
@keyframes in { from { transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { main > * { animation: none; } * { transition: none !important; } }

/* Header: who you are, and how far along */
.top { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: max(12px, env(safe-area-inset-top)); }
.top-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); }
.top-who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-save { white-space: nowrap; color: var(--ink-3); }
.top-save.warn { color: var(--red); }
.steps { display: flex; gap: 6px; padding-top: 10px; padding-bottom: 10px; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .2s; }
.steps i.done { background: var(--teal); }
.steps i.now { background: var(--navy); }

/* Type */
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-dark); }
h1 { margin: 0 0 12px; font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
h2 { margin: 28px 0 12px; font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
.lead { font-size: 19px; color: var(--ink-2); }
.muted { color: var(--ink-2); }
.small { font-size: 15px; }

/* Join: names */
.names { display: grid; gap: 10px; margin: 24px 0 8px; }
.name { display: flex; gap: 8px; }
input[type=text], textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: 18px; padding: 14px 16px; outline: none; transition: border-color .15s;
}
input[type=text]:focus, textarea:focus { border-color: var(--teal); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { min-height: 150px; resize: none; line-height: 1.4; }
.x { flex: none; width: 52px; border: 0; border-radius: 14px; background: transparent; color: var(--ink-3); font-size: 26px; line-height: 1; cursor: pointer; }
.x:hover { color: var(--red); }
.add { border: 0; background: none; padding: 12px 4px; font: inherit; font-weight: 600; color: var(--teal-dark); cursor: pointer; }


/* Choices */
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 16px; border: 2px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 18px; line-height: 1.35; transition: border-color .15s, background .15s;
}
.opt b { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--ink-2); font-size: 15px; font-weight: 700; transition: background .15s, color .15s; }
.opt[aria-pressed=true] { border-color: var(--teal); background: var(--teal-soft); }
.opt[aria-pressed=true] b { background: var(--teal); color: #fff; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips .opt { justify-content: center; text-align: center; padding: 14px 10px; font-size: 16px; font-weight: 600; }

/* Bottom bar: the one next step */
.bar { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 78%, transparent); padding: 14px 0 max(16px, env(safe-area-inset-bottom)); }
.bar-in { display: flex; gap: 10px; }
.btn { flex: 1; min-height: 56px; border: 0; border-radius: 28px; background: var(--teal); color: #fff; font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; transition: background .15s, opacity .15s; }
.btn:hover { background: var(--teal-dark); }
.btn:disabled { background: var(--line); color: var(--ink-3); cursor: default; }
.btn.ghost { flex: none; width: 96px; background: transparent; color: var(--ink-2); border: 2px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }
:focus-visible { outline: 3px solid #59CBC8; outline-offset: 2px; }
main:focus-visible { outline: none; }

/* Sent */
.sent { text-align: center; padding-top: 12vh; }
.tick { width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 50%; background: var(--teal); display: grid; place-items: center; }
.tick svg { width: 44px; height: 44px; }
.link { border: 0; background: none; padding: 12px; font: inherit; font-weight: 600; color: var(--teal-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 640px) { main { padding-top: 48px; } h1 { font-size: 34px; } }

/* Context: the case in numbers */
.facts { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 10px; }
.facts li { display: grid; grid-template-columns: 104px 1fr; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--line); }
.facts b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--teal-dark); }
.facts span { color: var(--ink-2); line-height: 1.3; }
.todo { margin: 20px 0; padding: 0; list-style: none; counter-reset: n; display: grid; gap: 14px; }
.todo li { counter-increment: n; display: grid; grid-template-columns: 36px 1fr; gap: 14px; font-size: 19px; line-height: 1.35; }
.todo li::before { content: counter(n); width: 36px; height: 36px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 16px; font-weight: 700; display: grid; place-items: center; }
.top-right { display: flex; align-items: center; gap: 12px; }
.top-case { border: 2px solid var(--line); background: var(--surface); border-radius: 16px; padding: 4px 14px; font: inherit; font-size: 14px; font-weight: 700; color: var(--teal-dark); cursor: pointer; }
.case { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88dvh; border-radius: 24px 24px 0 0; background: var(--bg); color: var(--ink); }
.case::backdrop { background: rgba(0, 29, 65, .45); }
.case-in { padding: 26px 20px max(20px, env(safe-area-inset-bottom)); }
.case .btn { width: 100%; }
@media (min-width: 640px) { .case { margin: auto; border-radius: 24px; } }
.opt strong { display: block; font-weight: 700; margin-bottom: 2px; }
.opt span { flex: 1; }

/* What the agent does: five steps down a line */
.flow { list-style: none; margin: 20px 0; padding: 0; counter-reset: f; }
.flow li { counter-increment: f; position: relative; display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: center; padding: 9px 0; font-size: 18px; line-height: 1.3; }
.flow li::before { content: counter(f); position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 16px; font-weight: 700; display: grid; place-items: center; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 17px; top: 50%; height: 100%; width: 2px; background: var(--line); }
.case { overflow-y: auto; }
.case h2 { margin-top: 20px; }

.opt strong { font-size: 19px; }
.opts { margin-top: 16px; }
.chips .opt { min-height: 60px; align-items: center; }
textarea { min-height: 0; }
