/* Design v3: the tour's soft, labelled controls are the common material. */
.app-shell :is(.help-button,.concept-button,.view-button,.zoom-controls button,.card-window-tools button,.card-close,#close-concept,#meta-lens-close,#h11-components-back,#lifestyle-matching-back,.signal-fold,.orientation-option,.orientation-choices > button,.orientation-link,.host-request-button,.coincidence-card-actions button,.coincidence-filters button,.coincidence-controls-foot button,.connect-green-button,.lifestyle-search-scales button,.lifestyle-search-open-house) {
  border: 1px solid rgba(78,89,94,.18);
  border-radius: 16px;
  background: #e8eae9;
  color: var(--soft-ink);
  box-shadow: var(--soft-raised);
  font-family: var(--sans);
  transition: background .18s ease, box-shadow .18s ease;
}
.app-shell :is(.help-button,.concept-button,.view-button,.zoom-controls button,.card-window-tools button,.card-close,#close-concept,#meta-lens-close,#h11-components-back,#lifestyle-matching-back,.signal-fold,.orientation-option,.orientation-choices > button,.orientation-link,.host-request-button,.coincidence-card-actions button,.coincidence-filters button,.coincidence-controls-foot button,.connect-green-button,.lifestyle-search-scales button,.lifestyle-search-open-house):hover {
  background: #f2f4f3; color: #182228; border-color: #879296;
}
.app-shell :is(.view-button.is-active,.orientation-option.is-selected,.signal-fold[aria-expanded="true"],.coincidence-filters button.is-active) { background: #e5e8e7; box-shadow: var(--soft-inset); border-color: #82928a; }
.app-shell :is(.help-button,.concept-button,.zoom-controls button,.card-window-tools button) { min-height: 44px; }
.app-shell .help-button { width: auto; height: 44px; padding: 10px 16px; font: 600 14px/1.2 var(--sans); white-space: nowrap; }
.app-shell .help-button::after { display: none; }
.app-shell .help-short { display: none; }
.app-shell .concept-button { width: 44px; flex: 0 0 44px; }
.app-shell .card-window-tools { gap: 10px; }
.app-shell .card-window-tools button { font: 600 12px/1.2 var(--sans); }
.app-shell #card-close { flex: 0 0 44px; width: 44px; height: 44px; padding: 11px; display: grid; place-items: center; border-radius: 14px; }
.app-shell #card-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.app-shell .signal-paths-icon { flex: 0 0 32px; width: 32px; height: 32px; fill: #e8eae9; stroke: #6c7b72; stroke-width: 1; }
.app-shell .information-drop-intro strong { font: 600 16px/1.4 var(--sans); letter-spacing: 0; }
.app-shell .information-drop-intro p { font-size: 14px; line-height: 1.5; }
.app-shell .signal-fold::after { display: none; }
.app-shell .signal-fold strong { font-size: 16px; line-height: 1.2; }
.app-shell .signal-fold small { font: 500 12px/1.3 var(--sans); letter-spacing: 0; }

/* Keep Meta's fitted arrangement and its meaningful resource colors. */
.app-shell :is(.lifestyle-primary-action,.lifestyle-tier-paths > button,.lifestyle-tier-paths > a,#lifestyle-search-guide button,#lifestyle-action-close,.orientation-detail-panel button,.open-house-times a) {
  border: 1px solid rgba(78,89,94,.18); border-radius: 16px;
  background: #e8eae9; color: var(--soft-ink); box-shadow: var(--soft-raised);
  font-family: var(--sans); transition: background .18s ease, box-shadow .18s ease;
}
.app-shell :is(.lifestyle-primary-action,.lifestyle-tier-paths > button,.lifestyle-tier-paths > a,#lifestyle-search-guide button,.orientation-detail-panel button,.open-house-times a):hover { background: #f2f4f3; border-color: #879296; }
.app-shell .lifestyle-pair article { padding-bottom: 52px; }
.app-shell .lifestyle-component-action > span { padding: 8px 12px; border-radius: 12px; background: #e8eae9; box-shadow: var(--soft-raised); font: 600 12px/1.3 var(--sans); }
#meta-lens .meta-fan-actions > :is(a,button), #meta-lens .meta-purpose-actions > a {
  border-radius: 16px; box-shadow: var(--soft-raised); background-color: #e8eae9;
}
.app-shell #meta-lens .meta-purpose-actions > button.meta-lifestyle-launch { border-radius: 16px; box-shadow: var(--soft-raised); }
#meta-lens .meta-fan-actions > :is(a,button):active { box-shadow: var(--soft-inset); }
#meta-lens #meta-lens-close { border-radius: 16px; }
#meta-lens #meta-lens-close b { background: transparent; color: inherit; }
.app-shell .view-controls { gap: 8px; padding: 10px; }
.app-shell .view-button { transform: none; margin-left: 0; }
.app-shell .view-button--meta::before { display: none; }

/* The hand-drawn wordmark stays vector-sharp at every display size. */
.app-shell .topbar { padding-inline: 16px; gap: 24px; grid-template-columns: minmax(270px,1fr) minmax(0,1.8fr) auto; }
.app-shell .brand { padding: 0; gap: 12px; border: 0; background: none; box-shadow: none; border-radius: 0; }
.app-shell .brand-emblem { display: block; flex: 0 0 44px; width: 44px; height: 44px; }
.app-shell .brand-copy { gap: 0; align-items: flex-end; }
.app-shell .brand-sketch { display: block; width: 230px; height: auto; }
.app-shell .brand-world { padding-right: 4px; font: 500 14px/1.25 var(--sans); letter-spacing: .08em; color: #434d47; }
.app-shell .map-title { gap: 7px; }
.app-shell .map-title > span { font: 500 clamp(18px,1.5vw,24px)/1.25 var(--sans); letter-spacing: -.025em; text-wrap: balance; }
.app-shell .map-title > strong { font: 400 14px/1.4 var(--sans); text-wrap: balance; }
.app-shell .network-readout { padding: 0; gap: 12px; }
.app-shell #concept-panel .concept-credits { margin-top: 20px; font: 400 12px/1.6 var(--sans); color: #5d6861; }

/* One scrolling reading surface. The navigation remains outside it. */
.app-shell #tutorial .tutorial-card {
  width: min(1060px,calc(100vw - 32px));
  height: min(900px,calc(100dvh - 32px));
  min-height: 0; padding: 20px 26px 16px; gap: 14px;
  grid-template-rows: auto minmax(0,1fr) auto 72px;
}
.app-shell #tutorial.has-sequence .tutorial-card { grid-template-rows: auto minmax(0,1fr) 72px; }
.app-shell #tutorial .tutorial-main {
  min-height: 0; overflow: auto; align-items: center;
  grid-template-columns: minmax(180px,.6fr) minmax(0,2fr);
  grid-template-rows: auto; scrollbar-width: thin; scrollbar-color: #94a099 transparent;
}
.app-shell #tutorial .tutorial-copy { min-height: auto; max-height: none; overflow: visible; width: 100%; max-width: none; padding: 24px 30px; }
.app-shell #tutorial #tutorial-text { overflow: visible; max-height: none; margin-top: 20px; font-size: 19px; line-height: 1.55; }
.app-shell #tutorial #tutorial-text p { max-height: none; overflow: visible; }
.app-shell #tutorial #tutorial-title { font-size: clamp(28px,2.6vw,36px); line-height: 1.2; }
.app-shell #tutorial.has-sequence .tutorial-main { display: grid; grid-template-columns: minmax(0,1fr); align-items: safe center; }
.app-shell #tutorial.has-sequence .tutorial-visual { display: none; }
.app-shell #tutorial.has-sequence .tutorial-copy { max-width: 880px; margin: auto; }
.app-shell #tutorial .tutorial-topline button { color: #445149; font: 500 14px/1.2 var(--sans); min-height: 36px; padding: 6px 10px; letter-spacing: 0; text-decoration: none; }
.app-shell #tutorial .tutorial-topline button:hover { text-decoration: underline; text-underline-offset: 4px; }
.app-shell #tutorial .tutorial-sequence { gap: 10px; }
.app-shell #tutorial .tutorial-sequence li {
  position: relative; min-height: 58px; padding: 12px 16px; grid-template-columns: 36px minmax(0,1fr);
  opacity: 1; transform: none; animation: readingStep 8s ease both;
  animation-delay: calc(var(--step) * 8s);
}
.app-shell #tutorial .tutorial-sequence li > span:last-child { grid-template-columns: 112px minmax(0,1fr); gap: 16px; }
.app-shell #tutorial .tutorial-sequence b { font-size: 17px; }
.app-shell #tutorial .tutorial-sequence li > span > span { font-size: 18px; line-height: 1.45; }
.app-shell #tutorial #tutorial-text .tutorial-sequence-intro { margin: 0 0 18px; }
.app-shell #tutorial #tutorial-text .tutorial-sequence-footer { margin: 18px 0 0; font-size: 17px; }
.app-shell #tutorial :is(.tutorial-benefits,.tutorial-coincidence-types) li { --step: 0; animation: readingStep 8s ease both; animation-delay: calc(var(--step) * 8s); }
.app-shell #tutorial :is(.tutorial-benefits,.tutorial-coincidence-types) li:nth-child(2) { --step: 1; }
.app-shell #tutorial :is(.tutorial-benefits,.tutorial-coincidence-types) li:nth-child(3) { --step: 2; }
.app-shell #tutorial :is(.tutorial-benefits,.tutorial-coincidence-types) li:nth-child(4) { --step: 3; }
.app-shell #tutorial[data-lesson="zoom"] .tutorial-sequence li { grid-template-columns: 94px minmax(0,1fr); padding-block: 10px; }
.app-shell #tutorial[data-lesson="zoom"] .tutorial-sequence-icon { width: calc(44px + var(--step)*12px); height: calc(44px + var(--step)*12px); justify-self: center; }
.app-shell #tutorial .tutorial-sequence-icon svg { display: block; width: 100%; height: 100%; }
.app-shell #tutorial[data-lesson="orientation"] .tutorial-sequence-icon { border: 1px solid #a0aca4; border-radius: 10px; font: 500 16px/1 var(--sans); width: 36px; height: 36px; background: #f8f9f7; }
.app-shell #tutorial[data-lesson="orientation"] .is-dream { border-color: #7ea78a; }
.app-shell #tutorial[data-lesson="orientation"] .is-alignment { border-color: #7f9fb8; }
.app-shell #tutorial[data-lesson="orientation"] .is-connection { border-color: #bb8b7c; }
@keyframes readingStep { 0%,100% { background: #eef0ef; border-color: #d7ddda; } 8%,85% { background: #fffef9; border-color: #9bafa2; box-shadow: inset 3px 0 0 #9bafa2; } }

/* v3.2: quicker signal/navigation lessons and evenly framed reading space. */
.app-shell #tutorial .tutorial-main { padding-block: 18px; }
.app-shell #tutorial .tutorial-copy { padding-block: 28px; }
.app-shell #tutorial:is([data-lesson="signal-language"],[data-lesson="zoom"]) .tutorial-sequence li {
  animation-duration: 4s; animation-delay: calc(var(--step) * 4s);
}
.app-shell #tutorial[data-lesson="zoom"] .tutorial-sequence li {
  animation-name: readingLensStep;
}
@keyframes readingLensStep {
  0% { opacity: .8; background: #eef0ef; border-color: #d7ddda; }
  8%,85% { opacity: 1; background: #fffef9; border-color: #9bafa2; box-shadow: inset 3px 0 0 #9bafa2; }
  100% { opacity: 1; background: #eef0ef; border-color: #d7ddda; }
}

/* Fill and shape separate, meet, and resolve into the four readable signals. */
.app-shell #tutorial[data-lesson="combinations"] .tutorial-main { grid-template-columns: 280px minmax(0,1fr); }
.app-shell #tutorial[data-lesson="combinations"] .tutorial-card { grid-template-rows: auto minmax(0,1fr) 72px; }
.app-shell #tutorial[data-lesson="combinations"] .tutorial-copy { padding-block: 20px; }
.app-shell #tutorial[data-lesson="combinations"] #tutorial-title { font-size: clamp(27px,2.4vw,32px); }
.app-shell #tutorial[data-lesson="combinations"] .tutorial-benefits { gap: 8px; }
.app-shell #tutorial[data-lesson="combinations"] .tutorial-benefits li { min-height: 64px; padding: 10px 14px; }
.app-shell #tutorial[data-lesson="combinations"] .tutorial-benefits { grid-template-columns: minmax(0,1fr); }
.app-shell #tutorial .tutorial-icon--combinations { position: static; display: block; width: 260px; height: 260px; transform: none; border: 0; background: none; box-shadow: none; }
.app-shell #tutorial .tutorial-icon--combinations::before,
.app-shell #tutorial .tutorial-icon--combinations::after { display: none; }
.app-shell #tutorial .combination-demo { display: block; width: 100%; height: 100%; fill: none; stroke: #66746b; stroke-width: 1.5; overflow: visible; }
.app-shell #tutorial .combination-demo text { fill: #445149; stroke: none; text-anchor: middle; font: 500 17px var(--sans); }
.app-shell #tutorial .combination-sources { opacity: 0; animation: combinationSources 6s ease both; }
.app-shell #tutorial .combination-fill { animation: combinationFill 6s ease both; }
.app-shell #tutorial .combination-shape { animation: combinationShape 6s ease both; }
.app-shell #tutorial .combination-mark { animation: combinationMark .45s ease both; }
.app-shell #tutorial .combination-fill .combination-mark--first { animation-delay: .65s; }
.app-shell #tutorial .combination-fill .combination-mark--second { animation-delay: 1.3s; }
.app-shell #tutorial .combination-shape .combination-mark--first { animation-delay: 2.7s; }
.app-shell #tutorial .combination-shape .combination-mark--second { animation-delay: 3.35s; }
@keyframes combinationMark { from { opacity: 0; } to { opacity: 1; } }
@media(prefers-reduced-motion:reduce) { .app-shell #tutorial .combination-mark { animation: none; } }
.app-shell #tutorial .combination-result { opacity: 1; animation: combinationResult 1s 5.4s ease both; }
.app-shell #tutorial[data-lesson="combinations"] .tutorial-benefits li { animation: combinationRow .8s ease both; animation-delay: calc(6.3s + var(--step) * 1.1s); }
@keyframes combinationSources { 0%,80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes combinationFill { 0% { transform: translateY(8px); opacity: 0; } 14%,80% { transform: none; opacity: 1; } 100% { transform: translate(35px,25px); opacity: 0; } }
@keyframes combinationShape { 0%,32% { transform: translateY(8px); opacity: 0; } 46%,80% { transform: none; opacity: 1; } 100% { transform: translate(-35px,25px); opacity: 0; } }
@keyframes combinationResult { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes combinationRow { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 640px) {
  .app-shell #tutorial[data-lesson="combinations"] .tutorial-visual { height: 210px; display: grid; place-items: center; }
  .app-shell #tutorial .tutorial-icon--combinations { width: 210px; height: 210px; }
}

/* The cursor reaches the pixel, clicks, then opens the illustrative card. */
.app-shell #tutorial[data-lesson="card"] .tutorial-main { grid-template-columns: 280px minmax(0,1fr); }
.app-shell #tutorial .tutorial-icon--card { position: static; display: block; width: 260px; height: 250px; transform: none; border: 0; background: none; box-shadow: none; }
.app-shell #tutorial .tutorial-icon--card::before, .app-shell #tutorial .tutorial-icon--card::after { display: none; }
.app-shell #tutorial .meet-demo { width: 100%; height: 100%; overflow: visible; }
.app-shell #tutorial .demo-cursor { animation: meetCursor 14s ease-in-out infinite; }
.app-shell #tutorial .demo-card { transform-origin: 59px 47px; animation: meetCard 14s ease-in-out infinite; }
.app-shell #tutorial .demo-halo { animation: meetHalo 14s ease-in-out infinite; }
@keyframes meetCursor { 0%,8% { transform: translate(112px,74px); opacity: 0; } 12% { opacity: 1; } 28%,86% { transform: translate(61px,49px); opacity: 1; } 96%,100% { transform: translate(112px,74px); opacity: 0; } }
@keyframes meetCard { 0%,29%,100% { opacity: 0; transform: scale(.18); } 40%,90% { opacity: 1; transform: scale(1); } }
@keyframes meetHalo { 0%,24%,42%,100% { opacity: 0; } 29% { opacity: .85; } }
.app-shell #tutorial.is-paused *, .app-shell #tutorial.is-paused *::before, .app-shell #tutorial.is-paused *::after { animation-play-state: paused !important; }

@media (max-width: 1200px) {
  .app-shell .topbar { grid-template-columns: 248px minmax(0,1fr) auto; gap: 16px; }
  .app-shell .brand-sketch { width: 188px; }
  .app-shell .brand-emblem { width: 40px; height: 40px; flex-basis: 40px; }
  .app-shell .network-readout > :is(time,.live-dot,span) { display: none; }
  .app-shell .map-title > strong { font-size: 13px; }
}
@media (max-width: 760px) {
  .app-shell .topbar { grid-template-columns: minmax(0,1fr) auto; padding-inline: 10px; gap: 12px; }
  .app-shell .map-title { display: none; }
  .app-shell .brand-sketch { width: 160px; }
  .app-shell .brand-emblem { width: 32px; height: 32px; flex-basis: 32px; }
  .app-shell .brand { gap: 8px; }
  .app-shell .brand-world { font-size: 12px; }
  .app-shell .help-button { width: auto; min-width: 60px; padding: 10px; font-size: 14px; letter-spacing: 0; }
  .app-shell .help-button .help-label { display: none; }
  .app-shell .help-button .help-short { display: inline; }
  .app-shell .network-readout { gap: 8px; }
  .app-shell .concept-button { width: 36px; flex-basis: 36px; }
}
@media (max-width: 640px) {
  .app-shell #tutorial .tutorial-card { width: calc(100vw - 16px); height: calc(100dvh - 16px); padding: 12px; gap: 10px; }
  .app-shell #tutorial .tutorial-main { display: block; }
  .app-shell #tutorial .tutorial-visual { height: 100px; min-width: 0; margin: 0; }
  .app-shell #tutorial .tutorial-copy { padding: 24px 16px; }
  .app-shell #tutorial .tutorial-main { padding-block: 12px; }
  .app-shell #tutorial #tutorial-title { font-size: 27px; }
  .app-shell #tutorial #tutorial-text { font-size: 18px; margin-top: 18px; }
  .app-shell #tutorial .tutorial-sequence li { padding: 12px 10px; gap: 10px; }
  .app-shell #tutorial .tutorial-sequence li > span:last-child { grid-template-columns: minmax(0,1fr); gap: 4px; }
  .app-shell #tutorial .tutorial-sequence li > span > span { font-size: 17px; }
  .app-shell #tutorial[data-lesson="zoom"] .tutorial-sequence li { grid-template-columns: 82px minmax(0,1fr); }
  .app-shell #tutorial[data-lesson="zoom"] .tutorial-sequence-icon { width: calc(40px + var(--step)*12px); height: calc(40px + var(--step)*12px); }
  .app-shell #tutorial[data-lesson="card"] .tutorial-visual { height: 225px; display: grid; place-items: center; }
  .app-shell #tutorial .tutorial-icon--card { width: 230px; height: 221px; }
  .app-shell #tutorial .tutorial-key { padding: 0 6px; }
  .app-shell .view-controls { gap: 4px; padding: 7px; }
}
@media (max-width: 400px) {
  .app-shell .brand-sketch { width: 138px; }
  .app-shell .network-readout .concept-button { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell #tutorial *, .app-shell #tutorial *::before, .app-shell #tutorial *::after { animation: none !important; }
  .app-shell #tutorial .demo-cursor { transform: translate(61px,49px); }
  .app-shell #tutorial #tutorial-motion { display: none; }
}

/* v3.32: two independent layers, with space to understand each question. */
.app-shell #tutorial .signal-layers { display: grid; gap: 28px; }
.app-shell #tutorial .signal-layer { padding: 18px 22px; border: 1px solid #d3dcd6; border-radius: 18px; background: rgba(255,255,255,.45); animation: signalLayerFocus 4s ease both; }
.app-shell #tutorial .signal-layer:nth-child(2) { animation-delay: 4s; }
.app-shell #tutorial .signal-layer-heading { display: flex; align-items: center; gap: 18px; }
.app-shell #tutorial .signal-layer h3 { margin: 0; font: 600 21px/1.3 var(--sans); letter-spacing: -.02em; }
.app-shell #tutorial #tutorial-text .signal-layer p { margin: 12px 0 8px; font-size: 19px; line-height: 1.45; }
.app-shell #tutorial .signal-layer small { font-size: 16px; color: #53635a; }
.app-shell #tutorial .signal-layer-pair { display: flex; gap: 10px; flex: none; }
.app-shell #tutorial .signal-layer-pair i { display: block; width: 22px; height: 22px; border: 1px solid #53635a; background: #fffefa; border-radius: 2px; }
.app-shell #tutorial .signal-layer-pair .layer-off { background: #25312a; }
.app-shell #tutorial .signal-layer-pair .layer-circle { border-radius: 50%; }
.app-shell #tutorial #tutorial-text .signal-layer-presence { display: flex; gap: 12px; align-items: center; margin: 22px 0 0; font-size: 16px; }
.app-shell #tutorial .signal-layer-presence i { width: 12px; height: 12px; border-radius: 50%; background: #35b857; flex: none; }
@keyframes signalLayerFocus { 0%,100% { border-color: #d3dcd6; } 15%,85% { border-color: #91ab99; background: rgba(255,255,255,.85); } }
@media(max-width:700px) {
  .app-shell #tutorial .signal-layers { gap: 20px; }
  .app-shell #tutorial .signal-layer { padding: 16px; }
  .app-shell #tutorial .signal-layer-heading { gap: 12px; }
  .app-shell #tutorial .signal-layer h3 { font-size: 19px; }
  .app-shell #tutorial #tutorial-text .signal-layer p { font-size: 17px; }
}
@media(prefers-reduced-motion:reduce) { .app-shell #tutorial .signal-layer { animation: none; } }
