:root {
  /* Matches mobile/src/lib/theme.ts exactly - keep these two in sync by hand. */
  --bg: #ffffff;
  --panel: #f4f9f8;
  --panel-2: #e8f3f1;
  --text: #0f1f1e;
  --soft: #5c7472;
  --accent: #0f766e;
  /* Decorative-only - accent-2 fails WCAG AA contrast as a foreground color (~1.9:1 on white).
     Use it for gradients, borders, and backgrounds; use --accent for text and icons. */
  --accent-2: #2dd4bf;
  /* Darker gradient end-stop for white/on-accent text that sits directly on top of an
     accent -> accent-2 gradient (buttons, message bubbles, avatar initials) - accent-2 itself
     is too light for white text to stay readable across the full gradient. */
  --accent-2-onwhite: #0f8171;
  --border: rgba(15, 118, 110, 0.16);
  /* White text/icon color for on top of solid accent-colored backgrounds - matches theme.onAccent. */
  --on-accent: #ffffff;
  /* Background for inputs/chips - matches theme.inputBg. */
  --input-bg: #f1f6f5;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: radial-gradient(circle at top, #e6f7f5, var(--bg));
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 800;
  font-size: 1.2rem;
}

nav {
  display: flex;
  gap: 1rem;
}

nav a {
  color: var(--soft);
  text-decoration: none;
}

main {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 8rem;
}

/* --- App tab bar: mirrors the mobile app's floating bottom tab bar (see
   mobile/src/app/(app)/(tabs)/_layout.tsx) - only one app-tab-panel is shown at a time
   instead of every section being stacked on one long scrolling page. --- */

.app-tab-bar {
  position: sticky;
  top: 5.5rem;
  z-index: 40;
  display: flex;
  gap: 0.25rem;
  height: 64px;
  margin: 0 auto 1.5rem;
  padding: 0 0.5rem;
  max-width: 640px;
  border-radius: 32px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 30px rgba(45, 212, 191, 0.12);
}

.app-tab-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: none;
  border: none;
  border-radius: 24px;
  color: var(--soft);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.2rem;
}

.app-tab-btn svg {
  width: 20px;
  height: 20px;
}

.app-tab-btn.active {
  color: var(--accent);
}

.app-tab-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
}

.app-tab-panel {
  scroll-margin-top: 9rem;
  /* !important is deliberate: several of these sections carry their own layout class
     (auth-layout/split-layout/business-model, all display:grid) that would otherwise win the
     cascade over a plain .active-tab { display: block } rule of equal-or-lower specificity,
     leaving inactive tabs visible - see the .message-form[hidden] bug this codebase already
     hit once for the same reason. */
  display: none !important;
}

.app-tab-panel.active-tab {
  display: block !important;
}

.app-tab-panel.active-tab.auth-layout {
  display: grid !important;
}

.marketing-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.5rem;
  align-items: center;
  padding: 2rem 0 3rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0.15rem 0 1rem;
}

.lede,
.section-heading p,
.match-card p,
.business-model div,
.panel p,
li {
  color: var(--soft);
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.2rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}

.btn.primary {
  /* Matches PrimaryButton's LinearGradient direction in the mobile app (left to right). */
  background: linear-gradient(to right, var(--accent), var(--accent-2-onwhite));
  color: var(--on-accent);
}

.btn.secondary {
  border-color: var(--border);
  color: var(--text);
}

.btn[hidden] {
  display: none;
}

.hero-card,
.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(15, 31, 30, 0.08);
}

.hero-card {
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.mini-card {
  padding: 1.2rem;
  background: var(--panel-2);
  border-radius: 18px;
}

.mini-card.accent {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(94, 234, 212, 0.18));
}

.mini-label {
  color: var(--soft);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.4rem;
}

.hero-card strong {
  font-size: 1.5rem;
}

.panel {
  margin-top: 1.4rem;
  padding: 1.4rem;
}

.section-heading h2,
.panel h2 {
  margin-top: 0;
}

.auth-layout {
  display: grid;
  gap: 1rem;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.auth-column {
  display: grid;
  gap: 1rem;
}

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

.forgot-link {
  align-self: center;
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
}

.forgot-link:hover {
  text-decoration: underline;
}

.field-hint {
  margin: -0.5rem 0 0;
  color: var(--soft);
  font-size: 0.8rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--soft);
}

.full-width {
  grid-column: 1 / -1;
}

.detected-location {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  color: var(--soft);
}

.detected-location .location-status {
  margin: 0;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}

.discovery-layout {
  display: grid;
  gap: 1rem;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.shows-filter-row {
  max-width: 320px;
}

.location-suggestions {
  margin-top: -0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  overflow: hidden;
}

.location-suggestion-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.location-suggestion-row:last-child {
  border-bottom: none;
}

.location-suggestion-row:hover {
  background: rgba(45, 212, 191, 0.12);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-group[hidden] {
  display: none;
}

.field-label {
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 600;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active {
  /* Solid accent, not a gradient - matches ChipMultiSelect's chipActive in the mobile app. */
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}

.radius-field input[type="range"] {
  padding: 0;
  background: transparent;
  border: none;
  accent-color: var(--accent);
}

.matches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.match-grid,
.business-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.discover-load-more {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 1rem;
}

.discover-load-more .btn {
  width: auto;
  display: inline-flex;
}

.match-card,
.business-model div {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
}

.match-actions {
  display: flex;
  gap: 0.75rem;
}

.match-status,
.location-status {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.32);
}

.matched-list,
.message-preview {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
}

.matched-list .match-card {
  cursor: pointer;
  border: 1px solid transparent;
}

.matched-list .match-card.active {
  border-color: var(--accent);
}

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
  margin: 0.8rem 0;
}

.message-bubble {
  max-width: 80%;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: var(--panel-2);
  color: var(--text);
}

.message-bubble.outgoing {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-2-onwhite));
  color: var(--on-accent);
}

.message-bubble time {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  opacity: 0.7;
}

.message-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.message-form[hidden] {
  display: none;
}

.message-form input {
  flex: 1;
}

.message-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.message-actions {
  display: flex;
  gap: 0.9rem;
}

.message-actions[hidden] {
  display: none;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text);
}

.link-btn.danger {
  color: #dc2626;
}

.link-btn.danger:hover {
  color: #b91c1c;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 13, 13, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.modal-header h3 {
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-sheet textarea {
  width: 100%;
  margin-top: 0.6rem;
}

.modal-sheet .btn {
  width: 100%;
  margin-top: 1rem;
  border: none;
}

.lessons-segment-row {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 1.2rem;
  width: fit-content;
}

.lessons-segment-btn {
  border: none;
  background: transparent;
  color: var(--soft);
  font-weight: 700;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
}

.lessons-segment-btn.active {
  background: var(--accent);
  color: var(--on-accent);
}

.lessons-panel[hidden] {
  display: none;
}

#offerLessonsBtn {
  margin-bottom: 1.2rem;
}

.teacher-card-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.teacher-card-info h3 {
  margin: 0;
  font-size: 1.1rem;
}

.teacher-card-info p {
  margin: 0.15rem 0;
  font-size: 0.85rem;
}

.bookings-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.bookings-section h3 {
  margin: 0 0 0.6rem;
}

.booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.booking-row:last-child {
  border-bottom: none;
}

.teaching-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.teaching-section h3 {
  margin: 0 0 0.6rem;
}

.teaching-section .btn {
  margin-top: 0.6rem;
}

#teachingRateRow label {
  margin-top: 0.6rem;
}

.blocked-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.blocked-section h4 {
  margin: 0 0 0.6rem;
}

.blocked-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.blocked-row:last-child {
  border-bottom: none;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2-onwhite));
  color: var(--on-accent);
  font-weight: 800;
  margin-bottom: 0.8rem;
  object-fit: cover;
}

.avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar-row .avatar {
  margin-bottom: 0;
  flex-shrink: 0;
}

.gallery-editor {
  display: grid;
  gap: 0.6rem;
}

.gallery-editor h4 {
  margin: 0;
  color: var(--text);
}

.gallery-row {
  display: flex;
  gap: 0.6rem;
}

.gallery-thumb-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
}

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

.gallery-play-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.6rem;
  display: grid;
  place-items: center;
}

.gallery-empty-slot {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px dashed var(--border);
}

.gallery-carousel {
  position: relative;
  margin-top: 0.6rem;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--panel-2);
  cursor: pointer;
  user-select: none;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.25s ease;
}

.gallery-page {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

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

.gallery-carousel .gallery-play-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
}

.gallery-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.gallery-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.gallery-dot.active {
  background: var(--accent);
}

.match-card span {
  display: inline-block;
  margin-top: 0.6rem;
  color: var(--accent);
  font-weight: 700;
}

.match-card p {
  margin: 0.2rem 0;
}

.match-card p strong,
.match-card span strong {
  color: var(--text);
}

.match-card .btn {
  display: block;
  margin-top: 0.75rem;
  width: 100%;
}

.profile-card {
  position: relative;
  padding: 0;
  aspect-ratio: 0.72;
  overflow: hidden;
}

.profile-card .gallery-carousel {
  position: absolute;
  inset: 0;
  margin: 0;
  aspect-ratio: unset;
  border-radius: 0;
}

.profile-card .gallery-carousel .gallery-play-badge {
  top: 14px;
  bottom: auto;
  right: 14px;
}

.profile-card .gallery-carousel .gallery-dots {
  top: 14px;
  bottom: auto;
}

.profile-card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 22%;
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-2) 100%);
}

.profile-card-fallback span {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(8, 16, 31, 0.22);
  color: var(--on-accent);
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  font-weight: 800;
}

.profile-card-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(8, 16, 31, 0.6) 50%, rgba(8, 16, 31, 0.97) 100%);
  pointer-events: none;
}

.profile-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Fixed light colors, not the theme tokens: this content always sits over a dark photo/
   gradient + scrim (see .profile-card-scrim), independent of whether the app theme is light
   or dark, so it can't follow --text/--soft the way a normal card's text does. */
.profile-card-content h3 {
  margin: 0 0 0.1rem;
  font-size: 1.35rem;
  color: #f5faf9;
}

.profile-card-content p,
.profile-card-content span {
  color: #cfe3e0;
}

.profile-card-content p strong,
.profile-card-content span strong {
  color: #ffffff;
}

.listing-poster-preview:empty {
  display: none;
}

.listing-poster-preview img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  margin-top: 0.4rem;
}

.listing-card {
  padding: 0;
  overflow: hidden;
}

.listing-poster {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.listing-poster-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--panel-2), var(--bg));
  color: var(--accent-2);
  font-size: 2rem;
  opacity: 0.7;
}

.listing-card-body {
  padding: 1rem;
}

.listing-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.listing-card-title-row h3 {
  margin: 0;
}

/* Only rendered for non-default listing types - a "Show" badge on every show would be noise. */
.listing-type-badge {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
}

.feature-card h3 {
  margin-top: 0;
}

.split-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.profile-dashboard {
  background: var(--panel-2);
  border-radius: 18px;
  padding: 1rem;
  display: grid;
  gap: 1rem;
}

.current-profile {
  background: rgba(15, 31, 30, 0.03);
  border-radius: 14px;
  padding: 1rem;
}

.profile-dashboard .profile-form {
  margin-top: 0.25rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.success-message {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: rgba(94, 234, 212, 0.15);
  border: 1px solid rgba(94, 234, 212, 0.4);
}

/* --- Teacher listing settings (create/edit listing + weekly availability) --- */

.teaching-section .field-group,
.availability-section .field-group {
  margin-top: 0.8rem;
}

.teaching-section label,
.availability-section label {
  margin-top: 0.6rem;
}

.availability-section {
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border);
}

.availability-section h3 {
  margin: 0 0 0.6rem;
}

.availability-section .btn {
  margin-top: 0.8rem;
}

.availability-time-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.6rem;
}

.availability-time-row label {
  flex: 1;
  margin-top: 0;
}

.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.rule-row:last-child {
  border-bottom: none;
}

/* --- Teacher detail modal (bio, instrument picker, bookable slots) --- */

.teacher-detail-slots {
  margin-top: 1rem;
}

.slot-date-group {
  margin-top: 0.9rem;
}

.slot-date-group:first-child {
  margin-top: 0;
}

.slot-date-label {
  color: var(--soft);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.chip.slot-chip:disabled,
.chip.slot-chip[disabled] {
  opacity: 0.5;
  cursor: default;
}

#teacherDetailBio:empty,
#teacherDetailRate:empty {
  display: none;
}

/* --- Chat attachments: attach/GIF buttons, pending preview, image viewer --- */

.icon-btn {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--accent);
}

.message-attachment-preview {
  position: relative;
  width: fit-content;
  margin: 0.6rem 0;
}

.message-attachment-preview img {
  max-width: 140px;
  max-height: 140px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
}

.message-attachment-preview .modal-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 1rem;
  display: grid;
  place-items: center;
}

.message-bubble img.message-attachment-media,
/* Voice messages: playback only on web - recording is mobile-only. */
.message-attachment-audio {
  display: block;
  width: 240px;
  max-width: 100%;
  margin-top: 0.4rem;
}

.message-bubble video.message-attachment-media {
  max-width: 220px;
  max-height: 220px;
  border-radius: 12px;
  display: block;
  cursor: pointer;
  margin-top: 0.4rem;
}

.message-bubble .message-attachment-media:first-child {
  margin-top: 0;
}

.gif-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.8rem;
  max-height: 340px;
  overflow-y: auto;
}

.gif-picker-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  background: var(--panel-2);
}

#gifPickerSearchInput {
  width: 100%;
}

.image-viewer-sheet {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.image-viewer-sheet img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  display: block;
}

.image-viewer-close {
  position: absolute;
  top: -2.2rem;
  right: 0;
  color: #fff;
}

/* --- Unread conversation indicator --- */

.matched-list .match-card {
  position: relative;
}

.unread-dot {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.25);
}

/* --- Skeleton loaders --- */

.skeleton-block {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(15, 31, 30, 0.05) 25%, rgba(15, 31, 30, 0.1) 37%, rgba(15, 31, 30, 0.05) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.skeleton-card {
  height: 180px;
}

.skeleton-row {
  height: 64px;
  margin-bottom: 0.75rem;
}

/* --- Empty states with an optional action --- */

.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--soft);
}

.empty-state p {
  margin: 0 0 0.9rem;
}

.empty-state .btn {
  width: auto;
  display: inline-flex;
}

/* --- Inline error banner for failed fetches --- */

.error-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #b91c1c;
  margin-bottom: 1rem;
}

.error-banner button {
  flex-shrink: 0;
}

/* --- List entrance animation --- */

@keyframes list-item-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.match-grid > *,
.matched-list > *,
.listings-grid > * {
  animation: list-item-in 0.28s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block,
  .match-grid > *,
  .matched-list > *,
  .listings-grid > * {
    animation: none;
  }
}

@media (max-width: 820px) {
  .hero,
  .auth-grid,
  .profile-form,
  .split-layout,
  .matches-grid,
  .match-grid,
  .business-grid,
  .features-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    gap: 0.6rem;
  }

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