:root {
  --bg: #080b09;
  --panel: rgba(17, 22, 18, .88);
  --panel-strong: #111612;
  --text: #f2f0e9;
  --muted: rgba(242, 240, 233, .62);
  --faint: rgba(242, 240, 233, .1);
  --olive: #a9b66f;
  --olive-soft: rgba(169, 182, 111, .16);
  --sand: #e4d6b8;
  --green: #719b6b;
  --radius: 30px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100svh; color: var(--text); background: radial-gradient(circle at 12% 8%, rgba(113,155,107,.16), transparent 32%), radial-gradient(circle at 88% 88%, rgba(228,214,184,.08), transparent 34%), var(--bg); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif; overflow-x: hidden; }
button, a, textarea { font: inherit; -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .12; z-index: 30; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.34'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
.scanline { position: fixed; inset: 0; pointer-events: none; z-index: 29; opacity: .18; background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(255,255,255,.018) 4px); }
.app { min-height: 100svh; position: relative; }
.topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: max(16px, env(safe-area-inset-top)) clamp(18px, 4vw, 48px) 14px; background: linear-gradient(to bottom, rgba(8,11,9,.94), rgba(8,11,9,0)); }
.brand { color: var(--text); text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 11px; letter-spacing: .16em; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid rgba(242,240,233,.2); border-radius: 50%; letter-spacing: 0; }
.system-status { font-family: "SFMono-Regular", Consolas, monospace; color: rgba(242,240,233,.5); font-size: 9px; letter-spacing: .1em; }
.system-status span { width: 6px; height: 6px; display: inline-block; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.screen { min-height: 100svh; display: none; opacity: 0; transform: translateY(10px); padding: 96px 18px 34px; }
.screen.is-active { display: grid; animation: screenIn .65s var(--ease) forwards; }
@keyframes screenIn { to { opacity: 1; transform: none; } }
.opening { place-items: center; }
.terminal-shell { width: min(100%, 880px); }
.terminal-line { margin: 7px 0; color: rgba(169,182,111,.74); font: 12px/1.5 "SFMono-Regular", Consolas, monospace; opacity: 0; animation: terminalIn .5s var(--ease) forwards; }
.delay-1 { animation-delay: .28s; }.delay-2 { animation-delay: .56s; }.delay-3 { animation-delay: .9s; }
@keyframes terminalIn { to { opacity: 1; } }
.opening-copy { margin-top: clamp(45px, 9vw, 100px); opacity: 0; transform: translateY(14px); animation: reveal 1s var(--ease) forwards; }
@keyframes reveal { to { opacity: 1; transform: none; } }
.eyebrow, .card-code, .card-type, .why-box span, .prompt-head span, .delivery-head > div > span, .delivery-label { margin: 0; text-transform: uppercase; letter-spacing: .17em; font-size: 10px; color: rgba(242,240,233,.44); }
h1 { max-width: 930px; margin: 18px 0 22px; font-size: clamp(38px, 7.5vw, 84px); line-height: .95; letter-spacing: -.058em; font-weight: 660; }
.opening-copy > p:not(.eyebrow) { max-width: 650px; color: var(--muted); font-size: clamp(17px, 2.3vw, 22px); line-height: 1.45; }
.primary-btn { border: 0; border-radius: 999px; min-height: 54px; padding: 0 26px; margin-top: 28px; cursor: pointer; background: var(--sand); color: #10120f; font-weight: 720; transition: transform .2s var(--ease), box-shadow .2s; }
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 42px rgba(228,214,184,.12); }
.mission-screen { align-content: start; }
.progress-wrap { position: fixed; z-index: 15; top: 70px; left: clamp(18px,4vw,48px); right: clamp(18px,4vw,48px); }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 9px; font: 10px "SFMono-Regular", Consolas, monospace; color: rgba(242,240,233,.42); letter-spacing: .1em; }
.progress-track { height: 2px; overflow: hidden; background: rgba(242,240,233,.08); }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--olive), var(--sand)); transition: width .55s var(--ease); }
.mission-stage { width: min(100%, 920px); margin: 38px auto 95px; }
.mission-card { border: 1px solid rgba(242,240,233,.11); border-radius: var(--radius); padding: clamp(24px, 5vw, 54px); background: linear-gradient(180deg, rgba(255,255,255,.052), rgba(255,255,255,.018)), radial-gradient(circle at 100% 0, var(--olive-soft), transparent 42%); box-shadow: 0 28px 90px rgba(0,0,0,.28); backdrop-filter: blur(22px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.card-type { margin-top: 7px; color: rgba(169,182,111,.72); }
.save-toggle { border: 1px solid rgba(242,240,233,.13); border-radius: 999px; background: rgba(255,255,255,.03); padding: 10px 14px; cursor: pointer; font-size: 11px; color: var(--muted); }
.save-toggle[aria-pressed="true"] { color: #10120f; background: var(--olive); border-color: var(--olive); }
.soft-intro { margin: 42px 0 12px; color: var(--olive); font-size: 14px; }
.mission-card h2 { margin: 0; max-width: 800px; font-size: clamp(31px, 5.2vw, 60px); line-height: .99; letter-spacing: -.05em; font-weight: 650; }
.card-body { margin: 24px 0 0; max-width: 770px; color: rgba(242,240,233,.75); font-size: clamp(16px, 2.2vw, 20px); line-height: 1.55; }
.why-box { margin-top: 30px; padding: 18px 20px; border-left: 2px solid var(--olive); background: rgba(169,182,111,.07); }
.why-box p { margin: 9px 0 0; color: rgba(242,240,233,.68); line-height: 1.5; }
.micro-steps { display: grid; gap: 10px; margin-top: 28px; }
.micro-step { display: flex; gap: 12px; align-items: flex-start; color: rgba(242,240,233,.72); font-size: 14px; line-height: 1.45; }
.micro-step b { display: grid; place-items: center; flex: 0 0 23px; height: 23px; border: 1px solid rgba(242,240,233,.13); border-radius: 50%; color: var(--olive); font: 10px "SFMono-Regular", Consolas, monospace; }
.prompt-box { margin-top: 34px; overflow: hidden; border: 1px solid rgba(242,240,233,.1); border-radius: 20px; background: rgba(0,0,0,.22); }
.prompt-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid rgba(242,240,233,.08); }
.copy-btn { border: 0; background: transparent; color: var(--sand); cursor: pointer; font-size: 12px; }
.prompt-box pre { margin: 0; padding: 18px; white-space: pre-wrap; word-break: break-word; color: rgba(242,240,233,.72); font: 12px/1.65 "SFMono-Regular", Consolas, monospace; }
.delivery-box { margin-top: 26px; padding: 18px; border: 1px solid rgba(228,214,184,.16); border-radius: 22px; background: rgba(228,214,184,.045); }
.delivery-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.delivery-head p { margin:7px 0 0; max-width:620px; color:var(--muted); font-size:12px; line-height:1.45; }
.sync-state { flex:0 0 auto; border:1px solid rgba(242,240,233,.12); border-radius:999px; padding:7px 10px; color:var(--muted); font:10px "SFMono-Regular",Consolas,monospace; }
.sync-state[data-state="saved"] { color:#d8f1c2; border-color:rgba(169,182,111,.35); background:rgba(169,182,111,.08); }
.sync-state[data-state="working"] { color:var(--sand); }
.sync-state[data-state="error"] { color:#ffb3a9; border-color:rgba(255,120,105,.3); }
.delivery-label { display:block; margin-top:18px; }
#missionNote { width:100%; min-height:130px; margin-top:9px; resize:vertical; border:1px solid rgba(242,240,233,.11); border-radius:16px; padding:14px; outline:none; color:var(--text); background:rgba(0,0,0,.2); line-height:1.5; }
#missionNote:focus { border-color:rgba(169,182,111,.48); box-shadow:0 0 0 3px rgba(169,182,111,.08); }
.upload-row { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:14px; }
.upload-button, .delivery-save { border:1px solid rgba(242,240,233,.13); border-radius:999px; padding:10px 14px; cursor:pointer; background:rgba(255,255,255,.04); }
.upload-button:hover { border-color:rgba(169,182,111,.45); }
#imageHint { color:var(--muted); font-size:11px; }
.image-preview { display:grid; grid-template-columns:92px 1fr; gap:12px; align-items:center; margin-top:14px; padding:10px; border:1px solid rgba(242,240,233,.09); border-radius:16px; background:rgba(0,0,0,.16); }
.image-preview img { width:92px; height:92px; object-fit:cover; border-radius:12px; background:#111; }
.image-preview strong, .image-preview span { display:block; word-break:break-word; }
.image-preview strong { font-size:12px; }
.image-preview span { margin-top:5px; color:var(--muted); font-size:10px; }
.delivery-save { width:100%; margin-top:14px; border:0; background:var(--sand); color:#10120f; font-weight:760; }
.delivery-save:disabled { opacity:.55; cursor:wait; }
.card-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; color: rgba(242,240,233,.38); font: 10px "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.saved-note { color: var(--olive); }
.mission-nav { position: fixed; z-index: 18; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 9px; padding: 7px; border: 1px solid rgba(242,240,233,.1); border-radius: 999px; background: rgba(11,15,12,.82); backdrop-filter: blur(22px); }
.nav-btn, .index-btn { border: 0; cursor: pointer; height: 44px; border-radius: 999px; background: rgba(255,255,255,.045); }
.nav-btn { width: 44px; font-size: 20px; }.nav-btn.next { background: var(--sand); color: #10120f; }
.index-btn { min-width: 84px; padding: 0 16px; color: var(--muted); font: 11px "SFMono-Regular", Consolas, monospace; }
.index-screen { align-content: start; }
.index-shell { width: min(100%, 1100px); margin: 20px auto; }
.index-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.index-title-row h2, .completion-shell h2 { margin: 12px 0 0; font-size: clamp(38px, 7vw, 72px); line-height: .95; letter-spacing: -.055em; }
.close-index { border: 1px solid rgba(242,240,233,.13); border-radius: 999px; padding: 11px 17px; background: transparent; cursor: pointer; }
.index-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 12px; margin-top: 36px; }
.index-item { text-align: left; border: 1px solid rgba(242,240,233,.09); border-radius: 18px; padding: 18px; background: rgba(255,255,255,.025); cursor: pointer; min-height: 132px; }
.index-item:hover { border-color: rgba(169,182,111,.38); }.index-item.done { background: rgba(169,182,111,.08); }
.index-item small { color: var(--olive); font: 9px "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; }.index-item strong { display: block; margin-top: 10px; font-size: 16px; line-height: 1.25; }.index-item span { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; }
.completion-screen { place-items: center; }
.completion-shell { width: min(100%, 800px); }
.completion-shell > p:not(.eyebrow,.terminal-line) { max-width: 620px; color: var(--muted); font-size: 18px; line-height: 1.5; }
.completion-stats { display: flex; gap: 12px; margin-top: 30px; }.completion-stats div { flex: 1; border: 1px solid rgba(242,240,233,.1); border-radius: 20px; padding: 20px; }.completion-stats strong { display: block; font-size: 34px; }.completion-stats span { color: var(--muted); font-size: 12px; }
.toast { position: fixed; z-index: 40; left: 50%; bottom: 95px; transform: translate(-50%, 18px); padding: 12px 16px; border-radius: 999px; background: var(--sand); color: #10120f; font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .28s var(--ease); }.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 620px) { .system-status { display: none; } .mission-card { border-radius: 24px; } .card-head { flex-direction: column; } .save-toggle { align-self: flex-start; } .soft-intro { margin-top: 32px; } .card-footer, .delivery-head { flex-direction: column; } .completion-stats { flex-direction: column; } .sync-state { align-self:flex-start; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }