:root {
  --w37-bg-deep: #171316;
  --w37-bg-light: #f5efed;
  --w37-ink: #352e31;
  --w37-cream: #fff9f7;
  --w37-muted-dark: #75696d;
  --w37-muted-light: rgba(255, 249, 247, .68);
  --w37-rose: #8f6468;
  --w37-rose-deep: #68484e;
  --w37-rose-soft: #d8c4c0;
  --w37-oat: #f8efec;
  --w37-sage: #a8b99a;
  --w37-coral: #bd7d76;
  --w37-success: #a8b99a;
  --w37-risk: #bd7d76;
  --w37-line: rgba(255, 255, 255, .28);
  --w37-font-display: "Songti SC", "STSong", "SimSun", serif;
  --w37-font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  --w37-type-page: clamp(28px, 7.8vw, 40px);
  --w37-type-section: 22px;
  --w37-type-body: 12px;
  --w37-type-control: 13px;
  --w37-type-meta: 8px;
  --w37-radius-surface: 26px;
  --w37-radius-action: 21px;
  --w37-radius-control: 16px;
  --w37-shadow-action: 0 15px 34px rgba(67, 42, 49, .28), inset 0 1px rgba(255, 255, 255, .38);
  --w37-shadow-surface: 0 20px 55px rgba(29, 19, 24, .24), inset 0 1px rgba(255, 255, 255, .08);
  --w37-light-page: radial-gradient(circle at 12% 0, rgba(255,255,255,.94), transparent 31%), linear-gradient(155deg, #faf6f4 0%, #f0e7e4 48%, #e8dcda 100%);
  --w37-dark-page: radial-gradient(circle at 82% 2%, rgba(143,100,104,.25), transparent 34%), linear-gradient(165deg, #2a2025 0%, #171316 52%, #0e0b0d 100%);
  --w37-light-card: rgba(255, 252, 250, .68);
  --w37-light-line: rgba(104, 72, 78, .16);
  --w37-dark-card: rgba(35, 27, 32, .9);
}

/* Secondary sheets, completion states, and hidden-route controls. */
#auth-sheet,.intimacy-card,.coordinate-preview{border-color:var(--w37-light-line)!important;background:var(--w37-light-card)!important;color:var(--w37-ink)!important;box-shadow:0 18px 48px rgba(75,48,57,.12)!important}
#auth-sheet :is(.close,.secondary),.home-sheet :is(.sheet-close,.secondary){min-width:44px;min-height:44px;border-color:rgba(104,72,78,.18)!important;background:rgba(255,255,255,.52)!important;color:var(--w37-rose-deep)!important}
:is(.video-complete,.ending-card,.task-complete-modal,.escape-leave-card,.result-card){border-color:rgba(216,196,192,.24)!important;background:linear-gradient(155deg,#2d2229,#21181d 58%,#120e11)!important;color:var(--w37-cream)!important}
:is(.video-complete,.ending-card,.task-complete-modal,.escape-leave-card,.result-card) :is(h1,h2){color:var(--w37-cream)!important}
:is(.video-complete,.ending-card,.task-complete-modal,.escape-leave-card,.result-card) p{color:var(--w37-muted-light)!important}
.vlog-toast{border-color:rgba(168,185,154,.35)!important;background:#21181df2!important;color:#e8f0e1!important}
.radar{border-color:rgba(143,100,104,.22)!important;background:radial-gradient(circle,rgba(143,100,104,.2),transparent 64%)!important}
.radar i{background:conic-gradient(from 0deg,rgba(143,100,104,.82),rgba(143,100,104,.28) 25%,transparent 36%,transparent 100%)!important;box-shadow:0 0 12px rgba(143,100,104,.3)!important}
.scan:after{background:var(--w37-rose)!important;box-shadow:0 0 12px rgba(143,100,104,.5)!important}
.scan{border-color:rgba(143,100,104,.34)!important;background-color:rgba(255,252,250,.42)!important}
.settings-row{border-color:var(--w37-light-line)!important}.permission-switch{background:rgba(104,72,78,.16)!important}.permission-row.is-on .permission-switch{background:rgba(168,185,154,.72)!important}
.secret-jumps{border-color:var(--w37-light-line)!important;background:rgba(255,252,250,.88)!important;box-shadow:0 8px 28px rgba(75,48,57,.1)!important}
.secret-jumps button{border-color:var(--w37-light-line)!important;color:var(--w37-muted-dark)!important}.secret-jumps button.is-active{background:linear-gradient(135deg,#dbc7c4,#c49ea1)!important;color:#533a41!important;box-shadow:inset 0 1px #fff9!important}
.my-secret-editor,.my-secret-card,.bond-event,.portrait-card,.thought-list article,.daily-list article{border-color:var(--w37-light-line)!important;background:rgba(255,252,250,.58)!important;color:var(--w37-ink)!important}
.my-secret-editor textarea,.vlog-prompt textarea{border-color:rgba(143,100,104,.22)!important;background:rgba(255,255,255,.58)!important;color:var(--w37-ink)!important}
.vlog-source,.vlog-presets button{border-color:rgba(143,100,104,.2)!important}.vlog-source.is-selected,.vlog-presets button.is-selected{border-color:rgba(216,196,192,.56)!important;background:rgba(143,100,104,.24)!important;color:var(--w37-cream)!important}
.vlog-footer{border-color:rgba(216,196,192,.18)!important;background:linear-gradient(180deg,rgba(33,24,29,.88),#171316)!important}
.video-controls,.escape-composer{border-color:rgba(216,196,192,.22)!important;background:rgba(33,24,29,.9)!important}
.task-dot{border-color:rgba(216,196,192,.45)!important;background:rgba(143,100,104,.15)!important}.task-dot.is-complete,.task-dot.on{background:var(--w37-success)!important}
.outside-nav{color:var(--w37-ink)!important}:is(button,a,input,textarea,select):focus-visible{outline:3px solid rgba(143,100,104,.44);outline-offset:3px}

:is(body,button,input,textarea,select,dialog) {
  font-family: var(--w37-font-ui) !important;
}

:is(h1,h2,.speaker,.story-text) {
  font-family: var(--w37-font-display) !important;
}

body { font-size: var(--w37-type-body); line-height: 1.65; }
:is(button,input,textarea,select) { font-size: var(--w37-type-control); }
:is(.eyebrow,.field,.tag,.node-kicker,.sheet-eyebrow,.nav-kicker,.task-header small,.chapter-heading small,.video-header small,.map-header small,.progress-heading small,.section-heading small,.step-number,.settings-header small,.secret-header small,.secret-kicker) {
  font-size: var(--w37-type-meta) !important;
  line-height: 1.45;
  letter-spacing: .12em;
}
:is(.calendar-day strong,.plan-item time,.progress-heading output,.diamond-balance,.step-number) {
  font-family: var(--w37-font-ui) !important;
  font-variant-numeric: tabular-nums;
}

.w37-surface {
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--w37-radius-surface);
  background: linear-gradient(145deg, rgba(75, 56, 62, .9), rgba(29, 23, 27, .94));
  box-shadow: var(--w37-shadow-surface);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.w37-action {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: var(--w37-radius-action);
  background: linear-gradient(135deg, var(--w37-rose-deep), var(--w37-rose));
  box-shadow: var(--w37-shadow-action);
  color: var(--w37-cream);
  font-family: var(--w37-font-ui);
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.w37-action::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(118deg, rgba(255, 255, 255, .18), transparent 38%);
  pointer-events: none;
}

.w37-action:hover { filter: brightness(1.05); }
.w37-action:active { transform: scale(.985); filter: brightness(.98); }
.w37-action:focus-visible,
.w37-quick-action:focus-visible,
.w37-field:focus-visible {
  outline: 3px solid rgba(216, 196, 192, .72);
  outline-offset: 3px;
}
.w37-action:disabled { opacity: .42; box-shadow: none; cursor: not-allowed; }

.w37-action--soft {
  border-color: rgba(143, 100, 104, .2);
  background: linear-gradient(145deg, #eee2df, #c9aaa9);
  box-shadow: 0 12px 28px rgba(75, 48, 57, .2), inset 0 1px #fff;
  color: #563c43;
}

.w37-action__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
}
.w37-action--soft .w37-action__icon { border-color: rgba(104, 72, 78, .17); background: rgba(255, 255, 255, .48); }
.w37-action__icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.w37-action__copy { position: relative; z-index: 1; min-width: 0; text-align: left; }
.w37-action__copy small,
.w37-action__copy strong { display: block; }
.w37-action__copy small { margin-bottom: 4px; opacity: .64; font-size: 7px; letter-spacing: .13em; }
.w37-action__copy strong { font: 500 13px/1.3 var(--w37-font-display); }
.w37-action__arrow { position: relative; z-index: 1; font-size: 18px; }

.w37-quick-action {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  min-height: 58px;
  padding: 7px 5px;
  border: 1px solid rgba(143, 100, 104, .22);
  border-radius: 18px;
  background: rgba(255, 249, 247, .1);
  box-shadow: inset 0 1px rgba(255, 255, 255, .12), 0 8px 22px rgba(32, 20, 25, .14);
  color: inherit;
  font: 9px/1.25 var(--w37-font-ui);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}
.w37-quick-action:hover { background: rgba(216, 196, 192, .16); }
.w37-quick-action:active { transform: scale(.98); }
.w37-quick-action svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.w37-field {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid rgba(143, 100, 104, .25);
  border-radius: var(--w37-radius-control);
  outline: 0;
  background: rgba(255, 249, 247, .08);
  color: inherit;
  font: 12px/1.5 var(--w37-font-ui);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.w37-field:focus { border-color: rgba(216, 196, 192, .72); box-shadow: 0 0 0 4px rgba(143, 100, 104, .1); }

/* Existing flow controls inherit the new material without changing script hooks. */
.primary {
  border-color: rgba(255,255,255,.3) !important;
  border-radius: var(--w37-radius-action) !important;
  background: linear-gradient(135deg, var(--w37-rose-deep), var(--w37-rose)) !important;
  box-shadow: var(--w37-shadow-action) !important;
  color: var(--w37-cream) !important;
}
.primary.w37-action { display: grid; grid-template-columns: 1fr; place-items: center; min-height: 56px; }
.secondary,.tab,.choice-button,.choice { border-color: rgba(216,196,192,.24) !important; background: rgba(143,100,104,.1) !important; }
.input,.identity-field input,.identity-field textarea { border-color: rgba(216,196,192,.24) !important; border-radius: var(--w37-radius-control) !important; }
.eyebrow,.field,.tag,.node-kicker,.task-brief p { color: var(--w37-rose-soft) !important; }
.sheet,.setup-card,.identity-form { border-color: rgba(216,196,192,.2) !important; }

/* Narrative and utility surfaces */
.continue-button,.hold-button,.complete-primary,.composer-send,.generate-bar button,#vlog-generate,#generate-vlog,.save-profile {
  border-color: rgba(255,255,255,.3) !important;
  border-radius: var(--w37-radius-action) !important;
  background: linear-gradient(135deg, var(--w37-rose-deep), var(--w37-rose)) !important;
  box-shadow: var(--w37-shadow-action) !important;
  color: var(--w37-cream) !important;
}
.dialogue-panel,.collection-panel,.video-controls,.escape-footer { border-color: rgba(216,196,192,.16) !important; }
.choice-button:hover,.choice-button.is-selected,.choice:hover,.choice:focus {
  border-color: rgba(216,196,192,.58) !important;
  background: rgba(143,100,104,.24) !important;
}
.circle-button,.map-button,.back-button,.escape-back,.settings-button {
  border-color: rgba(216,196,192,.3) !important;
  background: rgba(48,35,41,.66) !important;
  color: var(--w37-oat) !important;
}
.video-complete,.ending-card,.task-complete-modal,.escape-leave-card,.result-card,.vlog-card {
  border-color: rgba(216,196,192,.22) !important;
  background-color: rgba(31,24,28,.94) !important;
  box-shadow: var(--w37-shadow-surface) !important;
}
.chapter-card,.locked-chapter,.source-option,.scene-input,.escape-composer {
  border-color: rgba(216,196,192,.18) !important;
  background-color: rgba(143,100,104,.08) !important;
}
.chapter-card-heading>span,.chapter-heading small,.map-header small,.video-header small,.progress-heading small,.progress-heading output,.section-heading small,.step-number,.diamond-balance,.nav-kicker,.nav-grid small {
  color: var(--w37-rose-soft) !important;
}
.progress-track i,.meter i { background: linear-gradient(90deg, var(--w37-rose-deep), var(--w37-rose-soft)) !important; }
.outside-nav { border-color: rgba(216,196,192,.16) !important; background: linear-gradient(180deg,#21191d,#100d0f) !important; }
.nav-grid button { border-color: rgba(216,196,192,.18) !important; border-radius: var(--w37-radius-control) !important; background: rgba(143,100,104,.07) !important; }
.nav-grid button:hover,.nav-grid button:focus-visible,.nav-grid button.active { border-color: rgba(216,196,192,.55) !important; background: rgba(143,100,104,.22) !important; }

/* G palette: pale profile surfaces and plum-black immersive surfaces. */
.app:has([data-view="opening"].active) {
  --gold: var(--w37-rose-soft);
  --bright: var(--w37-oat);
  --muted: var(--w37-muted-light);
  background: var(--w37-dark-page) !important;
}
.app:has([data-view="opening"].active) .brand small { color: var(--w37-rose-soft) !important; }
.app:has([data-view="opening"].active) .signal { color: var(--w37-muted-light) !important; }
.app:has([data-view="opening"].active) .progress i { background: rgba(216,196,192,.18) !important; }
.app:has([data-view="opening"].active) .progress i.on { background: var(--w37-rose) !important; box-shadow: 0 0 9px rgba(143,100,104,.48) !important; }
.app:has([data-view="intro"].active) .progress i:not(.on) { background: rgba(216,196,192,.22) !important; }
.app:has([data-view="intro"].active) .progress i.on { background: var(--w37-rose) !important; box-shadow: 0 0 9px rgba(143,100,104,.48) !important; }
[data-view="opening"] .bg-video { filter: saturate(.78) contrast(1.04) brightness(.9); }
[data-view="opening"] .shade { background: linear-gradient(180deg,rgba(38,26,34,.14),rgba(31,22,28,.14) 34%,rgba(18,13,17,.94) 100%),radial-gradient(circle at 50% 42%,transparent 32%,rgba(31,20,28,.42) 100%) !important; }
[data-view="opening"] .eyebrow { color: var(--w37-rose-soft) !important; }
[data-view="opening"] .copy { color: var(--w37-muted-light) !important; }
[data-view="opening"] .primary {
  border-color: rgba(255,249,247,.34) !important;
  background: linear-gradient(135deg,#745159,var(--w37-rose)) !important;
  box-shadow: 0 18px 42px rgba(47,29,38,.42), inset 0 1px rgba(255,255,255,.32) !important;
}
.identity-view {
  --gold: var(--w37-rose);
  --bright: var(--w37-rose-deep);
  --muted: var(--w37-muted-dark);
  --line: var(--w37-light-line);
  background: var(--w37-light-page) !important;
  color: var(--w37-ink) !important;
}
.select-view,
.setup-view {
  --gold: var(--w37-rose);
  --bright: var(--w37-rose-deep);
  --muted: var(--w37-muted-dark);
  --line: var(--w37-light-line);
  background: var(--w37-light-page) !important;
  color: var(--w37-ink) !important;
}
.setup-view .setup-card {
  border-color: var(--w37-light-line) !important;
  background: rgba(255,252,250,.38) !important;
  box-shadow: 0 24px 70px rgba(75,48,57,.09);
}
.identity-view .identity-form {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.identity-view .eyebrow,
.select-view .eyebrow,
.setup-view .eyebrow,
.setup-view .field { color: var(--w37-rose) !important; }
.identity-view .identity-intro,
.identity-view .earth-identity-card small,
.identity-view .identity-field small,
.select-view .selection-status,
.setup-view .setup-card > p,
.setup-view .hint { color: var(--w37-muted-dark) !important; }
.identity-view .earth-identity-card,
.identity-view .identity-field,
.setup-view .setup-card {
  border-color: var(--w37-light-line) !important;
  background: var(--w37-light-card) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.86), 0 12px 30px rgba(75,48,57,.06);
}
.identity-view .earth-identity-avatar {
  border-color: rgba(143,100,104,.32) !important;
  background: linear-gradient(145deg, #fff, #eadcda);
  color: var(--w37-rose-deep) !important;
  box-shadow: inset 0 1px #fff, 0 8px 22px rgba(75,48,57,.1) !important;
}
.identity-view .identity-field input,
.identity-view .identity-field textarea,
.setup-view .input {
  border-color: rgba(104,72,78,.2) !important;
  background: rgba(255,255,255,.74) !important;
  color: var(--w37-ink) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.9);
}
.identity-view input::placeholder,
.identity-view textarea::placeholder,
.setup-view input::placeholder { color: rgba(53,46,49,.4) !important; }
.setup-view .tab,
.setup-view .wifi {
  border-color: var(--w37-light-line) !important;
  background: rgba(255,255,255,.44) !important;
  color: var(--w37-ink) !important;
}
.setup-view .tab.on,
.setup-view .wifi.on { background: rgba(143,100,104,.13) !important; color: var(--w37-rose-deep) !important; }
.select-view .char-label {
  border-color: rgba(104,72,78,.18) !important;
  background: rgba(255,252,250,.84) !important;
  color: var(--w37-ink) !important;
  box-shadow: 0 12px 28px rgba(75,48,57,.12);
}
.select-view .char-label small { color: var(--w37-rose-deep) !important; }
.select-view .showcase-nav { border-color: rgba(104,72,78,.2) !important; background: rgba(255,252,250,.78) !important; color: var(--w37-rose-deep) !important; }
.app:has(.identity-view.active) .top,
.app:has(.select-view.active) .top,
.app:has(.setup-view.active) .top { color: var(--w37-ink) !important; }
.app:has(.identity-view.active) .brand small,
.app:has(.select-view.active) .brand small,
.app:has(.setup-view.active) .brand small,
.app:has(.identity-view.active) .signal,
.app:has(.select-view.active) .signal,
.app:has(.setup-view.active) .signal { color: var(--w37-rose-deep) !important; }
.app:has(.identity-view.active) .progress i,
.app:has(.select-view.active) .progress i,
.app:has(.setup-view.active) .progress i { background: rgba(104,72,78,.12) !important; }
.app:has(.identity-view.active) .progress i.on,
.app:has(.select-view.active) .progress i.on,
.app:has(.setup-view.active) .progress i.on { background: var(--w37-rose) !important; box-shadow: 0 0 8px rgba(143,100,104,.2) !important; }
.activated { background: #171012 !important; }
.activated-background { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.activated .shade { background: linear-gradient(180deg, rgba(8,6,6,.34), transparent 42%, rgba(7,4,5,.2) 58%, rgba(7,4,5,.94) 100%), radial-gradient(circle at 50% 40%, transparent 38%, rgba(3,2,3,.2) 100%); }
.app:has(.activated.active) .progress i { background: rgba(216,196,192,.22) !important; }
.app:has(.activated.active) .progress i.on { background: var(--w37-rose) !important; box-shadow: 0 0 9px rgba(143,100,104,.48) !important; }

.settings-page,
.secret-archive,
.about-him-page,
.future-page,
.my-characters,
.vlog-page {
  --brass: var(--w37-rose);
  --brass-bright: var(--w37-rose-deep);
  --cream: var(--w37-ink);
  --muted: var(--w37-muted-dark);
  background: var(--w37-light-page) !important;
  color: var(--w37-ink) !important;
}
.settings-page :is(.settings-section,.profile-card,.settings-card),
.secret-archive :is(.archive-card,.secret-card,.memory-card),
.about-him-page :is(.about-profile-card,.thought-list article,.more-history),
.future-page :is(.plan-calendar,.plan-item),
.my-characters :is(.character-card,.character-profile),
.vlog-page :is(.vlog-card,.scene-input,.source-option) {
  border-color: var(--w37-light-line) !important;
  background: var(--w37-light-card) !important;
  color: var(--w37-ink) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.86), 0 12px 32px rgba(75,48,57,.07) !important;
}
.my-characters .bound-character { border-color: var(--w37-light-line) !important; background: var(--w37-light-card) !important; color: var(--w37-ink) !important; box-shadow: inset 0 1px rgba(255,255,255,.86), 0 10px 24px rgba(75,48,57,.055) !important; }
.my-characters .bound-character.is-selected { border-color: rgba(143,100,104,.54) !important; box-shadow: 0 0 0 3px rgba(143,100,104,.08), 0 12px 30px rgba(75,48,57,.09) !important; }
.my-characters .binding-detail { border-color: var(--w37-light-line) !important; background: rgba(255,252,250,.78) !important; color: var(--w37-ink) !important; box-shadow: inset 0 1px #fff, 0 14px 34px rgba(75,48,57,.07); }
.my-characters .binding-detail dl div { border-color: rgba(104,72,78,.12) !important; }
.my-characters .character-switch-confirm { background: linear-gradient(110deg,var(--w37-rose-deep),var(--w37-rose)) !important; color: #fff9f7 !important; }
.my-characters .character-switch-confirm:disabled { background: rgba(104,72,78,.09) !important; color: rgba(53,46,49,.48) !important; }
.settings-page :is(input,textarea,select),
.secret-archive :is(input,textarea),
.vlog-page :is(input,textarea) { border-color: var(--w37-light-line) !important; background: rgba(255,255,255,.72) !important; color: var(--w37-ink) !important; }
.settings-page .settings-tabs { background: linear-gradient(rgba(245,239,237,.96) 78%, transparent) !important; }
.settings-page :is(.settings-tab,.identity-card,.profile-field,.anchor-level,.settings-group,.account-danger-zone button),
.secret-archive :is(.secret-jumps,.portrait-card,.thought-list article,.my-secret-editor,.my-secret-card,.bond-event,.message,.more-history) {
  border-color: var(--w37-light-line) !important;
  background: var(--w37-light-card) !important;
  color: var(--w37-ink) !important;
  box-shadow: inset 0 1px rgba(255,255,255,.86), 0 10px 28px rgba(75,48,57,.06) !important;
}
.about-him-page :is(.about-him-tabs,.about-profile-card,.thought-list article,.more-history) { border-color: var(--w37-light-line) !important; background: var(--w37-light-card) !important; color: var(--w37-ink) !important; box-shadow: inset 0 1px rgba(255,255,255,.86), 0 10px 28px rgba(75,48,57,.06) !important; }
.settings-page .settings-tab.is-active,
.secret-archive .secret-jumps button.is-active,
.about-him-page .about-him-tabs button.is-active { border-color: rgba(143,100,104,.32) !important; background: rgba(143,100,104,.13) !important; color: var(--w37-rose-deep) !important; }
.settings-page :is(.settings-row,.settings-row strong,.profile-field input,.profile-field textarea),
.secret-archive :is(.portrait-card > p,.thought-list p,.my-secret-card > p,.daily-list article span,.daily-list article p,.message p) { color: var(--w37-ink) !important; }
.about-him-page :is(.about-profile-card dd,.thought-list p,.daily-list article span,.daily-list article p) { color: var(--w37-ink) !important; }
.settings-page :is(.identity-copy p,.profile-field small,.level-copy p,.settings-row small),
.secret-archive :is(.secret-note,.history-limit,.portrait-card > small,.bond-event p,.daily-list time,.more-history span) { color: var(--w37-muted-dark) !important; }
.about-him-page :is(.secret-note,.daily-list time,.more-history span) { color: var(--w37-muted-dark) !important; }
.settings-page .identity-avatar { border-color: rgba(143,100,104,.3) !important; background: linear-gradient(145deg,#fff,#dac3c1) !important; color: var(--w37-rose-deep) !important; }
.settings-page .level-orbit { border-color: rgba(143,100,104,.3) !important; box-shadow: inset 0 0 20px rgba(143,100,104,.11), 0 8px 20px rgba(75,48,57,.06) !important; }
.settings-page .level-orbit span,
.settings-page .level-copy small { color: var(--w37-rose) !important; }
.settings-page .level-track { background: rgba(104,72,78,.1) !important; }
.settings-page .level-track i { background: linear-gradient(90deg,var(--w37-rose-deep),var(--w37-rose-soft)) !important; }

.sheet-backdrop { background: rgba(35,25,31,.38) !important; backdrop-filter: blur(8px) saturate(.72) !important; }
.home-sheet {
  --brass: var(--w37-rose);
  --brass-bright: var(--w37-rose-deep);
  --cream: var(--w37-ink);
  --muted: var(--w37-muted-dark);
  border-color: var(--w37-light-line) !important;
  background: var(--w37-light-page) !important;
  color: var(--w37-ink) !important;
  box-shadow: 0 32px 0 #f5efed, 0 -24px 70px rgba(49,31,40,.22), inset 0 1px rgba(255,255,255,.82) !important;
  bottom: 0 !important;
  padding-bottom: max(32px, calc(env(safe-area-inset-bottom) + 22px)) !important;
  overflow-y: auto;
}
.home-sheet .sheet-handle { background: rgba(104,72,78,.22) !important; }
.home-sheet .sheet-close { border: 1px solid var(--w37-light-line) !important; background: rgba(255,255,255,.62) !important; color: var(--w37-rose-deep) !important; box-shadow: 0 8px 20px rgba(75,48,57,.08); }
.home-sheet .sheet-eyebrow { color: var(--w37-rose) !important; }
.home-sheet .sheet-description { color: var(--w37-muted-dark) !important; }
.home-sheet :is(.archive-item,.coordinate-preview,.intimacy-card) { border-color: var(--w37-light-line) !important; background: var(--w37-light-card) !important; color: var(--w37-ink) !important; }
.plan-calendar { border-color: var(--w37-light-line) !important; background: var(--w37-light-card) !important; box-shadow: inset 0 1px rgba(255,255,255,.9), 0 12px 28px rgba(75,48,57,.06); }
.calendar-heading small,
.schedule-heading small { color: var(--w37-muted-dark) !important; }
.calendar-day { color: rgba(53,46,49,.62) !important; }
.calendar-day.is-past { color: rgba(53,46,49,.28) !important; }
.calendar-day.is-today { border-color: rgba(143,100,104,.5) !important; background: linear-gradient(145deg,var(--w37-rose),#a77a7d) !important; color: var(--w37-cream) !important; box-shadow: 0 9px 22px rgba(75,48,57,.2) !important; }
.calendar-day.is-planned { border-color: rgba(143,100,104,.32) !important; background: rgba(255,255,255,.52) !important; color: var(--w37-rose-deep) !important; }
.calendar-day.has-plan i { background: var(--w37-rose) !important; box-shadow: 0 0 7px rgba(143,100,104,.36) !important; }
.plan-item { border-color: var(--w37-light-line) !important; background: rgba(255,252,250,.72) !important; color: var(--w37-ink) !important; box-shadow: inset 0 1px rgba(255,255,255,.88), 0 10px 26px rgba(75,48,57,.055); }
.plan-item time,
.plan-copy strong { color: var(--w37-ink) !important; }
.plan-copy span { color: var(--w37-rose-deep) !important; }
.plan-copy small { color: var(--w37-muted-dark) !important; }
.plan-item.is-complete { opacity: .62; background: rgba(239,235,231,.74) !important; }
.plan-item.is-complete .plan-copy span { color: #71816a !important; }
.plan-item.is-complete time,
.plan-item.is-complete strong { text-decoration-color: rgba(53,46,49,.24) !important; }
.plan-sticker { border-color: rgba(143,100,104,.2) !important; background: radial-gradient(circle at 34% 24%,rgba(255,255,255,.92),rgba(216,196,192,.32) 58%,rgba(143,100,104,.08) 100%) !important; color: var(--w37-rose-deep) !important; box-shadow: inset 0 1px #fff; }
.plan-sticker svg { fill: rgba(143,100,104,.08) !important; }

/* Contrast correction: contextual variants instead of one global soft action. */
#auth-sheet {
  background: #f8f2f0 !important;
  color: #352e31 !important;
  box-shadow: 0 -26px 70px rgba(24,16,20,.34), inset 0 1px #fff !important;
}
#auth-sheet :is(.eyebrow,.field) { color: var(--w37-rose-deep) !important; }
#auth-sheet > p,
#auth-sheet .consent { color: #62585c !important; }
#auth-sheet :is(.input,.secondary) {
  border-color: rgba(104,72,78,.28) !important;
  background: #fffaf8 !important;
  color: #352e31 !important;
}
#auth-sheet .input::placeholder { color: #75696d !important; opacity: 1; }
#auth-sheet .close { border: 1px solid rgba(104,72,78,.2) !important; background: #fffaf8 !important; color: var(--w37-rose-deep) !important; }
#auth-overlay { background: rgba(14,9,13,.76) !important; backdrop-filter: blur(6px) saturate(.7) !important; }

.story-actions .w37-action--soft {
  border-color: rgba(255,249,247,.3) !important;
  background: linear-gradient(145deg,#4a333c,#24191f) !important;
  color: var(--w37-cream) !important;
  box-shadow: 0 15px 34px rgba(18,10,15,.42), inset 0 1px rgba(255,255,255,.16) !important;
}
.story-actions .w37-action--soft .w37-action__icon { border-color: rgba(255,249,247,.2) !important; background: rgba(255,249,247,.1) !important; }
.story-actions .w37-action--soft .w37-action__copy small { color: #eadbd8 !important; opacity: .82; }
.story-actions .w37-action--soft .w37-action__copy strong,
.story-actions .w37-action--soft .escape-run-icon { color: var(--w37-cream) !important; stroke: currentColor !important; }
.story-actions .w37-action:not(.w37-action--soft) .w37-action__copy small { color: #fff0ed !important; opacity: .8; }

.map-view {
  --cream: var(--w37-ink);
  --muted: var(--w37-muted-dark);
  --gold: var(--w37-rose);
  --line: var(--w37-light-line);
  background: var(--w37-light-page) !important;
  color: var(--w37-ink) !important;
}
.map-view .map-ambient { opacity: .26; filter: sepia(.15) hue-rotate(285deg); }
.map-view .chapter-card,
.map-view .locked-chapter { border-color: var(--w37-light-line) !important; background: var(--w37-light-card) !important; color: var(--w37-ink) !important; box-shadow: 0 16px 38px rgba(75,48,57,.08) !important; }
.map-view .map-node-dot { border-color: rgba(104,72,78,.2) !important; background: #fffaf8 !important; color: var(--w37-rose-deep) !important; }
.map-view .circle-button { background: rgba(255,252,250,.72) !important; color: var(--w37-rose-deep) !important; }

.story-shell {
  --gold: var(--w37-rose-soft);
  --line: rgba(216,196,192,.18);
  background: var(--w37-dark-page) !important;
}
.story-grade { background: linear-gradient(180deg,rgba(18,13,17,.46),transparent 31%,rgba(15,11,14,.12) 48%,rgba(13,10,12,.97) 100%) !important; }
.dialogue-panel { background: linear-gradient(180deg,transparent,rgba(25,18,22,.8) 15%,rgba(14,11,13,.98) 52%) !important; }
.task-shell {
  --gold: var(--w37-rose-soft);
  --line: rgba(216,196,192,.18);
  background: var(--w37-dark-page) !important;
}
.task-shell :is(.collection-panel,.task-panel) { border-color: rgba(216,196,192,.16) !important; background-color: rgba(25,19,23,.9) !important; }
.task-shell .task-brief { border: 0 !important; background: transparent !important; }
.escape {
  --gold: var(--w37-rose-soft);
  --muted: var(--w37-muted-light);
  --line: rgba(216,196,192,.18);
  background: var(--w37-dark-page) !important;
}
.escape::after { background: linear-gradient(180deg,rgba(18,13,17,.2),rgba(18,13,17,.38) 48%,#0f0c0e 88%) !important; }
.escape .escape-head,
.escape .escape-footer { background-color: rgba(20,15,18,.92) !important; }
.escape .message { border-color: rgba(216,196,192,.14) !important; background: rgba(255,249,247,.07) !important; }
.escape .message.you { background: rgba(143,100,104,.3) !important; }

.vlog-shell {
  --paper: var(--w37-ink);
  --muted: var(--w37-muted-dark);
  --gold: var(--w37-rose);
  --line: var(--w37-light-line);
  background: var(--w37-light-page) !important;
  color: var(--w37-ink) !important;
}
.vlog-shell :is(.memory-preview,.vlog-card,.scene-input,.source-option) { border-color: var(--w37-light-line) !important; background: var(--w37-light-card) !important; color: var(--w37-ink) !important; }
.vlog-shell textarea { border-color: var(--w37-light-line) !important; background: rgba(255,255,255,.72) !important; color: var(--w37-ink) !important; }
.vlog-shell .generate-bar { border-color: var(--w37-light-line) !important; background: rgba(247,241,239,.9) !important; }
.vlog-shell .title-copy h1 { color: var(--w37-ink) !important; }
.vlog-shell .memory-preview > p,
.vlog-shell .scene-input > span,
.vlog-shell .source-option small { color: #6f6267 !important; }
.vlog-shell .scene-suggestions button,
.vlog-shell .source-option strong { color: var(--w37-ink) !important; }
.vlog-shell .source-option.is-selected { background: linear-gradient(145deg,#f2e5e3,#e4d0cf) !important; color: var(--w37-ink) !important; }

body:has(.outside-nav) { background: linear-gradient(180deg,#f5efed,#e6d9d7) !important; }
.outside-nav { border-color: var(--w37-light-line) !important; background: var(--w37-light-page) !important; color: var(--w37-ink) !important; }
.outside-nav > .nav-inner > p,
.outside-nav .reset { color: var(--w37-muted-dark) !important; }
.outside-nav .nav-group h2 { color: var(--w37-rose-deep) !important; }
.outside-nav .nav-grid button { border-color: var(--w37-light-line) !important; background: rgba(255,255,255,.54) !important; color: var(--w37-ink) !important; box-shadow: inset 0 1px rgba(255,255,255,.85); }
.outside-nav .nav-grid button:hover,
.outside-nav .nav-grid button:focus-visible,
.outside-nav .nav-grid button.active { border-color: rgba(143,100,104,.42) !important; background: rgba(143,100,104,.14) !important; }

@media (prefers-reduced-motion: reduce) {
  .w37-action,
  .w37-quick-action { transition-duration: .01ms !important; }
  .w37-action:active,
  .w37-quick-action:active { transform: none; }
}
