/* Startup DocBot — Studio Profile and Financial Planning (app.js). The shared look (colors, header, framed panel,
   buttons, input boxes) is in theme.css, loaded first. */
:root { --max: 600px; --max-wide: 1040px; }
.num { font-variant-numeric: tabular-nums; }

/* the panel's width follows the view: questions in a narrow panel, results and the review in a wide one */
main.panel[data-view="wizard"] { max-width: 720px; }
/* the header and copyright line up with the narrow panel */
body:has(main.panel[data-view="wizard"]) .top, body:has(main.panel[data-view="wizard"]) .sitefoot { max-width: 760px; }

/* progress */
.progress { display: flex; gap: 4px 6px; justify-content: center; flex-wrap: wrap; padding: 0 0 14px; margin: -6px auto 6px; width: 100%; border-bottom: 1.5px solid var(--tan); }
.progress span { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 4px 9px; border-radius: 4px; }
.progress span.done { color: var(--ink); }
.progress span.now { color: var(--cream); background: var(--tile); font-weight: 500; }
@media (max-width: 420px) { .progress span { padding: 3px 6px; letter-spacing: .02em; } }

/* wizard */
main { width: 100%; }
.screen { max-width: var(--max); margin: 8px auto 0; padding: 0 4px; }
.screen .intro { color: var(--ink-2); font-size: 16px; margin: -10px 0 20px; }
.screen h1 { font-size: 36px; margin: 18px 0 22px; display: flex; align-items: center; gap: 12px; }
@media (max-width: 480px) { .screen h1 { font-size: 30px; } }
.field { margin: 0 0 22px; }
.field > label, .field > .label { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 500; margin-bottom: 8px; }
.field .sub { font-size: 14.5px; color: var(--ink-3); margin: -4px 0 8px; }
.inputwrap { display: flex; align-items: stretch; gap: 0; }
.inputwrap .unit { display: flex; align-items: center; background: var(--card-under); border: 1.5px solid var(--ink); border-right: 0; border-radius: 6px 0 0 6px; padding: 10.5px 12px; color: var(--ink-2); font-size: 15px; }
.inputwrap .unit + input { border-radius: 0 6px 6px 0; }
.inputwrap input + .unit { border-left: 0; border-right: 1.5px solid var(--ink); border-radius: 0 6px 6px 0; }
.inputwrap input + .unit ~ * { display: none; }
input[type=text], input[type=number], input[type=month], select { width: 100%; padding: 10.5px 13px; font-size: 18px; min-width: 0; }
input.suffix { border-radius: 6px 0 0 6px; }
input[type=email], input[type=date] { width: 100%; padding: 10.5px 13px; font-size: 18px; min-width: 0; }
input[type=date] { max-width: 260px; }
/* company setup: one founder per block, and the LLC or corporation comparison */
.rowp { display: grid; grid-template-columns: 210px 1fr; gap: 12px; align-items: center; }
.rowp .name { font-size: 16px; }
.field.person > .label { justify-content: space-between; font-size: 16.5px; }
@media (max-width: 560px) { .rowp { grid-template-columns: 1fr; gap: 4px; } }
table.fin.compare { table-layout: fixed; border: 1.5px solid var(--ink); border-radius: 6px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.fin.compare th, table.fin.compare td { white-space: normal; text-align: left; vertical-align: top; }
table.fin.compare thead th { text-transform: none; font-family: inherit; font-size: 15px; letter-spacing: 0; }
table.fin.compare tbody th { width: 26%; font-weight: 500; }
@media (max-width: 560px) { table.fin.compare th, table.fin.compare td { padding: 7px 6px; font-size: 14px; } }
.check:focus-within, .choice:focus-visible { outline: 3px solid var(--arrow); outline-offset: 1px; }
input.bad { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.err { color: var(--red); font-size: 14.5px; margin-top: 6px; font-weight: 500; }
.note { font-size: 14.5px; color: var(--ink-3); margin-top: 8px; }
.preset { font-size: 14px; color: var(--ink-3); margin-top: 6px; }

/* choices: pale boxes like the inputs; a chosen one turns dark, like the home page's number tiles */
.choices { display: grid; gap: 8px; }
.choices.row { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.choice { display: flex; align-items: center; gap: 10px; padding: 10.5px 13px; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--field); cursor: pointer; text-align: left; }
.choice:hover { background: #fff7e6; }
.choice.on { background: var(--tile); color: var(--cream); }
.choice.off { background: var(--card-under); border-style: dashed; color: var(--ink-3); cursor: not-allowed; } /* still readable: it says why */
.choice .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-2); flex: 0 0 auto; }
.choice.on .dot { border-color: var(--cream); background: radial-gradient(circle, var(--cream) 40%, transparent 46%); }
.choice .box { width: 18px; height: 18px; border-radius: 3px; border: 2px solid var(--ink-2); flex: 0 0 auto; }
.choice.on .box { border-color: var(--cream); background: var(--cream) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5 6.6 11.5 12.5 4.8' fill='none' stroke='%231c363d' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center / 14px no-repeat; } /* a check mark, as on Legal Documents */
.choice small { display: block; color: var(--ink-3); font-size: 13.5px; }
.choice.on small { color: var(--cream-2); }
.choices.grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

/* per-store tables */
.rows { display: grid; gap: 10px; }
.rowf { display: grid; grid-template-columns: 1fr 150px; gap: 12px; align-items: center; }
.rowf .name { font-size: 16px; }
.rowf.tier .name { font-size: 15px; color: var(--ink-2); padding-left: 18px; }
[data-key="takeRates"] .rowf { grid-template-columns: 1fr 170px; }
[data-key="takeRates"] .rowf.tier { grid-template-columns: 1fr 210px; }
/* the 12-month row (user acquisition spend): a cell for each of the first 12 months after launch */
.m12 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; }
.m12c { display: grid; gap: 4px; }
.m12l { font-size: 13px; color: var(--ink-2); font-family: var(--mono, inherit); letter-spacing: 0.02em; }
.m12 .inputwrap .unit { padding: 8px 8px; font-size: 13px; }
.m12 input { padding: 8px 8px; font-size: 15px; min-width: 0; -moz-appearance: textfield; appearance: textfield; }
.m12 input::-webkit-outer-spin-button, .m12 input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 480px) { .m12 { grid-template-columns: repeat(3, 1fr); gap: 8px 6px; } .m12 input { padding: 8px 6px; } .m12 .inputwrap .unit { padding: 8px 6px; } }

/* help */
/* the "?" buttons: 26px, with a 44px tap area */
.q { position: relative; display: inline-flex; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ink); color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 500; align-items: center; justify-content: center; background: none; cursor: pointer; padding: 0; line-height: 1; flex: 0 0 auto; }
.q::after { content: ''; position: absolute; inset: -9px; }
.dialog p .q { margin-left: 8px; vertical-align: middle; }
.q:hover, .q[aria-expanded=true] { background: var(--tile); border-color: var(--tile); color: var(--cream); }
.pop { position: absolute; z-index: 60; max-width: 320px; background: var(--tile); color: var(--cream); padding: 12px 14px; border-radius: 7px; border: 1.5px solid var(--frame); font-size: 15px; font-weight: 400; line-height: 1.4; box-shadow: 3px 4px 0 rgba(14, 27, 32, .35); }
.pop:after { content: ''; position: absolute; top: -6px; left: calc(var(--ax, 24px) - 6px); border: 6px solid transparent; border-top: 0; border-bottom-color: var(--tile); }

/* nav */
.nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; }

/* money strip: a console readout fixed to the bottom of the window */
.strip { position: fixed; left: 0; right: 0; bottom: 0; background: var(--frame); border-top: 2px solid var(--tan); padding: 10px 18px; display: none; z-index: 10; color: var(--cream); }
.strip.show { display: block; }
.strip .in { max-width: var(--max-wide); margin: 0 auto; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.strip .kp { display: flex; gap: 22px; flex-wrap: wrap; }
.strip .kp div { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--cream-2); }
.strip .kp b { display: block; font-family: var(--sans); font-size: 17px; letter-spacing: 0; text-transform: none; color: var(--cream); font-weight: 500; }
.strip .kp b.neg { color: var(--neg-dark); }
.strip svg { display: block; }
@media (max-width: 640px) { /* a single compact row on phones */
  .strip { padding: 8px 12px; } .strip .in { grid-template-columns: 1fr; } .strip svg { display: none; }
  .strip .kp { flex-wrap: nowrap; gap: 12px; justify-content: space-between; } .strip .kp div { font-size: 12px; letter-spacing: .02em; } .strip .kp b { font-size: 15px; }
  body:has(input:focus) .strip { visibility: hidden; transition: none; } /* out of the keyboard's way while typing */
  .strip.show { transition: visibility 0s linear .4s; } /* back 0.4 s after the field lets go, so the tap that moved focus (Next, a button) lands on what was under it, not on the strip */
}

/* month picker */
.mp { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 10px 12px 12px; }
.mp-year { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 20px; font-weight: 500; margin-bottom: 8px; }
.mp-nav { background: var(--field); border: 1.5px solid var(--ink); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 20px; line-height: 1; color: var(--ink); }
.mp-nav:hover { background: var(--tile); color: var(--cream); }
.mp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mp-m { background: var(--field); border: 1.5px solid var(--ink); border-radius: 6px; padding: 10px 0; cursor: pointer; font-size: 16px; }
.mp-m:hover { background: #fff7e6; }
.mp-m.on { background: var(--tile); color: var(--cream); font-weight: 500; }
.mp-m.off { background: var(--card-under); border-color: var(--rule); color: var(--ink-3); cursor: not-allowed; }
.mp-sel { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
.total { display: flex; align-items: baseline; gap: 12px; margin-top: 12px; font-size: 22px; font-weight: 500; color: var(--ink); }
.total small { font-size: 14.5px; font-weight: 400; color: var(--ink-3); }
.total.bad { color: var(--red); } .total.bad small { color: var(--red); }
.total.good { color: var(--green); } .total.good small { color: var(--green); }

/* results */
.results { max-width: var(--max-wide); margin: 0 auto; padding: 0 4px; }
.results header h1 { font-size: 38px; margin: 10px 0 6px; }
@media (max-width: 480px) { .results header h1 { font-size: 30px; } }
.results header p { margin: 0 0 18px; color: var(--ink-2); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs button { background: var(--field); border: 2px solid var(--ink); border-radius: var(--radius); padding: 10px 18px; color: var(--ink); cursor: pointer; white-space: nowrap;
  font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; box-shadow: 3px 3px 0 var(--ink); }
.tabs button:hover { background: #fff7e6; }
.tabs button.on { background: var(--tile); color: var(--cream); }
/* calculated numbers sit on dark tiles, like the home page's 01–03 */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 22px; }
/* label on top, value at the bottom, so values line up across a row */
.tile { display: flex; flex-direction: column; background: var(--tile); color: var(--cream); border-radius: 6px; padding: 12px 14px 14px; }
.tile small { display: block; color: var(--cream-2); font-family: var(--mono); font-size: 13.5px; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3; }
/* the value sizes itself to its tile, so a 7-figure number never runs out of it */
.tile { container-type: inline-size; }
.tile b { display: block; font-size: clamp(16px, 13cqi, 25px); white-space: nowrap; font-weight: 500; margin-top: auto; padding-top: 8px; letter-spacing: -.01em; }
.tile b.text { white-space: normal; }
@media (max-width: 480px) { .tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } .tile { padding: 10px 11px 12px; } .tile small { font-size: 12.5px; letter-spacing: .02em; } }
@media (max-width: 400px) { .tiles { grid-template-columns: minmax(0, 1fr); } } /* narrow phones: 1 a row */
.tile b.neg { color: var(--neg-dark); } .tile b.amber { color: var(--amber-dark); } .tile b.text { font-size: clamp(16px, 11cqi, 19px); }
.band { font-family: var(--mono); font-weight: 500; font-size: 13.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1.5px solid var(--tan); }
.charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.charts.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } /* app.js chartW decides, and draws each chart at its width */
.chart { background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 12px 14px; }
.chart h3 { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 8px; color: var(--ink); }
.chart svg { width: 100%; height: auto; display: block; }
.chart .legend { font-size: 13.5px; color: var(--ink-3); margin: 4px 0 0; }

table.fin { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--card); }
.scroll { overflow-x: auto; border: 1.5px solid var(--ink); border-radius: 6px; }
.scroll > table.fin { border: 0; }
table.fin th, table.fin td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.fin th:first-child, table.fin td:first-child { text-align: left; white-space: normal; }
table.fin td.ans { text-align: left; white-space: normal; overflow-wrap: anywhere; }
table.fin th { color: var(--ink); background: var(--card-under); font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; }
table.fin tr:last-child td { border-bottom: 0; }
table.fin tr.sum td { font-weight: 500; border-top: 1.5px solid var(--ink); }
table.fin tr.sec td { color: var(--teal-ink); font-weight: 500; padding-top: 16px; border-bottom: 0; }
table.fin tr.sub td { color: var(--teal-ink); font-weight: 500; padding-top: 14px; border-bottom: none; font-size: 0.92em; }
table.fin td.neg { color: var(--red); }
table.fin td.dim { color: var(--ink-3); }
table.fin tr.dimrow td { color: var(--ink-3); font-style: italic; }
table.fin th.launch, table.fin td.launch { background: #f0cfa6; }
table.fin th.launch { color: var(--act-hover); }
table.fin th small { font-size: 1em; }
/* wide tables: row labels stay put while the months scroll */
.scroll table.fin th:first-child, .scroll table.fin td:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 10em; box-shadow: 1px 0 0 var(--rule); }
.scroll table.fin th:first-child { background: var(--card-under); }
.scroll table.fin tr.todo td:first-child { background: #f6d9b0; }
/* Check your answers */
table.fin.rev { table-layout: fixed; border: 1.5px solid var(--ink); border-radius: 6px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.fin.rev td:first-child { width: 42%; }
table.fin.rev td:last-child { width: 64px; }
table.fin.rev tr.sec td { background: var(--panel); font-family: var(--mono); font-size: 13px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 8px; }
@media (max-width: 560px) { table.fin.rev td:first-child { width: 44%; } table.fin.rev td { padding: 7px 6px; } table.fin.rev td:last-child { width: 48px; } }
table.fin tr.todo td { background: #f6d9b0; }
.need { display: inline-block; font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--amber); border: 1.5px solid var(--amber); border-radius: 4px; padding: 1px 7px; }
.todo-note, .warn { background: var(--card); border: 1.5px solid var(--ink); border-left: 6px solid var(--arrow); padding: 12px 14px; border-radius: 6px; font-size: 15.5px; color: var(--ink-2); margin: 0 0 14px; }

.scrollhint { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; color: var(--ink-3); margin: 6px 0 14px; text-align: right; }
.runway-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 4px; }
@media (prefers-reduced-motion: no-preference) { .screen { animation: in .18s ease-out; } @keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } } }

/* milestone rows, advanced fold */
.msrow { display: grid; grid-template-columns: 1fr 150px 150px 28px; gap: 10px; align-items: center; }
.msrow.named { grid-template-columns: 1.2fr 140px 150px 28px; }
.msrow.named .name { display: none; }
.msrow .linkbtn { min-width: 36px; min-height: 36px; padding: 4px; font-size: 20px; color: var(--ink-2); }
.linkbtn.add { font-size: 15.5px; margin-top: 6px; }
@media (max-width: 560px) { .msrow, .msrow.named { grid-template-columns: 1fr 1fr 28px; } .msrow .name { grid-column: 1 / -1; } .msrow.named input[type=text] { grid-column: 1 / 3; } }
.adv { margin: 22px 0; background: var(--card); border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 10px 14px; }
.adv summary { padding: 8px 0; cursor: pointer; font-family: var(--mono); font-size: 13.5px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.adv .rows { margin-top: 10px; }

/* notes */
.addnote { margin-top: 6px; }
.addnote .notebox { display: none; width: 100%; margin-top: 6px; font: inherit; font-size: 15px; padding: 8px 10px; }
.addnote.open .notebox { display: block; }

/* dialogs (download, Edit on Check your answers): the panel in miniature */
.overlay { position: fixed; inset: 0; background: rgba(8, 18, 22, .72); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.dialog { position: relative; background: var(--panel) var(--noise); border: 2px solid var(--frame); border-radius: 14px; padding: 30px 30px 26px; max-width: 480px; width: 100%;
  box-shadow: inset 0 0 0 5px var(--tan), 0 18px 60px rgba(0, 0, 0, .45); }
.dialog::before { content: ''; position: absolute; inset: 12px; border: 2px solid var(--ink); border-radius: 8px; pointer-events: none; }
.dialog h2 { margin: 0 0 12px; font-size: 28px; }
.dialog.edit { max-width: 640px; max-height: calc(100vh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.dialog.edit .field:last-of-type { margin-bottom: 8px; }
.dialog.edit .nav { margin-top: 18px; }
.dialog p { margin: 0 0 8px; }
.dialog .radios { display: flex; gap: 18px; margin: 6px 0 10px; font-size: 17px; }
.dialog .radios label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.dialog .radios input { accent-color: var(--tile); width: 18px; height: 18px; }
.dialog .meta { display: none; gap: 8px; flex-direction: column; margin: 8px 0 12px; }
.dialog .meta.open { display: flex; }
.dialog .meta label { display: flex; flex-direction: column; gap: 4px; font-family: var(--mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.dialog .meta input { font-family: var(--sans); font-size: 16px; letter-spacing: 0; text-transform: none; padding: 8px 10px; }
.dialog .status { min-height: 22px; font-size: 14.5px; color: var(--ink-2); margin: 4px 0 8px; }
.dialog .nav { display: flex; justify-content: space-between; margin-top: 10px; }
@media (max-width: 480px) { .dialog { padding: 26px 20px 22px; } .dialog::before { inset: 10px; } }
/* the Project Budget's switch on the forecast's first Costs screen, and its runway line (build spec v0.3, 7.1) */
.budgetbox { background: var(--card); border: 1.5px solid var(--ink); border-left: 6px solid var(--green); border-radius: 6px; padding: 12px 14px; margin: 0 0 18px; }
.budgetbox p { margin: 8px 0 0; }
.budgetbox .switch { display: flex; align-items: center; gap: 10px; font-size: 17px; cursor: pointer; }
.budgetbox .switch input { width: 20px; height: 20px; accent-color: var(--green); margin: 0; }
.field .note.warn { margin-top: 8px; }
.note.budgetrunway { background: var(--card); border: 1.5px solid var(--ink); border-left: 6px solid var(--amber); padding: 12px 14px; border-radius: 6px; font-size: 15.5px; color: var(--ink-2); }
