:root {
  --ocean: #087e8b;
  --ocean-2: #0aa0a8;
  --deep: #0b3954;
  --ink: #142129;
  --muted: #64727a;
  --line: #dcecef;
  --sky: #eaf7ff;
  --mist: #f5fbfc;
  --card: #ffffff;
  --coral: #ff5a5f;
  --sun: #ffc857;
  --shadow: 0 18px 50px rgba(11, 57, 84, .10);
  --shadow-soft: 0 10px 28px rgba(11, 57, 84, .07);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(10,160,168,.10), transparent 34%), var(--mist);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
button:disabled { opacity: .55; cursor: not-allowed; }
a { color: inherit; }

.landing {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(8,126,139,.88), rgba(11,57,84,.80)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
}
.hero-shell {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 34px);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
}
.topbar, .app-header, .brand-row, .hero-actions, .feature-strip, .filter-bar, .tabs, .chat-composer, .check-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar, .app-header, .brand-row { justify-content: space-between; }
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--ocean), var(--deep));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  letter-spacing: -.03em;
  box-shadow: 0 12px 28px rgba(8,126,139,.28);
}
.logo-mark {
  object-fit: contain;
  padding: 0;
  background: transparent;
}
.hero {
  align-self: center;
  color: white;
  max-width: 820px;
  padding: 8vh 0 4vh;
}
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .10em;
  font-weight: 900;
  color: var(--sun);
}
.hero h1 {
  font-size: clamp(54px, 10vw, 128px);
  margin: 0 0 18px;
  line-height: .88;
  letter-spacing: -.04em;
}
.hero-copy {
  font-size: clamp(19px, 2.6vw, 31px);
  line-height: 1.25;
  max-width: 760px;
  margin: 0 0 28px;
}
.hero-actions, .feature-strip { flex-wrap: wrap; }
.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-metrics span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  backdrop-filter: blur(12px);
}
.hero-metrics strong { color: var(--sun); }

.primary, .secondary, .ghost, .oauth, .danger-button {
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 900;
  min-height: 48px;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.primary { background: linear-gradient(135deg, var(--ocean), var(--ocean-2)); color: white; box-shadow: 0 14px 30px rgba(8,126,139,.22); }
.secondary { background: white; color: var(--deep); border: 1px solid var(--line); }
.ghost { background: rgba(255,255,255,.16); color: white; border: 1px solid rgba(255,255,255,.22); }
.primary:hover, .secondary:hover, .ghost:hover, .oauth:hover, .danger-button:hover { transform: translateY(-1px); }
.small { padding: 11px 16px; min-height: 42px; }
.full { width: 100%; }

.feature-strip { padding-bottom: 24px; }
.feature-strip article {
  flex: 1 1 230px;
  background: rgba(255,255,255,.90);
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 22px;
  padding: 20px;
  display: grid;
  gap: 5px;
  box-shadow: 0 18px 50px rgba(0,0,0,.08);
}
.feature-strip strong { font-size: 20px; }
.feature-strip span, .form-message, .member-card span, .empty-state span, .mini-card span, .approval-card span, .thread span {
  color: var(--muted);
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  color: rgba(255,255,255,.82);
  padding-bottom: 8px;
}
.site-footer a {
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}
.site-footer a:hover { text-decoration: underline; }
.app-footer {
  color: var(--muted);
  padding: 26px 4px 6px;
}

.legal-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(10,160,168,.14), transparent 34%),
    var(--mist);
}
.legal-shell {
  width: min(940px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 42px);
}
.legal-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--deep);
  font-size: 24px;
  font-weight: 900;
  text-decoration: none;
  margin-bottom: 24px;
}
.legal-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(220,236,239,.88);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
}
.legal-card h1 {
  font-size: clamp(38px, 6vw, 68px);
  line-height: .95;
  letter-spacing: -.04em;
  margin: 0 0 12px;
}
.legal-card h2 {
  margin: 28px 0 8px;
  color: var(--deep);
}
.legal-card p {
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 12px;
}
.legal-updated {
  font-weight: 900;
  color: var(--ocean) !important;
}

.auth-dialog {
  border: 0;
  border-radius: 28px;
  padding: 0;
  width: min(460px, calc(100% - 24px));
  box-shadow: 0 30px 90px rgba(11,57,84,.25);
}
.auth-dialog::backdrop { background: rgba(11,57,84,.48); backdrop-filter: blur(8px); }
.dialog-card { padding: 26px; display: grid; gap: 13px; position: relative; }
.dialog-card h2 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.dialog-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.close {
  position: absolute;
  right: 14px;
  top: 12px;
  background: #eef4f6;
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #d7e3e7;
  border-radius: 15px;
  padding: 14px 16px;
  background: white;
  color: var(--ink);
  outline: none;
}
select[multiple] {
  min-height: 148px;
  overflow: auto;
}
select[multiple] option {
  padding: 8px;
}
.select-button {
  width: 100%;
  border: 1px solid #d7e3e7;
  border-radius: 15px;
  padding: 14px 16px;
  background: white;
  color: var(--ink);
  text-align: left;
  min-height: 48px;
}
.option-panel {
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  box-shadow: var(--shadow-soft);
}
.option-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: white;
  border-bottom: 1px solid #edf4f6;
  color: var(--ink);
  text-align: left;
}
.option-row:last-child { border-bottom: 0; }
.option-row:hover, .option-row.active { background: var(--sky); }
.option-row strong {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ocean);
  color: white;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--ocean);
  box-shadow: 0 0 0 4px rgba(8,126,139,.12);
}
textarea { resize: vertical; }
.oauth { text-align: center; color: white; }
.google { background: #111827; }
.facebook { background: #1877f2; }
.divider { display: grid; place-items: center; color: var(--muted); margin: 4px 0; }
.auth-tabs, .gender-row, .choice-row, .auth-grid {
  display: grid;
  gap: 8px;
}
.auth-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: #e8f2f4;
  border-radius: 999px;
  padding: 5px;
}
.auth-tab, .gender-pill, .choice-pill {
  border-radius: 999px;
  padding: 12px 14px;
  background: transparent;
  color: var(--deep);
  font-weight: 900;
}
.auth-tab.active, .gender-pill.active, .choice-pill.active {
  background: white;
  color: var(--ocean);
  box-shadow: 0 8px 22px rgba(11,57,84,.10);
}
.register-fields { display: grid; gap: 11px; }
.gender-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-label {
  color: var(--muted);
  font-weight: 900;
  display: flex;
  justify-content: space-between;
}
input[type="range"] {
  padding: 0;
  accent-color: var(--ocean);
  border: 0;
  box-shadow: none;
}

.center-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.loader-card, .pricing-card, .panel {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(220,236,239,.86);
  border-radius: 26px;
  padding: clamp(18px, 3vw, 30px);
  box-shadow: var(--shadow);
}
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--sky); border-top-color: var(--ocean); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 18%, rgba(10,160,168,.22), transparent 32%),
    linear-gradient(135deg, rgba(245,251,252,.94), rgba(234,247,255,.96));
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
  visibility: visible;
}
.loading-card {
  width: min(340px, 100%);
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 26px;
  border: 1px solid rgba(220,236,239,.92);
  border-radius: 30px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 30px 90px rgba(11,57,84,.18);
  text-align: center;
}
.loading-logo-wrap {
  position: relative;
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
}
.loading-logo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 28px;
  border: 4px solid var(--sky);
  border-top-color: var(--ocean);
  border-right-color: var(--ocean-2);
  animation: spin .9s linear infinite;
}
.loading-logo {
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(8,126,139,.18));
}
.loading-card strong {
  color: var(--deep);
  font-size: 22px;
}
.loading-card span {
  color: var(--muted);
  line-height: 1.45;
}

.app-page { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.sidebar {
  background: linear-gradient(180deg, var(--deep), #08283b);
  color: white;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  min-height: 100vh;
}
.sidebar .brand-row { justify-content: flex-start; margin-bottom: 18px; }
.nav {
  color: rgba(255,255,255,.90);
  text-align: left;
  background: transparent;
  border-radius: 16px;
  padding: 13px 14px;
  font-weight: 800;
}
.nav-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.nav-badge,
.thread-title em {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ffb703;
  color: #08283b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}
.nav.active, .nav:hover { background: rgba(255,255,255,.14); color: white; }
.danger { color: #ffb4b4; margin-top: auto; }
.app-main { padding: clamp(18px, 4vw, 34px); overflow: auto; min-width: 0; }
.app-header {
  margin-bottom: 24px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(220,236,239,.78);
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
}
.app-header h1 { margin: 0; font-size: clamp(32px, 4vw, 54px); letter-spacing: -.04em; }
.app-header p { margin: 5px 0 0; color: var(--muted); }
.header-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.premium-active {
  background: #e7f7ee !important;
  color: #247a3b !important;
  box-shadow: none !important;
  cursor: default;
}

.view { display: none; }
.view.active { display: block; }
.filter-bar {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-soft);
  flex-wrap: wrap;
}
.filter-bar input, .filter-bar select { min-width: 150px; flex: 1; }
.check-row input { width: auto; }
.tabs { margin: 0 0 18px; background: #e8f2f4; padding: 6px; border-radius: 999px; }
.tab {
  flex: 1;
  min-height: 46px;
  border-radius: 999px;
  background: transparent;
  color: var(--deep);
  font-weight: 900;
}
.tab.active { background: white; color: var(--ocean); box-shadow: 0 8px 22px rgba(11,57,84,.10); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.member-card {
  background: var(--card);
  border: 1px solid rgba(220,236,239,.85);
  border-radius: 22px;
  padding: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease;
}
.profile-card {
  align-items: stretch;
  flex-direction: column;
  padding: 10px;
}
.member-card:hover { transform: translateY(-3px); box-shadow: 0 20px 44px rgba(11,57,84,.13); }
.member-card strong { font-size: 18px; line-height: 1.25; }
.member-card div:last-child { display: grid; gap: 3px; }
.member-photo {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--sky), #d7f0f4);
  color: var(--ocean);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 24px;
  object-fit: cover;
}
.profile-card .member-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  font-size: 46px;
}
.member-photo.big { width: 112px; height: 112px; border-radius: 30px; font-size: 42px; }
.member-photo.image { display: block; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8f7ee;
  color: #247a3d;
  font-size: 12px;
  font-weight: 900;
  vertical-align: middle;
}

.empty-state { background: var(--sky); border-radius: 20px; padding: 18px; display: grid; gap: 4px; }
.pricing-card { max-width: 560px; margin: 0 auto; display: grid; gap: 16px; }
.pricing-card h2 { margin: 0; font-size: clamp(34px, 5vw, 56px); letter-spacing: -.04em; }
.pricing-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.billing-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.billing-option {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: #fbfefe;
  border: 2px solid var(--line);
  color: var(--deep);
  text-align: left;
}
.billing-option.active {
  border-color: var(--ocean);
  background: var(--sky);
  box-shadow: 0 14px 30px rgba(8,126,139,.14);
}
.billing-option strong { font-size: 20px; }
.billing-option span { color: var(--muted); }
.billing-option em {
  font-style: normal;
  color: var(--ocean);
  font-size: 12px;
  margin-left: 4px;
}
.plan-list { display: grid; gap: 10px; }
.plan-list span {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfefe;
  font-weight: 800;
}
.plan-list span::before { content: "\2713"; color: var(--ocean); font-weight: 900; margin-right: 8px; }
.hidden { display: none !important; }
.location-field { position: relative; }
.suggestions {
  position: absolute;
  z-index: 8;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.suggestion {
  width: 100%;
  display: grid;
  gap: 2px;
  padding: 13px 15px;
  background: white;
  text-align: left;
  border-bottom: 1px solid #edf4f6;
}
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover { background: var(--sky); }
.suggestion span, .suggestion.muted { color: var(--muted); }

.form-panel { max-width: 960px; }
.form-panel h2, .panel h2 { margin-top: 0; letter-spacing: -.02em; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 18px 0; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid label, .panel label { color: var(--muted); font-weight: 800; display: grid; gap: 8px; }
.form-grid .wide { grid-column: 1 / -1; }
.language-field { position: relative; }
.language-field .option-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 10;
}
.split { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 12px; }
.mini-card, .approval-card {
  background: #fbfefe;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 8px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.section-head h2, .section-head p { margin: 0; }
.section-head p { color: var(--muted); margin-top: 4px; }
.staff-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(118px, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: #e8f2f4;
  margin-bottom: 18px;
  overflow-x: auto;
}
.staff-tab {
  min-height: 42px;
  border-radius: 999px;
  background: transparent;
  color: var(--deep);
  font-weight: 900;
}
.staff-tab.active {
  background: white;
  color: var(--ocean);
  box-shadow: 0 8px 22px rgba(11,57,84,.10);
}
.staff-panel h3 { margin: 0 0 14px; }
.staff-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.staff-toolbar h3 { margin: 0; }
.staff-toolbar input,
.staff-toolbar select {
  max-width: 280px;
}
.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.admin-card-head > div {
  display: grid;
  gap: 3px;
}
.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}
.admin-detail-grid .profile-lines,
.admin-detail-grid span {
  min-width: 0;
}
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: #edf4f6;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}
.status-pill.active,
.status-pill.approved,
.status-pill.verified {
  background: #e8f7ee;
  color: #247a3d;
}
.status-pill.open,
.status-pill.pending,
.status-pill.hidden {
  background: #fff6df;
  color: #9a5b00;
}
.status-pill.blocked,
.status-pill.rejected,
.status-pill.unverified {
  background: #ffe8e4;
  color: #b42318;
}
.admin-table {
  display: grid;
  gap: 8px;
}
.admin-table-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) minmax(130px, .7fr) minmax(160px, 1fr) minmax(210px, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfefe;
}
.admin-table-head {
  background: var(--sky);
  font-weight: 900;
}
.admin-table-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.admin-table-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}
.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.support-admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, .42fr) minmax(0, .58fr);
  gap: 18px;
}
.support-message-box {
  min-height: 280px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfefe;
  margin-bottom: 12px;
}
.support-message {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #edf4f6;
}
.support-message.staff {
  background: var(--sky);
  color: var(--deep);
}
.support-message small {
  color: var(--muted);
}
.attribute-layout {
  display: grid;
  grid-template-columns: minmax(260px, .42fr) minmax(0, .58fr);
  gap: 18px;
  align-items: start;
}
.attribute-sidebar {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfefe;
}
.attribute-list { display: grid; gap: 10px; }
.attribute-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
}
.attribute-row div { display: grid; gap: 3px; }
.attribute-row span { color: var(--muted); }
.muted-row { opacity: .58; }
.notice {
  background: var(--sky);
  border: 1px solid #ccebf5;
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 4px;
}
.verified-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2f7d16;
}
.verified-status span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #5daf22;
  color: white;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
}
.photo-manager { margin-top: 18px; }
.my-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.my-photo-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fbfefe;
}
.my-photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 16px;
  background: var(--sky);
  padding: 0;
}
.my-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.my-photo-preview span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(8,126,139,.92);
  color: white;
  font-size: 12px;
  font-weight: 900;
}
.my-photo-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.danger-button { background: #b42318; color: white; margin-top: 14px; box-shadow: 0 14px 30px rgba(180,35,24,.18); }
.icon-btn {
  border-radius: 15px;
  padding: 12px 14px;
  background: var(--sky);
  color: var(--deep);
  font-weight: 900;
  white-space: nowrap;
}

.chat-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
  height: calc(100dvh - 190px);
  min-height: 560px;
  overflow: hidden;
}
.thread-list {
  padding: 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
}
.thread {
  width: 100%;
  background: transparent;
  text-align: left;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 4px;
  border: 1px solid transparent;
}
.thread-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.thread-title em {
  background: var(--ocean);
  color: white;
}
.thread:hover, .thread.active { background: var(--sky); border-color: #cfeaf0; }
.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}
.chat-header { padding: 18px 22px; border-bottom: 1px solid #e3ecef; font-weight: 900; font-size: 22px; }
.chat-messages {
  padding: 22px;
  overflow: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, #fff, #f7fbfa);
  overscroll-behavior: contain;
}
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble {
  max-width: min(560px, 82%);
  background: #edf2f4;
  border-radius: 20px 20px 20px 7px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  line-height: 1.4;
}
.bubble-row.mine .bubble { background: #263238; color: white; border-radius: 20px 20px 7px 20px; }
.bubble small { color: #8b98a5; font-size: 12px; }
.chat-composer { padding: 14px; border-top: 1px solid #e3ecef; background: white; }
.chat-composer input { flex: 1; }
.chat-image { max-width: 280px; max-height: 280px; object-fit: cover; border-radius: 16px; }
audio { max-width: 280px; }

.profile-summary, .profile-lines { display: grid; gap: 0; }
.profile-lines span {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0;
  border-bottom: 1px solid #e5eef1;
  color: var(--muted);
}
.profile-lines strong { color: var(--ink); text-align: right; }
.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.photo-strip img { width: 168px; height: 204px; object-fit: cover; border-radius: 22px; background: var(--sky); }
.approval-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.approval-images img, .approval-images div {
  width: 100%;
  min-height: 220px;
  border-radius: 18px;
  object-fit: cover;
  background: var(--sky);
  display: grid;
  place-items: center;
  color: #b42318;
  padding: 12px;
}

@media (max-width: 980px) {
  .app-page { grid-template-columns: 1fr; }
  .sidebar {
    min-height: 0;
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    padding: 12px;
    border-radius: 0 0 22px 22px;
  }
  .sidebar .brand-row { margin-bottom: 0; min-width: max-content; }
  .danger { margin-top: 0; }
  .nav { min-width: max-content; }
  .chat-layout { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .hero-shell { padding: 16px; }
  .hero { padding-top: 5vh; }
  .hero-actions > *, .topbar .ghost { flex: 1; }
  .feature-strip article { flex-basis: 100%; }
  .app-main { padding: 16px; }
  .app-header { align-items: flex-start; flex-direction: column; border-radius: 22px; }
  .header-actions, .filter-bar, .chat-composer { align-items: stretch; flex-direction: column; width: 100%; }
  .filter-bar input, .filter-bar select, .header-actions button { width: 100%; }
  .tabs { gap: 6px; overflow-x: auto; border-radius: 18px; }
  .tab { min-width: 128px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .member-card strong { font-size: 16px; }
  .form-grid, .split { grid-template-columns: 1fr; }
  .attribute-layout,
  .support-admin-layout { grid-template-columns: 1fr; }
  .staff-tabs { grid-template-columns: repeat(6, minmax(112px, 1fr)); }
  .staff-toolbar { align-items: stretch; flex-direction: column; }
  .staff-toolbar input,
  .staff-toolbar select { max-width: none; width: 100%; }
  .admin-detail-grid { grid-template-columns: 1fr; }
  .admin-table-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .chat-layout, .chat-panel { min-height: auto; }
  .chat-messages { min-height: 440px; padding: 16px; }
  .bubble { max-width: 88%; }
  .approval-images { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .grid { grid-template-columns: 1fr; }
  .profile-card .member-photo { aspect-ratio: 16 / 12; }
  .primary, .secondary, .ghost, .oauth, .danger-button { width: 100%; }
  .dialog-card { padding: 22px; }
  .auth-grid, .choice-row { grid-template-columns: 1fr; }
}

/* TravelFriend-inspired web shell, tuned to Trip Connect colors. */
.app-page {
  grid-template-columns: 250px minmax(0, 1fr);
  background: #fff;
}
.sidebar {
  background: #fff;
  color: var(--ink);
  padding: 104px 22px 22px;
  border-right: 1px solid #edf2f4;
}
.sidebar .brand-row {
  position: fixed;
  inset: 0 0 auto 0;
  height: 74px;
  z-index: 6;
  justify-content: flex-start;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid #edf2f4;
  box-shadow: 0 2px 10px rgba(11,57,84,.06);
}
.sidebar .brand-row strong { color: var(--ocean); font-size: 28px; }
.nav {
  color: var(--ink);
  border-radius: 8px;
  padding: 15px 18px;
}
.nav.active, .nav:hover {
  background: #cfe8fb;
  color: var(--ocean);
}
.danger { color: #b42318; }
.app-header {
  background:
    linear-gradient(90deg, rgba(207,232,251,.98), rgba(207,232,251,.72)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1300&q=80") right center/cover;
  border-radius: 8px;
  padding: 36px;
}
.grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
}
.member-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 8px;
  padding: 0;
  position: relative;
}
.member-card:hover {
  box-shadow: none;
  transform: translateY(-3px);
}
.member-card strong { font-size: 17px; }
.member-card strong span { font-weight: 500; color: var(--ink); }
.profile-card .member-photo {
  aspect-ratio: 1 / 1;
  border-radius: 8px;
}
.verified-corner {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #5daf22;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
#profileDialog {
  width: min(1280px, calc(100% - 28px));
}
#profileDialog .dialog-card {
  padding: clamp(18px, 3vw, 30px);
}
.profile-popout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  gap: 34px;
}
.profile-photo-hero { position: relative; }
.profile-photo-hero img {
  width: 100%;
  max-height: 74vh;
  object-fit: cover;
  border-radius: 8px;
  cursor: zoom-in;
}
.verified-float {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(11,57,84,.72);
  color: white;
  font-weight: 800;
}
.profile-popout-info h2 {
  font-size: 34px;
  margin: 12px 0 4px;
}
.profile-popout-info h2 span { font-weight: 400; }
.profile-verified-line,
.profile-unverified-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  font-weight: 900;
}
.profile-verified-line {
  color: #3f8f1d;
}
.profile-verified-line span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #5daf22;
  color: white;
  font-size: 14px;
}
.profile-unverified-line {
  color: var(--muted);
}
.profile-location {
  color: var(--muted);
  font-size: 20px;
  margin-top: 0;
}
.profile-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  margin: 26px 0;
}
.icon-star {
  background: transparent;
  font-size: 42px;
  color: var(--ink);
}
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 26px;
}
.profile-tags span {
  border: 1px solid #98cafa;
  color: var(--deep);
  border-radius: 999px;
  padding: 8px 14px;
}
.photo-strip {
  padding: 14px 0 6px;
}
.photo-strip img {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  cursor: zoom-in;
}
.photo-viewer-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(92vw, 1100px);
  max-height: 92vh;
}
.photo-viewer-dialog::backdrop { background: rgba(0,0,0,.72); }
.photo-viewer-dialog img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
}
.viewer-close {
  position: fixed;
  top: 18px;
  right: 24px;
  z-index: 2;
}

@media (max-width: 980px) {
  .sidebar { padding: 86px 12px 12px; border-radius: 0; }
  .profile-popout { grid-template-columns: 1fr; }
}

/* Final mobile overrides. These intentionally come last so the desktop-inspired shell cannot win on phones. */
@media (max-width: 760px) {
  body.app-page {
    display: block;
    min-width: 0;
    overflow-x: hidden;
  }
  .app-page {
    display: block;
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 0;
    width: 100%;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid #edf2f4;
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    background: rgba(255,255,255,.98);
    box-shadow: 0 8px 22px rgba(11,57,84,.08);
  }
  .sidebar .brand-row {
    position: static;
    inset: auto;
    height: auto;
    min-width: max-content;
    padding: 0 8px 0 0;
    margin: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .sidebar .brand-row strong {
    font-size: 18px;
    white-space: nowrap;
  }
  .sidebar .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .nav {
    min-width: max-content;
    padding: 10px 12px;
    border-radius: 999px;
    font-size: 14px;
    white-space: nowrap;
  }
  .danger {
    margin-top: 0;
  }
  .app-main {
    padding: 14px;
    overflow: visible;
  }
  .app-header {
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 18px;
    flex-direction: column;
    align-items: flex-start;
  }
  .app-header h1 {
    font-size: clamp(30px, 11vw, 42px);
  }
  .header-actions,
  .filter-bar,
  .chat-composer,
  .profile-actions,
  .hero-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .filter-bar input,
  .filter-bar select,
  .header-actions button,
  .profile-actions button,
  .hero-actions button {
    width: 100%;
    min-width: 0;
  }
  .tabs {
    overflow-x: auto;
    gap: 6px;
    border-radius: 999px;
  }
  .tab {
    min-width: 118px;
    flex: 0 0 auto;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .profile-card .member-photo {
    aspect-ratio: 1 / 1;
  }
  .member-card strong {
    font-size: 16px;
  }
  .form-grid,
  .split,
  .attribute-layout,
  .support-admin-layout,
  .billing-toggle,
  .chat-layout,
  .profile-popout {
    grid-template-columns: 1fr;
  }
  .chat-layout,
  .chat-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  .thread-list {
    max-height: 42vh;
    overflow: auto;
  }
  .chat-messages {
    min-height: 52vh;
    max-height: 58vh;
    padding: 14px;
  }
  .bubble {
    max-width: 86%;
  }
  #profileDialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  #profileDialog .dialog-card {
    min-height: 100dvh;
    border-radius: 0;
    padding: 16px;
    overflow: auto;
  }
  .profile-photo-hero img {
    max-height: 58vh;
  }
  .profile-popout-info h2 {
    font-size: 28px;
  }
  .profile-location {
    font-size: 16px;
  }
  .photo-strip img {
    width: 84px;
    height: 84px;
  }
  .my-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .my-photo-actions {
    grid-template-columns: 1fr;
  }
  .section-head {
    flex-direction: column;
  }
  .approval-images {
    grid-template-columns: 1fr;
  }
  .app-footer {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 430px) {
  .hero h1 {
    font-size: clamp(48px, 18vw, 72px);
  }
  .grid,
  .my-photo-grid {
    grid-template-columns: 1fr;
  }
  .profile-lines span {
    display: grid;
    gap: 4px;
  }
  .profile-lines strong {
    text-align: left;
  }
  .pricing-card,
  .panel {
    border-radius: 18px;
    padding: 16px;
  }
}

.top-notice {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 2500;
  width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  font-weight: 800;
  line-height: 1.35;
  transform: translate(-50%, -140%);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.top-notice.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.top-notice.warning {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.top-notice.success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.top-notice.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Phone hardening for the logged-in web app. Keep this last. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.app-page {
    display: block !important;
  }

  .sidebar {
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar::-webkit-scrollbar,
  .tabs::-webkit-scrollbar {
    display: none;
  }

  .app-main,
  .view,
  .panel,
  .dialog-card,
  .chat-panel,
  .thread,
  .member-card {
    min-width: 0;
    max-width: 100%;
  }

  .app-header p,
  .member-card p,
  .thread small,
  .bubble,
  .profile-lines span {
    overflow-wrap: anywhere;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .filter-bar .check-row {
    justify-content: flex-start;
  }

  .chat-composer {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .chat-composer .icon-btn,
  .chat-composer .primary {
    width: auto;
    min-width: 0;
    padding-inline: 12px;
  }

  .chat-composer input {
    min-width: 0;
    width: 100%;
  }

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

  .profile-actions .icon-star {
    width: 100%;
  }

  .photo-viewer-dialog,
  .photo-viewer-dialog img {
    max-width: 96vw;
    max-height: 88dvh;
  }
}

@media (max-width: 380px) {
  .chat-composer {
    grid-template-columns: auto auto 1fr;
  }

  .chat-composer .primary {
    grid-column: 1 / -1;
  }
}
