/* Матрица личностных адаптаций — минималистичный редакционный дизайн и улучшенный UX */
@import url("assets/brand/palette.css");

:root {
  --ink: var(--dc-ink);
  --ink-soft: var(--dc-ink-soft);
  --muted: var(--dc-muted);
  --line: var(--dc-line);
  --line-strong: var(--dc-line-strong);
  --surface: var(--dc-surface);
  --surface-alt: var(--dc-surface-alt);
  --page: var(--dc-page);

  --accent: var(--dc-lab);
  --accent-dark: var(--dc-lab-dark);
  --accent-soft: var(--dc-lab-soft);
  --accent-line: var(--dc-lab-line);

  --teal: var(--dc-club);
  --teal-dark: var(--dc-club-dark);
  --teal-soft: var(--dc-club-soft);
  --teal-line: var(--dc-club-line);

  --amber: var(--dc-amber);
  --amber-soft: var(--dc-amber-soft);
  --amber-line: var(--dc-amber-line);

  --green: var(--dc-green);
  --green-soft: var(--dc-green-soft);
  --green-line: var(--dc-green-line);

  --rose: var(--dc-rose);
  --rose-soft: var(--dc-rose-soft);
  --rose-line: var(--dc-rose-line);

  --blue: var(--dc-blue);
  --blue-soft: var(--dc-blue-soft);
  --blue-line: var(--dc-blue-line);

  --shadow-sm: 0 2px 8px rgba(26, 35, 64, 0.035);
  --shadow: 0 10px 30px rgba(26, 35, 64, 0.045);
  --radius: 18px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 420px at 50% -60px, rgba(104, 79, 208, 0.055), transparent 72%),
    var(--page);
  font: 14.5px/1.58 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin-top: 0; }
button, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
svg { display: block; flex-shrink: 0; }

/* Term links (RU articles integration) */
.term-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(104, 79, 208, 0.48);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.term-link:hover {
  color: var(--accent);
  text-decoration-style: solid;
  text-decoration-color: var(--accent);
}
.script-tag .term-tag-link { text-decoration: none; }
.script-tag:hover .term-tag-link, .script-tag .term-tag-link:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
}
.profile-header h3 .term-link { text-decoration-color: rgba(26, 35, 64, 0.25); }
.profile-type .term-link { text-decoration: none; }
.profile-type .term-link:hover { text-decoration: underline; }

/* Shell */
.m-wrap {
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Unified Minimalist Header (matches index.html) */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 255, 0.9);
  backdrop-filter: blur(12px);
}
.header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.brand-mark { width: 24px; height: 24px; flex-shrink: 0; }
.brand-copy strong {
  display: block;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand-copy small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.2;
  margin-top: 1px;
}
.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.h-link, .h-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.h-link:hover, .h-btn:hover {
  background: #f2f4fb;
  color: var(--ink);
}
.h-link.articles-pill {
  background: var(--teal-soft);
  border-color: var(--teal-line);
  color: var(--teal-dark);
}
.h-link.articles-pill:hover {
  background: #dff4f2;
  border-color: #9bd6d1;
}
.h-btn.bordered, .h-link.lang-pill {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.h-btn.bordered:hover, .h-link.lang-pill:hover {
  border-color: #b7c2da;
  background: #f6f8fd;
}
.h-link.lang-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
  color: var(--accent-dark);
}

/* Sticky Command & Section Navigation Bar */
.command-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(251, 252, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.command-inner {
  min-height: 54px;
  padding: 7px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cmd-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pair-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}
.pair-pill .dot-a { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }
.pair-pill .dot-b { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.pair-pill .swap-mini {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}
.pair-pill .swap-mini:hover { background: #f2f4fb; color: var(--accent); }

.cmd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.15s;
}
.cmd-btn:hover {
  border-color: #c4baf2;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

/* Section Jump Links (Scroll-Spy) */
.section-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.section-nav a:hover { color: var(--ink); background: #f2f4fb; }
.section-nav a.is-active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

/* Mode Segmented Switcher */
.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #eff2f9;
  border: 1px solid #e4e8f3;
  flex-shrink: 0;
}
.mode-btn {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  transition: all 0.15s;
}
.mode-btn:hover { color: var(--ink); }
.mode-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(26, 35, 64, 0.1);
}
.app.is-therapist .mode-btn.active {
  color: var(--accent-dark);
}

/* Therapist visibility */
.therapy-only { display: none !important; }
.app.is-therapist .therapy-only { display: block !important; }
.app.is-therapist .section-nav a.therapy-only { display: inline-flex !important; }

/* Workspace 3-Column Grid */
.app {
  padding: 18px 0 36px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(272px, 304px) minmax(520px, 1fr) minmax(272px, 304px);
  gap: 18px;
  align-items: start;
}

.side, .center {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

/* Side Panels */
.side { padding: 16px; }
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.side-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.side-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.side-left .side-dot { background: var(--teal); }
.side-right .side-dot { background: var(--amber); }
.side-head h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -0.01em;
}
.side-head span.side-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Compact Selector Buttons */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
}
.adaptation-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 7px 10px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 550;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.adaptation-option:hover {
  background: var(--surface-alt);
  color: var(--ink);
}
.adaptation-option .radio {
  width: 14px;
  height: 14px;
  border: 1.5px solid #c4ccde;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.adaptation-option .opt-icon { display: none; }
.adaptation-option .opt-label { flex: 1; min-width: 0; line-height: 1.28; }
.adaptation-option .opt-tag {
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
  opacity: 0.85;
  flex-shrink: 0;
}
.adaptation-option.selected { font-weight: 700; }
.side-left .adaptation-option.selected {
  background: var(--teal-soft);
  border-color: var(--teal-line);
  color: #076a70;
}
.side-right .adaptation-option.selected {
  background: var(--amber-soft);
  border-color: var(--amber-line);
  color: #934e0d;
}
.adaptation-option.selected .radio { border-color: currentColor; }
.adaptation-option.selected .radio::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.adaptation-option.selected .opt-tag { color: currentColor; opacity: 0.78; }

/* Side Profile Card */
.side-profile {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.profile-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.profile-header h3 {
  font-size: 17px;
  line-height: 1.24;
  letter-spacing: -0.02em;
  font-weight: 750;
  margin: 0;
}
.profile-type {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid var(--teal-line);
}
.side-right .profile-type {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}
.profile-original {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 14px;
}

.profile-strategy {
  border-left: 2.5px solid var(--teal);
  padding: 2px 0 2px 12px;
  margin-bottom: 14px;
}
.side-right .profile-strategy { border-left-color: var(--amber); }
.profile-strategy small {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.profile-strategy strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  color: var(--ink);
}
.motto {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 14px;
}

.fact-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.fact {
  padding: 8px 0;
  font-size: 12.6px;
  line-height: 1.42;
  border-bottom: 1px solid #f0f2f9;
  color: var(--ink-soft);
}
.fact:last-child { border-bottom: 0; }
.fact strong { color: var(--ink); font-weight: 700; }

/* Ware's 3 Doors */
.doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}
.door {
  border-radius: 10px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.door .door-k {
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}
.door .door-v {
  font-size: 11.8px;
  font-weight: 700;
  line-height: 1.25;
}
.door.open { background: var(--green-soft); border-color: var(--green-line); color: var(--green); }
.door.target { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
.door.trap { background: var(--rose-soft); border-color: var(--rose-line); color: var(--rose); }

/* Mini Strengths & Stress */
.mini-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.mini-group {
  padding: 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}
.mini-group.positive { background: #f6fcf9; border-color: #d7efe2; }
.mini-group.negative { background: #fff9fa; border-color: #f6dfe6; }
.mini-group h4 {
  font-size: 11px;
  font-weight: 750;
  margin: 0 0 7px;
  letter-spacing: 0.02em;
}
.mini-group.positive h4 { color: var(--green); }
.mini-group.negative h4 { color: var(--rose); }
.mini-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.mini-group li { font-size: 12px; line-height: 1.35; color: var(--ink-soft); }

.profile-growth {
  font-size: 12.4px;
  line-height: 1.5;
  color: var(--ink-soft);
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}
.profile-growth strong { color: var(--ink); }

/* Sidebar Script Map */
.profile-script {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-alt);
  padding: 12px;
}
.profile-script-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-script-heading strong { font-size: 12.5px; font-weight: 750; color: var(--ink); }
.profile-script-heading small { font-size: 10.5px; color: var(--muted); }
.script-core { display: grid; gap: 8px; }
.script-core-item {
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.script-core-item small {
  display: block;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.script-core-item strong { font-size: 12.5px; color: var(--accent-dark); }

.script-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.script-tag {
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 3px 8px;
  border-radius: 7px;
  background: #f2f4fa;
  color: var(--ink-soft);
  border: 1px solid #e3e7f2;
}
.script-tag.warning { background: #fff5f0; color: #9c4a2e; border-color: #f4dacd; }
.script-tag.process { background: var(--accent-soft); color: var(--accent-dark); border-color: var(--accent-line); }
.script-tag.feelings { background: var(--rose-soft); color: #9a3959; border-color: var(--rose-line); }

.script-details {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.script-details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent-dark);
  padding: 3px 0;
}
.script-details summary::-webkit-details-marker { display: none; }
.script-details summary span { transition: transform 0.2s; font-size: 15px; }
.script-details[open] summary span { transform: rotate(180deg); }
.script-detail-rows { display: grid; gap: 0; margin-top: 8px; }
.script-detail-rows > div { border-top: 1px solid #eceff7; padding: 9px 0; }
.script-detail-rows b { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.script-detail-rows p { margin: 0; font-size: 12.2px; line-height: 1.5; color: var(--ink-soft); }
.script-detail-rows .script-permission {
  margin-top: 4px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
}
.script-permission b { color: var(--green); }
.script-permission p { color: #1d5b40; }

/* Sidebar Therapist Profile */
.profile-therapy {
  margin-top: 14px;
  border: 1px solid var(--accent-line);
  border-radius: 12px;
  background: #faf9ff;
  padding: 12px;
}
.profile-therapy-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-therapy-head strong { font-size: 12.5px; color: var(--accent-dark); }
.profile-therapy-head small { font-size: 10.5px; color: var(--muted); }
.therapy-contact {
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.therapy-contact > span {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.05em;
  color: var(--teal);
  margin-bottom: 4px;
}
.therapy-contact p { margin: 0; font-size: 12px; line-height: 1.48; color: var(--ink-soft); }
.therapy-mini-heading { font-size: 11.5px; font-weight: 750; color: var(--ink); margin: 12px 0 6px; }
.therapy-goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.therapy-goals li { display: flex; gap: 6px; font-size: 12px; line-height: 1.45; color: var(--ink-soft); }
.therapy-goals li::before { content: "✓"; color: var(--green); font-weight: 800; }
.therapy-mini-intervention {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  margin: 6px 0;
}
.therapy-mini-intervention strong { font-size: 12px; color: var(--ink); display: block; }
.therapy-mini-intervention p { font-size: 12px; line-height: 1.45; color: var(--accent-dark); margin: 4px 0; }
.therapy-mini-intervention small { display: block; font-size: 11.2px; line-height: 1.45; color: var(--muted); }
.therapy-note { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line-strong); }
.therapy-note strong { font-size: 11px; color: var(--amber); display: block; }
.therapy-note.outcome strong { color: var(--green); }
.therapy-note p { font-size: 12px; line-height: 1.48; color: var(--ink-soft); margin: 3px 0 0; }

/* ==========================================================================
   CENTER WORKSPACE — EDITORIAL REDESIGN
   ========================================================================== */
.center {
  padding: 26px 28px 28px;
}
.center.is-updating {
  animation: pairFade 0.2s ease-out;
}
@keyframes pairFade {
  from { opacity: 0.65; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Combination Hero */
.combo-hero {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.combo-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.pair-index-kicker {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.combo-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.small-action {
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.14s;
}
.small-action:hover {
  border-color: #c5bbf3;
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.combo-hero h2 {
  font-size: clamp(24px, 2.5vw, 31px);
  line-height: 1.16;
  letter-spacing: -0.028em;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--ink);
}
.combo-subtitle {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

/* Minimal Fusion Strip */
.fusion-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.fusion-side {
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--teal-line);
  background: var(--teal-soft);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.fusion-side.right-fusion {
  border-color: var(--amber-line);
  background: var(--amber-soft);
}
.fusion-side strong {
  font-size: 14px;
  font-weight: 750;
  color: #076a70;
}
.fusion-side.right-fusion strong { color: #934e0d; }
.fusion-side small {
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fusion-plus {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 500;
}

/* Center Sections */
.panel-section {
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 72px;
}
.panel-section:first-of-type {
  border-top: 0;
  margin-top: 0;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.section-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-kicker {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.section-heading h3 {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 750;
  margin: 0;
}
.section-explainer {
  font-size: 12px;
  color: var(--muted);
}

/* 01 · Five Dynamics — Clean Top-Accent Cards (readable & airy) */
.dynamics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dynamic-card {
  border-radius: 12px;
  border: 1px solid var(--line);
  border-top-width: 2.5px;
  background: var(--surface);
  padding: 14px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dynamic-card:hover {
  box-shadow: var(--shadow-sm);
}
.dynamic-card-top {
  display: flex;
  align-items: center;
  gap: 7px;
}
.dynamic-icon { font-size: 15px; line-height: 1; }
.dynamic-card h4 { font-size: 13.5px; font-weight: 750; margin: 0; }
.dynamic-card p { font-size: 13px; line-height: 1.52; color: var(--ink-soft); margin: 0; }

.dynamic-card.synergy { border-top-color: #1c9665; }
.dynamic-card.synergy .dynamic-card-top { color: var(--green); }

.dynamic-card.conflict { border-top-color: #cf4e72; }
.dynamic-card.conflict .dynamic-card-top { color: var(--rose); }

.dynamic-card.compensation { border-top-color: #347bc9; }
.dynamic-card.compensation .dynamic-card-top { color: var(--blue); }

.dynamic-card.switching { border-top-color: #dc8a2b; }
.dynamic-card.switching .dynamic-card-top { color: var(--amber); }

.dynamic-card.integration {
  border-top-color: var(--accent);
  background: #fbfaff;
  grid-column: span 2;
}
.dynamic-card.integration .dynamic-card-top { color: var(--accent-dark); }

/* 02 · Comparison Table */
.comparison-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}
.comparison-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
  text-align: left;
}
.comparison-table th {
  background: var(--surface-alt);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
}
.comparison-table th.th-left { color: var(--teal); background: #f4fbfa; }
.comparison-table th.th-right { color: var(--amber); background: #fffbf5; }
.comparison-table th.th-result { color: var(--accent-dark); background: #f8f6ff; }
.comparison-table td {
  padding: 12px 13px;
  border-bottom: 1px solid #f0f2f9;
  vertical-align: top;
  line-height: 1.48;
  color: var(--ink-soft);
}
.comparison-table tr:last-child td { border-bottom: 0; }
.comparison-table td:first-child {
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}
.comparison-table td.result {
  background: #fbfaff;
  color: var(--ink);
  font-weight: 550;
}
.comparison-table tbody tr:hover td { background: #f9fbff; }
.comparison-table tbody tr:hover td.result { background: #f4f1ff; }
.comparison-table .aspect-icon { color: var(--muted); margin-right: 6px; font-weight: 400; }

/* 03 · Script Layer */
.script-hypothesis-label {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 4px 10px;
}
.script-intro {
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.script-persona-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.script-persona {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px;
  background: var(--surface-alt);
}
.script-persona.persona-a { border-left: 3px solid var(--teal); }
.script-persona.persona-b { border-left: 3px solid var(--amber); }
.script-persona-label {
  display: block;
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  margin-bottom: 8px;
}
.script-persona-title {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.script-persona strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 10px;
}
.script-persona p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.script-focal {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--rose-line);
  background: var(--rose-soft);
}
.script-focal span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--rose);
  margin-bottom: 4px;
}
.script-focal p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 650;
  color: #5e1f35;
}

.script-intersections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.script-intersection {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.script-intersection-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 9px;
}
.script-process-lanes { display: grid; gap: 7px; }
.script-process-lanes > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.script-process-lanes small {
  font-size: 10px;
  font-weight: 750;
  color: var(--muted);
  background: #f2f4fa;
  padding: 2px 6px;
  border-radius: 5px;
}
.script-empty { font-size: 12px; color: var(--muted); line-height: 1.45; }

.script-path {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1.15fr);
  gap: 6px;
  align-items: stretch;
}
.script-path-step {
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}
.script-path-step small {
  display: block;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 5px;
}
.script-path-step strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--ink);
}
.script-path-step.stress { background: var(--amber-soft); border-color: var(--amber-line); }
.script-path-step.positive { background: var(--green-soft); border-color: var(--green-line); }
.script-path-arrow { display: grid; place-items: center; color: var(--muted); font-size: 16px; }

.script-takeaway {
  margin-top: 12px;
  padding: 12px 15px;
  border-radius: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 13px;
  line-height: 1.55;
  color: #463775;
}
.script-takeaway p { margin: 0; }
.script-caveat {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* Professional Therapist Section */
.therapy-section {
  background: #faf9ff;
  border: 1px solid var(--accent-line);
  border-radius: 16px;
  padding: 22px;
  margin-top: 28px;
}
.therapy-tag {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--accent-dark);
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 4px 10px;
}
.therapy-lead { font-size: 13.5px; line-height: 1.58; color: var(--ink-soft); margin: 0 0 16px; }
.therapy-hypothesis {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--accent-line);
  background: var(--surface);
  margin-bottom: 16px;
}
.therapy-hypothesis span {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}
.therapy-hypothesis p { margin: 0; font-size: 14px; line-height: 1.55; font-weight: 600; color: var(--ink); }

.therapy-panel-heading { margin: 18px 0 10px; }
.therapy-panel-heading h4 { font-size: 14.5px; font-weight: 750; margin: 0; color: var(--ink); }
.therapy-goal-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.therapy-goal-card {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.therapy-goal-card > span {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 7px;
  padding: 3px 7px;
  flex-shrink: 0;
}
.therapy-goal-card p { margin: 0; font-size: 12.8px; line-height: 1.48; color: var(--ink-soft); }

.therapy-intervention-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.therapy-intervention {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.therapy-intervention-top { display: flex; align-items: center; gap: 9px; }
.therapy-intervention-top span {
  font-size: 11px;
  font-weight: 750;
  color: #fff;
  background: var(--accent);
  border-radius: 7px;
  padding: 3px 7px;
  flex-shrink: 0;
}
.therapy-intervention-top strong { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.therapy-quote {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--accent-soft);
}
.therapy-quote small, .therapy-practice small {
  display: block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent-dark);
  margin-bottom: 4px;
}
.therapy-practice small { color: var(--teal); }
.therapy-quote p { margin: 0; font-size: 13px; line-height: 1.5; color: #3d2f72; }
.therapy-practice p { margin: 0; font-size: 12.6px; line-height: 1.5; color: var(--ink-soft); }

.therapy-monitor {
  margin: 14px 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--green-soft);
  border: 1px solid var(--green-line);
}
.therapy-monitor strong { display: block; font-size: 12px; color: var(--green); margin-bottom: 3px; }
.therapy-monitor p { margin: 0; font-size: 12.8px; line-height: 1.5; color: #205c43; }

.therapy-contact-doors {
  padding: 14px 15px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.therapy-contact-doors > span { display: block; font-size: 12.5px; font-weight: 750; color: var(--ink); margin-bottom: 10px; }
.therapy-contact-doors > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.therapy-contact-doors > div > div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
}
.therapy-contact-doors > div > div:last-child {
  background: var(--amber-soft);
  border-color: var(--amber-line);
}
.therapy-contact-doors small { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.therapy-contact-doors strong { font-size: 13px; color: var(--ink); }
.therapy-contact-doors p { margin: 10px 0 0; font-size: 12.2px; line-height: 1.5; color: var(--muted); }

.therapy-safeguard {
  margin-top: 14px;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid #eadcb6;
  background: #fffdf5;
  font-size: 12.5px;
  line-height: 1.55;
  color: #645534;
}
.therapy-safeguard strong { color: #4c3f21; display: block; margin-bottom: 3px; }
.therapy-safeguard p { margin: 0; }

/* 04 · Contexts (with All-4 View Toggle!) */
.context-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.context-all-toggle {
  height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.14s;
}
.context-all-toggle:hover, .context-all-toggle[aria-pressed="true"] {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.context-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.context-tab {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.14s;
}
.context-tab:hover { border-color: #b7c2da; color: var(--ink); }
.context-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.context-insight {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}
.context-insight span {
  display: block;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.context-insight p {
  margin: 0;
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink);
}

/* All-4 Contexts Grid Mode */
.contexts-all-grid {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.context-section.show-all .context-tabs,
.context-section.show-all .context-insight { display: none; }
.context-section.show-all .contexts-all-grid { display: grid; }
.context-card-all {
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}
.context-card-all small {
  display: block;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.context-card-all p {
  margin: 0;
  font-size: 13.2px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* 05 · Practical Map */
.results-stack { display: grid; gap: 10px; }
.result-block {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.result-top { margin-bottom: 10px; }
.result-top h4 { font-size: 13px; font-weight: 750; margin: 0; }
.result-block.strengths .result-top h4 { color: var(--green); }
.result-block.risks .result-top h4 { color: var(--rose); }
.result-block.restore .result-top h4 { color: var(--teal); }

.result-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.result-chip {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
}
.strengths .result-chip { background: var(--green-soft); color: #165e41; border: 1px solid #d5eee0; }
.risks .result-chip { background: var(--rose-soft); color: #963452; border: 1px solid #f5d8e2; }
.restore .result-chip { background: var(--teal-soft); color: #09686f; border: 1px solid #cdebe8; }

.growth-banner {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
}
.growth-banner span {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-dark);
  margin-bottom: 5px;
}
.growth-banner p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  font-weight: 650;
  color: var(--ink);
}

.site-note {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
}

/* Footer */
.site-footer {
  max-width: 1580px;
  margin: 0 auto;
  padding: 18px 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 14px 36px rgba(26, 35, 64, 0.24);
  border-radius: 11px;
  padding: 11px 18px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 60;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   INTERACTIVE ALL-15-PAIRS MATRIX MODAL
   ========================================================================== */
.pairs-dialog {
  color-scheme: light;
  width: min(980px, calc(100vw - 24px));
  max-height: min(88dvh, 820px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(20, 28, 56, 0.25);
  overflow: auto;
}
.pairs-dialog::backdrop {
  background: rgba(18, 26, 48, 0.56);
  backdrop-filter: blur(4px);
}
.pairs-dialog-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 16px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.pairs-dialog-head small {
  display: block;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 3px;
}
.pairs-dialog-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.dialog-close-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--ink-soft);
  font-size: 22px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dialog-close-btn:hover { background: #eef1fa; color: var(--ink); }

.pairs-dialog-body {
  padding: 20px 24px 24px;
}
.pairs-matrix-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.pairs-grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  table-layout: fixed;
}
.pairs-grid-table th {
  font-size: 11px;
  font-weight: 750;
  color: var(--ink-soft);
  padding: 7px 6px;
  text-align: center;
  border-radius: 8px;
  background: var(--surface-alt);
  transition: background 0.14s, color 0.14s;
}
.pairs-grid-table th.row-th { text-align: left; padding-left: 10px; }
.pairs-grid-table th.is-hl {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.pairs-grid-table td { padding: 0; vertical-align: stretch; }
.pairs-cell-self {
  height: 62px;
  border-radius: 9px;
  background: #f5f7fc;
  display: grid;
  place-items: center;
  color: #c5cde0;
  font-size: 13px;
}
.pairs-cell-btn {
  width: 100%;
  min-height: 62px;
  padding: 7px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  transition: all 0.14s;
}
.pairs-cell-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.pairs-cell-btn strong {
  font-size: 11.5px;
  line-height: 1.24;
  color: var(--ink);
  font-weight: 700;
}
.pairs-cell-btn span {
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
}
.pairs-cell-btn.is-current {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(104, 79, 208, 0.25);
}
.pairs-cell-btn.is-current strong,
.pairs-cell-btn.is-current span { color: #ffffff; }
.pairs-cell-btn.is-current span { opacity: 0.85; }
.pairs-cell-btn.is-mirror {
  background: #fbfcff;
  border-style: dashed;
  opacity: 0.72;
}
.pairs-cell-btn.is-mirror:hover { opacity: 1; }

/* Mobile compact list inside All-15-Pairs dialog */
.pairs-mobile-list {
  display: none;
  gap: 8px;
}
.pairs-list-item {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.pairs-list-item strong { display: block; font-size: 14px; color: var(--ink); }
.pairs-list-item small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pairs-list-item.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pairs-list-item.is-current strong { color: var(--accent-dark); }

/* Method Dialog (clean restyle matching new system) */
.method-dialog {
  color-scheme: light;
  width: min(880px, calc(100vw - 24px));
  max-height: min(90dvh, 920px);
  margin: auto;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 0;
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(20, 28, 56, 0.26);
}
.method-dialog::backdrop { background: rgba(18, 26, 48, 0.58); backdrop-filter: blur(4px); }
.method-dialog .dialog-heading {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}
.method-eyebrow { font-size: 10.5px; font-weight: 750; letter-spacing: 0.12em; color: var(--accent); }
.method-dialog .dialog-heading h2 { margin: 2px 0 0; font-size: 22px; letter-spacing: -0.02em; }
.method-content { padding: 20px 24px 26px; }
.method-lead { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); margin: 0 0 20px; }
.method-section { margin-top: 22px; }
.method-section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.method-index {
  font-size: 11px; font-weight: 800; color: var(--accent);
  background: var(--accent-soft); padding: 4px 8px; border-radius: 7px;
}
.method-section h3 { margin: 0; font-size: 16px; letter-spacing: -0.015em; }
.method-flow { display: grid; grid-template-columns: 1fr 22px 1fr 22px 1fr; gap: 8px; align-items: center; }
.method-step {
  display: flex; gap: 12px; align-items: center; padding: 13px;
  border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--line);
}
.method-step-number {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 20px; flex-shrink: 0;
}
.method-step-number.teal { background: var(--teal-soft); color: var(--teal); }
.method-step-number.purple { background: var(--accent-soft); color: var(--accent); }
.method-step-number.amber { background: var(--amber-soft); color: var(--amber); }
.method-step strong { display: block; font-size: 13.5px; margin-bottom: 2px; }
.method-step span { display: block; font-size: 12px; color: var(--ink-soft); line-height: 1.38; }
.method-arrow { text-align: center; color: var(--muted); font-size: 18px; }
.method-combine { display: grid; grid-template-columns: 1fr 18px 1fr 18px 1.25fr; gap: 8px; align-items: stretch; }
.method-source, .method-outcome {
  padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center; gap: 3px;
}
.method-source-a { background: var(--teal-soft); border-color: var(--teal-line); }
.method-source-b { background: var(--amber-soft); border-color: var(--amber-line); }
.method-outcome { background: var(--accent-soft); border-color: var(--accent-line); }
.method-source > span, .method-outcome > span { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; color: var(--muted); }
.method-source strong, .method-outcome strong { font-size: 13px; color: var(--ink); }
.method-source small { font-size: 11.5px; color: var(--ink-soft); }
.method-operator { display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.method-caption { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.method-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.method-legend-card {
  padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line);
  border-top-width: 2.5px; background: var(--surface); display: flex; flex-direction: column; gap: 5px;
}
.method-legend-card.synergy { border-top-color: #1c9665; }
.method-legend-card.conflict { border-top-color: #cf4e72; }
.method-legend-card.compensation { border-top-color: #347bc9; }
.method-legend-card.switching { border-top-color: #dc8a2b; }
.method-legend-card.integration { border-top-color: var(--accent); }
.method-legend-symbol { font-size: 18px; font-weight: 700; color: var(--ink); }
.method-legend-card strong { font-size: 12.5px; }
.method-legend-card small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.4; }
.method-principle {
  margin-top: 10px; padding: 11px 14px; border-radius: 10px;
  background: var(--surface-alt); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.5;
}
.method-evidence-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.method-evidence-card {
  padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-alt);
}
.method-evidence-card strong { display: block; font-size: 13.5px; margin-bottom: 4px; color: var(--ink); }
.method-evidence-card p { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.method-script-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.method-script-step {
  padding: 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-alt);
  display: flex; flex-direction: column; gap: 4px;
}
.method-script-step > span { font-size: 9.5px; font-weight: 800; letter-spacing: 0.06em; color: var(--muted); }
.method-script-step strong { font-size: 12.5px; }
.method-script-step small { font-size: 11.5px; color: var(--ink-soft); }
.method-script-step.positive { background: var(--green-soft); border-color: var(--green-line); }
.method-disclaimer {
  margin-top: 20px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid #eadcb6; background: #fffdf5; font-size: 12.5px; color: #645534; line-height: 1.58;
}
.method-disclaimer p { margin: 0; }

/* Mobile Profile Quick Dialog */
.mobile-profile-dialog {
  color-scheme: light;
  width: min(520px, calc(100vw - 20px));
  max-height: 90dvh;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 0;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(20, 28, 56, 0.28);
}
.mobile-profile-dialog::backdrop { background: rgba(18, 26, 48, 0.56); backdrop-filter: blur(4px); }
.mobile-profile-dialog-header {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.mobile-profile-dialog-kicker { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--accent); }
.mobile-profile-dialog-header h2 { font-size: 18px; margin: 2px 0 0; }
.mobile-profile-dialog-body { padding: 16px 18px 20px; }
.mobile-profile-dialog-body .side-profile { display: block !important; border-top: 0; padding-top: 0; }
.is-therapist-view .mobile-profile-dialog .profile-therapy { display: block !important; }

/* Mobile Picker (hidden on desktop) */
.mobile-picker, .mobile-profiles-intro, .mobile-profile-head { display: none; }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1320px) {
  .workspace { grid-template-columns: minmax(252px, 276px) minmax(460px, 1fr) minmax(252px, 276px); gap: 14px; }
  .center { padding: 22px 22px 24px; }
  .dynamics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dynamic-card.integration { grid-column: span 2; }
}

@media (max-width: 1120px) {
  .section-nav { display: none; }
  .workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: "chooser chooser" "center center" "intro intro" "left right";
    gap: 14px;
  }
  .mobile-picker {
    grid-area: chooser;
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
  }
  .mobile-picker-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px;
  }
  .mobile-picker-kicker { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; color: var(--accent); }
  .mobile-picker h2 { font-size: 17px; margin: 2px 0 0; }
  .mobile-picker-btns { display: flex; gap: 6px; }
  .mobile-swap {
    height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong);
    background: var(--surface-alt); color: var(--ink); font-size: 12.5px; font-weight: 650;
  }
  .mobile-picker-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mobile-pick {
    padding: 10px 11px; border-radius: 12px; border: 1px solid var(--teal-line); background: var(--teal-soft);
  }
  .mobile-pick-right { border-color: var(--amber-line); background: var(--amber-soft); }
  .mobile-pick-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
  .mobile-pick-label { font-size: 11px; font-weight: 750; color: var(--teal); text-transform: uppercase; letter-spacing: 0.05em; }
  .mobile-pick-right .mobile-pick-label { color: var(--amber); }
  .mobile-pick-info {
    width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line-strong);
    background: var(--surface); color: var(--ink-soft); font-size: 13px; display: grid; place-items: center;
  }
  .mobile-pick select {
    width: 100%; height: 42px; padding: 0 10px; border-radius: 9px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  }

  .mobile-profiles-intro { grid-area: intro; display: block; padding: 4px 2px 0; }
  .mobile-profiles-intro h2 { font-size: 17px; margin: 0 0 2px; }
  .mobile-profiles-intro p { font-size: 12.5px; color: var(--muted); margin: 0; }

  .side-left { grid-area: left; }
  .side-right { grid-area: right; }
  .center { grid-area: center; }
  .side-head, .option-list { display: none; }
  .side-profile { display: none !important; }
  .side.is-expanded .side-profile { display: block !important; margin-top: 12px; }
  .mobile-profile-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
  }
  .mobile-profile-tag { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); }
  .side-right .mobile-profile-tag { color: var(--amber); }
  .mobile-profile-identity strong { font-size: 14.5px; color: var(--ink); }
  .mobile-profile-toggle {
    height: 36px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-strong);
    background: var(--surface-alt); color: var(--ink); font-size: 12px; font-weight: 650; flex-shrink: 0;
  }
}

@media (max-width: 820px) {
  .pairs-grid-table { display: none; }
  .pairs-mobile-list { display: grid; }
  .method-flow, .method-combine, .method-evidence-grid { grid-template-columns: 1fr; }
  .method-arrow, .method-operator { transform: rotate(90deg); height: 18px; }
  .method-legend { grid-template-columns: repeat(2, 1fr); }
  .method-script-flow { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .m-wrap { padding: 0 14px; }
  .brand-copy small { display: none; }
  .h-btn span, .h-link.hide-xs span { display: none; }
  .command-inner { flex-wrap: wrap; gap: 8px; }
  .pair-pill { display: none; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-areas: "chooser" "center" "intro" "left" "right";
  }
  .mobile-picker-fields { grid-template-columns: 1fr; }
  .center { padding: 18px 16px 20px; }
  .fusion-strip { grid-template-columns: 1fr; gap: 6px; }
  .fusion-plus { display: none; }
  .dynamics-grid, .script-persona-grid, .script-intersections,
  .therapy-goal-list, .therapy-intervention-grid, .contexts-all-grid {
    grid-template-columns: 1fr;
  }
  .dynamic-card.integration { grid-column: auto; }
  .script-path { grid-template-columns: 1fr; }
  .script-path-arrow { transform: rotate(90deg); height: 16px; }
  .therapy-contact-doors > div { grid-template-columns: 1fr; }

  /* Card-based responsive table on mobile */
  .comparison-table-wrap { border: 0; overflow: visible; }
  .comparison-table, .comparison-table tbody { display: block; width: 100%; }
  .comparison-table thead { display: none; }
  .comparison-table tbody { display: grid; gap: 10px; }
  .comparison-table tbody tr {
    display: grid; grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface);
  }
  .comparison-table tbody td { display: block; white-space: normal !important; border: 0; padding: 10px 12px; }
  .comparison-table tbody td:first-child { grid-column: 1 / -1; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
  .comparison-table tbody td:nth-child(2) { border-right: 1px solid var(--line); background: #f6fcfb; }
  .comparison-table tbody td:nth-child(3) { background: #fffcf7; }
  .comparison-table tbody td:nth-child(4) { grid-column: 1 / -1; background: #faf8ff; border-top: 1px solid var(--line); }
  .comparison-table tbody td:nth-child(n+2)::before {
    content: attr(data-label); display: block; font-size: 10px; font-weight: 750;
    color: var(--muted); text-transform: uppercase; margin-bottom: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; font-size: 11px; }
  .site-header, .command-bar, .mobile-picker, .combo-actions, .option-list,
  .context-tabs, .context-insight, .context-all-toggle, .site-footer, .mobile-profile-toggle, .mobile-profiles-intro {
    display: none !important;
  }
  .contexts-all-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; }
  .side-profile { display: block !important; }
  .workspace { grid-template-columns: 1fr 1.6fr 1fr !important; grid-template-areas: none !important; gap: 10px; }
  .side-left, .center, .side-right { grid-area: auto !important; box-shadow: none !important; }
  .script-details .script-detail-rows { display: grid !important; }
  .app.is-therapist .therapy-only { display: block !important; }
}

/* Contextual Discourse discussion strip inside Matrix */
.discuss-strip {
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--teal-line);
  background: var(--teal-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  flex-wrap: wrap;
}
.discuss-strip-copy strong {
  display: block;
  font-size: 13.5px;
  font-weight: 750;
  color: #07595f;
  margin-bottom: 2px;
}
.discuss-strip-copy span {
  display: block;
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--ink-soft);
}
.discuss-strip-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.discuss-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.discuss-btn.primary {
  background: var(--teal);
  color: #ffffff;
  border: 1px solid var(--teal);
}
.discuss-btn.primary:hover {
  background: #076c72;
  border-color: #076c72;
}
.discuss-btn.secondary {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--teal-line);
}
.discuss-btn.secondary:hover {
  color: #07595f;
  border-color: #8fd2cd;
  background: #ffffff;
}
.small-action.discuss-action {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  border-color: var(--teal-line);
  background: var(--teal-soft);
}
.small-action.discuss-action:hover {
  background: #e1f5f3;
  border-color: #97d7d2;
  color: #07595f;
}
@media print {
  .discuss-strip { display: none !important; }
}

/* Split D Lab Brand Identity */
.brand-mark { width: 28px; height: 28px; flex-shrink: 0; }
.brand-sub-lab { color: var(--accent); }
