:root {
  --navy: #3C4F76;
  --navy-deep: #2B3A56;
  --blue: #4E6491;
  --blue-strong: #3C4F76;
  --blue-soft: #E8ECF4;
  --text: #2B3A56;
  --text-soft: #7A8FAD;
  --text-faint: #A0AEBE;
  --border: #D6DBE8;
  --border-strong: #C4CBDB;
  --surface: #ffffff;
  --surface-soft: #F9F8F7;
  --surface-muted: #F4F2F0;
  --bg: #F4F2F0;
  --success-bg: #e9f8ef;
  --success-text: #1f7a45;
  --error-bg: #fdecec;
  --error-text: #b23838;
  --shadow-sm: 0 4px 14px rgba(43, 58, 86, 0.06);
  --shadow-md: 0 12px 30px rgba(43, 58, 86, 0.10);
  --shadow-lg: 0 18px 50px rgba(43, 58, 86, 0.14);
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --frame-width: 390px;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 28%),
    linear-gradient(180deg, #F4F2F0 0%, #EEEcE9 100%);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.ui-icon {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* =========================
   WELCOME SCREEN
========================= */

.welcome-screen-outer {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px 48px;
  background: #3C4F76;
}

.welcome-screen-outer.hidden {
  display: none !important;
}

.welcome-screen-inner {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-card {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  width: 100%;
}

.welcome-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.welcome-logo {
  height: 220px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.welcome-heading {
  margin: 0 0 52px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.65;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.welcome-form {
  display: grid;
  gap: 14px;
  width: 100%;
}

.welcome-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.optional-text {
  color: rgba(255, 255, 255, 0.32);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.welcome-input {
  width: 100%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  padding: 18px 20px;
  font-size: 18px;
  line-height: 1.4;
  font-family: Inter, -apple-system, sans-serif;
  transition: border-color 0.18s ease, background 0.18s ease;
  box-sizing: border-box;
}

.welcome-input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.welcome-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.13);
}

.welcome-button {
  margin-top: 4px;
  background: #ffffff;
  color: #3C4F76;
  font-weight: 700;
  font-size: 18px;
  border: none;
  border-radius: 14px;
  padding: 19px;
  width: 100%;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.welcome-button:hover {
  opacity: 0.92;
}

.welcome-note {
  margin: 22px 0 0;
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.3);
}

/* =========================
   APP SHELL
========================= */

.app-shell {
  display: flex;
  justify-content: center;
  padding: 24px 0;
}

.app-shell.hidden {
  display: none !important;
}

.app-frame {
  width: min(var(--frame-width), 100%);
  height: min(844px, calc(100vh - 48px));
  border-radius: 34px;
  border: 1px solid rgba(205, 218, 237, 0.95);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--surface-soft);
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 18px 16px 28px;
}

/* =========================
   MENU
========================= */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 21, 43, 0.38);
  backdrop-filter: blur(3px);
  z-index: 45;
}

.menu-panel {
  position: fixed;
  top: 14px;
  right: 14px;
  width: min(320px, calc(100vw - 28px));
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(210, 223, 241, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  padding: 18px;
}

.menu-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.menu-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.menu-panel-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
  color: var(--text);
}

.menu-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.menu-section {
  display: grid;
  gap: 10px;
}

.menu-link {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 14px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

.menu-link:hover,
.menu-link:focus-visible {
  border-color: var(--border-strong);
  background: #f9fbff;
  outline: none;
}

.menu-link:active {
  transform: translateY(1px);
}

.menu-link-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.menu-link-meta {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-soft);
}

/* =========================
   APP UTILITY ROW / MENU BUTTON
========================= */

.app-utility-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.menu-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: inherit;
  display: grid;
  place-items: center;
  gap: 2px;
  transition: background 0.18s ease, transform 0.12s ease;
}

.menu-button:hover,
.menu-button:focus-visible {
  outline: none;
}

.menu-button:active {
  transform: scale(0.98);
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.app-menu-button {
  color: var(--navy);
  background: transparent;
  width: 40px;
  height: 40px;
}

.app-menu-button:hover,
.app-menu-button:focus-visible {
  background: rgba(15, 61, 132, 0.06);
  outline: none;
}

/* =========================
   SCREENS
========================= */

.screen {
  display: none;
}

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

.screen-intro {
  margin-top: 6px;
  margin-bottom: 22px;
}

.screen-title-xl,
.screen-title-lg {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.02em;
  color: var(--text);
}

.screen-title-xl {
  font-size: 40px;
  line-height: 1.02;
  margin-bottom: 10px;
}

.screen-title-lg {
  font-size: 34px;
  line-height: 1.08;
  margin-bottom: 8px;
}

.screen-subtitle {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
  max-width: 100%;
}

/* =========================
   STATUS / BANNERS
========================= */

.status-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message-banner {
  border-radius: 16px;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
}

.message-banner-error {
  background: var(--error-bg);
  color: var(--error-text);
  border-color: #f5d1d1;
}

.message-banner-success {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: #cfe9d6;
}

/* =========================
   SEGMENT CONTROL
========================= */

.segment-control {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: #f1f4f9;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 6px;
  margin-bottom: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.segment-button {
  min-height: 48px;
  border-radius: 14px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.segment-button .segment-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.segment-button.is-active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(18, 43, 92, 0.08);
}

/* =========================
   FORMS / INPUTS
========================= */

.entry-panel {
  display: block;
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.textarea-wrap {
  position: relative;
}

textarea {
  width: 100%;
  min-height: 166px;
  resize: none;
  border: 1.5px solid var(--border-strong);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  padding: 16px 16px 34px;
  font-size: 16px;
  line-height: 1.65;
  box-shadow: 0 2px 10px rgba(16, 42, 84, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea::placeholder {
  color: #90a0ba;
}

textarea:focus {
  outline: none;
  border-color: #8eafe3;
  box-shadow: 0 0 0 4px rgba(20, 81, 168, 0.10);
}

.char-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
}

.char-count--warning {
  color: var(--error-text);
}

/* =========================
   HELPER
========================= */

.helper-card,
.audio-card,
.about-card,
.explore-card,
.response-card {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.helper-card {
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #F9F8F7 100%);
}

.helper-toggle {
  width: 100%;
  text-align: left;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.helper-toggle-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.helper-badge {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  flex: 0 0 34px;
  background: #eef4ff;
  color: var(--blue);
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.helper-badge .ui-icon,
.helper-note-icon .ui-icon,
.privacy-icon .ui-icon,
.button-icon .ui-icon,
.segment-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.helper-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.helper-subtitle {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-soft);
}

.helper-caret {
  width: 24px;
  height: 24px;
  color: var(--text-soft);
  flex: 0 0 24px;
  transition: transform 0.18s ease;
}

.helper-card.is-open .helper-caret {
  transform: rotate(180deg);
}

.helper-expanded {
  padding: 4px 16px 16px;
  border-top: 1px solid #D6DBE8;
}

.helper-progress-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 0 4px;
}

.helper-step-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}

.helper-progress-track {
  width: 100%;
  height: 8px;
  background: #dfe8f5;
  border-radius: 999px;
  overflow: hidden;
}

.helper-progress-fill {
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4E6491 0%, #3C4F76 100%);
  transition: width 0.2s ease;
}

.helper-step-title {
  margin: 12px 0 6px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--text);
}

.helper-step-copy {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.chip {
  min-height: 48px;
  border: 1.5px solid var(--border-strong);
  background: #fff;
  border-radius: 14px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  padding: 12px 14px;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.chip:hover,
.chip:focus-visible {
  border-color: #aac0e7;
  outline: none;
}

.chip.is-selected {
  background: #edf4ff;
  border-color: #7ea5de;
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(20, 81, 168, 0.06);
}

.chip-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(20, 81, 168, 0.08);
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  color: currentColor;
}

.chip.is-selected .chip-icon {
  background: rgba(20, 81, 168, 0.16);
}

.chip-with-icon .ui-icon {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.helper-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 13px;
  border-radius: 14px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
}

.helper-note-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.helper-step-actions {
  margin-top: 14px;
}

.suggested-prompt-card {
  margin-top: 14px;
  background: #edf4ff;
  border: 1px solid #dbe7fb;
  border-radius: 16px;
  padding: 14px;
}

.suggested-prompt-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 8px;
}

.suggested-prompt-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.helper-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

/* =========================
   BUTTONS
========================= */

.primary-button,
.secondary-button,
.outline-button,
.ghost-button,
.danger-button {
  min-height: 54px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.primary-button:active,
.secondary-button:active,
.outline-button:active,
.ghost-button:active,
.danger-button:active {
  transform: translateY(1px);
}

.button-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.primary-button {
  min-height: 56px;
  font-size: 17px;
  background: linear-gradient(180deg, #3C4F76 0%, #2B3A56 100%);
  color: #fff;
  box-shadow: 0 10px 22px rgba(20, 81, 168, 0.22);
}

.primary-button:hover,
.primary-button:focus-visible {
  outline: none;
  filter: brightness(1.02);
}

.secondary-button {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid #d7e5fb;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  outline: none;
  background: #e4efff;
}

.helper-next-button {
  background: linear-gradient(180deg, #E8ECF4 0%, #DDE2EE 100%);
  border: 1px solid #c8daf7;
  color: var(--blue);
  box-shadow: 0 4px 10px rgba(20, 81, 168, 0.08);
}

.helper-next-button:hover,
.helper-next-button:focus-visible {
  background: linear-gradient(180deg, #E2E7F0 0%, #D6DBE8 100%);
  border-color: #b7cff2;
  outline: none;
}

.outline-button {
  background: #fff;
  color: var(--blue);
  border: 1.5px solid #b9cff0;
}

.outline-button:hover,
.outline-button:focus-visible {
  outline: none;
  background: #f7fbff;
  border-color: #9fbce8;
}

.ghost-button {
  background: #f4f7fb;
  color: var(--text);
  border: 1px solid var(--border);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  outline: none;
  background: #eef3f9;
}

.danger-button {
  background: #fff1f1;
  color: #c24545;
  border: 1px solid #f2cccc;
}

.danger-button:hover,
.danger-button:focus-visible {
  outline: none;
  background: #ffeaea;
}

/* =========================
   PRIVACY NOTE
========================= */

.privacy-note {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
}

.privacy-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

/* =========================
   AUDIO
========================= */

.audio-card {
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 18px;
}

.audio-status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.audio-status-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.audio-status {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.recording-timer {
  min-width: 56px;
  text-align: center;
  padding: 9px 12px;
  border-radius: 12px;
  background: #fff4f4;
  color: #c24545;
  font-size: 15px;
  font-weight: 800;
}

.audio-button-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.audio-button {
  width: 100%;
}

/* =========================
   RESPONSE
========================= */

.response-intro {
  margin-bottom: 16px;
}

.response-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #edf4ff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.response-card {
  border-radius: 22px;
  padding: 18px 16px;
  margin-bottom: 16px;
}

.response-meta {
  margin-bottom: 14px;
}

.response-meta-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.response-text {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.78;
  color: var(--text);
}

.response-text strong {
  display: block;
  font-weight: 700;
  margin-top: 18px;
  margin-bottom: 6px;
}

.response-body {
  font-size: 16px;
  line-height: 1.78;
  color: var(--text);
  white-space: pre-wrap;
}

.selah-block {
  margin-top: 28px;
  padding: 22px 20px 20px;
  background: #F4F2F0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.selah-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.selah-rule {
  flex: 1;
  height: 1px;
  background: var(--border-strong);
  opacity: 0.7;
}

.selah-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy);
  white-space: nowrap;
  flex-shrink: 0;
}

.selah-body {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text);
  white-space: pre-wrap;
}

.response-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.response-action-button {
  width: 100%;
}

/* =========================
   EXPLORE / ABOUT
========================= */

.explore-grid,
.about-stack {
  display: grid;
  gap: 12px;
}

.explore-card {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 20px;
  transition: transform 0.12s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.explore-card:hover,
.explore-card:focus-visible {
  outline: none;
  border-color: var(--border-strong);
  background: #fbfdff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.explore-card-title {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.explore-card-copy {
  display: block;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

.about-card {
  border-radius: 20px;
  padding: 16px;
}

.about-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.3;
  color: var(--text);
}

.about-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-soft);
}

.about-card + .about-card {
  margin-top: 0;
}

.about-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
}

.about-list li {
  font-size: 15px;
  line-height: 1.65;
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.about-links a {
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
}

/* =========================
   LOADING OVERLAY
========================= */

.spinner-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(244, 248, 253, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.22s ease;
  z-index: 9999;
}

.moment-loading-card {
  width: min(300px, 100%);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(214, 226, 242, 0.92);
  box-shadow: var(--shadow-lg);
  padding: 28px 22px 24px;
  text-align: center;
}

.moment-loading-glow {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(60, 79, 118, 0.20) 0%, rgba(60, 79, 118, 0.08) 45%, rgba(60, 79, 118, 0.02) 70%, rgba(60, 79, 118, 0) 100%);
  animation: momentPulse 1.8s ease-in-out infinite;
}

.moment-loading-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.moment-loading-copy {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-soft);
}

@keyframes momentPulse {
  0%, 100% {
    transform: scale(0.92);
    opacity: 0.72;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

/* =========================
   RESPONSIVE
========================= */

@media (min-width: 420px) {
  .helper-action-row {
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (min-width: 740px) {
  .welcome-screen-outer {
    padding: 40px 24px;
  }

  .welcome-screen-inner {
    max-width: 440px;
  }

  .welcome-logo {
    height: 240px;
  }

  .welcome-heading {
    font-size: 22px;
  }

  .app-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
  }

  .app-frame {
    width: min(var(--frame-width), 100%);
    height: min(844px, calc(100vh - 48px));
    border-radius: 34px;
  }

  .menu-panel {
    top: max(36px, calc((100vh - min(844px, calc(100vh - 48px))) / 2 + 14px));
    right: max(24px, calc((100vw - min(var(--frame-width), calc(100vw - 48px))) / 2 + 14px));
  }
}

@media (max-width: 420px) {
  .welcome-screen-outer {
    padding: 44px 24px 40px;
  }

  .welcome-logo {
    height: 200px;
  }

  .welcome-heading {
    font-size: 20px;
    margin-bottom: 40px;
  }

  .screen-title-xl {
    font-size: 40px;
  }

  .screen-title-lg {
    font-size: 31px;
  }

  .app-main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .chip-grid {
    gap: 9px;
  }

  .chip {
    font-size: 14px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .response-actions {
    grid-template-columns: 1fr;
  }

  .spinner-overlay {
    padding: 16px;
    background: rgba(244, 248, 253, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
