:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4d;
  --text: #e8eef7;
  --muted: #8b9cb3;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --danger: #f87171;
  --ok: #4ade80;
  --header-bg: rgba(26, 35, 50, 0.92);
  --btn-primary-text: #0f1419;
  --radius: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --border: #d0dae8;
  --text: #1a2332;
  --muted: #5a6b82;
  --accent: #059669;
  --accent-dim: #047857;
  --danger: #dc2626;
  --ok: #16a34a;
  --header-bg: rgba(255, 255, 255, 0.92);
  --btn-primary-text: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-left: 2.5rem;
}
.topbar-nav a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}
.topbar-nav a:hover,
.topbar-nav a.active {
  color: var(--accent);
  text-decoration: none;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.topbar-auth { display: flex; align-items: center; }
.topbar-manage, .topbar-dashboard { text-decoration: none; white-space: nowrap; }
.topbar-manage.active, .topbar-dashboard.active { color: var(--accent); border-color: var(--accent); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--muted); }

.lang-picker { position: relative; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 11rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 110;
}
.lang-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.lang-item:hover { background: var(--bg); }

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.logo span { color: var(--accent); }
html[data-theme="light"] .logo { color: var(--text); }
.logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent-dim), var(--accent));
  color: var(--btn-primary-text);
  border: none;
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn.btn-add {
  background: var(--ok);
  color: #052e16;
  border: none;
  font-weight: 600;
  gap: 0.35rem;
}
html[data-theme="light"] .btn.btn-add { color: #ffffff; }
.btn.btn-add:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { border-color: var(--danger); color: var(--danger); }

main { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero--video {
  position: relative;
  width: 100%;
  margin: 0 0 2rem;
  padding: clamp(3rem, 12vh, 5rem) 1.5rem clamp(2.5rem, 10vh, 4rem);
  min-height: min(72vh, 640px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-video-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  transition: opacity 1.2s ease;
}
.hero-video-layer.is-finished {
  opacity: 0;
  pointer-events: none;
}
.hero-video-layer[hidden] {
  display: none;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-video-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 20, 25, 0.55) 0%,
    rgba(15, 20, 25, 0.72) 45%,
    rgba(15, 20, 25, 0.88) 100%
  );
  pointer-events: none;
}

html[data-theme="light"] .hero-video-scrim {
  background: linear-gradient(
    180deg,
    rgba(244, 247, 251, 0.5) 0%,
    rgba(244, 247, 251, 0.75) 50%,
    rgba(244, 247, 251, 0.92) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
}
.hero .lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 32rem;
  margin: 0 auto 2rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel h2 { margin-top: 0; font-size: 1.1rem; }
.panel.plan-master { border-color: var(--accent); }

.domains-cname-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.help-q {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.help-q:hover { border-color: var(--accent); color: var(--accent); }
.dns-record {
  display: grid;
  gap: 0.45rem;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
}
.dns-record-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.dns-record-row .muted { min-width: 4.5rem; }
.dns-help-steps { margin: 0; padding-left: 1.15rem; }
.dns-help-steps > li { margin: 0.55rem 0; }

.profile-panel { max-width: 40rem; }
.profile-create-row { margin-bottom: 1.25rem; }
.profile-danger-zone { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.profile-header {
  margin-bottom: 1.5rem;
}
.profile-header-main {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  min-width: 0;
}
.profile-public-link {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.profile-public-link a {
  margin-left: 0.25rem;
}
.avatar-upload-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.avatar-upload-label {
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
}
.avatar-btn {
  position: relative;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
}
.avatar-btn:hover .avatar-edit-badge { opacity: 1; }
.avatar-edit-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.profile-field-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 32rem;
}
.profile-field-row input,
.profile-field-row textarea {
  flex: 1;
  min-width: 0;
}
.profile-field-row-tall { align-items: flex-start; }
.profile-field-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-top: 0.35rem;
}
.btn-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon.btn-ok { color: var(--accent-dim); }
.btn-icon.btn-cancel { color: var(--danger); }
.profile-field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 1px var(--danger);
}
.profile-field-row input:disabled,
.profile-field-row textarea:disabled {
  opacity: 0.85;
  cursor: default;
}
.crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.crop-dialog {
  position: relative;
  max-width: 420px;
  width: 100%;
}
.crop-dialog.is-busy .crop-stage,
.crop-dialog.is-busy .crop-actions,
.crop-dialog.is-busy .crop-title,
.crop-dialog.is-busy .crop-hint {
  opacity: 0.45;
  pointer-events: none;
}
.crop-upload-busy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: inherit;
  background: rgba(17, 24, 39, 0.88);
  backdrop-filter: blur(2px);
}
html[data-theme="light"] .crop-upload-busy {
  background: rgba(255, 255, 255, 0.92);
}
.crop-upload-busy-text {
  margin: 0;
  font-size: 0.95rem;
  text-align: center;
  color: var(--text);
}
.upload-spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: upload-spin 0.75s linear infinite;
}
@keyframes upload-spin {
  to { transform: rotate(360deg); }
}
.profile-upload-feedback-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.35);
}
.profile-upload-feedback-card {
  width: min(100%, 20rem);
  padding: 1.15rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  text-align: center;
}
.profile-upload-feedback-card.is-error { border-color: var(--danger); }
.profile-upload-feedback-card.is-success { border-color: var(--ok); }
.profile-upload-feedback-card.is-pending { border-color: var(--accent-warm, #fbbf24); }
.profile-upload-feedback-card.is-pending .profile-upload-feedback-title { color: var(--accent-warm, #fbbf24); }
.profile-upload-feedback-preview {
  margin: 0 auto 0.75rem;
  width: 96px;
  height: 96px;
}
.profile-upload-feedback-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.profile-upload-feedback-card.is-error .profile-upload-feedback-title { color: var(--danger); }
.profile-upload-feedback-card.is-success .profile-upload-feedback-title { color: var(--ok); }
.profile-upload-feedback-msg {
  margin: 0 0 1rem;
  line-height: 1.45;
  text-align: left;
}
.profile-upload-feedback-card .btn-primary {
  width: 100%;
}
.crop-title { margin: 0 0 0.35rem; font-size: 1.1rem; }
.crop-hint { margin: 0 0 1rem; font-size: 0.9rem; }
.crop-stage {
  display: flex;
  justify-content: center;
  border-radius: 8px;
  background: #000;
  margin-bottom: 1rem;
  padding: 0.5rem;
}
.crop-img-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  user-select: none;
  touch-action: none;
}
.crop-img-wrap img {
  display: block;
  max-width: min(100%, 360px);
  max-height: min(60vh, 360px);
  width: auto;
  height: auto;
}
.crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}
.crop-box:active { cursor: grabbing; }
.crop-actions { justify-content: flex-end; gap: 0.5rem; }
[x-cloak] { display: none !important; }
.avatar {
  display: block;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  border: 2px solid var(--border);
  flex-shrink: 0;
}
img.avatar {
  display: block;
}
.avatar.profile-upload-feedback-emoji {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.75rem;
  line-height: 1;
}
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--accent);
}
.profile-name { margin: 0 0 0.25rem; font-size: 1.5rem; }
.profile-bio { margin: 1rem 0 1.5rem; white-space: pre-wrap; }
.profile-field { margin-bottom: 1rem; }
.profile-field label { display: block; font-weight: 500; margin-bottom: 0.35rem; }
.profile-field-row input,
.profile-field-row textarea,
.profile-field input:not(.profile-field-row input) {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.profile-page-list { margin: 0; padding-left: 1.25rem; }
.profile-page-list li { margin-bottom: 0.35rem; }

main.plans-main { max-width: 1120px; }
main.about-main { max-width: 720px; margin: 0 auto; padding: 1.5rem; }
.about-body { line-height: 1.6; }
.about-body p { margin: 0 0 1rem; }

.site-footer {
  margin-top: 3rem;
  border-top: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text);
}
.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2.25rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem 2rem;
  align-items: start;
}
.site-footer-heading {
  margin: 0 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-footer-wordmark {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.site-footer-wordmark span { color: var(--accent); }
html[data-theme="light"] .site-footer-wordmark { color: var(--text); }
.site-footer-logo-link {
  display: block;
  margin-top: 1.25rem;
  max-width: 100%;
}
.site-footer-logo {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}
.site-footer-tagline {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}
.site-footer-blurb {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}
.site-footer-links,
.site-footer-contact,
.site-footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer-links li,
.site-footer-contact li,
.site-footer-social li {
  margin: 0 0 0.65rem;
}
.site-footer-links a,
.site-footer-contact a,
.site-footer-social a {
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.15rem 0;
  display: inline-block;
  transition: color 0.15s ease;
}
.site-footer-links a:hover,
.site-footer-contact a:hover,
.site-footer-social a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-footer-contact li { color: var(--muted); font-size: 0.95rem; }
.site-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.site-footer-social li { margin: 0; }
.site-footer-social a {
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.site-footer-social a:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.site-footer-cta {
  display: inline-block;
  margin-bottom: 1.25rem;
  min-height: 2.75rem;
  line-height: 1.2;
  padding: 0.65rem 1.25rem;
}
.site-footer-bar {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.site-footer-copy {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
}
.site-footer-legal a {
  font-size: 0.88rem;
  color: var(--muted);
}
.site-footer-legal a:hover { color: var(--accent); }

@media (max-width: 960px) {
  .site-footer-inner {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .site-footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 560px) {
  .site-footer-inner {
    grid-template-columns: 1fr;
    padding-top: 2rem;
    gap: 2rem;
  }
  .site-footer-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: 1.75rem;
  margin-bottom: 0;
}
.plan-popular {
  position: absolute;
  top: -0.55rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #6366f1;
  color: #fff;
  border: none;
  white-space: nowrap;
}
.plan-card-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  text-align: center;
  letter-spacing: 0.02em;
}
.plan-card-blurb {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
}
.price-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 1rem 0 0.5rem;
}
.price-tip-wrap { position: relative; }
.price-sku-btn {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.price-sku-btn:not(.btn-primary) {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}
.price-sku-btn:hover { filter: brightness(1.08); text-decoration: none; }
.price-sku-btn.price-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.price-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 20;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease, visibility 0s linear 0.35s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.price-tip-wrap:hover .price-tip {
  visibility: visible;
  opacity: 1;
  transition-delay: 0.35s;
}
.price-sku.panel { margin-top: 0.75rem; padding: 1rem; }

input, select, textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 100px; resize: vertical; }

.row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 0.75rem; }
.row > * { flex: 1; min-width: 140px; }
.row input:not([type="checkbox"]):not([type="radio"]), .row select { width: auto; min-width: 0; }
.row .btn, .row button { flex: 0 0 auto; min-width: auto; }
.row.row-actions { justify-content: flex-end; margin-top: 0.25rem; }
.row.row-actions > * { flex: 0 0 auto; min-width: auto; }
.order-btns { display: inline-flex; gap: 0.2rem; }
.order-btns .btn { min-width: auto; padding: 0.2rem 0.45rem; }
.row.row-limits > label { flex: 1 1 10rem; min-width: 10rem; }

.limit-stack { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.limit-row {
  display: grid;
  grid-template-columns: 1.5rem 7.5rem minmax(6rem, 1fr) auto;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.limit-row.is-off,
.price-off { opacity: 0.45; }
.limit-row.is-off .limit-controls { pointer-events: none; }
.limit-row label { margin: 0; }
.limit-row input[type="checkbox"] { width: auto; margin: 0; }
.limit-row input[type="number"] { width: 100%; }
.hint { cursor: help; border-bottom: 1px dotted var(--muted); }

.error { color: var(--danger); font-size: 0.9rem; margin: 0.5rem 0; }
.muted { color: var(--muted); font-size: 0.9rem; }

.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}
.table th { color: var(--muted); font-weight: 500; }
.table input[type="checkbox"] { width: auto; }

.plan-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg);
}
.plan-notice-icon {
  font-size: 1.4rem;
  line-height: 1;
  margin-top: 0.1rem;
}
.plan-notice-body p { margin: 0 0 0.9rem; color: var(--text); }
.plan-notice-body .btn { display: inline-block; padding: 0.45rem 1.1rem; font-size: 0.9rem; }

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
}
.badge-ok { border-color: var(--accent-dim); color: var(--accent); }
.badge-warn { border-color: #fbbf24; color: #fbbf24; }

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 0.85rem;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.status-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.status-toggle button {
  appearance: none;
  background: var(--bg);
  border: none;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}
.status-toggle button + button {
  border-left: 1px solid var(--border);
}
.status-toggle button.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
}
.status-toggle button.active.is-live {
  color: var(--accent);
}

.edit-body {
  display: grid;
  grid-template-columns: 1fr 12.5rem;
  gap: 0.75rem;
  align-items: start;
}
.edit-assets {
  margin: 0;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: sticky;
  top: calc(3.5rem + 0.75rem);
  min-width: 0;
}
.edit-assets-heading {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.edit-assets-list + .edit-assets-list { margin-top: 0.25rem; }
.edit-asset-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}
.edit-assets .btn-add {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 0.3rem 0.35rem;
  font-size: 0.75rem;
}
.edit-assets .btn-add svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}
.edit-assets-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.edit-assets-list li { margin: 0; }
.edit-asset-item {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.2rem;
  min-width: 0;
}
.edit-asset-x {
  flex: 0 0 auto;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.7rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}
.edit-asset-x:hover { color: var(--danger); }
.edit-asset-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  overflow: hidden;
  margin: 0;
  padding: 0.2rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.edit-asset-row:hover {
  background: var(--bg);
}
.edit-asset-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.85rem;
  height: 0.85rem;
  position: relative;
  top: 0.1rem;
  color: var(--muted);
}
.edit-asset-icon svg {
  width: 1rem;
  height: 1rem;
}
.edit-asset-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-tool-pick {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.edit-tool-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.edit-tool-pick-btn:hover { border-color: var(--accent); }
.edit-tool-pick-btn strong { font-size: 0.95rem; }
.edit-tool-pick-btn .muted { font-size: 0.8rem; }

.edit-workspace .panel { margin-top: 0; }
.edit-page-header .edit-page-title {
  flex: 1 1 12rem;
  max-width: 28rem;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  background: transparent;
}
.edit-page-header .edit-page-title:hover:not(:disabled),
.edit-page-header .edit-page-title:focus:not(:disabled) {
  border-color: var(--border);
  background: var(--bg);
}
.edit-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.edit-tab-bar .tab-btn { font-size: 0.9rem; }

.page-images-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0 1rem;
}
.page-images-upload input[type="text"] { flex: 1; min-width: 12rem; }
.modal-card .page-images-upload {
  flex-direction: column;
  align-items: stretch;
  margin: 0.5rem 0 0;
}
.modal-card .page-images-upload input[type="text"],
.modal-card .page-images-upload input[type="file"] {
  min-width: 0;
  width: 100%;
}
.page-images-upload input[type="file"] {
  flex: 1;
  min-width: 12rem;
  color: var(--text);
}
.page-image-thumb-cell { width: 3.5rem; padding: 0.35rem; }
.page-image-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}

.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.tool-row label {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 5rem;
}
.tool-row select {
  flex: 1;
  min-width: 10rem;
  max-width: 100%;
}

.helper-list { margin-top: 1rem; }
.helper-list-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.helper-list-item:last-child { border-bottom: none; }
.helper-list-item .helper-meta { min-width: 0; }
.helper-list-item strong { display: block; margin-bottom: 0.25rem; }
.helper-list-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
}
.html-editor {
  width: 100%;
  min-height: 360px;
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
}
.tool-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.5rem; }
.tag-chip { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
button.tag-chip { flex: 0 0 auto; min-width: auto; }
.vh-tool-preview { color: var(--muted); font-size: 0.85rem; margin: 0.25rem 0; }

.chat-actions { margin: 0.75rem 0; }
.chat-see-more { margin: 0 0 0.75rem; }
.chat-log {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  margin: 0 0 0.75rem;
  background: var(--bg);
  font-size: 0.85rem;
}
.chat-log-empty {
  margin: 0;
  font-size: 0.85rem;
  font-style: italic;
}
.msg { margin-bottom: 0.5rem; }
.msg.user { color: var(--accent); }
.msg.assistant { color: var(--muted); }

.preview {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.draft-preview-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.draft-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}
.badge-draft {
  border-color: var(--danger);
  color: var(--danger);
  font-weight: 600;
}
.draft-preview-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}
.draft-preview-return {
  flex-shrink: 0;
  font-size: 0.9rem;
  font-weight: 500;
}
.draft-preview-frame-wrap {
  flex: 1;
  min-height: 0;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
}
.draft-preview-error {
  margin: 1rem;
}
.draft-preview-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 3px solid var(--danger);
  border-radius: 8px;
  background: #fff;
}
.draft-preview-iframe.is-live {
  border-color: var(--accent);
}

.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 3.5rem);
  align-items: start;
}
.app-shell.nav-collapsed { grid-template-columns: 3rem 1fr; }
.app-shell main {
  max-width: none;
  margin: 0;
  min-width: 0;
}

.side-menu {
  margin: 1rem 0 1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(3.5rem + 0.75rem);
  overflow: hidden;
}
.side-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid var(--border);
}
.app-shell.nav-collapsed .side-menu-toggle {
  justify-content: center;
  border-bottom: none;
}
.app-shell.nav-collapsed .side-menu-title { display: none; }
.side-menu-toggle button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
}
.side-menu-toggle button:hover { color: var(--text); border-color: var(--muted); }
.side-menu-title {
  margin: 0;
  padding: 0 0.35rem 0 0.5rem;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}
.side-nav {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.35rem;
}
.side-nav a,
.side-nav button.side-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}
.side-nav a:hover,
.side-nav button.side-nav-btn:hover {
  background: var(--bg);
  text-decoration: none;
}
.side-nav a.active {
  border-color: var(--accent-dim);
  color: var(--accent);
}
.side-nav button.side-nav-btn { color: var(--muted); }
.side-nav button.side-nav-btn:hover { color: var(--text); }
.side-nav-section {
  margin: 0.7rem 0.25rem 0.2rem;
  padding: 0.55rem 0.75rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-nav-section:first-child {
  margin-top: 0.2rem;
  border-top: none;
  padding-top: 0;
}

.table tr.row-active td {
  background: var(--bg);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1.25rem 0;
}
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.stat-box {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}
.stat-box:hover {
  border-color: var(--accent-dim);
  text-decoration: none;
}
.stat-box .stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-box .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.35rem;
  color: var(--accent);
}
.stat-box .stat-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}
.bar-chart {
  width: 100%;
  max-width: 480px;
  height: 80px;
  color: var(--accent);
}
.visit-detail {
  padding: 0.75rem 0 0.5rem 1rem;
  border-left: 2px solid var(--border);
  margin: 0.5rem 0 1rem;
}
.breakdown-list {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0;
  font-size: 0.85rem;
}
.breakdown-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.2rem 0;
}

@media (max-width: 768px) {
  .app-shell,
  .app-shell.nav-collapsed {
    grid-template-columns: 1fr;
  }
  .side-menu {
    margin: 0.75rem 0.75rem 0;
    position: static;
  }
  .edit-body {
    grid-template-columns: 1fr;
  }
  .edit-assets {
    position: static;
  }
}

.signup-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
}
.signup-terms input[type="checkbox"] { width: auto; margin: 0.2rem 0 0; flex-shrink: 0; }
.signup-terms a { white-space: nowrap; }

body.modal-open { overflow: hidden; }
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden],
.waitlist-terms-overlay[hidden] {
  display: none !important;
}
.modal-card {
  width: min(32rem, 100%);
  max-height: calc(100vh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.signup-terms-modal h3 { margin-top: 0; }
.signup-terms-body { font-size: 0.95rem; line-height: 1.55; }
.signup-terms-actions { margin: 1rem 0 0; text-align: right; }
.waitlist-label { display: block; margin: 0.9rem 0 0.3rem; font-size: 0.9rem; }
.waitlist-intent { border: 0; margin: 0.2rem 0 0; padding: 0; }
.waitlist-intent legend { padding: 0; margin: 0 0 0.4rem; }
.waitlist-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.45rem 0;
  cursor: pointer;
}
.waitlist-option input { width: auto; margin: 0; flex-shrink: 0; accent-color: var(--accent-dim); cursor: pointer; }
.waitlist-terms-row { align-items: flex-start; margin-top: 0.9rem; font-size: 0.92rem; }
.waitlist-terms-row input { margin-top: 0.2rem; }
.waitlist-actions { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.waitlist-error { color: var(--danger); }
.waitlist-modal-card .waitlist-terms-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  max-height: none;
  overflow: auto;
}
.waitlist-modal-card { position: relative; }
