@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Sora:wght@500;600;700&display=swap');

:root {
  --bg: #0a0a0c;
  --bg-elevated: #121217;
  --panel: #16161c;
  --panel-2: #1c1c24;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --muted: #9a9aa8;
  --primary: #e91e8c;
  --primary-2: #ff4db8;
  --primary-soft: rgba(233, 30, 140, 0.16);
  --danger: #ff5c7a;
  --success: #3dcf9a;
  --warning: #f0b429;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --font: 'Outfit', sans-serif;
  --display: 'Sora', sans-serif;
  --transition: 180ms ease;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(233, 30, 140, 0.18), transparent 55%),
    radial-gradient(900px 500px at 0% 20%, rgba(90, 40, 120, 0.18), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.app-shell.sidebar-collapsed {
  --sidebar-w: 84px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(12, 12, 16, 0.92);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: width var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  min-height: var(--topbar-h);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #7b2ff7);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(233, 30, 140, 0.35);
}

.brand-mark span {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}

.brand-logo {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.brand-logo.sm { height: 28px; max-width: 100px; }

.announce-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 35%, transparent), color-mix(in srgb, var(--primary-2) 25%, transparent));
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.announce-bar a { color: var(--primary-2); font-weight: 600; }

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}
.site-footer__social a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
}
.site-footer__social a:hover { color: var(--text); }

.notif-bell { position: relative; }
.notif-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}
.notif-item.is-unread { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
a.workspace-selector {
  text-decoration: none;
  color: inherit;
}

.cookie-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 72px;
  z-index: 80;
  background: color-mix(in srgb, var(--card, #151522) 92%, #000);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  max-width: 720px;
  margin: 0 auto;
}
.cookie-banner__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-notice-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 70;
  background: color-mix(in srgb, var(--primary) 18%, #111);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  max-width: 900px;
  margin: 0 auto;
}

.brand-text { overflow: hidden; }
.brand-text strong {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.02em;
}
.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-nav {
  overflow: auto;
  padding: 8px 12px 24px;
  flex: 1;
}

.nav-section {
  margin: 18px 10px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: #cfcfd8;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  margin-bottom: 2px;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}

.nav-link.is-active {
  background: var(--primary-soft);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(233, 30, 140, 0.25);
}

.nav-ico {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  flex-shrink: 0;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .nav-link span {
  display: none;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: rgba(10, 10, 12, 0.75);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  display: grid;
  place-items: center;
  transition: border-color var(--transition), background var(--transition);
}

.icon-btn:hover { border-color: var(--border-strong); background: var(--panel-2); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(233, 30, 140, 0.2), rgba(123, 47, 247, 0.15));
  border: 1px solid rgba(233, 30, 140, 0.35);
  font-weight: 600;
  font-size: 13px;
}

.content {
  padding: 24px 24px 96px;
  width: min(1280px, 100%);
  margin: 0 auto;
}

h1, h2, h3 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: 1.35rem; }
p { margin: 0; }

.muted { color: var(--muted); }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.card, .tool-card, .model-card, .promo-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.tool-card:hover, .model-card:hover, .promo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(233, 30, 140, 0.35);
  box-shadow: var(--shadow);
}

.promo-card {
  background:
    linear-gradient(145deg, rgba(233, 30, 140, 0.22), rgba(20, 20, 28, 0.95) 55%),
    var(--panel);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.promo-card.alt {
  background:
    linear-gradient(145deg, rgba(123, 47, 247, 0.24), rgba(20, 20, 28, 0.95) 55%),
    var(--panel);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(120deg, rgba(10, 10, 14, 0.2), rgba(10, 10, 14, 0.82)),
    radial-gradient(800px 400px at 70% 20%, rgba(233, 30, 140, 0.35), transparent 60%),
    linear-gradient(160deg, #17171f, #0c0c10);
  padding: clamp(28px, 5vw, 56px);
  margin-bottom: 22px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: fadeUp 0.6s ease both;
}

.hero .brand-hero {
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #fff, #ffb3de);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 520px;
  color: #d4d4de;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform var(--transition), opacity var(--transition), background var(--transition), border-color var(--transition);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 30px rgba(233, 30, 140, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

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

.btn-danger {
  background: rgba(255, 92, 122, 0.15);
  border-color: rgba(255, 92, 122, 0.35);
  color: #ffb3c0;
}

.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 6px; }
label { font-size: 13px; color: #c9c9d4; font-weight: 500; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="color"],
select,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

input:focus, select:focus, textarea:focus {
  border-color: rgba(233, 30, 140, 0.55);
  box-shadow: 0 0 0 3px rgba(233, 30, 140, 0.15);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th { color: var(--muted); font-weight: 600; background: rgba(255,255,255,0.02); }
tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
}

.badge-ok { background: rgba(61, 207, 154, 0.12); color: #7dffc7; border-color: rgba(61, 207, 154, 0.3); }
.badge-warn { background: rgba(240, 180, 41, 0.12); color: #ffd76a; border-color: rgba(240, 180, 41, 0.3); }
.badge-danger { background: rgba(255, 92, 122, 0.12); color: #ff9db0; border-color: rgba(255, 92, 122, 0.3); }

.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.alert-success { background: rgba(61, 207, 154, 0.1); border-color: rgba(61, 207, 154, 0.3); }
.alert-error { background: rgba(255, 92, 122, 0.1); border-color: rgba(255, 92, 122, 0.3); }
.alert-info { background: rgba(233, 30, 140, 0.1); border-color: rgba(233, 30, 140, 0.3); }

.studio-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

.studio-panel, .canvas-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.model-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.model-card.selected {
  border-color: rgba(233, 30, 140, 0.5);
  background: var(--primary-soft);
}

.dropzone {
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,0.02);
  transition: border-color var(--transition), background var(--transition);
}

.dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.skeleton {
  background: linear-gradient(90deg, #1a1a22 25%, #242430 37%, #1a1a22 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 10px;
  min-height: 16px;
}

.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
}

.toast {
  background: var(--panel-2);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.25s ease both;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 16px;
}

.modal-backdrop.open { display: flex; }

.modal {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.2s ease both;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
}

.tab.is-active {
  color: #fff;
  background: var(--primary-soft);
  border-color: rgba(233, 30, 140, 0.4);
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}

.stat strong {
  display: block;
  font-size: 1.6rem;
  font-family: var(--display);
}

.mobile-nav,
.fab-create {
  /* Phase 2 overrides in creator.css */
}

.auth-shell, .install-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card, .install-card {
  width: min(460px, 100%);
  background: rgba(18, 18, 24, 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.45s ease both;
}

.admin-shell .content { width: min(1400px, 100%); }

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

.unavailable-banner {
  border: 1px solid rgba(240, 180, 41, 0.35);
  background: rgba(240, 180, 41, 0.08);
  color: #ffd76a;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

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

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

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

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-nav, .fab-create { display: none; } /* overridden by creator.css */
  .content { padding: 18px 16px 120px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .hero { min-height: 280px; }
}

/* —— Phase 8 checkout / billing —— */
.checkout-hero {
  margin-bottom: 1.5rem;
  padding: 1.5rem 0 0.5rem;
  animation: fadeUp 0.5s ease both;
}
.checkout-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--primary-2);
  margin: 0 0 0.5rem;
}
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  align-items: start;
}
.checkout-summary,
.checkout-panel,
.card-soft,
.billing-current {
  background: linear-gradient(160deg, var(--panel), var(--panel-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
}
.checkout-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-2);
  border: 1px solid rgba(233, 30, 140, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}
.checkout-dl { margin: 1rem 0; }
.checkout-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}
.checkout-dl dt { color: var(--muted); }
.checkout-features {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.checkout-features li {
  padding: 0.35rem 0 0.35rem 1.1rem;
  position: relative;
}
.checkout-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--primary);
}
.checkout-totals { margin-top: 1rem; }
.checkout-totals > div,
.checkout-totals__grand {
  display: flex;
  justify-content: space-between;
  padding: 0.3rem 0;
}
.checkout-totals__grand {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-strong);
  font-size: 1.1rem;
}
.checkout-coupon__row { display: flex; gap: 0.5rem; }
.checkout-coupon__row input { flex: 1; }
.checkout-method {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.checkout-method:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.checkout-terms {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin: 1rem 0;
  font-size: 0.92rem;
}
.checkout-result {
  max-width: 560px;
  margin: 2rem auto;
  padding: 2rem;
  text-align: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  animation: fadeUp 0.45s ease both;
}
.checkout-result--success { border-color: rgba(61, 207, 154, 0.35); }
.checkout-result--failure { border-color: rgba(255, 92, 122, 0.35); }
.checkout-result__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}
.pricing-card.is-featured {
  border-color: rgba(233, 30, 140, 0.45);
  box-shadow: 0 0 0 1px rgba(233, 30, 140, 0.2), var(--shadow);
  animation: pulseSoft 3.5s ease-in-out infinite;
}
.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  align-items: center;
}
.billing-cycle { display: flex; gap: 0.5rem; align-items: center; }
.admin-form label { display: flex; flex-direction: column; gap: 0.35rem; }
.admin-form input, .admin-form select, .admin-form textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Phase 9 communication / legal / support —— */
.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.25));
  padding: 2rem 1.25rem 5rem;
}
.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer__policies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  max-width: 720px;
}
.site-footer__policies a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.site-footer__policies a:hover { color: var(--text); }
.policy-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}
.policy-page__body.prose :where(h2,h3) { font-family: var(--display); margin-top: 1.5rem; }
.policy-page__body.prose :where(p,li) { line-height: 1.65; color: #d8d8e0; }
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.rte-toolbar button {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.rte-editor {
  min-height: 240px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  outline: none;
}
.ticket-thread { display: flex; flex-direction: column; gap: 0.85rem; }
.ticket-bubble {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
}
.ticket-bubble.is-staff { border-color: rgba(233, 30, 140, 0.28); }
.ticket-bubble.is-internal {
  border-style: dashed;
  background: rgba(240, 180, 41, 0.06);
}
.ticket-bubble header {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}
.ticket-attachments { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.hp-field {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}
.contact-hero { margin-bottom: 1.25rem; }

/* —— Phase 10 analytics / health / affiliates —— */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}
.health-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.health-ok { border-color: rgba(61, 207, 154, 0.35); }
.health-warn { border-color: rgba(240, 180, 41, 0.4); }
.health-error { border-color: rgba(255, 92, 122, 0.45); }
