/* Persistent Kē rebrand shell. The current /app chrome remains untouched. */
.ke-rebrand-shell-header { display: none; }

html.ke-rebrand-mode #app {
  background: #10242d !important;
}

html.ke-rebrand-mode .ke-rebrand-shell-header {
  align-items: center;
  background: rgba(16,36,45,.985);
  border-bottom: 1px solid rgba(215,181,109,.24);
  color: #fffaf2;
  display: grid !important;
  flex: 0 0 auto;
  grid-template-columns: 48px minmax(0,1fr) 48px;
  min-height: 66px;
  padding: 8px clamp(14px,3.3vw,20px);
  position: relative;
  width: 100%;
  z-index: 240;
}

html.ke-rebrand-mode .ke-rebrand-shell-action {
  align-items: center;
  appearance: none;
  background:
    radial-gradient(circle at 50% 32%, rgba(255,255,255,.11), transparent 48%),
    linear-gradient(145deg,#263f4b,#122933 64%,#091a21);
  border: 1px solid rgba(215,181,109,.62);
  border-radius: 50%;
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,.16),
    inset 0 -7px 13px rgba(0,0,0,.25),
    0 5px 14px rgba(0,0,0,.24),
    0 0 12px rgba(215,181,109,.1);
  color: #f1dca7;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  position: relative;
  text-decoration: none;
  width: 44px;
}

html.ke-rebrand-mode .ke-rebrand-shell-action::before {
  background: linear-gradient(180deg,rgba(255,255,255,.2),rgba(255,255,255,.055) 38%,transparent 68%);
  border-radius: 50%;
  content: '';
  inset: 2px 4px 10px;
  pointer-events: none;
  position: absolute;
  transform: translateY(2px);
}

html.ke-rebrand-mode .ke-rebrand-shell-home { justify-self: start; }
html.ke-rebrand-mode .ke-rebrand-shell-home svg {
  fill: none;
  height: 23px;
  position: relative;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 23px;
  z-index: 1;
}

html.ke-rebrand-mode .ke-rebrand-shell-wordmark {
  align-items: center;
  display: flex;
  gap: clamp(7px,1.6vw,10px);
  justify-self: center;
  max-width: min(100%,210px);
  min-width: 0;
}
html.ke-rebrand-mode .ke-rebrand-shell-wordmark img {
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.28));
  object-fit: contain;
}
html.ke-rebrand-mode .ke-rebrand-shell-ke-logo {
  flex: 0 0 auto;
  height: 30px;
  width: 43px;
}
html.ke-rebrand-mode .ke-rebrand-shell-by {
  color: rgba(255,250,242,.78);
  flex: 0 0 auto;
  font-family: 'Playfair Display',serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  line-height: 1;
  transform: translateY(1px);
}
html.ke-rebrand-mode .ke-rebrand-shell-karamo-logo {
  flex: 1 1 auto;
  height: 38px;
  max-width: 130px;
  min-width: 0;
  transform: translateY(2px);
  width: auto;
}

html.ke-rebrand-mode .ke-rebrand-shell-keepers-logo {
  display: none !important;
  height: auto;
  max-height: 44px;
  width: min(100%,160px);
}

html.ke-rebrand-mode body.ke-community-open .ke-rebrand-shell-wordmark {
  max-width: min(100%,180px);
}
html.ke-rebrand-mode body.ke-community-open .ke-rebrand-shell-ke-logo,
html.ke-rebrand-mode body.ke-community-open .ke-rebrand-shell-by,
html.ke-rebrand-mode body.ke-community-open .ke-rebrand-shell-karamo-logo {
  display: none;
}
html.ke-rebrand-mode body.ke-community-open .ke-rebrand-shell-keepers-logo {
  display: block !important;
}

html.ke-rebrand-mode .ke-rebrand-shell-profile { justify-self: end; }
html.ke-rebrand-mode .ke-rebrand-shell-profile > span {
  align-items: center;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-radius: inherit;
  color: #fffaf2;
  display: flex;
  font-family: 'Playfair Display',serif;
  font-size: 14px;
  font-weight: 700;
  height: 100%;
  justify-content: center;
  letter-spacing: .02em;
  position: relative;
  width: 100%;
  z-index: 1;
}

html.ke-rebrand-mode .ke-rebrand-shell-action:hover,
html.ke-rebrand-mode .ke-rebrand-shell-action:focus-visible {
  border-color: rgba(255,241,199,.9);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.2),0 7px 18px rgba(0,0,0,.28),0 0 0 3px rgba(215,181,109,.12);
  transform: translateY(-1px);
}

html.ke-rebrand-mode #scr-dashboard .ke-dashboard-main {
  display: flex;
  flex-direction: column;
  position: relative;
}
html.ke-rebrand-mode #scr-dashboard .ke-dashboard-tools { flex: 1 1 auto; }

/* Existing page bars become quiet content headings below the persistent shell.
   Profile shortcuts, Flame counts, and bells no longer compete with it. */
html.ke-rebrand-mode :is(.ke-journal-header,.ke-library-header,.ke-resources-header,.mp-plan-header) {
  background: rgba(16,36,45,.96) !important;
  border-bottom: 1px solid rgba(215,181,109,.14) !important;
  box-shadow: none !important;
  min-height: 54px !important;
  padding: 8px clamp(14px,3vw,20px) !important;
  position: relative !important;
  top: auto !important;
  z-index: 20;
}
html.ke-rebrand-mode :is(.ke-journal-brand,.ke-library-profile-initials,.ke-resources-profile-initials,.mp-plan-profile) {
  display: none !important;
}
html.ke-rebrand-mode :is(.ke-library-header-actions,.ke-resources-header-actions,.mp-plan-header-actions) {
  display: none !important;
}
html.ke-rebrand-mode :is(.ke-library-brand,.ke-resources-brand) {
  cursor: default;
  pointer-events: none;
}

/* Profile is a page within the shell, so Home and the footer stay available. */
html.ke-rebrand-mode #screen-area > #profile-overlay.ke-profile-overlay {
  inset: 0 !important;
  position: absolute !important;
}

@media (max-width:420px) {
  html.ke-rebrand-mode .ke-rebrand-shell-header {
    grid-template-columns: 44px minmax(0,1fr) 44px;
    min-height: 62px;
    padding: 7px 13px;
  }
  html.ke-rebrand-mode .ke-rebrand-shell-action { height: 40px; width: 40px; }
  html.ke-rebrand-mode .ke-rebrand-shell-home svg { height: 21px; width: 21px; }
  html.ke-rebrand-mode .ke-rebrand-shell-wordmark { gap: 7px; max-width: 190px; }
  html.ke-rebrand-mode .ke-rebrand-shell-ke-logo { height: 27px; width: 39px; }
  html.ke-rebrand-mode .ke-rebrand-shell-by { font-size: 12px; }
  html.ke-rebrand-mode .ke-rebrand-shell-karamo-logo { height: 34px; max-width: 116px; }
  html.ke-rebrand-mode .ke-rebrand-shell-keepers-logo { max-height: 40px; width: min(100%,150px); }
}

@media (max-width:340px) {
  html.ke-rebrand-mode .ke-rebrand-shell-header {
    grid-template-columns: 40px minmax(0,1fr) 40px;
    padding-inline: 9px;
  }
  html.ke-rebrand-mode .ke-rebrand-shell-wordmark { gap: 5px; max-width: 164px; }
  html.ke-rebrand-mode .ke-rebrand-shell-ke-logo { height: 24px; width: 35px; }
  html.ke-rebrand-mode .ke-rebrand-shell-by { font-size: 11px; }
  html.ke-rebrand-mode .ke-rebrand-shell-karamo-logo { height: 30px; max-width: 103px; }
  html.ke-rebrand-mode .ke-rebrand-shell-keepers-logo { max-height: 36px; width: min(100%,136px); }
}

/* Ask Karamo grows out of the persistent center portrait. The shell rails stay
   fixed while the choice surface occupies only the page space between them. */
html.ke-rebrand-mode body #ke-talk-chooser {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  bottom: calc(76px + env(safe-area-inset-bottom)) !important;
  left: 0 !important;
  padding: 0 !important;
  right: 0 !important;
  top: 66px !important;
  z-index: 190 !important;
}

/* Ask Karamo is modeless: the persistent app rails remain real navigation,
   even if a browser reports a slightly different safe-area height. */
html.ke-rebrand-mode body.ke-talk-surface-open .ke-rebrand-shell-header,
html.ke-rebrand-mode body.ke-talk-surface-open #tab-bar {
  pointer-events: auto !important;
  z-index: 240 !important;
}

html.ke-rebrand-mode body #ke-talk-chooser .ke-talk-chooser-backdrop {
  background: rgba(7, 23, 30, .96) !important;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-card {
  background:
    radial-gradient(circle at 50% 34%, rgba(215,181,109,.12), transparent 38%),
    linear-gradient(180deg, #102832, #0a1f27 72%) !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 100% !important;
  max-height: none !important;
  max-width: none !important;
  overflow: hidden !important;
  padding: 0 !important;
  width: 100% !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-overlay[data-ke-talk-surface="choice"] > .ke-talk-chooser-card {
  opacity: 0;
  transform: none !important;
  transition: opacity 180ms ease !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-open[data-ke-talk-surface="choice"] > .ke-talk-chooser-card {
  opacity: 1;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-closing:not(.ke-talk-reverse-close)[data-ke-talk-surface="choice"] > .ke-talk-chooser-card {
  opacity: 0;
  transition-delay: 260ms !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-talk-reverse-close.ke-morph-closing[data-ke-talk-surface="choice"] > .ke-talk-chooser-card {
  opacity: 1 !important;
  transition: none !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view::before {
  background:
    radial-gradient(circle, rgba(215,181,109,.12), rgba(17,48,58,.12) 48%, transparent 69%),
    radial-gradient(circle, transparent 61%, rgba(215,181,109,.22) 61.5% 62%, transparent 62.5%);
  border: 1px solid rgba(215,181,109,.16);
  border-radius: 50%;
  content: '';
  height: min(92vw, 430px);
  left: 50%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 37%;
  transform: translate(-50%, -50%) scale(.28);
  width: min(92vw, 430px);
  z-index: 0;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-view::before {
  animation: keTalkBackgroundBloom 620ms 150ms cubic-bezier(.16,.82,.18,1) both;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-kicker,
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-intro {
  display: none !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view > h2 {
  left: 50%;
  line-height: 1 !important;
  margin: 0 !important;
  position: absolute;
  top: clamp(12px, 2.2dvh, 22px);
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view > h2 span,
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view > h2 strong {
  display: inline !important;
  font-size: clamp(25px, 7vw, 34px) !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view > h2 strong {
  margin-left: .22em;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-portrait {
  height: clamp(160px, min(48vw, 25dvh), 204px) !important;
  left: 50%;
  margin: 0 !important;
  opacity: 0;
  position: absolute;
  top: 37%;
  transform: translate(-50%, -50%);
  transform-origin: center;
  width: clamp(160px, min(48vw, 25dvh), 204px) !important;
  z-index: 3;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-portrait img {
  object-position: center 24%;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-chooser-portrait {
  animation: keTalkPortraitRise 620ms cubic-bezier(.16,.82,.18,1) both;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons {
  display: block !important;
  inset: 0;
  margin: 0 !important;
  max-width: none !important;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
  margin: 0 !important;
  opacity: 0;
  pointer-events: auto;
  position: absolute;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(1),
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(2) {
  height: clamp(136px, 40vw, 190px) !important;
  padding: clamp(12px, 3vw, 22px) !important;
  top: 60%;
  width: clamp(136px, 40vw, 190px) !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(1) { left: clamp(10px, 4vw, 28px); }
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(2) { right: clamp(10px, 4vw, 28px); }

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource {
  background: #0c262e !important;
  border: 1px solid rgba(215,181,109,.72) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 10px 24px rgba(0,0,0,.28) !important;
  height: 116px !important;
  left: 50%;
  padding: 10px !important;
  top: 8%;
  transform: translateX(-50%);
  width: 116px !important;
  z-index: 4;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons small {
  display: none !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons strong {
  font-size: clamp(18px, 5vw, 23px) !important;
  line-height: 1.08 !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource strong {
  font-size: 13px !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(1) {
  animation: keTalkCallBloom 560ms 310ms cubic-bezier(.16,.82,.18,1) both;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(2) {
  animation: keTalkTextBloom 560ms 350ms cubic-bezier(.16,.82,.18,1) both;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource {
  animation: keTalkHelpBloom 500ms 390ms cubic-bezier(.16,.82,.18,1) both;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-ai-note {
  bottom: 10px;
  left: 50%;
  margin: 0;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  width: min(88%, 420px);
  z-index: 4;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-close {
  height: 38px;
  right: 10px;
  top: 10px;
  width: 38px;
  z-index: 7 !important;
}

html.ke-rebrand-mode body.ke-talk-surface-open #tab-bar > .ke-talk-launcher {
  pointer-events: auto;
}

html.ke-rebrand-mode body.ke-talk-surface-open #tab-bar > .ke-talk-launcher .ke-talk-launcher-photo {
  opacity: 0 !important;
  visibility: hidden;
}

html.ke-rebrand-mode body.ke-talk-surface-open #tab-bar > .ke-talk-launcher .ke-talk-launcher-label {
  opacity: 0;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-talk-reverse-close.ke-morph-closing[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-chooser-portrait {
  animation: keTalkPortraitReturn 1000ms 1400ms cubic-bezier(.55,0,.84,.18) both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-closing:not(.ke-talk-reverse-close)[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-view::before,
html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-closing:not(.ke-talk-reverse-close)[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
  opacity: 0 !important;
  transition: opacity 150ms ease !important;
}

@keyframes keTalkPortraitRise {
  0% { opacity: 1; transform: translate(-50%, -50%) translate(var(--ke-talk-start-x, 0), var(--ke-talk-start-y, 48vh)) scale(var(--ke-talk-start-scale, .3)); }
  72% { opacity: 1; transform: translate(-50%, -50%) translate(0, -3px) scale(1.025); }
  100% { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(1); }
}

@keyframes keTalkPortraitReturn {
  from { opacity: 1; transform: translate(-50%, -50%) translate(0, 0) scale(1); }
  to { opacity: 1; transform: translate(-50%, -50%) translate(var(--ke-talk-start-x, 0), var(--ke-talk-start-y, 48vh)) scale(var(--ke-talk-start-scale, .3)); }
}

@keyframes keTalkBackgroundBloom {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.28); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes keTalkCallBloom {
  from { opacity: 0; transform: translate(72%, -115%) scale(.16); }
  to { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes keTalkTextBloom {
  from { opacity: 0; transform: translate(-72%, -115%) scale(.16); }
  to { opacity: 1; transform: translate(0, 0) scale(1); }
}

@keyframes keTalkHelpBloom {
  from { opacity: 0; transform: translate(-50%, 145%) scale(.72); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@media (max-width:420px) {
  html.ke-rebrand-mode body #ke-talk-chooser {
    bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    top: 62px !important;
  }
}

@media (max-height:700px) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-portrait {
    height: clamp(132px, 39vw, 160px) !important;
    top: 37%;
    width: clamp(132px, 39vw, 160px) !important;
  }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view::before { top: 37%; }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource {
    height: 92px !important;
    top: 8%;
    width: 92px !important;
  }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(1),
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(2) {
    height: clamp(118px, 34vw, 146px) !important;
    top: 62%;
    width: clamp(118px, 34vw, 146px) !important;
  }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-ai-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-chooser-portrait,
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-view::before,
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
    animation-delay: 0s !important;
    animation-duration: .01ms !important;
  }
}

/* Final Ask Karamo constellation. Exactly two rings share one radial gap;
   measured connectors and actions originate at the portrait center. */
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-card {
  animation: none !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-card::before,
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-card::after,
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view::before {
  animation: none !important;
  background: none !important;
  border: 0 !important;
  content: none !important;
  display: none !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view {
  --ke-talk-portrait-size: clamp(168px, min(52vw, 26dvh), 204px);
  --ke-talk-portrait-top: 42%;
  --ke-talk-ring-gap: clamp(38px, 10vw, 48px);
  --ke-talk-action-size: clamp(136px, 40vw, 190px);
  --ke-talk-resource-size: 116px;
  --ke-talk-jewel-teal: #106e78;
  --ke-talk-jewel-teal-deep: #072e35;
  --ke-talk-jewel-teal-edge: #010303;
  --ke-talk-jewel-garnet: #740e1c;
  --ke-talk-jewel-garnet-deep: #30060a;
  --ke-talk-jewel-garnet-edge: #030102;
  --ke-talk-jewel-peridot: #297b0d;
  --ke-talk-jewel-peridot-deep: #113205;
  --ke-talk-jewel-peridot-edge: #010301;
  --ke-talk-jewel-teal-surface:
    radial-gradient(circle at 38% 25%, rgba(255, 255, 255, .035), transparent 29%),
    radial-gradient(circle at 50% 42%, var(--ke-talk-jewel-teal) 0 27%, var(--ke-talk-jewel-teal-deep) 72%, var(--ke-talk-jewel-teal-edge) 100%);
  --ke-talk-jewel-garnet-surface:
    radial-gradient(circle at 38% 25%, rgba(255, 255, 255, .035), transparent 29%),
    radial-gradient(circle at 50% 42%, var(--ke-talk-jewel-garnet) 0 27%, var(--ke-talk-jewel-garnet-deep) 72%, var(--ke-talk-jewel-garnet-edge) 100%);
  --ke-talk-jewel-peridot-surface:
    radial-gradient(circle at 38% 25%, rgba(255, 255, 255, .035), transparent 29%),
    radial-gradient(circle at 50% 42%, var(--ke-talk-jewel-peridot) 0 27%, var(--ke-talk-jewel-peridot-deep) 72%, var(--ke-talk-jewel-peridot-edge) 100%);
  --ke-talk-head-duration: 1000ms;
  --ke-talk-ring-duration: 600ms;
  --ke-talk-ring-inner-delay: 1050ms;
  --ke-talk-ring-outer-delay: 1150ms;
  --ke-talk-action-delay: 1800ms;
  --ke-talk-action-duration: 1600ms;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-orbit-rings,
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-connectors {
  inset: 0;
  pointer-events: none;
  position: absolute;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-orbit-rings { z-index: 0; }

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-orbit-ring {
  border: 1px solid rgba(215, 181, 109, .28);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(215, 181, 109, .025);
  display: block;
  left: 50%;
  opacity: 0;
  position: absolute;
  top: var(--ke-talk-portrait-top);
  transform: translate(-50%, -50%) scale(.42);
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-orbit-ring--inner {
  height: calc(var(--ke-talk-portrait-size) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap));
  width: calc(var(--ke-talk-portrait-size) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap));
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-orbit-ring--outer {
  height: calc(var(--ke-talk-portrait-size) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap));
  width: calc(var(--ke-talk-portrait-size) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap) + var(--ke-talk-ring-gap));
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-orbit-ring--inner {
  animation: keTalkRingBloom var(--ke-talk-ring-duration) var(--ke-talk-ring-inner-delay) cubic-bezier(.16, .82, .18, 1) both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-orbit-ring--outer {
  animation: keTalkRingBloom var(--ke-talk-ring-duration) var(--ke-talk-ring-outer-delay) cubic-bezier(.16, .82, .18, 1) both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-connectors { z-index: 1; }

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-connector {
  background: linear-gradient(90deg, rgba(215, 181, 109, .5), rgba(215, 181, 109, .2));
  box-shadow: 0 0 7px rgba(215, 181, 109, .12);
  display: block;
  height: 1px;
  left: var(--ke-talk-line-start-x, 50%);
  opacity: 0;
  position: absolute;
  top: var(--ke-talk-line-start-y, 37%);
  transform: rotate(var(--ke-talk-line-angle, 0deg)) scaleX(0);
  transform-origin: 0 50%;
  width: var(--ke-talk-line-length, 0px);
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-connector {
  animation: keTalkConnectorDraw var(--ke-talk-action-duration) var(--ke-talk-action-delay) cubic-bezier(.16, .82, .18, 1) both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-chooser-portrait {
  box-shadow: 0 22px 54px rgba(0, 0, 0, .42) !important;
  height: var(--ke-talk-portrait-size) !important;
  top: var(--ke-talk-portrait-top) !important;
  width: var(--ke-talk-portrait-size) !important;
  z-index: 3;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-chooser-portrait {
  animation: keTalkPortraitRise var(--ke-talk-head-duration) cubic-bezier(.16, .82, .18, 1) both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons { z-index: 2; }

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
  pointer-events: none;
  transform: none;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > [data-ke-talk-mode="call"] {
  background-color: var(--ke-talk-jewel-teal) !important;
  background-image: var(--ke-talk-jewel-teal-surface) !important;
  border-color: rgba(241, 220, 167, .85) !important;
  color: #fff !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > [data-ke-talk-mode="text"] {
  background-color: var(--ke-talk-jewel-garnet) !important;
  background-image: var(--ke-talk-jewel-garnet-surface) !important;
  border-color: rgba(241, 220, 167, .85) !important;
  color: #fff !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > [data-ke-talk-mode="resources"] {
  background-color: var(--ke-talk-jewel-peridot) !important;
  background-image: none !important;
  border-color: rgba(241, 220, 167, .85) !important;
  color: #fff !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(1),
html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(2) {
  height: var(--ke-talk-action-size) !important;
  width: var(--ke-talk-action-size) !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource {
  height: var(--ke-talk-resource-size) !important;
  left: calc(50% - 58px);
  top: 9%;
  transform: none;
  width: var(--ke-talk-resource-size) !important;
  z-index: 2;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
  animation: keTalkActionBloom var(--ke-talk-action-duration) var(--ke-talk-action-delay) cubic-bezier(.16, .82, .18, 1) both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-actions-ready="true"][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
  pointer-events: auto;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-closing:not(.ke-talk-reverse-close)[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-orbit-ring,
html.ke-rebrand-mode body #ke-talk-chooser.ke-morph-closing:not(.ke-talk-reverse-close)[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-connector {
  opacity: 0 !important;
  transition: opacity 150ms ease !important;
}

/* Closing retraces the reveal: choices and their branches return first, the
   outer and inner rings contract next, and the portrait rides the tether back
   to its persistent footer origin last. */
html.ke-rebrand-mode body #ke-talk-chooser.ke-talk-reverse-close.ke-morph-closing[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
  animation: keTalkActionBloom 900ms cubic-bezier(.55, 0, .84, .18) reverse both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-talk-reverse-close.ke-morph-closing[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-choice-connector {
  animation: keTalkConnectorDraw 900ms cubic-bezier(.55, 0, .84, .18) reverse both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-talk-reverse-close.ke-morph-closing[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-orbit-ring--outer {
  animation: keTalkRingBloom 350ms 950ms cubic-bezier(.55, 0, .84, .18) reverse both !important;
}

html.ke-rebrand-mode body #ke-talk-chooser.ke-talk-reverse-close.ke-morph-closing[data-ke-talk-bloom="ready"][data-ke-talk-surface="choice"] .ke-talk-orbit-ring--inner {
  animation: keTalkRingBloom 350ms 1050ms cubic-bezier(.55, 0, .84, .18) reverse both !important;
}

@keyframes keTalkRingBloom {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.42); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes keTalkConnectorDraw {
  from { opacity: 0; transform: rotate(var(--ke-talk-line-angle, 0deg)) scaleX(0); }
  18% { opacity: 1; }
  to { opacity: 1; transform: rotate(var(--ke-talk-line-angle, 0deg)) scaleX(1); }
}

@keyframes keTalkActionBloom {
  from { opacity: 0; transform: translate(var(--ke-talk-action-start-x, 0), var(--ke-talk-action-start-y, 0)) scale(.14); }
  72% { opacity: 1; transform: translate(0, -3px) scale(1.025); }
  to { opacity: 1; transform: translate(0, 0) scale(1); }
}

@media (min-height:701px) and (max-height:820px) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view {
    --ke-talk-portrait-size: clamp(148px, min(50vw, 24dvh), 196px);
    --ke-talk-portrait-top: 44%;
    --ke-talk-resource-size: 100px;
  }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource {
    left: calc(50% - 50px);
    top: 9%;
  }
}

@media (max-height:700px) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-view {
    --ke-talk-portrait-size: clamp(112px, min(47vw, calc(68dvh - 261px)), 180px);
    --ke-talk-portrait-top: 46%;
    --ke-talk-ring-gap: clamp(24px, 8vw, 34px);
    --ke-talk-action-size: clamp(110px, 34vw, 140px);
    --ke-talk-resource-size: 72px;
  }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > .ke-talk-choice-resource {
    left: calc(50% - 36px);
    top: 12%;
  }
}

@media (min-height:620px) and (max-height:700px) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-ai-note {
    display: block;
  }
}

@media (min-width:700px) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(1) {
    left: calc(50% - 310px);
  }
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button:nth-child(2) {
    right: calc(50% - 310px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-chooser-portrait,
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-orbit-ring,
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-connector,
  html.ke-rebrand-mode body #ke-talk-chooser[data-ke-talk-bloom][data-ke-talk-surface="choice"] .ke-talk-choice-buttons > button {
    animation-delay: 0s !important;
    animation-duration: .01ms !important;
  }
}

@media (prefers-reduced-motion:reduce) {
  html.ke-rebrand-mode .ke-rebrand-shell-action { transition: none; }
}
