/* Builder v2 additions: steps, line items, voice notes, optional pricing, totals. */
.steps-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 6; background: rgba(255,255,255,0.97); border-bottom: 1px solid var(--line); }
.steps-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-block: 8px; }
.steps-bar ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.steps-bar button.stp { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid transparent; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.steps-bar button.stp .n { width: 24px; height: 24px; border-radius: 999px; background: var(--mist); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; }
.steps-bar button.stp[aria-current="step"] { color: var(--accent-deep); background: var(--accent-soft); }
.steps-bar button.stp[aria-current="step"] .n { background: var(--accent); color: #FFFFFF; }
.steps-bar button.stp:disabled { opacity: 0.45; cursor: default; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.pill.draft { background: var(--mist); color: var(--muted); } .pill.sent { background: var(--accent-soft); color: var(--accent-deep); } .pill.signed { background: var(--ok-bg); color: var(--ok-ink); }
.homelist { border: 1px solid var(--line); border-radius: 16px; overflow-x: auto; }
.homelist .in { min-width: 680px; }
.homelist .r { display: grid; grid-template-columns: 3fr 1fr 1.3fr 1.3fr 1fr; gap: 12px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 15px; }
.homelist .r.h { border-top: 0; background: var(--mist); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.homelist .r span:nth-child(3), .homelist .r span:nth-child(4) { font-variant-numeric: tabular-nums; }
.empty-state { border: 1px dashed var(--line-2); border-radius: 16px; padding: 32px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* voice notes */
.micwrap { position: relative; }
.micbtn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--paper); color: var(--text); cursor: pointer; align-self: flex-start; }
.micbtn[aria-pressed="true"] { background: #FDECEC; border-color: #E8A3A3; color: #8A2B2B; }
.micbtn[aria-pressed="true"] .dot { animation: pulse 1.2s ease-in-out infinite; }
.micbtn .dot { width: 8px; height: 8px; border-radius: 999px; background: currentColor; }
@keyframes pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .micbtn[aria-pressed="true"] .dot { animation: none; } }
.fld .labrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.interim { font-size: 13px; color: var(--muted); font-style: italic; min-height: 0; }

/* line items */
.items { display: flex; flex-direction: column; gap: 12px; }
.item { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.item.opt { border-style: dashed; border-color: #B9C6E8; background: #FAFBFF; }
.item .top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.item .top b { font-size: 15px; }
.item .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.item .grid .fld label { font-size: 12px; }
.item .grid input, .item .grid select { min-height: 44px; }
.item .foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; font-size: 14px; }
.item .lt { font-family: var(--display); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.item .lt s { font-family: var(--body); font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 6px; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.addrow select { font: inherit; font-size: 15px; min-height: 44px; padding: 8px 10px; border: 1px solid #C3CAD4; border-radius: 10px; background: var(--paper); color: var(--text); }
.sumtbl { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.sumtbl div { display: flex; justify-content: space-between; gap: 12px; }
.sumtbl span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.sumtbl .g { border-top: 1px solid var(--ink-line); padding-top: 8px; margin-top: 4px; font-size: 16px; }
.sumtbl .o { color: var(--soft); font-size: 13px; }

/* review stage */
.edit-tip { background: var(--accent-soft); color: #1B2C55; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.pv { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.pv [data-edit] { outline: 1px dashed transparent; outline-offset: 3px; border-radius: 4px; transition: outline-color 0.15s; cursor: text; }
.pv [data-edit]:hover { outline-color: #9BB3F2; }
.pv [data-edit]:focus { outline: 2px solid var(--accent); background: rgba(44,91,224,0.05); }
.pv [data-edit].changed { outline-color: #F2B544; }
.pv .cover [data-edit]:focus { background: rgba(255,255,255,0.06); }
.pv .p-nav { position: static; }

/* proposal additions (client + preview) */
.optnote { font-size: 14px; color: var(--accent-deep); background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; align-self: flex-start; }
.inv .ln .nm { font-weight: 600; display: block; }
.inv .ln .q { font-weight: 500; color: var(--muted); }
.inv .ln .tag, .sowt .tag { display: inline-block; margin-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-deep); background: var(--accent-soft); border-radius: 6px; padding: 2px 6px; }
.inv .ln.optional { background: #FAFBFF; }
.inv .ln.optional:not(.on) > span:last-child { color: var(--muted); }
.inv .ln.optional.on { background: #F1F5FF; }
.inv .ln .opt { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--accent-deep); min-height: 44px; cursor: pointer; }
.inv .ln .opt input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.inv .ln strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.inv .ln s.was { display: block; font-size: 13px; color: var(--muted); }
.totals > div.grand { background: var(--accent); color: #FFFFFF; }
.totals > div.grand .k2, .totals > div.grand small { color: #DCE5FF; }
.sowt { border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; background: var(--paper); }
.sowt .hd, .sowt .ln { display: grid; grid-template-columns: 3fr 2fr 1.4fr; gap: 12px; padding: 12px 16px; font-size: 14px; min-width: 560px; }
.sowt .hd { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); background: var(--mist); }
.sowt .ln { border-top: 1px solid var(--line); }
.sowt .ln[data-sow-off] { color: var(--muted); }
.hist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.hist li { display: flex; gap: 12px; }
.hist time { flex-shrink: 0; font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 150px; }
.linkbox { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.linkbox input { flex: 1 1 320px; min-width: 0; font: inherit; font-family: var(--mono); font-size: 13px; padding: 10px 12px; border: 1px solid #C3CAD4; border-radius: 10px; min-height: 44px; background: var(--mist); }
.err { color: var(--err); }
