/*
 * RatingWall design system — plain CSS, no build step, no framework.
 * Tokens below match the approved design mockups (design.zip) so views
 * built from these classes stay visually consistent with them.
 *
 * Font: Plus Jakarta Sans, self-hosted as local woff2 files (below)
 * rather than pulled from Google Fonts — the CSP is "self + Razorpay
 * checkout" only, no third-party font CDN allowed (see
 * app/core/security.php), and a same-origin file satisfies that just
 * fine. Variable-font files (one file covers weights 200-800) rather
 * than one static file per weight — smaller total download for the
 * handful of weights (400/600/700/800) actually used across the site.
 * Falls back to the system stack if the font file fails to load for
 * any reason.
 */

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/PlusJakartaSans-VariableFont_wght.woff2') format('woff2-variations'),
       url('/assets/fonts/PlusJakartaSans-VariableFont_wght.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/fonts/PlusJakartaSans-Italic-VariableFont_wght.woff2') format('woff2-variations'),
       url('/assets/fonts/PlusJakartaSans-Italic-VariableFont_wght.woff2') format('woff2');
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand */
  --color-primary: #14A866;
  --color-primary-dark: #0D8250;
  --color-primary-bg: #F5FBF7;

  /* Text */
  --color-text: #16221C;
  --color-text-muted: #4B5A52;
  --color-text-faint: #7C8C82;
  --color-text-faintest: #9BB0A2;

  /* Surfaces */
  --color-bg: #F9FAF9;
  --color-bg-soft: #F5F8F5;
  --color-surface: #FFFFFF;
  --color-border: #E2E8E3;
  --color-border-soft: #D8DFDA;

  /* Status */
  --color-success-bg: #E6F6ED;
  --color-success-text: #0B5C38;
  --color-error-bg: #FBEAE7;
  --color-error-text: #C4432E;
  --color-error-border: #EFC3B8;
  --color-warning-bg: #FDF2E1;
  --color-warning-text: #8A5B15;
  --color-warning-border: #EFCF97;
  --color-star: #F5B400;

  /* Superadmin dark shell */
  --color-ink: #16221C;
  --color-ink-soft: #1E2A22;
  --color-ink-border: #34433A;
  --color-ink-accent: #7FBF9A;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --shadow-card: 0 20px 50px -30px rgba(20, 40, 30, 0.25);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary-dark);
  text-decoration: none;
}

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

h1, h2, h3, p {
  margin: 0;
}

img {
  max-width: 100%;
}

/* ---------------------------------------------------------------
   Layout: centered auth card (signup/login/forgot/reset/invite)
   --------------------------------------------------------------- */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 20px 80px;
  background: linear-gradient(160deg, var(--color-bg-soft) 0%, var(--color-bg-soft) 60%, var(--color-primary-bg) 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 32px;
}

.auth-brand__mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
}

.auth-brand__name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-card-wrap {
  width: 100%;
  max-width: 420px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
}

.card--tight {
  padding: 24px;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 28px;
}

.auth-footer-note {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.auth-footer-note a {
  font-weight: 700;
}

/* ---------------------------------------------------------------
   Forms
   --------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field:last-child {
  margin-bottom: 0;
}

.field__label {
  font-size: 13px;
  font-weight: 700;
}

.field__label--row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.field__hint {
  font-size: 12px;
  color: var(--color-text-faintest);
  font-weight: 600;
}

.field__error {
  font-size: 12px;
  color: var(--color-error-text);
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--color-border);
  font-size: 15px;
  font-family: inherit;
  color: var(--color-text);
  outline: none;
  background: var(--color-surface);
}

input.has-error,
textarea.has-error {
  border-color: var(--color-error-text);
}

input:disabled,
textarea:disabled {
  background: var(--color-bg-soft);
  color: var(--color-text-faintest);
}

textarea {
  resize: vertical;
}

::placeholder {
  color: var(--color-text-faintest);
}

/* ---------------------------------------------------------------
   Buttons
   --------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  line-height: 1.2;
}

.btn--block {
  display: block;
  width: 100%;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.btn--secondary {
  background: var(--color-bg-soft);
  color: var(--color-text);
}

.btn--danger {
  background: var(--color-error-text);
  color: #fff;
}

.btn--outline-danger {
  background: #fff;
  color: var(--color-error-text);
  border: 1px solid var(--color-error-border);
}

.btn--disabled,
.btn:disabled {
  background: var(--color-border);
  color: var(--color-text-faintest);
  cursor: not-allowed;
}

.btn--small {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-primary-dark);
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}

/* ---------------------------------------------------------------
   Alerts / banners / flash messages
   --------------------------------------------------------------- */

.alert {
  font-size: 13px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  border: 1px solid transparent;
}

.alert--error {
  background: var(--color-error-bg);
  border-color: var(--color-error-border);
  color: var(--color-error-text);
}

.alert--warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: var(--color-warning-text);
}

.alert--success {
  background: var(--color-success-bg);
  border-color: var(--color-success-bg);
  color: var(--color-success-text);
}

.alert--with-action {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------------------------------------------------------
   Badges / status pills
   --------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge--role {
  background: var(--color-primary);
  color: #fff;
}

.badge--success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.badge--error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.badge--neutral {
  background: var(--color-bg-soft);
  color: var(--color-text-faint);
}

.badge--plan-free {
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
}

.badge--plan-starter {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.badge--plan-pro,
.badge--plan-pro_founder {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

/* ---------------------------------------------------------------
   Avatars
   --------------------------------------------------------------- */

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

/* ---------------------------------------------------------------
   Dashboard shell (tenant)
   --------------------------------------------------------------- */

.shell {
  min-height: 100vh;
  display: flex;
}

.shell__sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.shell__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  margin-bottom: 22px;
}

.shell__tenant-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-bg-soft);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 700;
}

.shell-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shell-nav__item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.shell-nav__item a:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}

.shell-nav__item--active a {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.shell-nav__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-border-soft);
  flex-shrink: 0;
}

.shell-nav__item--active .shell-nav__dot {
  background: var(--color-primary);
}

.shell__sidebar-spacer {
  flex: 1;
}

.shell__user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 8px;
  border-top: 1px solid var(--color-border);
}

.shell__user-name {
  font-size: 13px;
  font-weight: 700;
}

.shell__user-role {
  font-size: 11px;
  color: var(--color-text-faint);
}

.shell__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.shell__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.shell__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.shell__content {
  flex: 1;
  padding: 28px 32px 60px;
  overflow-y: auto;
}

/* ---------------------------------------------------------------
   Tenant dashboard header chrome: mobile hamburger toggle + the
   top-right profile menu (Account / Log out). Scoped to
   .shell--tenant so the superadmin shell (same .shell/.shell__topbar
   base classes, its own simpler sidebar-stacking mobile behavior)
   is unaffected.
   --------------------------------------------------------------- */

.shell__topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.shell__nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.shell__nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--color-text);
}

.shell__backdrop {
  display: none;
}

.shell__profile {
  position: relative;
  flex-shrink: 0;
}

.shell__profile-btn {
  display: flex;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}

.shell__profile-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.shell__profile-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 6px;
  z-index: 40;
}

.shell__profile-menu[hidden] {
  display: none;
}

.shell__profile-menu-header {
  padding: 10px 10px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-border);
}

.shell__profile-menu-header .shell__user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shell__profile-menu-item {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}

.shell__profile-menu-item:hover {
  background: var(--color-bg-soft);
  color: var(--color-text);
}

.shell__profile-menu-item--danger {
  color: var(--color-error-text);
}

.shell__profile-menu-item--danger:hover {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

@media (max-width: 800px) {
  .shell--tenant .shell__nav-toggle {
    display: flex;
  }

  .shell--tenant .shell__sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 260px;
    max-width: 82vw;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 0 transparent;
  }

  .shell--tenant .shell__sidebar--open {
    transform: translateX(0);
    box-shadow: 20px 0 40px -20px rgba(20, 40, 30, 0.35);
  }

  .shell--tenant .shell__backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 25, 20, 0.4);
    z-index: 45;
  }

  .shell--tenant .shell__topbar {
    padding: 14px 16px;
  }

  .shell--tenant .shell__content {
    padding: 18px 16px 40px;
  }

  .shell--tenant .shell__title {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shell__profile-menu {
    width: 200px;
  }
}

/* ---------------------------------------------------------------
   Superadmin shell (dark sidebar variant of .shell)
   --------------------------------------------------------------- */

.shell--dark .shell__sidebar {
  background: var(--color-ink);
}

.shell--dark .shell__brand-name,
.shell--dark .shell__user-name {
  color: #fff;
}

.shell__internal-tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--color-ink-accent);
  background: rgba(127, 191, 154, 0.15);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
  display: inline-block;
  margin: 0 0 22px 8px;
}

.shell--dark .shell-nav__item a {
  color: #B8C4BC;
}

.shell--dark .shell-nav__item--active a {
  background: rgba(20, 168, 102, 0.18);
  color: #fff;
}

.shell--dark .shell__user {
  border-top-color: var(--color-ink-border);
}

/* ---------------------------------------------------------------
   Ops login (separate minimal dark layout)
   --------------------------------------------------------------- */

.ops-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-soft);
  padding: 20px;
}

.ops-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-ink);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 24px 60px -32px rgba(20, 40, 30, 0.4);
}

.ops-login-card input {
  background: var(--color-ink-soft);
  border-color: var(--color-ink-border);
  color: #fff;
}

.ops-login-eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-ink-accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.ops-login-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}

.ops-login-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ops-login-footnote {
  font-size: 11px;
  color: var(--color-text-faint);
  text-align: center;
  margin: 16px 0 0;
}

/* ---------------------------------------------------------------
   Tables
   --------------------------------------------------------------- */

.table {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--color-bg-soft);
  text-align: left;
}

.table td {
  padding: 13px 20px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  vertical-align: middle;
}

.table tr:first-child td {
  border-top: none;
}

/* Rather than requiring every view that renders a <table class="table">
   to add its own horizontal-scroll wrapper div, the table itself
   becomes the scroll container on narrow screens — it stays a table
   internally (rows/cells keep their default table layout; only the
   table element's own outer display changes to block), so nothing in
   any view file needs to change for this to take effect everywhere. */
@media (max-width: 700px) {
  .table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------
   Empty states
   --------------------------------------------------------------- */

.empty-state {
  background: var(--color-surface);
  border: 1px dashed var(--color-border-soft);
  border-radius: 16px;
  padding: 56px 20px;
  text-align: center;
}

.empty-state__title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-state__body {
  font-size: 13px;
  color: var(--color-text-faint);
}

/* ---------------------------------------------------------------
   Misc utility
   --------------------------------------------------------------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

  .shell {
    flex-direction: column;
  }

  .shell__sidebar {
    width: 100%;
    height: auto;
    position: static;
  }
}

.section-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 22px;
}

.section-card__title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 20px;
}

.stat__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat__value {
  font-size: 24px;
  font-weight: 800;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.demo-toggle {
  font-size: 11px;
  color: var(--color-text-faintest);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
}

.pwa-banner {
  background: var(--color-primary-bg);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  text-align: center;
}

.pwa-banner[hidden] {
  display: none;
}

.impersonation-banner {
  background: var(--color-warning-bg);
  border-bottom: 1px solid var(--color-warning-border);
  color: var(--color-warning-text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------
   Phase 1: tabs, toggles, collection builder, moderation queue
   --------------------------------------------------------------- */

.tabs {
  display: inline-flex;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 11px;
  padding: 4px;
  margin-bottom: 24px;
}

.tabs__item {
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  color: var(--color-text-muted);
}

.tabs__item--active {
  background: var(--color-primary);
  color: #fff;
}

.tabs__item--active:hover {
  color: #fff;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}

.toggle-row__label {
  font-size: 13px;
  font-weight: 600;
}

.toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--color-border-soft);
  position: relative;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: background 0.15s;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toggle:checked,
.toggle--on {
  background: var(--color-primary);
}

.toggle:checked::after,
.toggle--on::after {
  left: 18px;
}

.builder-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 28px;
  align-items: start;
}

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

.qr-preview {
  text-align: center;
}

.qr-preview img {
  width: 140px;
  height: 140px;
  border: 1.5px solid var(--color-text);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
}

.filter-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
}

.filter-chip--active {
  background: var(--color-text);
  color: #fff;
}

.mod-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 12px;
}

.mod-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
}

.mod-card__meta {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.mod-card__name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mod-card__sub {
  font-size: 12px;
  color: var(--color-text-faint);
  margin-top: 2px;
}

.mod-card__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.mod-card__body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.mod-card__body[hidden] {
  display: none;
}

.mod-card__video-thumb {
  width: 180px;
  height: 100px;
  border-radius: 10px;
  background: linear-gradient(135deg, #C7DBCF 0%, #8FA898 100%);
  margin-bottom: 12px;
  object-fit: cover;
}

audio {
  width: 100%;
  max-width: 340px;
}

video.mod-card__video-player {
  width: 100%;
  max-width: 320px;
  border-radius: 10px;
  background: #000;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
}

.contact-row:first-child {
  border-top: none;
}

.contact-row__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-border-soft);
  flex-shrink: 0;
}

.contact-row__dot--opened {
  background: var(--color-primary);
}

/* ---------------------------------------------------------------
   Public collection page (/c/{slug}) — matches PublicCollection.dc.html
   --------------------------------------------------------------- */

.collect-page {
  min-height: 100vh;
  background: var(--color-bg-soft);
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.collect-wrap {
  width: 100%;
  max-width: 430px;
}

.collect-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.collect-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.collect-dots__bar {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: var(--color-border);
}

.collect-dots__bar--done {
  background: var(--color-primary);
}

.collect-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
}

.collect-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.collect-star {
  font-size: 32px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--color-border-soft);
  line-height: 1;
  padding: 0;
}

.collect-star--filled {
  color: var(--color-star);
}

.collect-media-tabs {
  display: flex;
  gap: 6px;
  background: var(--color-bg-soft);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}

.collect-media-tabs button {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 10px;
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
}

.collect-media-tabs button.is-active {
  background: var(--color-primary);
  color: #fff;
}

.collect-record-zone {
  text-align: center;
  padding: 20px 12px;
  background: var(--color-bg-soft);
  border-radius: 14px;
  margin-bottom: 16px;
}

.collect-record-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  cursor: pointer;
  border: none;
}

.collect-record-btn--recording {
  background: var(--color-error-text);
  animation: rw-pulse 1.4s infinite;
}

@keyframes rw-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196, 67, 46, 0.35); }
  50% { box-shadow: 0 0 0 10px rgba(196, 67, 46, 0); }
}

.collect-record-btn__dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
}

.collect-record-btn__square {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #fff;
}

.collect-video-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  height: 220px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #C7DBCF 0%, #8FA898 100%);
}

.collect-video-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collect-timer-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: rgba(196, 67, 46, 0.9);
  padding: 4px 9px;
  border-radius: 6px;
}

.collect-error {
  text-align: center;
  padding: 28px 12px;
}

.collect-error__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  margin: 0 auto 16px;
}

.collect-consent {
  display: flex;
  gap: 12px;
  background: var(--color-bg-soft);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  cursor: pointer;
}

.collect-consent__box {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--color-border-soft);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.collect-consent__box--checked {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

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

.collect-actions .btn--secondary {
  flex-shrink: 0;
}

.collect-actions .btn--primary,
.collect-actions .btn--block {
  flex: 1;
}

.collect-success {
  text-align: center;
  padding: 44px 28px;
}

.collect-success__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-success-bg);
  color: var(--color-success-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  margin: 0 auto 20px;
}

[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------
   Phase 2: wall builder (dashboard), embed tab, walls list
   --------------------------------------------------------------- */

.wall-thumb-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
}

.wall-thumb-card__preview {
  height: 90px;
}

.wall-thumb-card__body {
  padding: 14px;
}

.theme-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2.5px solid transparent;
  padding: 0;
}

.theme-swatch--selected {
  border-color: var(--color-text);
}

.lang-chip {
  font-size: 12px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.lang-chip--selected {
  background: var(--color-primary);
  color: #fff;
}

.wall-picker {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wall-picker__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--color-bg-soft);
  border: 1px solid transparent;
}

.wall-picker__item--selected {
  background: var(--color-success-bg);
  border-color: var(--color-success-bg);
}

.wall-picker__item--dragging {
  opacity: 0.4;
}

.wall-picker__handle {
  cursor: grab;
  color: var(--color-text-faintest);
  font-size: 13px;
  user-select: none;
  flex-shrink: 0;
}

.wall-picker__label {
  font-size: 13px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wall-picker__label strong {
  font-weight: 700;
}

.embed-code {
  background: var(--color-ink);
  border-radius: 14px;
  padding: 20px;
  position: relative;
}

.embed-code pre {
  margin: 0;
  color: #D7E8DC;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.embed-code__copy {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--color-ink-accent);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

/* ---------------------------------------------------------------
   Public wall page (/w/{slug}, /w/embed/{slug})
   --------------------------------------------------------------- */

.wall-page {
  min-height: 100vh;
  background: var(--color-surface);
  font-family: var(--font-sans);
  color: var(--color-text);
}

.wall-hero {
  max-width: 480px;
  margin: 0 auto;
  padding: 36px 20px 8px;
  text-align: center;
}

.wall-hero__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  margin: 0 auto 14px;
}

.wall-hero__title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.wall-hero__subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 20px;
}

.wall-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.wall-layout-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 9px;
  cursor: pointer;
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
  border: none;
  font-family: inherit;
}

.wall-layout-pill.is-active {
  background: var(--wall-accent, var(--color-primary));
  color: #fff;
}

.wall-cards {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.wall-cards--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.wall-cards--list {
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.wall-cards--carousel {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.wall-cards--carousel .wall-card {
  flex: 0 0 260px;
}

.wall-card {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: 16px 16px 16px 4px;
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.wall-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.wall-card__stars {
  color: var(--color-star);
  font-size: 14px;
}

.wall-card__voice {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--color-surface);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.wall-card__play {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--wall-accent, var(--color-primary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
  padding: 0;
}

.wall-card__play::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #fff;
  margin-left: 2px;
}

.wall-card__duration {
  font-size: 11px;
  color: var(--color-text-faint);
  font-weight: 700;
}

.wall-card__video {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  height: 160px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #C7DBCF 0%, #8FA898 100%);
  flex-shrink: 0;
}

.wall-card__video video,
.wall-card__video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wall-card__video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.wall-card__video-play span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wall-card__video-play span::after {
  content: '';
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid var(--color-text);
  margin-left: 3px;
}

.wall-card__video-duration {
  position: absolute;
  bottom: 8px;
  right: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 7px;
  border-radius: 6px;
}

.wall-card__text {
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-muted);
  margin: 0 0 14px;
  flex: 1;
}

.wall-card__translate {
  margin: 0 0 14px;
}

.wall-card__translate-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--wall-accent, var(--color-primary));
  cursor: pointer;
  text-decoration: underline;
}

.wall-card__translate-select {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.wall-card__translate-status {
  font-size: 12px;
  color: var(--color-text-faint);
}

.wall-card__author {
  display: flex;
  align-items: center;
  gap: 9px;
}

.wall-card__author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.wall-card__author-name {
  font-size: 13px;
  font-weight: 700;
}

.wall-footer {
  text-align: center;
  padding: 8px 20px 44px;
}

.wall-badge-link {
  font-size: 12px;
  color: var(--color-text-faintest);
  font-weight: 600;
}

@media (max-width: 900px) {
  .wall-cards--grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .wall-cards--grid {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------
   Dashboard Overview (analytics) — server-rendered CSS bar charts,
   no client-side charting library (CSP has no third-party script-src
   beyond Razorpay checkout).
   --------------------------------------------------------------- */

.trend-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}

.trend-chart__col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.trend-chart__bar {
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--color-primary);
  opacity: 0.85;
  transition: opacity 0.15s;
}

.trend-chart__col:hover .trend-chart__bar {
  opacity: 1;
}

.breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.breakdown-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.breakdown-row__label {
  width: 84px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breakdown-row__bar-wrap {
  flex: 1;
  min-width: 0;
  height: 8px;
  border-radius: 4px;
  background: var(--color-bg-soft);
  overflow: hidden;
}

.breakdown-row__bar {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--color-primary);
}

.breakdown-row__count {
  width: 30px;
  flex-shrink: 0;
  text-align: right;
  font-weight: 700;
  color: var(--color-text-faint);
}

.funnel-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.funnel-step {
  flex: 1;
  min-width: 0;
  background: var(--color-bg-soft);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
}

.funnel-step__value {
  font-size: 22px;
  font-weight: 800;
}

.funnel-step__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 4px;
}

.funnel-step__pct {
  color: var(--color-primary-dark);
}

@media (max-width: 480px) {
  .breakdown-row__label {
    width: 64px;
  }

  .funnel-step__value {
    font-size: 18px;
  }
}
