:root {
  --paper: #f5f7f3;
  --surface: #ffffff;
  --surface-soft: #edf4ef;
  --ink: #203036;
  --muted: #617171;
  --line: #d7dfda;
  --teal: #2f6f73;
  --teal-deep: #214e52;
  --leaf: #6d8f61;
  --sun: #b9833c;
  --clay: #9b654f;
  --danger: #a83f3f;
  --danger-soft: #f7eaea;
  --focus: #0f6f86;
  --surface-muted: #fbfcfa;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --warm-soft: #fffaf2;
  --line-strong: rgba(47, 111, 115, 0.34);
  --shadow: 0 18px 48px rgba(25, 41, 43, 0.09);
  --shadow-soft: 0 10px 28px rgba(25, 41, 43, 0.05);
  --shadow-hover: 0 16px 38px rgba(25, 41, 43, 0.08);
  --radius: 8px;
  --page-max: 1120px;
  --dock-width: 236px;
  --dock-tab-width: 46px;
  --intro-chrome-height: 73px;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(245, 247, 243, 0.96), rgba(238, 244, 239, 0.98)),
    var(--paper);
  color: var(--ink);
  line-height: 1.65;
}

body.modal-open {
  overflow: hidden;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -120px;
  z-index: 100;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  font-weight: 900;
}

.skip-link:focus {
  top: 12px;
}

.skip-sos {
  top: -120px;
  background: var(--danger);
}

.skip-sos:focus {
  top: 58px;
}

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

button {
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 111, 134, 0.25);
  outline-offset: 3px;
}

a {
  color: var(--teal-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.text-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.danger-link {
  color: var(--danger);
  font-weight: 700;
  white-space: nowrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(245, 247, 243, 0.88);
  border-bottom: 1px solid rgba(215, 223, 218, 0.72);
  backdrop-filter: blur(14px);
}

.nav-shell {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.nav-toggle {
  min-height: 40px;
  border: 1px solid rgba(47, 111, 115, 0.22);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal-deep);
  padding: 8px 14px;
  font-weight: 900;
}

.nav-toggle[aria-expanded="true"] {
  border-color: rgba(47, 111, 115, 0.46);
  background: #e8f4ef;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, transparent 42%, rgba(255, 255, 255, 0.88) 43% 56%, transparent 57%),
    var(--teal);
  box-shadow: inset -5px -5px 0 rgba(0, 0, 0, 0.08);
}

.nav {
  position: absolute;
  top: 50%;
  right: calc(100% + 10px);
  display: none;
  flex-wrap: nowrap;
  gap: 8px;
  width: max-content;
  max-width: min(900px, calc(100vw - 190px));
  overflow-x: auto;
  overflow-y: hidden;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  padding: 6px;
  white-space: nowrap;
  box-shadow: 0 14px 38px rgba(25, 41, 43, 0.12);
}

.topbar.is-nav-open .nav {
  display: flex;
}

.nav button {
  min-width: max-content;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}

.nav button[aria-current="page"] {
  background: var(--surface);
  border-color: var(--line);
  color: var(--teal-deep);
  box-shadow: 0 8px 22px rgba(25, 41, 43, 0.08);
}

.nav button:hover,
.nav button:focus-visible {
  background: #e8f4ef;
  border-color: rgba(47, 111, 115, 0.34);
  color: var(--teal-deep);
}

main {
  min-height: calc(100vh - 180px);
}

.screen {
  display: none;
  padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 48px);
}

.screen.is-active {
  display: block;
}

.intro-screen {
  padding: 0;
}

.intro-deck {
  height: calc(100dvh - var(--intro-chrome-height));
  min-height: 560px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

.intro-slide {
  position: relative;
  display: grid;
  min-height: 100%;
  place-items: center;
  overflow: hidden;
  scroll-snap-align: start;
  padding: clamp(30px, 6vw, 72px) clamp(20px, 7vw, 92px) 116px;
  background: var(--paper);
}

.intro-slide img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-slide-purpose::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(245, 247, 243, 0.76);
  content: "";
}

.intro-slide-hope {
  background: #fbfcfa;
}

.intro-slide-start {
  background: #edf4ef;
}

.intro-copy {
  position: relative;
  z-index: 2;
  width: min(820px, 100%);
}

.intro-copy h1,
.intro-copy h2 {
  margin: 0;
  max-width: 820px;
  color: var(--ink);
  font-size: 4.05rem;
  font-weight: 900;
  line-height: 1.09;
  letter-spacing: 0;
}

.intro-copy h2 {
  font-size: 3.75rem;
}

.intro-copy .lead {
  max-width: 700px;
  font-size: 1.17rem;
}

.compact-intro-copy {
  text-align: center;
}

.compact-intro-copy .lead {
  margin-right: auto;
  margin-left: auto;
}

.intro-reassurance {
  max-width: 720px;
  margin: 28px 0 0;
  color: var(--teal-deep);
  font-size: 1.14rem;
  font-weight: 850;
}

.intro-start-button {
  display: block;
  margin-top: 32px;
  margin-right: auto;
  margin-left: auto;
  min-height: 58px;
  padding: 14px 22px;
  font-size: 1.02rem;
}

.intro-skip-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: fit-content;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 750;
}

.intro-skip-choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.intro-arrow {
  position: absolute;
  left: 50%;
  bottom: 54px;
  z-index: 3;
  display: inline-grid;
  gap: 4px;
  min-width: 64px;
  min-height: 62px;
  transform: translateX(-50%);
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--teal-deep);
  padding: 4px 10px;
  font-weight: 900;
}

.intro-arrow span {
  font-size: 0.82rem;
}

.intro-arrow b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 1.25rem;
  line-height: 1;
}

.intro-arrow:hover {
  color: var(--ink);
}

.intro-arrow-up {
  bottom: 54px;
}

.home-layout {
  display: block;
  max-width: 900px;
  margin: 0 auto;
}

.home-copy {
  width: min(100%, 860px);
}

.home-copy h1,
.section-header h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(2.05rem, 4.6vw, 4.25rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: 0;
}

.section-header h1 {
  font-size: clamp(2.05rem, 4.6vw, 4.25rem);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--teal-deep);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
}

.lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 1.65vw, 1.2rem);
  line-height: 1.75;
}

.boundary-note {
  max-width: 760px;
  margin: 16px 0 0;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: rgba(237, 244, 239, 0.86);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 0.98rem;
}

.action-note {
  max-width: 760px;
  margin: 14px 0 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--sun);
  border-radius: 0 8px 8px 0;
  background: #fffdf7;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 0.98rem;
}

.action-note strong {
  color: var(--teal-deep);
}

.danger-boundary {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.early-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
}

.home-paths {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin-top: 22px;
}

.home-paths .choice {
  display: grid;
  min-height: 92px;
  position: relative;
  align-content: center;
  gap: 8px;
  padding-right: 58px;
}

.home-paths .choice::after {
  content: "→";
  position: absolute;
  right: 20px;
  top: 50%;
  color: var(--teal-deep);
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.42;
  transform: translateY(-50%);
  animation: home-arrow-pulse 2.8s ease-in-out infinite;
}

.home-paths .choice span {
  margin-bottom: 0;
}

.home-paths .choice small {
  max-width: 560px;
}

@keyframes home-arrow-pulse {
  0%, 100% {
    opacity: 0.38;
  }
  48% {
    opacity: 1;
  }
}

.choice {
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 18px;
  text-align: left;
  box-shadow: 0 8px 28px rgba(25, 41, 43, 0.05);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.choice:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 115, 0.4);
  box-shadow: var(--shadow);
}

.choice.is-selected {
  border-color: rgba(47, 111, 115, 0.58);
  background: #f1f8f5;
  box-shadow: var(--shadow);
}

.choice span {
  display: block;
  margin-bottom: 10px;
  font-size: 1.1rem;
  font-weight: 800;
}

.choice small {
  display: block;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

.section-header {
  max-width: var(--page-max);
  margin: 0 auto 32px;
  padding-bottom: 4px;
}

.crisis-header {
  border-left: 4px solid var(--danger);
  padding-left: 18px;
}

.crisis-layout,
.tool-layout,
.map-layout,
.recovery-layout,
.support-grid {
  max-width: var(--page-max);
  margin: 0 auto;
}

.crisis-layout {
  display: grid;
  grid-template-columns: 0.84fr 1.16fr;
  gap: 18px;
  align-items: stretch;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 10px 30px rgba(25, 41, 43, 0.05);
}

.panel h2,
.section-band h2 {
  margin: 0 0 14px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.25;
}

.check-stack {
  display: grid;
  gap: 12px;
}

.risk-help {
  margin: 14px 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.risk-question {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.45;
}

.risk-choice-grid {
  display: grid;
  gap: 10px;
}

.risk-choice {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
}

.risk-choice strong {
  color: var(--ink);
  line-height: 1.3;
}

.risk-choice span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.risk-choice:hover,
.risk-choice:focus-visible,
.risk-choice.is-selected {
  border-color: rgba(47, 111, 115, 0.44);
  background: var(--surface-soft);
}

.risk-choice.is-selected strong {
  color: var(--teal-deep);
}

.danger-risk:hover,
.danger-risk:focus-visible,
.danger-risk.is-selected {
  border-color: rgba(168, 63, 63, 0.38);
  background: #fff4f2;
}

.danger-risk.is-selected strong {
  color: var(--danger);
}

.warning-risk:hover,
.warning-risk:focus-visible,
.warning-risk.is-selected {
  border-color: rgba(202, 151, 73, 0.42);
  background: #fff9e8;
}

.check-stack label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.check-stack input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--danger);
}

.risk-summary {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #e7c8c8;
  border-radius: 8px;
  background: #fff7f3;
}

.risk-summary strong {
  color: var(--danger);
}

.risk-summary span {
  color: var(--muted);
}

.crisis-action {
  background: #fffafa;
  border-color: #e7c8c8;
}

.action-title {
  color: var(--danger);
}

.crisis-short {
  margin: 0 0 14px;
  color: #6e3737;
  font-weight: 800;
}

.crisis-steps {
  display: grid;
  gap: 10px;
}

.crisis-step {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  width: 100%;
  border: 1px solid #e7c8c8;
  border-radius: 8px;
  background: #fffefe;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.crisis-step strong {
  color: var(--danger);
  line-height: 1.25;
}

.crisis-step span {
  color: var(--muted);
  grid-column: 1 / -1;
  font-size: 0.95rem;
}

.crisis-step em {
  align-self: start;
  border: 1px solid rgba(168, 63, 63, 0.22);
  border-radius: 999px;
  color: var(--danger);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
  padding: 4px 8px;
  white-space: nowrap;
}

.crisis-step.is-done {
  border-color: rgba(47, 111, 115, 0.34);
  background: #f4faf7;
}

.crisis-step.is-done strong,
.crisis-step.is-done em {
  color: var(--teal-deep);
}

.crisis-step.is-done em {
  border-color: rgba(47, 111, 115, 0.28);
}

.crisis-step:hover,
.crisis-step:focus-visible {
  border-color: rgba(168, 63, 63, 0.34);
  background: #fff7f3;
  box-shadow: var(--shadow-soft);
}

.section-band {
  max-width: var(--page-max);
  margin: 18px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(237, 244, 239, 0.72);
  padding: clamp(18px, 3vw, 28px);
}

.secondary-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: var(--page-max);
  margin: 18px auto 0;
}

.secondary-entry p {
  margin: 0;
  color: var(--muted);
}

.resource-header {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.resource-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
  min-width: min(520px, 100%);
}

.resource-header p {
  margin: 0;
  color: var(--muted);
}

.select-label,
.nav-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

select,
textarea,
input[type="search"],
input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 11px 12px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.resource-card {
  min-height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}

.resource-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.resource-card-badges {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.resource-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal-deep);
}

.resource-card em {
  min-width: max-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--clay);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  padding: 2px 8px;
}

.resource-status {
  min-width: max-content;
  border-radius: 999px;
  background: #eef6f2;
  color: var(--teal-deep);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 3px 8px;
}

.resource-status-public {
  background: #eef4f7;
  color: #355b68;
}

.resource-status-review {
  background: #fff7f0;
  color: #704733;
}

.resource-status-local {
  background: #f6f1ea;
  color: var(--clay);
}

.resource-card span {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
}

.resource-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.resource-check {
  display: block;
  margin-top: 10px;
  color: var(--clay);
  font-size: 0.78rem;
  line-height: 1.45;
}

.resource-card a {
  display: inline-block;
  margin-top: 10px;
  font-weight: 800;
}

.copy-card {
  display: grid;
  gap: 14px;
}

.copy-card p {
  margin: 0;
  border-left: 3px solid var(--teal);
  padding: 12px 14px;
  background: #f8faf7;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  font-weight: 800;
}

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

.secondary-button {
  width: fit-content;
  background: var(--surface);
  border-color: var(--line);
  color: var(--teal-deep);
}

.danger-link-button {
  color: var(--danger);
  border-color: rgba(168, 63, 63, 0.24);
}

.tool-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.tool-layout[hidden] {
  display: none;
}

.stabilize-flow {
  max-width: var(--page-max);
  margin: 0 auto;
}

.flow-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.flow-steps {
  margin-top: 16px;
}

.flow-timer {
  width: fit-content;
  margin: 16px 0;
  border: 1px solid rgba(47, 111, 115, 0.2);
  border-radius: 8px;
  background: #eef7f4;
  color: var(--teal-deep);
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  font-weight: 900;
  line-height: 1;
  padding: 14px 18px;
  font-variant-numeric: tabular-nums;
}

.stabilize-feedback,
.stabilize-next {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.stabilize-feedback h3,
.stabilize-next h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
}

.stabilize-feedback p,
.stabilize-next p {
  margin: 0 0 12px;
  color: var(--muted);
}

.tool-menu {
  display: grid;
  gap: 10px;
  align-self: start;
}

.tool-button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
  font-weight: 800;
}

.tool-button.is-active {
  border-color: rgba(47, 111, 115, 0.55);
  background: var(--surface-soft);
  color: var(--teal-deep);
}

.tool-panel {
  min-height: 420px;
}

.action-coach {
  max-width: var(--page-max);
  margin: 18px auto 0;
}

.micro-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  align-items: end;
}

.micro-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.micro-result {
  margin-top: 18px;
}

.micro-result h3 {
  margin: 0 0 12px;
}

.micro-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.micro-steps article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.micro-steps strong {
  display: block;
  color: var(--sun);
}

.micro-steps p,
.micro-note {
  margin: 8px 0 12px;
}

.micro-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f6f4;
  color: var(--ink);
  font-weight: 900;
}

.micro-timer[hidden] {
  display: none;
}

.micro-timer span {
  font-variant-numeric: tabular-nums;
}

.micro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.micro-followup {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.micro-followup h4 {
  margin: 0 0 8px;
}

.micro-followup p {
  margin: 0 0 12px;
  color: var(--muted);
}

.timer {
  display: inline-grid;
  place-items: center;
  width: 118px;
  height: 118px;
  margin: 10px 0 20px;
  border: 8px solid #d7e5dc;
  border-top-color: var(--teal);
  border-radius: 50%;
  color: var(--teal-deep);
  font-size: 1.42rem;
  font-weight: 900;
}

.steps,
.soft-list {
  margin: 0;
  padding-left: 22px;
}

.steps li,
.soft-list li {
  margin: 9px 0;
}

.grounding-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.grounding-grid div {
  min-height: 100px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.grounding-grid strong {
  display: block;
  color: var(--sun);
  font-size: 1.8rem;
  line-height: 1;
}

.textarea-stack {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  align-items: start;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.map-card {
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.map-card:hover,
.map-card.is-active {
  border-color: rgba(47, 111, 115, 0.48);
  background: var(--surface-soft);
}

.map-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 1rem;
}

.map-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.map-detail {
  min-height: 520px;
}

.detail-block {
  margin-top: 18px;
}

.detail-block h3 {
  margin: 0 0 8px;
  color: var(--teal-deep);
  font-size: 1rem;
}

.detail-block p {
  margin: 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.nav-form {
  max-width: var(--page-max);
  margin: 0 auto 18px;
}

.directory-shell,
.builder-layout,
.privacy-grid {
  max-width: var(--page-max);
  margin: 0 auto;
}

.resource-intents {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.resource-intent {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  text-align: left;
}

.resource-intent:hover,
.resource-intent.is-active {
  border-color: rgba(47, 111, 115, 0.48);
  background: var(--surface-soft);
}

.resource-intent strong,
.resource-intent span {
  display: block;
}

.resource-intent strong {
  line-height: 1.35;
}

.resource-intent span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.filter-toggle {
  display: none;
  width: 100%;
  margin-bottom: 12px;
}

.directory-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.directory-filters label,
.builder-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.directory-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 14px;
  color: var(--muted);
}

.directory-meta strong {
  color: var(--teal-deep);
  font-size: 1.25rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.directory-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  box-shadow: 0 8px 22px rgba(25, 41, 43, 0.04);
}

.directory-card > span {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.directory-card p {
  color: var(--muted);
}

.resource-quick-facts,
.resource-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.resource-quick-facts small,
.resource-facts small {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.resource-quick-facts strong,
.resource-facts strong {
  color: var(--teal-deep);
  font-size: 0.74rem;
}

.resource-fit {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.resource-fit div {
  border-left: 3px solid rgba(47, 111, 115, 0.45);
  padding-left: 10px;
}

.resource-fit strong {
  color: var(--teal-deep);
  font-size: 0.82rem;
}

.resource-fit p {
  margin: 2px 0 0;
}

.resource-fit-primary {
  margin-top: 10px;
}

.resource-warning {
  margin: 12px 0 0;
  border-radius: 8px;
  background: #fff7f0;
  color: #704733;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.resource-fallback {
  margin: 12px 0 0;
  border: 1px solid rgba(47, 111, 115, 0.18);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f4faf7;
  color: var(--teal-deep);
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.55;
}

.resource-review-note {
  max-width: 760px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  padding: 10px 12px;
}

.resource-review-note summary {
  color: var(--teal-deep);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.resource-review-note p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.resource-maintenance-note {
  max-width: 760px;
  margin-top: 12px;
  border: 1px solid rgba(184, 119, 76, 0.24);
  border-left: 4px solid var(--sun);
  border-radius: 8px;
  background: #fffaf2;
  padding: 12px 14px;
}

.resource-maintenance-note strong {
  color: var(--ink);
}

.resource-maintenance-note p {
  margin: 6px 0 0;
  color: var(--muted);
}

.resource-maintenance-panel {
  display: grid;
  gap: 16px;
}

.resource-maintenance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.resource-maintenance-grid p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  padding: 12px;
}

.resource-maintenance-grid strong {
  display: block;
  color: var(--teal-deep);
  margin-bottom: 4px;
}

.resource-more {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.resource-more summary {
  color: var(--teal-deep);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
}

.resource-more summary::marker {
  color: var(--teal);
}

.resource-more[open] summary {
  margin-bottom: 8px;
}

.resource-review-copy {
  border-left: 3px solid rgba(47, 111, 115, 0.35);
  margin: 10px 0 0;
  padding-left: 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row small {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-deep);
  background: #fbfcfa;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 800;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-deep);
  padding: 7px 12px;
  font-weight: 800;
  text-decoration: none;
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.builder-form {
  display: grid;
  gap: 14px;
}

.builder-stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.step-dot {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.25;
}

.step-dot.is-active {
  border-color: rgba(47, 111, 115, 0.48);
  background: #e8f4ef;
  color: var(--teal-deep);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 115, 0.1);
}

.builder-step {
  display: grid;
  gap: 14px;
}

.builder-step[hidden] {
  display: none;
}

.step-copy {
  border: 1px solid rgba(47, 111, 115, 0.16);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f8fbf8;
  padding: 14px;
}

.step-copy h2 {
  margin: 4px 0 0;
  font-size: clamp(1.18rem, 2vw, 1.55rem);
}

.step-copy p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.builder-intro {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.builder-intro strong {
  color: var(--teal-deep);
}

.builder-intro span {
  color: var(--muted);
  font-size: 0.94rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-button {
  min-height: 38px;
  border: 1px solid rgba(47, 111, 115, 0.28);
  border-radius: var(--radius);
  background: #f7fbf8;
  color: var(--teal-deep);
  padding: 8px 12px;
  font-size: 0.92rem;
  font-weight: 900;
}

.preset-button:hover {
  border-color: rgba(47, 111, 115, 0.58);
  background: #edf7f0;
}

.choice-set {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.choice-set legend {
  padding: 0 6px;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.choice-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice-chips label {
  position: relative;
  min-width: 0;
}

.choice-chips input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.choice-chips span {
  display: flex;
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  font-size: 0.92rem;
  font-weight: 750;
  line-height: 1.35;
}

.choice-chips input:checked + span {
  border-color: rgba(47, 111, 115, 0.72);
  background: #e7f1ea;
  box-shadow: inset 0 0 0 1px rgba(47, 111, 115, 0.16);
  color: var(--teal-deep);
}

.choice-chips input:focus-visible + span {
  outline: 3px solid rgba(15, 111, 134, 0.22);
  outline-offset: 2px;
}

.soft-textarea {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.soft-textarea textarea {
  min-height: 72px;
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.builder-output {
  position: sticky;
  top: 96px;
  min-height: 420px;
}

.urgent-note {
  border-left: 4px solid var(--danger);
  background: var(--danger-soft);
  padding: 12px 14px;
}

.gentle-note {
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
  padding: 12px 14px;
}

.prep-context-card {
  border: 1px solid rgba(47, 111, 115, 0.24);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f7fbf8;
  padding: 14px;
}

.prep-context-card strong,
.prep-context-card span {
  display: block;
}

.prep-context-card strong {
  color: var(--teal-deep);
}

.prep-context-card span {
  color: var(--clay);
  font-size: 0.88rem;
  font-weight: 800;
  margin-top: 4px;
}

.prep-context-card p {
  margin: 8px 0 0;
}

.prep-copy-stack {
  display: grid;
  gap: 12px;
}

.prep-copy-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.prep-copy-card.primary {
  border-color: rgba(47, 111, 115, 0.28);
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
}

.prep-copy-card strong {
  display: block;
  color: var(--teal-deep);
}

.prep-copy-card p {
  margin: 7px 0 0;
}

.prep-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prep-script {
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
}

.prep-script p {
  margin: 6px 0 0;
}

.prep-barrier-set > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.prep-barrier-chips {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.prep-barrier-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(184, 119, 76, 0.3);
  border-left: 4px solid var(--sun);
  border-radius: 8px;
  background: #fffaf2;
  padding: 14px;
}

.prep-barrier-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.prep-barrier-card p {
  margin: 0;
  color: var(--muted);
}

.prep-barrier-card div {
  border-top: 1px solid rgba(184, 119, 76, 0.18);
  padding-top: 10px;
}

.prep-barrier-card strong {
  display: block;
  color: var(--sun);
  margin-bottom: 4px;
}

.prep-guidance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.prep-guidance-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 12px;
}

.prep-guidance-card h3 {
  color: var(--teal-deep);
  font-size: 0.98rem;
  margin: 0 0 8px;
}

.prep-guidance-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.storage-status {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.plan-panel {
  max-width: var(--page-max);
  margin: 0 auto;
}

.plan-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: plan;
}

.plan-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  counter-increment: plan;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.plan-list li.is-active {
  border-color: rgba(47, 111, 115, 0.38);
  background: #f3faf7;
}

.plan-list li::before {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  content: counter(plan);
  font-weight: 900;
}

.plan-list p {
  margin: 0 0 10px;
}

.plan-item-body {
  min-width: 0;
}

.plan-list [data-plan-step].is-selected {
  border-color: rgba(47, 111, 115, 0.48);
  background: #e8f4ef;
  color: var(--teal-deep);
}

.compact-button {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.9rem;
}

.plan-inline-detail {
  margin-top: 12px;
  border: 1px solid rgba(47, 111, 115, 0.2);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.plan-inline-detail[hidden] {
  display: none;
}

.plan-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-resource-section {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

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

.plan-resource-heading h3 {
  margin: 2px 0 0;
  color: var(--teal-deep);
  font-size: 1.2rem;
}

.plan-resource-section > p {
  color: var(--muted);
  margin: 0 0 14px;
}

.plan-resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-resource-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.plan-resource-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.plan-resource-top strong,
.plan-resource-card span {
  display: block;
  color: var(--teal-deep);
  font-weight: 900;
}

.plan-resource-card span {
  color: var(--ink);
  margin-top: 8px;
}

.plan-resource-card p {
  color: var(--muted);
  margin: 8px 0;
}

.plan-resource-meta {
  display: block;
  color: var(--clay);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.45;
}

.plan-resource-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.plan-resource-facts small {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 7px 8px;
  font-size: 0.72rem;
  line-height: 1.35;
}

.plan-resource-facts strong {
  color: var(--teal-deep);
  font-size: 0.7rem;
}

.recovery-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.recovery-tabs {
  display: grid;
  gap: 10px;
}

.recovery-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.recovery-tab:hover,
.recovery-tab.is-active {
  border-color: rgba(47, 111, 115, 0.48);
  background: var(--surface-soft);
}

.recovery-tab strong,
.recovery-tab span {
  display: block;
}

.recovery-tab span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.recovery-detail {
  min-height: 420px;
}

.recovery-choice-actions .is-selected {
  border-color: rgba(47, 111, 115, 0.48);
  background: var(--surface-soft);
  color: var(--teal-deep);
}

.recovery-response {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.recovery-response[hidden] {
  display: none;
}

.recovery-response h3 {
  margin: 0 0 8px;
  color: var(--teal-deep);
}

.recovery-response p {
  margin: 0 0 12px;
}

.completion-step {
  margin: 12px 0;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: #f8faf7;
  padding: 12px 14px;
}

.completion-step strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal-deep);
}

.completion-step p {
  margin: 0;
  color: var(--ink);
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.sitemap-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: var(--page-max);
  margin: 0 auto;
}

.sitemap-card {
  min-height: 220px;
}

.sitemap-card.danger-map {
  grid-column: 1 / -1;
  border-color: #e7c8c8;
  background: #fffafa;
}

.sitemap-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.sitemap-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitemap-list li {
  display: grid;
  grid-template-columns: minmax(140px, 0.55fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px;
}

.sitemap-list button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal-deep);
  padding: 8px 10px;
  font-weight: 900;
  text-align: left;
}

.sitemap-list span {
  color: var(--muted);
  font-size: 0.92rem;
}

/* Unified UI language for repeated page elements. */
.panel,
.section-band,
.directory-card,
.resource-card,
.plan-resource-card,
.prep-copy-card,
.prep-guidance-card,
.prep-context-card,
.choice-set,
.micro-steps article,
.grounding-grid div,
.storage-status,
.sitemap-list li {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-soft);
}

.tool-panel,
.map-detail,
.plan-panel,
.builder-output,
.recovery-detail,
.crisis-action {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(251, 252, 250, 0.94)),
    var(--surface);
}

.primary-button,
.secondary-button,
.secondary-link,
.preset-button,
.audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
  line-height: 1.2;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover,
.primary-button:focus-visible,
.audio-toggle:hover,
.audio-toggle:focus-visible {
  background: var(--teal-deep);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.secondary-link:hover,
.secondary-link:focus-visible,
.preset-button:hover,
.preset-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
  color: var(--teal-deep);
  transform: translateY(-1px);
}

.danger-link-button:hover,
.danger-link-button:focus-visible {
  border-color: rgba(168, 63, 63, 0.34);
  background: var(--danger-soft);
  color: var(--danger);
}

.choice,
.risk-choice,
.check-stack label,
.tool-button,
.map-card,
.resource-intent,
.recovery-tab,
.step-dot,
.choice-chips span,
.sitemap-list button {
  border-color: var(--line);
  border-radius: var(--radius);
  background: var(--surface-muted);
  color: var(--ink);
  box-shadow: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, color 140ms ease;
}

.choice:hover,
.choice:focus-visible,
.risk-choice:hover,
.risk-choice:focus-visible,
.check-stack label:hover,
.check-stack label:focus-within,
.tool-button:hover,
.tool-button:focus-visible,
.map-card:hover,
.map-card:focus-visible,
.resource-intent:hover,
.resource-intent:focus-visible,
.recovery-tab:hover,
.recovery-tab:focus-visible,
.sitemap-list button:hover,
.sitemap-list button:focus-visible,
.choice-chips input:focus-visible + span {
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--teal-deep);
  transform: translateY(-1px);
}

.choice.is-selected,
.risk-choice.is-selected,
.check-stack label:has(input:checked),
.tool-button.is-active,
.map-card.is-active,
.resource-intent.is-active,
.recovery-tab.is-active,
.step-dot.is-active,
.choice-chips input:checked + span,
.plan-list [data-plan-step].is-selected,
.recovery-choice-actions .is-selected {
  border-color: rgba(47, 111, 115, 0.56);
  background: var(--surface-soft);
  color: var(--teal-deep);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 115, 0.1);
}

.danger-risk:hover,
.danger-risk:focus-visible,
.danger-risk.is-selected {
  border-color: rgba(168, 63, 63, 0.4);
  background: var(--danger-soft);
  color: var(--danger);
}

.warning-risk:hover,
.warning-risk:focus-visible,
.warning-risk.is-selected {
  border-color: rgba(185, 131, 60, 0.42);
  background: var(--warm-soft);
  color: #704733;
}

.danger-risk {
  border-color: rgba(168, 63, 63, 0.28);
  background: #fffafa;
}

.warning-risk {
  border-color: rgba(185, 131, 60, 0.26);
  background: #fffdf7;
}

.choice span,
.risk-choice strong,
.map-card strong,
.resource-intent strong,
.recovery-tab strong,
.plan-resource-top strong,
.prep-copy-card strong,
.tool-button {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.36;
}

.choice small,
.risk-choice span,
.map-card span,
.resource-intent span,
.recovery-tab span,
.builder-intro span,
.prep-copy-card p,
.plan-resource-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.58;
}

.choice.is-selected span,
.risk-choice.is-selected strong,
.map-card.is-active strong,
.resource-intent.is-active strong,
.recovery-tab.is-active strong,
.tool-button.is-active {
  color: var(--teal-deep);
}

.danger-risk:hover strong,
.danger-risk:focus-visible strong,
.danger-risk.is-selected strong {
  color: var(--danger);
}

.warning-risk:hover strong,
.warning-risk:focus-visible strong,
.warning-risk.is-selected strong {
  color: #704733;
}

.boundary-note,
.action-note,
.resource-review-note,
.resource-maintenance-note,
.resource-fallback,
.resource-warning,
.urgent-note,
.gentle-note,
.builder-intro,
.step-copy,
.completion-step,
.plan-inline-detail,
.copy-card p {
  border-radius: var(--radius);
  line-height: 1.65;
  box-shadow: none;
}

.boundary-note,
.gentle-note,
.resource-fallback,
.builder-intro,
.step-copy,
.completion-step,
.plan-inline-detail,
.copy-card p {
  border: 1px solid rgba(47, 111, 115, 0.18);
  border-left: 4px solid var(--teal);
  background: var(--surface-soft);
}

.action-note,
.resource-maintenance-note,
.resource-warning {
  border: 1px solid rgba(185, 131, 60, 0.22);
  border-left: 4px solid var(--sun);
  background: var(--warm-soft);
}

.danger-boundary,
.urgent-note {
  border-color: rgba(168, 63, 63, 0.22);
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.detail-block h3,
.recovery-response h3,
.prep-guidance-card h3,
.plan-resource-heading h3 {
  color: var(--teal-deep);
  font-size: 0.98rem;
  line-height: 1.35;
}

.resource-quick-facts small,
.resource-facts small,
.plan-resource-facts small,
.tag-row small,
.resource-status {
  border-radius: var(--radius);
  background: var(--surface-muted);
}

.tag-row small,
.resource-status {
  border-radius: 999px;
}

.resource-status {
  background: #eef6f2;
  color: var(--teal-deep);
}

.resource-status-public {
  background: #eef4f7;
  color: #355b68;
}

.resource-status-review {
  background: #fff7f0;
  color: #704733;
}

.resource-status-local {
  background: #f6f1ea;
  color: var(--clay);
}

.filter-toggle {
  display: none;
}

.section-header .boundary-note,
.section-header .action-note,
.section-header .resource-review-note,
.section-header .resource-maintenance-note {
  max-width: 760px;
}

.panel h2,
.map-detail h2,
.tool-panel h2,
.plan-panel h2,
.builder-output h2,
.recovery-detail h2,
.crisis-action h2 {
  color: var(--ink);
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  line-height: 1.28;
}

.select-label,
.nav-form label,
.directory-filters label,
.builder-form label,
.micro-form label,
.soft-textarea {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.38;
}

select,
textarea,
input[type="search"],
input[type="text"] {
  min-height: 46px;
  border-color: var(--line);
  background: var(--surface);
  line-height: 1.35;
}

select:hover,
textarea:hover,
input[type="search"]:hover,
input[type="text"]:hover {
  border-color: var(--line-strong);
}

.detail-actions,
.builder-actions,
.prep-copy-actions,
.plan-next-actions,
.micro-actions {
  gap: 10px;
}

.detail-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(215, 223, 218, 0.72);
}

.detail-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.detail-block h3 {
  margin-bottom: 6px;
}

.detail-block p,
.plan-list p,
.prep-copy-card p,
.prep-guidance-card li,
.resource-card p,
.directory-card p,
.plan-resource-card p {
  line-height: 1.65;
}

.builder-output > p:first-child,
.plan-panel > p:first-child,
.tool-panel > p:first-child,
.map-detail > p:first-child,
.recovery-detail > p:first-child {
  margin-top: 0;
}

.sos-dock {
  position: fixed;
  right: 0;
  top: 35%;
  z-index: 58;
  width: var(--dock-width);
  transform: translate(calc(100% - var(--dock-tab-width)), -50%);
  border: 1px solid #e7c8c8;
  border-radius: 8px;
  background: rgba(255, 250, 250, 0.95);
  box-shadow: 0 18px 48px rgba(85, 28, 28, 0.16);
  padding: 12px 12px 12px calc(var(--dock-tab-width) + 12px);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease;
}

.dock-tab {
  position: absolute;
  inset: 0 auto 0 0;
  display: grid;
  place-items: center;
  width: var(--dock-tab-width);
  border-radius: 8px 0 0 8px;
  border: 0;
  color: white;
  padding: 0;
  font-size: 0.94rem;
  font-weight: 900;
  letter-spacing: 0;
}

.sos-tab {
  background: var(--danger);
}

.audio-tab {
  background: var(--teal-deep);
  font-size: 0.9rem;
  writing-mode: vertical-rl;
}

.dock-content {
  display: grid;
  gap: 9px;
}

.sos-dock::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 var(--dock-tab-width);
  width: 1px;
  background: rgba(255, 255, 255, 0.54);
}

.audio-dock::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 var(--dock-tab-width);
  width: 1px;
  background: rgba(255, 255, 255, 0.54);
}

.dock-tab:focus-visible {
  color: white;
  outline-color: rgba(255, 255, 255, 0.7);
  outline-offset: -4px;
}

.sos-dock.is-open {
  transform: translate(0, -50%);
}

.sos-button {
  display: grid;
  gap: 2px;
  min-height: 58px;
  border: 1px solid rgba(168, 63, 63, 0.35);
  border-radius: 8px;
  background: var(--danger);
  color: white;
  padding: 10px 12px;
  text-align: left;
}

.sos-button strong {
  font-size: 1.02rem;
  line-height: 1.1;
}

.sos-button span {
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0.92;
}

.sos-dock p {
  margin: 0;
  color: #6e3737;
  font-size: 0.82rem;
  line-height: 1.45;
}

.audio-dock {
  position: fixed;
  right: 0;
  top: 66%;
  z-index: 55;
  width: var(--dock-width);
  transform: translate(calc(100% - var(--dock-tab-width)), -50%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 12px 12px 12px calc(var(--dock-tab-width) + 12px);
  backdrop-filter: blur(12px);
  transition: transform 180ms ease;
}

.audio-dock.is-open {
  transform: translate(0, -50%);
}

.audio-head {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.audio-head strong {
  color: var(--teal-deep);
  font-size: 0.95rem;
}

.audio-head span {
  color: var(--muted);
  font-size: 0.78rem;
}

.audio-dock label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.audio-dock select {
  min-height: 38px;
  padding: 7px 9px;
}

.audio-toggle {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--teal-deep);
  color: white;
  padding: 7px 12px;
  font-weight: 800;
}

.calm-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(245, 247, 243, 0.82);
  padding: 20px;
  backdrop-filter: blur(16px);
}

.calm-modal[hidden] {
  display: none;
}

.calm-card {
  position: relative;
  width: min(620px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(25, 41, 43, 0.18);
  padding: clamp(22px, 5vw, 38px);
  text-align: center;
}

.calm-card h2 {
  margin: 0 auto 18px;
  max-width: 520px;
  font-size: clamp(1.65rem, 4vw, 2.6rem);
  line-height: 1.16;
}

.calm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.4rem;
}

.breath-orb {
  width: 150px;
  height: 150px;
  margin: 20px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 38%, rgba(255, 255, 255, 0.95), rgba(237, 244, 239, 0.7) 46%, rgba(47, 111, 115, 0.22) 100%);
  box-shadow: 0 18px 48px rgba(47, 111, 115, 0.16);
  animation: breathe 7s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(0.88);
  }
  48% {
    transform: scale(1.08);
  }
}

#calm-step {
  max-width: 480px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.08rem;
}

.calm-progress {
  display: grid;
  gap: 8px;
  max-width: 420px;
  margin: 18px auto 0;
}

.calm-progress span {
  color: var(--teal-deep);
  font-weight: 900;
}

.calm-progress div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d7e5dc;
}

.calm-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.calm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.footer {
  display: grid;
  gap: 8px;
  padding: 28px clamp(16px, 4vw, 48px) 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.footer p {
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
}

.footer a {
  display: inline-block;
  margin-right: 12px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hidden-page {
  display: grid;
  place-content: center;
  min-height: 100vh;
  padding: 24px;
  background: white;
  color: #202124;
  text-align: center;
}

.hidden-page h1 {
  margin: 0 0 10px;
  font-size: 1.6rem;
}

.hidden-page p {
  max-width: 560px;
  color: #5f6368;
}

.hidden-page button {
  justify-self: center;
  border: 1px solid #dadce0;
  border-radius: 6px;
  background: #f8fafd;
  color: #202124;
  padding: 10px 14px;
}

@media (max-width: 980px) {
  .intro-copy h1,
  .intro-copy h2 {
    font-size: 2.85rem;
  }

  .intro-copy .lead {
    font-size: 1.06rem;
  }

  .home-layout,
  .crisis-layout,
  .tool-layout,
  .map-layout,
  .recovery-layout,
  .support-grid,
  .sitemap-layout {
    grid-template-columns: 1fr;
  }

  .secondary-entry {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-grid,
  .resource-intents,
  .form-grid,
  .directory-filters,
  .directory-grid,
  .resource-maintenance-grid,
  .builder-layout,
  .privacy-grid,
  .micro-form,
  .micro-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .audio-dock {
    top: 68%;
    right: 0;
    bottom: auto;
    left: auto;
    width: 224px;
    grid-template-columns: 1fr;
    align-items: stretch;
    transform: translate(calc(100% - 46px), -50%);
  }

  .audio-head {
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
  }

  .sos-dock {
    top: 38%;
    right: 0;
    width: 224px;
  }
}

@media (max-width: 680px) {
  :root {
    --intro-chrome-height: 116px;
  }

  body {
    padding-bottom: 86px;
  }

  .intro-screen {
    padding: 0;
  }

  .intro-deck {
    height: calc(100dvh - var(--intro-chrome-height));
    min-height: 490px;
  }

  .intro-slide {
    align-items: center;
    place-items: center start;
    padding: 30px 20px 104px;
  }

  .intro-copy h1,
  .intro-copy h2 {
    font-size: 1.95rem;
    line-height: 1.16;
  }

  .intro-copy .lead {
    font-size: 0.98rem;
  }

  .intro-reassurance {
    font-size: 0.98rem;
  }

  .intro-arrow {
    bottom: 124px;
    min-height: 62px;
  }

  .intro-arrow b {
    width: 34px;
    height: 34px;
  }

  .intro-start-button {
    width: 100%;
  }

  .intro-skip-choice {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    font-size: 0.91rem;
  }

  .topbar {
    gap: 12px;
  }

  .nav {
    position: fixed;
    top: 76px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
    transform: none;
    border-radius: 999px;
    padding: 6px;
  }

  .choice-grid,
  .map-grid,
  .tool-menu,
  .resource-grid,
  .resource-intents,
  .plan-resource-grid,
  .prep-guidance-grid,
  .prep-barrier-chips,
  .choice-chips,
  .form-grid,
  .builder-stepper,
  .sitemap-layout {
    grid-template-columns: 1fr;
  }

  .early-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .early-actions .primary-button,
  .early-actions .secondary-button {
    width: 100%;
  }

  .prep-copy-actions {
    flex-direction: column;
  }

  .prep-copy-actions .primary-button,
  .prep-copy-actions .secondary-button {
    width: 100%;
  }

  .choice {
    min-height: 108px;
  }

  .plan-resource-heading,
  .plan-resource-top {
    flex-direction: column;
  }

  .plan-resource-heading .secondary-button {
    width: 100%;
  }

  .resource-header {
    align-items: stretch;
    flex-direction: column;
  }

  .resource-controls,
  .directory-filters,
  .directory-grid,
  .resource-quick-facts,
  .resource-facts,
  .resource-maintenance-grid,
  .plan-resource-facts,
  .builder-layout,
  .privacy-grid,
  .micro-form,
  .micro-steps {
    grid-template-columns: 1fr;
  }

  .resource-card-top {
    flex-direction: column;
  }

  .resource-card-badges {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .filter-toggle {
    display: inline-flex;
  }

  .directory-shell:not(.is-filter-open) .directory-filters {
    display: none;
  }

  .audio-dock {
    grid-template-columns: 1fr;
    right: 0;
    top: 70%;
    width: 214px;
    padding: 10px 10px 10px 56px;
    transform: translate(calc(100% - 44px), -50%);
  }

  .audio-head span {
    display: none;
  }

  .audio-dock label {
    display: none;
  }

  .audio-dock.is-open label {
    display: grid;
  }

  .sos-dock {
    right: 12px;
    bottom: 12px;
    top: auto;
    width: 74px;
    transform: none;
    padding: 0;
    border-color: rgba(168, 63, 63, 0.28);
  }

  .sos-dock::before {
    display: none;
  }

  .sos-dock .dock-content {
    display: none;
    gap: 7px;
  }

  .sos-dock p {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .sos-dock .dock-tab {
    position: static;
    width: 100%;
    min-height: 42px;
    border-radius: 8px;
  }

  .sos-dock.is-open {
    width: min(360px, calc(100vw - 24px));
    padding: 10px;
  }

  .sos-dock.is-open .dock-content {
    display: grid;
  }

  .sos-dock.is-open {
    transform: none;
  }

  .sitemap-list li {
    grid-template-columns: 1fr;
  }

  .builder-output {
    position: static;
    min-height: 0;
  }

  .home-copy h1,
  .section-header h1 {
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  .screen {
    padding-top: 28px;
  }

  .grounding-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
