@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@300;400;500&display=swap');

:root {
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --font-display: "Outfit", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  --bg: #050505;
  --bg-soft: #0a0a0c;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(14, 14, 16, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);
  --text: rgba(255, 255, 255, 0.92);
  --text-soft: rgba(255, 255, 255, 0.56);
  --accent: #14b8a6;
  --accent-soft: rgba(20, 184, 166, 0.18);
  --user-bubble: rgba(20, 184, 166, 0.12);
  --assistant-bubble: rgba(255, 255, 255, 0.05);
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

body {
  overflow: hidden;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 15% 10%, rgba(16, 185, 129, 0.08), transparent 24%),
    radial-gradient(circle at 85% 90%, rgba(13, 148, 136, 0.08), transparent 22%),
    linear-gradient(180deg, #050505 0%, #09090b 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 88px);
  opacity: 0.22;
}

body::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0));
  opacity: 0.18;
}

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px 24px 40px;
  background: #050505;
  overflow: hidden;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.boot-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-screen-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}

.boot-screen-glow-left {
  top: -120px;
  left: -140px;
  background: rgba(16, 185, 129, 0.18);
}

.boot-screen-glow-right {
  right: -160px;
  bottom: -140px;
  background: rgba(20, 184, 166, 0.14);
}

.boot-screen-top {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.boot-screen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.08);
}

.boot-screen-kicker {
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.56);
}

.boot-screen-center {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
}

.boot-logo-mark {
  position: relative;
  width: 172px;
  height: 172px;
  display: grid;
  place-items: center;
  animation: boot-logo-breathe 3.2s ease-in-out infinite;
}

.boot-logo-core {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.18) 0%, rgba(20, 184, 166, 0.05) 45%, transparent 72%);
  filter: blur(16px);
}

.boot-logo-stem {
  position: absolute;
  top: 22px;
  left: 66px;
  width: 14px;
  height: 126px;
  border-radius: 999px;
  background: linear-gradient(180deg, #23d3c7 0%, #14b8a6 46%, rgba(8, 145, 178, 0.9) 100%);
  box-shadow: 0 0 24px rgba(20, 184, 166, 0.28);
  animation: boot-stem-pulse 3s ease-in-out infinite;
}

.boot-logo-bowl {
  position: absolute;
  top: 30px;
  left: 78px;
  width: 62px;
  height: 58px;
  border-top: 12px solid #21cdc0;
  border-right: 12px solid #1cc3b6;
  border-bottom: 12px solid #16b1a3;
  border-left: 0;
  border-radius: 0 30px 30px 0;
  box-shadow: 0 0 24px rgba(20, 184, 166, 0.18);
  animation: boot-bowl-glow 3s ease-in-out infinite;
}

.boot-logo-leg {
  position: absolute;
  top: 92px;
  left: 88px;
  width: 76px;
  height: 12px;
  border-radius: 999px;
  transform: rotate(46deg);
  transform-origin: left center;
  background: linear-gradient(90deg, #23d3c7 0%, #14b8a6 50%, rgba(8, 145, 178, 0.9) 100%);
  box-shadow: 0 0 22px rgba(20, 184, 166, 0.22);
  animation: boot-leg-pulse 3s ease-in-out infinite;
}

.boot-logo-particle {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  margin-top: -3px;
  border-radius: 50%;
  background: rgba(77, 255, 233, 0.9);
  box-shadow: 0 0 14px rgba(77, 255, 233, 0.55);
  opacity: 0;
}

.boot-logo-particle-a { --drift: -34px; animation: boot-particle-rise 3.8s linear infinite; }
.boot-logo-particle-b { --drift: 30px; animation: boot-particle-rise 4.2s linear infinite 0.8s; }
.boot-logo-particle-c { --drift: -18px; animation: boot-particle-rise 4s linear infinite 1.4s; }
.boot-logo-particle-d { --drift: 20px; animation: boot-particle-rise 4.6s linear infinite 2s; }

@keyframes boot-logo-breathe {
  0%, 100% { transform: scale(0.98); opacity: 0.92; }
  50% { transform: scale(1.02); opacity: 1; }
}

@keyframes boot-stem-pulse {
  0%, 100% { height: 126px; opacity: 0.78; }
  50% { height: 150px; opacity: 1; }
}

@keyframes boot-bowl-glow {
  0%, 100% {
    opacity: 0.78;
    border-top-color: #19c7ba;
    border-right-color: #18bdb0;
    border-bottom-color: #15aca0;
    box-shadow: 0 0 24px rgba(20, 184, 166, 0.18);
  }
  50% {
    opacity: 1;
    border-top-color: #29e1d3;
    border-right-color: #25d2c4;
    border-bottom-color: #18b6a8;
    box-shadow: 0 0 42px rgba(20, 184, 166, 0.34);
  }
}

@keyframes boot-leg-pulse {
  0%, 100% { width: 76px; opacity: 0.76; }
  50% { width: 92px; opacity: 1; }
}

@keyframes boot-particle-rise {
  0% {
    transform: translate(0, 42px) scale(0.4);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--drift, 28px), -72px) scale(1.15);
    opacity: 0;
  }
}

.boot-screen-copy {
  text-align: center;
}

.boot-screen-copy h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 42px);
  font-weight: 400;
  letter-spacing: 0.34em;
  color: rgba(255, 255, 255, 0.96);
}

.boot-screen-copy p {
  margin: 10px 0 0;
  font-size: 10px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

.boot-screen-bottom {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  align-self: center;
  display: grid;
  gap: 10px;
}

.boot-screen-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.72);
}

.boot-screen-status-row strong {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.boot-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.boot-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #14b8a6 0%, #2dd4bf 48%, #14b8a6 100%);
  box-shadow: 0 0 18px rgba(20, 184, 166, 0.22);
  transition: width 220ms ease;
}

.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.screen-overlay[hidden],
.app-shell[hidden] {
  display: none !important;
}

#openingScreen {
  background: rgba(5, 5, 5, 0.98);
  padding: 0;
  display: block;
}

.screen-card {
  width: min(100%, 960px);
  max-height: calc(100dvh - 56px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(15, 15, 18, 0.94), rgba(10, 10, 12, 0.92)),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 28%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.login-card,
.settings-card,
.account-card {
  max-width: 560px;
  padding: 38px 32px;
}

.account-card,
.account-doc-card,
.login-card,
.settings-card {
  min-height: 0;
}

.account-card {
  background:
    linear-gradient(180deg, rgba(10, 10, 12, 0.98), rgba(8, 8, 10, 0.96)),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 28%);
}

.opening-card {
  padding: 18px;
}

#openingScreen .opening-card,
#openingScreen .screen-card {
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.screen-card h1,
.screen-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.screen-lead {
  margin: 14px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.login-form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.auth-provider-group {
  display: grid;
  gap: 10px;
  margin-bottom: 6px;
}

.provider-auth-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 13px 16px;
  font: inherit;
  text-align: center;
}

.provider-auth-button:disabled {
  opacity: 0.5;
}

.provider-auth-button-active {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.09);
}

.login-form .ghost-button {
  width: 100%;
}

.account-summary {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

#accountHint {
  margin-top: 16px;
}

.account-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.account-avatar-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.account-avatar-button:disabled {
  cursor: default;
}

.account-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.9), rgba(15, 118, 110, 0.95));
  box-shadow: 0 14px 32px rgba(20, 184, 166, 0.18);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.account-avatar.has-image {
  color: transparent;
}

.account-hero-copy {
  display: grid;
  gap: 4px;
}

.account-inline-edit-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.account-hero-copy strong {
  font-size: 20px;
  letter-spacing: 0.04em;
  font-family: var(--font-display);
  font-weight: 400;
}

.account-hero-copy span {
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.account-row-button {
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.account-row-button:hover {
  border-color: rgba(20, 184, 166, 0.26);
  background: rgba(20, 184, 166, 0.06);
}

.account-row-button:active {
  transform: scale(0.99);
}

.account-row-button.is-disabled {
  cursor: default;
}

.account-row-button.is-disabled:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.account-row-button.is-disabled:active {
  transform: none;
}

.account-language-row {
  padding-right: 12px;
  position: relative;
}

.account-language-picker {
  position: relative;
}

.account-language-trigger {
  min-width: 136px;
  max-width: 172px;
  border: 1px solid rgba(20, 184, 166, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 34px 9px 12px;
  font: inherit;
  font-size: 14px;
  text-align: right;
  cursor: pointer;
  text-align: right;
  transition: border-color 180ms ease, background-color 180ms ease;
  position: relative;
}

.account-language-trigger option {
  background: #111317;
  color: var(--text);
}

.account-language-trigger:hover {
  border-color: rgba(20, 184, 166, 0.36);
}

.account-language-trigger:focus {
  outline: none;
  border-color: rgba(20, 184, 166, 0.46);
  background-color: rgba(20, 184, 166, 0.08);
}

.account-language-trigger:disabled {
  opacity: 0.6;
  cursor: default;
}

.account-language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 156px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(20, 184, 166, 0.2);
  background: rgba(11, 12, 14, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  z-index: 20;
  display: grid;
  gap: 4px;
}

.account-language-menu[hidden] {
  display: none !important;
}

.account-language-option {
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: right;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.account-language-option:hover,
.account-language-option.is-active {
  background: rgba(20, 184, 166, 0.14);
  color: #f5fffd;
}

.account-label {
  color: var(--text-soft);
  font-size: 14px;
}

.account-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.subscription-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.subscription-header h1 {
  margin: 0;
}

.subscription-header-price {
  min-width: 168px;
  padding: 12px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.account-doc-card {
  max-width: 620px;
}

.account-doc-body {
  margin-top: 22px;
  display: grid;
  gap: 14px;
  max-height: 44vh;
  overflow-y: auto;
  padding: 18px 18px 18px 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.permissions-group {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.permissions-group h2 {
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  font-family: var(--font-ui);
  font-weight: 600;
}

.permission-row {
  align-items: center;
}

.permission-row .account-label {
  text-align: left;
}

.permission-row-disabled {
  opacity: 0.68;
}

.account-doc-body p {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  line-height: 1.85;
}

.feedback-form {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.feedback-textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 18px 20px;
  font: inherit;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .screen-overlay {
    align-items: start;
    place-items: start center;
    padding: 14px 12px calc(18px + env(safe-area-inset-bottom));
  }

  .screen-card {
    width: 100%;
    max-height: calc(100dvh - 28px - env(safe-area-inset-bottom));
    border-radius: 24px;
  }

  .login-card,
  .settings-card,
  .account-card {
    padding: 22px 18px 20px;
  }

  .account-hero {
    gap: 14px;
    margin-top: 18px;
    padding: 16px 16px;
    border-radius: 20px;
  }

  .account-summary {
    gap: 10px;
    margin-top: 18px;
  }

  .account-row {
    gap: 12px;
    padding: 12px 14px;
  }

  .account-label {
    font-size: 13px;
  }

  .account-row strong {
    font-size: 15px;
    text-align: right;
  }

  .account-doc-body {
    margin-top: 16px;
    max-height: none;
    padding: 14px 14px 16px;
    border-radius: 18px;
  }

  .feedback-form {
    margin-top: 16px;
  }

  .feedback-textarea {
    min-height: 180px;
    padding: 15px 16px;
  }

  .account-actions {
    margin-top: 16px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .subscription-header {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .subscription-header-price {
    min-width: 0;
    width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 15px;
  }
}

.feedback-textarea::placeholder {
  color: rgba(255, 255, 255, 0.24);
}

.account-actions .ghost-button,
.account-actions .primary-button,
.account-actions .account-logout-button {
  width: 100%;
}

.ui-primary-button {
  height: 56px;
  border: 0;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #10b981, #0ea5a4);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
  transition: box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
}

.ui-primary-button:hover {
  box-shadow: 0 8px 40px rgba(16, 185, 129, 0.3);
  filter: brightness(1.02);
}

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

.ui-ghost-button {
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.76);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 300;
  letter-spacing: 0.18em;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.ui-ghost-button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
}

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

.account-hero-back-button {
  width: 100%;
  margin-top: 18px;
}

.account-hero-back-icon {
  opacity: 0.82;
  font-size: 16px;
}

.account-logout-button {
  width: 100%;
}

.account-danger-button {
  border-color: rgba(239, 68, 68, 0.22);
  color: rgba(255, 214, 214, 0.9);
}

.account-danger-button:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.34);
  color: rgba(255, 236, 236, 0.98);
}

.account-logout-icon {
  color: rgba(255, 255, 255, 0.4);
  font-size: 17px;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle-btn {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 6px;
}

.password-toggle-btn:hover {
  color: var(--text);
}

.login-hint {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
}

.login-hint[data-tone="error"] {
  color: #f87171;
}

.login-hint[data-tone="success"] {
  color: #34d399;
}

.primary-button {
  margin-top: 22px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(90deg, #10b981, #0ea5a4);
  color: white;
  padding: 15px 22px;
  min-width: 168px;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.15);
  transition: box-shadow 180ms ease, transform 180ms ease, filter 180ms ease;
}

.primary-button:hover {
  box-shadow: 0 8px 40px rgba(16, 185, 129, 0.3);
  filter: brightness(1.02);
}

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

.opening-stage {
  position: relative;
  min-height: 68vh;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  align-items: end;
  border: 1px solid var(--line-soft);
  background: rgba(12, 12, 14, 0.72);
}

.opening-slides {
  position: absolute;
  inset: 0;
}

.opening-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 700ms ease, transform 1800ms ease;
}

.opening-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.slide-one {
  background:
    radial-gradient(circle at 24% 78%, rgba(20, 184, 166, 0.3), transparent 22%),
    linear-gradient(180deg, rgba(11, 10, 12, 0.3), rgba(11, 10, 12, 0.76)),
    linear-gradient(120deg, #182222 0%, #0f1212 42%, #050709 100%);
}

.slide-two {
  background:
    radial-gradient(circle at 76% 18%, rgba(255, 255, 255, 0.08), transparent 14%),
    radial-gradient(circle at 18% 80%, rgba(20, 184, 166, 0.22), transparent 20%),
    linear-gradient(180deg, rgba(11, 10, 12, 0.28), rgba(11, 10, 12, 0.72)),
    linear-gradient(135deg, #151a1a 0%, #0d0b0c 100%);
}

.slide-three {
  background:
    linear-gradient(180deg, rgba(16, 12, 13, 0.18), rgba(16, 12, 13, 0.78)),
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(20, 184, 166, 0.18), transparent 26%),
    linear-gradient(160deg, #171c1c 0%, #0b090a 65%);
}

.opening-copy {
  position: relative;
  z-index: 1;
  padding: 28px;
  background: linear-gradient(180deg, rgba(15, 11, 11, 0), rgba(15, 11, 11, 0.78) 36%, rgba(15, 11, 11, 0.92));
}

.opening-copy h2 {
  margin-top: 10px;
  font-size: clamp(28px, 4vw, 44px);
}

.opening-quote {
  max-width: 560px;
  margin: 14px 0 0;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(247, 236, 230, 0.9);
}

.opening-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 6px 6px;
}

.settings-placeholder {
  margin-top: 22px;
  min-height: 220px;
  border-radius: 24px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  font-size: 28px;
  color: rgba(247, 236, 230, 0.72);
  letter-spacing: 0.08em;
}

.app-shell {
  position: fixed;
  inset: 0;
  width: min(100%, 1380px);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 26px 22px 24px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line-soft);
  overflow-y: auto;
}

.sidebar-profile h2 {
  margin: 10px 0 0;
  font-size: 28px;
  letter-spacing: 0.01em;
}

.sidebar-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: white;
  background: linear-gradient(180deg, rgba(20, 184, 166, 0.92), rgba(13, 148, 136, 0.92));
  box-shadow: 0 0 28px rgba(20, 184, 166, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.sidebar-block {
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-block-controls {
  display: grid;
  gap: 14px;
}

.sidebar-actions {
  margin-top: auto;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.debug-block {
  display: grid;
  gap: 12px;
}

.debug-grid {
  display: grid;
  gap: 10px;
}

.debug-item {
  display: grid;
  gap: 4px;
}

.debug-label,
.debug-subtitle {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.debug-value,
.debug-inline {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}

.debug-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.debug-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  color: var(--text-soft);
}

.debug-section {
  display: grid;
  gap: 6px;
}

.debug-text {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-soft);
  word-break: break-word;
}

.assistant-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.assistant-action-button {
  border: 1px solid rgba(20, 184, 166, 0.28);
  background: rgba(20, 184, 166, 0.08);
  color: var(--text);
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font: inherit;
  transition: opacity 140ms ease, border-color 140ms ease, background 140ms ease;
}

.assistant-action-row.is-disabled .assistant-action-button,
.assistant-action-button:disabled {
  opacity: 0.45;
  cursor: default;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.chat-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 26px 14px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.96) 0%, rgba(8, 8, 10, 0.74) 72%, rgba(8, 8, 10, 0) 100%);
  backdrop-filter: blur(12px);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

.title-wrap {
  min-width: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.15em;
  font-family: var(--font-display);
}

.topbar .title-alias {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.08em;
  opacity: 0.38;
}

.onboarding-card {
  width: min(100vw, 480px);
  min-height: 100dvh;
  height: 100dvh;
  padding: 0;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #0d090a;
  box-shadow: none;
}

.onboarding-shell {
  position: relative;
  width: 100vw;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: #0d090a;
}

.onboarding-skip {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 8;
}

.onboarding-enter {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 12;
  transform: translateX(-50%);
  min-width: 188px;
  max-width: calc(100vw - 36px);
}

.onboarding-enter:not([hidden]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.onboarding-app {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  background: #0d090a;
}

.scene-stack,
.scene {
  position: relative;
  min-height: 100dvh;
}

.scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.85s ease;
}

.scene.is-active {
  opacity: 1;
  pointer-events: auto;
}

.scene-image {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
}

.scene-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(8, 7, 8, 0.18) 0%, rgba(8, 7, 8, 0.38) 100%),
    radial-gradient(circle at top, rgba(255, 223, 172, 0.05) 0%, rgba(0, 0, 0, 0) 32%);
}

.scene-dark {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, rgba(10, 8, 9, 0.42) 100%),
    url("/assets/scene01_opening.png");
  background-size: cover;
  background-position: center center;
}

.scene-cardbox {
  background:
    radial-gradient(circle at 50% 20%, rgba(241, 198, 120, 0.08) 0%, rgba(0, 0, 0, 0) 24%),
    linear-gradient(180deg, #171012 0%, #2d1c1d 56%, #120d0f 100%);
}

.placeholder-cardbox {
  position: absolute;
  inset: 0;
}

.placeholder-city {
  position: absolute;
  inset: 0 0 28% 0;
  background:
    radial-gradient(circle at 20% 70%, rgba(255, 206, 120, 0.15), rgba(0, 0, 0, 0) 16%),
    radial-gradient(circle at 60% 36%, rgba(255, 206, 120, 0.12), rgba(0, 0, 0, 0) 18%),
    radial-gradient(circle at 76% 62%, rgba(255, 206, 120, 0.10), rgba(0, 0, 0, 0) 15%),
    linear-gradient(180deg, rgba(35, 31, 36, 0.8) 0%, rgba(16, 14, 16, 0.4) 100%);
  filter: blur(6px);
}

.placeholder-desk {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 34vh;
  background: linear-gradient(180deg, #4a2c2d 0%, #180f10 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.placeholder-card {
  position: absolute;
  left: 50%;
  top: 57%;
  width: min(54vw, 228px);
  aspect-ratio: 1.62;
  transform: translate(-50%, -50%);
  border-radius: 18px;
  border: 1px solid rgba(213, 183, 139, 0.35);
  background: linear-gradient(180deg, rgba(109, 48, 54, 0.82) 0%, rgba(29, 18, 20, 0.94) 100%);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28);
}

.scene-image-form {
  background:
    radial-gradient(circle at 50% 20%, rgba(243, 189, 108, 0.1) 0%, rgba(0, 0, 0, 0) 32%),
    linear-gradient(180deg, #130f11 0%, #25181a 48%, #120d0f 100%);
}

.scene-video-shell {
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.opening-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
  transition: filter 260ms ease, transform 260ms ease;
}

.opening-video-dim {
  filter: brightness(0.58);
}

.onboarding-app.is-assessment-on[data-scene="C04_FORM_GUIDE"] .scene.is-active .opening-video {
  filter: blur(10px);
  transform: scale(1.02);
}

.opening-loop-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  animation: opening-loop-mask-pulse 2.2s ease-in-out infinite;
}

.opening-c04-mask {
  animation-duration: 2.2s;
}

@keyframes opening-loop-mask-pulse {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.overlay-opening-loop {
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.34));
}

.opening-ripple-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.opening-click-ripple {
  position: absolute;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  margin-top: -24px;
  border-radius: 999px;
  pointer-events: none;
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  background: radial-gradient(circle, rgba(245, 158, 11, 0.45) 0%, transparent 75%);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.3), inset 0 0 10px rgba(245, 158, 11, 0.3);
  animation: opening-click-ripple-burst 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes opening-click-ripple-burst {
  0% {
    transform: scale(0);
    opacity: 0.95;
  }
  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

.opening-pointer {
  position: absolute;
  left: 50%;
  top: calc(50% - 84px);
  transform: translateX(-50%);
  width: 28px;
  height: 42px;
  pointer-events: none;
}

.opening-pointer-c04 {
  top: calc(50% - 8px);
}

.opening-pointer-glow {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: blur(4px);
  animation: opening-pointer-glow-float 2s ease-in-out infinite;
}

.opening-pointer-core {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: opening-pointer-core-float 2s ease-in-out infinite;
}

.opening-pointer-dot {
  width: 6px;
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  background: #fbbf24;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.8);
  animation: opening-pointer-dot-pulse 1.5s linear infinite;
}

@keyframes opening-pointer-glow-float {
  0% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(6px); opacity: 0.8; }
  100% { transform: translateY(0); opacity: 0.4; }
}

@keyframes opening-pointer-core-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(8px); }
  100% { transform: translateY(0); }
}

@keyframes opening-pointer-dot-pulse {
  0% { opacity: 0.2; }
  50% { opacity: 1; }
  100% { opacity: 0.2; }
}

.opening-namecard {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  border-radius: 0;
}

.opening-namecard-trigger {
  width: min(86vw, 408px);
  height: min(58vw, 276px);
  transform: translate(-50%, -50%) translateY(56%);
}

.opening-assessment-trigger {
  left: 0;
  right: 0;
  top: 63.36%;
  bottom: 0;
  width: 100%;
  height: auto;
  transform: none;
  border-radius: 0;
}

.opening-assessment-trigger:disabled,
.opening-assessment-trigger[data-ready="false"] {
  pointer-events: none;
  cursor: default;
}

.opening-card-modal {
  width: min(100%, 420px);
  padding: 28px 24px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 9, 12, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

.opening-card-title {
  margin-bottom: 16px;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.96);
}

.opening-card-body {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.opening-card-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

.opening-card-body p:last-child {
  text-align: right;
  padding-right: 4px;
  color: rgba(255, 255, 255, 0.9);
}

.opening-card-modal .card-close {
  width: min(100%, 288px);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  margin-left: auto;
  margin-right: auto;
}

.overlay-dialog {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 18px;
  padding: clamp(28px, 9vh, 72px) clamp(18px, 6vw, 40px);
}

.overlay-c03 {
  position: absolute;
  inset: 0;
}

.overlay-c04-guide {
  z-index: 8;
}

.opening-fade-curtain {
  position: absolute;
  inset: 0;
  z-index: 49;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease;
}

.opening-fade-curtain.is-visible {
  opacity: 1;
}

.opening-subtitle {
  position: fixed;
  left: 50%;
  bottom: clamp(28px, 7vh, 58px);
  z-index: 48;
  width: min(calc(100% - 28px), 680px);
  max-width: calc(100vw - 28px);
  transform: translateX(-50%);
  padding: 0 10px;
  box-sizing: border-box;
  color: rgba(247, 242, 236, 0.96);
  font-size: clamp(15px, 4vw, 18px);
  line-height: 1.35;
  text-align: center;
  text-shadow:
    -1px -1px 0 rgba(0, 0, 0, 0.92),
    0 -1px 0 rgba(0, 0, 0, 0.92),
    1px -1px 0 rgba(0, 0, 0, 0.92),
    -1px 0 0 rgba(0, 0, 0, 0.92),
    1px 0 0 rgba(0, 0, 0, 0.92),
    -1px 1px 0 rgba(0, 0, 0, 0.92),
    0 1px 0 rgba(0, 0, 0, 0.92),
    1px 1px 0 rgba(0, 0, 0, 0.92),
    0 3px 14px rgba(0, 0, 0, 0.78);
  -webkit-text-stroke: 0.6px rgba(0, 0, 0, 0.96);
  paint-order: stroke fill;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease;
}

.opening-subtitle.is-visible {
  opacity: 1;
}

.scene[data-scene-id="C04_FORM_GUIDE"].is-active .opening-c04-mask {
  z-index: 3;
}

.scene[data-scene-id="C04_FORM_GUIDE"].is-active .opening-pointer,
.scene[data-scene-id="C04_FORM_GUIDE"].is-active .opening-assessment-trigger {
  z-index: 9;
}

.onboarding-app.is-assessment-on[data-scene="C04_FORM_GUIDE"] .opening-c04-mask,
.onboarding-app.is-assessment-on[data-scene="C04_FORM_GUIDE"] .opening-pointer-c04,
.onboarding-app.is-assessment-on[data-scene="C04_FORM_GUIDE"] .opening-assessment-trigger {
  opacity: 0;
  visibility: hidden;
}

.dialog-card {
  width: min(84vw, 408px);
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(215, 188, 151, 0.24);
  background: rgba(20, 14, 16, 0.82);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.dialog-card-hero {
  position: absolute;
  left: 50%;
  top: 19%;
  width: min(82vw, 610px);
  min-height: 190px;
  transform: translateX(-50%);
  padding: 26px 28px 22px;
  border-radius: 28px;
  border: 1px solid rgba(214, 185, 143, 0.26);
  background: linear-gradient(180deg, rgba(18, 14, 15, 0.78) 0%, rgba(12, 10, 11, 0.84) 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.dialog-line-hero {
  margin-top: 18px;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1.56;
  letter-spacing: 0.01em;
}

.voice-mark {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  width: 160px;
  height: 24px;
  margin-top: 18px;
}

.voice-mark span {
  width: 2px;
  border-radius: 999px;
  background: rgba(214, 185, 143, 0.88);
}

.voice-mark span:nth-child(1),
.voice-mark span:nth-child(14) { height: 4px; opacity: 0.42; }
.voice-mark span:nth-child(2),
.voice-mark span:nth-child(13) { height: 6px; opacity: 0.50; }
.voice-mark span:nth-child(3),
.voice-mark span:nth-child(12) { height: 8px; opacity: 0.58; }
.voice-mark span:nth-child(4),
.voice-mark span:nth-child(11) { height: 12px; opacity: 0.70; }
.voice-mark span:nth-child(5),
.voice-mark span:nth-child(10) { height: 10px; opacity: 0.66; }
.voice-mark span:nth-child(6),
.voice-mark span:nth-child(9) { height: 15px; opacity: 0.78; }
.voice-mark span:nth-child(7) { height: 21px; opacity: 1; }
.voice-mark span:nth-child(8) { height: 18px; opacity: 0.90; }

.dialog-card-lower {
  position: absolute;
  left: clamp(18px, 6vw, 40px);
  right: clamp(18px, 6vw, 40px);
  bottom: clamp(22px, 6vh, 52px);
}

.dialog-name {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(213, 183, 139, 0.92);
}

.dialog-line {
  margin: 10px 0 0;
  font-size: clamp(18px, 4.8vw, 20px);
  line-height: 1.72;
}

.hint-chip,
.card-close,
.desk-namecard {
  pointer-events: auto;
}

.hint-chip,
.card-close {
  appearance: none;
  border: 1px solid rgba(215, 188, 151, 0.24);
  background: rgba(18, 13, 15, 0.8);
  color: rgba(245, 238, 232, 0.92);
  cursor: pointer;
}

.hint-chip-bottom {
  position: absolute;
  left: 50%;
  bottom: 7.5vh;
  min-width: 236px;
  min-height: 58px;
  transform: translateX(-50%);
  border-radius: 18px;
  border-color: rgba(214, 185, 143, 0.34);
  background: rgba(18, 13, 15, 0.46);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  font-size: 15px;
  letter-spacing: 0.02em;
}

.desk-namecard {
  position: absolute;
  left: 50%;
  bottom: 18.5vh;
  width: min(58vw, 280px);
  aspect-ratio: 1.74;
  transform: translateX(-50%) rotate(-7deg);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.desk-namecard-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 2px;
  border: 2px solid rgba(188, 150, 92, 0.84);
  background: linear-gradient(180deg, rgba(26, 20, 19, 0.94) 0%, rgba(17, 13, 12, 0.98) 100%);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(255, 237, 206, 0.05);
}

.desk-namecard-inner::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(214, 185, 143, 0.58);
  pointer-events: none;
}

.desk-namecard-title {
  position: relative;
  color: #c89a58;
  font-size: clamp(28px, 8vw, 46px);
  letter-spacing: 0.08em;
  font-family: "Times New Roman", serif;
}

.desk-namecard-mark {
  position: relative;
  color: rgba(200, 154, 88, 0.88);
  font-size: 13px;
  letter-spacing: 0.32em;
}

.overlay-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.card-modal {
  width: min(86vw, 360px);
  padding: 24px;
  border-radius: 22px;
  border: 1px solid rgba(213, 183, 139, 0.42);
  background: rgba(20, 14, 16, 0.88);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.card-title {
  font-size: 30px;
  letter-spacing: 0.08em;
}

.card-meta {
  margin-top: 8px;
  font-size: 14px;
  color: #d6b98f;
}

.card-copy {
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(245, 238, 232, 0.76);
}

.card-close {
  min-height: 48px;
  margin-top: 24px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 14px;
}

.assessment-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.assessment-overlay[hidden] {
  display: none;
}

.assessment-overlay[data-host="opening"] .assessment-overlay-scrim {
  background: rgba(8, 7, 8, 0.18);
}

.assessment-overlay[data-host="chat"] .assessment-overlay-scrim {
  background: rgba(8, 8, 10, 0.68);
  backdrop-filter: blur(10px);
}

.assessment-overlay-scrim {
  position: absolute;
  inset: 0;
}

.assessment-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(92vw, 760px);
  padding: 26px 18px 24px;
  border-radius: 24px;
  border: 1px solid rgba(213, 183, 139, 0.28);
  background: linear-gradient(180deg, rgba(35, 24, 28, 0.94) 0%, rgba(18, 13, 15, 0.96) 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.assessment-overlay[data-host="chat"] .assessment-overlay-panel {
  width: min(92vw, 640px);
  margin-left: min(220px, 18vw);
}

.form-kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #d6b98f;
  text-transform: uppercase;
}

.form-header h1 {
  margin: 8px 0 0;
  font-size: clamp(24px, 6vw, 28px);
  font-weight: 600;
}

.voice-line {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: rgba(245, 238, 232, 0.76);
  line-height: 1.7;
  font-size: 15px;
}

.question-box {
  margin-top: 24px;
}

.question-progress {
  font-size: 12px;
  color: rgba(213, 183, 139, 0.88);
  letter-spacing: 0.14em;
}

.question-text {
  margin-top: 10px;
  font-size: clamp(21px, 5.4vw, 24px);
  line-height: 1.5;
}

.option-list {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  min-height: 56px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(213, 183, 139, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(245, 238, 232, 0.92);
  text-align: left;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.option-button.is-selected {
  border-color: rgba(20, 184, 166, 0.78);
  box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.2), 0 0 24px rgba(20, 184, 166, 0.14);
  background: rgba(11, 58, 53, 0.28);
  transform: translateY(-1px);
}

.topbar-signal {
  margin: 8px 0 0;
  min-height: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  opacity: 0.9;
}

.topbar-signal-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.topbar-signal-token img {
  display: block;
  width: 10px;
  height: 10px;
  object-fit: contain;
  opacity: 0.82;
  filter: brightness(0) saturate(100%) invert(89%) sepia(8%) saturate(307%) hue-rotate(357deg) brightness(90%) contrast(89%);
}

.topbar-signal-token.is-dash img {
  width: 12px;
  height: 8px;
}

.topbar-signal-token.is-letter-gap img {
  width: 6px;
  height: 6px;
  opacity: 0.56;
}

.topbar-signal-token.is-word-gap img {
  width: 10px;
  height: 10px;
  opacity: 0.9;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.topbar-icon-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  flex: 0 0 40px;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.topbar-icon-button:hover {
  border-color: rgba(16, 185, 129, 0.3);
  color: rgb(52, 211, 153);
  background: rgba(16, 185, 129, 0.1);
}

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

.topbar-icon-button.is-active {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  color: rgb(52, 211, 153);
}

.topbar-icon-button.is-active:hover {
  background: rgba(20, 184, 166, 0.1);
}

.topbar-icon-svg {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
  transition: color 180ms ease;
  overflow: visible;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.5);
}

.provider-switch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.constraint-switch {
  min-width: 100%;
}

.constraint-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.constraint-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.constraint-control strong {
  min-width: 40px;
  text-align: right;
  color: var(--text);
  font-size: 12px;
}

.provider-switch select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font: inherit;
  min-width: 118px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 8px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.5);
}

.relationship-strip {
  display: grid;
  gap: 10px;
}

.relationship-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(20, 184, 166, 0.26);
  background: rgba(20, 184, 166, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
}

.relationship-meter {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.relationship-meter i {
  display: block;
  width: 18%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, #2dd4bf 100%);
  box-shadow: 0 0 16px rgba(20, 184, 166, 0.3);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.76);
  border-radius: 18px;
  padding: 10px 14px;
  font-weight: 300;
  letter-spacing: 0.18em;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, color 180ms ease;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.92);
}

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

.global-fab-stack {
  position: fixed;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.global-fab {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 12, 14, 0.82);
  color: rgba(255, 248, 238, 0.96);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.global-fab-danger {
  color: #ffd9cf;
  border-color: rgba(215, 122, 97, 0.28);
}

.chat-list {
  min-height: 0;
  overflow-y: auto;
  padding: 10px 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

.bubble {
  max-width: min(75%, 640px);
  padding: 9px 12px;
  border-radius: 18px;
  line-height: 1.58;
  white-space: pre-wrap;
  animation: rise 240ms ease-out;
}

.bubble.assistant {
  align-self: flex-start;
  background: var(--assistant-bubble);
  border: 1px solid var(--line-soft);
  color: var(--text);
}

.bubble.user {
  align-self: flex-end;
  background: var(--user-bubble);
  border: 1px solid rgba(20, 184, 166, 0.24);
  color: var(--text);
}

.bubble.system {
  align-self: center;
  max-width: min(84%, 560px);
  padding: 0;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  text-align: center;
  box-shadow: none;
  backdrop-filter: none;
}

.bubble.system .bubble-body {
  font-size: 13px;
  line-height: 1.55;
}

.bubble-body {
  font-size: 15px;
  word-break: break-word;
}

.bubble-status {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.58);
}

.bubble.user.is-undelivered .bubble-status {
  color: rgba(127, 29, 29, 0.92);
}

.typing-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0 28px 12px;
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
}

.typing-row[hidden] {
  display: none !important;
}

.typing-avatar {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #14b8a6, #0f766e);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.dots {
  display: inline-flex;
  gap: 6px;
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.58);
  animation: blink 1s infinite ease-in-out;
}

.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

.composer {
  display: block;
  padding: 18px 28px calc(24px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8, 8, 10, 0.18), rgba(8, 8, 10, 0.9));
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-soft);
}

.composer-frame {
  position: relative;
  padding: 1.5px;
  border-radius: 32px;
  overflow: hidden;
}

.composer-border {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 240ms ease;
}

.composer-frame.is-focused .composer-border {
  opacity: 1;
}

.composer-border-run {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    rgba(20, 184, 166, 0) 0deg,
    rgba(20, 184, 166, 0.08) 110deg,
    rgba(45, 212, 191, 0.95) 180deg,
    rgba(20, 184, 166, 0.08) 250deg,
    rgba(20, 184, 166, 0) 360deg
  );
  animation: composer-spin 4.2s linear infinite;
}

.composer-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  border-radius: 30px;
  background: var(--bg-soft);
  padding: 0;
}

.composer textarea {
  min-height: 60px;
  max-height: 160px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 18px 20px;
  font: inherit;
  line-height: 1.5;
  background: rgba(10, 10, 12, 0.96);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02);
}

.composer textarea::placeholder {
  color: rgba(255, 255, 255, 0.24);
}

.composer-send-button {
  margin: 8px 8px 8px 0;
  min-width: 96px;
  height: 60px;
  padding: 0 22px;
  border-radius: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.18);
}

  .composer button:disabled,
  .ghost-button:disabled,
  .global-fab:disabled,
  .provider-switch select:disabled {
    opacity: 0.6;
  }

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    display: none;
  }

  .assessment-overlay[data-host="chat"] .assessment-overlay-panel {
    width: min(92vw, 640px);
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    padding: 18px 16px 12px;
  }

  .chat-list {
    padding: 8px 14px 18px;
  }

  .bubble {
    max-width: 88%;
  }

  .composer {
    padding: 14px 14px calc(16px + env(safe-area-inset-bottom));
  }

  .global-fab-stack {
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .global-fab {
    padding: 9px 12px;
    font-size: 12px;
  }

  .login-card,
  .settings-card {
    padding: 22px 18px;
  }

  .opening-stage {
    min-height: 58vh;
  }

  .opening-copy {
    padding: 22px 18px;
  }

  .opening-actions {
    justify-content: stretch;
    flex-direction: column;
    padding: 16px 0 0;
  }

  .opening-actions .ghost-button,
  .opening-actions .primary-button,
  .login-card .primary-button,
  .settings-card .primary-button {
    width: 100%;
  }
}

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

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes composer-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
