/* Jarvis Home — dark + gold */

:root {
  --bg: #050505;
  --bg-elevated: #0e0e0e;
  --bg-card: #141414;
  --bg-card-hover: #1a1a1a;
  --border: rgba(212, 175, 55, 0.18);
  --border-strong: rgba(212, 175, 55, 0.35);
  --gold: #d4af37;
  --gold-soft: #c9a227;
  --gold-dim: rgba(212, 175, 55, 0.55);
  --gold-glow: rgba(212, 175, 55, 0.35);
  --text: #f2f2f0;
  --text-muted: #9a9a92;
  --text-dim: #6a6a64;
  --user-bubble: #1c1a12;
  --jarvis-bubble: #121212;
  --radius: 16px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  overscroll-behavior: none;
}

#app {
  min-height: 100%;
  min-height: 100dvh;
  max-width: 100%;
  margin: 0 auto;
  position: relative;
  background:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(212, 175, 55, 0.07), transparent 60%),
    var(--bg);
}

.screen {
  display: none;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  padding-left: max(16px, var(--safe-left));
  padding-right: max(16px, var(--safe-right));
  padding-bottom: max(16px, var(--safe-bottom));
}

.screen.screen-active {
  display: flex;
}

.home-header {
  padding-top: calc(28px + var(--safe-top));
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #f5e6b8 0%, var(--gold) 45%, #a8892a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-glow);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.brand-sub {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.home-actions {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
  padding: 20px 0 16px;
}

.action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 120px;
  padding: 18px 16px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
}

.action-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.action-card:active {
  transform: scale(0.98);
}

.action-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.action-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  border-radius: 10px;
}

.action-icon svg {
  width: 20px;
  height: 20px;
}

.action-label {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.action-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: auto;
}

.status-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.status-sep {
  color: var(--gold-dim);
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: calc(12px + var(--safe-top));
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.back-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--gold);
  border-radius: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.back-btn:hover {
  background: rgba(212, 175, 55, 0.08);
}

.back-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.screen-header-text h2 {
  font-size: 1.15rem;
  font-weight: 650;
}

.header-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.bubble {
  max-width: 85%;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.45;
}

.bubble p {
  margin: 0;
}

.bubble-jarvis {
  align-self: flex-start;
  background: var(--jarvis-bubble);
  border: 1px solid rgba(212, 175, 55, 0.12);
  border-bottom-left-radius: 4px;
}

.bubble-user {
  align-self: flex-end;
  background: var(--user-bubble);
  border: 1px solid var(--border);
  border-bottom-right-radius: 4px;
  color: #f5edd4;
}

.chat-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 max(10px, var(--safe-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.mic-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-elevated);
  color: var(--text-dim);
  border-radius: 12px;
  cursor: not-allowed;
  opacity: 0.65;
  font: inherit;
}

.mic-label {
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#chat-input {
  flex: 1;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

#chat-input::placeholder {
  color: var(--text-dim);
}

#chat-input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.send-btn {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: linear-gradient(145deg, #e0c25a, var(--gold) 40%, #a8892a);
  color: #1a1408;
  cursor: pointer;
  box-shadow: 0 0 20px var(--gold-glow);
  flex-shrink: 0;
}

.send-btn:hover {
  filter: brightness(1.06);
}

.send-btn:active {
  transform: scale(0.96);
}

.send-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.call-confirm {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  text-align: left;
  gap: 20px;
  padding: 16px 4px max(28px, var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.call-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.call-section-title {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--gold);
  letter-spacing: 0.02em;
}

.call-icon-wrap {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border);
  margin: 0 auto 4px;
  box-shadow: 0 0 40px rgba(212, 175, 55, 0.12);
}

.call-icon-wrap.call-icon-sm {
  width: 64px;
  height: 64px;
  margin-bottom: 0;
}

.call-label {
  font-size: 1.1rem;
  font-weight: 600;
}

.call-number {
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--gold);
  margin: 4px 0 8px;
}

.call-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
  text-align: center;
}

.call-field-note {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.call-section .field {
  width: 100%;
}

.call-section .field input,
.call-section .field textarea {
  min-height: 52px;
  width: 100%;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}

.call-section .field textarea {
  min-height: 72px;
  padding: 12px 14px;
  resize: vertical;
}

.call-section .field input:focus,
.call-section .field textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.call-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 200px;
  width: 100%;
  padding: 0 28px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(145deg, #e0c25a, var(--gold) 40%, #a8892a);
  color: #1a1408;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 24px var(--gold-glow), 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: filter 0.15s, transform 0.12s, opacity 0.15s;
}

.call-btn:hover,
.primary-btn:hover {
  filter: brightness(1.06);
}

.call-btn:active,
.primary-btn:active {
  transform: scale(0.98);
}

.call-btn:focus-visible,
.primary-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.call-btn:disabled,
.primary-btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
  filter: none;
}

.call-reply {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.call-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  min-height: 44px;
  padding: 8px 16px;
  margin-top: 4px;
  margin-bottom: 8px;
  color: var(--gold-dim);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.call-secondary:hover {
  color: var(--gold);
}

.call-secondary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

.routines-body,
.form-body,
.topics-body,
.topic-detail-body {
  flex: 1;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.routines-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.routine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 64px;
}

.routine-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.routine-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.routine-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.routine-badge {
  font-size: 0.65rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  flex-shrink: 0;
}

.routine-badge-paused {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

.routines-empty {
  list-style: none;
  padding: 24px 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.routines-body .primary-btn {
  width: 100%;
  margin-top: auto;
}

.stub-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.field input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.field textarea {
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
  line-height: 1.4;
}

.field textarea:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.stub-form.is-waiting .primary-btn {
  opacity: 0.7;
}

.stub-form .primary-btn {
  width: 100%;
  margin-top: 8px;
}

.live-voice-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 8px 40px;
  gap: 16px;
}

.voice-orb-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.voice-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.voice-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.2);
  opacity: 0;
}

.voice-orb-wrap.is-listening .voice-ring {
  animation: ring-pulse 2s ease-out infinite;
}

.voice-orb-wrap.is-listening .voice-ring:nth-child(2) {
  animation-delay: 0.45s;
}

.voice-orb-wrap.is-listening .voice-ring:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes ring-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

.voice-mic-btn {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: radial-gradient(circle at 40% 35%, #2a2414, #12100a 70%);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 0 36px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(212, 175, 55, 0.08);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
  z-index: 1;
  -webkit-appearance: none;
  appearance: none;
}

.voice-mic-btn:hover {
  box-shadow: 0 0 48px rgba(212, 175, 55, 0.32), inset 0 0 24px rgba(212, 175, 55, 0.12);
}

.voice-mic-btn:active {
  transform: scale(0.96);
}

.voice-mic-btn.is-active {
  background: radial-gradient(circle at 40% 35%, #3a3018, #1a160c 70%);
  box-shadow: 0 0 56px rgba(212, 175, 55, 0.45), inset 0 0 28px rgba(212, 175, 55, 0.15);
}

.voice-mic-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.voice-status {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
  min-height: 1.4em;
}

.voice-note {
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 280px;
  line-height: 1.4;
}

.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.topic-chip {
  min-height: 72px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.topic-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: var(--gold);
}

.topic-chip:active {
  transform: scale(0.98);
}

.topic-chip:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 40px 16px;
  border: 1px dashed rgba(212, 175, 55, 0.2);
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.03);
}

.empty-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gold-dim);
}

.empty-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 240px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  background: #1a1810;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.15);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 481px) {
  #app {
    border-left: 1px solid rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
  }
}

.action-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

/* ===== V2 polish: transitions, typing, mic, voice ===== */

html {
  height: 100%;
  height: 100dvh;
}

body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

#app {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
}

.screen.screen-active {
  opacity: 1;
  transform: none;
}

.screen.screen-enter {
  animation: screen-in 0.28s ease-out both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.live-pill {
  animation: live-pill-glow 2.8s ease-in-out infinite;
}

@keyframes live-pill-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
  50% {
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.25);
  }
}

.action-card {
  transition: background 0.15s, border-color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.action-card:active {
  transform: scale(0.96);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.home-actions,
.routines-body,
.form-body,
.topics-body,
.topic-detail-body,
.call-confirm {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chat-messages {
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  min-height: 0;
}

.chat-compose {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
  z-index: 5;
  padding-top: 12px;
}

.chat-compose.is-waiting .send-btn {
  /* Typing state is shown via indicator; send stays clickable for parallel sends. */
}

.send-btn:disabled,
#chat-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mic-btn {
  cursor: pointer;
  opacity: 1;
  color: var(--gold-dim);
  border-color: var(--border);
  transition: box-shadow 0.2s, color 0.15s, border-color 0.15s, transform 0.12s;
}

.mic-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.mic-btn:not(:disabled):hover {
  color: var(--gold);
  border-color: var(--border-strong);
}

.mic-btn:not(:disabled):active {
  transform: scale(0.96);
}

.mic-btn.is-listening {
  color: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.45);
  animation: mic-pulse 1.4s ease-out infinite;
}

@keyframes mic-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(212, 175, 55, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
  }
}

.bubble-enter {
  animation: bubble-in 0.22s ease-out both;
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.typing-indicator {
  padding: 14px 16px;
  min-width: 64px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 12px;
}

.typing-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.35;
  animation: typing-bounce 1.2s ease-in-out infinite;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.18s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes typing-bounce {
  0%, 80%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.voice-orb-wrap.is-speaking .voice-ring {
  animation: ring-pulse 1.2s ease-out infinite;
  border-color: rgba(212, 175, 55, 0.45);
}

.voice-orb-wrap.is-thinking .voice-mic-btn {
  animation: think-glow 1.5s ease-in-out infinite;
}

@keyframes think-glow {
  0%, 100% {
    box-shadow: 0 0 28px rgba(212, 175, 55, 0.2);
  }
  50% {
    box-shadow: 0 0 48px rgba(212, 175, 55, 0.5);
  }
}

.voice-transcript {
  min-height: 2.6em;
  max-width: 320px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
  padding: 0 8px;
}

.voice-stop-btn {
  margin-top: 4px;
  min-height: 44px;
  min-width: 120px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}

.voice-stop-btn:hover {
  background: rgba(212, 175, 55, 0.14);
}

.voice-stop-btn:active {
  transform: scale(0.96);
}

.routine-item,
.topic-chip {
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.routine-item:active {
  transform: scale(0.98);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .screen {
    opacity: 1;
    transform: none;
  }

  .live-pill,
  .live-dot,
  .mic-btn.is-listening,
  .voice-orb-wrap.is-listening .voice-ring,
  .voice-orb-wrap.is-thinking .voice-mic-btn {
    animation: none !important;
  }
}

/* Chat: Antworten vorlesen toggle */
.chat-speak-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.15);
  background: rgba(212, 175, 55, 0.04);
}
.chat-speak-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.chat-speak-toggle-ui {
  display: grid;
  place-items: center;
  color: var(--gold);
  opacity: 0.45;
  transition: opacity 0.15s ease;
}
.chat-speak-toggle:has(input:checked) {
  color: var(--gold);
  border-color: rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.1);
}
.chat-speak-toggle:has(input:checked) .chat-speak-toggle-ui {
  opacity: 1;
}
.chat-speak-toggle-label {
  white-space: nowrap;
}
@media (max-width: 380px) {
  .chat-speak-toggle-label {
    display: none;
  }
}

/* Jarvis bubble replay speaker */
.bubble-jarvis {
  position: relative;
  padding-right: 36px;
}
.bubble-speak-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--gold);
  opacity: 0.55;
  cursor: pointer;
  padding: 0;
}
.bubble-speak-btn:hover,
.bubble-speak-btn:focus-visible {
  opacity: 1;
  background: rgba(212, 175, 55, 0.12);
  outline: none;
}
.bubble-speak-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.bubble-speak-btn.is-playing {
  opacity: 1;
}

/* ---------- Swipe-to-reply / quote / reply bar ---------- */
.chat-compose {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.chat-compose-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-reply-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.08);
  border-left: 3px solid var(--gold);
}

.chat-reply-bar[hidden] {
  display: none !important;
}

.chat-reply-bar-icon {
  flex-shrink: 0;
  color: var(--gold);
  display: grid;
  place-items: center;
}

.chat-reply-bar-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-reply-bar-label {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 650;
}

.chat-reply-bar-who {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

.chat-reply-bar-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-reply-cancel {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.chat-reply-cancel:hover,
.chat-reply-cancel:focus-visible {
  color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  outline: none;
}

.bubble {
  position: relative;
  touch-action: pan-y;
  will-change: transform;
  transition: transform 0.18s ease-out, box-shadow 0.25s ease;
}

.bubble.is-swiping {
  transition: none;
}

.bubble-swipe-hint {
  position: absolute;
  left: -36px;
  top: 50%;
  transform: translateY(-50%) scale(0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.bubble.is-swiping .bubble-swipe-hint,
.bubble.swipe-armed .bubble-swipe-hint {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.bubble-quote {
  margin: 0 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 3px solid var(--gold);
  background: rgba(212, 175, 55, 0.08);
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.bubble-quote-who {
  display: block;
  font-weight: 650;
  font-size: 0.72rem;
  color: var(--gold);
  margin-bottom: 2px;
}

.bubble-quote-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bubble-reply-flash {
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px var(--gold-glow);
}

.bubble-reply-btn {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold);
  opacity: 0;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s ease;
}

.bubble-user .bubble-reply-btn {
  left: -36px;
}

.bubble-jarvis .bubble-reply-btn {
  /* speak btn occupies top-right; place reply left of speak or bottom-right */
  right: 40px;
}

@media (hover: hover) and (pointer: fine) {
  .bubble-reply-btn {
    display: grid;
  }
  .bubble:hover .bubble-reply-btn,
  .bubble-reply-btn:focus-visible {
    opacity: 0.85;
  }
  .bubble-reply-btn:hover,
  .bubble-reply-btn:focus-visible {
    opacity: 1;
    background: rgba(212, 175, 55, 0.2);
    outline: none;
  }
}

/* Themen news cards — dark + gold */
.topic-updated {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--gold-dim);
}

.topic-news-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-card {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.04);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.news-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}

.news-card-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--gold);
  line-height: 1.35;
}

.news-card-summary {
  margin: 0 0 12px;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.45;
}

.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  font-size: 0.8rem;
}

.news-card-source {
  color: var(--gold-dim);
}

.news-card-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}

.news-card-link:hover {
  border-bottom-color: var(--gold);
}

.news-card-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.news-card {
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.news-card:active {
  border-color: var(--gold);
}

.news-card-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gold-dim);
}

.article-body {
  padding: 8px 20px 28px;
  overflow-y: auto;
}

.article-summary {
  margin: 0 0 28px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
}

.article-content {
  margin: 0 0 28px;
}

.article-content .article-h {
  margin: 0 0 10px;
  font-size: 1.12rem;
  font-weight: 650;
  color: var(--gold);
  line-height: 1.35;
}

.article-content .article-h + .article-p {
  margin-top: 0;
}

.article-content .article-p {
  margin: 0 0 14px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
}

.article-content .article-p:last-child {
  margin-bottom: 0;
}

.article-content .article-section {
  margin: 0 0 20px;
}

.article-content .article-section:last-child {
  margin-bottom: 0;
}

.article-source-block {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.article-source-label {
  margin: 0 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-dim);
}

.article-source-name {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 600;
}

.article-source-link {
  display: inline-block;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.35);
}

.article-source-link:hover {
  border-bottom-color: var(--gold);
}

.news-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: calc(var(--radius-sm) - 4px);
  margin: 0 0 12px;
  background: var(--bg-elevated, #1a1a1a);
}

.article-figure {
  margin: 0 0 18px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated, #1a1a1a);
}

.article-image {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.routine-item {
  cursor: pointer;
}

.routine-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--gold-dim);
  line-height: 1.35;
}

.field-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field-toggle input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--gold);
}

.topic-chip-live {
  border-color: rgba(212, 175, 55, 0.55);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.05));
  font-weight: 700;
  position: relative;
}

.topic-chip-live::after {
  content: "LIVE";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  opacity: 0.9;
}

/* === polish v20 === */
:root {
  --depth-1: 0 4px 12px rgba(0, 0, 0, 0.35);
  --depth-2: 0 10px 28px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  --depth-gold: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 24px rgba(212, 175, 55, 0.12);
  --glass: rgba(20, 20, 20, 0.72);
  --shine: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, transparent 42%, transparent 58%, rgba(212, 175, 55, 0.06) 100%);
}

#app {
  background:
    radial-gradient(ellipse 90% 45% at 50% -8%, rgba(212, 175, 55, 0.11), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 30%, rgba(212, 175, 55, 0.04), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(212, 175, 55, 0.035), transparent 45%),
    var(--bg);
  overflow-x: hidden;
}

#app::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  max-width: 100%;
  margin: 0 auto;
  left: 0;
  right: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(212, 175, 55, 0.05), transparent 35%),
    radial-gradient(circle at 70% 70%, rgba(212, 175, 55, 0.03), transparent 40%);
  animation: ambient-drift 14s ease-in-out infinite alternate;
  z-index: 0;
}

#app > .screen {
  position: relative;
  z-index: 1;
}

@keyframes ambient-drift {
  from { opacity: 0.7; transform: scale(1) translate3d(0, 0, 0); }
  to { opacity: 1; transform: scale(1.04) translate3d(0, -1.5%, 0); }
}

.brand-title {
  text-shadow: 0 0 28px rgba(212, 175, 55, 0.25);
  animation: brand-breathe 5s ease-in-out infinite;
}

@keyframes brand-breathe {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.live-pill {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--depth-1), 0 0 16px rgba(212, 175, 55, 0.15);
}

.home-actions {
  perspective: 900px;
  gap: 14px;
}

.action-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  background:
    var(--shine),
    linear-gradient(160deg, #1a1a18 0%, var(--bg-card) 45%, #101010 100%);
  border: 1px solid var(--border);
  box-shadow: var(--depth-2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
  will-change: transform;
  animation: card-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.action-card:nth-child(1) { animation-delay: 0.04s; }
.action-card:nth-child(2) { animation-delay: 0.1s; }
.action-card:nth-child(3) { animation-delay: 0.16s; }
.action-card:nth-child(4) { animation-delay: 0.22s; }
.action-card:nth-child(5) { animation-delay: 0.28s; }

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 22px, -40px) rotateX(8deg);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg);
  }
}

.action-card::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.07) 48%,
    transparent 62%
  );
  transform: translateX(-60%) rotate(12deg);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.action-card:hover::before,
.action-card:focus-visible::before {
  transform: translateX(60%) rotate(12deg);
}

.action-card:hover,
.action-card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: var(--depth-gold), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translate3d(0, -4px, 12px) rotateX(4deg) scale(1.02);
}

.action-card.is-tilting {
  transition: transform 0.08s ease-out, box-shadow 0.2s ease, border-color 0.2s ease;
}

.action-card:active {
  transform: translate3d(0, 1px, 0) scale(0.97) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.action-icon {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: translateZ(18px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.action-card:hover .action-icon {
  transform: translateZ(28px) scale(1.06);
  box-shadow: 0 0 18px rgba(212, 175, 55, 0.25), 0 6px 14px rgba(0, 0, 0, 0.3);
}

.screen-header {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.92), rgba(5, 5, 5, 0.55));
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.back-btn,
.primary-btn,
.topic-chip,
.routine-item,
.news-card,
.stub-form input,
.stub-form textarea,
.msg {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.2s ease, background 0.2s ease;
}

.topic-chip {
  background:
    var(--shine),
    var(--bg-card);
  box-shadow: var(--depth-1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.topic-chip:hover,
.topic-chip:focus-visible {
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--depth-gold);
  border-color: var(--border-strong);
}

.topic-chip-live {
  animation: live-chip-pulse 2.6s ease-in-out infinite;
}

@keyframes live-chip-pulse {
  0%, 100% { box-shadow: var(--depth-1), 0 0 0 0 rgba(212, 175, 55, 0.2); }
  50% { box-shadow: var(--depth-gold), 0 0 22px rgba(212, 175, 55, 0.28); }
}

.news-card,
.routine-item {
  background:
    var(--shine),
    var(--bg-card);
  box-shadow: var(--depth-1), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transform: translateZ(0);
}

.news-card:hover,
.routine-item:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: var(--depth-gold);
  border-color: var(--border-strong);
}

.news-card-media,
.article-image {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.primary-btn {
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.22), var(--depth-1);
  transform: translateZ(0);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 175, 55, 0.3), var(--depth-2);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.98);
}

.msg {
  box-shadow: var(--depth-1);
}

.msg.jarvis {
  background:
    linear-gradient(160deg, rgba(212, 175, 55, 0.06), transparent 50%),
    var(--jarvis-bubble);
}

.voice-mic-btn {
  transform-style: preserve-3d;
  animation: orb-float 4.5s ease-in-out infinite;
}

@keyframes orb-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.02); }
}

.screen.screen-enter {
  animation: screen-in-3d 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  transform-origin: 50% 80%;
}

@keyframes screen-in-3d {
  from {
    opacity: 0;
    transform: perspective(900px) translateY(18px) rotateX(6deg) scale(0.98);
  }
  to {
    opacity: 1;
    transform: perspective(900px) translateY(0) rotateX(0) scale(1);
  }
}

.toast {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--depth-gold);
}

@media (prefers-reduced-motion: reduce) {
  #app::before,
  .brand-title,
  .live-pill,
  .action-card,
  .topic-chip-live,
  .voice-mic-btn {
    animation: none !important;
  }
  .action-card,
  .topic-chip,
  .news-card,
  .routine-item,
  .primary-btn {
    transition: border-color 0.15s, background 0.15s !important;
    transform: none !important;
  }
  .screen.screen-enter {
    animation: none !important;
  }
  .action-card::before {
    display: none;
  }
}

/* === home hero dock v21 === */
.screen-home {
  justify-content: space-between;
  padding-bottom: max(10px, var(--safe-bottom));
}

.home-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: calc(24px + var(--safe-top)) 12px 24px;
  min-height: 0;
}

.hero-orb {
  position: relative;
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  display: grid;
  place-items: center;
}

.hero-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 175, 55, 0.28);
  box-shadow:
    0 0 24px rgba(212, 175, 55, 0.12),
    inset 0 0 24px rgba(212, 175, 55, 0.06);
  animation: hero-ring-spin 12s linear infinite;
}

.hero-ring-1 {
  inset: 8%;
  animation-duration: 10s;
  border-color: rgba(212, 175, 55, 0.45);
}

.hero-ring-2 {
  inset: 0;
  animation-duration: 16s;
  animation-direction: reverse;
  opacity: 0.75;
  border-style: dashed;
}

.hero-ring-3 {
  inset: -8%;
  animation-duration: 22s;
  opacity: 0.45;
  border-width: 1px;
}

@keyframes hero-ring-spin {
  from { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.02); }
  to { transform: rotate(360deg) scale(1); }
}

.hero-core {
  position: relative;
  z-index: 2;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(245, 230, 184, 0.16), transparent 55%),
    radial-gradient(circle at 50% 50%, #1a1810 0%, #0a0a0a 70%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow:
    0 0 40px rgba(212, 175, 55, 0.22),
    0 12px 32px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: hero-core-pulse 4.5s ease-in-out infinite;
}

@keyframes hero-core-pulse {
  0%, 100% { box-shadow: 0 0 36px rgba(212, 175, 55, 0.18), 0 12px 32px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08); }
  50% { box-shadow: 0 0 56px rgba(212, 175, 55, 0.32), 0 14px 36px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
}

.screen-home .brand-title {
  font-size: clamp(1.6rem, 7vw, 2.15rem);
  margin: 0;
  text-align: center;
  line-height: 1.1;
}

.screen-home .live-pill {
  margin-top: 2px;
}

.screen-home .brand-sub {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.home-dock {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom, 0px));
  margin: 0 0 4px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(30, 28, 22, 0.92), rgba(12, 12, 12, 0.96));
  border: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(212, 175, 55, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 5;
}

.dock-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 8px 2px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s ease, transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s;
}

.dock-item:hover,
.dock-item:focus-visible {
  background: rgba(212, 175, 55, 0.1);
  outline: none;
}

.dock-item:focus-visible {
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.45);
}

.dock-item:active {
  transform: translateY(2px) scale(0.96);
}

.dock-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dock-icon svg {
  width: 18px;
  height: 18px;
}

.dock-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-item:hover .dock-label,
.dock-item:focus-visible .dock-label {
  color: var(--gold);
}

@media (prefers-reduced-motion: reduce) {
  .hero-ring,
  .hero-core {
    animation: none !important;
  }
}

.voice-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}

.voice-mute-btn,
.voice-stop-btn {
  margin-top: 0;
  min-height: 44px;
  min-width: 110px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, color 0.15s;
}

.voice-mute-btn.is-muted {
  background: rgba(180, 60, 60, 0.2);
  border-color: rgba(220, 100, 100, 0.45);
  color: #f0b4b4;
}

.voice-mute-btn:hover,
.voice-stop-btn:hover {
  background: rgba(212, 175, 55, 0.14);
}

.voice-mute-btn.is-muted:hover {
  background: rgba(180, 60, 60, 0.28);
}

.voice-mute-btn:active,
.voice-stop-btn:active {
  transform: scale(0.96);
}

/* === Fold 8 / large display === */
/* Default #app is full width. Optional phone-column only on desktop pointers. */

@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  #app {
    max-width: 480px;
  }

  #app::before {
    max-width: 480px;
  }
}

/* Cover denser tweaks (~10:16 phones / folded) */
@media (max-width: 480px) and (min-aspect-ratio: 9/19) and (max-aspect-ratio: 11/16) {
  .home-hero {
    padding-top: calc(18px + var(--safe-top));
    padding-bottom: 16px;
    gap: 12px;
  }

  .hero-orb {
    width: min(68vw, 260px);
    height: min(68vw, 260px);
  }

  .home-dock {
    gap: 2px;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .dock-item {
    min-height: 58px;
    padding: 6px 1px;
    gap: 4px;
  }

  .dock-label {
    font-size: 0.64rem;
  }
}

/* Fold inner / large short screens (4:3-ish) — by aspect, works even if CSS width ~500 */
@media (min-aspect-ratio: 17/25) and (max-aspect-ratio: 10/11) {
  .hero-orb {
    width: min(46vmin, 400px);
    height: min(46vmin, 400px);
  }

  .screen-home .brand-title {
    font-size: clamp(1.9rem, 4.2vw, 2.6rem);
  }

  .home-dock {
    max-width: min(880px, 94%);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    gap: 10px;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 28px;
  }

  .dock-item {
    min-height: 76px;
    padding: 12px 6px;
    gap: 8px;
  }

  .dock-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .dock-icon svg {
    width: 22px;
    height: 22px;
  }

  .dock-label {
    font-size: 0.78rem;
  }

  .chat-messages,
  .chat-compose,
  .routines-body,
  .form-body,
  .topics-body,
  .topic-detail-body,
  .call-confirm,
  .voice-stage,
  .screen-header,
  .routines-list {
    max-width: min(960px, 100%);
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .bubble {
    max-width: 64%;
  }

  .screen {
    padding-left: max(24px, var(--safe-left));
    padding-right: max(24px, var(--safe-right));
  }
}

/* Wide / landscape (inner rotated or large width) */
@media (orientation: landscape) and (min-width: 600px) {
  .screen-home {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding-left: max(28px, var(--safe-left));
    padding-right: max(28px, var(--safe-right));
  }

  .home-hero {
    flex: 1 1 45%;
    max-width: 580px;
    padding: calc(12px + var(--safe-top)) 16px 12px;
  }

  .hero-orb {
    width: min(40vmin, 320px);
    height: min(40vmin, 320px);
  }

  .home-dock {
    flex: 0 1 460px;
    max-width: 460px;
    margin: 0;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px 14px;
    align-self: center;
  }

  .dock-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    min-height: 56px;
    padding: 12px 16px;
  }

  .dock-label {
    font-size: 0.9rem;
    white-space: normal;
  }

  .topic-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Fallback: any viewport wider than phone column */
@media (min-width: 500px) {
  .home-dock {
    max-width: min(880px, 94%);
    margin-left: auto;
    margin-right: auto;
  }

  .hero-orb {
    width: min(48vmin, 380px);
    height: min(48vmin, 380px);
  }
}
