:root {
  --bg: #030711;
  --panel: rgba(9, 15, 27, 0.78);
  --panel-strong: rgba(13, 21, 35, 0.92);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(148, 163, 184, 0.32);
  --text: #f8fafc;
  --soft: #dce5f3;
  --muted: #9ca8bb;
  --blue: #2d6bff;
  --blue-2: #2cc6ff;
  --mint: #9cf2c8;
  --gold: #ffb238;
  --danger: #ff5a63;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.4);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030711;
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
.disabled {
  cursor: not-allowed;
}

a {
  color: #55a3ff;
  text-decoration: none;
}

input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  display: none;
  width: 0;
  height: 0;
}

input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-caps-lock-indicator {
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.loading-screen,
.login-screen,
.setup-screen,
.app-screen {
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.24), transparent 28%),
    linear-gradient(90deg, rgba(1, 5, 13, 0.98) 0%, rgba(4, 10, 20, 0.86) 36%, rgba(4, 10, 20, 0.38) 100%),
    url("/site-assets/img/newpictures/memoryclone_bg.jpg") center center / cover no-repeat,
    var(--bg);
}

.loading-screen {
  display: grid;
  place-items: center;
}

.loading-card {
  width: min(420px, calc(100vw - 40px));
  padding: 34px 38px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: rgba(18, 25, 37, 0.84);
  box-shadow: var(--shadow);
  text-align: center;
  backdrop-filter: blur(20px);
}

.ring {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--blue-2);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-card h1,
.login-brand h1,
.setup-brand h1 {
  margin: 0;
  letter-spacing: -0.05em;
}

.loading-card p,
.loading-card strong,
.login-brand p,
.setup-brand p,
.sub,
.privacy-note {
  color: var(--muted);
}

.progress {
  height: 7px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--blue-2), var(--mint));
}

.progress.slim {
  height: 6px;
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: clamp(150px, 14vw, 260px);
  overflow-y: auto;
}

.update-required-screen {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  background:
    radial-gradient(circle at 50% 24%, rgba(45, 107, 255, 0.22), transparent 34%),
    linear-gradient(90deg, rgba(1, 5, 13, 0.96) 0%, rgba(4, 10, 20, 0.76) 48%, rgba(4, 10, 20, 0.42) 100%),
    url("/site-assets/img/newpictures/memoryclone_bg.jpg") center center / cover no-repeat,
    var(--bg);
}

.update-required-card {
  width: min(620px, calc(100vw - 40px));
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: rgba(8, 14, 25, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.update-required-card h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.update-required-card p {
  color: var(--muted);
  line-height: 1.55;
}

.update-required-card .brand-row {
  margin-bottom: 22px;
}

.update-required-card .setup-stats {
  margin: 20px 0;
}

.login-wrap {
  width: 486px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 0;
}

.login-brand,
.setup-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.login-brand h1,
.setup-brand h1 {
  font-size: 42px;
  line-height: 1;
}

.login-brand p,
.setup-brand p {
  margin: 9px 0 0;
  font-size: 16px;
}

.brand-logo,
.mini-logo {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 64%),
    rgba(255, 255, 255, 0.08) url("/site-assets/img/logo-memoryclone.png") center / 74% 74% no-repeat;
  box-shadow: inset 0 1px 18px rgba(255, 255, 255, 0.08), 0 14px 36px rgba(0, 0, 0, 0.25);
}

.brand-logo {
  width: 70px;
  height: 70px;
  border-radius: 16px;
}

.mini-logo {
  width: 39px;
  height: 39px;
  border-radius: 12px;
}

.login-card,
.setup-card,
.wizard-card,
.usage-card,
.profile-menu,
.memory-card,
.settings-grid,
.review-box,
.plan-card-large {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.login-card {
  padding: 30px 34px 26px;
  border-radius: 28px;
}

.login-card h2,
.setup-page h2,
.wizard-section h2,
.panel-title h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.login-card .sub {
  margin: 10px 0 22px;
}

label {
  display: block;
  margin: 0 0 9px;
  color: var(--soft);
  font-weight: 650;
  font-size: 14px;
}

label small {
  color: var(--muted);
  font-weight: 500;
}

input,
.field {
  width: 100%;
  height: 48px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(8, 14, 25, 0.78);
  outline: none;
}

input {
  padding: 0 16px;
}

input::placeholder {
  color: rgba(220, 229, 243, 0.62);
}

.field {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  margin-bottom: 16px;
  overflow: hidden;
}

.field input {
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 18px;
}

.field-icon {
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(220, 229, 243, 0.72);
}

.password-field {
  grid-template-columns: 1fr 54px;
}

.eye-btn {
  height: 100%;
  width: 54px;
  display: grid;
  place-items: center;
  border: 0;
  border-left: 1px solid var(--line);
  color: white;
  background: rgba(255, 255, 255, 0.13);
}

.eye-btn svg {
  width: 22px;
  height: 22px;
}

.login-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--soft);
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--danger);
}

.primary-btn,
.secondary-btn,
.plan-btn,
.send-btn {
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  color: white;
}

.primary-btn {
  min-height: 50px;
  padding: 0 24px;
  background: linear-gradient(135deg, #246bff, #3154ff);
  box-shadow: 0 15px 36px rgba(36, 107, 255, 0.24);
}

.primary-btn:disabled,
.primary-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
  filter: grayscale(0.2);
}

.primary-btn.full,
.secondary-btn.full {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.primary-btn.full {
  justify-content: center;
  position: relative;
  padding: 0 24px;
}

.btn-arrow {
  position: absolute;
  right: 24px;
}

.secondary-btn {
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.plan-btn {
  min-height: 48px;
  padding: 0 22px;
  color: #05070b;
  background: linear-gradient(100deg, var(--gold), var(--mint));
}

.status {
  min-height: 18px;
  margin-top: 10px;
  color: #ffd7dc;
}

.status:empty {
  display: none;
}

.divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  color: var(--muted);
}

.divider span {
  height: 1px;
  background: var(--line);
}

.divider em {
  font-style: normal;
}

.privacy-note {
  margin: 14px 0 0;
  text-align: center;
  line-height: 1.5;
}

.setup-screen {
  display: grid;
  place-items: center;
  padding: 28px;
}

.setup-card {
  width: min(760px, calc(100vw - 56px));
  border-radius: 28px;
  padding: 34px;
}

.setup-brand {
  margin-bottom: 24px;
}

.setup-topline,
.step-indicator,
.setup-nav,
.wizard-actions,
.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.setup-topline {
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.setup-topline span,
.step-indicator,
.eyebrow,
.side-section,
.source-card em {
  color: var(--blue-2);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.step-indicator {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.setup-page {
  padding-top: 24px;
}

.setup-page p,
.wizard-section p,
.panel-title p,
.help-text {
  color: var(--muted);
  line-height: 1.55;
}

.alpha-note {
  margin: 16px 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 180, 72, 0.28);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  background: rgba(255, 180, 72, 0.06);
  color: var(--text);
}

.alpha-note strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.alpha-note p {
  max-width: 760px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.alpha-note small {
  display: block;
  margin-top: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.license-card {
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.license-card div {
  display: flex;
  justify-content: space-between;
  margin: 10px 0;
}

.ok-text {
  color: var(--mint) !important;
}

.policy-check {
  align-items: flex-start;
  margin-top: 18px;
  margin-bottom: 24px;
}

.policy-check span {
  line-height: 1.45;
}

.app-screen {
  padding: 0;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 360px 1fr;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgba(4, 9, 17, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px);
  position: relative;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(1, 5, 13, 0.48);
  backdrop-filter: blur(5px);
}

.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: rgba(8, 14, 25, 0.96);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.46);
}

.modal-card strong {
  display: block;
  padding-right: 30px;
  font-size: 20px;
}

.modal-card p {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

.update-progress {
  margin: 16px 0 18px;
}

.update-progress small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.notice-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 22px;
}

.notice-action {
  min-width: 140px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 18, 31, 0.82), rgba(5, 10, 18, 0.78));
}

.side-brand {
  height: 74px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  font-size: 23px;
  letter-spacing: -0.035em;
}

.app-version {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.side-brand .update-icon-btn {
  margin-left: 0;
}

.update-icon-btn {
  width: 34px;
  height: 34px;
  margin-left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 184, 77, 0.65);
  border-radius: 12px;
  color: #ffd08a;
  background: rgba(255, 170, 50, 0.16);
  box-shadow: 0 0 0 0 rgba(255, 170, 50, 0.48), 0 0 24px rgba(255, 170, 50, 0.22);
  cursor: pointer;
  animation: updatePulse 1.8s ease-in-out infinite;
}

.update-icon-btn svg {
  width: 19px;
  height: 19px;
}

.update-icon-btn.required {
  color: #fff1d6;
  border-color: rgba(255, 131, 67, 0.78);
  background: rgba(255, 101, 55, 0.22);
}

.usage-card.offline {
  border-color: rgba(255, 178, 56, 0.36);
}

.usage-card small {
  display: block;
  margin-top: 6px;
  color: #ffd08a;
  font-size: 12px;
  line-height: 1.35;
}

@keyframes updatePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 170, 50, 0.42), 0 0 20px rgba(255, 170, 50, 0.18); }
  50% { box-shadow: 0 0 0 8px rgba(255, 170, 50, 0), 0 0 30px rgba(255, 170, 50, 0.34); }
}

.side-section {
  padding: 22px 24px 12px;
}

.side-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.round-plus {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 22px;
}

.round-plus.muted {
  color: var(--gold);
}

.create-clone-btn {
  margin: 0 24px 14px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  font-weight: 750;
  background: rgba(255, 255, 255, 0.055);
}

.create-clone-btn.muted {
  color: var(--gold);
  background: rgba(255, 178, 56, 0.08);
}

.clone-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 14px 18px;
}

.clone-nav-block {
  margin-bottom: 8px;
}

.clone-item {
  width: 100%;
  display: grid;
  grid-template-columns: 58px 1fr 10px;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  color: var(--text);
  text-align: left;
  background: transparent;
}

.clone-item.compact {
  grid-template-columns: 38px 1fr 9px;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: 14px;
}

.clone-item.active {
  border-color: rgba(45, 107, 255, 0.75);
  background: linear-gradient(90deg, rgba(45, 107, 255, 0.35), rgba(255, 255, 255, 0.045));
}

.clone-item strong,
.usage-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clone-item em,
.usage-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.clone-item i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #44dec2;
}

.clone-nav-block.archived .clone-item {
  opacity: 0.76;
}

.clone-item i.archived {
  background: #8994a7;
  box-shadow: none;
}

.avatar.tiny {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.threads-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 8px 48px;
  padding: 0 4px 0 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.thread-list {
  display: grid;
  gap: 8px;
  padding: 0 0 8px 48px;
}

.thread-row {
  display: grid;
  grid-template-columns: 1fr 32px;
  gap: 8px;
  align-items: center;
}

.thread-item {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--soft);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
}

.thread-item.active {
  border-color: rgba(45, 107, 255, 0.56);
  background: rgba(45, 107, 255, 0.22);
}

.thread-item span,
.thread-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item small {
  margin-top: 3px;
  color: var(--muted);
}

.thread-delete {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 90, 99, 0.4);
  border-radius: 50%;
  color: #ffb4ba;
  background: rgba(255, 90, 99, 0.1);
  font-size: 18px;
}

.avatar {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d8e3f2, #37465b 46%, #101827 100%);
  color: white;
  font-weight: 800;
}

.avatar.large {
  width: 58px;
  height: 58px;
}

.empty-clones {
  margin: 0 10px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
}

.empty-clones strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
}

.account-dock {
  position: relative;
  padding: 14px;
}

.usage-card {
  padding: 18px;
  border-radius: 18px;
  box-shadow: none;
}

.compact-plan {
  width: 100%;
  margin-top: 16px;
}

.profile-menu {
  position: relative;
  margin-top: 10px;
  border-radius: 18px;
  box-shadow: none;
  overflow: visible;
}

.profile-summary {
  width: 100%;
  border: 0;
  color: var(--text);
  text-align: left;
  background: transparent;
  padding: 15px 18px;
  cursor: pointer;
  font-weight: 700;
}

.profile-popover {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 14, 25, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.profile-menu.open .profile-popover {
  display: block;
}

.menu-row {
  width: 100%;
  display: block;
  padding: 12px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--soft);
  text-align: left;
  background: transparent;
}

.menu-row.danger {
  color: #ffb4ba;
}

.main-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.workspace-head {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.clone-heading {
  display: flex;
  align-items: center;
  gap: 16px;
}

.clone-heading h1 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.clone-heading p {
  margin: 3px 0 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.tabs button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.tabs button.active {
  color: white;
  background: rgba(45, 107, 255, 0.24);
}

.chat-view {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px;
}

.day-pill {
  justify-self: center;
  padding: 10px 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.messages {
  min-height: 0;
  overflow: auto;
  padding: 24px 14px 24px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.messages::-webkit-scrollbar,
.wizard-view::-webkit-scrollbar,
.brain-view::-webkit-scrollbar,
.settings-view::-webkit-scrollbar {
  width: 8px;
}

.messages::-webkit-scrollbar-thumb,
.wizard-view::-webkit-scrollbar-thumb,
.brain-view::-webkit-scrollbar-thumb,
.settings-view::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
}

.chat-empty {
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.chat-empty h2 {
  margin: 0 0 10px;
  color: var(--text);
}

.message {
  display: flex;
  margin: 18px 0;
}

.message.user {
  justify-content: flex-end;
}

.bubble {
  max-width: min(560px, 68%);
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.07);
}

.message.user .bubble {
  border-color: rgba(45, 107, 255, 0.5);
  background: linear-gradient(145deg, #1454d9, #0f77a9);
}

.history-toggle {
  display: block;
  margin: 0 auto 14px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 38px;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--soft);
  animation: typingPulse 1.1s infinite ease-in-out;
}

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

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

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

.composer {
  position: relative;
  display: grid;
  grid-template-columns: 58px 1fr 78px;
  gap: 12px;
  align-items: center;
}

.composer input {
  height: 58px;
  border-radius: 999px;
  padding: 0 24px;
}

.mic-btn,
.send-btn {
  height: 58px;
  border: 0;
  border-radius: 999px;
}

.mic-btn {
  color: var(--soft);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
}

.send-btn {
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.danger-btn {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(255, 90, 99, 0.42);
  border-radius: 14px;
  color: #ffd7dc;
  font-weight: 750;
  background: rgba(255, 90, 99, 0.11);
}

.mic-disabled {
  opacity: 0.62;
  cursor: help;
}

.composer-status {
  position: absolute;
  left: 76px;
  bottom: -25px;
}

.inline-link {
  display: inline;
  border: 0;
  color: #74b6ff;
  background: transparent;
  font-weight: 750;
  text-decoration: underline;
}

.wizard-view,
.plan-required,
.brain-view,
.map-view,
.settings-view {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: clamp(22px, 3vw, 34px);
}

.map-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.map-view::-webkit-scrollbar {
  width: 8px;
}

.map-view::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
}

.map-grid {
  display: grid;
  gap: 12px;
}

.map-stats {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.map-stats article,
.map-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.map-stats article {
  padding: 16px;
}

.map-stats span,
.map-muted,
.map-person span,
.map-relationship span,
.map-reaction span,
.map-emotion span,
.map-panel small {
  color: var(--muted);
}

.map-stats strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.map-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.map-panel {
  padding: 18px;
}

.map-panel h3 {
  margin: 0 0 14px;
  font-size: 17px;
}

.evidence-panel {
  margin: 18px 0;
  border-color: rgba(45, 107, 255, 0.34);
}

.evidence-panel .map-row-head h3 {
  margin-bottom: 0;
}

.evidence-panel .map-row-head strong {
  color: #9fd7ff;
  font-size: 13px;
  text-transform: uppercase;
}

.evidence-panel p {
  margin: 13px 0 7px;
  color: var(--text);
  line-height: 1.5;
}

.map-person,
.map-relationship,
.map-reaction,
.map-emotion {
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.map-person:first-of-type,
.map-relationship:first-of-type,
.map-reaction:first-of-type,
.map-emotion:first-of-type {
  border-top: 0;
}

.map-person div,
.map-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.map-person small,
.map-relationship small,
.map-reaction small,
.map-emotion small {
  display: block;
  margin-top: 6px;
}

.map-score {
  display: grid;
  grid-template-columns: 78px 1fr 42px;
  gap: 9px;
  align-items: center;
  margin-top: 9px;
  font-size: 12px;
}

.map-score i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.map-score b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #8ff0bd);
}

.map-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.map-rules span {
  max-width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.04);
}

.plan-required {
  display: grid;
  place-items: center;
}

.plan-card-large {
  width: min(680px, 100%);
  padding: 36px;
  border-radius: 28px;
}

.plan-card-large h1 {
  margin: 10px 0 12px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 0.95;
}

.plan-card-large p {
  max-width: 560px;
  color: var(--soft);
  line-height: 1.55;
}

.plan-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.wizard-head,
.panel-title {
  max-width: 840px;
}

.wizard-head span,
.panel-title span {
  color: var(--gold);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 850;
}

.wizard-head h1 {
  margin: 10px 0 10px;
  font-size: clamp(30px, 3.35vw, 46px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.wizard-head p {
  color: var(--muted);
  line-height: 1.55;
  max-width: 700px;
}

.wizard-card {
  width: min(940px, 100%);
  max-width: none;
  margin-top: 22px;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: 24px;
  box-shadow: none;
}

.wizard-section.narrow {
  max-width: 720px;
}

.wizard-section label {
  margin-bottom: 14px;
}

.wizard-section label input {
  display: block;
  margin-top: 7px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.source-card {
  min-height: 138px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.045);
}

.source-card.disabled {
  min-height: 74px;
  padding: 14px 16px;
}

.source-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 10px;
}

.source-card strong small {
  color: var(--cyan);
  font-size: 11px;
  text-transform: uppercase;
}

.source-card span {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.source-card em {
  display: block;
  margin-top: 14px;
}

.source-card.selected {
  border-color: rgba(68, 222, 194, 0.7);
  background: linear-gradient(145deg, rgba(36, 107, 255, 0.24), rgba(68, 222, 194, 0.1));
}

.source-card.disabled { opacity: 0.42; }

.source-card.disabled strong {
  margin-bottom: 0;
}

.help-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}

.help-tabs button,
.sender-picker button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(101, 217, 255, 0.26);
  border-radius: 999px;
  color: rgba(232, 240, 255, 0.82);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.help-tabs button:hover,
.sender-picker button:hover {
  transform: translateY(-1px);
  color: white;
  border-color: rgba(101, 217, 255, 0.48);
  background: rgba(45, 107, 255, 0.18);
}

.help-tabs button.active,
.sender-picker button.active {
  color: white;
  border-color: rgba(45, 107, 255, 0.72);
  background: rgba(45, 107, 255, 0.26);
}

.tutorial-panel {
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.sender-picker button small {
  margin-left: 5px;
  color: var(--muted);
}

.wizard-actions {
  margin-top: 22px;
}

.wizard-actions.split {
  justify-content: space-between;
}

.instructions {
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.upload-wide {
  width: 100%;
  margin: 10px 0 18px;
}

.or-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.or-divider span {
  height: 1px;
  background: var(--line);
}

.phone-upload-card {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.phone-upload-card > div:first-child strong,
.phone-upload-card > div:first-child span,
.phone-upload-card > div:first-child small {
  display: block;
}

.phone-upload-card > div:first-child span,
.phone-upload-card > div:first-child small,
.phone-upload-live span,
.phone-upload-live small {
  color: var(--muted);
}

.phone-upload-card > div:first-child small {
  margin-top: 5px;
  color: #f6c86c;
}

.phone-upload-card > button {
  width: 100%;
  margin-top: 12px;
}

.phone-upload-live {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.phone-upload-live img {
  width: 132px;
  height: 132px;
  padding: 8px;
  border-radius: 12px;
  background: white;
}

.phone-upload-live a {
  display: block;
  max-width: 100%;
  margin: 4px 0;
  color: #65d9ff;
  overflow-wrap: anywhere;
}

.phone-upload-live small {
  display: block;
  margin-bottom: 10px;
}

.wizard-next-group {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.link-btn {
  border: 0;
  background: transparent;
  color: #65d9ff;
  font-weight: 900;
  cursor: pointer;
  padding: 10px 4px;
}

.link-btn:hover {
  color: #9ee7ff;
}

.file-list {
  display: grid;
  gap: 10px;
}

.import-summary {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.detected-conversations {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 13px;
}

.detected-conversations summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--text);
  font-weight: 700;
}

.detected-conversations > div {
  display: grid;
  gap: 5px;
  max-height: 180px;
  overflow: auto;
  padding: 0 12px 11px;
}

.detected-conversations span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-hint {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(260px, 520px) 38px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.file-row strong,
.file-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row span,
.file-row em {
  margin-top: 3px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.file-row input {
  height: 42px;
}

.file-remove {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 90, 99, 0.46);
  border-radius: 50%;
  color: #ffb4ba;
  background: rgba(255, 90, 99, 0.12);
  font-size: 20px;
  line-height: 1;
}

.sender-picker {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.sender-picker.prominent {
  margin: 0 0 18px;
  border-color: rgba(101, 217, 255, 0.42);
  background: linear-gradient(135deg, rgba(45, 107, 255, 0.12), rgba(101, 217, 255, 0.06));
}

.sender-picker strong,
.sender-picker span {
  display: block;
}

.sender-picker span {
  margin: 4px 0 12px;
  color: var(--muted);
}

.sender-picker div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
}

.review-box {
  display: grid;
  gap: 12px;
  margin: 20px 0;
  padding: 18px;
  border-radius: 18px;
  box-shadow: none;
}

.brain-pager,
.memory-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brain-pager {
  justify-content: space-between;
  margin: 14px 0 18px;
  color: var(--muted);
}

.memory-card-actions {
  margin-top: 12px;
}

.memory-card-actions .secondary-btn,
.brain-pager .secondary-btn {
  min-height: 36px;
  padding: 0 14px;
}

.memory-context {
  margin-top: 12px;
  padding: 12px;
  border-left: 2px solid rgba(68, 222, 194, 0.5);
  border-radius: 12px;
  background: rgba(68, 222, 194, 0.055);
}

.memory-context b {
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.memory-context p {
  margin: 6px 0 0;
  color: var(--soft);
}

.review-box div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.review-box span {
  color: var(--muted);
}

.import-progress {
  margin: 18px 0;
}

.progress-meta {
  margin-top: 8px;
  color: var(--muted);
}

.error-text {
  color: #ffb4ba;
}

.wizard-bottom {
  width: min(940px, 100%);
  max-width: none;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: 18px;
}

.brain-search {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 12px;
  margin: 24px 0 8px;
}

.memory-results {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.memory-card {
  padding: 18px;
  border-radius: 18px;
  box-shadow: none;
}

.memory-card p {
  white-space: pre-wrap;
  color: var(--soft);
  line-height: 1.45;
}

.memory-card small {
  color: var(--muted);
}

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

.identity-mode-card {
  text-align: left;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}

.identity-mode-card strong,
.identity-mode-card span {
  display: block;
}

.identity-mode-card span {
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.35;
}

.identity-mode-card.selected {
  border-color: rgba(57, 126, 255, 0.78);
  background: rgba(34, 96, 214, 0.22);
}

.memory-context {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.memory-context b {
  display: block;
  margin-bottom: 6px;
  color: #dce7f8;
  font-size: 12px;
  text-transform: uppercase;
}

.memory-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.memory-step-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.sender-hit,
.phrase-hit {
  border-radius: 5px;
  padding: 0 4px;
}

.sender-hit {
  color: #1a1200;
  background: #f7c948;
}

.phrase-hit {
  color: #fdf8e7;
  background: rgba(247, 201, 72, 0.28);
}

.settings-grid {
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  padding: 22px;
  border-radius: 22px;
  box-shadow: none;
}

.panel-title.with-action,
.wizard-head.with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-title.with-action > div,
.wizard-head.with-action > div {
  min-width: 0;
}

.compact-back {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
}

.settings-grid label.wide,
.settings-actions,
.settings-grid .status {
  grid-column: 1 / -1;
}

.settings-mode-field select {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
  border: 1px solid rgba(140, 160, 190, 0.28);
  border-radius: 12px;
  background: #090f1a;
  color: var(--text);
  font: inherit;
  font-weight: 750;
  padding: 0 42px 0 14px;
  outline: none;
}

.settings-mode-field select:focus {
  border-color: rgba(55, 120, 255, 0.85);
  box-shadow: 0 0 0 3px rgba(55, 120, 255, 0.16);
}

.settings-view .panel-title.with-action {
  width: 100%;
  max-width: none;
}

.settings-grid small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.settings-readonly input {
  color: #aab6c9;
  background: rgba(255, 255, 255, 0.025);
  cursor: default;
}

.settings-readonly small {
  display: block;
  margin-top: 6px;
  color: #8f9db3;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.35;
}

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

.settings-blueprint {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 11px 14px;
  border: 1px solid rgba(116, 182, 255, 0.2);
  border-radius: 12px;
  background: rgba(55, 120, 255, 0.06);
}

.settings-blueprint strong {
  white-space: nowrap;
  flex: 0 0 auto;
}

.settings-blueprint span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
  flex: 1 1 260px;
}

.settings-blueprint:not(:has(+ *)) {
  margin-bottom: 0;
}

.settings-save-status {
  min-height: 18px;
  margin: 0;
  color: #9fe8cf;
  font-size: 13px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 1120px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-period {
    grid-template-columns: 1fr 1fr;
  }

  .login-screen {
    justify-content: center;
    padding-left: 0;
  }

  .app-shell {
    grid-template-columns: 310px 1fr;
  }

  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-height: 760px) {
  .login-wrap {
    min-height: 100vh;
    transform: scale(0.92);
  }

  .login-brand {
    margin-bottom: 22px;
  }

  .login-card {
    padding: 28px 30px 24px;
  }
}

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

  .sidebar {
    display: none;
  }

  .file-row {
    grid-template-columns: 1fr 38px;
  }

  .file-row input,
  .file-row em {
    grid-column: 1 / -1;
  }

  .map-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .map-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-score {
    grid-template-columns: 68px 1fr 38px;
  }

  .phone-upload-live {
    grid-template-columns: 1fr;
  }

  .phone-upload-live img {
    justify-self: center;
  }
}
