:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #eef4f2;
  --surface-3: #e5eeeb;
  --ink: #17211e;
  --muted: #64706c;
  --line: #d7e2de;
  --brand: #12372f;
  --brand-2: #1f6f5b;
  --brand-soft: #dff3ec;
  --warning: #a05a00;
  --warning-soft: #fff4dc;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #196c2e;
  --ok-soft: #e9f6ec;
  --blue: #1a5fb4;
  --blue-soft: #e8f0fe;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-2: 0 12px 35px rgba(18, 55, 47, 0.12);
  --shadow-3: 0 24px 70px rgba(18, 55, 47, 0.22);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --topbar: 72px;
  --bottomnav: 74px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(31, 111, 91, 0.16), transparent 32rem),
    radial-gradient(circle at 90% 12%, rgba(26, 95, 180, 0.12), transparent 28rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, Roboto, Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  min-height: 100vh;
}

.top-app-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(244, 247, 246, 0.82);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid rgba(215, 226, 222, 0.82);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  flex: 1;
}

.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 850;
  letter-spacing: -0.04em;
  background: linear-gradient(145deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-1);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.brand-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button,
.panic-button,
.primary-button,
.secondary-button,
.text-button,
.chip,
.option-card,
.segment-button,
.fab {
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.icon-button:active,
.panic-button:active,
.primary-button:active,
.secondary-button:active,
.text-button:active,
.chip:active,
.option-card:active,
.segment-button:active,
.fab:active {
  transform: scale(0.98);
}

.ghost {
  background: transparent;
  color: var(--ink);
  width: 44px;
  height: 44px;
}

.panic-button {
  padding: 0 16px;
  background: var(--danger);
  color: white;
  box-shadow: var(--shadow-1);
  font-weight: 780;
}

.side-nav {
  position: fixed;
  z-index: 30;
  top: var(--topbar);
  left: 0;
  width: min(86vw, 330px);
  height: calc(100vh - var(--topbar));
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-3);
  transform: translateX(-105%);
  transition: transform 0.22s ease;
}

.side-nav.open {
  transform: translateX(0);
}

.side-nav nav {
  display: grid;
  gap: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 720;
}

.side-nav a.active,
.side-nav a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-utility {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 20px;
  display: grid;
  gap: 10px;
}

.view {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 20px 16px calc(var(--bottomnav) + 28px);
}

.bottom-nav {
  position: fixed;
  z-index: 15;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: var(--bottomnav);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(215, 226, 222, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-2);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  border-radius: 22px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.bottom-nav a span {
  font-size: 0.7rem;
}

.bottom-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.hero {
  padding: 24px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(18, 55, 47, 0.96), rgba(31, 111, 91, 0.92)),
    var(--brand);
  color: white;
  box-shadow: var(--shadow-2);
  overflow: hidden;
  position: relative;
}

.hero:after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  right: -120px;
  top: -120px;
  background: rgba(255, 255, 255, 0.14);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2.05rem, 8vw, 4.6rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

h2 {
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  line-height: 1;
  letter-spacing: -0.05em;
  margin-bottom: 12px;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.hero p {
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.04rem;
  max-width: 720px;
}

.hero-actions,
.row-actions,
.card-actions,
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.primary-button,
.secondary-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 820;
  text-decoration: none;
}

.primary-button {
  color: white;
  background: var(--brand);
  box-shadow: var(--shadow-1);
}

.primary-button:hover {
  background: #092821;
}

.secondary-button {
  color: var(--brand);
  background: var(--brand-soft);
}

.text-button {
  color: var(--brand);
  background: transparent;
}

.text-button.danger {
  color: var(--danger);
}

.hero .primary-button {
  background: white;
  color: var(--brand);
}

.hero .secondary-button {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two,
.grid.three {
  grid-template-columns: 1fr;
}

.card,
.panel,
.category-card,
.question-card,
.assessment-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(215, 226, 222, 0.94);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-1);
}

.card.soft {
  background: rgba(255, 255, 255, 0.64);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.metric {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.metric strong {
  display: block;
  font-size: 1.5rem;
  letter-spacing: -0.05em;
}

.metric span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 18px 0;
}

.search-field,
.input,
.textarea,
.select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  outline: none;
}

.textarea {
  min-height: 118px;
  resize: vertical;
}

.search-field:focus,
.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(31, 111, 91, 0.12);
}

.segmented {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow-x: auto;
}

.segment-button {
  flex: 0 0 auto;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 780;
  white-space: nowrap;
}

.segment-button.active {
  background: white;
  color: var(--brand);
  box-shadow: var(--shadow-1);
}

.category-card {
  margin: 18px 0;
}

.category-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.category-heading p {
  margin-bottom: 0;
}

.count-pill,
.badge,
.signal-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 820;
  white-space: nowrap;
}

.count-pill {
  background: var(--surface-2);
  color: var(--muted);
}

.badge {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 13px;
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  text-align: left;
}

.chip.selected {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
}

.chip:hover {
  border-color: var(--brand-2);
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0;
}

.step {
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
}

.step strong {
  display: block;
  font-size: 0.85rem;
}

.step span {
  color: var(--muted);
  font-size: 0.74rem;
}

.question-card {
  margin: 14px 0;
}

.option-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.option-card {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.option-card.selected {
  border-color: var(--brand-2);
  background: var(--brand-soft);
}

.option-card small {
  color: var(--muted);
}

.notice {
  border-radius: 18px;
  padding: 16px;
  background: var(--blue-soft);
  color: #123c73;
  border: 1px solid rgba(26, 95, 180, 0.18);
}

.notice.warning {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: rgba(160, 90, 0, 0.18);
}

.notice.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(179, 38, 30, 0.2);
}

.assessment-hero {
  border-radius: var(--radius-xl);
  padding: 22px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
}

.assessment-hero.urgent,
.assessment-hero.severe {
  border-color: rgba(179, 38, 30, 0.32);
  background: linear-gradient(180deg, #fff, #fff8f7);
}

.assessment-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.direct-line {
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.35;
  color: var(--ink);
}

.assessment-list,
.clean-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-weight: 780;
  color: var(--ink);
}

.form-grid label span {
  color: var(--muted);
  font-size: 0.82rem;
}

.incident-list,
.timeline-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.incident-item,
.timeline-item {
  padding: 16px;
  border-radius: 18px;
  background: white;
  border: 1px solid var(--line);
}

.timeline-item {
  position: relative;
  padding-left: 22px;
}

.timeline-item:before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 99px;
  background: var(--brand-2);
}

.report-box {
  width: 100%;
  min-height: 360px;
  white-space: pre-wrap;
  padding: 18px;
  border-radius: 20px;
  background: #0d1714;
  color: #d8f4ea;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
  line-height: 1.55;
}

.empty-state {
  text-align: center;
  padding: 34px 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line);
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: calc(var(--bottomnav) + 24px);
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  border-radius: 999px;
  background: #13221e;
  color: white;
  box-shadow: var(--shadow-3);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-weight: 780;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.privacy-shield {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: #f7f7f7;
}

.privacy-shield.hidden {
  display: none;
}

.news-lock {
  width: min(100vw, 520px);
  min-height: 100vh;
  background: #f6f6f6;
  color: #111;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.news-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: #b80000;
  color: white;
}

.news-brand {
  display: inline-flex;
  gap: 3px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.news-brand span {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  padding: 8px 7px;
  background: white;
  color: #b80000;
}

.news-live {
  padding: 7px 10px;
  border-radius: 999px;
  background: white;
  color: #b80000;
  font-weight: 900;
}

.news-content {
  padding: 16px;
}

.news-hero {
  padding: 0 0 16px;
  border-bottom: 1px solid #ddd;
}

.news-image-block {
  height: 210px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, 0.12), transparent),
    linear-gradient(45deg, #dadada, #9ba4ad);
  position: relative;
  overflow: hidden;
}

.news-image-block:before,
.news-image-block:after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.42);
}

.news-image-block:before {
  width: 180px;
  height: 180px;
  right: -30px;
  top: 38px;
}

.news-image-block:after {
  width: 260px;
  height: 120px;
  left: -40px;
  bottom: -35px;
  border-radius: 60px;
}

.news-kicker {
  margin: 14px 0 6px;
  color: #b80000;
  font-weight: 900;
  text-transform: uppercase;
}

.news-hero h1 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.news-hero p {
  color: #444;
}

.news-grid {
  display: grid;
  gap: 10px;
  padding: 16px 0 90px;
}

.news-grid article {
  padding: 14px 0;
  border-bottom: 1px solid #ddd;
}

.news-grid span {
  display: block;
  color: #b80000;
  font-weight: 900;
  font-size: 0.8rem;
}

.news-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 1.02rem;
}

.news-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  display: grid;
  place-items: center;
}

.unlock-btn {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.82);
  color: white;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

@media (min-width: 760px) {
  .top-app-bar {
    padding-left: 24px;
    padding-right: 24px;
  }

  .view {
    padding: 32px 26px 48px 108px;
  }

  .side-nav {
    transform: translateX(0);
    width: 86px;
    top: 88px;
    height: auto;
    left: 14px;
    bottom: 18px;
    border-radius: 30px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    padding: 10px;
  }

  .side-nav.open {
    width: 330px;
  }

  .side-nav:not(.open) a {
    justify-content: center;
    font-size: 0;
    padding: 0;
  }

  .side-nav:not(.open) a:before {
    content: attr(data-route);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-size: 0.62rem;
    text-transform: uppercase;
  }

  .side-nav:not(.open) .nav-utility {
    display: none;
  }

  .bottom-nav {
    display: none;
  }

  .grid.two {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid.three {
    grid-template-columns: repeat(3, 1fr);
  }

  .toolbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .metric-strip {
    grid-template-columns: repeat(4, 1fr);
  }

  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid .wide {
    grid-column: 1 / -1;
  }

  .option-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-lock {
    min-height: 860px;
    max-height: 96vh;
    border-radius: 26px;
  }

  .news-footer {
    position: absolute;
  }
}


.quick-panel {
  overflow: hidden;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 82px;
  text-align: left;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, #ffffff, #eef4f2);
  color: var(--ink);
  font-weight: 750;
  box-shadow: var(--shadow-1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.quick-card:hover,
.quick-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
  border-color: var(--brand-2);
}

.breakdown-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(215, 226, 222, 0.9);
  border-radius: 24px;
  padding: 18px;
  margin: 18px 0;
}

.breakdown-grid {
  display: grid;
  gap: 8px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.breakdown-row strong.strong { color: var(--danger); }
.breakdown-row strong.moderate { color: var(--warning); }
.breakdown-row strong.weak { color: var(--blue); }
.breakdown-row strong.missing { color: var(--muted); }

.microcopy {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0;
}

.incident-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.incident-meta span {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.82rem;
  font-weight: 700;
}

.row-actions.compact {
  margin-top: 12px;
}

.report-type {
  display: grid;
  gap: 6px;
  max-width: 320px;
  margin: 16px 0;
}

.about-hero {
  background: linear-gradient(135deg, rgba(18, 55, 47, 0.98), rgba(31, 111, 91, 0.92));
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 20px;
  padding: 16px;
}

.setting-row p {
  margin: 4px 0 0;
  color: var(--muted);
}

.news-ticker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.news-ticker span {
  background: rgba(255,255,255,0.86);
  border-radius: 999px;
  padding: 6px 10px;
  color: #1b1b1b;
  font-size: 0.78rem;
  font-weight: 800;
}

@media (max-width: 720px) {
  .quick-grid { grid-template-columns: 1fr; }
  .setting-row { align-items: stretch; flex-direction: column; }
  .breakdown-row { align-items: flex-start; flex-direction: column; gap: 4px; }
}

.bottom-nav { grid-template-columns: repeat(5, 1fr); }


/* v0.3 guided interview, pattern map, reports and notes */
.guide-hero {
  background:
    radial-gradient(circle at 12% 10%, rgba(98, 0, 238, 0.16), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(0, 150, 136, 0.16), transparent 30%),
    linear-gradient(135deg, #ffffff, #eef7f4);
}

.guide-panel .section-heading,
.pattern-map .section-heading,
.assessment-notes .section-heading {
  align-items: flex-start;
}

.guide-chip-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.quick-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.quick-card.active {
  outline: 3px solid rgba(18, 55, 47, 0.22);
  background: #e6f4ef;
}

.guide-checks li {
  padding: 8px 0;
}

.pattern-map {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(19, 70, 58, 0.14);
  border-radius: 24px;
  padding: 18px;
  margin: 18px 0;
  box-shadow: 0 14px 38px rgba(16, 24, 40, 0.08);
}

.pattern-bars {
  display: grid;
  gap: 12px;
}

.pattern-bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 2fr) 46px;
  gap: 12px;
  align-items: center;
  font-size: 0.92rem;
}

.pattern-bar-row span {
  color: #1f2933;
  font-weight: 650;
}

.pattern-bar-row strong {
  text-align: right;
  color: #12372f;
}

.pattern-bar-track {
  height: 12px;
  background: #e7ecea;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.pattern-bar-track i {
  display: block;
  width: var(--bar);
  min-width: 14px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0f766e, #22c55e);
}

.pattern-bar-row.primary .pattern-bar-track i {
  background: linear-gradient(90deg, #b42318, #f97316);
}

.assessment-notes textarea {
  min-height: 86px;
}

.report-type select {
  margin-top: 8px;
}

@media (max-width: 680px) {
  .pattern-bar-row {
    grid-template-columns: 1fr 48px;
  }
  .pattern-bar-row span {
    grid-column: 1 / -1;
  }
}


/* v0.4 theme polish */
:root {
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-2: #eff6f3;
  --surface-3: #e2eee9;
  --ink: #101915;
  --muted: #60706a;
  --line: #d6e2dd;
  --brand: #0d1f1b;
  --brand-2: #1b6b56;
  --brand-3: #2d8f73;
  --brand-soft: #e3f5ee;
  --gold: #ffc629;
  --gold-soft: #fff5cc;
  --danger: #b3261e;
  --danger-soft: #fff0ed;
  --warning: #965600;
  --warning-soft: #fff5df;
  --blue: #2459a6;
  --blue-soft: #eaf1ff;
  --shadow-1: 0 1px 2px rgba(16, 25, 21, 0.08), 0 2px 8px rgba(16, 25, 21, 0.06);
  --shadow-2: 0 16px 45px rgba(13, 31, 27, 0.13);
  --shadow-3: 0 30px 80px rgba(13, 31, 27, 0.22);
  --focus: 0 0 0 4px rgba(45, 143, 115, 0.18);
}

body {
  background:
    radial-gradient(circle at 8% -8%, rgba(45, 143, 115, 0.22), transparent 34rem),
    radial-gradient(circle at 96% 4%, rgba(255, 198, 41, 0.16), transparent 28rem),
    radial-gradient(circle at 50% 110%, rgba(36, 89, 166, 0.10), transparent 32rem),
    linear-gradient(180deg, #f7faf8 0%, #eef5f1 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(13, 31, 27, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 31, 27, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.28), transparent 62%);
}

.top-app-bar {
  height: 76px;
  padding: 10px max(14px, env(safe-area-inset-left)) 10px max(14px, env(safe-area-inset-right));
  background: rgba(247, 250, 248, 0.78);
  border-bottom: 1px solid rgba(214, 226, 221, 0.72);
  box-shadow: 0 8px 28px rgba(16, 25, 21, 0.06);
}

.brand-mark {
  border-radius: 18px;
  background:
    radial-gradient(circle at 78% 16%, rgba(255,255,255,0.28), transparent 30%),
    linear-gradient(145deg, #0d1f1b 0%, #1b6b56 58%, #2d8f73 100%);
  box-shadow: 0 12px 28px rgba(13, 31, 27, 0.22);
}

.brand-copy strong {
  font-size: 1.05rem;
}

.panic-button {
  background: linear-gradient(135deg, #b3261e, #df4338);
  color: #fff;
  box-shadow: 0 10px 26px rgba(179, 38, 30, 0.22);
}

.icon-button.ghost {
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(214, 226, 221, 0.84);
}

.view {
  padding-top: 24px;
}

.hero,
.assessment-hero,
.panel,
.card,
.category-card,
.question-card,
.breakdown-card,
.pattern-map {
  box-shadow: var(--shadow-1);
}

.hero {
  padding: clamp(26px, 6vw, 46px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  background:
    radial-gradient(circle at 12% 16%, rgba(255,255,255,0.18), transparent 22rem),
    radial-gradient(circle at 90% 8%, rgba(255,198,41,0.30), transparent 18rem),
    linear-gradient(135deg, #0d1f1b 0%, #164c3f 52%, #1b6b56 100%);
  box-shadow: var(--shadow-3);
}

.hero:after {
  width: 360px;
  height: 360px;
  right: -160px;
  top: -160px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255, 255, 255, 0.10);
}

.hero::before {
  content: "";
  position: absolute;
  left: -70px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(45, 143, 115, 0.28);
}

.eyebrow {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.card,
.panel,
.category-card,
.question-card,
.assessment-card,
.breakdown-card,
.pattern-map,
.assessment-hero {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(214, 226, 221, 0.92);
  backdrop-filter: blur(18px);
}

.card:hover,
.category-card:hover,
.question-card:hover,
.quick-card:hover,
.option-card:hover,
.chip:hover {
  box-shadow: 0 14px 36px rgba(16, 25, 21, 0.10);
}

.primary-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px rgba(13, 31, 27, 0.18);
}

.primary-button:hover {
  background: linear-gradient(135deg, #091512, #155442);
}

.secondary-button {
  background: linear-gradient(135deg, #e9f8f2, #d8f0e7);
  color: var(--brand);
  border: 1px solid rgba(45, 143, 115, 0.18);
}

.hero .primary-button {
  color: #0d1f1b;
  background: linear-gradient(135deg, #ffffff, #e6f7f0);
}

.hero .secondary-button {
  color: #ffffff;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.18);
}

.metric {
  border: 1px solid rgba(214, 226, 221, 0.9);
  background:
    radial-gradient(circle at 100% 0%, rgba(45,143,115,0.10), transparent 50%),
    rgba(255,255,255,0.9);
  box-shadow: 0 8px 22px rgba(16, 25, 21, 0.06);
}

.metric strong {
  color: var(--brand);
}

.chip,
.option-card,
.quick-card,
.segment-button,
.primary-button,
.secondary-button,
.text-button,
.panic-button,
.icon-button {
  -webkit-tap-highlight-color: transparent;
}

.chip {
  border-radius: 18px;
}

.chip.selected,
.option-card.selected,
.segment-button.active,
.quick-card.active {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,198,41,0.18), transparent 52%),
    var(--brand-soft);
  border-color: rgba(45, 143, 115, 0.42);
}

.chip.selected {
  color: var(--brand);
  font-weight: 820;
}

.option-card.selected {
  box-shadow: inset 4px 0 0 var(--brand-2), 0 10px 26px rgba(16,25,21,0.08);
}

.notice {
  border-radius: 22px;
  box-shadow: 0 8px 22px rgba(16, 25, 21, 0.05);
}

.assessment-hero {
  background:
    radial-gradient(circle at 95% 4%, rgba(255,198,41,0.12), transparent 18rem),
    rgba(255,255,255,0.94);
}

.assessment-hero.urgent,
.assessment-hero.severe {
  background:
    radial-gradient(circle at 95% 4%, rgba(179,38,30,0.14), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,240,237,0.72));
}

.direct-line {
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff7d6, #fffaf0);
  border: 1px solid rgba(255, 198, 41, 0.38);
}

.pattern-map {
  background:
    radial-gradient(circle at 100% 0%, rgba(45,143,115,0.12), transparent 16rem),
    rgba(255,255,255,0.88);
}

.pattern-bar-track {
  background: rgba(13, 31, 27, 0.09);
}

.pattern-bar-track i {
  background: linear-gradient(90deg, #1b6b56, #35b58e);
}

.pattern-bar-row.primary .pattern-bar-track i {
  background: linear-gradient(90deg, #b3261e, #ffc629);
}

.breakdown-row,
.incident-item,
.timeline-item {
  background: rgba(255,255,255,0.86);
  border-color: rgba(214,226,221,0.88);
}

.timeline-item:before {
  background: linear-gradient(180deg, var(--brand-2), var(--gold));
}

.input,
.search-field,
.textarea,
.select {
  background: rgba(255,255,255,0.92);
  border-color: rgba(214,226,221,0.94);
}

.search-field:focus,
.input:focus,
.textarea:focus,
.select:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.side-nav {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(239,246,243,0.94));
  border-right: 1px solid rgba(214,226,221,0.9);
}

.side-nav a.active,
.side-nav a:hover,
.bottom-nav a.active {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,198,41,0.20), transparent 56%),
    var(--brand-soft);
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(214, 226, 221, 0.86);
  box-shadow: 0 18px 48px rgba(16, 25, 21, 0.18);
}

.bottom-nav a {
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.bottom-nav a.active {
  transform: translateY(-1px);
}

.news-lock {
  box-shadow: 0 34px 120px rgba(0,0,0,0.42);
}

.news-topbar {
  background: #111827;
}

.news-brand span:first-child {
  background: #d71920;
}

@media (min-width: 880px) {
  .view {
    padding-top: 34px;
  }

  .top-app-bar {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 680px) {
  h1 {
    font-size: clamp(2.25rem, 12vw, 3.4rem);
  }

  .hero {
    border-radius: 28px;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .top-app-bar {
    gap: 8px;
  }

  .panic-button {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* v0.5 flow and navigation fix */
.side-nav {
  top: var(--topbar);
  left: 0;
  bottom: auto;
  width: min(94vw, 420px);
  height: calc(100dvh - var(--topbar));
  max-height: calc(100dvh - var(--topbar));
  padding: 16px;
  overflow-y: auto;
  border-radius: 0 28px 28px 0;
  transform: translateX(-110%);
  transition: transform 180ms ease, box-shadow 180ms ease;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(13, 31, 27, 0.28);
}

.side-nav.open {
  width: min(94vw, 420px);
  transform: translateX(0);
}

.side-nav:not(.open) a::before {
  content: none;
  display: none;
}

.side-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 6px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.side-nav-header div {
  display: grid;
  gap: 3px;
}

.side-nav-header strong {
  font-size: 1.05rem;
  letter-spacing: -0.03em;
}

.side-nav-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.side-nav nav {
  display: grid;
  gap: 6px;
}

.nav-section-label {
  margin: 14px 8px 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 860;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-nav a {
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-areas:
    "num title"
    "num hint";
  gap: 2px 12px;
  min-height: 62px;
  padding: 10px 12px;
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
}

.side-nav a span {
  grid-area: num;
  align-self: center;
  justify-self: center;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--brand);
  font-weight: 880;
  font-size: 0.82rem;
}

.side-nav a strong {
  grid-area: title;
  align-self: end;
  font-size: 0.95rem;
}

.side-nav a small {
  grid-area: hint;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.side-nav a.active span,
.side-nav a:hover span {
  background: var(--brand);
  color: white;
}

.nav-utility {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.flow-header {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(214, 226, 221, 0.92);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 198, 41, 0.12), transparent 16rem),
    rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(16, 25, 21, 0.08);
  backdrop-filter: blur(18px);
}

.flow-header-copy h2 {
  margin: 2px 0 4px;
  font-size: clamp(1.28rem, 3.2vw, 2rem);
  letter-spacing: -0.04em;
}

.flow-header-copy p:last-child {
  margin: 0;
  color: var(--muted);
  max-width: 72ch;
}

.flow-next-card {
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, #e9f8f2, #ffffff);
  border: 1px solid rgba(45, 143, 115, 0.18);
}

.flow-next-card span,
.flow-next-card small {
  color: var(--muted);
  font-size: 0.78rem;
}

.flow-next-card strong {
  font-size: 1.02rem;
}

.flow-next-card button {
  margin-top: 8px;
  justify-self: start;
}

.flow-steps {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(126px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.flow-step {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-areas:
    "num label"
    "num detail";
  gap: 1px 8px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(214, 226, 221, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}

.flow-step span {
  grid-area: num;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 860;
}

.flow-step strong {
  grid-area: label;
  align-self: end;
  color: var(--ink);
  font-size: 0.82rem;
}

.flow-step small {
  grid-area: detail;
  font-size: 0.68rem;
  line-height: 1.15;
}

.flow-step.done span {
  background: var(--ok-soft);
  color: var(--ok);
}

.flow-step.current {
  border-color: rgba(45, 143, 115, 0.42);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 198, 41, 0.22), transparent 60%),
    var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(45, 143, 115, 0.12);
}

.flow-step.current span {
  background: var(--brand);
  color: white;
}

.flow-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-stats span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

@media (min-width: 760px) {
  .view {
    padding: 28px 28px 48px;
  }

  .side-nav {
    top: var(--topbar);
    left: 0;
    bottom: auto;
    width: min(94vw, 420px);
    height: calc(100dvh - var(--topbar));
    border-radius: 0 28px 28px 0;
    transform: translateX(-110%);
    padding: 16px;
  }

  .side-nav.open {
    width: min(94vw, 420px);
    transform: translateX(0);
  }

  .side-nav:not(.open) a {
    justify-content: initial;
    font-size: initial;
    padding: 10px 12px;
  }

  .side-nav:not(.open) .nav-utility {
    display: grid;
  }

  .flow-header {
    grid-template-columns: minmax(0, 1fr) 220px;
    align-items: start;
  }

  .flow-steps,
  .flow-stats {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .flow-header {
    margin-left: -2px;
    margin-right: -2px;
    border-radius: 22px;
    padding: 12px;
  }

  .flow-steps {
    grid-auto-columns: minmax(114px, 72%);
  }

  .side-nav {
    width: min(94vw, 380px);
  }

  .side-nav.open {
    width: min(94vw, 380px);
  }
}
