/* Brand Demo App Styles (palette is brand configuration — see config/brand.json) */
:root {
  --color-bg: #faf9f7;
  --color-surface: #ffffff;
  --color-ink: #1a1a1a;
  --color-ink-secondary: #555555;
  --color-muted: #8a8a8a;
  --color-border: #e8e6e3;
  --color-accent: #b46b54;
  --color-accent-dark: #8f5240;
  --color-accent-light: #f3e7e3;
  --color-premium: #1f3a5f;
  --color-premium-light: #e7edf5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-ink);
  background: var(--color-bg);
  line-height: 1.6;
}

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

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

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 247, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: white;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 32px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-ink-secondary);
}

.main-nav a:hover {
  color: var(--color-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: var(--color-surface);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-border);
}

.btn-outline:hover {
  background: var(--color-surface);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* Hero */
.hero {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(180, 107, 84, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 20% 90%, rgba(31, 58, 95, 0.08) 0%, transparent 40%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 36px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--color-ink-secondary);
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-stats strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-accent);
}

.hero-stats span {
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* Sections */
section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.section-header p {
  margin: 0;
  color: var(--color-ink-secondary);
  font-size: 1.05rem;
}

/* Collections */
.collections {
  background: var(--color-surface);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.collection-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.collection-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.card-media {
  height: 220px;
  background-size: cover;
  background-position: center;
}

.card-media-1 {
  background-image: linear-gradient(135deg, #e8ded8 0%, #d4c4bb 100%);
}

.card-media-2 {
  background-image: linear-gradient(135deg, #c9d6df 0%, #a7b8c4 100%);
}

.card-media-3 {
  background-image: linear-gradient(135deg, #f0e6d8 0%, #e1d2be 100%);
}

.card-body {
  padding: 24px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.card-body p {
  margin: 0 0 16px;
  color: var(--color-ink-secondary);
  font-size: 0.95rem;
}

.link-arrow {
  font-weight: 600;
  color: var(--color-accent);
}

.link-arrow:hover {
  color: var(--color-accent-dark);
}

/* Products */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
  transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--color-ink);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-media {
  height: 260px;
  background-size: cover;
  background-position: center;
}

.product-1 { background-image: linear-gradient(135deg, #d7ccc8 0%, #bcaaa4 100%); }
.product-2 { background-image: linear-gradient(135deg, #cfd8dc 0%, #b0bec5 100%); }
.product-3 { background-image: linear-gradient(135deg, #efebe9 0%, #d7ccc8 100%); }
.product-4 { background-image: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%); }
.product-5 { background-image: linear-gradient(135deg, #e8e2d9 0%, #c9bfae 100%); }
.product-6 { background-image: linear-gradient(135deg, #e6d8dc 0%, #c4a8ad 100%); }
.product-7 { background-image: linear-gradient(135deg, #dcd9e0 0%, #a9a5b0 100%); }
.product-8 { background-image: linear-gradient(135deg, #e3e8e0 0%, #b7c0b2 100%); }
.product-9 { background-image: linear-gradient(135deg, #d8dfe0 0%, #9fb2b5 100%); }

/* Merchandiser photo served from R2 via /media/* — fills the media slot. */
.product-media-photo {
  background: none;
}

.product-media-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-body {
  padding: 18px 20px;
}

.product-body h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.product-price {
  margin: 0;
  font-weight: 700;
  color: var(--color-accent);
}

.product-stock {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted);
}

.product-stock-low {
  color: var(--color-accent-dark);
}

.product-stock-out {
  color: var(--color-muted);
}

.product-card-soldout .product-media {
  filter: grayscale(1);
  opacity: 0.55;
}

.btn-add {
  margin-top: 12px;
  width: 100%;
  padding: 9px 16px;
  font-size: 0.85rem;
}

.btn-add:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.catalog-loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

/* Cart drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 220;
  height: 100vh;
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  box-shadow: var(--shadow-lg);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.cart-header h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
}

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cart-item-info span {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-weight: 700;
  cursor: pointer;
}

.qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qty-value {
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

.cart-remove {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
}

.cart-empty {
  text-align: center;
  color: var(--color-muted);
  padding: 40px 0;
}

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-subtotal {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-subtotal strong {
  font-size: 1.15rem;
}

.cart-clear {
  background: none;
  border: none;
  color: var(--color-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

.cart-note {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-align: center;
}

.cart-count {
  display: inline-block;
  margin-left: 8px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

@media (max-width: 720px) {
  .cart-drawer {
    width: 100%;
  }
}

/* Checkout + orders */
.cart-email-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-secondary);
}

.cart-footer .form-input {
  width: 100%;
}

.cart-footer .turnstile-widget {
  min-height: 0;
}

.order-card {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.order-card:last-child {
  border-bottom: none;
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.order-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.order-id span {
  font-size: 0.75rem;
  color: var(--color-muted);
}

.order-status {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-status-confirmed {
  background: var(--color-premium-light);
  color: var(--color-premium);
}

.order-status-fulfilled {
  background: #e6f4ea;
  color: #1e7e34;
}

.order-status-cancelled {
  background: #fdecea;
  color: #b03a2e;
}

.order-items {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.order-items li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 0.9rem;
  color: var(--color-ink-secondary);
}

.order-total {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.order-total strong {
  color: var(--color-accent);
}

/* Semantic search */
.search-bar {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto 28px;
}

.search-input {
  flex: 1;
  padding: 13px 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.search-results {
  margin-bottom: 40px;
}

.search-grid {
  margin-top: 4px;
}

.search-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  margin-bottom: 14px;
  background: var(--color-accent-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-dark);
}

.search-clear {
  background: none;
  border: none;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  text-decoration: underline;
  cursor: pointer;
}

.search-score {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-premium);
}

/* Reviews */
.reviews {
  background: linear-gradient(180deg, var(--color-bg) 0%, #f2f0ed 100%);
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.review-card {
  margin: 0;
  padding: 28px;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.review-card p {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--color-ink-secondary);
}

.review-card footer {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-ink);
}

/* Footer */
.site-footer {
  padding: 60px 0 30px;
  background: var(--color-ink);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-grid .logo {
  margin-bottom: 16px;
}

.footer-about {
  max-width: 280px;
  line-height: 1.7;
}

.footer-grid h4 {
  margin: 0 0 18px;
  color: white;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li + li {
  margin-top: 10px;
}

.footer-grid a:hover {
  color: white;
}

.copyright {
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
}

/* Chat launcher */
.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-accent);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.2s, background 0.2s;
}

.chat-launcher:hover {
  transform: scale(1.05);
  background: var(--color-accent-dark);
}

/* Chat panel */
.chat-panel {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 201;
  width: min(420px, calc(100% - 48px));
  max-height: min(700px, calc(100vh - 130px));
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: white;
  font-weight: 700;
  font-family: var(--font-serif);
}

.chat-title h3 {
  margin: 0;
  font-size: 1rem;
}

.chat-status {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.chat-status::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: var(--radius-full);
  background: #2ecc71;
}

.chat-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.chat-close:hover {
  background: var(--color-bg);
  color: var(--color-ink);
}

/* Plan switcher */
.chat-plan-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.plan-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.plan-toggle {
  display: flex;
  gap: 8px;
  background: var(--color-surface);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
}

.plan-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.plan-option-active {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.plan-option[data-plan="paid"].plan-option-active {
  background: var(--color-premium-light);
  color: var(--color-premium);
}

.plan-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: currentColor;
  opacity: 0.4;
}

.plan-option-active .plan-dot {
  opacity: 1;
}

.plan-badge {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--color-premium);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 260px;
}

.message {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 88%;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-user {
  align-self: flex-end;
}

.message-bot {
  align-self: flex-start;
}

.message-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  line-height: 1.55;
  word-wrap: break-word;
}

.message-user .message-bubble {
  background: var(--color-accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-bot .message-bubble {
  background: var(--color-bg);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 4px;
}

.message-meta {
  font-size: 0.7rem;
  color: var(--color-muted);
}

.message-bot .message-bubble.fallback-bubble {
  border: 1px solid #9a5b16;
  background: #fff3df;
  color: #58380e;
}

.message-execution-note {
  margin: 6px 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #795019;
}

.message-user .message-meta {
  align-self: flex-end;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 20px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-muted);
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.error-bubble {
  border-left: 3px solid #e74c3c;
}

/* Input */
.chat-input-area {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-accent);
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.chat-send:hover {
  background: var(--color-accent-dark);
}

.chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-disclaimer {
  margin: 12px 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: var(--color-muted);
}

.chat-disclaimer code {
  background: var(--color-bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Suggestion tiles — optional secondary aid below the input */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}

.chat-suggest {
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.chat-suggest:hover {
  color: var(--color-ink);
  border-color: var(--color-accent);
  background: var(--color-accent-light);
}

/* Responsive */
@media (min-width: 768px) {
  .main-nav {
    display: flex;
  }

  .icon-btn {
    display: inline-block;
  }
}

@media (max-width: 767px) {
  .hero {
    padding: 70px 0 90px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .chat-panel {
    right: 12px;
    bottom: 84px;
    width: calc(100% - 24px);
  }

  .chat-launcher {
    right: 12px;
    bottom: 12px;
  }
}

/* Account section */
.account-section {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-top: 1px solid var(--color-border);
}

/* Standalone signup page */
.signup-main {
  padding: 48px 0 96px;
}

/* Landing-page signup CTA banner */
.signup-cta {
  padding: 48px 0;
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
  border-top: 1px solid var(--color-border);
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 28px 36px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.cta-banner h2 {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.6rem;
}

.cta-banner p {
  margin: 0;
  color: var(--color-ink-secondary);
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 880px;
  margin: 0 auto;
}

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

.account-card h3 {
  margin: 0 0 18px;
  font-size: 1.15rem;
}

.account-card-demo p {
  color: var(--color-ink-secondary);
  font-size: 0.95rem;
  margin: 0 0 18px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--color-bg);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.btn-full {
  width: 100%;
}

.turnstile-widget {
  margin: 8px 0 16px;
  min-height: 65px;
}

.form-status {
  margin: 14px 0 0;
  font-size: 0.85rem;
  min-height: 1.2em;
}

.form-status-success {
  color: #1e7e34;
}

.form-status-error {
  color: #c0392b;
}

.generated-user {
  margin-top: 18px;
  padding: 16px;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  line-height: 1.8;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 6px;
}

.badge-free {
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
}

.badge-paid {
  background: var(--color-premium-light);
  color: var(--color-premium);
}

.badge-seed {
  background: #e8e8e8;
  color: #555;
}

.badge-autofill {
  background: #e6f4ea;
  color: #1e7e34;
}

.badge-manual {
  background: #e3f2fd;
  color: #0d47a1;
}

/* Login page (/login) */
.login-alt {
  margin: 14px 0 0;
  font-size: 0.9rem;
  color: var(--color-ink-secondary);
}

.login-alt a {
  color: var(--color-accent);
  font-weight: 600;
}

.demo-cred-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}

.demo-cred-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.demo-cred-list li + li {
  margin-top: 6px;
}

.demo-cred-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-ink-secondary);
  line-height: 1.6;
}

.demo-cred-note code,
.demo-cred-list code {
  background: var(--color-surface);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* Signed-in header state (account.js) */
.account-signed-in {
  font-weight: 700;
}

.account-signout {
  color: var(--color-ink-secondary) !important;
  font-style: italic;
}



.live-viewers {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-premium-light);
  color: var(--color-premium);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-viewers.show {
  display: inline-flex;
}

.live-viewers .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1e7e34;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

/* Server-rendered agent-ready pages (/products, /collections, support) */
.page-section {
  padding-top: 56px;
}

.section-header h1,
.section-header h2 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.crumbs {
  margin: 0 0 28px;
  font-size: 0.85rem;
  color: var(--color-muted);
  letter-spacing: 0.02em;
}

.crumbs a {
  color: var(--color-ink-secondary);
}

.crumbs a:hover {
  color: var(--color-accent);
}

.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.product-detail-media .product-media {
  height: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.product-detail-info h1 {
  margin: 0 0 16px;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.product-detail-badge {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--color-accent-light);
  color: var(--color-accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-detail-desc {
  margin: 0 0 20px;
  color: var(--color-ink-secondary);
  font-size: 1.05rem;
}

.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 0 0 28px;
}

.product-detail-price strong {
  font-size: 1.9rem;
  font-weight: 700;
}

.product-detail-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  margin: 0 0 32px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.product-detail-facts div {
  margin: 0;
}

.product-detail-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.product-detail-facts dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.product-detail-support {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--color-ink-secondary);
}

.product-detail-support a,
.crumbs span {
  color: var(--color-accent);
}

.product-detail-support a:hover {
  text-decoration: underline;
}

.product-media-link {
  display: block;
}

.collection-count {
  margin: 0 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.content-prose {
  max-width: 780px;
}

.content-prose h2 {
  margin: 40px 0 12px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
}

.support-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.support-table th,
.support-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.support-table th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
  background: var(--color-bg);
}

.support-table tr:last-child td {
  border-bottom: none;
}

.support-notes {
  margin: 20px 0 0;
  padding-left: 20px;
  color: var(--color-ink-secondary);
}

.support-notes li + li {
  margin-top: 8px;
}

.support-crosslink {
  margin-top: 36px;
  padding: 16px 20px;
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-ink-secondary);
}

@media (max-width: 880px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-detail-media .product-media {
    height: 340px;
  }
}
