:root {
  --bg: #eef4ff;
  --bg-2: #f8fbff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: #ffffff;
  --surface-dark: #0f172a;
  --text: #0f172a;
  --muted: #5b6478;
  --line: rgba(15, 23, 42, 0.09);
  --primary: #1d4ed8;
  --primary-strong: #153ba8;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --accent-2: #f97316;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1180px;
  --transition: 180ms ease;
  --font-body: "Segoe UI", "Avenir Next", "Trebuchet MS", sans-serif;
  --font-display: "Trebuchet MS", "Segoe UI", "Avenir Next", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.10), transparent 32%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.11), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: -1;
}

body::before {
  top: 6%;
  right: -8%;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, rgba(14, 165, 233, 0.04) 50%, transparent 72%);
  filter: blur(8px);
}

body::after {
  bottom: -10%;
  left: -10%;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.14) 0%, rgba(249, 115, 22, 0.04) 48%, transparent 72%);
  filter: blur(10px);
}

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

img {
  display: block;
  max-width: 100%;
}

p {
  margin: 0 0 1rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.75rem;
  line-height: 1.1;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(2.3rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

h3 {
  font-size: 1.2rem;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.section {
  padding: 3.25rem 0;
}

.section-inner {
  margin-top: 2.5rem;
}

.section-spacer {
  height: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.78rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.brand img {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
}

.brand-icon-only {
  gap: 0;
}

.brand-icon-only img {
  width: 2.7rem;
  height: 2.7rem;
}

.brand span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand strong {
  font-size: 1rem;
  line-height: 1.1;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--muted);
  font-weight: 700;
  transition: color var(--transition), transform var(--transition);
}

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

.header-actions {
  margin-left: 0;
  justify-self: end;
  display: inline-flex;
  width: auto;
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.header-search {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin-left: 0;
  padding: 0.3rem 0.35rem 0.3rem 0.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
  max-width: 34rem;
  justify-self: stretch;
}

.header-search input {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  min-height: 2rem;
  padding: 0;
  box-shadow: none;
  font-size: 0.92rem;
}

.header-search input:focus {
  outline: none;
}

.header-search button,
.header-search-clear {
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
}

.header-search button {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(245, 158, 11, 0.16));
  color: var(--primary-strong);
}

.header-search button svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}

.header-search-clear {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: auto;
  padding: 0 0.7rem;
  border-radius: 12px;
}

.auth-links {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: nowrap;
  width: auto;
  white-space: nowrap;
}

.site-header .auth-links .button.small,
.site-header .header-actions .button.small {
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  color: var(--text);
}

.site-footer {
  margin-top: 3rem;
  padding: 3rem 0 1.25rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.07));
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

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

.footer-grid p,
.footer-grid li {
  color: var(--muted);
}

.footer-grid ul {
  padding-left: 1rem;
  margin: 0;
}

.footer-bottom {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  padding-top: 2.5rem;
}

.hero-grid,
.split-layout,
.editor-layout,
.auth-layout,
.invite-hero {
  display: grid;
  gap: 1.5rem;
}

.hero-grid {
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
}

.hero-copy {
  padding: 0.75rem 0;
}

.hero-copy p {
  max-width: 44rem;
  font-size: 1.08rem;
  color: var(--muted);
}

.hero-panel,
.panel,
.card,
.empty-state,
.stat-card,
.mini-card,
.hero-card,
.danger-banner,
.alert,
.breadcrumb,
.countdown-box {
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.hero-card,
.panel,
.card,
.empty-state,
.stat-card,
.mini-card,
.alert,
.danger-banner,
.countdown-box {
  border-radius: var(--radius-xl);
}

.hero-card,
.panel,
.card,
.empty-state,
.mini-card,
.alert,
.danger-banner,
.countdown-box {
  padding: 1.25rem;
}

.hero-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

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

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.8rem;
}

.feature-list li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--muted);
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent));
}

.hero-actions,
.card-actions,
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.hero-points span {
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.88rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.button.primary:hover {
  background: linear-gradient(135deg, var(--primary-strong), #0369a1);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--line);
  color: var(--text);
}

.button.ghost:hover {
  border-color: rgba(29, 78, 216, 0.22);
  background: #fff;
}

.button.small {
  padding: 0.68rem 0.95rem;
  font-size: 0.92rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--primary-strong);
  font-weight: 900;
  margin-bottom: 0.8rem;
}

.eyebrow::before {
  content: "";
  width: 2.2rem;
  height: 0.15rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.section-heading {
  margin-bottom: 1.4rem;
  max-width: 48rem;
}

.section-heading p,
.page-header p,
.lead {
  color: var(--muted);
  font-size: 1.04rem;
}

.page-header {
  margin-bottom: 1.4rem;
  max-width: 52rem;
}

.model-detail-page .menu-toggle,
.model-detail-page .site-nav {
  display: none;
}

.model-detail-page .header-actions {
  margin-left: auto;
}

.model-detail-page .brand-compact {
  gap: 0;
}

.model-detail-page .brand-compact img {
  margin-right: 0;
}

.model-detail-page .container {
  width: min(1080px, calc(100% - 1.5rem));
}

.model-detail-page .model-compact-layout {
  grid-template-columns: minmax(0, 420px) minmax(260px, 340px);
  justify-content: center;
  gap: 1.6rem;
  align-items: center;
}

.model-detail-page .model-preview-only {
  width: min(100%, 420px);
  padding: 0.65rem;
  justify-self: center;
}

.model-detail-page .model-action-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  background: rgba(255, 255, 255, 0.78);
  padding: 1rem;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
}

.model-detail-page .model-action-stack {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.6rem;
}

.model-detail-page .model-summary {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: left;
  width: 100%;
}

.model-detail-page .model-action-stack .button {
  flex: 1 1 calc(50% - 0.3rem);
  width: auto;
  justify-content: center;
  border-radius: 11px;
  padding: 0.72rem 0.8rem;
  font-size: 0.84rem;
  min-width: 0;
  white-space: nowrap;
}

.model-detail-page .preview-image {
  aspect-ratio: auto;
  height: auto;
  max-height: none;
  object-fit: contain;
  background: transparent;
  display: block;
}

.model-detail-page .template-card .card-actions {
  flex-direction: row;
  align-items: stretch;
  gap: 0.6rem;
}

.model-detail-page .template-card .card-actions .button {
  width: auto;
  flex: 1 1 0;
  min-width: 0;
  padding: 0.68rem 0.78rem;
  border-radius: 11px;
  white-space: nowrap;
}

.model-detail-page .template-card .card-actions .button.ghost {
  border-radius: 11px;
}

@media (max-width: 640px) {
  .model-detail-page .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand search actions";
    align-items: center;
    gap: 0.35rem 0.45rem;
    padding: 0.45rem 0;
  }

  .model-detail-page .brand {
    grid-area: brand;
    gap: 0.45rem;
  }

  .model-detail-page .brand img {
    width: 2.2rem;
    height: 2.2rem;
  }

  .model-detail-page .brand span {
    display: none;
  }

  .model-detail-page .header-search {
    grid-area: search;
    width: 100%;
    min-width: 0;
    margin-left: 0;
    flex: none;
    padding: 0.24rem 0.3rem 0.24rem 0.68rem;
    border-radius: 14px;
  }

  .model-detail-page .header-actions {
    grid-area: actions;
    margin-left: 0;
    width: auto;
    justify-self: end;
  }

  .model-detail-page .auth-links {
    width: auto;
    gap: 0.32rem;
  }

  .model-detail-page .auth-links .button.small,
  .model-detail-page .header-actions .button.small {
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0.48rem 0.62rem;
    font-size: 0.74rem;
    border-radius: 12px;
  }

  .model-detail-page .model-compact-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .model-detail-page .model-preview-only {
    width: 100%;
    max-width: 520px;
    padding: 0.45rem;
  }

  .model-detail-page .model-action-panel {
    width: 100%;
    padding: 0.9rem;
    border-radius: 20px;
  }

  .model-detail-page .model-action-stack .button {
    flex: 1 1 calc(50% - 0.25rem);
    width: auto;
    padding: 0.66rem 0.7rem;
    border-radius: 11px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .model-detail-page .model-action-stack {
    flex-direction: row;
    align-items: stretch;
  }

  .model-detail-page .model-action-stack {
    gap: 0.5rem;
  }

  .model-detail-page .template-card .card-actions {
    flex-direction: row;
    align-items: stretch;
    gap: 0.55rem;
  }

  .model-detail-page .template-card .card-actions .button {
    width: auto;
    flex: 1 1 0;
    padding: 0.66rem 0.72rem;
    border-radius: 11px;
    font-size: 0.8rem;
  }
}

body.models-page {
  background:
    radial-gradient(circle at 12% 10%, rgba(29, 78, 216, 0.08), transparent 26%),
    radial-gradient(circle at 88% 8%, rgba(245, 158, 11, 0.10), transparent 20%),
    radial-gradient(circle at 82% 72%, rgba(14, 165, 233, 0.07), transparent 24%),
    linear-gradient(180deg, #fcfdff 0%, #f2f6fc 100%);
}

body.models-page::before {
  top: 7%;
  right: -10%;
  width: 30rem;
  height: 30rem;
  opacity: 0.88;
}

body.models-page::after {
  bottom: -16%;
  left: -12%;
  width: 32rem;
  height: 32rem;
  opacity: 0.78;
}

.models-page .container {
  width: min(1240px, calc(100% - 2rem));
}

.models-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 420px);
  gap: clamp(1.2rem, 2.6vw, 2rem);
  align-items: center;
  padding: 0.05rem 0 1.1rem;
}

.models-hero-copy {
  max-width: 46rem;
}

.models-hero-copy h1 {
  max-width: 13ch;
  font-size: clamp(1.9rem, 4vw, 3.6rem);
  letter-spacing: -0.045em;
}

.models-hero-copy p {
  max-width: 32rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.models-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 1rem 0 0.9rem;
}

.models-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  max-width: 36rem;
}

.models-facts span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-align: center;
}

.models-hero-panel {
  position: relative;
  padding: 0.85rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.models-hero-panel::before {
  content: "";
  position: absolute;
  inset: auto -20% -18% auto;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.20) 0%, rgba(245, 158, 11, 0.06) 42%, transparent 72%);
  filter: blur(4px);
  pointer-events: none;
}

.models-hero-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.models-hero-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--primary-strong);
  font-weight: 900;
}

.models-hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.10);
  color: var(--primary-strong);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.models-hero-preview {
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.06), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 18px 44px rgba(15, 23, 42, 0.12);
}

.models-hero-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.models-hero-footer {
  padding: 0.7rem 0 0.05rem;
}

.models-hero-footer h2 {
  margin-bottom: 0.35rem;
  font-size: 1.08rem;
}

.models-hero-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.models-collection {
  margin-top: 2.5rem;
}

.models-collection-heading {
  max-width: 55rem;
}

.models-search-summary {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.95rem;
  padding: 0.6rem 0.8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 0.88rem;
}

.models-search-summary strong {
  color: var(--text);
}

.models-search-summary a {
  color: var(--primary-strong);
  font-weight: 800;
}

.models-grid {
  margin-top: 1.35rem;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.models-page .template-card {
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.models-page .template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 58px rgba(15, 23, 42, 0.14);
  border-color: rgba(29, 78, 216, 0.16);
}

.models-page .template-card .card-media {
  border-radius: 21px 21px 0 0;
  background: linear-gradient(180deg, rgba(29, 78, 216, 0.08), rgba(255, 255, 255, 0.92));
}

.models-page .template-card .card-media img {
  aspect-ratio: 9 / 14;
  transition: transform var(--transition), filter var(--transition);
}

.models-page .template-card:hover .card-media img {
  transform: scale(1.02);
}

.models-page .template-card .card-body {
  padding: 0.95rem 0.95rem 1rem;
}

.models-page .template-card h3 {
  margin-bottom: 0.45rem;
}

.models-page .template-card h3 a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.models-page .template-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.6em;
  font-size: 0.95rem;
  line-height: 1.55;
}

.models-page .template-card .card-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.65rem;
}

.models-page .template-card .card-actions .button {
  flex: 1 1 0;
  justify-content: center;
  padding-inline: 0.95rem;
  border-radius: 11px;
  min-width: 0;
  white-space: nowrap;
}

.models-page .template-card .card-actions .button.ghost {
  background: rgba(255, 255, 255, 0.80);
}

.models-page .empty-state {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
}

.models-page .button {
  border-radius: 13px;
}

.models-page .button.small {
  border-radius: 11px;
}

.models-page .faq-list {
  margin-top: 0.25rem;
}

.models-page .faq-item {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(15, 23, 42, 0.07);
  box-shadow: var(--shadow-soft);
}

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

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

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

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

.card {
  overflow: hidden;
}

.card-media {
  display: block;
  border-radius: calc(var(--radius-xl) - 1px);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.05);
}

.card-media img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}

.card-body h3 {
  margin-top: 0.1rem;
}

.card-body p,
.card-body .muted {
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.12);
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  margin-bottom: 0.9rem;
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.16), rgba(245, 158, 11, 0.22));
  color: var(--primary-strong);
  font-weight: 900;
}

.faq-list {
  display: grid;
  gap: 0.8rem;
}

.faq-item {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-soft);
}

.faq-item summary {
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-answer {
  margin-top: 0.75rem;
  color: var(--muted);
}

.split-layout {
  grid-template-columns: 1.05fr 0.95fr;
  align-items: start;
}

body.editor-page {
  background:
    radial-gradient(circle at top left, rgba(29, 78, 216, 0.06), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.06), transparent 22%),
    linear-gradient(180deg, #fbfcff 0%, #eef3fb 100%);
}

body.editor-page::before {
  opacity: 0.32;
}

body.editor-page::after {
  opacity: 0.22;
}

.editor-page .page-header {
  max-width: 58rem;
  margin-bottom: 1.2rem;
}

.editor-page .page-header h1 {
  font-size: clamp(2.2rem, 3.8vw, 4.1rem);
}

.editor-page .page-header p {
  max-width: 46rem;
  font-size: 1rem;
}

.editor-page .editor-layout {
  grid-template-columns: minmax(320px, 392px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.editor-page .form-panel,
.editor-page .preview-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

.editor-page .form-panel {
  padding: 1rem;
}

.editor-page .preview-panel {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 1rem;
}

.editor-page .panel-header {
  margin-bottom: 0.9rem;
}

.editor-page .panel-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.editor-page .panel-header p {
  font-size: 0.95rem;
  line-height: 1.45;
}

.editor-page .form-grid {
  gap: 0.8rem;
}

.editor-page .editor-section {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(248, 250, 255, 0.9);
  padding: 0.82rem 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.editor-page .editor-section + .editor-section {
  margin-top: 0.05rem;
}

.editor-page .editor-section > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.editor-page .editor-section > summary::-webkit-details-marker {
  display: none;
}

.editor-page .editor-section > summary span {
  font-size: 0.95rem;
}

.editor-page .editor-section > summary small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.editor-page .editor-section-body {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.editor-page .editor-section-body label {
  display: grid;
  gap: 0.45rem;
  padding: 0.78rem 0.88rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.editor-page .editor-section-body label > span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.editor-page .editor-section-body input,
.editor-page .editor-section-body textarea {
  width: 100%;
  border: 0;
  padding: 0;
  min-height: auto;
  background: transparent;
  box-shadow: none;
}

.editor-page .editor-section-body textarea {
  resize: vertical;
}

.editor-page .preview-frame {
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 255, 0.9));
  padding: 0.35rem;
}

.preview-panel {
  position: relative;
}

.editor-page .preview-panel .preview-frame {
  width: min(100%, clamp(220px, 17vw, 300px));
  margin: 0 auto;
  overflow: hidden;
}

.editor-page .preview-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.editor-page .info-box {
  padding: 0.75rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
}

.editor-page .info-box strong {
  font-size: 0.7rem;
  margin-bottom: 0.22rem;
}

.preview-image,
.invite-image {
  width: 100%;
  border-radius: calc(var(--radius-xl) - 2px);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.preview-image {
  aspect-ratio: 9 / 16;
}

.info-grid,
.stats-grid,
.preview-meta,
.invite-meta-grid {
  display: grid;
  gap: 0.75rem;
}

.info-grid,
.preview-meta,
.invite-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-box {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  background: rgba(255, 255, 255, 0.9);
}

.info-box strong {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.empty-state {
  text-align: center;
  padding: 2rem;
}

.empty-state p {
  color: var(--muted);
  max-width: 42rem;
  margin: 0 auto 1.2rem;
}

.panel-header {
  margin-bottom: 1rem;
}

.panel-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}

.form-grid label {
  display: grid;
  gap: 0.45rem;
  font-weight: 700;
}

.form-grid span {
  color: var(--text);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.95rem 1rem;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.preview-age-field {
  min-height: 88px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(29, 78, 216, 0.46);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

input[type="color"] {
  min-height: 56px;
  padding: 0.35rem;
}

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

.grid-3,
.grid-4 {
  display: grid;
  gap: 0.9rem;
}

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

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

.section-divider {
  height: 1px;
  margin: 1.5rem 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0));
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.form-feedback {
  color: var(--muted);
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.preview-frame {
  position: relative;
}

.preview-zoom-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  transform-origin: top left;
  will-change: transform;
  transition: transform 120ms ease-out;
  cursor: grab;
  touch-action: none;
}

.preview-zoom-stage.is-panning {
  cursor: grabbing;
}

.preview-center-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 2;
  width: 0;
  pointer-events: none;
  transform: translateX(-50%);
  border-left: 0;
  box-shadow: none;
  opacity: 0;
}

.preview-zoom-stage.is-snapping .preview-center-guide {
  opacity: 0;
}

.builder-preview-frame {
  width: min(100%, clamp(260px, 24vw, 360px));
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.88);
}

.builder-preview-frame .preview-image {
  border-radius: 0;
  box-shadow: none;
}

.builder-preview-frame .preview-image {
  display: block;
  height: 100%;
}

.text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: space-between;
  margin: 0.1rem 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.text-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.text-toolbar-group--title {
  flex: 1 1 320px;
}

.text-toolbar-group--state {
  margin-left: auto;
}

.text-toolbar-group--global {
  margin-left: auto;
}

.text-toolbar-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.text-toolbar-button,
.text-toolbar-input,
.text-toolbar-select {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.text-toolbar-button {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

.text-toolbar-button--wide {
  padding-inline: 1rem;
}

.text-toolbar-button:hover,
.text-toolbar-button:focus-visible,
.text-toolbar-input:hover,
.text-toolbar-input:focus-visible,
.text-toolbar-select:hover,
.text-toolbar-select:focus-visible {
  border-color: rgba(29, 78, 216, 0.3);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
  outline: none;
}

.text-toolbar-button.is-active {
  background: rgba(29, 78, 216, 0.12);
  border-color: rgba(29, 78, 216, 0.25);
  color: var(--primary-strong);
}

.text-toolbar-input {
  min-height: 2.5rem;
  padding: 0 0.7rem;
}

.text-toolbar-number {
  width: 5.2rem;
  text-align: center;
}

.text-toolbar-select {
  min-width: 10rem;
  padding: 0 0.65rem;
  height: 2.5rem;
}

.text-toolbar-color {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.text-toolbar-color--global {
  font-weight: 700;
}

.text-toolbar-color input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.text-toolbar-label {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  background: rgba(29, 78, 216, 0.08);
  color: var(--primary-strong);
  font-weight: 800;
}

.text-toolbar-group [data-text-position] {
  white-space: nowrap;
}

.field-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.field-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  font-weight: 700;
  color: var(--text-strong);
}

.field-toggle input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.template-drag-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: auto;
  touch-action: none;
}

.drag-handle {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
  max-width: none;
  min-height: 0;
  padding: 0.45rem 0.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.44);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.02);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: center;
  line-height: 1.15;
  box-shadow: none;
  cursor: grab;
  backdrop-filter: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  will-change: left, top, transform;
  overflow: visible;
  white-space: normal;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: move;
  box-sizing: border-box;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.72);
}

.drag-handle::before {
  content: "";
  display: none;
}

.drag-handle-label {
  display: none;
}

.drag-handle-value {
  display: block;
  font-size: clamp(0.82rem, 1vw, 1.08rem);
  font-weight: 800;
  line-height: 1.1;
  white-space: pre-line;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.drag-handle-label,
.drag-handle-value {
  pointer-events: none;
  font-family: inherit;
  font-style: inherit;
  text-decoration: inherit;
  color: inherit;
  text-align: inherit;
  line-height: inherit;
}

.drag-handle.is-dragging {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.02);
}

.drag-handle.is-resizing {
  cursor: nwse-resize;
}

.drag-handle.is-selected {
  border-color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.drag-handle.is-selected .drag-handle-value {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

.drag-handle-title,
.drag-handle-name,
.drag-handle-name-girl,
.drag-handle-name-boy,
.drag-handle-age,
.drag-handle-date,
.drag-handle-time,
.drag-handle-venue,
.drag-handle-address,
.drag-handle-message,
.drag-handle-footer {
  border-left: 0;
}

.drag-handle-title { --accent: #b57a6a; }
.drag-handle-name { --accent: #d36b90; }
.drag-handle-name-girl { --accent: #ec4899; }
.drag-handle-name-boy { --accent: #8b5cf6; }
.drag-handle-age { --accent: #6b7280; }
.drag-handle-date { --accent: #8b5cf6; }
.drag-handle-time { --accent: #0ea5e9; }
.drag-handle-venue { --accent: #10b981; }
.drag-handle-address { --accent: #ef4444; }
.drag-handle-message { --accent: #3b82f6; }
.drag-handle-footer { --accent: #f59e0b; }

.drag-resize-handle {
  position: absolute;
  z-index: 6;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  background: var(--accent, #3b82f6);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  touch-action: none;
  cursor: nwse-resize;
}

.drag-resize-handle--tl {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.drag-resize-handle--tr {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.drag-resize-handle--bl {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.drag-resize-handle--br {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.drag-resize-handle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 2px;
}

.preview-hint {
  margin-top: 0.75rem;
  font-size: 0.95rem;
}

.preview-overlay {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 0.92rem;
  text-align: center;
  pointer-events: none;
}

.preview-zoom-indicator {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 6;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.preview-zoom-indicator:hover,
.preview-zoom-indicator:focus-visible {
  outline: none;
  border-color: rgba(29, 78, 216, 0.28);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.countdown-box {
  margin: 1rem 0;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.countdown-item {
  text-align: center;
  border-radius: var(--radius-lg);
  padding: 0.8rem 0.5rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.countdown-item strong {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
}

.countdown-item span {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invite-hero {
  grid-template-columns: 1.1fr 0.9fr;
}

.invite-image-wrap {
  position: relative;
}

.invite-image {
  aspect-ratio: 9 / 16;
}

.invite-content {
  position: sticky;
  top: 5.5rem;
  align-self: start;
}

.invite-content p {
  color: var(--muted);
}

.invite-actions .button {
  flex: 1 1 auto;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1.15rem 1.25rem;
  text-align: center;
}

.stat-card strong {
  display: block;
  font-size: 2rem;
}

.toolbar {
  margin: 1rem 0 1.25rem;
}

.stats-mini {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.94rem;
}

.dashboard-card .card-media img {
  aspect-ratio: 16 / 9;
}

.mini-card {
  background: rgba(255, 255, 255, 0.92);
}

.mini-card strong {
  display: block;
  margin-bottom: 0.35rem;
}

.article-panel {
  padding: 1.5rem;
}

.article-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.article-content {
  color: var(--text);
}

.article-content p {
  margin-bottom: 1rem;
}

.article-content h2,
.article-content h3 {
  margin-top: 1.6rem;
}

.article-content ul,
.article-content ol {
  padding-left: 1.25rem;
}

.auth-layout {
  grid-template-columns: 0.85fr 1.15fr;
  align-items: start;
}

.auth-copy {
  padding-right: 1rem;
}

.auth-panel {
  max-width: 30rem;
  justify-self: end;
}

.alert {
  margin-bottom: 1rem;
}

.alert.error {
  background: rgba(220, 38, 38, 0.09);
  border-color: rgba(220, 38, 38, 0.2);
  color: #991b1b;
}

.alert.success {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.2);
  color: #14532d;
}

.alert.info {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.18);
  color: #1e3a8a;
}

.danger-banner {
  margin-top: 1rem;
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.18);
  color: #7f1d1d;
}

.breadcrumb {
  display: inline-flex;
  width: auto;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
}

.breadcrumb ol {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: rgba(91, 100, 120, 0.7);
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  gap: 0.55rem;
}

.check-list li {
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.check-list li.ok {
  border-color: rgba(22, 163, 74, 0.18);
}

.check-list li.bad {
  border-color: rgba(220, 38, 38, 0.2);
}

.check-list li.warn {
  border-color: rgba(217, 119, 6, 0.18);
}

.check-list li.pending {
  border-color: rgba(100, 116, 139, 0.16);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-pill.ok {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.status-pill.bad {
  background: rgba(220, 38, 38, 0.1);
  color: #991b1b;
}

.status-pill.warn {
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.status-pill.pending {
  background: rgba(100, 116, 139, 0.1);
  color: #475569;
}

.diagnostic-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.diagnostic-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-top: 1rem;
  color: var(--muted);
}

.diagnostic-note code {
  background: rgba(15, 23, 42, 0.08);
}

.diagnostic-check-head {
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.diagnostic-check-head strong {
  font-size: 0.98rem;
}

.diagnostic-details {
  margin-top: 0.75rem;
}

.diagnostic-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary-strong);
}

.diagnostic-details pre {
  margin: 0.75rem 0 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.06);
  overflow: auto;
  font-size: 0.85rem;
}

.diagnostic-browser-test {
  display: grid;
  gap: 0.9rem;
}

.diagnostic-stage {
  position: relative;
  min-height: 260px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background:
    radial-gradient(circle at 20% 20%, rgba(29, 78, 216, 0.14), transparent 36%),
    radial-gradient(circle at 80% 35%, rgba(245, 158, 11, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 255, 0.95));
}

.diagnostic-drag-target {
  position: absolute;
  left: 18px;
  top: 20px;
  width: min(220px, calc(100% - 36px));
  padding: 1rem 1.1rem;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 900;
  box-shadow: 0 18px 30px rgba(15, 23, 42, 0.18);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.diagnostic-drag-target:active {
  cursor: grabbing;
}

.diagnostic-log {
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  background: rgba(15, 23, 42, 0.06);
  padding: 0.18rem 0.35rem;
  border-radius: 8px;
}

@media (max-width: 1120px) {
  .hero-grid,
  .split-layout,
  .invite-hero,
  .auth-layout,
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .invite-content {
    max-width: none;
    justify-self: stretch;
    position: static;
  }

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

@media (max-width: 960px) {
  .header-search input {
    width: 100%;
    min-width: 0;
  }

  .models-hero {
    grid-template-columns: 1fr;
  }

  .models-hero-copy h1 {
    max-width: none;
  }

  .models-facts {
    grid-template-columns: 1fr;
  }

  .models-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .site-header .header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.65rem;
  }

  .stats-grid,
  .card-grid-3,
  .card-grid-2,
  .grid-3,
  .grid-4,
  .diagnostic-summary,
  .preview-meta,
  .invite-meta-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .site-header .header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.32rem;
    padding: 0.36rem 0;
  }

  .site-header .brand img {
    width: 2rem;
    height: 2rem;
  }

  .container {
    width: min(var(--container), calc(100% - 1.1rem));
  }

  .section {
    padding: 2.2rem 0;
  }

  .hero-copy p,
  .page-header p,
  .section-heading p {
    font-size: 1rem;
  }

  .button,
  .button.small {
    width: 100%;
  }

  .site-header .button,
  .site-header .button.small {
    width: auto;
  }

  .header-actions {
    width: 100%;
  }

  .site-header .header-actions {
    width: auto;
  }

  .auth-links {
    width: 100%;
    gap: 0.45rem;
  }

  .site-header .auth-links {
    width: auto;
    gap: 0.22rem;
  }

  .auth-links .button.small,
  .header-actions .button.small {
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0.58rem 0.78rem;
    font-size: 0.8rem;
    border-radius: 14px;
  }

  .site-header .header-search {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 0;
    padding: 0.2rem 0.24rem 0.2rem 0.58rem;
    border-radius: 12px;
    gap: 0.24rem;
  }

  .site-header .header-search input {
    width: 100%;
    min-width: 0;
    min-height: 1.65rem;
    font-size: 0.76rem;
  }

  .site-header .header-search button,
  .site-header .header-search-clear {
    width: 1.75rem;
    height: 1.75rem;
  }

  .site-header .auth-links .button.small,
  .site-header .header-actions .button.small {
    width: auto;
    flex: 0 0 auto;
    min-width: 0;
    padding: 0.34rem 0.42rem;
    font-size: 0.6rem;
    border-radius: 10px;
  }

  .hero-actions,
  .toolbar,
  .card-actions,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .models-page .template-card .card-actions {
    flex-direction: row;
    align-items: stretch;
  }

  .models-page .template-card .card-actions .button {
    width: auto;
    flex: 1 1 0;
    padding: 0.68rem 0.75rem;
    border-radius: 11px;
    font-size: 0.82rem;
  }

  .text-toolbar {
    padding: 0.65rem;
  }

  .text-toolbar-group--title,
  .text-toolbar-group--state {
    width: 100%;
    margin-left: 0;
  }

  .text-toolbar-select {
    min-width: 8.5rem;
  }

  .grid-2,
  .countdown {
    grid-template-columns: 1fr;
  }

  .diagnostic-summary {
    grid-template-columns: 1fr 1fr;
  }

  .card-grid-4,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .breadcrumb {
    width: 100%;
  }
}
