:root {
  --brand-50: #fdf2f8;
  --brand-100: #fce7f3;
  --brand-200: #fbcfe8;
  --brand-300: #f9a8d4;
  --brand-400: #f472b6;
  --brand-500: #ec4899;
  --brand-600: #db2777;
  --brand-700: #be185d;
  --brand-800: #9d174d;
  --ink-900: #111827;
  --ink-700: #374151;
  --ink-500: #6b7280;
  --ink-400: #9ca3af;
  --ink-300: #d1d5db;
  --ink-200: #e5e7eb;
  --ink-100: #f3f4f6;
  --ink-50:  #f9fafb;
  --bg: #ffffff;
  --bg-soft: #fffafc;
  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info: #3b82f6;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(17,24,39,.06), 0 1px 3px rgba(17,24,39,.08);
  --shadow-md: 0 6px 16px rgba(190,24,93,.08), 0 2px 6px rgba(17,24,39,.06);
  --shadow-lg: 0 24px 48px -12px rgba(190,24,93,.18), 0 8px 16px -4px rgba(17,24,39,.06);
  --gradient-brand: linear-gradient(135deg, #ec4899 0%, #f43f5e 50%, #d946ef 100%);
  --gradient-hero: radial-gradient(1200px 500px at 85% 10%, rgba(244,114,182,.25), transparent 60%), radial-gradient(800px 400px at 0% 100%, rgba(217,70,239,.18), transparent 60%);
  --container: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Sukhumvit Set", "Noto Sans Thai", "IBM Plex Sans Thai", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-wrap: anywhere; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-900);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-weight: 800; letter-spacing: -0.01em; color: var(--ink-900); margin: 0 0 .6em; line-height: 1.4; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3.3rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.3rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
p { margin: 0 0 1em; color: var(--ink-700); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 1.2rem; }
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section-slim { padding: clamp(1.5rem, 4vw, 3rem) 0; }
.row { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.2rem; }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.eyebrow {
  display: inline-block;
  font-weight: 700;
  letter-spacing: .14em;
  font-size: .78rem;
  text-transform: uppercase;
  color: var(--brand-600);
  margin-bottom: .8rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; cursor: pointer; border-radius: 999px;
  padding: .75rem 1.4rem; font-weight: 700; font-size: .98rem;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  text-decoration: none; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff; background: var(--gradient-brand);
  box-shadow: 0 10px 24px -8px rgba(236,72,153,.55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(236,72,153,.65); color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--ink-900); border: 1px solid var(--ink-200);
}
.btn-ghost:hover { background: var(--ink-50); color: var(--ink-900); }
.btn-block { width: 100%; }
.btn-sm { padding: .55rem 1rem; font-size: .88rem; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(236,72,153,.12);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 0;
}
.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  font-weight: 900; font-size: 1.05rem; color: var(--ink-900);
}
.brand .logo {
  width: 42px; height: 42px; border-radius: 14px;
  background: linear-gradient(135deg, #fce7f3, #fbcfe8);
  color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: inset 0 0 0 1px rgba(236,72,153,.15);
}
.brand small { display: block; font-weight: 500; color: var(--ink-500); font-size: .75rem; }
.action-mark {
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-100), #ede9fe);
  color: var(--brand-700); font-size: .82rem; font-weight: 800;
}
.site-nav { display: flex; align-items: center; gap: 1.4rem; font-weight: 600; font-size: .95rem; }
.site-nav a { color: var(--ink-700); }
.site-nav a:hover { color: var(--brand-600); }
.header-cta { display: flex; align-items: center; gap: .6rem; }
.nav-toggle { display: none; background: transparent; border: 1px solid var(--ink-200); border-radius: 12px; padding: .45rem .65rem; cursor: pointer; color: var(--ink-700); font-weight: 700; }
@media (max-width: 860px) {
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; padding: 1rem 1.2rem 1.4rem; background: #fff; border-bottom: 1px solid var(--ink-200); }
  .site-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .header-cta .btn-primary { padding: .6rem 1rem; font-size: .9rem; }
}

.hero {
  background: var(--gradient-hero), var(--bg-soft);
  overflow: hidden;
}
.hero .inner {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 7vw, 6rem);
}
@media (max-width: 900px) {
  .hero .inner { grid-template-columns: 1fr; padding: 2.4rem 0 3rem; }
}
.hero h1 { margin-bottom: 1.1rem; }
.hero h1 .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { font-size: 1.1rem; color: var(--ink-700); max-width: 560px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }
.hero-tagline {
  margin-top: 1.4rem; color: var(--brand-700); font-weight: 600;
}
.hero-art {
  aspect-ratio: 1.15/1; border-radius: 40px;
  background:
    radial-gradient(circle at 70% 30%, rgba(255,255,255,.85), transparent 50%),
    conic-gradient(from 210deg at 50% 50%, #fbcfe8, #f9a8d4, #e9d5ff, #fbcfe8);
  position: relative; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.8);
}
.hero-art .badge-circle {
  position: absolute; width: 64%; height: 64%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(253,242,248,.75));
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.9);
}
.hero-art .heart { font-size: 3.4rem; color: var(--brand-500); filter: drop-shadow(0 6px 14px rgba(236,72,153,.35)); }
.hero-art .sticker {
  position: absolute; background: rgba(255,255,255,.92); border-radius: 999px; padding: .6rem 1rem;
  font-weight: 700; font-size: .88rem; box-shadow: var(--shadow-md);
  color: var(--brand-700);
}
.hero-art .s1 { top: 12%; left: 6%; }
.hero-art .s2 { bottom: 14%; right: 8%; color: var(--info); }
.hero-art .s3 { bottom: 30%; left: 4%; color: var(--success); }

.section-title { text-align: center; margin-bottom: 2.2rem; }
.section-title p { color: var(--ink-500); max-width: 640px; margin: 0 auto; }

.pricing-card {
  position: relative; background: #fff; border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg); padding: 1.8rem 1.5rem 1.6rem;
  display: flex; flex-direction: column; gap: 1rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.pricing-card.featured {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--gradient-brand) border-box;
  border: 2px solid transparent;
  transform: translateY(-2px);
}
.badge {
  position: absolute; top: -12px; right: 16px;
  background: var(--gradient-brand); color: #fff; font-weight: 800;
  padding: .3rem .85rem; border-radius: 999px; font-size: .78rem; letter-spacing: .02em;
  box-shadow: 0 8px 16px -6px rgba(236,72,153,.55);
}
.plan-name { font-size: 1.1rem; font-weight: 800; color: var(--ink-900); }
.plan-desc { color: var(--ink-500); font-size: .92rem; margin-top: -0.5rem; }
.plan-price { display: flex; align-items: baseline; gap: .4rem; }
.plan-price .amount { font-size: 2.8rem; font-weight: 900; color: var(--ink-900); letter-spacing: -0.03em; }
.plan-price .cur { color: var(--brand-600); font-weight: 700; }
.plan-duration { color: var(--ink-500); font-weight: 600; font-size: .95rem; margin-top: -0.3rem; }
.plan-features { list-style: none; padding: 0; margin: .2rem 0 .4rem; display: flex; flex-direction: column; gap: .55rem; }
.plan-features li { display: flex; align-items: flex-start; gap: .6rem; color: var(--ink-700); font-size: .95rem; }
.plan-features li::before {
  content: ""; flex: 0 0 auto;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-50); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .8rem;
}
.pricing-card .spacer { flex: 1 1 auto; }

.benefits { background: linear-gradient(180deg, #fff, var(--bg-soft)); }
.benefit-card {
  background: #fff; border-radius: var(--radius-md); border: 1px solid var(--ink-200);
  padding: 1.4rem 1.3rem; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, border-color .2s ease;
}
.benefit-card:hover { border-color: var(--brand-200); transform: translateY(-2px); }
.benefit-ico {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-100), #ede9fe);
  color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem;
  margin-bottom: .8rem;
}

.testimonial {
  max-width: 760px; margin: 0 auto; text-align: center;
  background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
  border-radius: var(--radius-lg); padding: 2.4rem 1.8rem;
  border: 1px solid rgba(236,72,153,.12);
  box-shadow: var(--shadow-md);
}
.testimonial q { display: block; font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-900); quotes: none; font-weight: 600; }
.testimonial .who { margin-top: 1.1rem; color: var(--ink-500); font-weight: 600; font-size: .92rem; }

.faq { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: .8rem; }
.faq details {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  padding: .2rem 1.1rem; transition: border-color .2s ease, box-shadow .2s ease;
}
.faq details[open] { border-color: var(--brand-200); box-shadow: var(--shadow-sm); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1rem 0; font-weight: 700; color: var(--ink-900);
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.4rem; color: var(--brand-600); line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-700); padding: 0 0 1rem; margin: 0; }

.site-footer {
  background: #111827; color: #e5e7eb; padding: 2.6rem 0 1.6rem;
  margin-top: 4rem;
}
.site-footer a { color: #f9a8d4; }
.footer-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.6rem; }
.footer-top .brand { color: #fff; }
.footer-top .brand small { color: #9ca3af; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-bottom { margin-top: 1.8rem; color: #9ca3af; font-size: .85rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem; border-top: 1px solid #1f2937; padding-top: 1rem; }

.auth-page { min-height: 100vh; background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%); display: flex; }
.auth-wrap { margin: auto; width: 100%; max-width: 460px; padding: 1.4rem; }
.auth-logo {
  display: inline-flex; align-items: center; gap: .7rem; margin: 0 auto 1.3rem; color: var(--ink-900);
  font-weight: 900; font-size: 1.1rem;
}
.auth-logo small { display: block; font-size: .75rem; color: var(--ink-500); font-weight: 500; }
.auth-logo .crown {
  width: 44px; height: 44px; border-radius: 14px; color: var(--brand-700);
  background: linear-gradient(135deg, var(--brand-100), #ede9fe);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem;
}
.auth-card { background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-lg); padding: 1.8rem 1.5rem; box-shadow: var(--shadow-sm); }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .2rem; }
.auth-footer { margin-top: 1.2rem; text-align: center; font-size: .9rem; color: var(--ink-500); }
.auth-footer a { font-weight: 700; }
.auth-note { margin-top: 1rem; text-align: center; font-size: .8rem; color: var(--ink-400); }

.form { display: flex; flex-direction: column; gap: .85rem; margin-top: 1.1rem; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-weight: 700; color: var(--ink-700); font-size: .88rem; }
.form input, .form select, .form textarea {
  width: 100%;
  padding: .75rem .9rem; font-size: .98rem;
  border: 1px solid var(--ink-300); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink-900); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.form textarea { min-height: 120px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px rgba(236,72,153,.12);
}

.alert { border-radius: var(--radius-sm); padding: .8rem 1rem; font-weight: 600; font-size: .9rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.shell {
  display: grid; grid-template-columns: 260px 1fr; gap: 1.4rem;
  min-height: calc(100vh - 74px);
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
}
.sidebar {
  position: sticky; top: 90px; align-self: start;
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  padding: 1rem; display: flex; flex-direction: column; gap: .3rem; box-shadow: var(--shadow-sm);
}
.sidebar .nav-group { margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1px dashed var(--ink-200); }
.sidebar .nav-group:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.sidebar .nav-title { font-size: .72rem; color: var(--ink-500); letter-spacing: .02em; font-weight: 800; margin: .2rem .3rem .4rem; }
.sidebar a, .sidebar form button {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 12px;
  color: var(--ink-700); font-weight: 600; background: transparent; border: 0; width: 100%;
  cursor: pointer; text-align: left; font-size: .93rem;
}
.sidebar a:hover, .sidebar form button:hover { background: var(--brand-50); color: var(--brand-700); }
.sidebar a.active { background: var(--gradient-brand); color: #fff; box-shadow: 0 6px 14px -6px rgba(236,72,153,.55); }
.sidebar .ico { width: 22px; text-align: center; }
.user-chip {
  display: flex; align-items: center; gap: .7rem; padding: .8rem .7rem;
  border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--ink-200); margin-bottom: .8rem;
}
.user-chip .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--gradient-brand); color: #fff; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-chip .name { font-weight: 800; color: var(--ink-900); font-size: .9rem; }
.user-chip .meta { font-size: .78rem; color: var(--ink-500); }

.content { padding: 1.4rem 0 3rem; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.3rem; }
.page-title-row h2 { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }
.stat-card {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  padding: 1.1rem 1.15rem; box-shadow: var(--shadow-sm);
}
.stat-card .label { color: var(--ink-500); font-size: .8rem; letter-spacing: .02em; font-weight: 700; }
.stat-card .value { font-size: 1.75rem; font-weight: 900; color: var(--ink-900); letter-spacing: -0.02em; margin-top: .25rem; }
.stat-card .sub { color: var(--success); font-weight: 700; font-size: .85rem; margin-top: .2rem; }

.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { padding: .8rem .9rem; text-align: left; border-bottom: 1px solid var(--ink-100); font-size: .92rem; }
.data-table thead th { background: var(--bg-soft); color: var(--ink-700); font-weight: 800; font-size: .82rem; letter-spacing: .02em; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--bg-soft); }
.table-wrap { overflow-x: auto; }

.pill {
  display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .02em;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-active, .pill-confirmed, .pill-success { background: #d1fae5; color: #065f46; }
.pill-pending, .pill-open { background: #fef3c7; color: #92400e; }
.pill-failed, .pill-danger { background: #fee2e2; color: #991b1b; }
.pill-expired, .pill-closed { background: var(--ink-100); color: var(--ink-700); }
.pill-cancelled { background: var(--ink-100); color: var(--ink-500); }

.card {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  padding: 1.3rem 1.35rem; box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 1.1rem; margin-bottom: .6rem; }
.card + .card { margin-top: 1rem; }

.sub-banner {
  background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
  border: 1px solid rgba(236,72,153,.15);
  border-radius: var(--radius-lg); padding: 1.4rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.sub-banner h3 { margin: 0 0 .2rem; }
.sub-banner .meta { color: var(--ink-600); }
.sub-banner .days { font-weight: 800; color: var(--brand-700); }

.modal-bg {
  position: fixed; inset: 0; background: rgba(17,24,39,.55); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 1rem;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: var(--radius-lg); padding: 1.6rem 1.5rem; width: 100%;
  max-width: 460px; box-shadow: var(--shadow-lg); position: relative;
  max-height: 92vh; overflow-y: auto;
}
.modal .close {
  position: absolute; top: .8rem; right: .8rem;
  background: transparent; border: 0; font-size: 1.5rem; color: var(--ink-500); cursor: pointer;
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.modal .close:hover { background: var(--ink-50); color: var(--ink-900); }
.qr-wrap {
  background: linear-gradient(180deg, #fff, var(--bg-soft));
  border: 1px dashed var(--brand-300); border-radius: var(--radius-md);
  padding: 1rem; text-align: center;
}
.qr-wrap img { max-width: 100%; height: auto; border-radius: 12px; background: #fff; }
.qr-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: 1rem 0; }
.qr-meta .k { font-size: .76rem; color: var(--ink-500); letter-spacing: .02em; font-weight: 700; }
.qr-meta .v { font-weight: 800; color: var(--ink-900); }
.poll-status {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem .9rem; border-radius: var(--radius-sm); font-weight: 700; font-size: .9rem; text-align: center;
}
.poll-status.pending { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.poll-status.confirmed { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.poll-status.failed { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.spinner {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chat-wrap {
  display: grid; grid-template-columns: 260px 1fr; gap: 1rem;
  height: calc(100vh - 180px); min-height: 540px;
}
@media (max-width: 860px) {
  .chat-wrap { grid-template-columns: 1fr; height: auto; }
  .chat-sidebar { max-height: 300px; }
}
.chat-sidebar {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  padding: .8rem; display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; box-shadow: var(--shadow-sm);
}
.chat-sidebar .new-chat { }
.chat-list { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }
.chat-list .item {
  padding: .55rem .7rem; border-radius: 10px; background: var(--ink-50); color: var(--ink-700);
  font-weight: 600; font-size: .88rem; border: 1px solid transparent; cursor: pointer;
  display: flex; flex-direction: column; gap: .15rem;
}
.chat-list .item:hover { background: var(--brand-50); color: var(--brand-700); }
.chat-list .item.active { background: var(--gradient-brand); color: #fff; border-color: transparent; }
.chat-list .item time { font-size: .72rem; opacity: .8; font-weight: 500; }
.chat-list .item .chat-room-line {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem;
  min-width: 0;
}
.chat-list .item .chat-room-line > span:first-child {
  min-width: 0; overflow-wrap: anywhere;
}
.chat-list .item .chat-prev {
  font-size: .72rem; font-weight: 500; opacity: .65; line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chat-list .item .chat-prev-title { display: block; }
.unread-badge {
  flex: none; font-size: .68rem; font-weight: 800; padding: .1rem .42rem; border-radius: 999px;
  background: var(--brand-600); color: #fff; white-space: nowrap;
}
.chat-list .item.active .unread-badge { background: #fff; color: var(--brand-700); }
.chat-cat .chat-cat-link { color: inherit; text-decoration: none; }
.chat-cat .chat-cat-link:hover { color: var(--brand-600); }

.chat-panel {
  background: #fff; border: 1px solid var(--ink-200); border-radius: var(--radius-md);
  display: flex; flex-direction: column; box-shadow: var(--shadow-sm); overflow: hidden;
}
.chat-header {
  padding: .9rem 1rem; border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-soft);
}
.chat-header h3 { margin: 0; font-size: 1rem; }
.chat-header .sub { font-size: .8rem; color: var(--ink-500); font-weight: 600; }
.chat-messages {
  padding: 1.1rem; flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem;
  background:
    radial-gradient(800px 400px at 100% 0%, rgba(249,168,212,.12), transparent 60%),
    radial-gradient(600px 300px at 0% 100%, rgba(216,180,254,.12), transparent 60%),
    #fcfaff;
}
.msg { display: flex; gap: .6rem; max-width: 82%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85rem;
  color: #fff;
}
.msg.user .avatar { background: var(--gradient-brand); }
.msg.assistant .avatar { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.msg .bubble {
  background: #fff; border: 1px solid var(--ink-200); border-radius: 18px;
  padding: .75rem .9rem; color: var(--ink-800); font-size: .96rem;
  white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-sm);
}
.msg.user .bubble {
  background: var(--gradient-brand); color: #fff; border-color: transparent;
  box-shadow: 0 10px 22px -10px rgba(236,72,153,.55);
}
.chat-composer {
  padding: .85rem .9rem; border-top: 1px solid var(--ink-200); background: #fff;
  display: grid; grid-template-columns: 1fr auto; gap: .6rem;
}
.chat-composer textarea {
  resize: none; min-height: 50px; max-height: 160px;
  border: 1px solid var(--ink-300); border-radius: 14px; padding: .7rem .9rem;
  font-family: inherit; font-size: .96rem; outline: none;
}
.chat-composer textarea:focus {
  border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(236,72,153,.12);
}
.chat-composer .send { align-self: end; }

.empty-state {
  margin: auto; padding: 2rem; text-align: center; max-width: 560px; color: var(--ink-500);
}
.empty-state .big-ico {
  width: 72px; height: 72px; border-radius: 20px; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--brand-100), #ede9fe); color: var(--brand-700);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.8rem;
}
.empty-state h3 { color: var(--ink-900); margin-bottom: .3rem; }

.util { color: var(--ink-500); font-size: .85rem; }
.breadcrumbs { color: var(--ink-500); font-size: .85rem; margin-bottom: .8rem; }
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--brand-600); }

/* ===== Real-time categorized community chat (Durable Objects / PartyKit) ===== */
.pill-warn { background: #fef3c7; color: #92400e; }
.pill-warn::before { background: #f59e0b; }

.chat-sidebar-head { font-weight: 700; color: var(--ink-500); padding: .2rem .2rem .4rem; border-bottom: 1px solid var(--ink-100); }
.chat-cat + .chat-cat { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--ink-200); }
.chat-head-right { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; }

.msg { align-items: flex-start; }
.msg > .msg-meta {
  display: block; width: 100%; font-size: .72rem; font-weight: 600; color: var(--ink-400);
  padding: 0 .25rem; margin-bottom: .15rem;
}
.msg.user > .msg-meta { text-align: right; }
.msg.user, .msg.assistant { flex-direction: column; }
.msg .bubble { width: fit-content; }

.chat-notice {
  display: none; padding: .5rem .9rem; margin: .6rem .9rem 0; border-radius: 10px;
  background: #fef3c7; color: #92400e; font-size: .85rem; font-weight: 600;
}
.chat-empty {
  margin: auto; padding: .8rem; text-align: center; color: var(--ink-400); font-size: .9rem;
}
.chat-composer textarea:disabled,
.chat-composer textarea:disabled::placeholder { background: var(--ink-50); color: var(--ink-400); cursor: not-allowed; }

/* === Sales & demo pages === */

.sales-hero {
  background: var(--gradient-hero), var(--bg-soft);
  overflow: hidden;
}
.sales-hero .inner {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
  padding: clamp(3rem, 7vw, 5.5rem) 0;
}
.sales-hero h1 { margin-bottom: 1rem; }
.sales-hero h1 .accent {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sales-hero .hero-lead { max-width: 640px; margin: 0 auto 1.6rem; font-size: 1.1rem; }
.sales-hero .hero-cta { justify-content: center; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.2rem; }
@media (max-width: 960px) { .steps { grid-template-columns: 1fr; } }
.step-card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.3rem;
  box-shadow: var(--shadow-sm);
}
.step-card .step-no {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .8rem;
}
.step-card h3 { margin-bottom: .3rem; }

.cta-footer {
  background: linear-gradient(135deg, #fdf2f8, #f5f3ff);
  border: 1px solid rgba(236,72,153,.12);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: clamp(2rem, 5vw, 3.5rem) 1.5rem;
  box-shadow: var(--shadow-md);
}
.cta-footer p { max-width: 560px; margin: 0 auto 1.4rem; }

.split-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
}
@media (max-width: 960px) { .split-layout { grid-template-columns: 1fr; } }
.split-sticky {
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.qr-note {
  margin-top: 1rem;
  padding: .8rem .9rem;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.6;
}

.plan-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.6rem;
}
.plan-tabs a {
  padding: .55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--ink-200);
  background: #fff;
  color: var(--ink-700);
  font-weight: 700;
  font-size: .92rem;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.plan-tabs a:hover {
  background: var(--brand-50);
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.plan-row + .plan-row { margin-top: 1rem; }
.plan-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-200);
}
.plan-row-features {
  list-style: none;
  padding: 0;
  margin: .4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.plan-row-features li {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  color: var(--ink-700);
  font-size: .92rem;
}
.plan-row-features li::before {
  content: "";
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: .72rem;
}
.plan-row-side {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  align-items: flex-end;
}
@media (max-width: 640px) {
  .plan-row { grid-template-columns: 1fr; }
  .plan-row-side { text-align: left; align-items: flex-start; }
}

.tenant-switcher {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  background: #111827;
  border-radius: var(--radius-md);
  padding: .65rem .85rem;
  box-shadow: var(--shadow-sm);
}
.tenant-switcher .switcher-label {
  color: #9ca3af;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-right: .2rem;
}
.tenant-switcher a {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .95rem;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: #e5e7eb;
  font-weight: 700;
  font-size: .88rem;
  transition: background .2s ease, color .2s ease;
}
.tenant-switcher a:hover { background: rgba(255,255,255,.16); color: #fff; }

.tenant-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.demo-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.4rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.demo-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--card-accent, var(--brand-500));
}
.demo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.demo-card .demo-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--card-accent-soft, var(--brand-50));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}
.demo-card h3 { margin: 0; }
.demo-card .demo-meta { color: var(--ink-500); font-size: .9rem; font-weight: 600; }
.demo-card .demo-cta { margin-top: auto; font-weight: 800; font-size: .92rem; }

.tenant-hero {
  background: var(--hero-soft, var(--bg-soft));
  overflow: hidden;
}
.tenant-hero .inner {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 2.5rem;
  align-items: center;
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}
@media (max-width: 900px) { .tenant-hero .inner { grid-template-columns: 1fr; } }
.tenant-hero .tenant-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .95rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.tenant-hero h1 { margin-bottom: 1rem; }
.tenant-hero .hero-lead { font-size: 1.08rem; max-width: 560px; }
.tenant-hero .hero-cta { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 1.6rem; }
.tenant-hero .hero-art {
  aspect-ratio: 1.15/1;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  box-shadow: var(--shadow-lg);
}

.tenant-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 700px) { .tenant-stats { grid-template-columns: 1fr; } }
.tenant-stat {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.tenant-stat .value { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.02em; }
.tenant-stat .label { color: var(--ink-500); font-size: .85rem; font-weight: 600; margin-top: .15rem; }

.tenant-features li::before {
  background: var(--tenant-soft, var(--brand-50));
  color: var(--tenant, var(--brand-700));
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.compare-table th, .compare-table td {
  padding: .8rem .9rem;
  text-align: left;
  border-bottom: 1px solid var(--ink-100);
  font-size: .92rem;
}
.compare-table thead th {
  background: var(--bg-soft);
  color: var(--ink-700);
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .02em;
}
.compare-table tbody tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:hover td { background: var(--bg-soft); }
.compare-table .check { color: var(--success); font-weight: 900; }
.compare-table .dash { color: var(--ink-300); }
