:root {
  --bg: #f8f4fb;
  --panel: #ffffff;
  --ink: #21172b;
  --muted: #756b7d;
  --line: #e4dce9;
  --violet: #b77bef;
  --violet-dark: #7b3fc6;
  --lavender: #efe1ff;
  --green: #35c66a;
  --cyan: #46d6d0;
  --rose: #f05f8c;
  --amber: #f7b955;
  --shadow: 0 18px 45px rgba(48, 32, 66, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 16% 10%, rgba(183, 123, 239, 0.18), transparent 26%),
    radial-gradient(circle at 86% 18%, rgba(70, 214, 208, 0.12), transparent 24%),
    linear-gradient(135deg, #fff 0, var(--bg) 48%, #eee7f3 100%);
}

.auth-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--rose));
  font-size: 36px;
}

.auth-card h1 {
  margin: 0;
  font-size: 34px;
}

.auth-card p,
.auth-card small {
  color: var(--muted);
  line-height: 1.45;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.auth-card input,
.auth-card select,
.profile-settings select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.register-fields,
.profile-settings {
  display: grid;
  gap: 12px;
}

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

.check-line {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.check-line input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  padding: 0;
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid #f2b4c5;
  border-radius: 8px;
  color: #8d153c;
  background: #fff0f4;
  line-height: 1.35;
}

.primary,
.secondary {
  min-height: 48px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  border: 0;
  color: #fff;
  background: var(--violet-dark);
}

.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 84px minmax(320px, 520px) minmax(360px, 1fr);
  gap: 20px;
  min-height: 100vh;
  padding: 18px;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #d0a0ff, #b57bea);
  box-shadow: var(--shadow);
}

.rail-btn {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 8px;
  color: #160b20;
  background: rgba(255, 255, 255, 0.64);
  cursor: pointer;
}

.rail-btn svg,
.gift-icon svg,
.profile-sigil svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-btn.active {
  background: #fff;
  outline: 3px solid rgba(123, 63, 198, 0.35);
}

.nearby-panel,
.profile-panel {
  min-width: 0;
}

.topbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.balance,
.visibility,
.ghost {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(48, 32, 66, 0.05);
  cursor: pointer;
}

.balance {
  flex: 1;
  text-align: left;
  padding: 0 14px;
}

.visibility {
  padding: 0 16px;
  color: #0d3a1e;
  background: #dff8e8;
  border-color: #b8efcb;
}

.visibility.off {
  color: #5b2230;
  background: #ffe3eb;
  border-color: #f6b5c7;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-title h1 {
  margin: 0;
  font-size: 28px;
}

.section-title span {
  color: var(--muted);
}

.nearby-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 4px;
}

.nearby-user {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(48, 32, 66, 0.06);
  cursor: pointer;
  text-align: left;
}

.nearby-user.selected {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(180, 119, 239, 0.22);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #e7d5fa;
}

.user-meta strong {
  display: block;
  font-size: 18px;
}

.user-meta span,
.distance {
  color: var(--muted);
  font-size: 14px;
}

.profile-card,
.activity,
.drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.profile-card {
  padding: 20px;
}

.photo-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 12px solid #c595f3;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(183, 123, 239, 0.2), rgba(70, 214, 208, 0.12)),
    #fbf9fd;
}

.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-name-row h2 {
  margin: 16px 0 8px;
  font-size: 30px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: #4f2a7f;
  background: var(--lavender);
  font-size: 13px;
}

.bio {
  margin: 0 0 18px;
  color: #4e4557;
  line-height: 1.45;
}

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

.gift-btn {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.gift-btn:hover {
  border-color: var(--violet);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(48, 32, 66, 0.08);
}

.gift-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.gift-btn small {
  color: var(--muted);
}

.paid {
  background: #fff4f8;
}

.free {
  background: #effdfb;
}

.apology {
  background: #fff9ec;
}

.hidden {
  display: none;
}

.empty-state {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px dashed #cfbae7;
  border-radius: 8px;
  background: linear-gradient(135deg, #fbf8ff, #f4fffd);
}

.empty-state p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.placeholder-photo {
  min-height: 320px;
  color: var(--muted);
}

.profile-sigil {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--rose));
  box-shadow: 0 14px 30px rgba(123, 63, 198, 0.22);
}

.profile-sigil svg {
  width: 42px;
  height: 42px;
  fill: rgba(255, 255, 255, 0.2);
}

.free .gift-icon {
  color: #08766f;
  background: #dffbf8;
}

.paid .gift-icon {
  color: #b41e54;
  background: #ffe1eb;
}

.apology .gift-icon {
  color: #6e4a0a;
  background: #fff4d8;
}

.apology .gift-icon svg {
  fill: rgba(247, 185, 85, 0.18);
}

.avatar-letter {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--violet);
  font-size: 24px;
  font-weight: 800;
}

.gift-btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.message-box {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.message-box label {
  color: var(--muted);
  font-size: 14px;
}

textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.ghost {
  padding: 0 14px;
}

.danger {
  color: #8d153c;
}

.activity {
  margin-top: 18px;
  padding: 16px;
}

.activity h3 {
  margin: 0 0 10px;
}

.feed {
  display: grid;
  gap: 8px;
}

.feed-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8f5fb;
  color: #43394d;
}

.drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
  padding: 16px;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.2s ease;
  z-index: 10;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.drawer-head h2 {
  margin: 0;
}

.drawer-head button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #f1eaf7;
  cursor: pointer;
  font-size: 26px;
}

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

.drawer-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #f8f5fb;
}

.drawer-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

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

  .profile-panel {
    grid-column: 2;
  }
}

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

  .rail {
    position: sticky;
    top: 0;
    z-index: 3;
    flex-direction: row;
    justify-content: space-around;
  }

  .profile-panel {
    grid-column: auto;
  }

  .gift-toolbar {
    grid-template-columns: 1fr;
  }
}
