* { box-sizing: border-box; }
:root {
  --bg-dark: #07111f;
  --bg-mid: #0b1730;
  --panel: #ffffff;
  --panel-alt: #eef5fb;
  --text: #11233a;
  --muted: #5f748d;
  --line: #d7e1ee;
  --primary: #1b5fba;
  --primary-dark: #154888;
  --accent: #26b87a;
  --danger: #c64747;
  --header-bg: rgba(7, 17, 31, 0.92);
  --footer-bg: #08111f;
  --shadow: 0 16px 44px rgba(8, 24, 50, 0.14);
  --radius: 24px;
  --container: 1180px;
  --theme-hero-image: none;
}
html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 33%, #f5f8fc 33%, #f5f8fc 100%);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
p, li { line-height: 1.7; }
.container { width: min(var(--container), calc(100vw - 32px)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 74px; }
.brand-link { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: rgba(255,255,255,0.88); font-weight: 600; }
.site-nav a:hover { color: #fff; }
.nav-toggle { display: none; border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 700; }
main { min-height: 70vh; }
.section { padding: 72px 0; }
.section-tight-top { padding-top: 18px; }
.section-dark { background: linear-gradient(135deg, var(--bg-dark), var(--bg-mid)); color: #fff; }
.hero-section { position: relative; padding: 88px 0 72px; overflow: hidden; }
.hero-ribbon {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-image: var(--theme-hero-image);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}
.hero-grid { position: relative; display: grid; gap: 28px; grid-template-columns: 1.15fr 0.85fr; align-items: center; }
.hero-copy { color: #fff; }
.eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 55%, white 45%);
}
.hero-copy h1, .page-header h1 { margin: 0 0 18px; font-size: clamp(2.5rem, 4vw, 4rem); line-height: 1.05; }
.hero-copy p, .page-header p { font-size: 1.05rem; line-height: 1.7; color: #d8e5f6; max-width: 62ch; }
.hero-html p:last-child, .section-html p:last-child { margin-bottom: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.button, button {
  cursor: pointer;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
}
.button.primary, button.button.primary, button.primary { color: #fff; background: var(--primary); box-shadow: var(--shadow); }
.button.primary:hover, button.primary:hover { background: var(--primary-dark); }
.button.secondary, button.secondary { color: var(--text); background: #fff; }
.glass-card { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 22px 48px rgba(0,0,0,0.18); }
.hero-panel { border-radius: var(--radius); padding: 24px; color: #fff; }
.panel-kicker { font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: #cfe6ff; margin-bottom: 16px; font-weight: 700; }
.metric-grid { display: grid; gap: 14px; }
.metric-card {
  display: grid;
  gap: 8px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.16);
}
.metric-card strong { font-size: 1.6rem; }
.metric-title { font-weight: 700; }
.metric-caption { color: #d6e6fa; line-height: 1.5; }
.metric-warning { border-color: rgba(255, 196, 0, 0.45); }
.static-card { cursor: default; }
.section-heading { margin-bottom: 28px; }
.section-heading h2 { font-size: clamp(2rem, 3vw, 2.8rem); margin: 0 0 10px; }
.section-heading p { color: var(--muted); max-width: 70ch; line-height: 1.7; }
.product-grid { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.product-card { display: grid; grid-template-columns: 260px 1fr; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid #e4ebf5; }
.product-card-media { min-height: 250px; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(135deg, var(--bg-dark), var(--primary-dark)); }
.product-card-body { padding: 22px; }
.product-card-body h3 { margin: 0 0 8px; font-size: 1.5rem; }
.product-tagline { color: var(--primary); font-weight: 700; margin: 0 0 12px; }
.product-tagline-light { color: color-mix(in srgb, var(--accent) 60%, white 40%); }
.product-card-body p { line-height: 1.7; color: #314a64; }
.product-card-body ul, .simple-list { margin: 14px 0 0; padding-left: 20px; line-height: 1.7; color: #314a64; }
.text-link { display: inline-flex; margin-top: 16px; color: var(--primary); font-weight: 700; }
.two-column { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
.feature-list { display: grid; gap: 14px; }
.feature-item { display: grid; gap: 8px; background: rgba(255,255,255,0.08); padding: 18px; border-radius: 18px; border: 1px solid rgba(255,255,255,0.1); }
.feature-item span { color: rgba(255,255,255,0.82); }
.team-grid { display: grid; gap: 20px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.team-card, .card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #e6edf6; }
.team-card { padding: 22px; }
.team-card h3 { margin: 0 0 6px; }
.team-title { font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.team-card p { color: #314a64; line-height: 1.6; }
.page-header { padding-top: 54px; color: #fff; }
.compact-header { padding-bottom: 20px; }
.product-header-grid { display: grid; gap: 28px; grid-template-columns: 1.1fr 0.9fr; align-items: center; }
.product-hero-card { background: rgba(255,255,255,0.08); padding: 20px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.14); }
.product-hero-card img { max-height: 380px; margin: 0 auto; object-fit: contain; }
.portal-grid { display: grid; gap: 24px; grid-template-columns: 0.95fr 1.05fr; }
.chat-page-header { max-width: 78ch; }
.chat-section { padding-top: 20px; }
.chat-layout { display: grid; gap: 24px; grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
.chat-sidebar, .chat-card { padding: 24px; }
.chat-sidebar { display: grid; gap: 20px; }
.chat-sidebar h2, .chat-card h2 { margin-top: 0; }
.chat-suggestions { display: grid; gap: 12px; }
.chat-suggestion {
  width: 100%;
  text-align: left;
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid #d9e4f1;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: none;
}
.chat-sidebar-note { display: grid; gap: 10px; padding: 18px; border-radius: 18px; background: var(--panel-alt); border: 1px solid #dde8f5; }
.chat-sidebar-note p { margin: 0; color: #314a64; line-height: 1.6; }
.chat-transcript {
  display: grid;
  gap: 14px;
  min-height: 420px;
  max-height: 640px;
  overflow-y: auto;
  padding: 6px 4px 10px;
}
.chat-message {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid #dce7f3;
  max-width: 90%;
}
.assistant-message { background: var(--panel-alt); justify-self: start; }
.user-message { background: #eef6ff; justify-self: end; }
.chat-message-role { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.chat-message-body { white-space: pre-wrap; line-height: 1.7; color: var(--text); }
.chat-message-actions { margin-top: 2px; }
.chat-form { display: grid; gap: 12px; margin-top: 16px; }
.chat-input-label { font-weight: 700; }
.chat-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 120px;
  padding: 14px 16px;
  font: inherit;
  resize: vertical;
}
.chat-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stack-card { padding: 24px; }
.stack-form { display: grid; gap: 14px; }
.stack-form label { display: grid; gap: 8px; font-weight: 600; }
.stack-form input, .stack-form textarea, .stack-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 46px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
}
.stack-form input[type="color"] { padding: 6px; min-height: 46px; }
.stack-form textarea { min-height: 120px; resize: vertical; }
.checkbox-row { display: flex !important; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; min-height: 0; }
.checkbox-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.api-result { margin-top: 12px; min-height: 24px; color: var(--primary); font-weight: 700; }
.hidden-block { display: none !important; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.admin-login-wrap { display: flex; justify-content: center; }
.admin-login-card { width: min(540px, 100%); }
.admin-overview-grid { display: grid; gap: 18px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card { background: #fff; border-radius: 22px; border: 1px solid #e4ebf5; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 8px; }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.stat-card strong { font-size: 1.8rem; }
.admin-grid-wide { display: grid; gap: 22px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-span-2 { grid-column: span 2; }
.admin-form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-form textarea { min-height: 96px; }
.admin-list { display: grid; gap: 10px; margin-top: 16px; }
.admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel-alt);
  border: 1px solid #dde8f5;
}
.small-row { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.list-actions { display: flex; gap: 8px; }
.list-button { background: var(--bg-mid); color: #fff; border-radius: 12px; padding: 8px 12px; }
.admin-empty { padding: 16px; border-radius: 16px; background: var(--panel-alt); color: var(--muted); }
.admin-placeholder { padding: 16px; border-radius: 16px; background: var(--panel-alt); color: #254564; }
.rich-editor { display: grid; gap: 10px; }
.rich-editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.rich-editor-toolbar button {
  background: var(--panel-alt);
  color: var(--text);
  border: 1px solid #d7e1ee;
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: none;
}
.rich-editor-surface {
  min-height: 220px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.7;
}
.rich-editor-surface:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, white 60%); outline-offset: 2px; }
.html-content p:first-child { margin-top: 0; }
.html-content p:last-child { margin-bottom: 0; }
.html-content ul, .html-content ol { padding-left: 20px; }
.theme-preview {
  --preview-primary: #1b5fba;
  --preview-secondary: #154888;
  --preview-accent: #26b87a;
  --preview-dark: #07111f;
  --preview-mid: #0b1730;
  --preview-panel: #ffffff;
  --preview-panel-alt: #eef5fb;
  --preview-text: #11233a;
  --preview-muted: #5f748d;
  --preview-header: rgba(7, 17, 31, 0.92);
  --preview-footer: #08111f;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--preview-dark) 0%, var(--preview-mid) 58%, var(--preview-panel-alt) 58%, var(--preview-panel-alt) 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
  min-height: 420px;
}
.theme-preview-header {
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--preview-header);
  border: 1px solid rgba(255,255,255,0.12);
}
.theme-preview-hero {
  padding: 22px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.theme-preview-hero h3 { margin: 0 0 10px; font-size: 1.7rem; }
.theme-preview-hero p { margin: 0; color: rgba(255,255,255,0.82); }
.theme-preview-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.theme-preview-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--preview-primary);
  color: #fff;
  font-weight: 700;
}
.theme-preview-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--preview-accent);
  color: #fff;
  font-weight: 700;
}
.theme-preview-card {
  background: var(--preview-panel);
  color: var(--preview-text);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 16px 40px rgba(8, 24, 50, 0.18);
}
.site-footer { background: var(--footer-bg); color: rgba(255,255,255,0.86); padding: 36px 0 24px; margin-top: 30px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1.2fr 1fr 1fr; }
.site-footer h3, .site-footer h4 { margin-top: 0; color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.65); }

@media (max-width: 1080px) {
  .hero-grid, .two-column, .portal-grid, .product-header-grid, .footer-grid, .admin-grid-wide, .chat-layout { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-span-2 { grid-column: auto; }
}

@media (max-width: 840px) {
  body { background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-mid) 26%, #f5f8fc 26%, #f5f8fc 100%); }
  .site-nav {
    position: absolute;
    top: 78px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: color-mix(in srgb, var(--bg-dark) 92%, black 8%);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.08);
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .product-card { grid-template-columns: 1fr; }
  .team-grid, .admin-overview-grid, .checkbox-grid, .admin-form-grid { grid-template-columns: 1fr; }
  .admin-toolbar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 640px) {
  .container { width: min(var(--container), calc(100vw - 20px)); }
  .section { padding: 56px 0; }
  .chat-message { max-width: 100%; }
  .chat-form-actions { flex-direction: column; align-items: stretch; }
  .hero-section { padding-top: 64px; }
  .hero-copy h1, .page-header h1 { font-size: 2.2rem; }
  .theme-preview { min-height: 340px; }
}
