/* Design v2: one material language, with color reserved for meaning. */
:root {
  --glass-ink: #263d30;
  --glass-muted: #68796e;
  --glass-edge: rgba(43,68,51,.16);
  --glass-surface: linear-gradient(140deg,rgba(255,255,255,.86),rgba(242,249,245,.68));
  --glass-shadow: inset 0 1px 0 rgba(255,255,255,.98), inset 0 0 0 1px rgba(34,57,41,.045), 0 14px 42px rgba(21,45,29,.10);
}

/* Purpose resource identities: white / blue / green / coral. */
#meta-lens #meta-humaneagi { --resource-color: 126,139,129; --resource-ink: #425149; }
#meta-lens #meta-human11 { --resource-color: 49,134,210; --resource-ink: #235f94; }
#meta-lens #meta-h11-life { --resource-color: 24,156,64; --resource-ink: #24713c; }
#meta-lens #meta-lifestyle-matching { --resource-color: 219,91,62; --resource-ink: #9c4a35; }
#meta-lens .meta-purpose-actions > a,
#meta-lens .meta-purpose-actions > button.meta-lifestyle-launch {
  color: var(--resource-ink);
  border-color: rgba(var(--resource-color),.36) !important;
  background: linear-gradient(145deg,rgba(255,255,255,.76),rgba(var(--resource-color),.09)) !important;
  box-shadow: inset 0 1px 0 #fff, inset 2px 0 0 rgba(var(--resource-color),.5), 0 2px 7px rgba(var(--resource-color),.05);
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
#meta-lens .meta-purpose-actions > a:is(:hover,:focus-visible),
#meta-lens .meta-purpose-actions > button.meta-lifestyle-launch:is(:hover,:focus-visible) {
  border-color: rgba(var(--resource-color),.76) !important;
  background: linear-gradient(135deg,rgba(255,255,255,.84),rgba(var(--resource-color),.28)) !important;
  box-shadow: inset 0 1px 0 #fff, inset 2px 0 0 rgb(var(--resource-color)), 0 5px 18px rgba(var(--resource-color),.18);
  outline-color: rgba(var(--resource-color),.7);
}
#meta-lens #meta-humaneagi { background: linear-gradient(140deg,#fff,rgba(255,255,255,.62)) !important; }
#meta-lens #meta-humaneagi:is(:hover,:focus-visible) { background: #fff !important; box-shadow: inset 0 0 0 1px #fff, 0 5px 20px rgba(255,255,255,.7); }
#meta-lens #meta-lifestyle-matching small { color: #936958; }

/* Floating surfaces: stable dimensions and a single thin reflective edge. */
.app-shell :is(.brand,.legend-panel,#signal-card,#concept-panel,#coincidence-unlock,#coincidence-controls,#coincidence-card,.coincidence-log-card,.tutorial-card,#lifestyle-search-guide,#lifestyle-action-panel) {
  color: var(--glass-ink);
  border: 1px solid rgba(255,255,255,.92);
  background: var(--glass-surface);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px) saturate(1.12);
  -webkit-backdrop-filter: blur(24px) saturate(1.12);
}
.app-shell :is(.legend-panel,#signal-card,#concept-panel,#coincidence-unlock,#coincidence-controls,#coincidence-card,.coincidence-log-card,#lifestyle-search-guide,#lifestyle-action-panel) { border-radius: 24px; }
.app-shell .brand { border-radius: 20px; background: rgba(255,255,255,.66); box-shadow: inset 0 1px 0 #fff, 0 3px 14px rgba(31,51,37,.04); }
.app-shell .map-title > span {
  color: #426c50; border-color: rgba(73,119,86,.12);
  background: rgba(255,255,255,.44); box-shadow: inset 0 1px 0 #fff;
  font-weight: 600; letter-spacing: .11em;
}
.app-shell .map-title > strong { color: #728076; font-weight: 500; letter-spacing: .1em; }
.app-shell .live-presence { color: var(--glass-muted); }
.app-shell .view-controls {
  border: 1px solid rgba(255,255,255,.9); border-radius: 22px;
  background: linear-gradient(135deg,rgba(255,255,255,.8),rgba(245,249,246,.56));
  box-shadow: inset 0 1px 0 #fff, 0 6px 24px rgba(23,45,30,.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.app-shell .view-button { border-color: transparent; border-radius: 15px; color: #52675a; background: transparent; box-shadow: none; }
.app-shell .view-button:hover { background: rgba(255,255,255,.64); box-shadow: inset 0 1px 0 #fff; }
.app-shell .view-button.is-active { color: #244b33; border-color: rgba(56,107,72,.2); background: linear-gradient(140deg,rgba(255,255,255,.92),rgba(108,169,125,.13)); box-shadow: inset 0 1px 0 #fff, 0 2px 7px rgba(33,65,43,.06); }
.app-shell .view-button.is-active .lens-map { background: rgba(255,255,255,.56); }
.app-shell .zoom-controls { border: 1px solid rgba(255,255,255,.92); background: rgba(255,255,255,.7); box-shadow: var(--glass-shadow); border-radius: 17px; }
.app-shell .zoom-controls button { color: #365842; background: transparent; border-color: rgba(39,71,49,.1); }
.app-shell .zoom-controls button:hover { background: rgba(108,169,125,.14); }
.app-shell .coincidence-mode-toggle { border: 1px solid rgba(60,103,73,.2); border-radius: 18px; background: rgba(248,253,249,.8); color: #386149; box-shadow: inset 0 1px 0 #fff, 0 4px 16px rgba(23,51,33,.06); }
.app-shell .coincidence-mode-toggle:hover { background: rgba(229,246,234,.9); border-color: rgba(60,103,73,.45); }
.app-shell .overall-pixel-copy { background: rgba(255,255,255,.68); border-color: rgba(51,84,61,.17); box-shadow: inset 0 1px 0 #fff, 0 4px 18px rgba(23,45,30,.05); color: #446650; }

/* Card hierarchy and folds echo the four conceptual petals. */
.app-shell :is(#signal-card,#coincidence-card,#concept-panel,#coincidence-unlock) h2 { font-family: var(--sans); color: #233e2e; font-weight: 550; letter-spacing: -.035em; }
.app-shell :is(#signal-card,#coincidence-card) .card-rule { background: rgba(56,81,64,.14); }
.app-shell :is(.card-kicker,.card-location,.coincidence-card-location,.signal-fold-kicker,.legend-footer,.panel-index) { color: #718477; }
.app-shell :is(.card-close,#close-concept,.card-return,.card-drag-handle) { color: #46634f; border-color: rgba(47,78,56,.16); background: rgba(255,255,255,.38); box-shadow: inset 0 1px 0 rgba(255,255,255,.8); }
.app-shell :is(.card-close,#close-concept,.card-return,.card-drag-handle):hover { background: #fff; border-color: rgba(47,78,56,.35); }
.app-shell .signal-fold--purpose { --fold-rgb: 214,147,90; }
.app-shell .signal-fold--dream { --fold-rgb: 101,178,119; }
.app-shell .signal-fold--mission { --fold-rgb: 100,157,183; }
.app-shell .signal-fold--vision { --fold-rgb: 154,169,155; }
.app-shell .signal-fold {
  border: 1px solid rgba(var(--fold-rgb),.34); border-radius: 16px 7px 16px 7px;
  color: #344f3e; background: linear-gradient(140deg,rgba(255,255,255,.65),rgba(var(--fold-rgb),.11));
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(38,58,43,.025);
}
.app-shell .signal-fold:is(:hover,[aria-expanded="true"]) { border-color: rgba(var(--fold-rgb),.65); background: linear-gradient(140deg,rgba(255,255,255,.8),rgba(var(--fold-rgb),.26)); box-shadow: inset 0 1px 0 #fff, 0 4px 14px rgba(var(--fold-rgb),.12); }
.app-shell .signal-fold strong { font-weight: 650; }
.app-shell #signal-card { z-index: 950; }
.app-shell #signal-card.is-fold-menu-revealed {
  max-height: calc(100dvh - 202px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(63,98,73,.25) transparent;
}
.app-shell:has(#signal-card:not([hidden])) .legend-panel { opacity: 0; pointer-events: none; }
.app-shell .signal-fold-panel { border: 1px solid rgba(56,81,64,.13); border-radius: 18px; background: rgba(255,255,255,.34); box-shadow: inset 0 1px 0 rgba(255,255,255,.86); }
.app-shell .signal-fold-panel h3 { color: #2c4937; font-weight: 550; letter-spacing: -.025em; }
.app-shell :is(.signal-fold-copy,.signal-summary p,.coincidence-story p,.coincidence-match p) { color: #556c5e; line-height: 1.55; }
.app-shell .signal-data > div { border-color: rgba(56,81,64,.13); background: rgba(255,255,255,.24); }
.app-shell :is(.orientation-choices > button,.open-house-times button,.viewpoint-options button,.orientation-link,.host-request-button,.coincidence-card-actions button) { border: 1px solid rgba(60,107,75,.24); border-radius: 14px; background: linear-gradient(145deg,rgba(255,255,255,.7),rgba(130,184,145,.1)); color: #345c42; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); }
.app-shell :is(.orientation-choices > button,.orientation-link,.host-request-button,.coincidence-card-actions button):hover { background: rgba(215,239,222,.72); border-color: rgba(60,107,75,.5); }

/* The tutorial keeps its visual teaching, with lighter typography and edges. */
.app-shell .tutorial-card { border-radius: 30px; }
.app-shell .tutorial-backdrop,
.app-shell .coincidence-log-backdrop { background: rgba(38,57,44,.16); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.app-shell .tutorial-main { border: 1px solid rgba(50,76,59,.13); border-radius: 22px; background: rgba(255,255,255,.2); }
.app-shell .tutorial-visual { border-color: rgba(50,76,59,.1); background: radial-gradient(ellipse at center,rgba(122,189,140,.09),transparent 70%); }
.app-shell .tutorial-copy h1 { font-family: var(--sans); font-size: clamp(28px,3.15vw,46px); line-height: 1.08; font-weight: 500; letter-spacing: -.045em; color: #294433; }
.app-shell .tutorial-copy > p:first-child { color: #568067; letter-spacing: .12em; }
.app-shell #tutorial-text { color: #597062; font-size: clamp(16px,1.4vw,20px); line-height: 1.5; }
.app-shell .tutorial-key { border-color: rgba(50,76,59,.12); background: rgba(255,255,255,.24); }
.app-shell .tutorial-button { border: 1px solid rgba(54,91,65,.22); background: rgba(255,255,255,.45); color: #3d684c; box-shadow: inset 0 1px 0 #fff; }
.app-shell .tutorial-button--next { background: linear-gradient(135deg,#60816b,#3d654b); color: #fff; }
.app-shell .tutorial-button--next:hover { background: #345b41; }
.app-shell #skip-tutorial { color: #657c6d; }

/* Nested conceptual surfaces retain their own content and color codes. */
.app-shell :is(#lifestyle-matching,#h11-components) { border: 1px solid rgba(255,255,255,.92); background: linear-gradient(130deg,rgba(250,253,250,.97),rgba(229,240,233,.94)); box-shadow: var(--glass-shadow); border-radius: 24px; }
.app-shell :is(.lifestyle-head,.h11-components-head) { border-color: rgba(48,80,58,.13); }
.app-shell :is(.lifestyle-head,.h11-components-head) h2 { font-family: var(--sans); font-weight: 500; letter-spacing: -.035em; color: #2f4b39; }
.app-shell :is(#lifestyle-matching-back,#h11-components-back) { border: 1px solid rgba(48,80,58,.2); border-radius: 14px; background: rgba(255,255,255,.65); color: #4b6956; box-shadow: inset 0 1px 0 #fff; }
.app-shell .lifestyle-pair article { border-color: rgba(48,80,58,.16); background: linear-gradient(140deg,rgba(255,255,255,.68),rgba(255,255,255,.28)); box-shadow: inset 0 1px 0 rgba(255,255,255,.94); }
.app-shell .lifestyle-pair h3 { font-weight: 550; letter-spacing: -.025em; }
.app-shell .lifestyle-component-action > span { border-color: rgba(53,88,65,.2); background: rgba(255,255,255,.65); color: #4a6d56; box-shadow: inset 0 1px 0 #fff; }
.app-shell .h11-pillar { border: 1px solid rgba(48,80,58,.16); border-radius: 21px; background: rgba(255,255,255,.4); box-shadow: inset 0 1px 0 #fff; }
.app-shell .h11-pillar li { border-color: rgba(48,80,58,.1); background: rgba(255,255,255,.25); }
.app-shell .h11-pillar h3 { font-weight: 550; letter-spacing: -.035em; color: #35543f; }

/* Coincidence filters and inputs use the same touchable glass. */
.app-shell .coincidence-filters button { border-color: rgba(64,108,78,.18); border-radius: 14px; color: #426850; background: rgba(255,255,255,.38); box-shadow: inset 0 1px 0 rgba(255,255,255,.85); }
.app-shell .coincidence-filters button:is(:hover,.is-active) { border-color: rgba(49,120,70,.45); color: #245e36; background: rgba(168,217,180,.28); box-shadow: inset 0 1px 0 #fff; }
.app-shell :is(#exit-coincidence-mode,#open-coincidence-log) { border-color: rgba(64,108,78,.24); border-radius: 12px; background: rgba(255,255,255,.55); color: #426850; }
.app-shell .connect-green-button { border: 1px solid rgba(57,108,71,.45); border-radius: 15px; background: linear-gradient(135deg,#638d6e,#3b714c); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 4px 14px rgba(46,98,62,.12); }
.app-shell :is(.coincidence-log-card,.lifestyle-action-panel,.orientation-detail-panel) :is(input:not([type="checkbox"]),textarea,select),
.app-shell #perspectives-issue { border: 1px solid rgba(53,85,63,.23); border-radius: 12px; background: rgba(255,255,255,.56); color: #2c4836; box-shadow: inset 0 1px 2px rgba(37,59,43,.035); }
.app-shell :is(input,textarea,select):focus-visible { outline: 2px solid rgba(65,126,84,.6); outline-offset: 2px; }
.app-shell .quality-choice { border-color: rgba(53,85,63,.16); border-radius: 13px; background: rgba(255,255,255,.25); }
.app-shell[data-mode="coincidence"] #coincidence-mode-toggle { visibility: hidden; pointer-events: none; }
.app-shell[data-mode="coincidence"] #coincidence-controls { z-index: 940; }
.app-shell #coincidence-controls :is(.coincidence-controls-head span,.coincidence-controls-foot span,.coincidence-filters small) { color: #516d5a; }
.app-shell #coincidence-controls .coincidence-filters :is(b,span) { color: #2c573b; }
.app-shell #coincidence-log-form :is(label,legend) { color: #4c6a56; }
.app-shell #coincidence-log-form small { color: #60776a; }
.app-shell #coincidence-log-form :is(input,textarea)::placeholder { color: #83948a; }
.app-shell #coincidence-card :is(.coincidence-eyebrow,.coincidence-card-kicker,.coincidence-card-location,.coincidence-card-meta,.coincidence-story > span,.coincidence-match > span,footer) { color: #5d7967; }
.app-shell :is(button,a):focus-visible { outline: 2px solid #59896a; outline-offset: 3px; }

@media (max-width: 640px) {
  .app-shell .tutorial-card { border-radius: 22px; }
  .app-shell .tutorial-copy h1 { font-size: clamp(25px,7vw,34px); }
  .app-shell #tutorial-text { font-size: 16px; line-height: 1.4; }
  .app-shell :is(#signal-card,#concept-panel,#coincidence-card,#coincidence-controls,.coincidence-log-card) { border-radius: 20px; }
  .app-shell #signal-card.is-fold-menu-revealed { max-height: calc(100dvh - 150px); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass-surface: #f5faf6; }
  .app-shell .view-controls { background: #f5faf6; }
}

/* Tour lessons: one explanation and its symbol enter together. */
.app-shell #tutorial-title > span { display: block; }
.app-shell .tutorial-main .tutorial-copy {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(63,98,73,.25) transparent;
  padding: clamp(22px,2.5vw,34px);
}
.app-shell .tutorial-main .tutorial-copy > #tutorial-text { font-size: clamp(16px,1.4vw,20px); line-height: 1.5; }
.app-shell #tutorial.has-sequence .tutorial-card { grid-template-rows: auto minmax(0,1fr) 72px; }
.app-shell #tutorial-key[hidden] { display: none; }
.app-shell #tutorial[data-lesson="signal-language"] #tutorial-title { font-size: clamp(25px,2.7vw,34px); line-height: 1.22; }
.app-shell .tutorial-main .tutorial-icon--zoom { transform: scale(.9); }
.app-shell :is(.tutorial-icon--zoom,.tutorial-icon--coincidence) > span:nth-child(n) { inset: auto; }
.app-shell .tutorial-sequence { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.app-shell .tutorial-sequence li {
  display: grid; grid-template-columns: 32px minmax(0,1fr); align-items: center; gap: 14px;
  padding: 10px 14px; border: 1px solid rgba(62,99,74,.13); border-radius: 14px;
  background: linear-gradient(125deg,rgba(255,255,255,.65),rgba(255,255,255,.2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  animation: tutorialRowEnter .55s ease both; animation-delay: calc(var(--step) * .18s);
}
.app-shell .tutorial-sequence li > span:last-child { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 8px; align-items: baseline; }
.app-shell .tutorial-sequence b { color: #345b42; font: 650 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.app-shell .tutorial-sequence li > span > span { font-size: 15px; line-height: 1.4; }
.app-shell .tutorial-sequence-icon { width: 28px; height: 28px; display: grid; place-items: center; color: #497759; font: 24px/1 var(--sans); }
.app-shell .tutorial-sequence-icon:is(.is-fill-on,.is-fill-off,.is-steady,.is-cycling,.is-live) { width: 18px; height: 18px; margin: 5px; border: 1px solid #47604f; background: #fffef8; border-radius: 2px; }
.app-shell .tutorial-sequence-icon.is-fill-off { background: #17241b; }
.app-shell .tutorial-sequence-icon.is-cycling { border-radius: 50%; }
.app-shell .tutorial-sequence-icon.is-live { background: #35b857; border-color: #289443; box-shadow: 0 0 0 4px rgba(53,184,87,.12); }
.app-shell #tutorial[data-lesson="coincidence"] #tutorial-text { margin-top: 14px; }
.app-shell .tutorial-coincidence-intro { margin: 0 0 12px; }
.app-shell .tutorial-coincidence-types { gap: 8px; }
.app-shell .tutorial-coincidence-types li { min-height: 0; padding: 11px 13px; }
.app-shell .tutorial-coincidence-note { margin: 12px 0 0; }
@keyframes tutorialRowEnter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }

/* Card descriptions grow with their text, including after a narrow reflow. */
.app-shell .orientation-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
.app-shell .orientation-option { min-width: 0; height: auto; gap: 10px; }
.app-shell .orientation-option > * { flex-shrink: 0; min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.app-shell .orientation-option small {
  max-height: none; overflow: visible; opacity: 1; transform: none; transition: none;
  line-height: 1.45;
}
.app-shell .orientation-option strong { font-family: var(--sans); font-weight: 550; line-height: 1.25; }
.app-shell .signal-fold-panel :is(h3,.signal-fold-copy,.signal-summary,.orientation-intro) { opacity: 1; filter: none; }
.app-shell .orientation-detail-heading { flex-wrap: wrap; }
.app-shell .orientation-detail-heading small { text-align: left; }
.app-shell .orientation-detail-panel { min-width: 0; }
.app-shell .orientation-detail-panel :is(label,legend,p,button) { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .app-shell #tutorial.has-sequence .tutorial-card { grid-template-rows: auto minmax(0,1fr) 62px; }
  .app-shell .tutorial-main { grid-template-rows: 92px max-content; }
  .app-shell .tutorial-main .tutorial-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(.55); }
  .app-shell .tutorial-main .tutorial-copy { max-height: none; overflow: visible; padding: 18px 17px 22px; }
  .app-shell #tutorial[data-lesson="signal-language"] #tutorial-title { font-size: clamp(21px,5.7vw,30px); }
  .app-shell .tutorial-sequence li { padding: 10px; gap: 8px; }
  .app-shell .tutorial-sequence li > span:last-child { grid-template-columns: minmax(0,1fr); gap: 2px; }
  .app-shell .tutorial-sequence li > span > span { font-size: 14px; }
  .app-shell .orientation-options { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { .app-shell .tutorial-sequence li { animation: none; } }
