/* Olli visual shell + one-screen home + standard bottom tab bar.
 * Ownership: final Clarity micro-surfaces that are visible across Olli, plus the
 * home viewport and persistent non-dialog tab bar. The goal is restrained depth:
 * comfortable touch areas, light visual footprints, and one consistent radius/shadow language.
 */

[data-screen="home"] {
  --home-ink: var(--color-text-primary, #242522);
  --home-muted: var(--color-text-secondary, #77746b);
  --home-primary: var(--color-primary, #3f503b);
  --home-accent: var(--color-accent, #ddb64c);
  --home-border: var(--color-border, #dacdba);
  --home-surface: var(--color-surface-elevated, #fffcf7);
  --home-soft: var(--color-surface, #efe6d8);
  --home-bg: var(--color-bg, #f8f5ef);
  --home-shadow: rgba(85, 65, 36, 0.055);
  min-height: 0;
  background: var(--home-bg);
}

.olli-home-header {
  position: relative;
  top: auto;
  z-index: 20;
  flex: 0 0 auto;
  min-height: 56px;
  padding: 10px 16px;
}

.olli-home-header .header-right {
  gap: 8px;
}

[data-screen="home"] .content {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  align-items: stretch;
  padding: 0 0 calc(68px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(circle at 50% 5%, rgba(255, 255, 255, 0.9), transparent 30%),
    radial-gradient(circle at 80% 14%, rgba(221, 182, 76, 0.055), transparent 24%),
    radial-gradient(circle at 18% 38%, rgba(63, 80, 59, 0.035), transparent 26%);
}

[data-screen="home"] .main.olli-home-shell {
  width: min(100%, 900px);
  max-width: 900px;
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  padding: clamp(8px, 1.6dvh, 16px) clamp(13px, 3vw, 26px) clamp(8px, 1.4dvh, 14px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

/* The overview is one screen. Long-form explanation belongs to the dedicated tabs. */
.olli-home-example,
.olli-home-section,
.olli-home-final {
  display: none;
}

.olli-home-start {
  width: min(100%, 720px);
  min-height: 0;
  margin: 0 auto;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(7px, 1.35dvh, 13px);
  padding: 0;
}

.olli-home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--home-primary) 10%, var(--home-border));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--home-primary);
  font-size: 10px;
  font-weight: 720;
  line-height: 1;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.olli-home-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--home-accent) 78%, var(--home-primary));
  box-shadow: 0 0 0 3px rgba(221, 182, 76, 0.09);
}

.olli-home-title {
  max-width: 690px;
  margin: 0;
  color: var(--home-ink);
  font-size: clamp(30px, 5.7vw, 50px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

.olli-home-title em {
  color: var(--home-primary);
  font-style: normal;
  font-weight: inherit;
}

.olli-home-lead {
  max-width: 590px;
  margin: 0;
  color: var(--home-muted);
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.48;
  text-wrap: balance;
}

.olli-home-voice-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: clamp(1px, 0.7dvh, 6px) 0 0;
}

.olli-home-mic {
  position: relative;
  width: clamp(88px, 12dvh, 112px);
  height: clamp(88px, 12dvh, 112px);
  min-width: 88px;
  min-height: 88px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--home-primary) 24%, var(--home-border));
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,0.9), transparent 30%),
    linear-gradient(145deg, color-mix(in srgb, var(--home-soft) 54%, white), color-mix(in srgb, var(--home-primary) 6%, var(--home-bg)));
  color: var(--home-primary);
  cursor: pointer;
  box-shadow:
    0 11px 30px rgba(63, 80, 59, 0.075),
    0 0 0 8px rgba(63, 80, 59, 0.025),
    inset 0 1px 0 rgba(255,255,255,0.94);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.olli-home-mic::after {
  content: "";
  position: absolute;
  inset: -9px;
  border: 1px solid color-mix(in srgb, var(--home-primary) 13%, transparent);
  border-radius: 50%;
  opacity: 0.48;
  animation: olliHomeMicPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.olli-home-mic svg {
  width: clamp(38px, 5.6dvh, 48px);
  height: clamp(38px, 5.6dvh, 48px);
  stroke: currentColor;
  stroke-width: 1.55;
}

.olli-home-mic:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--home-primary) 38%, var(--home-border));
  box-shadow:
    0 15px 34px rgba(63, 80, 59, 0.095),
    0 0 0 9px rgba(63, 80, 59, 0.03),
    inset 0 1px 0 rgba(255,255,255,0.96);
}

.olli-home-mic:active { transform: translateY(0) scale(0.985); }

.olli-home-mic.rec {
  border-color: color-mix(in srgb, var(--home-primary) 68%, var(--home-accent));
  background:
    radial-gradient(circle at 35% 26%, rgba(255,255,255,0.82), transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--home-primary) 14%, white), color-mix(in srgb, var(--home-primary) 20%, var(--home-bg)));
  box-shadow:
    0 14px 34px rgba(63, 80, 59, 0.13),
    0 0 0 9px rgba(63, 80, 59, 0.055),
    inset 0 1px 0 rgba(255,255,255,0.92);
}

.olli-home-mic.rec::after {
  animation-duration: 1.3s;
  border-color: color-mix(in srgb, var(--home-primary) 40%, transparent);
}

.olli-home-mic.unavailable {
  opacity: 0.48;
  filter: saturate(0.55);
}

.olli-home-mic-hint {
  min-height: 17px;
  color: var(--home-primary);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.3;
}
.olli-home-mic-timer {
  min-height: 15px;
  color: var(--home-muted);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

@keyframes olliHomeMicPulse {
  0%, 100% { transform: scale(0.99); opacity: 0.44; }
  50% { transform: scale(1.045); opacity: 0.10; }
}

.olli-home-entry {
  width: min(100%, 650px);
  display: grid;
  gap: 5px;
  margin-top: 0;
}

.olli-home-input-label {
  color: var(--home-muted);
  font-size: 11.5px;
  line-height: 1.25;
  text-align: left;
}

.olli-home-input-wrap {
  min-height: 58px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 7px 6px 12px;
  border: 1px solid color-mix(in srgb, var(--home-primary) 12%, var(--home-border));
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.83);
  box-shadow: 0 6px 18px var(--home-shadow), inset 0 1px 0 rgba(255,255,255,0.94);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.olli-home-input-wrap:focus-within {
  border-color: color-mix(in srgb, var(--home-primary) 31%, var(--home-border));
  background: var(--home-surface);
  box-shadow: 0 8px 20px rgba(63, 80, 59, 0.07), 0 0 0 2px rgba(63,80,59,0.035);
}

.olli-home-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 104px;
  padding: 10px 5px 8px;
  border: 0;
  outline: 0;
  resize: none;
  overflow-y: auto;
  background: transparent;
  color: var(--home-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.olli-home-input::placeholder {
  color: color-mix(in srgb, var(--home-muted) 72%, transparent);
}

.olli-home-send {
  width: 46px;
  height: 46px;
  min-width: 46px;
  flex: 0 0 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--home-primary) 88%, black);
  border-radius: 13px;
  background: var(--home-primary);
  color: var(--home-bg);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(63,80,59,0.1);
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.olli-home-send:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(63,80,59,0.14); }
.olli-home-send:active { transform: translateY(0); }
.olli-home-send svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.8; }

.olli-home-starters {
  width: min(100%, 650px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.olli-home-starter {
  min-height: 46px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--home-border) 66%, white);
  border-radius: 12px;
  background: rgba(255,255,255,0.39);
  color: color-mix(in srgb, var(--home-ink) 92%, var(--home-muted));
  font: inherit;
  font-size: 12px;
  font-weight: 480;
  line-height: 1.28;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.olli-home-starter:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--home-primary) 22%, var(--home-border));
  background: rgba(255,255,255,0.68);
  color: var(--home-primary);
}

.olli-home-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  color: var(--home-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.olli-home-trust span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.olli-home-trust span::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--home-primary) 54%, var(--home-accent));
}

.olli-home-mic:focus-visible,
.olli-home-send:focus-visible,
.olli-home-starter:focus-visible,
#bottomNav .nav-item:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--home-accent) 44%, transparent);
  outline-offset: 3px;
}

/* Standard fixed tab bar. The chat keeps its dedicated composer/navigation behavior. */
#bottomNav {
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(100%, 960px);
  min-height: 64px;
  padding: 4px 8px env(safe-area-inset-bottom, 0px);
  transform: translateX(-50%);
  border-top: 1px solid color-mix(in srgb, var(--home-border) 64%, white);
  background: rgba(248, 245, 239, 0.94);
  -webkit-backdrop-filter: blur(18px) saturate(1.03);
  backdrop-filter: blur(18px) saturate(1.03);
  box-shadow: 0 -5px 18px rgba(85, 65, 36, 0.045);
  color: var(--home-muted, #77746b);
}

#bottomNav .nav-item {
  position: relative;
  min-width: 0;
  min-height: 56px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: color-mix(in srgb, var(--home-muted, #77746b) 88%, transparent);
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 620;
  line-height: 1.1;
  letter-spacing: 0.025em;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

#bottomNav .nav-item:hover {
  background: rgba(63, 80, 59, 0.035);
  color: var(--home-primary, #3f503b);
}

#bottomNav .nav-item:active {
  transform: scale(0.985);
}

#bottomNav .nav-icon {
  margin-bottom: 0;
  opacity: 0.66;
}

#bottomNav .nav-icon svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.65;
}

#bottomNav .nav-icon svg path:first-child {
  fill: none;
}

#bottomNav .nav-item.active {
  color: var(--home-primary, #3f503b);
  background: rgba(63, 80, 59, 0.032);
}

#bottomNav .nav-item.active::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 50%;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--home-primary, #3f503b) 70%, var(--home-accent, #ddb64c));
  opacity: 0.7;
}

#bottomNav .nav-item.active .nav-icon {
  opacity: 0.94;
  filter: none;
}

/* The markup starts with .hidden so no stale tab bar flashes over the onboarding.
 * Once the real home screen is active, CSS exposes the standard bar immediately;
 * normal switchScreen() behavior continues to own all later screen changes.
 */
body:has(.screen[data-screen="home"].active) #bottomNav.hidden:not(.dialog-nav-popover) {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Shared Clarity refinement: keep touch targets generous while the visible controls stay light. */
html[data-ally-interface="clarity"] #dialogMessages .msg-who {
  color: color-mix(in srgb, var(--color-text-secondary) 82%, transparent);
  font-size: 11.5px;
  font-weight: 520;
  letter-spacing: 0.01em;
}

html[data-ally-interface="clarity"] #dialogMessages .bubble {
  border-color: color-mix(in srgb, var(--color-border) 66%, transparent) !important;
  border-radius: 18px;
  padding: 13px 15px;
  line-height: 1.52;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.52),
    0 4px 14px rgba(85, 65, 36, 0.038) !important;
}

html[data-ally-interface="clarity"] #dialogMessages .msg.ally .bubble {
  background: color-mix(in srgb, var(--color-ally-bubble) 82%, var(--color-surface-elevated)) !important;
  border-top-left-radius: 7px;
}

html[data-ally-interface="clarity"] #dialogMessages .msg.user .bubble {
  background: color-mix(in srgb, var(--color-user-bubble) 88%, var(--color-surface-elevated)) !important;
  border-top-right-radius: 7px;
}

html[data-ally-interface="clarity"] #dialogMessages .message-actions {
  gap: 2px 5px;
}

html[data-ally-interface="clarity"] #dialogMessages .message-reactions {
  min-height: 44px;
  margin-top: 1px;
  padding-left: 0;
  gap: 2px;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn {
  width: 44px;
  height: 44px;
  border: 0 !important;
  border-radius: 13px;
  background: transparent !important;
  color: color-mix(in srgb, var(--color-primary) 78%, var(--color-text-secondary)) !important;
  box-shadow: none !important;
  opacity: 0.84;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn {
  top: -10px;
  right: -10px;
}

html[data-ally-interface="clarity"] #dialogMessages .msg.user .copy-message-btn {
  right: auto;
  left: -10px;
  background: transparent !important;
}

html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn {
  right: -10px;
  bottom: -10px;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn::before,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid color-mix(in srgb, var(--color-border) 62%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-surface-elevated) 72%, transparent);
  box-shadow: 0 3px 10px rgba(85, 65, 36, 0.04), inset 0 1px 0 rgba(255,255,255,0.68);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn svg,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn svg {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn:hover::before,
html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn:focus-visible::before,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn:hover::before,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn:focus-visible::before {
  border-color: color-mix(in srgb, var(--color-primary) 24%, var(--color-border));
  background: color-mix(in srgb, var(--color-surface-elevated) 92%, var(--color-surface));
  transform: translateY(-1px);
}

html[data-ally-interface="clarity"] #dialogMessages .voice-stop-btn {
  min-height: 44px;
  height: 44px;
  bottom: -10px;
  right: 34px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, #8e443b 72%, var(--color-text-secondary));
  box-shadow: none;
  font-size: 11px;
  font-weight: 560;
}

html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: color-mix(in srgb, var(--color-text-secondary) 68%, transparent);
  font-size: 17px;
  box-shadow: none;
}

html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn:hover,
html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn:focus-visible {
  background: color-mix(in srgb, #d8889b 5%, transparent);
  color: color-mix(in srgb, #b96e82 72%, var(--color-primary));
}

html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn.liked {
  color: #b96e82;
  transform: none;
}

html[data-ally-interface="clarity"] .dialog-input-area {
  border-top-color: color-mix(in srgb, var(--color-border) 54%, transparent);
  box-shadow: 0 -5px 18px rgba(85, 65, 36, 0.035);
}

html[data-ally-interface="clarity"] .dialog-input-wrapper,
html[data-ally-interface="clarity"] .dialog-input-wrapper.always-glow {
  border-color: color-mix(in srgb, var(--color-border) 72%, transparent) !important;
  border-radius: 18px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.62),
    0 5px 18px rgba(85, 65, 36, 0.045) !important;
}

html[data-ally-interface="clarity"] .dialog-input-wrapper:focus-within,
html[data-ally-interface="clarity"] .dialog-input-wrapper.always-glow:focus-within {
  border-color: color-mix(in srgb, var(--color-primary) 26%, var(--color-border)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.68),
    0 7px 20px rgba(63, 80, 59, 0.055) !important;
}

html[data-ally-interface="clarity"] .chat-switch-btn,
html[data-ally-interface="clarity"] .decision-card-action-btn,
html[data-ally-interface="clarity"] .voice-toggle,
html[data-ally-interface="clarity"] .dialog-mic-btn {
  border-color: color-mix(in srgb, var(--color-primary) 12%, var(--color-border)) !important;
  background: color-mix(in srgb, var(--color-surface-elevated) 58%, var(--color-surface)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.58) !important;
}

html[data-ally-interface="clarity"] .chat-switch-btn,
html[data-ally-interface="clarity"] .decision-card-action-btn,
html[data-ally-interface="clarity"] .voice-toggle,
html[data-ally-interface="clarity"] .dialog-mic-btn,
html[data-ally-interface="clarity"] .dialog-send-btn {
  border-radius: 11px !important;
}

html[data-ally-interface="clarity"] .chat-switch-label,
html[data-ally-interface="clarity"] .decision-card-action-btn span:not(.matrix-tooltip) {
  font-weight: 590;
}

html[data-ally-interface="clarity"] .chat-btn-count {
  box-shadow: none !important;
  border-color: color-mix(in srgb, var(--color-surface-elevated) 82%, transparent) !important;
}

@media (max-width: 520px) {
  .olli-home-header {
    min-height: 52px;
    padding: 8px 13px;
  }

  .olli-home-header .ally-interface-toggle,
  .olli-home-header .sub-status {
    display: none;
  }

  [data-screen="home"] .main.olli-home-shell {
    padding-inline: 13px;
  }

  .olli-home-title {
    font-size: clamp(30px, 9vw, 40px);
  }

  .olli-home-lead {
    font-size: 14px;
    line-height: 1.42;
  }

  .olli-home-starter {
    font-size: 11.5px;
    padding-inline: 9px;
  }

  #bottomNav {
    padding-inline: 5px;
  }

  #bottomNav .nav-item {
    border-radius: 11px;
    font-size: 9.25px;
  }
}

@media (max-width: 360px) {
  .olli-home-kicker,
  .olli-home-trust {
    display: none;
  }

  .olli-home-title {
    font-size: 30px;
    line-height: 1.01;
  }

  .olli-home-lead {
    font-size: 13.5px;
  }

  .olli-home-mic {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
  }

  .olli-home-mic svg {
    width: 36px;
    height: 36px;
  }

  .olli-home-starters {
    gap: 6px;
  }

  .olli-home-starter {
    min-height: 44px;
    font-size: 11px;
    line-height: 1.22;
  }

  #bottomNav .nav-item {
    font-size: 8.75px;
  }

  #bottomNav .nav-icon svg {
    width: 19px;
    height: 19px;
  }
}

@media (max-height: 740px) {
  .olli-home-start {
    gap: 7px;
  }

  .olli-home-kicker {
    min-height: 25px;
  }

  .olli-home-title {
    font-size: clamp(28px, 5.2vw, 42px);
  }

  .olli-home-lead {
    line-height: 1.38;
  }

  .olli-home-mic {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
  }

  .olli-home-mic svg {
    width: 36px;
    height: 36px;
  }

  .olli-home-input-wrap {
    min-height: 56px;
  }
}

@media (max-height: 650px) {
  .olli-home-kicker,
  .olli-home-trust,
  .olli-home-input-label {
    display: none;
  }

  .olli-home-title {
    font-size: 28px;
  }

  .olli-home-lead {
    font-size: 13px;
  }

  .olli-home-starter:nth-child(n + 3) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .olli-home-mic::after {
    animation: none;
  }

  .olli-home-mic,
  .olli-home-send,
  .olli-home-starter,
  #bottomNav .nav-item,
  html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn::before,
  html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn::before {
    transition: none;
  }
}


/* CUMULATIVE CHAT POLISH v3
 * Additive release layer: preserves shipped behavior while refining dialog surfaces.
 */
html[data-ally-interface="clarity"] #dialogMessages {
  gap: 16px;
}

html[data-ally-interface="clarity"] #dialogMessages .msg-who {
  color: color-mix(in srgb, var(--color-text-secondary) 90%, transparent);
  font-size: 12px;
  font-weight: 570;
}

html[data-ally-interface="clarity"] #dialogMessages .bubble {
  padding: 14px 16px;
  border-color: color-mix(in srgb, var(--color-border) 50%, transparent) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 1px 2px rgba(85, 65, 36, 0.024),
    0 8px 24px rgba(85, 65, 36, 0.034) !important;
}

html[data-ally-interface="clarity"] #dialogMessages .msg.ally .bubble {
  border-radius: 20px 20px 20px 8px;
  background: color-mix(in srgb, var(--color-ally-bubble) 88%, var(--color-surface-elevated)) !important;
}

html[data-ally-interface="clarity"] #dialogMessages .msg.user .bubble {
  border-radius: 20px 20px 8px 20px;
  background: color-mix(in srgb, var(--color-user-bubble) 92%, var(--color-surface-elevated)) !important;
}

html[data-ally-interface="clarity"] #dialogMessages .message-actions {
  min-height: 44px;
  margin-top: 2px;
  align-items: center;
  gap: 0;
}

html[data-ally-interface="clarity"] #dialogMessages .message-reactions {
  min-height: 44px;
  margin-top: 0;
  align-items: center;
  gap: 2px;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn {
  position: relative;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  opacity: 0.76;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn::before,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn::before {
  inset: 7px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn:hover::before,
html[data-ally-interface="clarity"] #dialogMessages .copy-message-btn:focus-visible::before,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn:hover::before,
html[data-ally-interface="clarity"] #dialogMessages .voice-replay-btn:focus-visible::before {
  border-color: color-mix(in srgb, var(--color-primary) 16%, var(--color-border));
  background: color-mix(in srgb, var(--color-surface-elevated) 76%, var(--color-surface));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.64);
}

html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn {
  border-radius: 12px;
  opacity: 0.78;
}

html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn:hover,
html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn:focus-visible,
html[data-ally-interface="clarity"] #dialogMessages .heart-feedback-btn.liked {
  opacity: 1;
}

@media (max-width: 520px) {
  html[data-ally-interface="clarity"] #dialogMessages {
    gap: 14px;
  }

  html[data-ally-interface="clarity"] #dialogMessages .bubble {
    padding: 12px 14px;
    line-height: 1.5;
  }

  html[data-ally-interface="clarity"] #dialogMessages .msg.ally .bubble {
    border-radius: 18px 18px 18px 7px;
  }

  html[data-ally-interface="clarity"] #dialogMessages .msg.user .bubble {
    border-radius: 18px 18px 7px 18px;
  }
}

/* HOME COSMETIC PASS — 2026-09-10
 * One shared composition for web, PWA and mini app. Only density changes at small heights.
 */
[data-screen="home"] .content {
  background:
    radial-gradient(circle at 18% 3%, color-mix(in srgb, var(--home-accent) 11%, transparent), transparent 24%),
    radial-gradient(circle at 86% 7%, color-mix(in srgb, #d8889b 6%, transparent), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,255,255,0.12) 46%, transparent 72%),
    var(--home-bg);
}

.olli-home-start::before {
  content: "";
  width: 54px;
  height: 12px;
  flex: 0 0 12px;
  background:
    radial-gradient(circle at 12% 56%, color-mix(in srgb, var(--home-accent) 72%, var(--home-primary)) 0 1.5px, transparent 1.8px),
    radial-gradient(circle at 50% 30%, color-mix(in srgb, #b96e82 54%, var(--home-accent)) 0 2px, transparent 2.3px),
    radial-gradient(circle at 88% 56%, color-mix(in srgb, var(--home-accent) 72%, var(--home-primary)) 0 1.5px, transparent 1.8px);
  opacity: 0.78;
}

.olli-home-kicker {
  border-color: color-mix(in srgb, var(--home-accent) 38%, var(--home-border));
  background: color-mix(in srgb, var(--home-accent) 7%, var(--home-surface));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.olli-home-title {
  max-width: 660px;
  line-height: 1.06;
}

.olli-home-title em {
  text-shadow: none;
}

.olli-home-lead {
  max-width: 570px;
  color: color-mix(in srgb, var(--home-muted) 94%, var(--home-ink));
}

.olli-home-voice-stage {
  margin-top: clamp(2px, 0.8dvh, 7px);
}

.olli-home-mic {
  border-color: color-mix(in srgb, var(--home-primary) 30%, var(--home-border));
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,0.98), transparent 31%),
    linear-gradient(145deg, color-mix(in srgb, var(--home-surface) 78%, white), color-mix(in srgb, var(--home-primary) 7%, var(--home-bg)));
  box-shadow:
    0 10px 28px rgba(63,80,59,0.075),
    0 0 0 9px rgba(63,80,59,0.018),
    inset 0 1px 0 rgba(255,255,255,0.98);
}

.olli-home-mic-hint {
  font-weight: 690;
  letter-spacing: -0.01em;
}

.olli-home-input-wrap {
  border-color: color-mix(in srgb, var(--home-primary) 16%, var(--home-border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--home-surface) 91%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.92),
    0 6px 18px rgba(85,65,36,0.04);
}

.olli-home-input::placeholder {
  color: var(--home-muted);
}

.olli-home-starters {
  gap: 8px;
}

.olli-home-starter {
  position: relative;
  min-height: 48px;
  padding: 9px 28px 9px 12px;
  border-color: color-mix(in srgb, var(--home-primary) 9%, var(--home-border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--home-surface) 64%, transparent);
  font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.olli-home-starter::after {
  content: "›";
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-52%);
  color: color-mix(in srgb, var(--home-primary) 66%, var(--home-muted));
  font-size: 18px;
  font-weight: 450;
  line-height: 1;
  opacity: 0.72;
}

.olli-home-starter:hover::after,
.olli-home-starter:focus-visible::after {
  opacity: 1;
}

.olli-home-trust {
  width: min(100%, 650px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 1px;
  color: var(--home-primary);
}

.olli-home-trust span {
  min-width: 0;
  min-height: 39px;
  justify-content: center;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: color-mix(in srgb, var(--home-primary) 88%, var(--home-muted));
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.18;
  text-align: center;
  box-shadow: none;
}

.olli-home-trust span::before {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  background: color-mix(in srgb, var(--home-accent) 72%, var(--home-primary));
  box-shadow: 0 0 0 3px rgba(221,182,76,0.055);
}

@media (max-width: 520px) {
  .olli-home-start::before {
    width: 46px;
    height: 10px;
    flex-basis: 10px;
  }

  .olli-home-starter {
    min-height: 46px;
    padding: 8px 24px 8px 10px;
  }

  .olli-home-starter::after {
    right: 9px;
  }

  .olli-home-trust {
    gap: 6px;
  }

  .olli-home-trust span {
    min-height: 37px;
    padding: 6px 5px;
    border-radius: 12px;
    font-size: 9.9px;
  }
}

@media (max-height: 650px) and (min-width: 361px) {
  .olli-home-start {
    gap: 5px;
  }

  .olli-home-start::before,
  .olli-home-kicker,
  .olli-home-input-label {
    display: none;
  }

  .olli-home-voice-stage {
    margin-top: 1px;
  }

  .olli-home-mic {
    width: 78px;
    height: 78px;
    min-width: 78px;
    min-height: 78px;
  }

  .olli-home-mic svg {
    width: 33px;
    height: 33px;
  }

  .olli-home-starter {
    min-height: 42px;
    padding-block: 6px;
  }

  .olli-home-trust {
    display: grid;
    gap: 5px;
    margin-top: 0;
  }

  .olli-home-trust span {
    min-height: 32px;
    padding: 4px 4px;
    border-radius: 10px;
    font-size: 9.2px;
    line-height: 1.12;
  }

  .olli-home-trust span::before {
    width: 4px;
    height: 4px;
    flex-basis: 4px;
    box-shadow: none;
  }
}

@media (max-width: 360px) {
  .olli-home-trust {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .olli-home-starter::after {
    transition: none;
  }
}
