/* QuoteSpark – Aurora theme (matches Swanbourne Team): deep navy, frosted glass, teal–violet glow */
:root {
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --bg: #070b1a; --text: #eef2ff; --muted: #9ba6c9; --line: rgba(255,255,255,.11);
  --card: rgba(255,255,255,.065); --card2: rgba(255,255,255,.1); --input: rgba(255,255,255,.07);
  --accent: #38e1c4; --accent-ink: #04151a; --violet: #8b6cff; --warn: #ff5c8a; --amber: #ffc25c; --wa: #25d366;
  --r: 22px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); padding-bottom: calc(100px + var(--safe-b)); }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 420px at -10% -5%, #1d3b6e, transparent 70%), radial-gradient(460px 380px at 110% 15%, #4b2a7a, transparent 70%),
              radial-gradient(420px 420px at -20% 70%, #123d55, transparent 70%), radial-gradient(380px 380px at 120% 95%, #3a2369, transparent 70%), #070b1a; }
a { color: var(--accent); }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t)) 16px 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.topbar .logo { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--violet)); color: var(--accent-ink); box-shadow: 0 0 24px rgba(56,225,196,.35); }
.topbar .logo svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--text); font-size: 24px; line-height: 1; display: grid; place-items: center; }
.spacer { flex: 1; }
main { padding: 6px 16px 16px; max-width: 720px; margin: 0 auto; }

/* Floating nav dock */
.tabs { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 40; max-width: 736px; margin: 0 auto; height: 66px;
  display: flex; justify-content: space-around; align-items: center; border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 85%, #141c3a); border: 1px solid var(--line); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.tabs button { background: none; border: 0; font: 500 11px var(--font); color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 60px; padding: 4px 0; }
.tabs button .p { width: 48px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .2s; }
.tabs button.on { color: var(--accent); }
.tabs button.on .p { background: rgba(56,225,196,.14); }

/* Cards & text */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
label.f { display: block; margin: 12px 0 5px; font-size: 13px; font-weight: 500; color: var(--muted); }
input, select, textarea { width: 100%; font: 15px var(--font); padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--input); color: var(--text); }
input::placeholder, textarea::placeholder { color: #6f7aa0; }
select option { background: #0e1430; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(56,225,196,.15); }
input[type=date] { color-scheme: dark; }
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }

/* Buttons – "amber" is the main action colour (teal in this theme) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  font: 600 15px var(--font); background: var(--card2); color: var(--text); width: 100%; margin-top: 10px; text-decoration: none; }
.btn.amber { background: linear-gradient(135deg, var(--accent), #5fd0ff); color: var(--accent-ink); border: 0; box-shadow: 0 8px 26px rgba(56,225,196,.28); }
.btn.wa { background: var(--wa); color: #04210f; border: 0; }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--warn); border-color: rgba(255,92,138,.35); }
.btn:disabled { opacity: .5; }
.btns2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns2 .btn { margin-top: 8px; }

/* Big mic */
.micwrap { display: flex; flex-direction: column; align-items: center; padding: 22px 0 8px; position: relative; }
.micwrap::before { content: ""; position: absolute; top: 4px; width: 240px; height: 240px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(124,92,255,.45), transparent 65%); filter: blur(6px); }
.mic { position: relative; width: 172px; height: 172px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); color: var(--accent-ink);
  background: linear-gradient(135deg, var(--accent), var(--violet)); display: grid; place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 0 60px rgba(56,225,196,.35), 0 20px 50px rgba(0,0,0,.35); transition: transform .15s; }
.mic svg { width: 64px; height: 64px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mic:active { transform: scale(.96); }
.mic.rec { background: linear-gradient(135deg, var(--warn), #ff9a5c); color: #fff; animation: pulse 1.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,92,138,.55); } 70% { box-shadow: 0 0 0 28px rgba(255,92,138,0); } 100% { box-shadow: 0 0 0 0 rgba(255,92,138,0); } }
.miclabel { margin-top: 16px; font-weight: 600; font-size: 17px; }
.micsub { color: var(--muted); font-size: 13px; margin-top: 2px; text-align: center; }
.mini-mic { width: 46px; flex: 0 0 46px; height: 46px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), var(--violet)); color: var(--accent-ink); display: grid; place-items: center; }
.mini-mic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mini-mic.rec { background: var(--warn); color: #fff; }

/* Lists */
.list-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.list-item:last-child { border-bottom: 0; }
.list-item .main { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .s { color: var(--muted); font-size: 13px; }
.list-item .amt { font-weight: 700; color: var(--accent); white-space: nowrap; }
.pill { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.1); color: var(--text); }
.pill.quote { background: rgba(139,108,255,.22); color: #d2c6ff; } .pill.invoice { background: rgba(95,208,255,.18); color: #bfeaff; }
.pill.paid, .pill.accepted { background: rgba(56,225,196,.18); color: #bff7ec; } .pill.sent { background: rgba(255,194,92,.18); color: #ffe2b0; }

/* Quote lines */
.line { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 16px; padding: 10px; margin-bottom: 8px; }
.line.warn { border-color: rgba(255,194,92,.55); background: rgba(255,194,92,.07); }
.line .desc { font-weight: 500; resize: none; }
.line .nums { display: grid; grid-template-columns: 1fr 1fr 1fr 40px; gap: 6px; margin-top: 6px; align-items: end; }
.line .nums label { font-size: 11px; color: var(--muted); display: block; }
.line .nums input { padding: 9px; }
.line .tot { font-weight: 700; text-align: right; padding: 9px 0; }
.line .del { background: none; border: 0; font-size: 18px; color: var(--warn); height: 38px; }
.totals { font-size: 15px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .grand { font-size: 22px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.totals .grand span:last-child { color: var(--accent); }
.notice { background: rgba(255,194,92,.1); border: 1px solid rgba(255,194,92,.35); padding: 11px 13px; border-radius: 16px; font-size: 14px; margin-bottom: 12px; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }

/* Wizard */
.progress { height: 6px; background: var(--card2); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.progress div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); }
.pq { padding: 11px 0; border-bottom: 1px solid var(--line); }
.pq:last-child { border-bottom: 0; }
.pq .lbl { font-weight: 500; font-size: 15px; }
.pq .guide { font-size: 12px; color: var(--muted); }
.pq .inrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pq .inrow .pre { font-weight: 600; color: var(--accent); }
.pq .inrow input { flex: 1; }
.pq .inrow .unit { font-size: 13px; color: var(--muted); min-width: 64px; }
.logo-prev { max-width: 160px; max-height: 80px; display: block; margin: 8px 0; background: #fff; border-radius: 10px; padding: 6px; }
.toggle { display: flex; gap: 6px; }
.toggle button { flex: 1; padding: 11px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: 500 14px var(--font); }
.toggle button.on { background: rgba(56,225,196,.16); color: var(--accent); border-color: rgba(56,225,196,.45); }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); background: #141c3a; border: 1px solid var(--line); color: var(--text); padding: 10px 16px; border-radius: 14px; font-size: 14px; z-index: 60; max-width: 90%; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(4,21,26,.25); border-top-color: var(--accent-ink); border-radius: 50%; animation: spin .8s linear infinite; }
.btn:not(.amber) .spinner { border-color: rgba(255,255,255,.2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { text-align: center; }
.hero h2 { font-size: 22px; font-weight: 600; margin: 8px 0; }
.hero .big { width: 72px; height: 72px; margin: 4px auto; border-radius: 22px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--violet)); color: var(--accent-ink); box-shadow: 0 0 40px rgba(56,225,196,.3); }
.hero .big svg { width: 36px; height: 36px; fill: currentColor; }
.chip { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; font-size: 14px; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .mic.rec { animation: none; } }
[hidden] { display: none !important; }

/* ---------- v2: ask bar, chat, diary, checklist ---------- */
body.with-ask { padding-bottom: calc(160px + var(--safe-b)); }
.askbar { position: fixed; left: 12px; right: 12px; bottom: calc(86px + var(--safe-b)); z-index: 41; max-width: 736px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 10px; border-radius: 99px;
  background: color-mix(in srgb, var(--bg) 80%, #1b2550); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 22%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.askbar .sw { width: 30px; height: 30px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--accent), var(--violet)); display: grid; place-items: center; color: #04151a; cursor: pointer; }
.askbar .sw svg { width: 16px; height: 16px; fill: currentColor; }
.askbar .t { flex: 1; font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.askbar .amic { width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); border: 0; }
.askbar .amic svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 170px; }
.bubble { max-width: 88%; padding: 11px 14px; border-radius: 18px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble .acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; white-space: normal; }
.bubble .act { text-align: left; font: 500 13.5px var(--font); color: var(--accent); background: rgba(56,225,196,.1); border: 1px solid rgba(56,225,196,.4); border-radius: 12px; padding: 9px 11px; }
.bubble .act.done { color: var(--muted); background: transparent; border-color: var(--line); }
.askinput { position: fixed; left: 12px; right: 12px; bottom: calc(86px + var(--safe-b)); z-index: 41; max-width: 736px; margin: 0 auto; padding: 10px;
  background: color-mix(in srgb, var(--bg) 88%, #1b2550); border: 1px solid var(--line); border-radius: 22px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.askinput textarea { min-height: 46px; max-height: 120px; resize: none; }
.askinput .chip { margin: 0 0 8px; font-size: 13px; padding: 4px 10px; }
.askinput .chip button { background: none; border: 0; color: var(--muted); margin-left: 4px; }
.askopts { display: flex; justify-content: space-between; margin-top: 6px; }
.linkbtn { background: none; border: 0; color: var(--muted); font: 500 13px var(--font); padding: 6px 2px; }
.btns3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.btns3 .btn { margin-top: 8px; padding: 13px 6px; }
.setup h2 { margin-bottom: 6px; }
.chk { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.chk:last-of-type { border-bottom: 0; }
.chk .box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 13px; flex: none; }
.chk.ok { cursor: default; color: var(--muted); }
.chk.ok .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chk span:nth-child(2) { flex: 1; }
.chk .go { color: var(--accent); font-size: 20px; }
.diary-row .when { width: 64px; flex: none; display: flex; flex-direction: column; font-size: 14px; }
.diary-row .when span { color: var(--muted); font-size: 12px; }
.diary-row.done { opacity: .5; }
.tabs button { min-width: 0; flex: 1; }
input[type=time] { color-scheme: dark; }
body.with-ask .toast { bottom: calc(150px + var(--safe-b)); }
