/* Spreks design system: HeroUI v3 defaults + emerald accent, IBM Plex Sans.
   One emerald block (the price) and one black main action (Email quote) per screen. */
:root {
  --background: oklch(0.9702 0 0);
  --foreground: oklch(0.2103 0.0059 285.89);
  --surface: #ffffff;
  --surface-secondary: oklch(0.9524 0.0013 286.37);
  --muted: oklch(0.5517 0.0138 285.94);
  --default: oklch(0.94 0.001 286.375);
  --border: oklch(0.9 0.004 286.32);
  --separator: oklch(0.92 0.004 286.32);
  --accent: #047857;
  --accent-foreground: oklch(0.9911 0 0);
  --warning: oklch(0.7819 0.1585 72.33);
  --danger: oklch(0.6532 0.2328 25.74);
  --success: oklch(0.7329 0.1935 150.81);
  --r-field: 12px;
  --r-card: 24px;
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-family: var(--font-sans);
  color: var(--foreground);
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 16px; line-height: 24px; padding-bottom: env(safe-area-inset-bottom); }

/* Header */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px; background: var(--surface); border-bottom: 1px solid var(--separator); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.wordmark { font-family: Inter, var(--font-sans); font-weight: 800; font-size: 21px; color: #064E3B; letter-spacing: -0.02em; }
.product { font-weight: 600; font-size: 17px; color: var(--muted); }

main { max-width: 640px; margin: 0 auto; padding: 20px; display: grid; gap: 24px; }
#appView { display: grid; gap: 24px; }
#appView[hidden] { display: none; }

/* Type */
h1 { margin: 0; font-size: 36px; line-height: 44px; font-weight: 700; letter-spacing: -0.02em; }
h2 { margin: 0 0 4px; font-size: 20px; line-height: 28px; font-weight: 700; }
h3 { margin: 16px 0 8px; font-size: 16px; font-weight: 600; }
.title p { margin: 4px 0 0; }
.muted { color: var(--muted); font-size: 14px; line-height: 20px; margin: 0; }
.footer { text-align: center; }

/* Card */
.card { background: var(--surface); border-radius: var(--r-card); padding: 16px; box-shadow: 0 2px 4px rgb(0 0 0 / .04), 0 1px 2px rgb(0 0 0 / .06); display: grid; gap: 12px; }

/* The emerald block: the price */
.block { background: var(--accent); color: var(--accent-foreground); border-radius: var(--r-card); padding: 20px; display: grid; gap: 2px; }
.block-label { font-size: 14px; font-weight: 600; opacity: .9; }
.hero { font-size: 56px; line-height: 60px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .hero { font-size: 46px; line-height: 52px; } }
.block-sub { font-size: 14px; opacity: .9; }
.client-lines { margin-top: 12px; display: grid; }
.client-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid rgb(255 255 255 / .25); font-size: 14px; line-height: 20px; }
.client-lines strong { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Fields */
label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; color: var(--foreground); }
input, textarea, select { font: inherit; font-size: 16px; color: var(--foreground); width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--r-field); background: var(--surface); }
input[type=number] { font-variant-numeric: tabular-nums; }
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } }
.margin { max-width: 140px; }

/* Buttons: pills */
.btn { font: inherit; font-size: 16px; font-weight: 600; border-radius: 999px; padding: 12px 20px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.btn.primary { background: var(--accent); color: var(--accent-foreground); }
.btn.tertiary { background: var(--default); color: var(--foreground); }
.btn.main { background: var(--foreground); color: var(--surface); width: 100%; min-height: 56px; font-size: 17px; }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.icon { background: var(--default); color: var(--muted); padding: 0; width: 44px; min-height: 44px; flex: none; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.ico-sm { width: 18px; height: 18px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }

/* Mic */
.speak { display: flex; align-items: center; gap: 16px; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-foreground); display: grid; place-items: center; cursor: pointer; flex: none; }
.mic.on { background: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--danger) 50%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }

/* Lines */
.line { border: 1px solid var(--border); border-radius: 20px; padding: 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.line-head { display: flex; gap: 8px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.detail { font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }

/* Switch */
.switch { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 999px; background: var(--default); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Alerts */
.alert { border-radius: var(--r-card); padding: 12px 16px; font-size: 14px; line-height: 20px; display: grid; grid-template-columns: 20px 1fr; gap: 4px 10px; }
.alert svg { margin-top: 1px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert.warning { background: color-mix(in oklch, var(--warning) 18%, var(--surface)); }
.alert.warning svg { color: oklch(0.55 0.13 60); }
.alert.notice { background: var(--surface-secondary); }

/* Private breakdown */
.private { background: var(--surface-secondary); border-radius: 16px; padding: 12px 16px; }
.private summary { font-weight: 600; cursor: pointer; }
.private table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.private td { padding: 6px 0; border-top: 1px solid var(--separator); }
.private td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 12px; }

.error { color: var(--danger); font-size: 14px; margin: 0; }
.ok { color: var(--accent); font-weight: 600; font-size: 14px; margin: 0; }
.pin { display: flex; gap: 8px; }
.pin input { flex: 1; }
