:root {
  color-scheme: light;
  --cz-bg: #f7f8fc;
  --cz-surface: #ffffff;
  --cz-surface-2: #f0f2f8;
  --cz-text: #182033;
  --cz-muted: #687086;
  --cz-line: rgba(24, 32, 51, 0.1);
  --cz-primary: #ef476f;
  --cz-primary-dark: #d93861;
  --cz-accent: #7c4dff;
  --cz-success: #1fa971;
  --cz-danger: #dc3545;
  --cz-shadow: 0 22px 60px rgba(24, 32, 51, 0.1);
  --cz-shadow-sm: 0 10px 30px rgba(24, 32, 51, 0.08);
  --cz-radius: 24px;
  --cz-radius-sm: 15px;
  --cz-container: 1180px;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --cz-bg: #0e1320;
  --cz-surface: #171e2e;
  --cz-surface-2: #20293c;
  --cz-text: #f4f6fb;
  --cz-muted: #a9b1c3;
  --cz-line: rgba(255, 255, 255, 0.1);
  --cz-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  --cz-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.2);
}

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

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 4%, rgba(239, 71, 111, 0.1), transparent 28rem),
    radial-gradient(circle at 92% 16%, rgba(124, 77, 255, 0.09), transparent 30rem),
    var(--cz-bg);
  color: var(--cz-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  transition: background-color 180ms ease, color 180ms ease;
}

img,
video {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--cz-primary);
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  color: var(--cz-text);
  font-weight: 800;
  letter-spacing: -0.03em;
}

p {
  color: var(--cz-muted);
}

.cz-skip-link {
  position: fixed;
  z-index: 2000;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--cz-text);
  color: var(--cz-surface);
  transform: translateY(-150%);
  transition: transform 150ms ease;
}

.cz-skip-link:focus {
  color: var(--cz-surface);
  transform: translateY(0);
}

.cz-container {
  width: min(calc(100% - 32px), var(--cz-container));
  margin-inline: auto;
}

.cz-main {
  min-height: calc(100vh - 168px);
}

.cz-main-full {
  padding-top: 0;
}

/* Navigation */
.cz-top-shell {
  position: sticky;
  z-index: 1000;
  top: 0;
  border-bottom: 1px solid var(--cz-line);
  background: color-mix(in srgb, var(--cz-surface) 88%, transparent);
  box-shadow: 0 6px 24px rgba(24, 32, 51, 0.04);
  backdrop-filter: blur(18px);
}

.cz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(calc(100% - 32px), var(--cz-container));
  min-height: 76px;
  margin-inline: auto;
  gap: 28px;
}

.cz-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
}

.cz-brand img {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(239, 71, 111, 0.2);
}

.cz-brand span {
  display: grid;
  line-height: 1.15;
}

.cz-brand strong {
  color: var(--cz-text);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.cz-brand small {
  margin-top: 3px;
  color: var(--cz-muted);
  font-size: 0.72rem;
}

.cz-nav-menu,
.cz-nav-links,
.cz-nav-actions {
  display: flex;
  align-items: center;
}

.cz-nav-menu {
  flex: 1;
  justify-content: space-between;
  gap: 28px;
}

.cz-nav-links {
  gap: 6px;
}

.cz-nav-links > a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--cz-muted);
  font-size: 0.93rem;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease;
}

.cz-nav-links > a:hover {
  background: var(--cz-surface-2);
  color: var(--cz-primary);
}

.cz-nav-actions {
  gap: 10px;
}

.cz-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--cz-line);
  border-radius: 13px;
  background: var(--cz-surface);
  color: var(--cz-text);
  font-size: 1.45rem;
}

.cz-icon-btn {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--cz-line);
  border-radius: 13px;
  background: var(--cz-surface);
  color: var(--cz-text);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease;
}

.cz-icon-btn:hover {
  border-color: rgba(239, 71, 111, 0.35);
  color: var(--cz-primary);
  transform: translateY(-2px);
}

.cz-dot-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  place-items: center;
  border: 2px solid var(--cz-surface);
  border-radius: 999px;
  background: var(--cz-primary);
  color: white;
  font-size: 0.67rem;
  font-weight: 800;
}

.cz-account-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 5px;
  border: 1px solid var(--cz-line);
  border-radius: 999px;
  background: var(--cz-surface);
  color: var(--cz-text);
  font-weight: 750;
}

.cz-account-pill img,
.cz-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
}

.cz-menu-card {
  padding: 8px;
  border: 1px solid var(--cz-line);
  border-radius: 16px;
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-menu-card .dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--cz-text);
}

.cz-mobile-tabbar {
  display: none;
}

/* Buttons */
.cz-primary-btn,
.cz-ghost-btn,
.cz-link-btn,
.cz-inline-btn,
.cz-btn,
.cz-btn-solid,
.cz-ghost,
.cz-primary,
.cz-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.cz-primary-btn,
.cz-btn-solid,
.cz-primary {
  background: linear-gradient(135deg, var(--cz-primary), #ff6f91);
  box-shadow: 0 10px 24px rgba(239, 71, 111, 0.22);
  color: white;
}

.cz-primary-btn:hover,
.cz-btn-solid:hover,
.cz-primary:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(239, 71, 111, 0.3);
}

.cz-ghost-btn,
.cz-ghost,
.cz-btn,
.cz-link-btn,
.cz-inline-btn {
  border-color: var(--cz-line);
  background: var(--cz-surface);
  color: var(--cz-text);
}

.cz-ghost-btn:hover,
.cz-ghost:hover,
.cz-btn:hover,
.cz-link-btn:hover,
.cz-inline-btn:hover {
  border-color: rgba(239, 71, 111, 0.35);
  color: var(--cz-primary);
  transform: translateY(-2px);
}

.cz-danger {
  border-color: rgba(220, 53, 69, 0.22);
  background: rgba(220, 53, 69, 0.08);
  color: var(--cz-danger);
}

/* Typography and shared surfaces */
.cz-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--cz-primary);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.cz-h1 {
  margin: 12px 0 16px;
  font-size: clamp(3.25rem, 8vw, 7rem);
  line-height: 0.92;
}

.cz-h2 {
  margin: 10px 0 14px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.04;
}

.cz-h3 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.cz-lead {
  max-width: 720px;
  color: var(--cz-muted);
  font-size: clamp(1.02rem, 1.8vw, 1.22rem);
}

.cz-card,
.cz-panel {
  border: 1px solid var(--cz-line);
  border-radius: var(--cz-radius);
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-card {
  padding: 24px;
}

.cz-panel {
  padding: clamp(20px, 3vw, 32px);
}

.cz-panel-title,
.cz-section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}

.cz-panel-title h1,
.cz-panel-title h2,
.cz-panel-title h3,
.cz-section-title h1,
.cz-section-title h2,
.cz-list-item h3 {
  margin: 0;
}

.cz-panel-title p,
.cz-section-title p,
.cz-list-item p {
  margin: 5px 0 0;
}

.cz-section {
  padding-block: clamp(64px, 9vw, 112px);
}

.cz-section-tight {
  padding-block: clamp(34px, 6vw, 70px);
}

.cz-section-sub {
  padding-block: 30px;
}

.cz-grid,
.cz-grid-2,
.cz-grid-3,
.cz-grid-4 {
  display: grid;
  gap: 20px;
}

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

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

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

.cz-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(290px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.cz-chip-row,
.cz-kpi-strip,
.cz-action-row,
.cz-actions,
.cz-hero-actions,
.cz-swipe-actions,
.cz-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.cz-chip,
.cz-pill,
.cz-tag,
.cz-kpi-pill,
.cz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--cz-line);
  border-radius: 999px;
  background: var(--cz-surface-2);
  color: var(--cz-muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.cz-list-stack,
.cz-list {
  display: grid;
  gap: 13px;
}

.cz-list-item,
.cz-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--cz-line);
  border-radius: var(--cz-radius-sm);
  background: var(--cz-surface);
  color: var(--cz-text);
}

a.cz-list-item:hover {
  border-color: rgba(239, 71, 111, 0.3);
  color: var(--cz-text);
  transform: translateY(-1px);
}

.cz-list-item img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
}

.cz-tool-icon {
  display: grid;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: rgba(239, 71, 111, 0.11);
  color: var(--cz-primary);
  font-size: 1.2rem;
}

.cz-feature-card {
  min-height: 220px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cz-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--cz-shadow);
}

.cz-feature-card > i {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(239, 71, 111, 0.15), rgba(124, 77, 255, 0.13));
  color: var(--cz-primary);
  font-size: 1.45rem;
}

.cz-plan-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: flex-start;
}

.cz-plan-card h3 {
  margin-top: auto;
  font-size: 2rem;
}

.cz-empty-state,
.cz-empty {
  padding: 30px;
  border: 1px dashed var(--cz-line);
  border-radius: var(--cz-radius-sm);
  color: var(--cz-muted);
  text-align: center;
}

/* Landing hero */
.cz-hero {
  position: relative;
  display: grid;
  min-height: min(790px, calc(100vh - 76px));
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.9fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  width: min(calc(100% - 32px), var(--cz-container));
  margin-inline: auto;
  padding-block: clamp(55px, 8vw, 100px);
}

.cz-hero-content {
  position: relative;
  z-index: 2;
}

.cz-hero-content .cz-lead {
  max-width: 650px;
}

.cz-hero-actions {
  margin-top: 28px;
}

.cz-kpi-strip {
  margin-top: 32px;
}

.cz-kpi-pill {
  background: color-mix(in srgb, var(--cz-surface) 85%, transparent);
  box-shadow: var(--cz-shadow-sm);
}

.cz-hero-media {
  position: relative;
  display: grid;
  min-height: 570px;
  place-items: center;
}

.cz-hero-media::before {
  position: absolute;
  width: min(39vw, 480px);
  aspect-ratio: 1;
  border-radius: 44% 56% 60% 40% / 48% 43% 57% 52%;
  background: linear-gradient(145deg, rgba(239, 71, 111, 0.2), rgba(124, 77, 255, 0.18));
  content: "";
  filter: blur(2px);
  transform: rotate(-7deg);
}

.cz-hero-media > img {
  position: relative;
  z-index: 2;
  width: min(82%, 430px);
  aspect-ratio: 1;
  border: 10px solid color-mix(in srgb, var(--cz-surface) 88%, transparent);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--cz-shadow);
}

.cz-media-stack {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 3%;
  display: grid;
  gap: 12px;
}

.cz-media-stack img {
  width: 135px;
  height: 135px;
  border: 7px solid var(--cz-surface);
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--cz-shadow-sm);
}

/* Profiles and discovery */
.cz-profile-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cz-line);
  border-radius: var(--cz-radius);
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-profile-cover {
  position: relative;
  min-height: 350px;
  overflow: hidden;
  background: var(--cz-surface-2);
}

.cz-profile-cover > img,
.cz-profile-cover > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cz-profile-gradient {
  position: absolute;
  inset: 30% 0 0;
  background: linear-gradient(transparent, rgba(8, 11, 20, 0.9));
}

.cz-profile-overlay {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px;
}

.cz-profile-overlay h3,
.cz-profile-overlay p {
  margin: 0;
  color: white;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.cz-profile-overlay .cz-chip {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(8, 11, 20, 0.45);
  color: white;
  backdrop-filter: blur(9px);
}

.cz-swipe-deck {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.cz-swipe-actions {
  justify-content: center;
  padding: 16px;
}

.cz-swipe-actions > button,
.cz-swipe-actions > a {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--cz-line);
  border-radius: 50%;
  background: var(--cz-surface);
  color: var(--cz-text);
  cursor: pointer;
}

.cz-swipe-actions .is-like {
  border-color: rgba(239, 71, 111, 0.24);
  background: rgba(239, 71, 111, 0.1);
  color: var(--cz-primary);
}

.cz-stat-card {
  display: grid;
  gap: 4px;
  text-align: center;
}

.cz-stat-card strong,
.cz-stat strong {
  color: var(--cz-text);
  font-size: 1.7rem;
}

.cz-stat-card span,
.cz-stat span {
  color: var(--cz-muted);
  font-size: 0.86rem;
  font-weight: 700;
}

/* Forms and authentication */
.cz-form-shell {
  display: grid;
  width: min(calc(100% - 32px), 1000px);
  min-height: calc(100vh - 190px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.85fr);
  align-items: stretch;
  gap: 24px;
  margin: clamp(28px, 6vw, 72px) auto;
}

.cz-auth-visual {
  position: relative;
  min-height: 580px;
  overflow: hidden;
  border-radius: var(--cz-radius);
  background: #161b2a;
  box-shadow: var(--cz-shadow);
}

.cz-auth-visual > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cz-auth-visual::after {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(10, 13, 22, 0.9));
  content: "";
}

.cz-auth-copy {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  padding: clamp(24px, 5vw, 48px);
}

.cz-auth-copy h1 {
  max-width: 520px;
  margin: 10px 0 0;
  color: white;
  font-size: clamp(2rem, 5vw, 4rem);
}

.cz-auth-card {
  align-self: center;
  padding: clamp(24px, 4vw, 42px);
}

.cz-form label,
.cz-auth-card label {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--cz-text);
  font-size: 0.9rem;
  font-weight: 800;
}

.form-control,
.form-select,
.cz-searchbox,
.cz-textarea {
  min-height: 48px;
  border-color: var(--cz-line);
  border-radius: 13px;
  background-color: var(--cz-surface);
  color: var(--cz-text);
}

.form-control:focus,
.form-select:focus,
.cz-searchbox:focus,
.cz-textarea:focus {
  border-color: rgba(239, 71, 111, 0.55);
  background-color: var(--cz-surface);
  color: var(--cz-text);
  box-shadow: 0 0 0 0.23rem rgba(239, 71, 111, 0.12);
}

.cz-errors,
.cz-alert {
  padding: 13px 15px;
  border: 1px solid rgba(220, 53, 69, 0.25);
  border-radius: 13px;
  background: rgba(220, 53, 69, 0.08);
  color: var(--cz-danger);
}

.cz-alert-success {
  border-color: rgba(31, 169, 113, 0.28);
  background: rgba(31, 169, 113, 0.1);
  color: var(--cz-success);
}

.cz-alert-info {
  border-color: rgba(124, 77, 255, 0.24);
  background: rgba(124, 77, 255, 0.09);
  color: var(--cz-accent);
}

.cz-toast-stack .cz-alert {
  background-color: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
  transition: opacity 180ms ease;
}

.cz-toast-stack {
  position: fixed;
  z-index: 1200;
  top: 90px;
  right: 18px;
  display: grid;
  width: min(380px, calc(100% - 36px));
  gap: 10px;
}

/* Footer */
.cz-footer {
  border-top: 1px solid var(--cz-line);
  background: color-mix(in srgb, var(--cz-surface) 86%, transparent);
  padding-block: 34px;
}

.cz-footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 24px;
}

.cz-footer p {
  max-width: 430px;
  margin: 7px 0 0;
}

.cz-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 20px;
}

.cz-footer-links a {
  color: var(--cz-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

/* Utility variants used throughout templates */
.cz-action-row {
  margin-top: 18px;
}

.cz-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}

.cz-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.cz-sticky {
  position: sticky;
  top: 96px;
}

.cz-online-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cz-success);
  box-shadow: 0 0 0 3px rgba(31, 169, 113, 0.14);
}

.cz-meta,
.cz-subtitle,
.cz-sub,
.cz-time,
.cz-help,
.cz-excerpt,
.cz-bio {
  color: var(--cz-muted);
}

@media (max-width: 1050px) {
  .cz-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .cz-hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.85fr);
  }
}

@media (max-width: 900px) {
  .cz-nav-toggle {
    display: inline-grid;
    place-items: center;
  }

  .cz-nav-menu {
    position: absolute;
    top: calc(100% + 1px);
    right: 16px;
    left: 16px;
    display: none;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--cz-line);
    border-radius: 0 0 20px 20px;
    background: var(--cz-surface);
    box-shadow: var(--cz-shadow);
  }

  .cz-nav-menu.is-open {
    display: grid;
    gap: 14px;
  }

  .cz-nav-links,
  .cz-nav-actions {
    align-items: stretch;
  }

  .cz-nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cz-nav-actions {
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--cz-line);
  }

  .cz-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cz-hero-content {
    display: grid;
    justify-items: center;
  }

  .cz-hero-media {
    order: -1;
    min-height: 430px;
  }

  .cz-dashboard-grid,
  .cz-form-shell {
    grid-template-columns: 1fr;
  }

  .cz-form-shell {
    min-height: 0;
  }

  .cz-auth-visual {
    min-height: 390px;
  }

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

@media (max-width: 640px) {
  body {
    padding-bottom: 0;
  }

  body:has(.cz-mobile-tabbar) {
    padding-bottom: 72px;
  }

  .cz-brand small,
  .cz-account-pill > span {
    display: none;
  }

  .cz-nav-links {
    grid-template-columns: 1fr;
  }

  .cz-nav-actions {
    flex-wrap: wrap;
  }

  .cz-grid-2,
  .cz-grid-3,
  .cz-grid-4,
  .cz-swipe-deck,
  .cz-footer-grid {
    grid-template-columns: 1fr;
  }

  .cz-panel-title,
  .cz-section-title {
    flex-direction: column;
  }

  .cz-footer-links {
    justify-content: flex-start;
  }

  .cz-hero {
    min-height: auto;
  }

  .cz-hero-media {
    min-height: 330px;
  }

  .cz-hero-media > img {
    width: min(78vw, 310px);
  }

  .cz-media-stack img {
    width: 92px;
    height: 92px;
    border-width: 5px;
  }

  .cz-h1 {
    font-size: clamp(3rem, 18vw, 5rem);
  }

  .cz-profile-cover {
    min-height: 390px;
  }

  .cz-mobile-tabbar {
    position: fixed;
    z-index: 1100;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px;
    border: 1px solid var(--cz-line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--cz-surface) 91%, transparent);
    box-shadow: var(--cz-shadow);
    backdrop-filter: blur(16px);
  }

  .cz-mobile-tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 5px 2px;
    color: var(--cz-muted);
    font-size: 0.67rem;
    font-weight: 750;
  }

  .cz-mobile-tabbar i {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Application shell and interaction states */
@view-transition {
  navigation: auto;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cz-accent) 72%, white);
  outline-offset: 3px;
}

.cz-nav-links > a.is-active {
  background: rgba(239, 71, 111, 0.1);
  color: var(--cz-primary);
}

.cz-nav-links > a.is-active::after {
  position: absolute;
  right: 16px;
  bottom: 3px;
  left: 16px;
  height: 2px;
  border-radius: 999px;
  background: var(--cz-primary);
  content: "";
}

.cz-nav-links > a {
  position: relative;
}

.cz-mobile-tabbar a.is-active {
  border-radius: 13px;
  background: rgba(239, 71, 111, 0.11);
  color: var(--cz-primary);
}

.cz-app-page {
  padding-block: clamp(28px, 5vw, 64px);
}

.cz-page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: clamp(24px, 4vw, 42px);
}

.cz-page-hero h1 {
  max-width: 820px;
  margin: 8px 0 10px;
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: 0.98;
}

.cz-page-hero p {
  max-width: 680px;
  margin: 0;
  font-size: 1.05rem;
}

.cz-page-hero-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.cz-result-count,
.cz-filter-toggle {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid var(--cz-line);
  border-radius: 999px;
  background: var(--cz-surface);
  color: var(--cz-muted);
  font-weight: 750;
}

.cz-result-count strong {
  color: var(--cz-text);
}

.cz-filter-toggle {
  display: none;
  color: var(--cz-text);
  cursor: pointer;
}

/* Discovery */
.cz-discover-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.cz-filter-panel {
  position: sticky;
  top: 96px;
  padding: 22px;
  border: 1px solid var(--cz-line);
  border-radius: var(--cz-radius);
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-filter-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.cz-filter-heading h2 {
  margin: 5px 0 0;
  font-size: 1.22rem;
}

.cz-filter-close {
  display: none;
}

.cz-filter-form {
  display: grid;
  gap: 17px;
}

.cz-filter-form label,
.cz-filter-form legend {
  display: block;
  margin: 0 0 7px;
  color: var(--cz-text);
  font-size: 0.82rem;
  font-weight: 850;
}

.cz-filter-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cz-filter-form input,
.cz-filter-form select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--cz-line);
  border-radius: 13px;
  background: var(--cz-bg);
  color: var(--cz-text);
  outline: none;
}

.cz-field-icon {
  position: relative;
}

.cz-field-icon > i {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 13px;
  color: var(--cz-muted);
  transform: translateY(-50%);
}

.cz-field-icon input {
  padding-left: 38px;
}

.cz-age-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.cz-age-fields label span {
  color: var(--cz-muted);
  font-size: 0.75rem;
}

.cz-filter-form .cz-primary-btn,
.cz-filter-form .cz-ghost-btn {
  width: 100%;
}

.cz-discovery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.cz-discovery-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cz-line);
  border-radius: 27px;
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cz-discovery-card:hover {
  box-shadow: var(--cz-shadow);
  transform: translateY(-3px);
}

.cz-discovery-photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--cz-surface-2);
}

.cz-discovery-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.cz-discovery-card:hover .cz-discovery-photo > img {
  transform: scale(1.025);
}

.cz-photo-shade {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(transparent, rgba(7, 10, 18, 0.83));
  pointer-events: none;
}

.cz-profile-status {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.cz-profile-status > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(8, 11, 20, 0.46);
  color: white;
  font-size: 0.72rem;
  font-weight: 850;
  backdrop-filter: blur(9px);
}

.cz-status-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35d08a;
  box-shadow: 0 0 0 3px rgba(53, 208, 138, 0.2);
}

.cz-profile-copy {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  gap: 3px;
  color: white;
}

.cz-profile-copy strong {
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.cz-profile-copy small {
  display: flex;
  align-items: center;
  gap: 5px;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
}

.cz-discovery-body {
  padding: 18px;
}

.cz-discovery-body > p {
  min-height: 48px;
  margin: 14px 0;
  font-size: 0.92rem;
}

.cz-match-signal {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  color: var(--cz-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.cz-match-signal > span {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cz-surface-2);
}

.cz-match-signal > span::after {
  display: block;
  width: var(--score);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cz-primary), var(--cz-accent));
  content: "";
}

.cz-match-signal strong {
  color: var(--cz-primary);
}

.cz-discovery-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.cz-round-action {
  display: grid;
  min-width: 46px;
  height: 48px;
  place-items: center;
  border: 1px solid var(--cz-line);
  border-radius: 15px;
  background: var(--cz-bg);
  color: var(--cz-text);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 150ms ease, color 150ms ease, background 150ms ease;
}

.cz-round-action:hover {
  color: var(--cz-primary);
  transform: translateY(-2px);
}

.cz-round-action.is-like {
  border-color: transparent;
  background: linear-gradient(135deg, var(--cz-primary), #ff6f91);
  box-shadow: 0 8px 20px rgba(239, 71, 111, 0.24);
  color: white;
}

.cz-round-action.is-follow.is-active {
  background: rgba(124, 77, 255, 0.12);
  color: var(--cz-accent);
}

.cz-round-action:disabled {
  opacity: 0.55;
  cursor: wait;
}

.cz-discover-empty {
  grid-column: 1 / -1;
  padding-block: 70px;
}

.cz-discover-empty > i,
.cz-inbox-empty > i {
  color: var(--cz-primary);
  font-size: 3rem;
}

.cz-filter-backdrop {
  display: none;
}

/* Matches */
.cz-match-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cz-match-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--cz-line);
  border-radius: var(--cz-radius);
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-match-avatar {
  position: relative;
  min-height: 270px;
  overflow: hidden;
  background: var(--cz-surface-2);
}

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

.cz-presence {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 13px;
  height: 13px;
  border: 3px solid var(--cz-surface);
  border-radius: 50%;
  background: #2dcc83;
  box-sizing: content-box;
}

.cz-match-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 15px;
  padding: 20px;
}

.cz-match-copy h2 {
  margin: 5px 0 2px;
  font-size: 1.45rem;
}

.cz-match-copy p {
  margin: 0;
}

.cz-match-label {
  color: var(--cz-primary);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cz-latest-message {
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--cz-bg);
}

.cz-latest-message span {
  color: var(--cz-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.cz-latest-message p {
  margin-top: 3px;
  color: var(--cz-text);
  font-size: 0.85rem;
}

.cz-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.cz-match-actions > * {
  flex: 1;
  white-space: nowrap;
}

.cz-match-empty {
  display: grid;
  max-width: 720px;
  min-height: 450px;
  margin-inline: auto;
  place-items: center;
  align-content: center;
  padding: clamp(30px, 8vw, 80px);
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-match-empty p {
  max-width: 520px;
}

.cz-empty-orbit {
  display: grid;
  width: 100px;
  height: 100px;
  margin-bottom: 22px;
  place-items: center;
  border: 1px solid rgba(239, 71, 111, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 71, 111, 0.14), rgba(124, 77, 255, 0.05));
  color: var(--cz-primary);
  font-size: 2.2rem;
  box-shadow: 0 0 0 16px rgba(239, 71, 111, 0.04);
}

/* Inbox */
.cz-inbox-shell {
  overflow: hidden;
  border: 1px solid var(--cz-line);
  border-radius: var(--cz-radius);
  background: var(--cz-surface);
  box-shadow: var(--cz-shadow-sm);
}

.cz-inbox-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--cz-line);
}

.cz-tabs {
  display: flex;
  gap: 7px;
}

.cz-tab {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 13px;
  color: var(--cz-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.cz-tab strong {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--cz-surface-2);
  font-size: 0.7rem;
}

.cz-tab.is-active {
  background: rgba(239, 71, 111, 0.1);
  color: var(--cz-primary);
}

.cz-inbox-search {
  display: flex;
  width: min(360px, 100%);
  min-height: 46px;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid var(--cz-line);
  border-radius: 999px;
  background: var(--cz-bg);
  color: var(--cz-muted);
}

.cz-inbox-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--cz-text);
}

.cz-conversation-list {
  display: grid;
  padding: 8px;
}

.cz-conversation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border-radius: 17px;
  color: var(--cz-text);
  transition: background 150ms ease, transform 150ms ease;
}

.cz-conversation + .cz-conversation {
  border-top: 1px solid var(--cz-line);
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.cz-conversation:hover {
  background: var(--cz-bg);
  color: var(--cz-text);
  transform: translateX(2px);
}

.cz-conversation.has-unread {
  background: rgba(239, 71, 111, 0.045);
}

.cz-conversation-avatar {
  position: relative;
  width: 62px;
  height: 62px;
}

.cz-conversation-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  object-fit: cover;
}

.cz-conversation-content,
.cz-conversation-heading,
.cz-conversation-preview,
.cz-conversation-meta {
  min-width: 0;
}

.cz-conversation-content {
  display: grid;
  gap: 4px;
}

.cz-conversation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cz-conversation-heading strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cz-conversation-heading time {
  flex: 0 0 auto;
  color: var(--cz-muted);
  font-size: 0.73rem;
  font-weight: 700;
}

.cz-conversation-preview {
  overflow: hidden;
  color: var(--cz-muted);
  font-size: 0.89rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cz-conversation-meta {
  display: flex;
  gap: 10px;
  color: var(--cz-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.cz-unread-count {
  display: grid;
  min-width: 25px;
  height: 25px;
  padding-inline: 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--cz-primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 850;
}

.cz-conversation-arrow {
  color: var(--cz-muted);
}

.cz-inbox-empty {
  margin: 25px;
  padding-block: 60px;
}

.cz-page {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--cz-line);
  border-radius: 13px;
  background: var(--cz-surface);
  color: var(--cz-text);
  font-weight: 800;
}

.cz-page.is-current {
  background: var(--cz-surface-2);
  color: var(--cz-muted);
}

@media (max-width: 980px) {
  .cz-discover-layout {
    grid-template-columns: 1fr;
  }

  .cz-filter-toggle {
    display: inline-flex;
  }

  .cz-filter-panel {
    position: fixed;
    z-index: 1300;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(390px, 92vw);
    overflow-y: auto;
    border-radius: 24px 0 0 24px;
    transform: translateX(105%);
    transition: transform 220ms ease;
  }

  .cz-filter-panel.is-open {
    transform: translateX(0);
  }

  .cz-filter-close {
    display: inline-grid;
  }

  .cz-filter-backdrop {
    position: fixed;
    z-index: 1290;
    inset: 0;
    background: rgba(5, 8, 15, 0.54);
    backdrop-filter: blur(3px);
  }

  .cz-filter-backdrop.is-open {
    display: block;
  }

  body.has-filter-open {
    overflow: hidden;
  }

  .cz-match-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .cz-page-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .cz-page-hero-actions {
    width: 100%;
    justify-content: space-between;
  }

  .cz-discovery-grid {
    grid-template-columns: 1fr;
  }

  .cz-discovery-card {
    max-width: 520px;
    margin-inline: auto;
  }

  .cz-inbox-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .cz-inbox-search {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .cz-app-page {
    width: min(calc(100% - 20px), var(--cz-container));
    padding-top: 22px;
  }

  .cz-page-hero h1 {
    font-size: clamp(2.1rem, 12vw, 3.3rem);
  }

  .cz-result-count {
    display: none;
  }

  .cz-filter-toggle {
    width: 100%;
  }

  .cz-match-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .cz-match-avatar {
    min-height: 245px;
  }

  .cz-match-copy {
    padding: 15px;
  }

  .cz-match-actions {
    display: grid;
  }

  .cz-conversation {
    gap: 10px;
    padding: 12px 8px;
  }

  .cz-conversation-avatar {
    width: 53px;
    height: 53px;
  }

  .cz-conversation-meta {
    display: none;
  }

  .cz-conversation-heading time {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .cz-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cz-tab {
    justify-content: center;
  }
}
