:root {
  --ink: #10213a;
  --ink-soft: #4d5d73;
  --paper: #f6f8fc;
  --surface: #ffffff;
  --line: #dbe3ee;
  --nav: #0d2038;
  --nav-soft: #173653;
  --primary: #126f8c;
  --primary-dark: #0b526a;
  --primary-soft: #dff3f7;
  --accent: #8a56d8;
  --accent-soft: #eee6fb;
  --safe: #087f63;
  --safe-soft: #dff6ef;
  --warn: #a86600;
  --warn-soft: #fff2cf;
  --danger: #a9363e;
  --danger-soft: #fde7e9;
  --shadow: 0 16px 40px rgba(17, 38, 63, 0.09);
  --shadow-small: 0 8px 22px rgba(17, 38, 63, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar-width: 276px;
  --content-width: 1480px;
  --group-1: #e85d75;
  --group-1-soft: #ffe6ec;
  --group-2: #e2812d;
  --group-2-soft: #fff0dc;
  --group-3: #158ca4;
  --group-3-soft: #def5f7;
  --group-4: #7655c7;
  --group-4-soft: #ede7ff;
  --group-5: #14906d;
  --group-5-soft: #def7ed;
  --group-6: #326fd1;
  --group-6-soft: #e5edff;
}

html[data-soul="direction"] { --primary: #c4516c; --primary-dark: #91324b; --primary-soft: #ffe4eb; --accent: #ef9d4a; --accent-soft: #fff0dc; }
html[data-soul="evidence"] { --primary: #3372c7; --primary-dark: #225293; --primary-soft: #e2ecff; --accent: #6c57c8; --accent-soft: #ece8ff; }
html[data-soul="rigor"] { --primary: #087d8e; --primary-dark: #075866; --primary-soft: #dcf4f7; --accent: #2f73c8; --accent-soft: #e4eeff; }
html[data-soul="connection"] { --primary: #7f53c7; --primary-dark: #5a3995; --primary-soft: #eee6ff; --accent: #db5b88; --accent-soft: #ffe5ef; }
html[data-soul="translation"] { --primary: #148366; --primary-dark: #0b5e49; --primary-soft: #dcf5ec; --accent: #df8d27; --accent-soft: #fff0d7; }
html[data-soul="renewal"] { --primary: #176ab0; --primary-dark: #104d82; --primary-soft: #e0effc; --accent: #15997f; --accent-soft: #def6f0; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 87% 5%, color-mix(in srgb, var(--accent-soft) 75%, transparent), transparent 27rem),
    radial-gradient(circle at 32% 95%, color-mix(in srgb, var(--primary-soft) 70%, transparent), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input, select, textarea { font: inherit; }
button, select, label, .file-button { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--primary-dark); }
strong { font-weight: 760; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: -5rem;
  padding: .7rem 1rem;
  border-radius: .6rem;
  color: white;
  background: var(--nav);
}

.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  padding: 2rem 1.15rem 1.25rem;
  color: white;
  background:
    radial-gradient(circle at 20% 8%, rgba(32, 165, 177, .22), transparent 15rem),
    radial-gradient(circle at 90% 88%, rgba(139, 86, 216, .2), transparent 17rem),
    var(--nav);
  overflow-y: auto;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 0 .55rem 1.85rem;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, #1ab4aa, #6d5ce8 56%, #ea5e7b);
  box-shadow: 0 10px 28px rgba(20, 145, 160, .32);
  font-size: 1.45rem;
  font-weight: 850;
}

.eyebrow {
  margin: 0 0 .25rem;
  color: var(--primary-dark);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .085em;
  text-transform: uppercase;
}

.sidebar .eyebrow { color: #8bdfe0; }
.brand-title { margin: 0; font-size: 1.28rem; font-weight: 850; letter-spacing: .04em; }
.brand-subtitle { margin: -.1rem 0 0; color: #b9c9d9; font-size: .84rem; }

.nav-list { display: grid; gap: .35rem; }

.nav-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #dbe7f2;
  background: transparent;
  text-align: left;
  font-weight: 680;
}

.nav-item > span:first-child {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #a9dfe4;
  background: rgba(255,255,255,.06);
}

.nav-item:hover { background: rgba(255,255,255,.055); }
.nav-item.is-active { color: white; border-color: rgba(255,255,255,.12); background: linear-gradient(105deg, rgba(31,155,166,.28), rgba(111,85,205,.18)); }
.nav-item.is-active > span:first-child { color: white; background: var(--primary); }

.sidebar-safety {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: auto .4rem 0;
  padding: .9rem;
  border: 1px solid rgba(143, 230, 210, .19);
  border-radius: 14px;
  background: rgba(10, 108, 87, .18);
}

.sidebar-safety strong, .sidebar-safety span { display: block; }
.sidebar-safety strong { font-size: .82rem; }
.sidebar-safety span { color: #b8d8d2; font-size: .69rem; }
.status-dot { width: 9px; height: 9px; margin-top: .35rem; border-radius: 50%; background: #57dbb1; box-shadow: 0 0 0 5px rgba(87,219,177,.12); }
.sidebar-version { margin: .75rem 0 0; color: #748aa0; font-size: .65rem; text-align: center; }

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 0 2.3rem 4rem;
}

.topbar {
  max-width: var(--content-width);
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 auto;
  border-bottom: 1px solid rgba(185, 198, 215, .65);
}

.topbar-copy { flex: 1; }
.topbar h1 { margin: 0; font-size: clamp(1.45rem, 2vw, 2rem); line-height: 1.15; }
.role-switcher { min-width: 260px; }
.role-switcher label { display: block; margin-bottom: .25rem; color: var(--ink-soft); font-size: .73rem; font-weight: 750; }

select, input[type="search"], input[type="text"], input[type="url"], textarea {
  width: 100%;
  border: 1px solid #cbd6e3;
  border-radius: 12px;
  color: var(--ink);
  background: white;
}

select, input[type="search"], input[type="text"], input[type="url"] { min-height: 44px; padding: .55rem .75rem; }
textarea { padding: .8rem; line-height: 1.5; resize: vertical; }

.mobile-menu { display: none !important; }
.icon-button { border: 0; border-radius: 10px; color: var(--ink); background: transparent; font-size: 1.45rem; }

.boundary-banner {
  max-width: var(--content-width);
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1rem auto 1.35rem;
  padding: .78rem 1rem;
  border: 1px solid #b7e1d4;
  border-radius: 14px;
  color: #164b3e;
  background: linear-gradient(90deg, #e4f7f1, #effaf6);
  font-size: .82rem;
}

.boundary-banner strong, .boundary-banner span { display: block; }
.boundary-banner span { color: #477064; }
.boundary-banner .text-button { margin-left: auto; white-space: nowrap; }
.boundary-icon { color: var(--safe); }

.view { max-width: var(--content-width); margin: 0 auto; animation: view-in .25s ease both; }
.view[hidden] { display: none !important; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .8fr);
  gap: 1rem;
}

.hero-card, .soul-card, .section-block, .quiz-card, .quiz-result-card, .role-selector-card, .guide-hero {
  border: 1px solid rgba(205, 216, 230, .85);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-small);
}

.hero-card {
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.6rem, 3vw, 2.7rem);
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 83% 29%, color-mix(in srgb, var(--accent) 70%, transparent), transparent 14rem),
    linear-gradient(130deg, var(--primary-dark), var(--nav) 72%);
}

.hero-card h2 { position: relative; z-index: 1; max-width: 740px; margin: .8rem 0 .65rem; font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.02; letter-spacing: -.04em; }
.hero-card p { position: relative; z-index: 1; max-width: 680px; margin: 0; color: #dce9ef; font-size: 1rem; }
.hero-card .pill { position: relative; z-index: 1; color: white; background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.2); }
.hero-actions { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.hero-card .primary-button { color: var(--nav); background: white; }
.hero-card .secondary-button { color: white; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.07); }

.hero-orbit { position: absolute; right: -40px; bottom: -65px; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; }
.hero-orbit span { position: absolute; display: block; border-radius: 50%; background: rgba(255,255,255,.14); }
.hero-orbit span:nth-child(1) { width: 130px; height: 130px; left: 55px; top: 55px; }
.hero-orbit span:nth-child(2) { width: 32px; height: 32px; left: 18px; top: 43px; background: var(--accent); }
.hero-orbit span:nth-child(3) { width: 19px; height: 19px; right: 14px; top: 118px; background: #45d6ba; }

.soul-card { padding: 2rem; background: linear-gradient(150deg, white, var(--accent-soft)); }
.soul-emblem { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 1.35rem; border-radius: 18px; color: white; background: linear-gradient(135deg, var(--accent), var(--primary)); box-shadow: 0 12px 25px color-mix(in srgb, var(--accent) 28%, transparent); font-size: 1.35rem; }
.soul-card h2 { margin: .35rem 0 .55rem; font-size: 1.65rem; }
.soul-card p:not(.eyebrow) { color: var(--ink-soft); }

.pill, .status-chip, .privacy-chip, .guide-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: .28rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 780;
}

.metric-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: .75rem; margin: 1rem 0; }
.metric-card { display: flex; align-items: baseline; gap: .55rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.8); }
.metric-card strong { color: var(--primary-dark); font-size: 1.65rem; line-height: 1; }
.metric-card span { color: var(--ink-soft); font-size: .8rem; }
.safe-metric strong { color: var(--safe); }

.section-block { margin-top: 1rem; padding: clamp(1.2rem, 2vw, 1.7rem); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading.compact { margin-bottom: .7rem; }
.section-heading h2 { margin: 0; font-size: 1.35rem; }
.section-note { color: var(--ink-soft); font-size: .75rem; }

.quick-launch-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .75rem; }
.quick-card, .workflow-card, .power-card, .group-card, .role-option, .role-focus-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
}

.quick-card { min-height: 188px; display: flex; flex-direction: column; padding: 1rem; overflow: hidden; }
.quick-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--card-color); }
.quick-card .card-icon { color: var(--card-color); background: var(--card-soft); }
.quick-card h3 { margin: .7rem 0 .35rem; font-size: .98rem; line-height: 1.25; }
.quick-card p { margin: 0 0 .7rem; color: var(--ink-soft); font-size: .76rem; }
.quick-card button { margin-top: auto; align-self: flex-start; }

.card-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; font-weight: 850; }
.text-button, .danger-text-button { padding: .25rem .1rem; border: 0; color: var(--primary-dark); background: transparent; font-weight: 780; }
.text-button:hover { text-decoration: underline; }
.danger-text-button { color: var(--danger); }

.primary-button, .secondary-button, .filter-button {
  min-height: 42px;
  padding: .62rem .95rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 760;
}
.primary-button { color: white; background: var(--primary); }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button { color: var(--primary-dark); border-color: #bdcedc; background: white; }
.secondary-button:hover { background: var(--primary-soft); }

.dashboard-columns { display: grid; grid-template-columns: 1.08fr .92fr; gap: 1rem; }
.role-focus-card { padding: 1.1rem; background: linear-gradient(120deg, var(--primary-soft), white); }
.role-focus-card h3 { margin: 0 0 .35rem; }
.role-focus-card p { margin: .25rem 0; color: var(--ink-soft); font-size: .82rem; }
.role-focus-card .role-goal-copy { margin-top: .7rem; padding: .65rem .75rem; border-radius: 10px; color: var(--primary-dark); background: color-mix(in srgb, var(--primary-soft) 78%, white); font-size: .72rem; }
.workflow-chip-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .8rem; }
.workflow-chip { padding: .35rem .55rem; border: 1px solid color-mix(in srgb, var(--primary) 30%, white); border-radius: 9px; color: var(--primary-dark); background: white; font-size: .7rem; font-weight: 780; }

.attention-list { display: grid; gap: .55rem; margin: 0; padding: 0; list-style: none; counter-reset: attention; }
.attention-list li { counter-increment: attention; display: grid; grid-template-columns: 31px 1fr; gap: .65rem; align-items: center; min-height: 48px; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-soft); background: #fbfcfe; font-size: .78rem; }
.attention-list li::before { content: counter(attention); width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; color: white; background: var(--primary); font-weight: 850; }

.group-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; }
.group-card { padding: 1.05rem; border-top: 5px solid var(--group-color); background: linear-gradient(145deg, var(--group-soft), white 60%); }
.group-card-header { display: flex; align-items: center; gap: .65rem; }
.group-card h3 { margin: 0; font-size: .94rem; }
.group-card p { margin: .55rem 0 0; color: var(--ink-soft); font-size: .76rem; }
.group-card .count { margin-left: auto; color: var(--group-color); font-weight: 850; }

.page-intro { display: flex; justify-content: space-between; gap: 2rem; align-items: flex-end; margin: 1.75rem 0 1.15rem; }
.page-intro h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.page-intro p { max-width: 850px; margin: .35rem 0 0; color: var(--ink-soft); }
.search-wrap { width: min(100%, 330px); }
.search-wrap label { display: block; margin-bottom: .25rem; color: var(--ink-soft); font-size: .72rem; font-weight: 750; }

.filter-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.filter-button { min-height: 38px; padding: .45rem .7rem; color: var(--ink-soft); border-color: var(--line); background: white; font-size: .72rem; }
.filter-button[aria-pressed="true"] { color: white; border-color: var(--primary); background: var(--primary); }

.workflow-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .85rem; }
.workflow-card { display: flex; flex-direction: column; min-height: 272px; padding: 1.05rem; border-top: 5px solid var(--group-color); }
.workflow-card.is-recommended { box-shadow: 0 0 0 2px color-mix(in srgb, var(--group-color) 22%, transparent), var(--shadow-small); }
.workflow-card-header { display: flex; align-items: center; gap: .55rem; }
.workflow-id { color: var(--group-color); font-size: .72rem; font-weight: 850; }
.favorite-button { margin-left: auto; border: 0; color: #748399; background: transparent; font-size: 1.25rem; }
.favorite-button[aria-pressed="true"] { color: #bc7a00; }
.workflow-card h3 { margin: .75rem 0 .45rem; font-size: 1.02rem; line-height: 1.28; }
.workflow-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .65rem; }
.workflow-meta span { padding: .2rem .45rem; border-radius: 7px; color: var(--ink-soft); background: #f0f4f8; font-size: .65rem; font-weight: 700; }
.workflow-card p { margin: 0 0 .8rem; color: var(--ink-soft); font-size: .78rem; }
.workflow-card .button-row { margin-top: auto; }
.empty-state { padding: 3rem; color: var(--ink-soft); text-align: center; }

.power-sections { display: grid; gap: 1rem; }
.power-group { padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,255,255,.82); }
.power-group-heading { display: flex; align-items: center; gap: .7rem; margin-bottom: .85rem; }
.power-group-heading .card-icon { color: var(--group-color); background: var(--group-soft); }
.power-group-heading h3 { margin: 0; }
.power-group-heading p { margin: .1rem 0 0; color: var(--ink-soft); font-size: .75rem; }
.power-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .65rem; }
.power-card { padding: .9rem; }
.power-card strong { display: block; color: var(--group-color); font-size: .7rem; }
.power-card span { display: block; margin-top: .28rem; font-size: .83rem; font-weight: 680; }
.power-card small { display: block; margin-top: .55rem; color: var(--safe); font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .55rem; }
.template-item { display: grid; grid-template-columns: 58px 1fr; gap: .6rem; align-items: center; min-height: 64px; padding: .65rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.template-item strong { color: var(--primary-dark); font-size: .7rem; }
.template-item span { font-size: .76rem; font-weight: 670; }

.soul-intro { align-items: center; }
.privacy-chip { color: var(--safe); border-color: #a9dcca; background: var(--safe-soft); }
.quiz-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.75fr); gap: 1rem; align-items: start; }
.quiz-card, .quiz-result-card, .role-selector-card { padding: clamp(1.2rem, 2.5vw, 2rem); }
.quiz-question { margin: 0 0 1.1rem; padding: 0 0 1.1rem; border: 0; border-bottom: 1px solid var(--line); }
.quiz-question legend { margin-bottom: .65rem; font-weight: 760; }
.question-number { color: var(--primary); font-size: .72rem; }
.likert-row { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .45rem; }
.likert-option { position: relative; }
.likert-option input { position: absolute; opacity: 0; pointer-events: none; }
.likert-option label { min-height: 52px; display: grid; place-items: center; padding: .3rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: #fbfcfe; font-size: .68rem; text-align: center; cursor: pointer; }
.likert-option input:checked + label { color: white; border-color: var(--primary); background: var(--primary); }
.likert-option input:focus-visible + label { outline: 3px solid #ffbf47; outline-offset: 2px; }
.quiz-consent { display: grid; grid-template-columns: 22px 1fr; gap: .55rem; align-items: start; margin: 1rem 0; padding: .8rem; border-radius: 12px; color: var(--ink-soft); background: #f1f5f9; font-size: .76rem; }
.quiz-consent input { width: 18px; height: 18px; margin-top: .1rem; }
.quiz-result-card { position: sticky; top: 1rem; background: linear-gradient(150deg, white, var(--accent-soft)); }
.quiz-result-card h3 { margin: .35rem 0 .55rem; font-size: 1.45rem; }
.quiz-result-card > p:not(.eyebrow) { color: var(--ink-soft); }
.dimension-bars { display: grid; gap: .65rem; margin-top: 1rem; }
.dimension-row { display: grid; grid-template-columns: 1fr 42px; gap: .4rem; align-items: center; }
.dimension-row label { font-size: .7rem; font-weight: 750; }
.dimension-row strong { color: var(--ink-soft); font-size: .72rem; text-align: right; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: rgba(120,136,155,.18); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.result-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.25rem; }
.form-status { min-height: 1.45rem; margin: .45rem 0; color: var(--danger); font-size: .75rem; font-weight: 680; }
.form-status.is-success { color: var(--safe); }
.button-row { display: flex; gap: .55rem; align-items: center; }
.button-row.wrap { flex-wrap: wrap; }

.role-selector-card fieldset { padding: 0; border: 0; }
.role-selector-card legend { margin-bottom: 1rem; font-size: 1.15rem; font-weight: 800; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.role-option { display: grid; grid-template-columns: 24px 1fr; gap: .65rem; padding: .9rem; }
.role-option input { width: 18px; height: 18px; margin-top: .18rem; }
.role-option label { cursor: pointer; }
.role-option strong, .role-option span { display: block; }
.role-option span { margin-top: .2rem; color: var(--ink-soft); font-size: .72rem; }
.role-option:has(input:checked) { border-color: color-mix(in srgb, var(--primary) 45%, white); background: var(--primary-soft); }
.file-button { display: inline-grid; place-items: center; cursor: pointer; }
.muted-copy { color: var(--ink-soft); }

.guide-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.75rem 0 1rem; padding: 2rem; color: white; background: linear-gradient(125deg, var(--primary-dark), var(--nav) 70%, var(--accent)); }
.guide-hero .eyebrow { color: #b6e9e7; }
.guide-hero h2 { margin: 0; font-size: 2.3rem; }
.guide-hero p { margin: .3rem 0 0; color: #d6e3ea; }
.guide-badge { color: white; border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.08); }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 1rem; align-items: start; }
.guide-toc { position: sticky; top: 1rem; display: grid; gap: .25rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-small); }
.guide-toc a { padding: .55rem .65rem; border-radius: 9px; color: var(--ink-soft); font-size: .74rem; font-weight: 680; text-decoration: none; }
.guide-toc a:hover { color: var(--primary-dark); background: var(--primary-soft); }
.guide-content { display: grid; gap: .75rem; }
.guide-content article { position: relative; padding: 1.5rem 1.5rem 1.5rem 4.3rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
.guide-content h3 { margin: 0 0 .55rem; font-size: 1.25rem; }
.guide-content p, .guide-content li, .guide-content dd { color: var(--ink-soft); font-size: .84rem; }
.guide-content li + li { margin-top: .35rem; }
.guide-number { position: absolute; left: 1.2rem; top: 1.35rem; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: var(--primary-dark); background: var(--primary-soft); font-size: .75rem; font-weight: 850; }
.guide-callout { margin-top: 1rem; padding: .85rem; border-left: 4px solid var(--warn); border-radius: 8px; color: #684500; background: var(--warn-soft); font-size: .78rem; }
.rhythm-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.rhythm-grid div { padding: .75rem; border-radius: 12px; background: var(--primary-soft); }
.rhythm-grid strong, .rhythm-grid span { display: block; }
.rhythm-grid span { margin-top: .2rem; color: var(--ink-soft); font-size: .74rem; }
.guide-content dt { margin-top: .65rem; font-weight: 800; }
.guide-content dd { margin: .15rem 0 0; }

dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: white;
  box-shadow: 0 30px 90px rgba(10, 31, 54, .32);
}
dialog::backdrop { background: rgba(6, 21, 37, .66); backdrop-filter: blur(4px); }
.dialog-shell { padding: 1.5rem; overflow-y: auto; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-header h2 { margin: 0; }
.dialog-boundary { margin: 1rem 0; padding: .75rem; border-left: 4px solid var(--safe); border-radius: 8px; color: #175645; background: var(--safe-soft); font-size: .78rem; }
.dialog-details-card { padding: .85rem; border: 1px solid var(--line); border-radius: 13px; background: #f8fafc; }
.dialog-details-card h3 { margin: 0 0 .3rem; }
.dialog-details-card p { margin: .25rem 0; color: var(--ink-soft); font-size: .75rem; }
.dialog-shell > label { display: block; margin: .95rem 0 .3rem; font-size: .78rem; font-weight: 780; }
.dialog-shell > label span { color: var(--ink-soft); font-weight: 500; }
.hermes-open-row { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.hermes-open-row > label { display: block; margin-bottom: .35rem; color: var(--ink); font-size: .76rem; font-weight: 780; }
.hermes-open-row > label span { color: var(--ink-soft); font-weight: 500; }
.hermes-open-row input { flex: 1; min-width: 260px; min-height: 42px; padding: .55rem .75rem; border: 1px solid #cbd6e3; border-radius: 12px; }

/* Expanded governed Mission Control */
.sandbox-legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.sandbox-legend span { padding: .32rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: white; font-size: .66rem; font-weight: 740; }
.sandbox-legend span:nth-child(-n+4) { border-color: color-mix(in srgb, var(--primary) 25%, var(--line)); background: var(--primary-soft); }
.sandbox-legend span:nth-child(n+5) { border-color: color-mix(in srgb, var(--warn) 25%, var(--line)); background: var(--warn-soft); }

.mission-layout { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 1rem; align-items: start; }
.mission-library { position: sticky; top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-small); }
.mission-library h3 { margin: 0; }
.mission-list { display: grid; gap: .55rem; max-height: 65vh; overflow-y: auto; }
.mission-list-card { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfcfe; text-align: left; }
.mission-list-card:hover { border-color: var(--primary); }
.mission-list-card.is-active { color: var(--primary-dark); border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 12%, transparent); }
.mission-list-card strong, .mission-list-card span, .mission-list-card small { display: block; }
.mission-list-card span { margin-top: .2rem; color: var(--ink-soft); font-size: .69rem; }
.mission-list-card small { margin-top: .35rem; color: var(--primary-dark); font-size: .62rem; font-weight: 760; text-transform: uppercase; }
.mission-library .empty-state { padding: 1.4rem .3rem; font-size: .76rem; }
.mission-workspace { margin-top: 0; min-width: 0; }
.mission-empty-panel { min-height: 430px; display: grid; place-items: center; align-content: center; gap: .65rem; text-align: center; }
.mission-empty-panel h3, .mission-empty-panel p { margin: 0; }
.mission-empty-panel p { max-width: 520px; color: var(--ink-soft); }
.empty-orbit { width: 86px; height: 86px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 50%; color: white; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 15px 35px color-mix(in srgb, var(--accent) 24%, transparent); font-size: 2.2rem; }
.mission-header-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .7rem; }
.field-block { display: block; margin-bottom: .8rem; }
.field-block > span { display: block; margin-bottom: .3rem; color: var(--ink); font-size: .73rem; font-weight: 760; }
.field-block textarea, .field-block input, .field-block select { display: block; }
.edena-panel { margin: .7rem 0; padding: .9rem 1rem; border: 1px solid var(--line); border-left: 5px solid #718096; border-radius: 12px; color: var(--ink-soft); background: #f3f6f9; font-size: .78rem; }
.edena-panel strong, .edena-panel span { display: block; }
.edena-panel strong { color: var(--ink); }
.edena-panel.is-green { border-color: #98d9c4; border-left-color: var(--safe); background: var(--safe-soft); }
.edena-panel.is-yellow { border-color: #ead089; border-left-color: var(--warn); background: var(--warn-soft); }
.edena-panel.is-orange { border-color: #eca877; border-left-color: #c75c18; background: #fff0e5; }
.edena-panel.is-red { border-color: #e8a3a7; border-left-color: var(--danger); background: var(--danger-soft); }
.gate-panel { padding: .15rem 0; }
.loop-progress { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .8rem; align-items: center; margin: 1rem 0; }
.loop-progress-track { height: 11px; border-radius: 999px; background: #e5ebf2; overflow: hidden; }
.loop-progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .25s ease; }
.loop-progress strong { color: var(--ink-soft); font-size: .7rem; }
.stage-tabs { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: .45rem; margin: 1rem 0; }
.stage-tab { min-height: 44px; padding: .55rem .35rem; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: white; font-size: .72rem; font-weight: 770; }
.stage-tab.is-active, .stage-tab[aria-selected="true"] { color: white; border-color: var(--primary); background: var(--primary); }
.stage-tab.is-complete::after { content: " ✓"; }
.stage-tab.needs-review::after { content: " · review"; color: #fff2a8; }
.mission-stage { padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, #fff, #fbfcfe); }
.mission-stage h3 { margin: 0 0 .35rem; font-size: 1.45rem; }
.stage-guidance { margin: 0 0 .9rem; color: var(--ink-soft); font-size: .8rem; }
.stage-check { display: grid; grid-template-columns: 22px 1fr; gap: .55rem; align-items: start; padding: .75rem; border-radius: 11px; background: var(--primary-soft); color: var(--ink-soft); font-size: .76rem; }
.stage-check input { width: 18px; height: 18px; }
.mission-command-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 1rem; }

.credential-warning { margin-bottom: 1rem; padding: 1rem; border: 1px solid #e4cd87; border-left: 5px solid var(--warn); border-radius: 13px; color: #69480c; background: var(--warn-soft); font-size: .79rem; }
.mastery-levels { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: .7rem; margin-bottom: 1rem; }
.mastery-levels article { min-height: 145px; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, white, var(--primary-soft)); }
.mastery-levels span { width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: .7rem; border-radius: 9px; color: white; background: var(--primary); font-size: .68rem; font-weight: 850; }
.mastery-levels strong, .mastery-levels small { display: block; }
.mastery-levels small { margin-top: .35rem; color: var(--ink-soft); font-size: .7rem; }
.capability-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(320px,.7fr); gap: 1rem; align-items: start; }
.capability-layout .section-block { margin-top: 0; }
.capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .65rem; }
.capability-card { padding: .9rem; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; }
.capability-card-header { display: flex; align-items: flex-start; gap: .65rem; }
.capability-icon { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; color: white; background: linear-gradient(135deg, var(--primary), var(--accent)); font-size: .73rem; font-weight: 850; }
.capability-card h4 { margin: 0; font-size: .9rem; }
.capability-card p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .69rem; }
.level-label { display: inline-flex; margin-top: .65rem; padding: .25rem .5rem; border-radius: 999px; color: var(--primary-dark); background: var(--primary-soft); font-size: .65rem; font-weight: 820; }
.capability-progress { margin-top: .55rem; }
.capability-progress-track { height: 7px; border-radius: 99px; background: #e1e8f0; overflow: hidden; }
.capability-progress-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.capability-progress small { display: block; margin-top: .3rem; color: var(--ink-soft); font-size: .63rem; }
.capability-metadata { display: grid; grid-template-columns: 92px minmax(0,1fr); gap: .3rem .55rem; margin: .65rem 0 0; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .64rem; }
.capability-metadata dt { color: var(--ink-soft); font-weight: 760; }
.capability-metadata dd { margin: 0; color: var(--ink); }
.capability-evidence-preview { display: grid; gap: .25rem; margin: .55rem 0 0; padding-left: 1.05rem; color: var(--ink-soft); font-size: .63rem; }
.capability-card .capability-no-evidence { margin-top: .55rem; font-style: italic; }
.capability-card .capability-next { margin-top: .55rem; color: var(--primary-dark); font-weight: 700; }
.evidence-panel { position: sticky; top: 1rem; }
.evidence-list { display: grid; gap: .5rem; margin-top: 1rem; max-height: 520px; overflow-y: auto; }
.evidence-item { padding: .7rem; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.evidence-item strong, .evidence-item span, .evidence-item small { display: block; }
.evidence-item span { margin-top: .2rem; color: var(--ink-soft); font-size: .69rem; }
.evidence-item small { margin-top: .35rem; color: var(--primary-dark); font-size: .62rem; }
.evidence-item button { margin-top: .4rem; }

.soul-adapter-grid, .packet-adapter-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(320px,.75fr); gap: 1rem; }
.packet-adapter-grid { margin-bottom: 1rem; }
.soul-adapter-grid .section-block, .packet-adapter-grid .section-block { margin-top: 0; }
.soul-import-card h3, .soul-profile-preview h3 { margin: 0 0 .45rem; }
.compact-list { color: var(--ink-soft); font-size: .78rem; }
.soul-profile-preview { background: linear-gradient(145deg, white, var(--accent-soft)); }
.soul-profile-preview dl { display: grid; grid-template-columns: 130px 1fr; gap: .35rem .65rem; margin: .75rem 0; font-size: .74rem; }
.soul-profile-preview dt { color: var(--ink-soft); font-weight: 760; }
.soul-profile-preview dd { margin: 0; }
.legacy-quiz-details { margin-top: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
.legacy-quiz-details > summary { padding: 1rem 1.2rem; color: var(--primary-dark); font-weight: 780; cursor: pointer; }
.legacy-quiz-details .quiz-layout { padding: 0 1rem 1rem; }
.provisional-warning { margin: 0 1rem 1rem; padding: .85rem; border-left: 5px solid var(--warn); border-radius: 10px; color: #6f4a08; background: var(--warn-soft); font-size: .76rem; }

.role-option { grid-template-columns: 24px minmax(0,1fr); }
.role-state-select { grid-column: 2; width: 100%; margin-top: .5rem; min-height: 38px; padding: .4rem .55rem; font-size: .7rem; }
.guide-hero-actions { display: grid; justify-items: end; gap: .55rem; }

.onboarding-shell { min-height: min(620px, calc(100vh - 2rem)); display: flex; flex-direction: column; }
.onboarding-progress { height: 7px; margin: 1rem 0 1.4rem; border-radius: 99px; background: #e1e8f0; overflow: hidden; }
.onboarding-progress span { display: block; width: 25%; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .2s ease; }
.onboarding-step { flex: 1; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, white, var(--primary-soft)); }
.onboarding-step h3 { margin: 0 0 .55rem; font-size: 1.55rem; }
.onboarding-step p, .onboarding-step li { color: var(--ink-soft); }
.onboarding-hero-mark { width: 72px; height: 72px; display: grid; place-items: center; margin-bottom: 1rem; border-radius: 22px; color: white; background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow); font-size: 2rem; font-weight: 850; }
.onboarding-actions { justify-content: flex-end; margin-top: 1rem; }
.ready-check { display: grid; grid-template-columns: 42px 1fr; gap: .75rem; align-items: center; margin-top: 1rem; padding: 1rem; border-radius: 14px; background: var(--safe-soft); }
.ready-check > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--safe); font-weight: 850; }
.ready-check p { margin: .2rem 0 0; font-size: .76rem; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .48; }

.toast {
  position: fixed;
  z-index: 100;
  right: 1rem;
  bottom: 1rem;
  max-width: min(420px, calc(100vw - 2rem));
  padding: .8rem 1rem;
  border-radius: 12px;
  color: white;
  background: var(--nav);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .quick-launch-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .workflow-grid, .power-grid, .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .group-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mission-header-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .mastery-levels { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: none; }
  .main-content { margin-left: 0; padding-inline: 1rem; }
  .mobile-menu { display: grid !important; place-items: center; min-width: 42px; min-height: 42px; border: 1px solid var(--line); background: white; }
  .hero-grid, .quiz-layout { grid-template-columns: 1fr; }
  .quiz-result-card { position: static; }
  .dashboard-columns { grid-template-columns: 1fr; }
  .mission-layout, .capability-layout, .soul-adapter-grid, .packet-adapter-grid { grid-template-columns: 1fr; }
  .mission-library, .evidence-panel { position: static; }
  .mission-list { max-height: none; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-toc { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; flex-wrap: wrap; padding: 1rem 0; }
  .role-switcher { width: 100%; }
  .boundary-banner { align-items: flex-start; flex-wrap: wrap; }
  .boundary-banner .text-button { margin-left: 1.9rem; }
  .hero-card { min-height: 380px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .quick-launch-grid, .workflow-grid, .power-grid, .template-grid, .group-grid, .role-grid, .rhythm-grid, .mission-header-grid, .mastery-levels, .capability-grid, .mission-list { grid-template-columns: 1fr; }
  .stage-tabs { display: flex; overflow-x: auto; padding-bottom: .25rem; }
  .stage-tab { min-width: 126px; }
  .loop-progress { grid-template-columns: 1fr; }
  .mission-command-row { align-items: stretch; flex-direction: column; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .search-wrap { width: 100%; }
  .guide-hero { align-items: flex-start; flex-direction: column; }
  .guide-hero-actions { justify-items: start; }
  .guide-toc { grid-template-columns: 1fr; }
  .guide-content article { padding: 4rem 1.1rem 1.1rem; }
  .guide-number { top: 1rem; left: 1rem; }
  .likert-row { grid-template-columns: 1fr; }
  .likert-option label { min-height: 42px; }
  .button-row { align-items: stretch; flex-direction: column; }
  .button-row > * { width: 100%; }
}

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

@media print {
  .sidebar, .topbar, .boundary-banner, button, dialog, .toast { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  .view[hidden] { display: none !important; }
  body { background: white; }
  .section-block, .hero-card, .soul-card { box-shadow: none; break-inside: avoid; }
}
