:root {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: #34283c;
  background: #fbf5f6;
  font-synthesis: none;
  --ink: #34283c;
  --muted: #6d5a76;
  --accent: #69507c;
  --soft: #e8ddef;
  --line: #d8c8e0;
  --danger: #8a405d;
  --surface: #fffcff;
  --card: #f1e9f5;
  --other: #f0d7d9;
}
:root[data-font-size="large"] { font-size: 22px; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; }
button, a, summary { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 4px; }
button, a, input, textarea { overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, .message:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.app-shell {
  width: 100%; max-width: 440px; margin: 0 auto;
  min-height: 100svh;
  padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 32px; }
.badge { font-size: .889rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #a38ab4; }
.text-button { background: none; border: 0; padding: 10px 0; min-height: 44px; font-size: .889rem; color: var(--accent); text-align: left; }
.topbar .text-button { display: inline-flex; gap: 8px; align-items: center; }
.topbar svg { width: 18px; height: 18px; flex: 0 0 auto; }
.topbar .saved-entry {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-width: 88px; min-height: 54px; margin-left: auto; padding: 5px 8px;
  border: 0; border-radius: 12px; background: none; color: var(--accent);
  font-size: .778rem; line-height: 1.3; text-align: center;
}
.topbar .saved-entry svg { width: 22px; height: 22px; }
.topbar .saved-entry:hover { background: var(--soft); }
main { min-width: 0; }
h1 { font-size: 1.667rem; line-height: 1.25; letter-spacing: -.025em; font-weight: 650; margin: 0 0 18px; overflow-wrap: anywhere; }
h2, h3 { min-width: 0; overflow-wrap: anywhere; }
h1:focus { outline: none; }
p { margin: 0 0 24px; overflow-wrap: anywhere; }
.body { color: var(--muted); }
.exercise .body, [data-screen="SAFETY"] .body, [data-screen="WORSE"] .body, [data-screen="URGENT"] .body { color: var(--ink); }
.actions { display: grid; gap: 12px; margin-top: 30px; }
.action {
  width: 100%; min-height: 56px; padding: 15px 20px;
  border-radius: 22px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-decoration: none; line-height: 1.4; font-weight: 500;
}
.action.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; min-height: 58px; }
.action.secondary { background: var(--soft); }
.action.danger { color: var(--danger); border-color: #c9a8b6; }
.action.link { background: none; border: none; border-radius: 6px; color: var(--accent); padding: 10px 2px; min-height: 44px; font-weight: 400; }
.action svg { width: 22px; height: 22px; flex: 0 0 auto; }
.action:hover { filter: brightness(.98); }
.home-layout { display: flex; flex-direction: column; }
.home-layout .topbar { margin-bottom: 24px; }
.home .actions { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 24px; gap: 12px; }
.home .actions > * { grid-column: 1 / -1; }
.home .action { padding: 16px; }
.home .actions > .home-situation { grid-column: auto; }
.home .action.home-situation {
  min-height: 158px; margin: 0; background: var(--card); border-color: var(--line);
  color: var(--ink); align-items: flex-start; position: relative; padding-bottom: 42px;
}
.home .home-situation > svg { position: absolute; bottom: 15px; right: 15px; width: 20px; height: 20px; color: var(--accent); }
.home .action.home-other { min-height: 60px; background: var(--other); border-color: #dfbec4; color: var(--ink); }
.home .action.home-help { min-height: 64px; background: var(--soft); border-color: var(--line); color: var(--ink); }
.home .home-help svg { color: var(--accent); }
.home-action-copy { display: grid; gap: 5px; min-width: 0; }
.home-action-title { font-size: 1rem; font-weight: 600; }
.home .primary .home-action-title { font-size: 1rem; }
.home-action-description { color: var(--muted); font-size: .889rem; font-weight: 400; line-height: 1.4; }
.home .primary .home-action-description { color: var(--muted); }
.home h1 { max-width: 400px; margin-bottom: 12px; }
.home .body { margin-bottom: 0; }
.exercise { min-height: 440px; display: flex; flex-direction: column; }
.exercise .actions { margin-top: auto; padding-top: 36px; }
.choices { border: 0; padding: 0; margin: 4px 0 0; display: grid; gap: 10px; min-width: 0; }
.choices legend { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.choice { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 54px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; cursor: pointer; }
.choice:has(input:checked) { border: 2px solid var(--accent); padding: 12px 15px; background: var(--soft); }
.choice input { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
.notice .actions { padding-top: 24px; }
.message { margin: 28px 0; padding: 22px; border-left: 3px solid var(--accent); border-radius: 0 16px 16px 0; background: var(--soft); user-select: text; overflow-wrap: anywhere; }
.contact-card, .empty-card, .saved-card { padding: 20px; margin: 24px 0; background: var(--soft); border: 1px solid var(--line); border-radius: 22px; overflow-wrap: anywhere; }
.contact-card p, .empty-card p, .saved-card p { margin: 0; }
.contact-card .contact-name { font-weight: 600; margin-bottom: 5px; }
.phone { font-variant-numeric: tabular-nums; user-select: all; }
.phone-note { font-size: .889rem; color: var(--muted); margin: 16px 0 0; }
.contact-form { margin-top: 28px; }
.field { margin-bottom: 24px; }
.field label { display: block; margin-bottom: 9px; font-size: .944rem; }
.field input, .field textarea { display: block; width: 100%; max-width: 100%; min-height: 56px; background: var(--surface); border: 1px solid #a68daf; border-radius: 20px; padding: 12px 14px; color: var(--ink); }
.field textarea { resize: vertical; min-height: 124px; line-height: 1.6; }
.field-hint { margin: 9px 0 0; font-size: .889rem; color: var(--muted); }
.field input[aria-invalid="true"] { border: 2px solid var(--danger); }
.field-error { color: var(--danger); font-size: .889rem; margin-top: 10px; margin-bottom: 0; }
.topics { list-style: none; margin: 28px 0; padding: 0; border-top: 1px solid var(--line); color: var(--muted); }
.topics li { padding: 16px 2px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.support-footer { margin-top: 26px; }
.support-footer .text-button { color: var(--danger); text-decoration: underline; text-decoration-thickness: 1px; }
.tabs { display: grid; grid-template-columns: .75fr 1.15fr .85fr 1.25fr; border-top: 1px solid var(--line); margin: 22px -8px 0; padding-top: 12px; gap: 0; }
.tab { border: 0; border-radius: 10px; background: none; color: var(--muted); padding: 10px 2px; display: flex; flex-direction: column; gap: 6px; align-items: center; min-height: 66px; text-align: center; font-size: .889rem; line-height: 1.3; letter-spacing: -.02em; }
.tab svg { width: 21px; height: 21px; }
.tab[aria-current="page"] { color: var(--accent); background: var(--soft); font-weight: 600; }
.feedback { margin: 18px 0 0; font-size: .889rem; color: var(--accent); padding: 15px 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow-wrap: anywhere; }
.feedback.error { color: var(--danger); }
.feedback:empty { display: none; }
.eyebrow { color: var(--accent); font-size: .889rem; margin: 0 0 12px; line-height: 1.5; }
.home .eyebrow { display: flex; align-items: center; gap: 10px; }
.home .eyebrow::before { content: ""; width: 24px; height: 1px; background: #aa92b7; }
.journey-progress { color: var(--muted); font-size: .889rem; margin: 0 0 14px; width: fit-content; padding: 4px 12px; background: var(--soft); border-radius: 18px; }
.section-heading { font-size: 1.111rem; line-height: 1.4; font-weight: 600; margin: 32px 0 16px; }
.card-list { display: grid; gap: 12px; margin: 24px 0; }
.content-card { display: flex; align-items: center; gap: 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 18px; width: 100%; min-width: 0; color: var(--ink); line-height: 1.45; }
.content-card:hover { border-color: #ac91bb; background: var(--card); }
.content-card > svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--accent); }
.card-mark { display: flex; align-items: center; justify-content: center; background: var(--soft); color: var(--accent); border-radius: 50%; flex: 0 0 40px; height: 40px; }
.card-mark svg { width: 21px; height: 21px; }
.card-copy { display: grid; gap: 7px; min-width: 0; flex: 1; }
.card-title { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.card-description { font-size: .889rem; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.resume-card { background: var(--card); border-color: var(--line); padding: 16px; margin-bottom: 4px; }
.contact-list { display: grid; gap: 12px; margin: 24px 0; }
.contact-list .contact-card { margin: 0; background: var(--surface); }
.contact-card .text-button { margin-top: 9px; }
.contact-call { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; font-size: .944rem; }
.reading-block { margin: 28px 0; }
.reading-block h2 { font-size: 1.111rem; font-weight: 600; line-height: 1.4; margin: 0 0 12px; color: var(--ink); }
.reading-block p { margin: 0; }
.reading-list { margin: 16px 0 0; padding-left: 24px; }
.reading-list li { padding-left: 4px; margin: 12px 0; overflow-wrap: anywhere; }
.source-links { margin: 28px 0; padding-left: 22px; font-size: .889rem; }
.source-links li { margin: 12px 0; }
.support-footer { display: flex; flex-direction: column; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 16px; gap: 2px; }
.support-footer .text-button { display: inline-flex; align-items: center; gap: 9px; }
.support-footer .text-button:first-child:not(:last-child) { color: var(--accent); text-decoration: none; }
.support-footer svg { width: 17px; height: 17px; flex: 0 0 auto; }
.home-layout .support-footer { margin-top: auto; padding-top: 16px; border-top: 0; gap: 0; }
.home-footnote { margin: 0; font-size: .889rem; color: var(--muted); line-height: 1.45; }
.home-layout .support-footer .text-button { width: 100%; padding: 8px 0; line-height: 1.45; text-decoration: none; }
.home-layout .tabs { margin-top: 16px; }
.support-layout { display: flex; flex-direction: column; }
.support-layout .topbar { margin-bottom: 22px; }
.support-layout .topbar .text-button:last-child { color: var(--muted); }
.support-step.exercise { min-height: 0; display: block; }
.support-step .body { color: var(--ink); margin-bottom: 20px; white-space: pre-line; }
.support-step .actions { margin-top: 26px; padding-top: 0; margin-bottom: 28px; }
.support-step .eyebrow { margin-bottom: 8px; }
.support-step .reading-block { margin: 20px 0; }
.support-step .reading-list li { margin: 10px 0; }
.support-step .card-list { margin-top: 20px; }
.support-step .content-card { padding: 16px; }
.support-layout .support-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 14px; gap: 0; }
.support-layout .support-footer .text-button { width: 100%; padding: 8px 0; text-decoration: none; line-height: 1.45; }
.sense-steps { display: flex; align-items: center; gap: 10px; margin: 4px 0 24px; }
.sense-count { display: flex; justify-content: center; align-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 1rem; }
.sense-count.current { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 650; }
.sense-count.complete { background: var(--soft); }
.practice-why { margin: 24px 0; padding: 14px 16px; background: var(--soft); border-radius: 20px; font-size: .889rem; line-height: 1.5; }
.why-label { display: block; color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.practice-why p { margin: 0; }
.reflection-field { margin: 24px 0; }
.reflection-field textarea { min-height: 112px; }
.reflection-field textarea::placeholder { color: var(--muted); opacity: 1; }
.reflection-review { margin: 24px 0; }
.reflection-review h2 { font-size: .889rem; font-weight: 500; color: var(--muted); margin: 0 0 12px; }
.reflection-row { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin-top: 10px; }
.reflection-index { display: flex; align-items: center; justify-content: center; flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--accent); font-size: .889rem; }
.reflection-copy { min-width: 0; }
.reflection-row h3 { font-size: .889rem; font-weight: 600; color: var(--accent); margin: 0 0 5px; }
.reflection-row p { margin: 0; overflow-wrap: anywhere; line-height: 1.5; }
.thought-phrase { display: grid; gap: 8px; margin: 24px 0; }
.thought-prefix { font-size: .889rem; color: var(--muted); }
.action[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.thought-catalog-layout, .app-shell:has(> .thought-catalog) { display: flex; flex-direction: column; }
.thought-catalog-layout .topbar, .app-shell:has(> .thought-catalog) .topbar { margin-bottom: 16px; }
.thought-catalog h1 { font-size: 1.444rem; margin-bottom: 18px; }
.thought-catalog .card-list.case-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px;
}
.case-grid .content-card {
  min-height: 96px; padding: 12px; gap: 0; border-radius: 20px; align-items: center;
  background: var(--card); color: var(--ink);
}
.case-grid .content-card:hover { border-color: var(--accent); background: var(--soft); }
.case-grid .card-title { font-size: .889rem; line-height: 1.35; font-weight: 600; }
.case-grid .card-copy { gap: 0; }
.case-grid .card-mark, .case-grid .content-card > svg { display: none; }
.thought-catalog-layout .support-footer, .app-shell:has(> .thought-catalog) .support-footer {
  margin-top: auto; padding-top: 0; border-top: 0;
}
.thought-catalog-layout .support-footer .text-button, .app-shell:has(> .thought-catalog) .support-footer .text-button {
  padding: 8px 0; min-height: 44px;
}
.thought-catalog-layout .tabs, .app-shell:has(> .thought-catalog) .tabs { margin-top: 8px; padding-top: 8px; }
.case-step.exercise { min-height: 0; display: block; }
.case-step .body { color: var(--ink); white-space: pre-line; }
.case-step .actions { margin-top: 24px; padding-top: 0; }
.case-step .eyebrow { margin-bottom: 8px; }
.lesson-options { display: grid; gap: 10px; border: 0; padding: 0; margin: 24px 0; min-width: 0; }
.lesson-options legend:not(.visually-hidden) {
  padding: 0; margin-bottom: 14px; font-weight: 600; line-height: 1.5; color: var(--ink);
}
.lesson-option {
  display: block; width: 100%; min-height: 54px; padding: 14px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 20px; font-size: 1rem; line-height: 1.5; text-align: left;
}
.lesson-option:hover { background: var(--card); border-color: #ac91bb; }
.lesson-option[aria-pressed="true"] {
  border-color: var(--accent); background: var(--soft); outline: 2px solid var(--accent); outline-offset: 2px;
}
.lesson-option:focus-visible { outline-width: 3px; outline-offset: 4px; }
.lesson-feedback {
  padding: 18px; margin: 24px 0; background: var(--soft); border: 1px solid var(--line);
  border-radius: 22px; color: var(--ink); line-height: 1.55;
}
.lesson-feedback p { margin: 0 0 18px; }
.lesson-feedback p:last-child { margin-bottom: 0; }
.lesson-feedback .lesson-next { margin-top: 16px; }
.lesson-feedback .lesson-next.action { width: 100%; }
.lesson-feedback:empty { display: none; }
.lesson-explanation, .lesson-explanations { margin: 24px 0; color: var(--ink); }
.lesson-explanation { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.lesson-explanation h2, .lesson-explanation h3, .lesson-explanations h2, .lesson-explanations h3 {
  margin: 0 0 12px; font-size: 1rem; line-height: 1.45;
}
.lesson-explanation p:last-child, .lesson-explanations p:last-child { margin-bottom: 0; }
.personal-form + .actions { margin-top: 24px; }
.help-directory { margin-top: 22px; overflow-wrap: anywhere; }
.help-jumps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; }
.help-jumps a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--soft); color: var(--ink); text-decoration: none; font-size: .889rem;
}
.help-group { margin: 32px 0; scroll-margin-top: 20px; }
.help-group > h2 { margin: 0 0 16px; font-size: 1.222rem; font-weight: 650; line-height: 1.35; }
.service-card {
  min-width: 0; margin: 0 0 14px; padding: 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
}
.service-card.emergency { background: #f7e8ec; border-color: #ddbdca; }
.service-name { margin: 0 0 8px; font-size: 1.056rem; font-weight: 650; line-height: 1.4; }
.service-description { margin: 0 0 14px; color: var(--muted); font-size: .889rem; line-height: 1.5; }
.service-methods { list-style: none; margin: 0; padding: 0; }
.service-method { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); }
.service-method:first-child { padding-top: 0; border-top: 0; }
.service-method:last-child { padding-bottom: 0; }
.service-link {
  display: inline-flex; align-items: center; min-height: 44px; max-width: 100%;
  color: var(--accent); font-weight: 600; text-decoration-thickness: 1px; line-height: 1.4;
  overflow-wrap: anywhere;
}
.service-link[href^="tel:"] { font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.service-link[href^="tel:112"] { font-size: 1.333rem; }
.service-card.emergency .service-link { color: var(--danger); }
.service-hours, .service-note { margin: 3px 0 0; font-size: .889rem; line-height: 1.5; }
.service-hours { color: var(--ink); }
.service-note { color: var(--muted); }
.service-sources { margin-top: 16px; border-top: 1px solid var(--line); font-size: .889rem; }
.service-sources summary { width: fit-content; min-height: 44px; padding: 11px 0 7px; cursor: pointer; color: var(--accent); }
.service-source { display: block; min-height: 44px; padding: 9px 0; line-height: 1.5; overflow-wrap: anywhere; }
.help-verification { color: var(--muted); margin: 26px 0 12px; font-size: .889rem; line-height: 1.5; }
.helpFooter { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .889rem; line-height: 1.5; }
.helpFooter p { margin-bottom: 10px; }
.helpFooter a { display: inline-block; min-height: 44px; padding: 9px 0; }
@media (min-width: 700px) {
  body { padding: 40px 24px; background: radial-gradient(ellipse at 50% 0, #ede1f0, #fbf5f6 65%); }
  .app-shell { max-width: 560px; min-height: min(800px, calc(100svh - 80px)); background: var(--surface); padding: 28px 36px; border: 1px solid var(--line); border-radius: 28px; box-shadow: 0 16px 60px #5d3c6c0a; }
  .topbar { margin-bottom: 40px; }
  .home h1 { font-size: 1.667rem; }
  .exercise { min-height: 480px; }
  .action:not(.primary):not(.link) { background: var(--soft); }
  .home .action.home-situation { background: var(--card); }
  .home .action.home-other { background: var(--other); }
  .home .action.home-help { background: var(--soft); }
}
@media (max-width: 350px) {
  .app-shell { padding-left: 16px; padding-right: 16px; }
  .topbar { gap: 4px 10px; margin-bottom: 26px; }
  h1 { font-size: 1.5rem; }
  .action { padding-left: 16px; padding-right: 16px; }
  .tabs { margin-left: -10px; margin-right: -10px; }
  .content-card { gap: 10px; padding: 17px 14px; }
  .card-mark { flex-basis: 32px; height: 32px; }
  .home .actions { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .home .action.home-situation { min-height: 96px; padding: 16px 44px 16px 16px; align-items: center; }
  .home .home-situation > svg { bottom: calc(50% - 10px); }
  .service-card { padding: 16px; }
}
:root[data-font-size="large"] .home .actions { grid-template-columns: minmax(0, 1fr); }
:root[data-font-size="large"] .home .action.home-situation { min-height: 110px; padding: 18px 48px 18px 18px; align-items: center; }
:root[data-font-size="large"] .home .home-situation > svg { bottom: calc(50% - 10px); }
:root[data-font-size="large"] .thought-catalog .card-list.case-grid { grid-template-columns: minmax(0, 1fr); }
:root[data-font-size="large"] .case-grid .content-card { min-height: 80px; padding: 16px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
