:root {
  --bg: #050711;
  --screen: #080d18;
  --screen-soft: #0d1423;
  --surface: #121a2c;
  --surface-2: #18223a;
  --surface-3: #202c47;
  --text: #f3f6ff;
  --muted: #8d99b8;
  --faint: #5d6885;
  --accent: #6fe7c8;
  --accent-strong: #36c9a7;
  --accent-soft: rgba(111, 231, 200, 0.14);
  --violet: #8b7cff;
  --danger: #ff718b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --bubble-in: #151f35;
  --bubble-out: #145a4f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 18px;
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(65, 53, 148, 0.18), transparent 35%),
    radial-gradient(circle at 82% 82%, rgba(26, 124, 113, 0.15), transparent 40%),
    #03050b;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.24;
  pointer-events: none;
}

.ambient-one {
  left: -18vw;
  top: -14vw;
  background: #5b42d9;
}

.ambient-two {
  right: -20vw;
  bottom: -18vw;
  background: #138a78;
  opacity: 0.18;
}

.phone-wrap {
  position: relative;
  display: grid;
  place-items: center;
  height: 100vh;
  height: 100dvh;
  padding: 10px;
}

.phone {
  position: relative;
  width: min(430px, calc(100vw - 20px));
  height: min(886px, calc(100dvh - 20px));
  padding: 9px;
  border-radius: 54px;
  background:
    linear-gradient(145deg, #3a3f4d 0%, #0b0d14 18%, #03050a 55%, #20242f 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.09),
    0 34px 90px rgba(0, 0, 0, 0.7),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.phone::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  pointer-events: none;
}

.phone-button {
  position: absolute;
  width: 3px;
  border-radius: 3px;
  background: #252a36;
  box-shadow: inset 0 0 1px rgba(255, 255, 255, 0.2);
}

.phone-button-left {
  left: -2px;
  top: 155px;
  height: 68px;
}

.phone-button-left::after {
  content: "";
  position: absolute;
  top: 84px;
  width: 3px;
  height: 42px;
  border-radius: 3px;
  background: #252a36;
}

.phone-button-right {
  right: -2px;
  top: 178px;
  height: 94px;
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 45px;
  background: var(--screen);
  isolation: isolate;
}

.screen-glare {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.055) 0%, transparent 25%),
    radial-gradient(circle at 78% -12%, rgba(255, 255, 255, 0.055), transparent 34%);
  border-radius: inherit;
}

.status-bar {
  position: absolute;
  z-index: 45;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
  padding: 0 23px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.dynamic-island {
  position: absolute;
  left: 50%;
  top: 9px;
  width: 94px;
  height: 25px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.045);
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-icon {
  width: 14px;
  height: 11px;
  fill: currentColor;
}

.status-icon:nth-child(2) {
  width: 13px;
}

.battery {
  position: relative;
  width: 22px;
  height: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 3px;
  padding: 1.5px;
}

.battery::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 2px;
  width: 2px;
  height: 4px;
  border-radius: 0 2px 2px 0;
  background: rgba(255, 255, 255, 0.75);
}

.battery-level {
  display: block;
  width: 78%;
  height: 100%;
  border-radius: 1px;
  background: var(--text);
}

.screen-content {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: view-in 240ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: var(--accent);
}

.setup-view {
  padding: 74px 30px var(--safe-bottom);
  overflow-y: auto;
  background:
    radial-gradient(circle at 74% 8%, rgba(139, 124, 255, 0.22), transparent 36%),
    radial-gradient(circle at 10% 66%, rgba(111, 231, 200, 0.11), transparent 38%),
    linear-gradient(180deg, #0a1020 0%, #070b14 100%);
}

.setup-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  right: -120px;
  top: 60px;
  border-radius: 50%;
  background: rgba(111, 231, 200, 0.09);
  filter: blur(14px);
  pointer-events: none;
}

.brand-mark {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: linear-gradient(145deg, rgba(111, 231, 200, 0.2), rgba(139, 124, 255, 0.14));
  border: 1px solid rgba(111, 231, 200, 0.25);
  box-shadow: 0 18px 44px rgba(56, 201, 167, 0.12);
  margin-bottom: 28px;
}

.brand-mark svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
}

.brand-mark .brand-mark-light {
  fill: rgba(111, 231, 200, 0.9);
  stroke: none;
}

.brand-mark .brand-mark-line {
  stroke: var(--accent);
  opacity: 0.7;
}

.setup-view h1 {
  margin: 12px 0 8px;
  max-width: 280px;
  font-size: 31px;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.setup-subtitle {
  margin: 0 0 30px;
  max-width: 280px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.avatar-picker {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 1.5px dashed rgba(111, 231, 200, 0.45);
  background: rgba(111, 231, 200, 0.06);
  transition: border-color 180ms ease, background 180ms ease;
  align-self: flex-start;
}

.avatar-picker:hover {
  border-color: var(--accent);
  background: rgba(111, 231, 200, 0.1);
}

.avatar-picker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-picker-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 100%;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.avatar-picker-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

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

.field > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.field input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 13px 15px;
  font-size: 15px;
  transition: border-color 160ms ease, background 160ms ease;
}

.field input::placeholder {
  color: var(--faint);
}

.field input:focus {
  border-color: rgba(111, 231, 200, 0.6);
  background: rgba(111, 231, 200, 0.045);
  outline: none;
}

.form-error {
  margin: -4px 0 0;
  font-size: 12px;
  color: var(--danger);
}

.primary-button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #48d6bc 55%, #8b7cff 160%);
  color: #04110e;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 36px rgba(54, 201, 167, 0.2);
  transition: transform 150ms ease, filter 150ms ease, opacity 150ms ease;
}

.primary-button:hover {
  filter: brightness(1.04);
}

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

.primary-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.setup-footnote {
  margin: auto 0 0;
  padding-top: 26px;
  font-size: 11px;
  color: var(--faint);
}

.home-view {
  padding: 61px 24px 28px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 12%, rgba(139, 124, 255, 0.33), transparent 38%),
    radial-gradient(circle at 88% 20%, rgba(44, 197, 172, 0.18), transparent 34%),
    linear-gradient(165deg, #11172b 0%, #080d18 48%, #070b13 100%);
}

.home-view::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

.home-top {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.home-date {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.58);
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.home-clock {
  margin: 0;
  font-size: 46px;
  line-height: 0.92;
  letter-spacing: -0.055em;
  font-weight: 300;
}

.profile-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  max-width: 174px;
  padding: 7px 11px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.065);
  backdrop-filter: blur(16px);
  text-align: left;
}

.profile-pill-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-pill-text strong {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-pill-text small {
  font-size: 9px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.home-message {
  position: relative;
  margin-top: clamp(52px, 11vh, 94px);
  max-width: 260px;
}

.home-kicker {
  display: block;
  margin-bottom: 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: rgba(111, 231, 200, 0.78);
}

.home-message p {
  margin: 0;
  color: rgba(243, 246, 255, 0.84);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.app-grid {
  position: relative;
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.app-icon {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 82px;
  padding: 0;
  border: 0;
  background: transparent;
}

.app-glyph {
  position: relative;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 19px;
  background:
    linear-gradient(145deg, rgba(111, 231, 200, 0.95), rgba(57, 194, 165, 0.74) 52%, rgba(139, 124, 255, 0.8) 130%);
  box-shadow:
    0 14px 30px rgba(27, 151, 130, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 170ms ease, filter 170ms ease;
}

.app-glyph svg {
  width: 38px;
  height: 38px;
  fill: rgba(4, 21, 18, 0.9);
  stroke: none;
}

.app-glyph .app-glyph-line {
  stroke: rgba(4, 21, 18, 0.68);
  stroke-width: 2.1;
  stroke-linecap: round;
  fill: none;
}

.app-icon:hover .app-glyph {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.app-icon:active .app-glyph {
  transform: scale(0.95);
}

.app-label {
  padding-left: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.app-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border: 2px solid #0d1421;
  border-radius: 12px;
  background: #ff5d73;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(255, 93, 115, 0.35);
}

.persona-exit {
  position: relative;
  margin-top: 32px;
  align-self: flex-start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.home-footer {
  position: relative;
  margin: auto 0 0;
  padding-top: 32px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.23);
  text-transform: uppercase;
}

.avatar {
  --avatar-hue: 168;
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, hsl(var(--avatar-hue) 70% 58% / 0.88), transparent 65%),
    linear-gradient(145deg, hsl(var(--avatar-hue) 48% 32%), hsl(calc(var(--avatar-hue) + 50) 45% 18%));
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 36px;
  height: 36px;
}

.avatar-medium {
  width: 50px;
  height: 50px;
  font-size: 14px;
}

.avatar-large {
  width: 112px;
  height: 112px;
  font-size: 24px;
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 50px 18px 13px;
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.98), rgba(8, 13, 24, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  z-index: 2;
}

.app-header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.app-header-title span {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.app-header-title strong {
  font-size: 21px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-round {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  background: var(--surface-2);
}

.profile-round .avatar {
  width: 100%;
  height: 100%;
}

.persona-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 18px;
  background: rgba(139, 124, 255, 0.14);
  border-bottom: 1px solid rgba(139, 124, 255, 0.16);
  color: #c9c2ff;
  font-size: 10.5px;
}

.persona-bar strong {
  color: #fff;
}

.persona-bar button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.messages-tools {
  display: flex;
  gap: 8px;
  padding: 12px 16px 10px;
}

.tool-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(111, 231, 200, 0.17);
  border-radius: 12px;
  padding: 9px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
}

.tool-button-secondary {
  flex: 0 0 auto;
  border-color: rgba(139, 124, 255, 0.2);
  background: rgba(139, 124, 255, 0.1);
  color: #bcb4ff;
}

.tool-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 14px;
  scrollbar-width: none;
}

.conversation-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.modal-sheet::-webkit-scrollbar {
  display: none;
}

.conversation-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 11px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 14px;
  background: transparent;
  text-align: left;
}

.conversation-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.conversation-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.conversation-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.conversation-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-time {
  font-size: 9.5px;
  color: var(--faint);
  flex: 0 0 auto;
}

.conversation-preview {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-preview.is-unread {
  color: rgba(255, 255, 255, 0.87);
  font-weight: 600;
}

.unread-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #061411;
  font-size: 9px;
  font-weight: 800;
}

.npc-chip {
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(139, 124, 255, 0.16);
  color: #bdb5ff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 42px 90px;
  text-align: center;
}

.empty-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.035);
}

.empty-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty-icon .empty-line {
  opacity: 0.55;
}

.empty-state strong {
  font-size: 14px;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.chat-view {
  background:
    radial-gradient(circle at 92% 10%, rgba(139, 124, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #080d17 0%, #070b13 100%);
}

.chat-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 49px 15px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(8, 13, 23, 0.92);
  backdrop-filter: blur(18px);
}

.chat-contact {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chat-contact strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-contact small {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 17px 13px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: none;
}

.message-row {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  animation: message-in 180ms ease both;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

.message-row.is-out {
  align-items: flex-end;
}

.message-row.is-in {
  align-items: flex-start;
}

.message-bubble {
  max-width: 79%;
  padding: 9px 12px 7px;
  border-radius: 16px;
  font-size: 12.8px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.is-in .message-bubble {
  border-bottom-left-radius: 5px;
  background: var(--bubble-in);
  color: rgba(243, 246, 255, 0.92);
}

.is-out .message-bubble {
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, #176b5e, #145448);
  color: #f1fffb;
  box-shadow: 0 6px 16px rgba(10, 80, 67, 0.16);
}

.message-time {
  margin: 4px 5px 2px;
  font-size: 8.5px;
  color: var(--faint);
}

.date-separator {
  align-self: center;
  margin: 10px 0 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--faint);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chat-empty {
  margin: auto;
  padding: 20px;
  text-align: center;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.5;
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 9px 11px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(8, 13, 23, 0.9);
  backdrop-filter: blur(18px);
}

.chat-composer textarea {
  flex: 1;
  min-height: 40px;
  max-height: 116px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.35;
  scrollbar-width: none;
}

.chat-composer textarea::placeholder {
  color: var(--faint);
}

.chat-composer textarea:focus {
  border-color: rgba(111, 231, 200, 0.35);
  outline: none;
}

.send-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #041411;
  box-shadow: 0 8px 20px rgba(54, 201, 167, 0.24);
}

.send-button:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.send-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-banner {
  position: absolute;
  z-index: 65;
  top: 45px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(111, 231, 200, 0.22);
  border-radius: 17px;
  background: rgba(17, 27, 43, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  animation: banner-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes banner-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.98);
  }
}

.notification-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.notification-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notification-copy strong {
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-copy small {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: absolute;
  z-index: 100;
  left: 20px;
  right: 20px;
  bottom: 36px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(21, 31, 50, 0.97);
  color: var(--text);
  font-size: 11.5px;
  text-align: center;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
}

.modal-root {
  position: absolute;
  inset: 0;
  z-index: 80;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 11, 0.68);
  backdrop-filter: blur(4px);
  animation: fade-in 160ms ease both;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 84%;
  overflow-y: auto;
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  border-top: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #121b2d 0%, #0b111e 100%);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.55);
  animation: sheet-in 230ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes sheet-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

.modal-grabber {
  width: 38px;
  height: 4px;
  margin: -7px auto 17px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.16);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.modal-close {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.modal-actions {
  display: flex;
  gap: 9px;
  margin-top: 4px;
}

.modal-actions .primary-button {
  flex: 1;
}

.crop-overlay {
  position: absolute;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: flex-end;
  background: rgba(2, 5, 11, 0.8);
  backdrop-filter: blur(7px);
  animation: fade-in 160ms ease both;
}

.crop-sheet {
  width: 100%;
  max-height: 96%;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 22px 20px calc(20px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(circle at 92% 0%, rgba(111, 231, 200, 0.08), transparent 34%),
    #0a111e;
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.55);
  animation: sheet-in 220ms ease both;
}

.crop-sheet::-webkit-scrollbar {
  display: none;
}

.crop-stage {
  position: relative;
  width: min(264px, 68vw);
  aspect-ratio: 1;
  margin: 4px auto 18px;
  overflow: hidden;
  border-radius: 50%;
  background: #03050b;
  border: 2px solid rgba(111, 231, 200, 0.55);
  box-shadow:
    0 0 0 7px rgba(111, 231, 200, 0.07),
    0 18px 45px rgba(0, 0, 0, 0.5);
  touch-action: none;
  cursor: grab;
}

.crop-stage.is-dragging {
  cursor: grabbing;
}

.crop-stage img {
  position: absolute;
  display: block;
  max-width: none;
  user-select: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

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

.crop-zoom {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.crop-zoom span {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.crop-zoom input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.crop-reset {
  flex: 0 0 auto;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.crop-reset:hover {
  border-color: rgba(111, 231, 200, 0.4);
  color: var(--accent);
}

.crop-hint {
  margin: 12px 2px 4px;
  color: var(--faint);
  font-size: 10px;
  line-height: 1.5;
}

.crop-actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

.crop-actions .primary-button {
  flex: 1;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.danger-button {
  border: 1px solid rgba(255, 113, 139, 0.25);
  border-radius: 14px;
  padding: 12px 16px;
  background: rgba(255, 113, 139, 0.09);
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.contact-search {
  position: relative;
}

.contact-suggestions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 230px;
  overflow-y: auto;
  margin-top: 8px;
}

.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
}

.suggestion:hover {
  background: rgba(255, 255, 255, 0.04);
}

.suggestion-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.suggestion-copy strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-copy small {
  color: var(--faint);
  font-size: 9.5px;
}

.suggestion-state {
  color: var(--accent);
  font-size: 9px;
  font-weight: 700;
}

.suggestion-state.is-added {
  color: var(--faint);
}

.modal-empty {
  padding: 18px 0;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.npc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.npc-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.03);
}

.npc-card-copy {
  flex: 1;
  min-width: 0;
}

.npc-card-copy strong {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.npc-card-copy small {
  color: var(--violet);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.mini-button {
  border: 1px solid rgba(111, 231, 200, 0.2);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 800;
}

.mini-button.muted {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.npc-create {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.025);
}

.npc-create-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-picker.small {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 18px;
  border-style: solid;
}

.avatar-picker.small .avatar-picker-icon {
  gap: 2px;
  font-size: 8px;
}

.avatar-picker.small .avatar-picker-icon svg {
  width: 18px;
  height: 18px;
}

.npc-create-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.npc-create-fields input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 10px 12px;
  font-size: 13px;
}

.sync-overlay {
  position: absolute;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(4, 8, 16, 0.82);
  backdrop-filter: blur(12px);
}

.sync-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 250px;
  text-align: center;
}

.sync-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.sync-card strong {
  font-size: 14px;
}

.sync-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.sync-overlay.is-error .sync-spinner {
  border-color: var(--danger);
  animation: none;
}

.home-indicator {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 7px;
  width: 116px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.34);
  pointer-events: none;
}

.blocked-view {
  padding: 94px 32px 44px;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 113, 139, 0.13), transparent 34%),
    radial-gradient(circle at 82% 82%, rgba(139, 124, 255, 0.13), transparent 38%),
    linear-gradient(180deg, #0b1020 0%, #070b14 100%);
}

.blocked-icon {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  margin-bottom: 26px;
  border: 1px solid rgba(255, 113, 139, 0.3);
  border-radius: 28px;
  background: rgba(255, 113, 139, 0.08);
  box-shadow: 0 20px 48px rgba(255, 113, 139, 0.09);
  color: var(--danger);
}

.blocked-icon svg {
  width: 42px;
  height: 42px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.blocked-view h1 {
  margin: 12px 0 10px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.blocked-copy {
  max-width: 280px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.blocked-footnote {
  max-width: 260px;
  margin: 28px 0 0;
  color: var(--faint);
  font-size: 10.5px;
  line-height: 1.5;
}

.app-glyph-settings {
  background:
    linear-gradient(145deg, rgba(139, 124, 255, 0.96), rgba(102, 91, 225, 0.85) 55%, rgba(111, 231, 200, 0.8) 145%);
  box-shadow:
    0 14px 30px rgba(101, 89, 221, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.app-glyph-settings svg {
  width: 36px;
  height: 36px;
  fill: rgba(7, 9, 24, 0.9);
  stroke: none;
}

.tool-button-violet {
  border-color: rgba(139, 124, 255, 0.22);
  background: rgba(139, 124, 255, 0.11);
  color: #c5beff;
}

.group-chip {
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(111, 231, 200, 0.15);
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.message-sender {
  margin: 0 6px 3px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.group-member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.group-member-head > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.group-members {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 232px;
  overflow-y: auto;
  scrollbar-width: none;
}

.group-members::-webkit-scrollbar,
.access-list::-webkit-scrollbar {
  display: none;
}

.group-member {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.group-member:hover {
  background: rgba(255, 255, 255, 0.045);
}

.group-member.is-selected {
  border-color: rgba(111, 231, 200, 0.27);
  background: rgba(111, 231, 200, 0.08);
}

.group-member-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.group-member-copy strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-copy small {
  color: var(--faint);
  font-size: 9px;
}

.group-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 12px;
  font-weight: 900;
}

.group-member.is-selected .group-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #04110e;
}

.access-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 330px;
  overflow-y: auto;
  scrollbar-width: none;
}

.access-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.access-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.access-copy strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-copy small {
  color: var(--faint);
  font-size: 9px;
}

.access-toggle {
  flex: 0 0 auto;
  min-width: 76px;
  border: 1px solid rgba(111, 231, 200, 0.25);
  border-radius: 999px;
  padding: 7px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.access-toggle.is-blocked {
  border-color: rgba(255, 113, 139, 0.27);
  background: rgba(255, 113, 139, 0.08);
  color: var(--danger);
}

.access-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.access-footer p {
  flex: 1;
  margin: 0;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.45;
}

.access-footer .secondary-button {
  flex: 0 0 auto;
  padding: 10px 12px;
  font-size: 10px;
}

@media (max-height: 760px) {
  .setup-view {
    padding-top: 64px;
  }

  .brand-mark {
    width: 58px;
    height: 58px;
    margin-bottom: 20px;
  }

  .brand-mark svg {
    width: 37px;
    height: 37px;
  }

  .setup-view h1 {
    font-size: 27px;
  }

  .setup-subtitle {
    margin-bottom: 22px;
  }

  .home-message {
    margin-top: 39px;
  }

  .app-grid {
    margin-top: 28px;
  }

  .home-clock {
    font-size: 40px;
  }
}

@media (max-width: 350px) {
  .phone-wrap {
    padding: 0;
  }

  .phone {
    width: 100vw;
    height: 100dvh;
    padding: 0;
    border-radius: 0;
  }

  .screen {
    border-radius: 0;
  }

  .dynamic-island {
    display: none;
  }

  .status-bar {
    padding-top: 2px;
  }

  .home-indicator {
    display: none;
  }
}

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