/* Signal type system, matched to giovannielabs.ai */
:root {
  --ink: #0b1b3a; --ink-2: #33415c; --mute: #5e6b85; --line: #e3e9f3;
  --paper: #f7f9fc; --white: #ffffff; --blue: #037ef3; --blue-deep: #0262c2;
  --blue-ui: #0272dd; --blue-wash: #e8f2fe; --night: #07122a;
  --green: #14804a; --green-wash: #e6f5ec;
  --amber: #a15c00; --amber-wash: #fff4e0;
  --red: #b42318; --red-wash: #fdecea;
  --display: 'Manrope', system-ui, sans-serif; --body: 'Manrope', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --r: 14px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; }
body { font-family: var(--body); color: var(--ink); background: var(--paper); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--blue-ui); }
h1 { font-family: var(--display); font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.025em; margin: 6px 0 10px; }
h2 { font-family: var(--display); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.015em; line-height: 1.15; margin: 28px 0 12px; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
.label { font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-deep); }
.lead { font-size: 1.08rem; color: var(--ink-2); }
.muted { color: var(--mute); }
.fine { font-size: .82rem; color: var(--mute); margin-top: 10px; }
.big { font-family: var(--display); font-size: 1.7rem; font-weight: 800; line-height: 1.2; margin: 4px 0; overflow-wrap: anywhere; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; max-width: 1080px; margin: 0 auto; }
.brand { font-weight: 800; color: var(--ink); text-decoration: none; }
.topbar-link { font-family: var(--mono); font-size: .8rem; text-decoration: none; }
main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 48px; }
.foot { max-width: 1080px; margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--mute); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 .95rem var(--body); padding: 11px 18px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink); text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--blue); }
.btn-primary { background: var(--blue-ui); border-color: var(--blue-ui); color: var(--white); }
.btn-primary:hover { background: var(--blue-deep); }
.btn-small { padding: 8px 14px; font-size: .88rem; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .stage-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Gate */
.gate { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; padding-top: 24px; }
.gate-form h2 { margin-top: 0; }
.gate-form label { display: block; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
.gate-form .check-item { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.gate-form .btn { width: 100%; margin-top: 18px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--red); background: var(--red-wash); padding: 8px 12px; border-radius: 8px; margin-top: 12px; font-size: .9rem; }
input, textarea, select { width: 100%; font: 400 1rem var(--body); color: var(--ink); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white); }
input[type=checkbox] { width: auto; accent-color: var(--blue-ui); }

ul.checks { list-style: none; margin: 10px 0 16px; }
ul.checks li { padding-left: 28px; position: relative; margin: 8px 0; }
ul.checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--blue); }
ol.steps { margin: 10px 0 16px 22px; }
ol.steps li { margin: 8px 0; padding-left: 4px; }

/* Dashboard */
.progress { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 18px 0 6px; }
.progress div { height: 100%; background: var(--green); transition: width .4s; }
.progress-text { font-size: .9rem; color: var(--mute); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .85rem; color: var(--ink-2); margin: 10px 0 18px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: -8px; }
.dot-quick { background: var(--green); } .dot-real { background: var(--blue); } .dot-weeds { background: var(--red); }
.stage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.stage-card { position: relative; display: block; background: var(--white); border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: var(--r); padding: 24px 24px 56px; min-height: 220px; color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.stage-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(11,27,58,.08); }
.stage-card h3 { font-family: var(--display); font-size: 1.45rem; font-weight: 800; line-height: 1.15; margin: 10px 0 6px; }
.stage-card p { font-size: 1.02rem; color: var(--ink-2); margin: 0; }
.stage-num { font-family: var(--mono); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); }
.stage-time { position: absolute; top: 18px; right: 18px; font-family: var(--mono); font-size: .86rem; font-weight: 500; padding: 3px 10px; border-radius: 99px; background: var(--blue-wash); color: var(--blue-deep); }
.stage-status { position: absolute; bottom: 18px; left: 24px; font-size: .9rem; font-weight: 600; color: var(--mute); }
.stage-card.is-quick { border-top-color: var(--green); } .stage-card.is-quick .stage-time { background: var(--green-wash); color: var(--green); }
.stage-card.is-weeds { border-top-color: var(--red); } .stage-card.is-weeds .stage-time { background: var(--red-wash); color: var(--red); }
.stage-card.is-done { background: var(--green-wash); } .stage-card.is-done .stage-status { color: var(--green); }
.stage-card.is-done .stage-status::before { content: "\2713  "; }
.dash-actions, .plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Stage page */
.stage, .plan { max-width: 760px; margin: 0 auto; }
.back { display: inline-block; font-size: .9rem; margin: 8px 0 16px; text-decoration: none; }
.stage header { margin-bottom: 8px; }
.stage.is-weeds header .label { color: var(--red); }
.note { border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.note p { margin: 4px 0 0; }
.note-tip { background: var(--blue-wash); } .note-warn { background: var(--amber-wash); } .note-warn .label { color: var(--amber); }
.case { border-left: 4px solid var(--green); background: var(--white); border-radius: 0 var(--r) var(--r) 0; padding: 16px 20px; margin: 24px 0; }
.case .label { color: var(--green); }
.case-label { font-weight: 700; margin: 4px 0 0; }
.case-result { font-family: var(--display); font-size: 1.3rem; font-weight: 800; line-height: 1.2; margin: 2px 0 8px; }
.exercises { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin: 24px 0; }
.exercises h2 { margin-top: 0; }
.field { margin: 14px 0; }
.field > label, .field-label, .checklist legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.checklist { border: 0; }
.check-item { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: .95rem; }
.print-line { display: none; }
.table-wrap { overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.task-table th { text-align: left; font-size: .78rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--mute); padding: 4px 6px; }
.task-table td { padding: 3px 4px; }
.task-table td:nth-child(2) { width: 110px; } .task-table td:nth-child(3) { width: 90px; text-align: center; } .task-table td:nth-child(4) { width: 130px; }
.task-table input, .task-table select { padding: 7px 8px; font-size: .9rem; }
.live { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
#live-2 { grid-template-columns: 1fr; }
.live ol { margin: 8px 0 0 20px; }
.cost .big { color: var(--red); font-size: 2rem; }
pre.prompt { white-space: pre-wrap; overflow-wrap: anywhere; font: 500 .88rem/1.55 var(--mono); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin: 10px 0 14px; }
.cta-panel { background: var(--night); color: var(--white); border-radius: var(--r); padding: 26px; margin: 28px 0; }
.cta-panel .label { color: #7cc0ff; } .cta-panel h3 { font-family: var(--display); font-size: 1.5rem; font-weight: 800; margin-top: 6px; } .cta-panel p { color: #d5def0; }
.cta-panel .fine { color: #9fb0cf; }
.cta-stuck { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; background: var(--amber-wash); border-radius: var(--r); padding: 16px 18px; margin: 24px 0; }
.cta-stuck p { margin: 0; flex: 1 1 320px; }
.stage-foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 24px; }

/* Plan */
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.plan ol { margin-left: 22px; }

/* Print view on screen */
.print-head { max-width: 760px; margin: 0 auto 24px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.print-head p { margin: 0; color: var(--mute); }
.print-cover { max-width: 760px; margin: 0 auto 32px; }
.print-stage, .print-plan { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .gate { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .live, .plan-grid { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr; }
  .stage-foot .btn, .plan-actions .btn, .dash-actions .btn { flex: 1 1 100%; }
}

/* Gate stage preview */
.gate-preview { list-style: none; counter-reset: s; margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--white); overflow: hidden; }
.gate-preview li { counter-increment: s; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: .92rem; font-weight: 600; }
.gate-preview li:first-child { border-top: 0; }
.gate-preview li span:first-child::before { content: counter(s) ". "; color: var(--mute); }
.gate-preview .stage-time { position: static; font-family: var(--mono); font-size: .76rem; padding: 2px 9px; border-radius: 99px; background: var(--blue-wash); color: var(--blue-deep); white-space: nowrap; }
.gate-preview .is-quick .stage-time { background: var(--green-wash); color: var(--green); }
.gate-preview .is-weeds .stage-time { background: var(--red-wash); color: var(--red); }

/* Click-through stage cards */
.stage-head h1 { margin-bottom: 4px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 12px; }
.card-count { font-family: var(--mono); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mute); }
.dots { display: flex; gap: 6px; }
.dot-step { width: 28px; height: 6px; border-radius: 99px; background: var(--line); }
.dot-step.is-past { background: var(--blue); opacity: .45; }
.dot-step.is-on { background: var(--blue); }
.stage.is-weeds .dot-step.is-on, .stage.is-weeds .dot-step.is-past { background: var(--red); }
.step-card { padding: 28px; min-height: 300px; font-size: 1.06rem; animation: card-in .25s ease; }
.step-card h2 { margin-top: 0; }
.step-card .exercises { border: 0; padding: 0; margin: 0; }
.step-card .case { margin: 0; }
.card-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.finish-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .step-card { animation: none; } }
@media (max-width: 760px) { .step-card { padding: 20px; } .card-nav .btn { flex: 1; } .dot-step { width: 18px; } }

/* Dashboard email CTA */
.dash-cta { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; background: var(--night); color: var(--white); border-radius: var(--r); padding: 20px 24px; margin: 18px 0 8px; }
.dash-cta > div { flex: 1 1 360px; }
.dash-cta strong { font-size: 1.15rem; }
.dash-cta p { color: #d5def0; margin: 4px 0 0; }
.dash-cta .btn { flex: 0 0 auto; }
@media (max-width: 760px) { .dash-cta .btn { flex: 1 1 100%; } }
