:root {
  --card: rgba(255, 255, 255, 0.76);
  --text: #1e2b43;
  --muted: #7f8ba2;
  --line: rgba(124, 148, 184, 0.25);
  --primary: linear-gradient(120deg, #5e6cf6 0%, #7f5be8 40%, #e65aa8 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 25% 20%, #dde6ff 0%, #eef3ff 38%, #f4f8ff 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(24px);
  z-index: 0;
}

.orb-a {
  width: 260px;
  height: 260px;
  background: rgba(101, 121, 255, 0.34);
  top: 9%;
  left: -80px;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: rgba(231, 139, 217, 0.28);
  right: -110px;
  bottom: 8%;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
}

.view {
  width: 100%;
  max-width: 460px;
  display: none;
  animation: rise 0.35s ease;
}

.view.active {
  display: block;
}

#view-home {
  max-width: min(1120px, calc(100vw - 28px));
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(8px);
  box-shadow: 0 20px 48px rgba(56, 84, 135, 0.16);
  padding: 24px;
}

.hero-panel {
  text-align: center;
}

.brand-dot {
  width: 72px;
  height: 72px;
  margin: 4px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(140deg, #edf2ff, #ffeaf8);
  color: #5970cc;
  border: 1px solid rgba(126, 153, 255, 0.24);
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: 34px;
  font-weight: 800;
}

h2 {
  font-size: 34px;
  font-weight: 800;
  margin-top: 8px;
}

.sub {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.features {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.feature-item {
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  background: rgba(243, 247, 255, 0.82);
  border: 1px solid var(--line);
}

.feature-item span {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.feature-item small {
  color: var(--muted);
}

.btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn-primary {
  color: #fff;
  background: var(--primary);
  margin-top: 12px;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(109, 130, 255, 0.34);
  color: #5a66c9;
  margin-top: 10px;
}

.btn-text {
  background: transparent;
  color: #8c96a8;
  margin-top: 4px;
}

.form-panel .btn-primary {
  margin-top: 8px;
}

.back-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: #73809a;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

.progress {
  width: 106px;
  height: 6px;
  border-radius: 999px;
  background: rgba(170, 183, 210, 0.24);
  overflow: hidden;
  margin: 10px 0 16px;
}

.progress span {
  display: block;
  width: 56%;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.field {
  display: block;
  margin-bottom: 12px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  color: #75839f;
  font-weight: 700;
  font-size: 13px;
}

.inline {
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 8px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(128, 149, 188, 0.33);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  background: rgba(252, 254, 255, 0.8);
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(106, 126, 247, 0.25);
  border-color: rgba(101, 120, 239, 0.58);
}

.hint {
  min-height: 22px;
  margin: 8px 0;
  color: #6f7b94;
  font-size: 13px;
}

.tabs {
  margin: 14px 0;
  border-radius: 12px;
  background: rgba(241, 245, 255, 0.85);
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.tab {
  border: none;
  border-radius: 10px;
  padding: 10px;
  font-weight: 700;
  color: #7d89a2;
  background: transparent;
}

.tab.active {
  color: #5f6df1;
  background: #fff;
}

.tab:disabled {
  cursor: not-allowed;
}

.home-panel {
  max-width: none;
  width: 100%;
}

.home-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

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

.btn.small {
  width: auto;
  padding: 9px 12px;
  font-size: 13px;
  border-radius: 10px;
  margin: 0;
}

.btn.small.ghost,
.btn.small.btn-ghost {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(141, 160, 196, 0.42);
  color: #74809a;
}

.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 14px;
}

/* ── Profile Page ── */
.profile-page {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-card {
  padding: 18px;
}

.profile-card h3 {
  font-size: 16px;
  margin-bottom: 14px;
  color: #3a4a6b;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid .field {
  margin-bottom: 0;
}

.form-grid .field.full {
  grid-column: 1 / -1;
}

.btn-save {
  margin-top: 4px;
  border-radius: 14px;
}

/* ── Avatar ── */
.avatar-section {
  text-align: center;
  padding: 10px 0;
}

.avatar-wrapper {
  width: 96px;
  height: 96px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 3px solid rgba(106, 126, 247, 0.3);
  background: rgba(243, 247, 255, 0.9);
  transition: border-color 0.2s;
}

.avatar-wrapper:hover {
  border-color: rgba(106, 126, 247, 0.6);
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 36px;
  color: #a0b0d0;
  font-weight: 300;
}

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

.avatar-hint {
  margin: 0;
  color: #8c96a8;
  font-size: 12px;
}

/* ── Searchable Select ── */
.searchable-select {
  position: relative;
}

.searchable-select .select-input {
  width: 100%;
  cursor: text;
}

.searchable-select .select-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(124, 148, 184, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(56, 84, 135, 0.15);
  z-index: 10;
  backdrop-filter: blur(8px);
}

.searchable-select.open .select-dropdown {
  display: block;
}

.select-option {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s;
}

.select-option:hover,
.select-option.highlighted {
  background: rgba(106, 126, 247, 0.1);
  color: #3a4a8a;
}

.select-option:first-child {
  border-radius: 12px 12px 0 0;
}

.select-option:last-child {
  border-radius: 0 0 12px 12px;
}

/* ── Photo Wall ── */
.photo-wall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.photo-add {
  aspect-ratio: 1;
  border: 2px dashed rgba(124, 148, 184, 0.35);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  color: #a0b0d0;
}

.photo-add:hover {
  border-color: rgba(106, 126, 247, 0.5);
  background: rgba(243, 247, 255, 0.6);
}

.photo-add span {
  font-size: 28px;
  line-height: 1;
}

.photo-add small {
  font-size: 11px;
  margin-top: 4px;
}

.photo-item {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(124, 148, 184, 0.2);
}

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

.photo-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s;
}

.photo-item:hover .photo-remove {
  opacity: 1;
}

.card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 253, 255, 0.78);
  padding: 14px;
}

.card h3 {
  margin-bottom: 8px;
}

.card-note {
  margin: 0 0 10px;
  color: #73819a;
  font-size: 13px;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

textarea {
  min-height: 86px;
  margin-top: 8px;
  margin-bottom: 10px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.overview-card {
  border-radius: 12px;
  border: 1px solid rgba(133, 154, 190, 0.33);
  background: rgba(255, 255, 255, 0.78);
  padding: 10px;
}

.overview-card small {
  display: block;
  color: #73819a;
  margin-bottom: 6px;
}

.overview-card strong {
  font-size: 23px;
}

.match-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.match-tab {
  border: 1px solid rgba(136, 157, 190, 0.35);
  background: rgba(255, 255, 255, 0.76);
  color: #667698;
  border-radius: 10px;
  padding: 9px 8px;
  font-weight: 700;
  cursor: pointer;
}

.match-tab.active {
  background: linear-gradient(120deg, rgba(94, 108, 246, 0.16), rgba(230, 90, 168, 0.16));
  border-color: rgba(105, 123, 244, 0.45);
  color: #3f57c5;
}

.match-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.match-list li {
  border: 1px solid rgba(131, 152, 191, 0.36);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.76);
  line-height: 1.5;
}

.match-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.score-pill {
  background: rgba(92, 111, 240, 0.14);
  color: #5063c9;
  border: 1px solid rgba(92, 111, 240, 0.25);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.tag {
  border-radius: 999px;
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid rgba(130, 151, 190, 0.35);
  background: rgba(240, 245, 255, 0.8);
  color: #62739a;
}

.guest-area {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(251, 253, 255, 0.72);
  padding: 14px;
}

.guest-cards {
  display: grid;
  gap: 9px;
  margin: 8px 0 12px;
}

.guest-cards article {
  border: 1px solid rgba(132, 152, 188, 0.35);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.guest-cards p {
  margin: 6px 0 0;
  color: #6f7c95;
}

.row-cta {
  display: flex;
  gap: 10px;
}

.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(17, 26, 43, 0.32);
  padding: 16px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(460px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(133, 154, 190, 0.35);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 42px rgba(35, 53, 94, 0.22);
  padding: 16px;
}

.modal-sub {
  margin: 6px 0 10px;
  color: #6f7c95;
  font-size: 13px;
}

.identity-box {
  border: 1px solid rgba(130, 151, 190, 0.35);
  border-radius: 12px;
  background: rgba(243, 247, 255, 0.82);
  padding: 10px;
  margin-bottom: 10px;
}

.identity-box p {
  margin: 6px 0 0;
  color: #5f6f90;
  font-size: 13px;
}

/* ── Match Page ── */
#view-matches {
  max-width: 480px;
}

.match-panel {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
}

.match-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.match-header h2 {
  flex: 1;
  font-size: 22px;
  margin: 0;
}

.match-count {
  background: rgba(92, 111, 240, 0.14);
  color: #5063c9;
  border: 1px solid rgba(92, 111, 240, 0.25);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 700;
}

.match-card-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.match-empty {
  color: #8c96a8;
  font-size: 15px;
  text-align: center;
  padding: 40px 20px;
}

.match-card {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 8px 32px rgba(56, 84, 135, 0.18);
  animation: cardIn 0.3s ease;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.match-card-photo {
  width: 100%;
  height: 280px;
  object-fit: cover;
  background: linear-gradient(135deg, #e8edff, #fce8f4);
  display: block;
}

.match-card-body {
  padding: 18px;
}

.match-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.match-card-name {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}

.match-card-sub {
  color: #7f8ba2;
  font-size: 13px;
  margin-top: 2px;
}

.match-card-score {
  background: rgba(92, 111, 240, 0.12);
  color: #4a5dc7;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.match-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.match-card-tags .tag {
  font-size: 12px;
  padding: 3px 10px;
}

.match-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin-bottom: 12px;
}

.match-card-info .info-item {
  font-size: 13px;
  color: #5a6a88;
}

.match-card-info .info-item strong {
  color: #3a4a6b;
}

.match-card-bio {
  font-size: 14px;
  color: #5a6a88;
  line-height: 1.5;
  border-top: 1px solid rgba(124, 148, 184, 0.15);
  padding-top: 12px;
  margin: 0;
}

.match-card-hobbies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.hobby-tag-mini {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(94, 108, 246, 0.08);
  border: 1px solid rgba(94, 108, 246, 0.2);
  color: #5e6cf6;
}

.match-actions {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 16px 0 4px;
}

.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.action-btn:hover {
  transform: scale(1.08);
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn span {
  font-size: 24px;
  line-height: 1;
}

.action-btn small {
  font-size: 10px;
  font-weight: 700;
}

.action-pass {
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid rgba(200, 80, 80, 0.3);
  color: #c85050;
  box-shadow: 0 4px 16px rgba(200, 80, 80, 0.12);
}

.action-pass:hover {
  box-shadow: 0 6px 20px rgba(200, 80, 80, 0.22);
}

.action-like {
  background: linear-gradient(135deg, #ff6b8a, #ff4d6d);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.3);
}

.action-like:hover {
  box-shadow: 0 6px 20px rgba(255, 77, 109, 0.45);
}

.guest-match-cta {
  text-align: center;
  padding: 12px 0 4px;
  border-top: 1px solid rgba(124, 148, 184, 0.15);
  margin-top: 8px;
}

.guest-match-cta p {
  color: #8c96a8;
  font-size: 12px;
  margin: 0 0 10px;
}

.guest-match-cta .row-cta {
  justify-content: center;
}

.guest-match-cta .btn {
  width: auto;
  padding: 9px 16px;
  font-size: 13px;
  margin: 0;
}

/* ── Hobby Multi-Select ── */
.hobby-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hobby-input-wrap {
  position: relative;
}

.hobby-input {
  width: 100%;
  border: 1px solid rgba(128, 149, 188, 0.33);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  background: rgba(252, 254, 255, 0.8);
}

.hobby-input:focus {
  outline: 2px solid rgba(106, 126, 247, 0.25);
  border-color: rgba(101, 120, 239, 0.58);
}

.hobby-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(124, 148, 184, 0.35);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(56, 84, 135, 0.15);
  z-index: 10;
  backdrop-filter: blur(8px);
}

.hobby-dropdown.open {
  display: block;
}

.hobby-option {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.12s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hobby-option:hover {
  background: rgba(106, 126, 247, 0.1);
  color: #3a4a8a;
}

.hobby-option.selected {
  color: #5e6cf6;
  font-weight: 600;
}

.hobby-option.selected::after {
  content: '✓';
  font-size: 13px;
}

.hobby-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
}

.hobby-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(94, 108, 246, 0.1);
  border: 1px solid rgba(94, 108, 246, 0.25);
  color: #4a5dc7;
  font-size: 13px;
  font-weight: 600;
  animation: tagIn 0.2s ease;
}

@keyframes tagIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.hobby-tag-remove {
  background: none;
  border: none;
  color: #8c96a8;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0;
}

.hobby-tag-remove:hover {
  color: #c85050;
}

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

/* ── Match Nav ── */
.match-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
  border-top: 1px solid rgba(124, 148, 184, 0.15);
  margin-top: 8px;
}

.match-nav .btn {
  width: auto;
  padding: 8px 18px;
  font-size: 13px;
  margin: 0;
}

/* ── Mutual Matches ── */
#view-mutual,
#view-chatlist,
#view-chat {
  max-width: 480px;
}

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

.mutual-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(124, 148, 184, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.mutual-item:hover {
  background: rgba(243, 247, 255, 0.9);
  border-color: rgba(106, 126, 247, 0.35);
}

.mutual-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #e8edff, #fce8f4);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: rgba(100, 120, 200, 0.4);
}

.mutual-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.mutual-info {
  flex: 1;
  min-width: 0;
}

.mutual-info strong {
  display: block;
  font-size: 15px;
  color: var(--text);
}

.mutual-info small {
  color: var(--muted);
  font-size: 12px;
}

.mutual-chat-btn {
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid rgba(94, 108, 246, 0.3);
  background: rgba(94, 108, 246, 0.08);
  color: #5e6cf6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.mutual-chat-btn:hover {
  background: rgba(94, 108, 246, 0.15);
}

/* ── Chat List ── */
.chat-list {
  display: grid;
  gap: 6px;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.chat-list-item:hover {
  background: rgba(243, 247, 255, 0.8);
}

.chat-list-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, #e8edff, #fce8f4);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: rgba(100, 120, 200, 0.4);
  overflow: hidden;
}

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

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

.chat-list-info .chat-list-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.chat-list-info .chat-list-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-list-meta {
  text-align: right;
  flex-shrink: 0;
}

.chat-list-meta .chat-list-time {
  font-size: 11px;
  color: var(--muted);
  display: block;
}

.chat-unread-badge {
  display: inline-block;
  background: #ff4d6d;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-top: 4px;
}

/* ── Chat View ── */
.chat-panel {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(124, 148, 184, 0.15);
}

.chat-header .back-btn {
  flex-shrink: 0;
}

.chat-header-info {
  flex: 1;
}

.chat-header-info strong {
  font-size: 16px;
  display: block;
}

.chat-header-info small {
  color: var(--muted);
  font-size: 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  animation: rise 0.2s ease;
}

.chat-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(120deg, #5e6cf6, #7f5be8);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble.received {
  align-self: flex-start;
  background: rgba(243, 247, 255, 0.95);
  color: var(--text);
  border: 1px solid rgba(124, 148, 184, 0.2);
  border-bottom-left-radius: 4px;
}

.chat-bubble .bubble-time {
  font-size: 10px;
  opacity: 0.6;
  margin-top: 4px;
  display: block;
}

.chat-bubble.sent .bubble-time {
  text-align: right;
}

.chat-input-area {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(124, 148, 184, 0.15);
  background: rgba(255, 255, 255, 0.6);
}

.chat-input {
  flex: 1;
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(124, 148, 184, 0.3);
  font: inherit;
  font-size: 14px;
}

.chat-input:focus {
  outline: 2px solid rgba(106, 126, 247, 0.25);
  border-color: rgba(101, 120, 239, 0.58);
}

.chat-input-area .btn {
  width: auto;
  padding: 10px 18px;
  margin: 0;
}

#view-mutual,
#view-chatlist,
#view-chat {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
  background: rgba(238, 243, 255, 0.92);
  backdrop-filter: blur(4px);
}

#view-mutual.active,
#view-chatlist.active,
#view-chat.active {
  display: flex;
}

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

  .home-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 580px) {
  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  h1,
  h2 {
    font-size: 28px;
  }

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

  .mini-grid,
  .overview-grid,
  .match-tabs,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .photo-wall {
    grid-template-columns: repeat(2, 1fr);
  }

  .actions {
    width: 100%;
  }

  .actions .btn.small {
    flex: 1;
    text-align: center;
  }

  .row-cta {
    flex-direction: column;
  }
}
