:root {
  --ink: #1a1d16;
  --ink-soft: #3a3830;
  --muted: #6b675c;
  --paper: #f6f3eb;
  --paper-2: #efeae0;
  --card: #fffcf7;
  --rule: #d4cfc3;
  --navy: #1e3a4c;
  --navy-2: #16303e;
  --navy-3: #0f242f;
  --fog: #d7e0e6;
  --hivis: #e8a317;
  --hivis-dark: #b37b0a;
  --safety: #c45c16;
  --ok: #1f6b4a;
  --ok-soft: #d9efe4;
  --danger: #9b2226;
  --danger-soft: #f8e4e4;
  --shadow: 0 10px 30px rgba(22, 48, 62, 0.1);
  --font: "Barlow", "Segoe UI", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Georgia", serif;
  --radius: 14px;
  --max: 1120px;
  --tap: 46px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--paper); }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(232, 163, 23, 0.08), transparent 50%),
    var(--paper);
  min-height: 100%;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

h1, h2, h3, .brand, .section-kicker, .price-plan {
  font-family: var(--cond);
  letter-spacing: 0.02em;
}

a { color: var(--navy); }
a:hover { color: var(--hivis-dark); }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 12px; background: #fff; padding: 8px; z-index: 99; }

/* ----- Landing ----- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--navy);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: 0.04em;
}
.brand svg { width: 36px; height: 36px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  background: var(--card);
  color: var(--ink);
  border-color: var(--rule);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--hivis); outline-offset: 2px; }
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 6px 16px rgba(30, 58, 76, 0.25);
}
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-accent {
  background: var(--hivis);
  color: var(--navy-3);
  border-color: var(--hivis);
  font-weight: 700;
}
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #e7c0c0; }
.btn-ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px 48px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}
.kicker {
  font-family: var(--cond);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--safety);
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 10px;
}
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.95;
  margin: 0 0 16px;
  color: var(--navy);
  text-wrap: balance;
}
.lede {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 38ch;
  margin: 0 0 24px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-note { margin-top: 14px; color: var(--muted); font-size: 14px; }

.report-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: rotate(1.1deg);
}
.report-card-head {
  background: var(--navy);
  color: #fff;
  padding: 14px 18px 12px;
  position: relative;
}
.report-card-head::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--hivis);
  position: absolute;
  left: 0; right: 0; bottom: 0;
}
.report-card-head .co { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; }
.report-card-head h3 { margin: 4px 0 0; font-size: 22px; }
.report-card-body { padding: 16px 18px 18px; font-size: 13px; }
.report-card-body .meta { color: var(--muted); margin-bottom: 10px; }
.report-card-body ul { margin: 0; padding-left: 18px; }
.report-card-body li { margin: 3px 0; }

.section { max-width: var(--max); margin: 0 auto; padding: 12px 20px 48px; }
.section-kicker { text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.section h2 { font-size: 36px; margin: 0 0 20px; color: var(--navy); }

.steps, .features, .prices {
  display: grid;
  gap: 16px;
}
.steps { grid-template-columns: repeat(3, 1fr); }
.features { grid-template-columns: repeat(2, 1fr); }
.prices { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; max-width: 720px; }

.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 20px;
}
.step-num {
  font-family: var(--cond);
  font-size: 28px;
  color: var(--hivis-dark);
  font-weight: 700;
}
.card h3 { margin: 6px 0 8px; font-size: 24px; color: var(--navy); }
.card p { margin: 0; color: var(--ink-soft); }

.price {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.price.featured {
  border: 2px solid var(--navy);
  box-shadow: var(--shadow);
}
.price-plan { font-size: 20px; color: var(--navy); margin: 0; }
.price .amt { font-family: var(--cond); font-size: 44px; font-weight: 700; color: var(--navy); line-height: 1; }
.price .amt span { font-size: 16px; color: var(--muted); font-weight: 600; }
.price-alt { margin: 0; color: var(--ink-soft); font-weight: 600; }
.price-alt span { color: var(--muted); font-weight: 500; }
.price ul { margin: 8px 0 16px; padding-left: 18px; color: var(--ink-soft); flex: 1; }
.badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--hivis);
  color: var(--navy-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 999px;
}

.compare { width: 100%; border-collapse: collapse; font-size: 15px; }
.compare th, .compare td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.compare th { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.compare .price-cell { white-space: nowrap; font-weight: 600; }

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 24px 20px 48px;
  color: var(--muted);
  font-size: 14px;
  max-width: var(--max);
  margin: 0 auto;
}

/* ----- App chrome ----- */
.app-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 10px 16px calc(10px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .brand { color: #fff; font-size: 22px; }
.app-header .brand span { color: var(--hivis); }
.app-header .nav { display: flex; gap: 4px; }
.app-header .nav .btn {
  min-height: 40px;
  background: transparent;
  color: #fff;
  border-color: transparent;
  padding: 0 10px;
}
.app-header .nav .btn[aria-current="page"],
.app-header .nav .btn.active {
  background: rgba(255,255,255,0.12);
}
.app-main {
  flex: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 16px 110px;
}

.page-title { margin: 0 0 4px; font-size: 32px; color: var(--navy); }
.sub { margin: 0 0 18px; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 140px; }

.field label, .label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea, .input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: var(--tap);
}
.field textarea, textarea.input {
  min-height: 180px;
  resize: vertical;
  line-height: 1.45;
}
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  outline: 3px solid rgba(232, 163, 23, 0.55);
  border-color: var(--hivis);
}

.notes-box { position: relative; }
.mic-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mic-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(155, 34, 38, 0.6);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(155, 34, 38, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(155, 34, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(155, 34, 38, 0); }
}

.listening {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--danger); font-weight: 600; font-size: 14px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.photo-tile {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.photo-tile img { width: 100%; height: 110px; object-fit: cover; background: #ddd; }
.photo-tile .cap { padding: 8px; }
.photo-tile input { width: 100%; border: 0; background: transparent; padding: 0; min-height: 28px; font-size: 13px; }
.photo-tile .cap-actions { display: flex; justify-content: space-between; align-items: center; }

.table-wrap { overflow-x: auto; }
table.manpower {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  font-size: 14px;
}
table.manpower th, table.manpower td { padding: 6px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
table.manpower th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-align: left; }
table.manpower input { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px; min-height: 36px; border-radius: 6px; }
table.manpower input:focus { border-color: var(--hivis); background: #fff; outline: none; }
table.manpower .num { width: 64px; }
table.manpower .del { width: 44px; }

.list-editor .item {
  display: flex; gap: 8px; margin-bottom: 8px; align-items: flex-start;
}
.list-editor textarea {
  min-height: 54px;
  flex: 1;
}

.sticky-actions {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(246, 243, 235, 0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  justify-content: center;
  z-index: 20;
}
.sticky-actions .btn { flex: 1; max-width: 280px; }

.report-list { display: flex; flex-direction: column; gap: 10px; }
.report-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
}
.report-item h3 { margin: 0; font-size: 18px; color: var(--navy); }
.report-item p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.empty {
  border: 1px dashed var(--rule);
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%);
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 40;
  box-shadow: var(--shadow);
}

.banner {
  background: #fff6df;
  border: 1px solid #ead7a0;
  color: var(--ink-soft);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.segmented {
  display: flex;
  background: var(--paper-2);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
}
.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 600;
  color: var(--muted);
}
.segmented button[aria-selected="true"] {
  background: var(--card);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Preview (on-screen report) */
.preview-sheet {
  background: #fff;
  color: #111;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  padding: 0 0 24px;
}
.preview-head {
  background: var(--navy);
  color: #fff;
  padding: 18px 22px 16px;
  border-bottom: 4px solid var(--hivis);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.preview-head .co { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.8; }
.preview-head h2 { margin: 4px 0 0; font-size: 26px; color: #fff; }
.preview-body { padding: 18px 22px; font-family: var(--serif); }
.preview-body h3 {
  font-family: var(--cond);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #f3efe6;
  color: var(--navy);
  margin: 16px 0 8px;
  padding: 6px 8px;
}
.preview-body h3:first-child { margin-top: 0; }
.preview-project { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.preview-meta { color: #555; margin: 0 0 8px; font-size: 14px; }
.preview-body ul { margin: 0; padding-left: 18px; }
.preview-body li { margin: 3px 0; }
.preview-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.preview-photos figure { margin: 0; }
.preview-photos img { width: 100%; height: 140px; object-fit: cover; border: 1px solid #ddd; }
.preview-photos figcaption { font-size: 12px; color: #555; margin-top: 4px; font-family: var(--font); }
.muted { color: var(--muted); font-style: italic; }

.logo-preview { width: 72px; height: 72px; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 8px; }

/* Print */
@media print {
  body { background: #fff; }
  .topbar, .app-header, .sticky-actions, .toast, .no-print, .hero, .section, .site-footer, .segmented, .banner {
    display: none !important;
  }
  .app-main { padding: 0; max-width: none; }
  .preview-sheet { box-shadow: none; border: 0; }
}

@media (max-width: 860px) {
  .hero, .steps, .features, .prices { grid-template-columns: 1fr; }
  .hero { padding-top: 8px; }
  .report-card { transform: none; max-width: 420px; }
  .compare .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .mic-dot { transition: none; animation: none; }
}
