/* APRS Radio Online — layout and components (light/dark) */

* {
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e8f0;
  --success: #059669;
  --error: #dc2626;
  --error-hover: #b91c1c;
  --warning: #d97706;
  --info: #0284c7;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  /* Standard button size (same for .btn, .btn-secondary, .btn-primary, .btn-danger) */
  --btn-padding-y: 10px;
  --btn-padding-x: 18px;
  --btn-font-size: 0.95rem;
  --btn-min-height: 40px;
  --btn-line-height: 1.25;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-elevated: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --border: #334155;
  --success: #10b981;
  --error: #ef4444;
  --error-hover: #dc2626;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Outfit", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
}

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

a:hover {
  text-decoration: underline;
}

.nav-links a:hover, .nav-right a:hover, .btn:hover, .btn-secondary:hover, .btn-primary:hover {
  text-decoration: none;
}

/* -------------------------------------------------------------------------- */
/* Nav                                                                        */
/* -------------------------------------------------------------------------- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  background: var(--bg-elevated);
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav-brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

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

.nav-link-with-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  background: var(--error);
  border-radius: 9px;
  text-decoration: none;
}

.nav-link-with-badge:hover .nav-badge {
  background: var(--error-hover);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-right a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.nav-user-callsign {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.nav-admin-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--bg);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--bg);
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: inline-block; }
[data-theme="dark"] .icon-sun { display: inline-block; }
[data-theme="dark"] .icon-moon { display: none; }

/* -------------------------------------------------------------------------- */
/* Container & cards                                                          */
/* -------------------------------------------------------------------------- */

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* Admin page uses wider container (90% width, max 95%) */
.container.admin-container {
  width: 90%;
  max-width: 95%;
  margin: 0 auto;
  padding: 24px 20px;
}

@media (max-width: 1400px) {
  .container.admin-container {
    width: 95%;
  }
}

@media (max-width: 768px) {
  .container.admin-container {
    width: 100%;
    padding: 16px;
  }
}

/* Instance detail page uses wider container for packets view */
.container.instance-container {
  width: 95%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
}

@media (max-width: 1200px) {
  .container.instance-container {
    width: 98%;
  }
}

@media (max-width: 768px) {
  .container.instance-container {
    width: 100%;
    padding: 16px;
  }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card h1, .card h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.card h2 {
  font-size: 1.1rem;
}

.terms-card {
  max-width: 640px;
}

.terms-intro {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.terms-section {
  margin-bottom: 20px;
}

.terms-section h2 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.terms-section p {
  margin: 0;
  color: var(--text);
}

.terms-back {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Landing                                                                    */
/* -------------------------------------------------------------------------- */

.landing-hero {
  text-align: center;
  margin-bottom: 32px;
}

.landing-hero h1 {
  margin: 0 0 12px;
  font-size: 2rem;
}

.tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

.landing-diagram {
  margin: 16px 0 0;
}

.landing-diagram svg {
  max-width: 100%;
  height: auto;
}

.landing-diagram figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.landing-desc h2 {
  margin-top: 24px;
  margin-bottom: 8px;
}

.landing-desc h2:first-of-type {
  margin-top: 0;
}

.landing-cta {
  margin-top: 24px;
  margin-bottom: 0;
}

/* Landing page (Cursor-style layout) */
.landing-page {
  padding-bottom: 48px;
}

.landing-hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 48px;
  gap: 40px;
}

.landing-hero-inner {
  max-width: 640px;
  margin: 0;
}

.landing-hero-title {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.landing-hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

.landing-hero-services {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 32px;
}

.landing-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* -------------------------------------------------------------------------- */
/* Hero gradient section (ngrok-inspired)                                     */
/* -------------------------------------------------------------------------- */

.landing-hero-gradient {
  position: relative;
  padding: 80px 24px 120px;
  /* Break out of container to full viewport width */
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  margin-top: -24px;
  margin-bottom: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 30%, #312e81 60%, #1e1b4b 85%, var(--bg) 100%);
}

/* Animated gradient orbs */
.landing-hero-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: hero-float 8s ease-in-out infinite;
  pointer-events: none;
}

.landing-hero-gradient-orb--left {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  top: -100px;
  left: -100px;
}

.landing-hero-gradient-orb--right {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  bottom: 50px;
  right: -150px;
  animation-delay: -4s;
}

@keyframes hero-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

/* Grid pattern overlay */
.landing-hero-gradient .landing-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.landing-hero-title-large {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 24px;
}

/* Gradient text effect for hero headline */
.landing-hero-gradient-text {
  background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 30%, #f0abfc 60%, #fda4af 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.landing-hero-tagline-large {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero buttons with glow effect */
.btn-hero-primary,
.btn-hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.btn-hero-primary {
  background: #fff;
  color: #1e1b4b;
  border: none;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.btn-hero-primary:hover {
  background: #f0f0ff;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  text-decoration: none;
}

.btn-hero-secondary {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}

/* Light theme adjustments for hero */
[data-theme="light"] .landing-hero-gradient {
  background: linear-gradient(180deg, #1e3a8a 0%, #3730a3 30%, #4f46e5 60%, #3730a3 85%, var(--bg) 100%);
}

@media (max-width: 768px) {
  .landing-hero-gradient {
    padding: 60px 20px 100px;
    /* Keep full-width on mobile too */
  }

  .landing-hero-gradient-orb--left {
    width: 250px;
    height: 250px;
  }

  .landing-hero-gradient-orb--right {
    width: 300px;
    height: 300px;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
}

/* Two hero panels side by side */
.landing-hero-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  max-width: 720px;
  align-items: start;
}

.landing-hero-visual {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 160px;
  flex-shrink: 0;
}

/* Hero preview panel: looks like the app’s “My instances” table */
.landing-hero-preview {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  min-width: 320px;
  max-width: 100%;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.landing-hero-preview-title {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.landing-hero-preview-table {
  display: flex;
  flex-direction: column;
}

.landing-hero-preview-row {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.8fr 0.7fr;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.9rem;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.landing-hero-preview-row:last-child {
  border-bottom: none;
}

.landing-hero-preview-header {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
}

.landing-hero-preview-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.landing-hero-preview-icon {
  flex-shrink: 0;
  color: var(--accent);
}

.landing-hero-preview-status {
  color: var(--success);
  font-weight: 500;
}

.landing-hero-preview-caption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* Instance view hero preview: uses same .card, .badge, .form-actions, .tabs as real instance detail */
.landing-hero-instance-card {
  min-width: 0;
  width: 100%;
}

.landing-hero-instance-card .form-actions-row {
  gap: 8px;
}

.landing-hero-instance-card .tabs-content {
  display: none;
}

/* Webchat screenshot hero: full-width row below the two panels */
.landing-hero-webchat {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 800px;
  justify-self: center;
}

.landing-hero-webchat-link {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-elevated);
}

.landing-hero-webchat-link:hover {
  border-color: var(--accent);
}

.landing-hero-webchat-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

@media (max-width: 700px) {
  .landing-hero-visuals {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .landing-hero-webchat {
    grid-column: 1;
  }
}

.landing-trusted {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 48px 0;
}

.landing-feature {
  margin-bottom: 48px;
}

.landing-feature-alt {
  background: var(--bg-elevated);
  margin-left: -20px;
  margin-right: -20px;
  padding: 32px 20px;
  border-radius: var(--radius);
}

.landing-feature-highlight {
  background: var(--bg-elevated);
  margin-left: -20px;
  margin-right: -20px;
  padding: 32px 20px;
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  position: relative;
}

.landing-feature-highlight::before {
  content: "New";
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.landing-feature-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  max-width: 960px;
  margin: 0 auto;
}

.landing-feature-inner.landing-feature-reverse {
  direction: rtl;
}

.landing-feature-inner.landing-feature-reverse > * {
  direction: ltr;
}

.landing-feature-inner.landing-feature-column {
  grid-template-columns: 1fr;
  direction: ltr;
  text-align: center;
}

.landing-feature-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.landing-feature-title-center {
  text-align: center;
}

.landing-feature-desc {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

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

.landing-feature-link:hover {
  text-decoration: underline;
}

.landing-feature-figure {
  margin: 0;
}

.landing-screenshot {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.landing-screenshot-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.landing-screenshot-body {
  padding: 16px 14px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.landing-screenshot-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.landing-screenshot-row:last-child {
  border-bottom: none;
}

.landing-screenshot-chat {
  margin: 0;
  font-style: italic;
}

.landing-screenshot-caption {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.landing-feature-screenshot-link {
  display: block;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--bg-elevated);
}

.landing-feature-screenshot-link:hover {
  border-color: var(--accent);
}

.landing-feature-screenshot-img {
  display: block;
  width: 100%;
  height: auto;
}

.landing-diagram {
  margin: 24px auto 0;
  max-width: 620px;
}

.landing-diagram svg {
  max-width: 100%;
  height: auto;
}

.landing-diagram-svg {
  color: var(--text-muted);
}

.landing-diagram-svg .diag-box {
  fill: var(--bg-elevated);
  stroke: var(--border);
  stroke-width: 1.5;
}

.landing-diagram-svg .diag-box-success {
  stroke: var(--success);
}

.landing-diagram-svg .diag-box-accent {
  stroke: var(--accent);
}

.landing-diagram-svg .diag-text {
  fill: var(--text);
}

.landing-diagram-svg .diag-muted {
  fill: var(--text-muted);
}

.landing-diagram-svg .diag-line {
  stroke: var(--text-muted);
}

.landing-diagram-svg .diag-success {
  fill: var(--success);
}

.landing-diagram-svg .diag-accent {
  fill: var(--accent);
}

.landing-diagram-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Network flow diagram (wider) */
.landing-diagram-wide {
  max-width: 900px;
}

.landing-network-svg {
  color: var(--text-muted);
}

.landing-network-svg .diag-box {
  fill: var(--bg-elevated);
  stroke: var(--border);
  stroke-width: 2;
}

.landing-network-svg .diag-box-cloud {
  fill: var(--bg-elevated);
  stroke: var(--border);
  stroke-width: 2;
  stroke-dasharray: 4,2;
}

.landing-network-svg .diag-box-accent {
  stroke: var(--accent);
  stroke-width: 2.5;
}

.landing-network-svg .diag-text {
  fill: var(--text);
}

.landing-network-svg .diag-muted {
  fill: var(--text-muted);
}

.landing-network-svg .diag-accent {
  fill: var(--accent);
}

.landing-network-svg .diag-line {
  stroke: var(--text-muted);
}

.landing-network-svg .diag-line-internet {
  stroke: var(--accent);
  opacity: 0.7;
}

.landing-network-svg .diag-flow-forward {
  stroke: var(--success);
}

.landing-network-svg .diag-flow-return {
  stroke: var(--info);
}

.landing-network-svg .diag-icon {
  stroke: var(--text-muted);
  fill: none;
}

.landing-network-svg .diag-icon[fill="currentColor"] {
  fill: var(--text-muted);
}

.landing-network-svg .diag-icon-accent {
  stroke: var(--accent);
}

.landing-network-svg .diag-icon-accent[fill="currentColor"] {
  fill: var(--accent);
}

/* Responsive: stack or simplify on smaller screens */
@media (max-width: 768px) {
  .landing-diagram-wide {
    max-width: 100%;
    overflow-x: auto;
  }

  .landing-network-svg {
    min-width: 700px;
  }
}

.landing-quote-section {
  margin-bottom: 48px;
  padding: 32px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.landing-quote-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.landing-quote-title {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
}

.landing-quote-text {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.landing-cta-section {
  text-align: center;
  padding: 32px 0;
}

.landing-cta-inner {
  max-width: 480px;
  margin: 0 auto;
}

.landing-cta-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.landing-cta-desc {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.landing-cta-desc a {
  color: var(--accent);
}

.landing-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.landing-admin-note {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 24px;
}

@media (max-width: 768px) {
  .landing-feature-inner {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 20px;
  }

  .landing-feature-inner.landing-feature-reverse {
    direction: ltr;
  }

  .landing-feature-figure {
    order: -1;
  }

  .landing-feature-alt {
    margin-left: 0;
    margin-right: 0;
    padding: 24px 16px;
  }
}

/* -------------------------------------------------------------------------- */
/* Pricing                                                                    */
/* -------------------------------------------------------------------------- */

.pricing-page {
  max-width: 900px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 40px;
}

.pricing-header h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  color: var(--text);
}

.pricing-tagline {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.pricing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.pricing-card-featured {
  border: 2px solid var(--accent);
  position: relative;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .pricing-card-featured {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.pricing-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.pricing-card-icon {
  color: var(--accent);
}

.pricing-card-desc {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pricing-card-price {
  margin: 0 0 20px;
}

.pricing-card-amount {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.pricing-card-period {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-card-features {
  margin: 0 0 24px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.pricing-card-features li {
  margin-bottom: 6px;
}

.pricing-card-cta {
  margin-top: auto;
  width: 100%;
}

.pricing-notes h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--text);
}

.pricing-notes ul {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-muted);
  line-height: 1.6;
}

.pricing-notes-extra {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.pricing-notes-extra a {
  color: var(--accent);
}

/* -------------------------------------------------------------------------- */
/* Forms                                                                      */
/* -------------------------------------------------------------------------- */

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
}

.form-group-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.form-group-checkbox label {
  display: inline;
  margin-bottom: 0;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="checkbox"],
select,
textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.input-with-action {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.input-with-action input {
  flex: 1;
  min-width: 0;
}

.help, .help-text {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.error {
  display: block;
  font-size: 0.875rem;
  color: var(--error);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

/* Single row of instance action buttons (Deploy, Restart, Stop, etc.) so alignment is consistent with or without payment box */
.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.form-actions-inline {
  margin: 0;
}

.form-inline {
  display: inline;
}

.form-inline button, .form-inline input {
  display: inline;
}

/* -------------------------------------------------------------------------- */
/* Buttons                                                                    */
/* -------------------------------------------------------------------------- */

/* Base: same dimensions for all primary/secondary/danger buttons (and <a> vs <button>) */
.btn,
.btn-secondary,
.btn-primary,
.btn-danger {
  display: inline-block;
  min-height: var(--btn-min-height);
  padding: var(--btn-padding-y) var(--btn-padding-x);
  font-family: inherit;
  font-size: var(--btn-font-size);
  font-weight: 600;
  line-height: var(--btn-line-height);
  text-decoration: none;
  text-align: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  box-sizing: border-box;
  vertical-align: middle;
}

/* <a> with .btn: remove default underline, match button appearance */
a.btn,
a.btn-secondary,
a.btn-primary,
a.btn-danger {
  line-height: var(--btn-line-height);
}

.btn, .btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn:hover, .btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn:disabled,
.btn[disabled],
.btn-primary:disabled,
.btn-primary[disabled] {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

.btn:disabled:hover,
.btn[disabled]:hover,
.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
  background: var(--border);
  color: var(--text-muted);
}

.btn-secondary {
  background: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--text-muted);
  color: #fff;
}

.btn-secondary:disabled,
.btn-secondary[disabled] {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-secondary:disabled:hover,
.btn-secondary[disabled]:hover {
  background: var(--border);
  color: var(--text-muted);
}

.btn-link {
  display: inline;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link:disabled,
.btn-link[disabled] {
  color: var(--text-muted);
  cursor: not-allowed;
  text-decoration: none;
}

.btn-link:disabled:hover,
.btn-link[disabled]:hover {
  text-decoration: none;
}

.btn-link-danger {
  color: var(--error);
}

.btn-link-danger:hover {
  text-decoration: underline;
}

.btn-danger {
  background: var(--error);
  color: #fff;
}

.btn-danger:hover {
  background: var(--error-hover);
  color: #fff;
}

.btn-danger:disabled,
.btn-danger[disabled] {
  background: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-danger:disabled:hover,
.btn-danger[disabled]:hover {
  background: var(--border);
  color: var(--text-muted);
}

/* Small button variant (e.g. inline actions, beacon, Refresh); same proportions, smaller size */
.btn-sm,
.btn-sm.btn-secondary,
.btn-sm.btn-primary,
.btn-sm.btn-danger {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 0.85rem;
}

/* -------------------------------------------------------------------------- */
/* Alerts                                                                     */
/* -------------------------------------------------------------------------- */

.alert {
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 6px;
  border: 1px solid;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

[data-theme="dark"] .alert-error {
  background: #450a0a;
  color: #fecaca;
  border-color: #7f1d1d;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

[data-theme="dark"] .alert-warning {
  background: #451a03;
  color: #fde68a;
  border-color: #78350f;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

[data-theme="dark"] .alert-info {
  background: #1e3a8a;
  color: #bfdbfe;
  border-color: #1e40af;
}

.plugin-upgrade-alert {
  margin-left: 6px;
}
.plugin-upgrade-alert a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.plugin-upgrade-alert a:hover {
  text-decoration: underline;
}

.admin-nav-count,
.admin-unhealthy-alert-nav {
  position: relative;
}

.admin-nav-count {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius);
}

.admin-nav-count:hover {
  color: var(--accent);
  background: var(--bg-elevated);
}

.admin-nav-tooltip {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 6px;
  width: 280px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  white-space: normal;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.08s ease-out, visibility 0.08s ease-out;
  z-index: 1000;
  box-sizing: border-box;
}

.admin-nav-has-tooltip:hover .admin-nav-tooltip {
  opacity: 1;
  visibility: visible;
}

.admin-nav-count-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: inherit;
}

.admin-nav-count-icon .instance-type-icon__svg {
  width: 20px;
  height: 20px;
}

.admin-nav-count-num {
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-unhealthy-alert-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--warning);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: var(--radius);
}

.admin-unhealthy-alert-nav:hover {
  color: var(--warning);
  background: var(--bg-elevated);
}

.admin-unhealthy-alert-icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--warning);
}

.admin-unhealthy-alert-nav-count {
  font-weight: 600;
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------------- */
/* Tables                                                                     */
/* -------------------------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.875rem;
}

tr:last-child td {
  border-bottom: none;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.plugins-table {
  min-width: 1000px;
}

.plugins-table th:nth-child(1),
.plugins-table td:nth-child(1) {
  min-width: 120px;
}

.plugins-table th:nth-child(2),
.plugins-table td:nth-child(2) {
  min-width: 300px;
}

.plugins-table th:nth-child(6),
.plugins-table td:nth-child(6) {
  min-width: 150px;
  max-width: 250px;
}

.plugins-table th:nth-child(8),
.plugins-table td:nth-child(8) {
  min-width: 80px;
  white-space: nowrap;
}

.plugins-table tr.plugin-pkg-header td {
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.plugins-table tr.plugin-pkg-header .plugin-pkg-name {
  font-family: var(--font-mono);
}

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-truncate code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

/* Links cell with mini charts: stack chart above action links */
.row-actions.row-actions-with-chart {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px 0;
}

.row-actions.row-actions-with-chart .row-actions-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

/* Inline instance stats (CPU / memory / network) mini charts above action links */
.inline-instance-chart {
  display: inline-flex;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.inline-instance-chart .chart-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.inline-instance-chart .mini-bar {
  width: 36px;
  height: 6px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.inline-instance-chart .mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.2s ease;
}

.inline-instance-chart .mini-bar-fill.cpu {
  background: var(--accent);
}

.inline-instance-chart .mini-bar-fill.mem {
  background: var(--text-muted);
}

.inline-instance-chart .mini-bar-fill.net {
  background: var(--info);
}

.inline-instance-chart .chart-value {
  min-width: 2.8em;
  font-variant-numeric: tabular-nums;
}

/* Tiny spinner shown while instance stats are loading */
.inline-chart-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: inline-chart-spin 0.7s linear infinite;
}

@keyframes inline-chart-spin {
  to {
    transform: rotate(360deg);
  }
}

.instances-stats-timer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-action:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--text-muted);
  text-decoration: none;
}

.icon-action.icon-edit:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.icon-action.icon-delete {
  color: var(--error);
  border-color: var(--error);
}

.icon-action.icon-delete:hover {
  color: var(--error-hover);
  border-color: var(--error-hover);
}

.icon-action.icon-sync:hover {
  color: var(--success);
  border-color: var(--success);
}

.icon-action svg {
  display: block;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-tab {
  padding: 10px 16px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.admin-tab:hover {
  color: var(--text);
}

.admin-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* -------------------------------------------------------------------------- */
/* Instance type icons                                                        */
/* -------------------------------------------------------------------------- */

.instance-type-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.instance-type-icon__svg {
  width: 1.125em;
  height: 1.125em;
  flex-shrink: 0;
  fill: currentColor;
}

.instance-type-icon--muted .instance-type-icon__svg {
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Badges                                                                     */
/* -------------------------------------------------------------------------- */

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 4px;
}

.badge-draft { background: #f1f5f9; color: #475569; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-active { background: #d1fae5; color: #047857; }
.badge-expired { background: #fee2e2; color: #b91c1c; }
.badge-suspended, .badge-cancelled, .badge-failed { background: #f1f5f9; color: #64748b; }

.badge-health-healthy { background: #d1fae5; color: #047857; }
.badge-health-unhealthy { background: #fee2e2; color: #b91c1c; }
.badge-health-starting { background: #fef3c7; color: #92400e; }

[data-theme="dark"] .badge-draft { background: #334155; color: #94a3b8; }
[data-theme="dark"] .badge-pending { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .badge-active { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-expired { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-suspended,
[data-theme="dark"] .badge-cancelled,
[data-theme="dark"] .badge-failed { background: #334155; color: #94a3b8; }

[data-theme="dark"] .badge-health-healthy { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-health-unhealthy { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .badge-health-starting { background: #451a03; color: #fcd34d; }

/* -------------------------------------------------------------------------- */
/* Pre / code                                                                 */
/* -------------------------------------------------------------------------- */

pre, code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.9em;
}

.pre-scroll {
  max-height: 70vh;
  overflow: auto;
  padding: 16px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

code {
  padding: 2px 6px;
  background: var(--border);
  border-radius: 4px;
  font-size: 0.9em;
}

[data-theme="dark"] code {
  background: #334155;
}

/* -------------------------------------------------------------------------- */
/* Wizard: summary, loading                                                   */
/* -------------------------------------------------------------------------- */

.settings-summary {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.summary-section {
  margin-bottom: 0;
}

.summary-section h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-section dl {
  margin: 0;
  display: block;
}

.summary-section dt {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-muted);
  display: inline;
  margin: 0;
  padding: 0;
}

.summary-section dt::after {
  content: " = ";
  color: var(--text-muted);
  margin: 0 4px;
}

.summary-section dd {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text);
  display: inline;
  word-break: break-word;
}

.summary-section dd::after {
  content: "";
  display: block;
  margin-bottom: 6px;
}

.summary-section .plugins-list {
  margin: 0;
  padding-left: 20px;
  list-style: none;
  font-size: 0.9rem;
  line-height: 1.6;
}

.summary-section .plugins-list li {
  margin-bottom: 4px;
  color: var(--text);
}

.summary-section .plugins-list li::before {
  content: "• ";
  color: var(--text-muted);
  font-weight: bold;
  margin-right: 6px;
}

.summary-section strong {
  display: inline-block;
  min-width: 140px;
}

.step6-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------- */
/* Deploy overlay — full-page spinner during deploy (pay_deploy)               */
/* -------------------------------------------------------------------------- */

.deploy-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(0, 0, 0, 0.65);
}

.deploy-overlay.is-visible {
  display: flex;
}

.deploy-overlay__spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.deploy-overlay__text {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 500;
  color: #fff;
}

.next-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/* Config saving overlay — inline popup when saving instance config           */
/* -------------------------------------------------------------------------- */

.config-saving-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.config-saving-overlay.is-visible {
  display: flex;
}

.config-saving-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px;
  min-width: 280px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.config-saving-overlay__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.config-saving-overlay__text {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

/* -------------------------------------------------------------------------- */
/* Gmail Warning Banner and Modal                                            */
/* -------------------------------------------------------------------------- */

.gmail-warning-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.gmail-warning-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.gmail-warning-link {
  color: var(--warning);
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.gmail-warning-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.65);
  padding: 20px;
}

.modal-content {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.modal-content h2 {
  margin: 0 0 16px 0;
  padding: 24px 24px 0 24px;
  color: var(--text);
  font-size: 1.5rem;
}

.modal-content h3 {
  margin: 20px 0 12px 0;
  color: var(--text);
  font-size: 1.1rem;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  z-index: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 0 24px;
  overflow-y: auto;
  flex: 1;
  color: var(--text);
  line-height: 1.6;
}

.modal-body p {
  margin: 0 0 16px 0;
}

.modal-body ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.modal-body li {
  margin-bottom: 8px;
}

.modal-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-body a {
  color: var(--accent);
  text-decoration: underline;
}

.modal-body a:hover {
  color: var(--accent-hover);
}

.modal-actions {
  padding: 16px 24px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border);
}

/* Email test modal specific styles */
.email-test-modal-content {
  max-width: 700px;
}

.email-test-messages {
  margin-bottom: 16px;
}

.email-test-messages p {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 4px;
  border-left: 3px solid var(--info);
  font-family: monospace;
  font-size: 0.9em;
}

.email-test-messages p.email-test-error-msg {
  border-left-color: var(--error);
  color: var(--error);
}

.email-test-errors {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg);
  border: 1px solid var(--error);
  border-radius: var(--radius);
}

.email-test-error-summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--error);
  padding: 8px;
  user-select: none;
}

.email-test-error-summary:hover {
  background: var(--bg-elevated);
  border-radius: 4px;
}

.email-test-error-details {
  margin-top: 8px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  color: var(--text);
  border: 1px solid var(--border);
}

#email-test-result {
  margin-left: 12px;
  font-weight: 500;
}

#email-test-result.success {
  color: var(--success);
}

#email-test-result.error {
  color: var(--error);
}

/* Pricing invoice display */
.pricing-invoice {
  font-size: 0.95rem;
}

.pricing-invoice table {
  font-family: inherit;
}

.pricing-invoice th,
.pricing-invoice td {
  font-size: 0.95rem;
}

.pricing-invoice tbody tr:last-child {
  border-top: 2px solid var(--border);
}

/* -------------------------------------------------------------------------- */
/* Logs page — full width                                                     */
/* -------------------------------------------------------------------------- */

.logs-page {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 20px;
  box-sizing: border-box;
}

/* -------------------------------------------------------------------------- */
/* Plugins page — 90% width                                                  */
/* -------------------------------------------------------------------------- */

.plugins-page-wrapper {
  width: 90vw;
  max-width: 90vw;
  margin-left: calc(50% - 45vw);
  margin-right: calc(50% - 45vw);
  padding: 0;
  box-sizing: border-box;
}

.plugins-page {
  width: 100%;
  max-width: 100%;
}

.logs-header {
  max-width: 960px;
  margin: 0 auto 16px;
}

.logs-stream-status {
  color: var(--text-muted);
  font-size: 0.9em;
}

.logs-stream-status.live {
  color: var(--success);
}

.logs-container {
  width: 100vw;
  max-width: none;
  max-height: calc(90vh - 198px);
  margin: 0 0 16px;
  margin-left: calc(50% - 50vw);
  padding: 16px 24px;
  background: #1e1e1e;
  color: #d4d4d4;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.45;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #333;
  border-radius: 6px;
  box-sizing: border-box;
}

.logs-page .form-actions {
  max-width: 960px;
  margin: 16px auto 0;
}

/* Sortable table headers (admin instances) */
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

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

.sort-icon {
  font-size: 0.75em;
}

.sort-icon--inactive {
  opacity: 0.5;
}

/* Tabs */
.tabs {
  margin-top: 24px;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tabs-nav-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.tabs-nav-btn:hover {
  color: var(--text);
}

.tabs-nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tabs-panel {
  display: none;
}

.tabs-panel.active {
  display: block;
}

/* Subtabs inside Config tab */
.config-subtab-nav-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.config-subtab-nav-btn:hover {
  color: var(--text);
}

.config-subtab-nav-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.config-subtab-panel {
  display: none;
}

.config-subtab-panel.active {
  display: block;
}

/* Packets table */
.packets-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.packets-table th,
.packets-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.packets-table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
}

.packets-table td {
  color: var(--text-muted);
}

.packets-table code {
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.85em;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.packets-loading,
.plugins-loading,
.debug-stats-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
}

.overview-stats-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.overview-stats-loading .spinner {
  margin: 0 auto;
}

.packets-error,
.plugins-error,
.debug-stats-error {
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--error);
}

.debug-stats-json {
  background: var(--bg-elevated);
  color: var(--text);
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.4;
  font-family: "JetBrains Mono", "Consolas", monospace;
}

/* Plugin statistics */
.plugin-stats-item {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.plugin-stats-item h4 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--text);
}

.plugin-stats-item dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
}

.plugin-stats-item dt {
  font-weight: 600;
  color: var(--text);
}

.plugin-stats-item dd {
  margin: 0;
  color: var(--text-muted);
}

.plugin-stats-item pre {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.85em;
}

/* Refresh countdown */
.refresh-countdown {
  display: flex;
  align-items: center;
  gap: 4px;
}

.refresh-countdown span {
  font-weight: 600;
  color: var(--accent);
}

/* Admin billing: collapsible settings section */
.billing-settings-collapsible summary {
  list-style: none;
}
.billing-settings-collapsible summary::-webkit-details-marker {
  display: none;
}
.billing-settings-collapsible summary::marker {
  content: none;
}
.billing-settings-collapsible[open] .details-chevron {
  transform: rotate(90deg);
}

/* -------------------------------------------------------------------------- */
/* Blog                                                                       */
/* -------------------------------------------------------------------------- */

.blog-page {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.blog-header {
  text-align: center;
  margin-bottom: 40px;
}

.blog-header h1 {
  margin: 0 0 12px;
  font-size: 2rem;
  color: var(--text);
}

.blog-tagline {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.blog-posts {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.blog-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.blog-card-header {
  margin-bottom: 12px;
}

.blog-card-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.3;
}

.blog-card-title a {
  color: var(--text);
  text-decoration: none;
}

.blog-card-title a:hover {
  color: var(--accent);
}

.blog-card-meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.blog-card-author {
  margin-left: 8px;
}

.blog-card-author::before {
  content: "·";
  margin-right: 8px;
}

.blog-card-summary {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

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

.blog-card-link:hover {
  text-decoration: underline;
}

.blog-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 24px;
}

/* Individual blog post */
.blog-post {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.blog-post-header {
  margin-bottom: 32px;
}

.blog-post-back {
  margin: 0 0 16px;
}

.blog-post-back a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.blog-post-back a:hover {
  color: var(--accent);
}

.blog-post-title {
  margin: 0 0 12px;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

.blog-post-meta {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.blog-post-author {
  margin-left: 8px;
}

.blog-post-author::before {
  content: "·";
  margin-right: 8px;
}

/* Blog post content styling */
.blog-post-content {
  line-height: 1.7;
  color: var(--text);
}

.blog-post-content h2 {
  margin: 32px 0 16px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.blog-post-content h3 {
  margin: 24px 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.blog-post-content p {
  margin: 0 0 16px;
}

.blog-post-content ul,
.blog-post-content ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.blog-post-content li {
  margin-bottom: 8px;
}

.blog-post-content a {
  color: var(--accent);
}

.blog-post-content a:hover {
  text-decoration: underline;
}

.blog-post-content strong {
  font-weight: 600;
  color: var(--text);
}

.blog-post-content code {
  padding: 2px 6px;
  background: var(--border);
  border-radius: 4px;
  font-size: 0.9em;
}

[data-theme="dark"] .blog-post-content code {
  background: #334155;
}

.blog-post-content pre {
  margin: 0 0 16px;
  padding: 16px;
  background: #1e1e1e;
  color: #d4d4d4;
  border-radius: var(--radius);
  overflow-x: auto;
}

.blog-post-content pre code {
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: 0.9rem;
}

.blog-post-content blockquote {
  margin: 0 0 16px;
  padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-style: italic;
}

.blog-post-content hr {
  margin: 32px 0;
  border: none;
  border-top: 1px solid var(--border);
}

.blog-post-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* -------------------------------------------------------------------------- */
/* Wizard step 1 service type cards                                           */
/* -------------------------------------------------------------------------- */

.wizard-intro {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.wizard-service-types {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.wizard-service-type {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.wizard-service-type strong {
  color: var(--text);
  font-size: 0.95rem;
}

.wizard-service-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.wizard-service-price {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.wizard-service-price em {
  color: var(--text-muted);
  font-weight: 400;
}
