/* Base styles shared by the worksheet. Colours from the "What should I build?" PDF: soft sky blue with a lilac glow. */
@font-face { font-family: "Inter"; font-weight: 400 600; font-display: swap; src: url(/fonts/inter-latin.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 200 800; font-display: swap; src: url(/fonts/plus-jakarta-sans-latin.woff2) format("woff2"); }

:root {
  --ink: #1b2838; --muted: #5d6e84; --faint: #8a98ab; --line: #d4e3f2; --line2: #e6eef7;
  --accent: #4a78c2; --accent-deep: #34599a; --soft: #e8f1fb; --sky: #eef5fc; --card: rgba(255,255,255,.86);
  --lilac: #f2eefd; --ok: #2f8a5b; --ok-bg: #e5f4ec; --warn: #b4552d; --warn-bg: #fbeee6;
  --shadow: 0 1px 2px rgba(27,40,56,.04), 0 8px 28px rgba(27,40,56,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: #eef4fb; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 16px/1.55 Inter, system-ui, -apple-system, sans-serif; background: linear-gradient(160deg, #eaf3fd 0%, #f4f0fd 55%, #e7f1fb 100%) fixed; }
a { color: var(--accent-deep); }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg span { position: absolute; border-radius: 50%; }
.b1 { width: 70vw; height: 70vw; right: -25vw; top: -25vw; background: radial-gradient(circle, rgba(74,120,194,.16), transparent 65%); }
.b2 { width: 60vw; height: 60vw; left: -25vw; top: 40vh; background: radial-gradient(circle, rgba(150,130,220,.14), transparent 65%); }
.b3 { width: 50vw; height: 50vw; right: 5vw; bottom: -25vw; background: radial-gradient(circle, rgba(74,120,194,.10), transparent 65%); }

.top { max-width: 980px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; }
.brand em, h1 em, h2 em { font-style: normal; color: var(--accent); }
.top-actions { display: flex; gap: 8px; }
.top-actions .ghost { white-space: nowrap; }
@media (max-width: 420px) { .top-actions .ghost { padding: 8px 11px; font-size: .82rem; } }

main { max-width: 980px; margin: 0 auto; padding: 8px 20px 48px; }
.view { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1, h2 { font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif; font-weight: 700; margin: 0; letter-spacing: -.02em; }
h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); line-height: 1.02; margin: 22px 0 18px; letter-spacing: -.03em; }
h1 em, h2 em { font-style: normal; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.15; margin-bottom: 10px; }
.kicker { font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36em; margin: 0; }
.sub { color: var(--muted); margin: 0 0 18px; max-width: 40em; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); border: 1px solid rgba(74,120,194,.35); border-radius: 99px; padding: 6px 14px; background: rgba(255,255,255,.6); }
.hint, .opt { font-size: .82rem; color: var(--faint); font-weight: 400; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* buttons */
.primary, .ghost { border-radius: 12px; padding: 10px 18px; cursor: pointer; font-weight: 600; font-size: .95rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .12s, background .12s, border-color .12s; }
.primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.primary:hover { background: var(--accent-deep); }
.primary:disabled { opacity: .5; cursor: default; }
.primary.big { padding: 14px 26px; font-size: 1.05rem; border-radius: 14px; }
.ghost { background: rgba(255,255,255,.7); color: var(--ink); border: 1px solid var(--line); }
.ghost:hover { border-color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* home */
.hero { padding: 24px 0 8px; }
.hero-cta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 28px 0 34px; }
.how { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.how li { background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.how b { display: block; font-family: inherit; font-weight: 700; font-size: 1.8rem; color: var(--accent); line-height: 1; margin-bottom: 6px; }
.how span { font-size: .88rem; color: var(--muted); line-height: 1.4; display: block; }

/* wizard */
.progress { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; font-size: .82rem; color: var(--muted); }
.progress .bar { flex: 1; height: 6px; background: var(--line2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 20%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.step { max-width: 720px; margin: 0 auto; }
.progress { max-width: 720px; margin-left: auto !important; margin-right: auto !important; }
.field { display: block; margin-bottom: 18px; font-weight: 600; font-size: .92rem; }
.field > input, .field > textarea, .field > .chips, .field > .row { margin-top: 8px; }
.field > .chips + input { margin-top: 10px; }
.field > span { display: block; }
input, textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 11px 13px; font-weight: 400; font-size: 1rem; outline: 0; }
input:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 14px; cursor: pointer; font-size: .9rem; font-weight: 500; }
.chips button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips.stack { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.chips.stack button { border-radius: 14px; text-align: left; padding: 12px 14px; }
.chips.stack small { display: block; font-weight: 400; font-size: .8rem; opacity: .75; }
.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.likes { display: grid; gap: 10px; margin-bottom: 10px; }
.like { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.like [data-k=url] { grid-column: 1; grid-row: 1; }
.like .rm { grid-column: 2; grid-row: 1; border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 1rem; padding: 10px 6px; }
.like .meta { grid-column: 1 / 3; font-size: .85rem; color: var(--muted); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.like .meta:empty { display: none; }
.like .meta b { color: var(--ink); font-weight: 600; }
.like .plat { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--soft); color: var(--accent-deep); border-radius: 99px; padding: 2px 8px; }
.like .note { grid-column: 1 / 3; }
.add-like { margin-bottom: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); margin-bottom: 8px; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.err { color: var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.keystatus { font-size: .9rem; margin-bottom: 10px; }
.keystatus b { color: var(--ok); }

/* loading */
.loading { text-align: center; max-width: 560px; margin: 40px auto; padding: 44px 26px; }
.spinner { width: 44px; height: 44px; margin: 0 auto 20px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* results */
.res-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 6px 0 16px; }
.res-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.snapshot { margin-bottom: 16px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.snapshot p { margin: 0 0 8px; }
.snapshot ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.snapshot li { background: var(--soft); color: var(--accent-deep); border-radius: 99px; padding: 4px 11px; font-size: .82rem; font-weight: 600; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters button { border: 1px solid var(--line); background: rgba(255,255,255,.7); border-radius: 99px; padding: 6px 13px; cursor: pointer; font-size: .85rem; }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ideas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.idea { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.idea .top-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.idea .num { font-family: inherit; font-weight: 700; font-size: 1.6rem; color: var(--accent); line-height: 1; }
.idea h3 { margin: 2px 0 0; font-size: 1.12rem; }
.idea .one { margin: 0; color: var(--muted); font-size: .95rem; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: .74rem; font-weight: 600; border-radius: 99px; padding: 3px 9px; background: var(--soft); color: var(--accent-deep); text-transform: capitalize; }
.pill.d1 { background: var(--ok-bg); color: var(--ok); } .pill.d3 { background: var(--warn-bg); color: var(--warn); }
.pill.goal { background: var(--lilac); color: #5b4aa0; }
.idea dl { margin: 0; display: grid; gap: 8px; font-size: .9rem; }
.idea dt { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.idea dd { margin: 2px 0 0; }
.idea ul { margin: 2px 0 0; padding-left: 18px; }
.idea details summary { cursor: pointer; color: var(--accent-deep); font-weight: 600; font-size: .9rem; list-style: none; }
.idea details summary::-webkit-details-marker { display: none; }
.idea details summary::after { content: " ↓"; }
.idea details[open] summary::after { content: " ↑"; }
.idea details[open] summary { margin-bottom: 10px; }
.prompt { position: relative; background: #1b2838; color: #e7eef8; border-radius: 12px; padding: 12px 14px 40px; font: .82rem/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; }
.prompt button { position: absolute; right: 8px; bottom: 8px; border: 0; border-radius: 8px; padding: 5px 10px; background: #2f4466; color: #fff; cursor: pointer; font-size: .78rem; font-family: inherit; }
.next { margin-top: 18px; background: linear-gradient(135deg, #1f3354, #2c4777); color: #eaf0f8; border: 0; }
.next .kicker { color: #9cc0f3; } .next h2 { color: #fff; } .next h2 em { color: #9cc0f3; } .next p { color: #c9d6e8; max-width: 44em; }
.next-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.next .ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.25); }

.history { display: grid; gap: 10px; margin-top: 12px; }
.history button { text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; }
.history b { display: block; } .history span { font-size: .85rem; color: var(--muted); }

/* modal */
.modal { border: 0; padding: 0; border-radius: 22px; width: min(560px, calc(100vw - 24px)); box-shadow: 0 30px 80px rgba(27,40,56,.25); }
.modal::backdrop { background: rgba(15,21,34,.35); }
.modal-in { padding: 26px; }
.prov { display: grid; gap: 8px; margin: 6px 0 14px; }
.pv { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.pv input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.pv b { font-size: .98rem; } .pv small { display: block; color: var(--muted); font-size: .85rem; }
.rec { font-style: normal; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: var(--ok-bg); color: var(--ok); border-radius: 99px; padding: 2px 8px; margin-left: 6px; }
.pv-help { background: var(--sky); border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; font-size: .9rem; }
.pv-help ol { margin: 0; padding-left: 20px; } .pv-help li { margin: 3px 0; }
.tiny { font-size: .78rem; color: var(--faint); margin: 8px 0 0; }
code { background: var(--soft); border-radius: 6px; padding: 1px 6px; font-size: .85em; }

.foot { max-width: 980px; margin: 0 auto; padding: 18px 20px 30px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: .8rem; color: var(--faint); border-top: 1px solid var(--line); }
.foot a { color: var(--muted); text-decoration: none; }

@media (max-width: 760px) {
  .how { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ideas, .snapshot { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; border-radius: 18px; }
  .row { flex-direction: column; }
  .top { padding: 14px 16px; } main { padding: 4px 16px 40px; }
}
@media print {
  .top, .bg, .res-actions, .filters, .next, .foot, .prompt button { display: none !important; }
  body { background: #fff; } .idea, .snapshot { box-shadow: none; break-inside: avoid; }
  .idea details > *:not(summary) { display: block; }
}
