/* Safety Planning page styles */

.sp-hero {
  background: linear-gradient(180deg, var(--plum-50), var(--cream));
  padding: 72px 24px 56px;
}
.sp-hero-inner { max-width: 1280px; margin: 0 auto; }
.sp-hero-lede {
  margin-top: 22px;
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 56ch;
}
.sp-hero-meta {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.sp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-mute);
  font-weight: 500;
}
.sp-meta-item svg { color: var(--plum-600); }

.sp-body { padding: 56px 24px 80px; background: var(--cream); }
.sp-body-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  align-items: start;
}

.sp-side {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sp-progress {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
}
.sp-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sp-progress-label strong {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--plum-700);
  font-weight: 500;
  letter-spacing: -0.02em;
}
.sp-progress-bar {
  margin-top: 12px;
  height: 6px;
  background: var(--cream-2);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.sp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--terra-600), var(--plum-600));
  border-radius: var(--r-pill);
  transition: width .3s ease;
}
.sp-progress-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}
.sp-side-btn {
  flex: 1;
  padding: 9px 12px;
  background: var(--plum-700);
  color: white;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.sp-side-btn:hover { background: var(--plum-800); }
.sp-side-btn.ghost {
  background: transparent;
  color: var(--ink-mute);
  border: 1px solid var(--line-2);
}
.sp-side-btn.ghost:hover { background: var(--cream-2); color: var(--ink); }

.sp-nav {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sp-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  text-align: left;
  transition: all .15s;
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  width: 100%;
}
.sp-nav-item:hover { background: var(--paper); color: var(--plum-800); }
.sp-nav-item.active {
  background: var(--plum-50);
  color: var(--plum-800);
  font-weight: 600;
}
.sp-nav-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: var(--cream-2);
  color: var(--plum-700);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sp-nav-item.active .sp-nav-icon {
  background: var(--terra-100);
  color: var(--terra-700);
}
.sp-nav-label { flex: 1; min-width: 0; }
.sp-nav-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.sp-nav-item.active .sp-nav-count { color: var(--terra-700); }

.sp-help-card {
  background: var(--plum-700);
  color: var(--cream);
  border-radius: var(--r-lg);
  padding: 24px;
}
.sp-help-card h4 { color: white; font-size: 17px; }
.sp-help-card p {
  margin: 8px 0 18px;
  color: var(--plum-100);
  font-size: 14px;
  line-height: 1.5;
}
.sp-help-card .btn-primary { background: var(--cream); color: var(--plum-800); }
.sp-help-card .btn-primary:hover { background: white; }

.sp-main {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 56px;
  box-shadow: var(--sh-sm);
}
.sp-section-head h2 { font-size: clamp(28px, 3vw, 40px); }
.sp-section-blurb {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 60ch;
}

.sp-checklist {
  margin-top: 40px;
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sp-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: all .15s;
}
.sp-item.checked {
  background: var(--plum-50);
  border-color: var(--plum-300);
}
.sp-check {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: white;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .15s;
  font-family: var(--font-serif);
  color: var(--ink-mute);
  font-weight: 600;
}
.sp-check:hover { border-color: var(--plum-500); }
.sp-item.checked .sp-check {
  background: var(--plum-700);
  border-color: var(--plum-700);
  color: white;
}
.sp-check-num {
  font-size: 13px;
  letter-spacing: 0.04em;
}
.sp-item-body { min-width: 0; }
.sp-item-title {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--plum-900);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.sp-item.checked .sp-item-title { text-decoration: line-through; text-decoration-color: var(--plum-300); text-decoration-thickness: 1px; }
.sp-item-desc {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}
.sp-note {
  margin-top: 12px;
  font-size: 13px;
}
.sp-note summary {
  cursor: pointer;
  color: var(--plum-700);
  font-weight: 600;
  width: max-content;
  user-select: none;
}
.sp-note summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.sp-note textarea {
  margin-top: 10px;
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink);
  background: white;
  resize: vertical;
}
.sp-note textarea:focus {
  outline: none;
  border-color: var(--plum-500);
  box-shadow: 0 0 0 3px var(--plum-50);
}

.sp-foot {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.sp-foot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--plum-700);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  transition: all .15s;
}
.sp-foot-link:hover { background: var(--plum-50); }
.sp-foot-link.primary {
  background: var(--plum-700);
  color: white;
  padding: 12px 20px;
}
.sp-foot-link.primary:hover { background: var(--plum-800); }

.sp-grounding {
  background: var(--plum-900);
  color: var(--cream);
  padding: 80px 24px;
}
.sp-grounding-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.sp-grounding p {
  margin-top: 20px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--plum-100);
}

@media print {
  .nav, .safety-bar, .sp-side, .sp-foot, .sp-grounding, .footer, .quick-escape-float, .tweaks-panel, .hover-cover, .sp-note summary {
    display: none !important;
  }
  .sp-body-inner { grid-template-columns: 1fr; }
  .sp-main { box-shadow: none; border: none; padding: 0; }
  .sp-item { break-inside: avoid; background: white; border: 1px solid #ddd; }
  .sp-note textarea { border: 1px solid #ccc; }
  .sp-note[open] summary { display: block !important; }
  body { background: white; }
}

@media (max-width: 1024px) {
  .sp-body-inner { grid-template-columns: 1fr; gap: 24px; }
  .sp-side { position: static; }
  .sp-nav { flex-direction: row; flex-wrap: wrap; }
  .sp-nav-item { flex: 1 1 280px; }
  .sp-main { padding: 36px 28px; }
}

@media (max-width: 720px) {
  .sp-hero { padding: 44px 20px 32px; }
  .sp-body { padding: 32px 20px 56px; }
  .sp-main { padding: 24px 20px; border-radius: var(--r-lg); }
  .sp-item { padding: 18px; gap: 14px; }
  .sp-item-title { font-size: 17px; }
  .sp-foot { flex-direction: column; gap: 8px; align-items: stretch; }
  .sp-foot-link { justify-content: center; }
  .sp-nav-item { flex: 1 1 100%; }
  .sp-grounding { padding: 56px 24px; }
}
