/*
 * TrustChat Design System
 * Modern B2B SaaS UI for Homepage, ChatBotAdmin and public Chat Widget
 * Target stack: Spring Boot + Thymeleaf/htmx/Vanilla JS
 */

/* ========================================================================== */
/* 1. Design Tokens                                                           */
/* ========================================================================== */

:root {
  /* Brand */
  --tc-primary-50: #eff6ff;
  --tc-primary-100: #dbeafe;
  --tc-primary-200: #bfdbfe;
  --tc-primary-300: #93c5fd;
  --tc-primary-400: #60a5fa;
  --tc-primary-500: #2563eb;
  --tc-primary-600: #1d4ed8;
  --tc-primary-700: #1e40af;
  --tc-primary-800: #1e3a8a;
  --tc-primary-900: #172554;

  --tc-accent-50: #ecfeff;
  --tc-accent-100: #ccfbf1;
  --tc-accent-300: #5eead4;
  --tc-accent-400: #2dd4bf;
  --tc-accent-500: #14b8a6;
  --tc-accent-600: #0d9488;
  --tc-accent-700: #0f766e;

  --tc-sky-500: #0ea5e9;
  --tc-cyan-400: #22d3ee;

  /* Semantic */
  --tc-success-50: #ecfdf5;
  --tc-success-500: #10b981;
  --tc-success-600: #059669;
  --tc-warning-50: #fffbeb;
  --tc-warning-500: #f59e0b;
  --tc-danger-50: #fef2f2;
  --tc-danger-500: #ef4444;
  --tc-purple-50: #faf5ff;
  --tc-purple-500: #8b5cf6;

  /* Neutrals */
  --tc-navy-950: #07111f;
  --tc-slate-950: #0f172a;
  --tc-slate-900: #111827;
  --tc-slate-800: #1f2937;
  --tc-slate-700: #334155;
  --tc-slate-600: #475569;
  --tc-slate-500: #64748b;
  --tc-slate-400: #94a3b8;
  --tc-slate-300: #cbd5e1;
  --tc-slate-200: #e2e8f0;
  --tc-slate-100: #f1f5f9;
  --tc-slate-50: #f8fafc;
  --tc-white: #ffffff;

  /* Backgrounds */
  --tc-bg: #ffffff;
  --tc-bg-subtle: #f8fafc;
  --tc-bg-muted: #f1f5f9;
  --tc-surface: rgba(255, 255, 255, 0.92);
  --tc-surface-solid: #ffffff;
  --tc-surface-blue: #f4f8ff;
  --tc-border: #e2e8f0;
  --tc-border-strong: #cbd5e1;

  /* Text */
  --tc-text: #0f172a;
  --tc-text-muted: #64748b;
  --tc-text-soft: #94a3b8;
  --tc-text-inverse: #ffffff;
  --tc-link: #2563eb;
  --tc-link-hover: #1d4ed8;

  /* Typography */
  --tc-font-sans: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tc-font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  --tc-text-xs: 0.75rem;
  --tc-text-sm: 0.875rem;
  --tc-text-base: 1rem;
  --tc-text-lg: 1.125rem;
  --tc-text-xl: 1.25rem;
  --tc-text-2xl: 1.5rem;
  --tc-text-3xl: 2rem;
  --tc-text-4xl: 2.75rem;
  --tc-text-5xl: 3.5rem;

  --tc-leading-tight: 1.1;
  --tc-leading-snug: 1.25;
  --tc-leading-normal: 1.5;
  --tc-leading-relaxed: 1.65;

  /* Spacing */
  --tc-space-0: 0;
  --tc-space-1: 0.25rem;
  --tc-space-2: 0.5rem;
  --tc-space-3: 0.75rem;
  --tc-space-4: 1rem;
  --tc-space-5: 1.25rem;
  --tc-space-6: 1.5rem;
  --tc-space-8: 2rem;
  --tc-space-10: 2.5rem;
  --tc-space-12: 3rem;
  --tc-space-16: 4rem;
  --tc-space-20: 5rem;
  --tc-space-24: 6rem;
  --tc-space-32: 8rem;

  /* Radius */
  --tc-radius-xs: 0.25rem;
  --tc-radius-sm: 0.5rem;
  --tc-radius-md: 0.75rem;
  --tc-radius-lg: 1rem;
  --tc-radius-xl: 1.5rem;
  --tc-radius-2xl: 2rem;
  --tc-radius-full: 9999px;

  /* Shadows */
  --tc-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --tc-shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --tc-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --tc-shadow-lg: 0 18px 45px rgba(15, 23, 42, 0.12);
  --tc-shadow-xl: 0 28px 80px rgba(15, 23, 42, 0.16);
  --tc-shadow-blue: 0 18px 45px rgba(37, 99, 235, 0.18);

  /* Layout */
  --tc-container: 1180px;
  --tc-admin-sidebar-width: 280px;
  --tc-admin-detail-width: 420px;
  --tc-header-height: 72px;

  /* Motion */
  --tc-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --tc-duration-fast: 120ms;
  --tc-duration: 180ms;
  --tc-duration-slow: 280ms;

  /* Focus */
  --tc-focus-ring: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

/* ========================================================================== */
/* 2. Base                                                                    */
/* ========================================================================== */

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--tc-font-sans);
  font-size: var(--tc-text-base);
  line-height: var(--tc-leading-normal);
  color: var(--tc-text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 34rem),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 34rem),
    var(--tc-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--tc-link-hover);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: var(--tc-focus-ring);
}

::selection {
  color: var(--tc-white);
  background: var(--tc-primary-500);
}

.tc-container {
  width: min(100% - 2rem, var(--tc-container));
  margin-inline: auto;
}

.tc-muted {
  color: var(--tc-text-muted);
}

.tc-gradient-text {
  background: linear-gradient(90deg, var(--tc-primary-500), var(--tc-accent-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ========================================================================== */
/* 3. Typography                                                              */
/* ========================================================================== */

.tc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--tc-space-2);
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--tc-radius-full);
  background: rgba(239, 246, 255, 0.72);
  color: var(--tc-primary-700);
  font-size: var(--tc-text-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tc-h1,
.tc-h2,
.tc-h3,
.tc-h4 {
  margin: 0;
  color: var(--tc-text);
  letter-spacing: -0.04em;
  /* Long German compounds (e.g. "mandantenfähig", "vertrauenswürdig") otherwise
     overflow their grid cell and get hidden behind the hero mockup. */
  overflow-wrap: break-word;
  hyphens: auto;
}

.tc-h1 {
  font-size: clamp(2.8rem, 6vw, 5.6rem);
  line-height: 0.98;
  font-weight: 800;
}

.tc-h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: var(--tc-leading-tight);
  font-weight: 800;
}

.tc-h3 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: var(--tc-leading-snug);
  font-weight: 750;
}

.tc-h4 {
  font-size: var(--tc-text-xl);
  line-height: var(--tc-leading-snug);
  font-weight: 750;
}

.tc-lead {
  margin: 0;
  color: var(--tc-text-muted);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: var(--tc-leading-relaxed);
}

.tc-caption {
  color: var(--tc-text-soft);
  font-size: var(--tc-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ========================================================================== */
/* 4. Logo                                                                    */
/* ========================================================================== */

.tc-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--tc-text);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.tc-logo__mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
}

.tc-logo__text {
  font-size: 1.45rem;
  line-height: 1;
}

.tc-logo__trust {
  color: var(--tc-slate-950);
}

.tc-logo__chat {
  color: var(--tc-primary-500);
}

.tc-logo--small .tc-logo__mark {
  width: 1.8rem;
  height: 1.8rem;
}

.tc-logo--small .tc-logo__text {
  font-size: 1.15rem;
}

/* Optional pure-CSS fallback mark if no SVG/logo image is available. */
.tc-logo-fallback-mark {
  position: relative;
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid var(--tc-primary-500);
  border-radius: 45% 45% 45% 16%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.12));
}

.tc-logo-fallback-mark::before {
  content: "";
  position: absolute;
  right: -0.25rem;
  bottom: -0.2rem;
  width: 1rem;
  height: 1.15rem;
  border-radius: 0.25rem 0.25rem 0.45rem 0.45rem;
  background: linear-gradient(135deg, var(--tc-primary-500), var(--tc-accent-500));
  clip-path: polygon(50% 0, 92% 16%, 92% 54%, 50% 100%, 8% 54%, 8% 16%);
}

.tc-logo-fallback-mark::after {
  content: "•••";
  position: absolute;
  left: 0.38rem;
  top: 0.46rem;
  color: var(--tc-slate-950);
  font-size: 0.95rem;
  letter-spacing: 0.05rem;
}

/* ========================================================================== */
/* 5. Buttons, Forms, Badges                                                  */
/* ========================================================================== */

.tc-btn {
  --_btn-bg: var(--tc-white);
  --_btn-color: var(--tc-text);
  --_btn-border: var(--tc-border);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.75rem;
  padding: 0.72rem 1rem;
  border: 1px solid var(--_btn-border);
  border-radius: var(--tc-radius-md);
  background: var(--_btn-bg);
  color: var(--_btn-color);
  font-size: var(--tc-text-sm);
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
  box-shadow: var(--tc-shadow-xs);
  transition:
    transform var(--tc-duration-fast) var(--tc-ease),
    box-shadow var(--tc-duration) var(--tc-ease),
    background var(--tc-duration) var(--tc-ease),
    border-color var(--tc-duration) var(--tc-ease);
}

.tc-btn:hover {
  transform: translateY(-1px);
  color: var(--_btn-color);
  box-shadow: var(--tc-shadow-sm);
}

.tc-btn:active {
  transform: translateY(0);
}

.tc-btn--primary {
  --_btn-bg: linear-gradient(135deg, var(--tc-primary-500), var(--tc-primary-600));
  --_btn-color: var(--tc-white);
  --_btn-border: rgba(29, 78, 216, 0.4);
  box-shadow: var(--tc-shadow-blue);
}

.tc-btn--primary:hover {
  --_btn-bg: linear-gradient(135deg, var(--tc-primary-600), var(--tc-primary-700));
}

.tc-btn--accent {
  --_btn-bg: linear-gradient(135deg, var(--tc-accent-500), var(--tc-cyan-400));
  --_btn-color: var(--tc-white);
  --_btn-border: rgba(13, 148, 136, 0.4);
}

.tc-btn--ghost {
  --_btn-bg: rgba(255, 255, 255, 0.72);
  --_btn-border: rgba(226, 232, 240, 0.9);
}

.tc-btn--text {
  --_btn-bg: transparent;
  --_btn-border: transparent;
  padding-inline: 0.25rem;
  box-shadow: none;
  color: var(--tc-primary-600);
}

.tc-btn--full {
  width: 100%;
}

.tc-btn--sm {
  min-height: 2.25rem;
  padding: 0.55rem 0.8rem;
  font-size: var(--tc-text-xs);
}

.tc-input,
.tc-select,
.tc-textarea {
  width: 100%;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-md);
  background: var(--tc-white);
  color: var(--tc-text);
  box-shadow: var(--tc-shadow-xs);
  transition:
    border-color var(--tc-duration) var(--tc-ease),
    box-shadow var(--tc-duration) var(--tc-ease),
    background var(--tc-duration) var(--tc-ease);
}

.tc-input,
.tc-select {
  min-height: 2.75rem;
  padding: 0 0.9rem;
}

.tc-textarea {
  min-height: 8rem;
  padding: 0.85rem 0.9rem;
  resize: vertical;
}

.tc-input::placeholder,
.tc-textarea::placeholder {
  color: var(--tc-text-soft);
}

.tc-input:focus,
.tc-select:focus,
.tc-textarea:focus {
  outline: none;
  border-color: var(--tc-primary-400);
  box-shadow: var(--tc-focus-ring);
}

.tc-form-field {
  display: grid;
  gap: var(--tc-space-2);
}

.tc-label {
  color: var(--tc-slate-700);
  font-size: var(--tc-text-sm);
  font-weight: 700;
}

.tc-help {
  color: var(--tc-text-muted);
  font-size: var(--tc-text-xs);
}

.tc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: var(--tc-radius-full);
  background: var(--tc-slate-100);
  color: var(--tc-slate-700);
  font-size: var(--tc-text-xs);
  font-weight: 750;
  line-height: 1;
}

.tc-badge--primary {
  background: var(--tc-primary-50);
  color: var(--tc-primary-700);
}

.tc-badge--success {
  background: var(--tc-success-50);
  color: var(--tc-success-600);
}

.tc-badge--warning {
  background: var(--tc-warning-50);
  color: #b45309;
}

.tc-badge--purple {
  background: var(--tc-purple-50);
  color: var(--tc-purple-500);
}

.tc-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: var(--tc-radius-full);
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 14%, transparent);
}

/* ========================================================================== */
/* 6. Cards and Common Components                                             */
/* ========================================================================== */

.tc-card {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--tc-radius-xl);
  background: var(--tc-surface-solid);
  box-shadow: var(--tc-shadow-sm);
}

.tc-card--glass {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.tc-card--interactive {
  transition:
    transform var(--tc-duration) var(--tc-ease),
    box-shadow var(--tc-duration) var(--tc-ease),
    border-color var(--tc-duration) var(--tc-ease);
}

.tc-card--interactive:hover {
  transform: translateY(-3px);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: var(--tc-shadow-md);
}

.tc-card__header,
.tc-card__body,
.tc-card__footer {
  padding: var(--tc-space-6);
}

.tc-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--tc-space-4);
  border-bottom: 1px solid var(--tc-border);
}

.tc-icon-box {
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border-radius: var(--tc-radius-lg);
  background: linear-gradient(135deg, var(--tc-primary-50), var(--tc-accent-50));
  color: var(--tc-primary-600);
}

.tc-icon-box--solid {
  background: linear-gradient(135deg, var(--tc-primary-500), var(--tc-accent-500));
  color: var(--tc-white);
  box-shadow: var(--tc-shadow-blue);
}

.tc-progress {
  overflow: hidden;
  height: 0.55rem;
  border-radius: var(--tc-radius-full);
  background: var(--tc-slate-200);
}

.tc-progress__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tc-primary-500), var(--tc-accent-500));
}

.tc-divider {
  height: 1px;
  margin: var(--tc-space-8) 0;
  border: 0;
  background: var(--tc-border);
}

/* ========================================================================== */
/* 6b. Spacing + container utilities                                          */
/* These exist so templates don't need style="margin-top: …" etc., which the  */
/* strict Content-Security-Policy would block in some browsers.               */
/* ========================================================================== */

.tc-mt-1   { margin-top: 0.5rem; }
.tc-mt-2   { margin-top: 1rem; }
.tc-mt-3   { margin-top: 1.5rem; }
.tc-mt-4   { margin-top: 2rem; }
.tc-mb-1   { margin-bottom: 0.5rem; }
.tc-mb-2   { margin-bottom: 1rem; }
.tc-mb-3   { margin-bottom: 1.5rem; }
.tc-mb-4   { margin-bottom: 2rem; }
.tc-mt-sm  { margin-top: 0.6rem; }
.tc-mt-md  { margin-top: 0.8rem; }

/* Form-stack: form-fields stacked with consistent vertical rhythm */
.tc-form-stack > .tc-form-field + .tc-form-field { margin-top: 0.8rem; }
.tc-form-stack > .tc-form-actions { margin-top: 1.2rem; display: flex; gap: 0.6rem; }

/* Page-shell containers */
.tc-container--prose { width: min(100% - 2rem, 780px); margin-inline: auto; }
.tc-container--wide  { width: min(100% - 2rem, 880px); margin-inline: auto; }

/* Page intro headline + lead */
.tc-page-h2          { margin: 0.6rem 0 1rem 0; }
.tc-page-lead--last  { margin-bottom: 2rem; }

/* Card with a notice accent on the left edge (used for the LLM-transfer hint) */
.tc-card--notice   { border-left: 4px solid var(--tc-warning-500); }

/* Bot-Setup-Wizard (/admin/bot/new) */
.tc-wizard__draft-banner {
    margin: 0 1.5rem 0;
    padding: 0.55rem 0.85rem;
    border: 1px dashed var(--tc-accent-500, #2563eb);
    border-radius: 8px;
    background: rgba(122,162,255,0.10);
    font-size: 0.9rem;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    justify-content: space-between;
}
.tc-wizard__draft-banner a { color: var(--tc-accent-500, #2563eb); text-decoration: underline; }

.tc-wizard__steps {
    list-style: none;
    margin: 0;
    padding: 0 1.5rem;
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--tc-border, #2a3568);
}
.tc-wizard__step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 0;
    color: var(--tc-muted);
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tc-wizard__step.is-active { color: var(--tc-text, currentColor); border-bottom-color: var(--tc-accent-500, #2563eb); font-weight: 600; }
.tc-wizard__step.is-done   { opacity: 0.8; }
.tc-wizard__step-num {
    display: inline-flex;
    width: 1.6rem;
    height: 1.6rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(122,162,255,0.18);
    font-size: 0.85rem;
    font-weight: 600;
}
.tc-wizard__step.is-active .tc-wizard__step-num { background: var(--tc-accent-500, #2563eb); color: #fff; }

.tc-wizard__panel { display: none; border: none; padding: 1.5rem 1.5rem 0.5rem; margin: 0; }
.tc-wizard__panel.is-active { display: block; }

.tc-wizard__actions {
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    padding: 1.25rem 1.5rem 1.5rem;
}

.tc-wizard__templates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 0.6rem;
}
.tc-wizard__template-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--tc-border, #2a3568);
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.tc-wizard__template-card:hover { border-color: var(--tc-accent-500, #2563eb); }
.tc-wizard__template-card.is-selected { border-color: var(--tc-accent-500, #2563eb); background: rgba(122,162,255,0.10); }
.tc-wizard__template-card input { position: absolute; opacity: 0; pointer-events: none; }
.tc-wizard__template-name { font-weight: 600; }
.tc-wizard__template-desc { font-size: 0.85rem; }

/* Deployment cards on /admin/bot */
.tc-deploy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.tc-deploy-card { padding: 1.25rem; }
.tc-deploy-card__lead { color: var(--tc-muted); margin-bottom: 0.85rem; }
.tc-deploy-card__url-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; }
.tc-deploy-card__url {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    background: rgba(0,0,0,0.10);
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}
.tc-deploy-card__tabs { display: flex; gap: 0.3rem; border-bottom: 1px solid var(--tc-border, #2a3568); margin-top: 1rem; }
.tc-deploy-card__tab {
    padding: 0.45rem 0.85rem;
    border: none;
    background: transparent;
    color: var(--tc-muted);
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tc-deploy-card__tab.is-active { color: var(--tc-text, currentColor); border-bottom-color: var(--tc-accent-500, #2563eb); font-weight: 600; }
.tc-deploy-card__tab-panel { display: none; padding: 0.85rem 0 0; }
.tc-deploy-card__tab-panel.is-active { display: block; }
.is-hidden { display: none !important; }
.tc-error-text { color: var(--tc-danger-500, #d12); }
.tc-deploy-card__snippet {
    background: rgba(0,0,0,0.18);
    color: inherit;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.8rem;
    font-family: ui-monospace, monospace;
    margin: 0.5rem 0 0;
}

/* Hosted bot page (/c/{publicId}) — full-bleed SPA-style chat */
.tc-hosted-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-height: 100vh;
}
.tc-hosted-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.tc-hosted-header__brand { display: flex; align-items: center; gap: 0.85rem; }
.tc-hosted-header__logo { width: 44px; height: 44px; }
.tc-hosted-header__title { margin: 0; font-size: 1.4rem; }
.tc-hosted-header__subtitle { margin: 0.15rem 0 0; color: var(--tc-muted); font-size: 0.95rem; }
.tc-hosted-header__powered { font-size: 0.85rem; color: var(--tc-muted); text-decoration: none; }
.tc-hosted-header__powered:hover { text-decoration: underline; }

.tc-hosted-chat-card { display: flex; flex-direction: column; flex: 1 1 auto; padding: 1rem; }
.tc-hosted-chat-log {
    flex: 1 1 auto;
    min-height: 50vh;
    max-height: 65vh;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.tc-hosted-chat-form { margin-top: 0.75rem; display: flex; gap: 0.5rem; }
.tc-hosted-chat-form .tc-input { flex: 1 1 auto; }

.tc-hosted-footer {
    text-align: center;
    font-size: 0.85rem;
}
.tc-hosted-footer a { color: var(--tc-muted); text-decoration: none; }
.tc-hosted-footer a:hover { text-decoration: underline; }

/* Bot-Special-Rules section (admin/bot.html) */
.tc-rules-section  { margin-top: 1.5rem; }
.tc-rules-list     { list-style: none; padding: 0; }
.tc-rule-item      { padding: 1rem; margin-bottom: 0.75rem; }
.tc-rule-actions   { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.tc-rules-divider  { margin: 1.25rem 0; opacity: 0.2; }

/* Notice block headline tighter than h3 default */
.tc-notice-title   { margin-bottom: 0.4rem; }

/* Feature cards: condensed h3 spacing */
.tc-feature-card-h3 { margin: 0.8rem 0; }

/* Footer baseline copy */
.tc-footer-baseline { margin-top: 2rem; }
.tc-footer-baseline > p { font-size: 0.8rem; }

/* Inline-form helper (no margin/padding/etc., just sits inline) */
.tc-inline-form { display: inline; }

/* Tight list (used in imprint for the projects list) */
.tc-tight-list           { margin: 1rem 0 0 0; padding: 0; list-style: none; }
.tc-tight-list > li      { margin: 0.15rem 0; }

/* Compact stack list with grid for the dashboard "recent" cards */
.tc-stack-list           { display: grid; gap: 0.6rem; padding: 0; margin: 0; list-style: none; }
.tc-stack-card           { padding: 0.6rem 0.8rem; }
.tc-stack-card__title    { margin: 0; font-weight: 750; }
.tc-stack-card__sub      { margin: 0.2rem 0 0 0; font-size: 0.8rem; }

/* Embed snippet preformatted block */
.tc-embed-snippet        {
  padding: 0.8rem;
  font-family: var(--tc-font-mono);
  font-size: 0.8rem;
  overflow: auto;
}
/* Hero embed snippet (slightly larger) */
.tc-hero-snippet         {
  padding: 1rem;
  overflow: auto;
  font-family: var(--tc-font-mono);
  font-size: 0.85rem;
}

/* Fine-print muted line */
.tc-fineprint            { margin-top: 0.6rem; font-size: 0.85rem; }

/* Dashboard usage progress bar wrapper */
.tc-progress--inline     { margin-top: 1rem; }

/* Chat-test layout */
.tc-chat-log             { position: relative; }
.tc-chat-form            { margin-top: 0.6rem; display: flex; gap: 0.6rem; }

/* Hero product wrapper around the dashboard image */
.tc-hero-product--bare   { margin: 0; background: transparent; border: 0; box-shadow: none; padding: 0; }
.tc-hero-product__img    {
  width: 100%; height: auto; display: block;
  border-radius: var(--tc-radius-2xl);
  box-shadow: var(--tc-shadow-xl);
}

/* Imprint contact email block */
.tc-imprint-email-block  { margin-top: 0.6em; }
.tc-imprint-address      { margin-top: 1em; }
.tc-imprint-projects-h   { margin-top: 1rem; font-size: 1rem; }

/* Privacy section: bullets + illustration side-by-side inside the card.
   Strict CSP (style-src 'self') would otherwise drop equivalent inline styles. */
.tc-privacy-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  margin-top: 1rem;
}
.tc-privacy-card-grid > ul { margin: 0; min-width: 0; }
.tc-privacy-card-grid > img {
  width: 134px;
  height: 134px;
  max-width: 134px;
  justify-self: end;
}

/* ========================================================================== */
/* 7. Homepage                                                                */
/* ========================================================================== */

.tc-site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--tc-header-height);
  border-bottom: 1px solid rgba(226, 232, 240, 0.72);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
}

.tc-site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--tc-space-6);
}

.tc-site-nav {
  display: flex;
  align-items: center;
  gap: var(--tc-space-6);
}

.tc-site-nav a {
  color: var(--tc-slate-700);
  font-size: var(--tc-text-sm);
  font-weight: 700;
}

.tc-site-nav a:hover {
  color: var(--tc-primary-600);
}

.tc-site-actions {
  display: flex;
  align-items: center;
  gap: var(--tc-space-3);
}

.tc-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) 0 var(--tc-space-20);
}

.tc-hero::before {
  content: "";
  position: absolute;
  inset: -12rem -12rem auto auto;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.17), transparent 64%);
  pointer-events: none;
}

.tc-hero__grid {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: clamp(2rem, 6vw, 5rem);
}

/* Hero h1 is one notch smaller than the global .tc-h1 — long German compounds
   ("mandantenfähig", "vertrauenswürdig") otherwise wrap to too many lines. */
.tc-hero .tc-h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.9rem);
  line-height: 1.05;
}

.tc-hero__copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: var(--tc-space-6);
  min-width: 0;
}

.tc-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tc-space-3);
}

.tc-hero__proof {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tc-space-5);
  color: var(--tc-slate-600);
  font-size: var(--tc-text-sm);
  font-weight: 700;
}

.tc-hero-product {
  position: relative;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--tc-radius-2xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.92));
  box-shadow: var(--tc-shadow-xl);
}

.tc-hero-product::before {
  content: "";
  position: absolute;
  inset: 4rem -2rem -2rem 2rem;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(20, 184, 166, 0.16));
  filter: blur(40px);
}

.tc-hero-product__chrome {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 2.4rem;
  padding: 0 var(--tc-space-5);
  border-bottom: 1px solid var(--tc-border);
}

.tc-hero-product__dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: var(--tc-radius-full);
  background: var(--tc-slate-300);
}

.tc-hero-product__body {
  display: grid;
  min-height: 360px;
  grid-template-columns: 180px 1fr;
}

.tc-product-sidebar {
  padding: var(--tc-space-5);
  border-radius: 0 0 0 var(--tc-radius-2xl);
  background: linear-gradient(180deg, var(--tc-slate-950), #0b1b33);
  color: var(--tc-text-inverse);
}

.tc-product-sidebar__item {
  display: flex;
  align-items: center;
  gap: var(--tc-space-2);
  padding: 0.65rem 0.75rem;
  border-radius: var(--tc-radius-md);
  color: rgba(255, 255, 255, 0.76);
  font-size: var(--tc-text-sm);
  font-weight: 700;
}

.tc-product-sidebar__item.is-active {
  background: var(--tc-primary-500);
  color: var(--tc-white);
}

.tc-product-chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: var(--tc-space-4);
  padding: var(--tc-space-5);
}

.tc-message {
  width: fit-content;
  max-width: 86%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-lg);
  background: var(--tc-white);
  color: var(--tc-slate-700);
  font-size: var(--tc-text-sm);
  box-shadow: var(--tc-shadow-xs);
  /* Long German compounds (e.g. "Mandantenfähigkeit") otherwise run past
     the bubble border. */
  overflow-wrap: break-word;
  hyphens: auto;
}

.tc-message--user {
  margin-left: auto;
  border-color: rgba(37, 99, 235, 0.22);
  background: var(--tc-primary-50);
  color: var(--tc-primary-900);
}

.tc-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tc-space-5);
}

.tc-section {
  padding: var(--tc-space-20) 0;
}

.tc-section--muted {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.88), rgba(255, 255, 255, 0.94));
}

.tc-section__header {
  display: grid;
  max-width: 720px;
  gap: var(--tc-space-4);
  margin-bottom: var(--tc-space-10);
}

.tc-pricing-grid {
  display: grid;
  align-items: stretch;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tc-space-6);
}

.tc-price-card {
  position: relative;
  display: grid;
  gap: var(--tc-space-5);
  padding: var(--tc-space-6);
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-xl);
  background: var(--tc-white);
  box-shadow: var(--tc-shadow-sm);
}

.tc-price-card--featured {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: var(--tc-shadow-blue);
}

.tc-price-card__badge {
  position: absolute;
  top: -0.8rem;
  left: var(--tc-space-6);
}

.tc-price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.tc-price__amount {
  font-size: var(--tc-text-3xl);
  font-weight: 850;
  letter-spacing: -0.05em;
}

.tc-check-list {
  display: grid;
  gap: var(--tc-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tc-check-list li {
  display: flex;
  gap: var(--tc-space-2);
  color: var(--tc-slate-700);
  font-size: var(--tc-text-sm);
}

.tc-check-list li::before {
  content: "✓";
  color: var(--tc-primary-500);
  font-weight: 900;
}

.tc-footer {
  border-top: 1px solid var(--tc-border);
  background: var(--tc-white);
  padding: var(--tc-space-12) 0 var(--tc-space-6);
}

.tc-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr) 1.4fr;
  gap: var(--tc-space-8);
}

.tc-footer h4 {
  margin: 0 0 var(--tc-space-3);
  font-size: var(--tc-text-sm);
}

.tc-footer a,
.tc-footer p {
  color: var(--tc-text-muted);
  font-size: var(--tc-text-sm);
}

/* ========================================================================== */
/* 8. Admin Layout                                                            */
/* ========================================================================== */

.tc-admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--tc-admin-sidebar-width) minmax(0, 1fr);
  background: var(--tc-bg-subtle);
}

.tc-admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--tc-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  padding: var(--tc-space-5);
}

.tc-admin-sidebar__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--tc-space-8);
}

.tc-admin-nav {
  display: grid;
  gap: var(--tc-space-2);
}

.tc-admin-nav__link {
  display: flex;
  align-items: center;
  gap: var(--tc-space-3);
  padding: 0.85rem 0.95rem;
  border-radius: var(--tc-radius-md);
  color: var(--tc-slate-700);
  font-size: var(--tc-text-sm);
  font-weight: 750;
  transition:
    background var(--tc-duration) var(--tc-ease),
    color var(--tc-duration) var(--tc-ease),
    transform var(--tc-duration-fast) var(--tc-ease);
}

.tc-admin-nav__link:hover {
  background: var(--tc-primary-50);
  color: var(--tc-primary-700);
  transform: translateX(2px);
}

.tc-admin-nav__link.is-active {
  background: linear-gradient(135deg, var(--tc-primary-500), var(--tc-primary-600));
  color: var(--tc-white);
  box-shadow: var(--tc-shadow-blue);
}

.tc-admin-main {
  min-width: 0;
}

.tc-admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 var(--tc-space-8);
  border-bottom: 1px solid var(--tc-border);
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: blur(18px);
}

.tc-admin-search {
  position: relative;
  width: min(100%, 520px);
}

.tc-admin-search .tc-input {
  padding-left: 2.6rem;
}

.tc-admin-search__icon {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  color: var(--tc-text-soft);
  transform: translateY(-50%);
}

.tc-admin-content {
  display: grid;
  gap: var(--tc-space-6);
  padding: var(--tc-space-8);
}

.tc-admin-grid {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) var(--tc-admin-detail-width);
  gap: var(--tc-space-6);
}

.tc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--tc-space-5);
}

.tc-kpi-card {
  display: flex;
  align-items: center;
  gap: var(--tc-space-4);
  padding: var(--tc-space-5);
}

.tc-kpi-card__value {
  font-size: var(--tc-text-2xl);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.tc-kpi-card__trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--tc-success-600);
  font-size: var(--tc-text-xs);
  font-weight: 750;
}

.tc-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--tc-space-5);
}

.tc-chart-placeholder {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  border-radius: var(--tc-radius-lg);
  background:
    linear-gradient(to right, rgba(226, 232, 240, 0.65) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.65) 1px, transparent 1px),
    linear-gradient(180deg, rgba(37, 99, 235, 0.07), rgba(20, 184, 166, 0.05));
  background-size: 64px 56px, 64px 56px, auto;
}

.tc-chart-placeholder::before,
.tc-chart-placeholder::after {
  content: "";
  position: absolute;
  right: 8%;
  left: 6%;
  height: 4px;
  border-radius: var(--tc-radius-full);
  transform-origin: left center;
}

.tc-chart-placeholder::before {
  top: 58%;
  background: linear-gradient(90deg, var(--tc-primary-500), var(--tc-primary-400));
  box-shadow: 0 -38px 0 -1px rgba(37, 99, 235, 0.55), 0 42px 0 -1px rgba(37, 99, 235, 0.35);
  transform: skewY(-8deg);
}

.tc-chart-placeholder::after {
  top: 66%;
  background: linear-gradient(90deg, var(--tc-accent-500), var(--tc-cyan-400));
  transform: skewY(-5deg);
}

.tc-table-wrap {
  overflow-x: auto;
}

.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--tc-text-sm);
}

.tc-table th,
.tc-table td {
  padding: 0.95rem 0.85rem;
  border-bottom: 1px solid var(--tc-border);
  text-align: left;
  vertical-align: middle;
}

.tc-table th {
  color: var(--tc-text-muted);
  font-size: var(--tc-text-xs);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tc-table tr:hover td {
  background: var(--tc-slate-50);
}

.tc-avatar {
  display: inline-grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border-radius: var(--tc-radius-full);
  background: linear-gradient(135deg, var(--tc-primary-500), var(--tc-accent-500));
  color: var(--tc-white);
  font-size: var(--tc-text-sm);
  font-weight: 850;
}

.tc-detail-panel {
  position: sticky;
  top: calc(var(--tc-header-height) + var(--tc-space-6));
  max-height: calc(100vh - var(--tc-header-height) - var(--tc-space-10));
  overflow-y: auto;
}

.tc-tabs {
  display: flex;
  gap: var(--tc-space-1);
  border-bottom: 1px solid var(--tc-border);
}

.tc-tab {
  padding: 0.85rem 0.75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--tc-text-muted);
  font-size: var(--tc-text-sm);
  font-weight: 800;
}

.tc-tab.is-active {
  border-color: var(--tc-primary-500);
  color: var(--tc-primary-600);
}

/* ========================================================================== */
/* 9. Chat Widget                                                             */
/* ========================================================================== */

.tc-widget-launcher {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 90;
  display: grid;
  width: 4rem;
  height: 4rem;
  place-items: center;
  border: 0;
  border-radius: var(--tc-radius-full);
  background: linear-gradient(135deg, var(--tc-primary-500), var(--tc-accent-500));
  color: var(--tc-white);
  box-shadow: var(--tc-shadow-blue);
}

.tc-widget {
  position: fixed;
  right: 1.5rem;
  bottom: 6.25rem;
  z-index: 90;
  display: grid;
  width: min(calc(100vw - 2rem), 390px);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: var(--tc-radius-2xl);
  background: var(--tc-white);
  box-shadow: var(--tc-shadow-xl);
}

.tc-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--tc-space-4);
  background: linear-gradient(135deg, var(--tc-primary-600), var(--tc-primary-800));
  color: var(--tc-white);
}

.tc-widget__body {
  display: grid;
  gap: var(--tc-space-3);
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: var(--tc-space-4);
  background: var(--tc-slate-50);
}

.tc-widget__footer {
  display: grid;
  gap: var(--tc-space-2);
  padding: var(--tc-space-3);
  border-top: 1px solid var(--tc-border);
  background: var(--tc-white);
}

.tc-chat-bubble {
  max-width: 82%;
  padding: 0.72rem 0.88rem;
  border-radius: var(--tc-radius-lg);
  background: var(--tc-white);
  color: var(--tc-slate-700);
  font-size: var(--tc-text-sm);
  box-shadow: var(--tc-shadow-xs);
}

.tc-chat-bubble--user {
  justify-self: end;
  background: var(--tc-primary-500);
  color: var(--tc-white);
  /* User input keeps paragraph breaks from pasted text (CV, job descriptions). */
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.tc-chat-bubble--assistant {
  justify-self: start;
  border: 1px solid var(--tc-border);
}
/* Markdown-rendered assistant bubbles: keep headings/lists/paragraphs readable inside
 * the constrained bubble width. */
.tc-chat-bubble--assistant p             { margin: 0 0 0.55rem; }
.tc-chat-bubble--assistant p:last-child  { margin-bottom: 0; }
.tc-chat-bubble--assistant h3,
.tc-chat-bubble--assistant h4,
.tc-chat-bubble--assistant h5,
.tc-chat-bubble--assistant h6            { margin: 0.85rem 0 0.4rem; font-weight: 700; line-height: 1.25; }
.tc-chat-bubble--assistant h3            { font-size: 1.05rem; }
.tc-chat-bubble--assistant h4            { font-size: 1rem; }
.tc-chat-bubble--assistant h5,
.tc-chat-bubble--assistant h6            { font-size: 0.95rem; }
.tc-chat-bubble--assistant > *:first-child { margin-top: 0; }
.tc-chat-bubble--assistant ul,
.tc-chat-bubble--assistant ol            { margin: 0.3rem 0 0.55rem; padding-left: 1.25rem; }
.tc-chat-bubble--assistant li            { margin: 0.15rem 0; }
.tc-chat-bubble--assistant strong        { font-weight: 700; }
.tc-chat-bubble--assistant em            { font-style: italic; }
.tc-chat-bubble--assistant code          { background: rgba(0,0,0,0.08); padding: 0 0.25rem; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 0.9em; }
.tc-chat-bubble--assistant pre           { background: rgba(0,0,0,0.10); padding: 0.6rem 0.75rem; border-radius: 6px; overflow-x: auto; margin: 0.4rem 0 0.6rem; }
.tc-chat-bubble--assistant pre code      { background: transparent; padding: 0; }
.tc-chat-bubble--assistant a             { color: var(--tc-primary-500); text-decoration: underline; }

.tc-widget-powered-by {
  display: flex;
  justify-content: center;
  color: var(--tc-text-soft);
  font-size: var(--tc-text-xs);
}

/* ========================================================================== */
/* 10. Design System Documentation Helpers                                    */
/* ========================================================================== */

.tc-token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--tc-space-4);
}

.tc-swatch {
  display: grid;
  gap: var(--tc-space-2);
}

.tc-swatch__color {
  min-height: 3.2rem;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-md);
  box-shadow: var(--tc-shadow-xs);
}

.tc-swatch__label {
  color: var(--tc-slate-700);
  font-family: var(--tc-font-mono);
  font-size: var(--tc-text-xs);
}

/* ========================================================================== */
/* 11. Responsive                                                             */
/* ========================================================================== */

@media (max-width: 1180px) {
  :root {
    --tc-admin-detail-width: 360px;
  }

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

  .tc-admin-grid,
  .tc-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .tc-detail-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 920px) {
  .tc-site-nav,
  .tc-site-actions .tc-btn--ghost,
  .tc-site-actions a:not(.tc-btn) {
    display: none;
  }

  .tc-hero__grid,
  .tc-hero-product__body,
  .tc-product-chat,
  .tc-pricing-grid,
  .tc-feature-grid,
  .tc-footer__grid {
    grid-template-columns: 1fr;
  }

  .tc-product-sidebar {
    display: none;
  }

  .tc-admin-shell {
    grid-template-columns: 1fr;
  }

  .tc-admin-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--tc-border);
  }

  .tc-admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tc-admin-topbar,
  .tc-admin-content {
    padding-inline: var(--tc-space-4);
  }
}

@media (max-width: 640px) {
  .tc-container {
    width: min(100% - 1.25rem, var(--tc-container));
  }

  .tc-hero,
  .tc-section {
    padding-block: var(--tc-space-12);
  }

  .tc-hero__actions,
  .tc-site-actions,
  .tc-kpi-card {
    align-items: stretch;
    flex-direction: column;
  }

  .tc-kpi-grid,
  .tc-admin-nav {
    grid-template-columns: 1fr;
  }

  .tc-widget,
  .tc-widget-launcher {
    right: 1rem;
  }

  .tc-widget {
    bottom: 5.75rem;
  }
}

/* ========================================================================== */
/* 12. Accessibility and Reduced Motion                                       */
/* ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-color-scheme: dark) {
  /* The MVP mockup is light-first. Keep dark mode opt-in via .tc-theme-dark. */
}

.tc-theme-dark {
  --tc-bg: #07111f;
  --tc-bg-subtle: #0f172a;
  --tc-bg-muted: #111827;
  --tc-surface: rgba(15, 23, 42, 0.82);
  --tc-surface-solid: #0f172a;
  --tc-surface-blue: #0b1d35;
  --tc-border: rgba(148, 163, 184, 0.22);
  --tc-border-strong: rgba(148, 163, 184, 0.32);
  --tc-text: #f8fafc;
  --tc-text-muted: #cbd5e1;
  --tc-text-soft: #94a3b8;
  --tc-link: #60a5fa;
  --tc-link-hover: #93c5fd;

  --tc-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.45);
  --tc-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
  --tc-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --tc-shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.55);
  --tc-shadow-xl: 0 28px 80px rgba(0, 0, 0, 0.7);
}

.tc-theme-dark body {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 34rem),
    var(--tc-bg);
}

/* Surfaces */
.tc-theme-dark .tc-card,
.tc-theme-dark .tc-price-card,
.tc-theme-dark .tc-hero-product,
.tc-theme-dark .tc-kpi-card {
  background: var(--tc-surface-solid);
  border-color: var(--tc-border);
  color: var(--tc-text);
}
.tc-theme-dark .tc-card--glass {
  background: rgba(15, 23, 42, 0.72);
}
.tc-theme-dark .tc-section--muted {
  background: linear-gradient(180deg, rgba(7, 17, 31, 0.92), rgba(15, 23, 42, 0.92));
}

/* Header / sidebar / topbar */
.tc-theme-dark .tc-site-header,
.tc-theme-dark .tc-admin-topbar {
  background: rgba(7, 17, 31, 0.85);
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-site-nav a,
.tc-theme-dark .tc-admin-nav__link {
  color: var(--tc-text-muted);
}
.tc-theme-dark .tc-site-nav a:hover,
.tc-theme-dark .tc-admin-nav__link:hover {
  color: var(--tc-text);
  background: rgba(37, 99, 235, 0.18);
}
.tc-theme-dark .tc-admin-shell {
  background: var(--tc-bg);
}
.tc-theme-dark .tc-admin-sidebar {
  background: rgba(11, 19, 33, 0.92);
  border-color: var(--tc-border);
}

/* Forms */
.tc-theme-dark .tc-input,
.tc-theme-dark .tc-select,
.tc-theme-dark .tc-textarea {
  background: var(--tc-bg-muted);
  color: var(--tc-text);
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-input::placeholder,
.tc-theme-dark .tc-textarea::placeholder {
  color: var(--tc-text-soft);
}

/* Buttons */
.tc-theme-dark .tc-btn {
  background: var(--tc-bg-muted);
  color: var(--tc-text);
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-btn--ghost {
  background: rgba(148, 163, 184, 0.08);
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-btn--text {
  background: transparent;
  color: var(--tc-link);
}

/* Tables */
.tc-theme-dark .tc-table th {
  color: var(--tc-text-soft);
}
.tc-theme-dark .tc-table th,
.tc-theme-dark .tc-table td {
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-table tr:hover td {
  background: rgba(37, 99, 235, 0.08);
}

/* Card headers / dividers */
.tc-theme-dark .tc-card__header {
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-divider {
  background: var(--tc-border);
}

/* Lists & labels — many components hard-code --tc-slate-700 (#334155) which is
   nearly invisible on the dark surface. Lift them to --tc-text-muted (#cbd5e1). */
.tc-theme-dark .tc-check-list li,
.tc-theme-dark .tc-label,
.tc-theme-dark .tc-hero__proof,
.tc-theme-dark .tc-site-nav a {
  color: var(--tc-text-muted);
}
.tc-theme-dark .tc-check-list li::before {
  color: var(--tc-primary-300);
}
.tc-theme-dark .tc-help,
.tc-theme-dark .tc-muted {
  color: var(--tc-text-soft);
}
.tc-theme-dark .tc-h1,
.tc-theme-dark .tc-h2,
.tc-theme-dark .tc-h3,
.tc-theme-dark .tc-h4 {
  color: var(--tc-text);
}
.tc-theme-dark .tc-eyebrow {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(37, 99, 235, 0.18);
  color: var(--tc-primary-300);
}
.tc-theme-dark .tc-price-card,
.tc-theme-dark .tc-price-card .tc-muted,
.tc-theme-dark .tc-price-card p {
  color: var(--tc-text-muted);
}
.tc-theme-dark .tc-price__amount {
  color: var(--tc-text);
}

/* Logo wordmark adapts to dark background */
.tc-theme-dark .tc-logo__trust {
  color: var(--tc-text);
}

/* Footer */
.tc-theme-dark .tc-footer {
  background: var(--tc-bg);
  border-color: var(--tc-border);
}

/* Pre / code blocks */
.tc-theme-dark pre,
.tc-theme-dark code {
  background: var(--tc-bg-muted);
  color: var(--tc-text);
}

/* Badges keep their semantic backgrounds but tone-shift the neutral one */
.tc-theme-dark .tc-badge {
  background: rgba(148, 163, 184, 0.18);
  color: var(--tc-text-muted);
}

/* Hero product chrome */
.tc-theme-dark .tc-hero-product__chrome {
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-message {
  background: var(--tc-bg-muted);
  color: var(--tc-text-muted);
  border-color: var(--tc-border);
}
.tc-theme-dark .tc-message--user {
  background: rgba(37, 99, 235, 0.22);
  color: var(--tc-text);
}

/* Theme toggle button */
.tc-theme-toggle {
  display: inline-grid;
  width: 2.4rem;
  height: 2.4rem;
  place-items: center;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-full);
  background: transparent;
  color: var(--tc-text-muted);
  transition: background var(--tc-duration) var(--tc-ease), color var(--tc-duration) var(--tc-ease);
}
.tc-theme-toggle:hover {
  background: rgba(37, 99, 235, 0.12);
  color: var(--tc-text);
}
.tc-theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}
.tc-theme-dark .tc-theme-toggle--sun { display: inline-grid; }
.tc-theme-dark .tc-theme-toggle--moon { display: none; }
.tc-theme-toggle--sun { display: none; }
.tc-theme-toggle--moon { display: inline-grid; }

/* Locale flag toggles */
.tc-locale-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--tc-border);
  border-radius: var(--tc-radius-full);
  background: transparent;
}
.tc-locale-toggle a {
  display: inline-grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: var(--tc-radius-full);
  opacity: 0.55;
  transition: opacity var(--tc-duration) var(--tc-ease), background var(--tc-duration) var(--tc-ease);
}
.tc-locale-toggle a:hover { opacity: 0.9; }
.tc-locale-toggle a.is-active {
  opacity: 1;
  background: rgba(37, 99, 235, 0.14);
}
.tc-locale-toggle svg {
  width: 1.4rem;
  height: 1.05rem;
  border-radius: 0.18rem;
}
