/* =========================================================
   xkzGram — Dark soft-pink Telegram Mini App UI
   ========================================================= */

:root {
  --bg: #120b12;
  --bg-2: #1a0d18;
  --bg-3: #241323;
  --bg-4: #35172f;
  --bg-5: #6f2858;

  --ice-0: #ffe4f1;
  --ice-1: #f7a8cc;
  --ice-2: #ed78ae;
  --ice-3: #e94891;
  --ice-4: #ff9bc7;

  --violet: #b88cff;

  --text: #fff0f7;
  --dim: #c5a9b8;
  --faint: #8f7182;

  --good: #68d6a4;
  --bad: #ff7898;

  --line: rgba(255, 170, 211, 0.12);
  --line-2: rgba(255, 170, 211, 0.2);
  --line-3: rgba(255, 170, 211, 0.34);

  --glass: rgba(34, 17, 31, 0.72);
  --glass-strong: rgba(39, 19, 35, 0.92);

  --accent-fill: rgba(233, 72, 145, 0.14);
  --accent-fill-soft: rgba(247, 168, 204, 0.08);
  --accent-fill-strong: rgba(247, 168, 204, 0.2);

  --shadow-lg:
    0 24px 70px -30px rgba(0, 0, 0, 0.72),
    0 0 42px -28px rgba(233, 72, 145, 0.42);

  --shadow-md:
    0 16px 42px -26px rgba(0, 0, 0, 0.72),
    0 0 28px -22px rgba(233, 72, 145, 0.34);

  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 999px;

  --ease: cubic-bezier(0.22, 0.7, 0.3, 1);

  --page-pad: 20px;
  --nav-h: 82px;
  --safe-b: calc(18px + env(safe-area-inset-bottom, 0px));

  --screen-duration: 0.62s;
  --auth-duration: 0.82s;
}

/* =========================================================
   Reset
   ========================================================= */

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;

  overflow-x: hidden;
  overflow-y: hidden;

  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  color: var(--text);

  background:
    radial-gradient(
      circle at 12% 8%,
      rgba(233, 72, 145, 0.2),
      transparent 34%
    ),
    radial-gradient(
      circle at 88% 18%,
      rgba(184, 140, 255, 0.14),
      transparent 32%
    ),
    var(--bg);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

img,
svg {
  display: block;
  max-width: 100%;
  flex: none;
  vertical-align: middle;
}

img {
  height: auto;
}

svg {
  overflow: visible;
}

code {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

::selection {
  background: #8f3d70;
  color: var(--text);
}

/* =========================================================
   Background
   ========================================================= */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;

  overflow: hidden;
  pointer-events: none;
  transform: translateZ(0);
}

.aurora {
  position: absolute;
  inset: -25%;

  background:
    radial-gradient(
      40% 36% at 16% 12%,
      rgba(247, 168, 204, 0.22),
      transparent 70%
    ),
    radial-gradient(
      36% 40% at 86% 22%,
      rgba(184, 140, 255, 0.16),
      transparent 72%
    ),
    radial-gradient(
      48% 42% at 52% 100%,
      rgba(233, 72, 145, 0.15),
      transparent 70%
    );

  filter: blur(28px);
  will-change: transform;

  animation:
    auroraDrift 16s ease-in-out infinite alternate;
}

.grid {
  position: absolute;
  inset: 0;

  background-image:
    linear-gradient(
      var(--line) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      var(--line) 1px,
      transparent 1px
    );

  background-size: 46px 46px;

  mask-image:
    radial-gradient(
      circle at 50% 18%,
      #000 15%,
      transparent 78%
    );

  -webkit-mask-image:
    radial-gradient(
      circle at 50% 18%,
      #000 15%,
      transparent 78%
    );

  animation:
    gridBreath 18s ease-in-out infinite alternate;
}

.noise {
  position: absolute;
  inset: 0;

  opacity: 0.1;

  background-image:
    radial-gradient(
      rgba(255, 190, 220, 0.16) 0.5px,
      transparent 0.7px
    );

  background-size: 18px 18px;
  mix-blend-mode: screen;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

/* =========================================================
   Loading screen
   ========================================================= */

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 20;

  display: grid;
  place-items: center;

  padding: 24px;

  opacity: 1;
  visibility: visible;
  transform: scale(1);

  background:
    linear-gradient(
      180deg,
      rgba(18, 11, 18, 0.94),
      rgba(18, 11, 18, 0.99)
    );

  transition:
    opacity 0.55s var(--ease),
    visibility 0.55s var(--ease),
    transform 0.55s var(--ease);
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
}

.loading-core {
  width: min(100%, 360px);
  padding: 28px 22px 24px;

  text-align: center;

  border: 1px solid var(--line-2);
  border-radius: 32px;

  background: rgba(36, 19, 35, 0.78);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow: var(--shadow-lg);

  animation:
    loadingCoreIn 0.7s var(--ease) both;
}

.brand-orb {
  width: 72px;
  height: 72px;

  display: grid;
  place-items: center;

  margin: 0 auto 18px;

  border: 1px solid var(--line-2);
  border-radius: 24px;

  background:
    linear-gradient(
      180deg,
      rgba(247, 168, 204, 0.22),
      rgba(111, 40, 88, 0.18)
    );

  box-shadow:
    0 0 0 1px rgba(247, 168, 204, 0.1) inset,
    0 20px 40px -24px rgba(233, 72, 145, 0.55);

  animation:
    orbPulse 2s var(--ease) infinite;
}

.brand-orb__svg,
.brand-orb__icon {
  display: block;

  width: 42px;
  height: 42px;

  margin: 0;

  object-fit: contain;
  object-position: center;
}

.loading-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 8px;
  padding: 7px 12px;

  border: 1px solid var(--line-2);
  border-radius: var(--radius-full);

  background: var(--accent-fill-soft);
  color: var(--ice-1);

  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.loading-copy h1 {
  margin-bottom: 7px;

  color: var(--text);

  font-size: 24px;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.loading-copy p {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.55;
}

.loading-progress,
.loading-bar {
  position: relative;

  height: 5px;
  margin: 22px 8px 0;

  overflow: hidden;

  border: 1px solid var(--line);
  border-radius: var(--radius-full);

  background: rgba(255, 170, 211, 0.08);
}

.loading-progress span,
.loading-bar span {
  position: absolute;
  inset: 0 auto 0 -35%;

  display: block;

  width: 36%;
  height: 100%;

  border-radius: inherit;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--ice-2),
      var(--ice-4),
      transparent
    );

  box-shadow: 0 0 18px rgba(233, 72, 145, 0.72);

  animation:
    loadingProgress 1.35s ease-in-out infinite;
}

/* =========================================================
   Main app
   ========================================================= */

.app {
  position: relative;
  min-height: 100dvh;

  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    var(--page-pad)
    calc(var(--nav-h) + var(--safe-b) + 22px);
}

.screen {
  position: relative;

  display: none;
  min-height: 100dvh;
  padding-top: 8px;

  overflow: visible;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  will-change:
    transform,
    opacity;
}

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

.screen.is-hidden {
  display: none;
}

.screen.screen--enter,
.screen.screen--exit {
  display: block;
}

/* =========================================================
   Screen enter animation
   ========================================================= */

.screen.screen--enter {
  position: absolute;
  inset: 0;

  opacity: 0;
  transform: translate3d(0, 110vh, 0);

  pointer-events: none;

  transition:
    opacity var(--screen-duration) var(--ease),
    transform var(--screen-duration) var(--ease);
}

.screen.screen--enter-active {
  opacity: 1;
  transform: translate3d(0, 0, 0);

  pointer-events: auto;
}

/* =========================================================
   Screen exit animation
   ========================================================= */

.screen.screen--exit {
  position: relative;

  opacity: 1;
  transform: translate3d(0, 0, 0);

  pointer-events: none;

  transition:
    opacity var(--screen-duration) var(--ease),
    transform var(--screen-duration) var(--ease);
}

.screen.screen--exit-active {
  opacity: 0;
  transform: translate3d(0, -110vh, 0);

  pointer-events: none;
}

/* =========================================================
   Auth screen
   ========================================================= */

.auth-screen {
  display: block;
  min-height: calc(100dvh - 150px);
}

.auth-screen.is-hidden {
  display: none;
}

.auth-screen.is-leaving {
  pointer-events: none;
}

.auth-screen .page-enter {
  animation:
    authCardEnter 0.8s var(--ease) 0.08s both;
}

.screen:not([data-screen="auth"]) .page-enter {
  opacity: 1;
  transform: none;
  animation: none;
}

/* =========================================================
   Auth card
   ========================================================= */

.auth-card {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);

  will-change:
    transform,
    opacity;

  transition:
    opacity var(--auth-duration) var(--ease),
    transform var(--auth-duration) var(--ease);
}

.auth-card--ready {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.auth-card--exit {
  opacity: 0;
  transform: translate3d(0, -120vh, 0) scale(0.94);

  pointer-events: none;
}

/* =========================================================
   Cards
   ========================================================= */

.card {
  position: relative;
  overflow: hidden;

  border: 1px solid var(--line-2);
  border-radius: 30px;

  background:
    linear-gradient(
      180deg,
      rgba(44, 22, 41, 0.9),
      rgba(29, 14, 27, 0.82)
    );

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  box-shadow: var(--shadow-lg);
}

.auth-card {
  min-height: calc(100dvh - 150px);
  padding: 24px;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card__glow {
  position: absolute;
  inset: auto -10% 62% auto;

  width: 180px;
  height: 180px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(247, 168, 204, 0.22),
      transparent 68%
    );

  filter: blur(10px);
  pointer-events: none;

  animation:
    glowFloat 6s ease-in-out infinite alternate;
}

.eyebrow {
  width: fit-content;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin-bottom: 16px;
  padding: 8px 12px;

  border: 1px solid var(--line-2);
  border-radius: var(--radius-full);

  background: var(--accent-fill-soft);
  color: var(--ice-1);

  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";

  width: 18px;
  height: 1px;

  background:
    linear-gradient(
      90deg,
      var(--ice-3),
      transparent
    );

  background-size: 200% 100%;

  animation:
    eyebrowLine 3.5s ease-in-out infinite;
}

.auth-card h2,
.page-top h2 {
  color: var(--text);

  font-size: clamp(28px, 8vw, 34px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.lead {
  max-width: 34ch;
  margin-top: 14px;

  color: var(--dim);
  font-size: 15px;
  line-height: 1.6;
}

.lead code {
  padding: 2px 8px;

  border: 1px solid var(--line);
  border-radius: var(--radius-full);

  background: rgba(247, 168, 204, 0.1);
  color: var(--ice-1);
}

/* =========================================================
   Form
   ========================================================= */

.xid-form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.field-label {
  color: var(--ice-1);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.field-wrap {
  min-height: 58px;
  padding: 0 16px;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;

  border: 1px solid var(--line-2);
  border-radius: 22px;

  background: rgba(48, 23, 44, 0.78);

  box-shadow:
    inset 0 1px 0 rgba(255, 210, 230, 0.08);

  transition:
    border-color 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    background 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.field-wrap > svg,
.field-wrap > img,
.field-icon {
  display: block;

  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;

  margin: 0;

  flex: 0 0 20px;
  align-self: center;

  object-fit: contain;
  object-position: center;
}

.field-icon {
  opacity: 0.86;
}

.field-wrap:focus-within {
  border-color: var(--line-3);
  background: rgba(55, 25, 49, 0.94);
  transform: translateY(-1px);

  box-shadow:
    0 0 0 4px rgba(233, 72, 145, 0.12),
    0 12px 30px -22px rgba(233, 72, 145, 0.72);
}

.field-wrap input {
  width: 100%;
  min-width: 0;

  border: none;
  outline: none;

  background: transparent;
  color: var(--text);

  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.field-wrap input::placeholder {
  color: #9f788d;
}

.field-hint,
.status-text {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
}

.status-text {
  min-height: 20px;
}

.status-text.is-error {
  color: var(--bad);
}

.status-text.is-success {
  color: var(--good);
}

/* =========================================================
   Buttons
   ========================================================= */

.primary-btn,
.btn,
.btn-1,
.btn-2,
.pill,
.go,
.pb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  vertical-align: middle;
  text-align: center;
}

.primary-btn {
  position: relative;
  isolation: isolate;

  width: 100%;
  min-height: 56px;
  margin-top: 4px;

  overflow: hidden;
  border-radius: 22px;

  color: #fff;

  background:
    linear-gradient(
      135deg,
      #d93682,
      #f472b6
    );

  box-shadow:
    0 18px 42px -24px rgba(233, 72, 145, 0.72);

  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;

  transition:
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    filter 0.22s var(--ease);
}

.primary-btn::after,
.btn-1::after,
.pill::after,
.go::after,
.pb::after {
  content: "";

  position: absolute;
  top: 0;
  left: -130%;
  z-index: -1;

  width: 55%;
  height: 100%;

  background:
    linear-gradient(
      100deg,
      transparent,
      rgba(255, 255, 255, 0.35),
      transparent
    );

  transform: skewX(-18deg);
  pointer-events: none;
}

.primary-btn:hover::after,
.btn-1:hover::after,
.pill:hover::after,
.go:hover::after,
.pb:hover::after {
  animation:
    buttonShine 0.85s ease;
}

.primary-btn:hover,
.primary-btn:active {
  transform: translateY(-1px);
  filter: brightness(1.06);

  box-shadow:
    0 20px 46px -22px rgba(233, 72, 145, 0.88);
}

.primary-btn:disabled {
  cursor: wait;
  transform: none;
  filter: saturate(0.72);
  opacity: 0.88;
}

.primary-btn > span,
.btn > span,
.pill > span,
.go > span,
.pb > span {
  display: block;
  line-height: 1;
}

.primary-btn > svg,
.primary-btn > img,
.button-icon,
.btn > svg,
.btn > img,
.pill > svg,
.pill > img,
.go > svg,
.go > img,
.pb > svg,
.pb > img {
  display: block;

  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;

  margin: 0;

  flex: 0 0 18px;
  align-self: center;

  object-fit: contain;
  object-position: center;
}

.button-icon {
  transition: transform 0.22s var(--ease);
}

.primary-btn:hover .button-icon,
.primary-btn:active .button-icon {
  transform: translateX(3px);
}

.primary-btn.is-loading .button-icon {
  animation:
    buttonIconPulse 0.8s ease-in-out infinite;
}

.btn-1,
.pill,
.go,
.pb {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  color: #fff;

  background:
    linear-gradient(
      118deg,
      #d93682,
      #f472b6
    );

  box-shadow:
    0 10px 28px -16px rgba(233, 72, 145, 0.72);

  transition:
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease),
    filter 0.22s var(--ease);
}

.btn-1:hover,
.pill:hover,
.go:hover,
.pb:hover {
  transform: translateY(-1px);

  box-shadow:
    0 16px 36px -16px rgba(233, 72, 145, 0.88);
}

.btn-2 {
  border: 1px solid var(--line-3);
  color: var(--text);
  background: rgba(48, 24, 45, 0.62);

  transition:
    background 0.22s var(--ease),
    border-color 0.22s var(--ease),
    transform 0.22s var(--ease);
}

.btn-2:hover {
  border-color: var(--ice-3);
  background: var(--accent-fill-soft);
  transform: translateY(-1px);
}

/* =========================================================
   Content blocks
   ========================================================= */

.page-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tiles-grid,
.stack-grid,
.chat-list {
  display: grid;
  gap: 14px;
}

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

.tile,
.profile-card,
.chat-item {
  position: relative;

  border: 1px solid var(--line-2);
  border-radius: 24px;

  background:
    linear-gradient(
      145deg,
      rgba(48, 24, 45, 0.88),
      rgba(29, 14, 27, 0.76)
    );

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: var(--shadow-md);

  transition:
    transform 0.25s var(--ease),
    border-color 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.tile:hover,
.profile-card:hover,
.chat-item:hover {
  transform: translateY(-2px);
  border-color: var(--line-3);

  box-shadow:
    0 20px 44px -28px rgba(0, 0, 0, 0.82),
    0 0 28px -22px rgba(233, 72, 145, 0.58);
}

.tile {
  padding: 18px;
}

.tile--wide {
  grid-column: 1 / -1;
  min-height: 180px;
}

.tile__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 14px;
  padding: 6px 10px;

  border: 1px solid var(--line);
  border-radius: var(--radius-full);

  background: var(--accent-fill-soft);
  color: var(--ice-1);

  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tile h3,
.profile-card strong {
  margin-bottom: 8px;

  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.tile p,
.chat-item p,
.profile-card p {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.55;
}

/* =========================================================
   Chat items
   ========================================================= */

.chat-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
}

.chat-item__avatar,
.profile-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;

  display: grid;
  place-items: center;

  flex: 0 0 48px;

  border-radius: 18px;

  color: #fff;

  background:
    linear-gradient(
      135deg,
      #d93682,
      #f9a8d4
    );

  box-shadow:
    0 12px 26px -16px rgba(233, 72, 145, 0.8);

  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.chat-item__avatar > svg,
.chat-item__avatar > img,
.profile-avatar > svg,
.profile-avatar > img {
  display: block;

  width: 24px;
  height: 24px;

  margin: 0;

  object-fit: contain;
  object-position: center;
}

.chat-item__body {
  min-width: 0;
  flex: 1;
}

.chat-item__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;

  margin-bottom: 6px;
}

.chat-item__head strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.chat-item__head time {
  flex: 0 0 auto;

  color: var(--faint);
  font-size: 12px;
  line-height: 1.25;
}

/* =========================================================
   Profile
   ========================================================= */

.profile-card {
  padding: 18px;
}

.profile-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

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

.profile-stats div {
  min-width: 0;
  padding: 14px;

  border: 1px solid var(--line);
  border-radius: 20px;

  background: rgba(247, 168, 204, 0.07);
}

.profile-stats span {
  display: block;

  margin-bottom: 4px;

  color: var(--faint);
  font-size: 12px;
  line-height: 1.2;
}

.profile-stats strong {
  display: block;
  min-width: 0;

  margin: 0;
  overflow: hidden;

  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   Bottom navigation
   ========================================================= */

.bottom-nav {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: var(--safe-b);
  z-index: 12;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate3d(0, 36px, 0);

  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease),
    visibility 0s linear 0.55s;
}

.bottom-nav.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transform: translate3d(0, 0, 0);

  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease),
    visibility 0s linear 0s;
}

.bottom-nav.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translate3d(0, 36px, 0);

  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease),
    visibility 0s linear 0.55s;
}

.bottom-nav__inner {
  position: relative;

  min-height: 78px;
  padding: 8px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 6px;

  overflow: visible;

  border: 1px solid var(--line-2);
  border-radius: var(--radius-full);

  background: rgba(35, 17, 32, 0.84);

  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  box-shadow:
    0 24px 60px -28px rgba(0, 0, 0, 0.82),
    0 0 34px -25px rgba(233, 72, 145, 0.68);

  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.nav-highlight {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 0;

  width: calc(25% - 4.5px);
  height: calc(100% - 16px);

  border: 1px solid rgba(247, 168, 204, 0.42);
  border-radius: var(--radius-full);

  background:
    linear-gradient(
      180deg,
      rgba(247, 168, 204, 0.24),
      rgba(233, 72, 145, 0.12)
    );

  box-shadow:
    inset 0 1px 0 rgba(255, 220, 235, 0.12),
    0 14px 28px -20px rgba(233, 72, 145, 0.78);

  pointer-events: auto;
  cursor: grab;

  transition:
    left 0.48s var(--ease),
    top 0.48s var(--ease),
    width 0.48s var(--ease),
    height 0.48s var(--ease),
    transform 0.3s var(--ease),
    box-shadow 0.3s var(--ease),
    filter 0.25s var(--ease),
    opacity 0.25s var(--ease);
}

.nav-highlight:active,
.nav-highlight--dragging {
  top: 4px !important;
  height: calc(100% - 8px) !important;

  cursor: grabbing;
  transform: scale(1.04);

  box-shadow:
    inset 0 1px 0 rgba(255, 220, 235, 0.22),
    0 18px 34px -14px rgba(233, 72, 145, 0.92),
    0 0 24px -10px rgba(247, 168, 204, 0.7);
}

.nav-highlight--no-transition {
  transition: none !important;
}

.nav-item {
  position: relative;
  z-index: 1;

  min-height: 62px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  border-radius: var(--radius-full);

  color: var(--dim);
  text-align: center;

  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;

  transition:
    color 0.22s var(--ease),
    transform 0.22s var(--ease),
    opacity 0.22s var(--ease),
    filter 0.22s var(--ease);
}

.nav-item:hover {
  color: var(--ice-1);
  transform: translateY(-1px);
}

.nav-item.is-active {
  color: var(--ice-0);
}

.nav-item__icon,
.nav-item__label {
  pointer-events: none;
}

.nav-item__icon {
  width: 22px;
  height: 22px;

  display: grid;
  place-items: center;

  line-height: 0;
}

.nav-item__icon > svg,
.nav-item__icon > img {
  display: block;

  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;

  margin: 0;

  object-fit: contain;
  object-position: center;
  transform-origin: center;
}

.nav-item__icon > img {
  opacity: 0.78;

  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    filter 0.22s var(--ease);
}

.nav-item:hover .nav-item__icon > img {
  opacity: 1;
  transform: translateY(-1px);
}

.nav-item.is-active .nav-item__icon > img {
  opacity: 1;

  filter:
    drop-shadow(
      0 0 8px rgba(233, 72, 145, 0.58)
    );
}

.nav-item__label {
  display: block;

  color: currentColor;

  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.01em;
}

/* =========================================================
   Navbar anti-spam
   ========================================================= */

.bottom-nav.nav-is-locked {
  pointer-events: none;
}

.bottom-nav.nav-is-locked .nav-item,
.bottom-nav.nav-is-locked .nav-highlight {
  pointer-events: none;
}

.bottom-nav.nav-is-locked .nav-item {
  opacity: 0.68;
  transform: none !important;
}

.bottom-nav.nav-is-locked .nav-item__icon,
.bottom-nav.nav-is-locked .nav-item__label {
  opacity: 0.78;
}

.bottom-nav.nav-is-locked .nav-highlight {
  opacity: 0.92;
  filter: saturate(0.82) brightness(0.94);
  transform: none;
}

.nav-item.is-disabled,
.nav-item[aria-disabled="true"] {
  opacity: 0.68;
}

.nav-item.is-disabled:hover,
.nav-item[aria-disabled="true"]:hover {
  color: var(--dim);
  transform: none;
}

.nav-item.is-disabled .nav-item__icon > img,
.nav-item[aria-disabled="true"] .nav-item__icon > img {
  transform: none !important;
  opacity: 0.72;
  filter: none;
}

/* =========================================================
   Icon alignment
   ========================================================= */

.icon,
.ico,
.si,
.fcard .ico,
.cat .ico,
.step .si {
  display: grid;
  place-items: center;

  line-height: 0;
}

.icon > svg,
.icon > img,
.ico > svg,
.ico > img,
.si > svg,
.si > img,
.fcard .ico > svg,
.fcard .ico > img,
.cat .ico > svg,
.cat .ico > img,
.step .si > svg,
.step .si > img {
  display: block;

  width: 100%;
  height: 100%;
  max-width: 24px;
  max-height: 24px;

  margin: 0;

  object-fit: contain;
  object-position: center;
}

.tile > svg,
.tile > img,
.profile-card > svg,
.profile-card > img,
.chat-item > svg,
.chat-item > img {
  display: block;
  margin: 0;

  object-fit: contain;
  object-position: center;
}

/* =========================================================
   External SVG recoloring
   ========================================================= */

.icon-pink,
.brand-orb__icon,
.field-icon,
.button-icon,
.nav-item__icon > img,
.tile > img,
.profile-card > img,
.chat-item > img {
  filter:
    brightness(0)
    saturate(100%)
    invert(79%)
    sepia(17%)
    saturate(1018%)
    hue-rotate(291deg)
    brightness(104%)
    contrast(94%);
}

.brand-orb__icon {
  filter:
    brightness(0)
    saturate(100%)
    invert(90%)
    sepia(11%)
    saturate(604%)
    hue-rotate(292deg)
    brightness(105%)
    contrast(103%)
    drop-shadow(
      0 0 10px rgba(247, 168, 204, 0.58)
    );
}

.field-icon {
  filter:
    brightness(0)
    saturate(100%)
    invert(77%)
    sepia(19%)
    saturate(1033%)
    hue-rotate(292deg)
    brightness(104%)
    contrast(94%);
}

.button-icon {
  filter:
    brightness(0)
    saturate(100%)
    invert(100%);
}

.nav-item:hover .nav-item__icon > img {
  filter:
    brightness(0)
    saturate(100%)
    invert(77%)
    sepia(19%)
    saturate(1033%)
    hue-rotate(292deg)
    brightness(104%)
    contrast(94%)
    drop-shadow(
      0 0 7px rgba(247, 168, 204, 0.48)
    );
}

.nav-item.is-active .nav-item__icon > img {
  filter:
    brightness(0)
    saturate(100%)
    invert(46%)
    sepia(75%)
    saturate(2862%)
    hue-rotate(312deg)
    brightness(96%)
    contrast(94%)
    drop-shadow(
      0 0 8px rgba(233, 72, 145, 0.58)
    );
}

.bottom-nav.nav-is-locked .nav-item__icon > img,
.nav-item.is-disabled .nav-item__icon > img,
.nav-item[aria-disabled="true"] .nav-item__icon > img {
  filter:
    brightness(0)
    saturate(100%)
    invert(67%)
    sepia(11%)
    saturate(482%)
    hue-rotate(288deg)
    brightness(95%)
    contrast(88%);
}

/* =========================================================
   Gradient text
   ========================================================= */

.grad {
  background:
    linear-gradient(
      108deg,
      var(--ice-1) 6%,
      var(--ice-3) 50%,
      var(--violet) 98%
    );

  background-size: 220% auto;

  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  animation:
    gradientSheen 7s linear infinite;
}

/* =========================================================
   Input states
   ========================================================= */

.field-wrap:has(input.is-valid) {
  border-color: rgba(104, 214, 164, 0.52);

  box-shadow:
    0 0 0 4px rgba(104, 214, 164, 0.08),
    0 12px 30px -22px rgba(104, 214, 164, 0.55);
}

.field-wrap:has(input.is-invalid) {
  border-color: rgba(255, 120, 152, 0.58);

  box-shadow:
    0 0 0 4px rgba(255, 120, 152, 0.08),
    0 12px 30px -22px rgba(255, 120, 152, 0.55);
}

.field-wrap input.is-valid {
  color: var(--good);
}

.field-wrap input.is-invalid {
  color: var(--bad);
}

/* =========================================================
   Focus
   ========================================================= */

input:focus,
button:focus-visible {
  outline: none;
}

button:focus-visible,
input:focus-visible {
  box-shadow:
    0 0 0 4px rgba(233, 72, 145, 0.18);
}

button img,
button svg,
a img,
a svg {
  pointer-events: none;
}

/* =========================================================
   Animations
   ========================================================= */

@keyframes auroraDrift {
  100% {
    transform: translate3d(-2%, 2%, 0) scale(1.05);
  }
}

@keyframes gridBreath {
  100% {
    opacity: 0.58;
    transform: translateY(8px);
  }
}

@keyframes loadingCoreIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes orbPulse {
  50% {
    transform: translateY(-2px) scale(1.02);

    box-shadow:
      0 0 0 1px rgba(247, 168, 204, 0.14) inset,
      0 22px 42px -22px rgba(233, 72, 145, 0.78);
  }
}

@keyframes loadingProgress {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(390%);
  }
}

@keyframes authCardEnter {
  from {
    opacity: 0;
    transform: translate3d(0, 28px, 0) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes buttonIconPulse {
  50% {
    opacity: 0.35;
    transform: translateX(2px) scale(0.86);
  }
}

@keyframes buttonShine {
  from {
    left: -130%;
  }

  to {
    left: 140%;
  }
}

@keyframes gradientSheen {
  from {
    background-position: 0 center;
  }

  to {
    background-position: 220% center;
  }
}

@keyframes eyebrowLine {
  0%,
  100% {
    opacity: 0.65;
    background-position: 0 0;
  }

  50% {
    opacity: 1;
    background-position: 100% 0;
  }
}

@keyframes glowFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }

  to {
    transform: translate3d(-12px, 10px, 0) scale(1.08);
  }
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 390px) {
  :root {
    --page-pad: 16px;
  }

  .auth-card {
    padding: 20px;
  }

  .loading-core {
    padding: 24px 18px 20px;
  }

  .loading-copy h1 {
    font-size: 23px;
  }

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

  .tile--wide {
    grid-column: auto;
  }

  .bottom-nav {
    left: 10px;
    right: 10px;
  }

  .bottom-nav__inner {
    gap: 3px;
    padding: 7px;
  }

  .nav-item {
    min-height: 60px;
  }

  .nav-item__label {
    font-size: 10px;
  }
}

@media (min-width: 700px) {
  body {
    overflow-y: auto;
  }

  .app {
    max-width: 520px;
    margin: 0 auto;
  }

  .bottom-nav {
    right: 0;
    left: 0;

    max-width: 492px;
    margin: 0 auto;
  }
}

/* =========================================================
   Reduced motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .screen.screen--enter,
  .screen.screen--exit {
    transition: none !important;
  }

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

  .screen.screen--exit-active {
    opacity: 0;
    transform: translate3d(0, -110vh, 0);
  }

  .auth-card--exit {
    opacity: 0;
    transform: translate3d(0, -120vh, 0);
  }

  .bottom-nav.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate3d(0, 0, 0);
  }

  .bottom-nav.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 36px, 0);
  }

  .bottom-nav.nav-is-locked .nav-item,
  .bottom-nav.nav-is-locked .nav-highlight {
    transition: none !important;
  }
}

/* =========================================================
   Profile full
   ========================================================= */

.profile-card--full {
  padding: 18px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-avatar-wrap {
  position: relative;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
}

.profile-avatar,
.profile-avatar-image {
  width: 74px;
  height: 74px;
  min-width: 74px;
  min-height: 74px;

  border-radius: 24px;
}

.profile-avatar {
  font-size: 28px;
}

.profile-avatar-image {
  position: absolute;
  inset: 0;
  z-index: 2;

  object-fit: cover;
  object-position: center;

  border: 1px solid var(--line-2);

  box-shadow:
    0 12px 26px -16px rgba(233, 72, 145, 0.8);
}

.profile-avatar-image.is-hidden {
  display: none;
}

.profile-hero__content {
  min-width: 0;
  flex: 1;
}

.profile-hero__content strong {
  display: block;
  margin-bottom: 4px;

  color: var(--text);
  font-size: 20px;
  line-height: 1.15;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-username {
  margin-bottom: 6px;

  color: var(--ice-1);
  font-size: 14px;
  line-height: 1.3;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-badge {
  min-height: 38px;
  padding: 8px 12px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  border: 1px solid var(--line);
  border-radius: var(--radius-full);

  background: rgba(247, 168, 204, 0.07);
  color: var(--ice-1);

  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.profile-badge img {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;

  filter:
    brightness(0)
    saturate(100%)
    invert(77%)
    sepia(19%)
    saturate(1033%)
    hue-rotate(292deg)
    brightness(104%)
    contrast(94%);
}

.profile-stats--single {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.profile-stat-card {
  min-width: 0;
  padding: 16px;

  border: 1px solid var(--line);
  border-radius: 22px;

  background:
    linear-gradient(
      145deg,
      rgba(48, 24, 45, 0.88),
      rgba(29, 14, 27, 0.76)
    );
}

.profile-stat-card--accent {
  border-color: rgba(247, 168, 204, 0.22);
  background:
    linear-gradient(
      135deg,
      rgba(233, 72, 145, 0.18),
      rgba(247, 168, 204, 0.08)
    );
}

.profile-stat-card span {
  display: block;
  margin-bottom: 6px;

  color: var(--faint);
  font-size: 12px;
  line-height: 1.2;
}

.profile-stat-card strong {
  display: block;
  margin-bottom: 6px;

  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.profile-stat-card p {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.45;
}

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

.profile-info-card {
  min-width: 0;
  padding: 14px;

  border: 1px solid var(--line);
  border-radius: 20px;

  background: rgba(247, 168, 204, 0.06);
}

.profile-info-card__head {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 10px;

  color: var(--ice-1);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.profile-info-card__head img {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;

  filter:
    brightness(0)
    saturate(100%)
    invert(77%)
    sepia(19%)
    saturate(1033%)
    hue-rotate(292deg)
    brightness(104%)
    contrast(94%);
}

.profile-info-card strong {
  display: block;
  margin-bottom: 6px;

  color: var(--text);
  font-size: 18px;
  line-height: 1.2;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-info-card p {
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 390px) {
  .profile-hero {
    align-items: flex-start;
  }

  .profile-insights {
    grid-template-columns: 1fr;
  }

  .profile-hero__content strong {
    white-space: normal;
  }
}