:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fc;
  --bg-tertiary: #eaf1fa;
  --bg-card: #ffffff;
  --border: #d8e1ed;
  --border-highlight: #3b82f6;
  --text-primary: #172033;
  --text-secondary: #42526b;
  --text-muted: #6b7c93;
  --accent: #2563c7;
  --accent-hover: #174ea6;
  --green: #5fd0a0;
  --green-bg: rgba(95, 208, 160, 0.1);
  --green-border: rgba(95, 208, 160, 0.4);
  --red: #ff6b7a;
  --orange: #f8a95b;
  --purple: #a98df8;
}

html { background: #ffffff; }

* {
  scrollbar-color: #b8c5d6 #f1f5f9;
  scrollbar-width: thin;
}

.seo-heading {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

body {
  min-height: 100vh;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  background:
    radial-gradient(circle at 82% -10%, rgba(59, 130, 246, 0.08), transparent 32rem),
    radial-gradient(circle at -10% 55%, rgba(117, 157, 207, 0.08), transparent 30rem),
    #ffffff !important;
}

h1, h2, h3, .menu-title, .brand-wordmark, .hero-title {
  font-family: "Montserrat", "Inter", sans-serif;
}

.top-bar {
  position: relative !important;
  top: auto !important;
  z-index: auto !important;
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 300;
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid #dce4ef;
  box-shadow: 0 3px 14px rgba(24, 47, 78, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Keep the visualiser navigation and options together while the chart scrolls. */
body.visualiser-active .top-bar {
  position: sticky !important;
  top: 0 !important;
  z-index: 300 !important;
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid #dce4ef !important;
  box-shadow: 0 3px 14px rgba(24, 47, 78, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.visualiser-active .app-header {
  position: relative;
  top: auto;
  z-index: 1;
  background: transparent !important;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.visualiser-active .toolbar {
  position: relative;
  z-index: 1;
  background: transparent;
  border-top: 1px solid #e2e8f0;
}

body.visualiser-active .sidebar {
  top: 84px;
  max-height: calc(100vh - 84px);
}

.feature-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}

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

.feature-page > main {
  flex: 1 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  flex: 0 0 56px;
  min-width: 0;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  height: 56px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #dce4ef;
  box-shadow: 0 3px 14px rgba(24, 47, 78, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-header::after,
.app-header::after,
body.visualiser-active .top-bar::after {
  position: absolute;
  right: 0;
  bottom: -14px;
  left: 0;
  height: 14px;
  background: linear-gradient(180deg, rgba(221, 230, 241, 0.48), rgba(255, 255, 255, 0));
  content: "";
  pointer-events: none;
}

body.visualiser-active .app-header::after {
  display: none;
}

.site-header h1 {
  margin: 0;
  color: var(--text-secondary);
  font-family: "Inter", sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
}

.site-header .subtitle {
  margin-left: auto;
  color: #86a7d5;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.app-header,
body > .top-bar {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  height: 56px !important;
  padding: 0 20px !important;
  gap: 14px !important;
}

.logo-btn.brand-lockup {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transform: none !important;
}

.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 6px 15px rgba(59, 130, 246, 0.24));
}

.brand-wordmark {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  color: #172033;
  font-size: 0.74rem;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  text-transform: uppercase;
}

.brand-wordmark-project {
  color: #172033;
  font-size: 1em;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.brand-wordmark-name {
  color: #66758a;
  font-size: 0.82em;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.brand-divider {
  width: 1px;
  height: 24px;
  background: #cbd5e1;
}

.primary-nav {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.site-header-title {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 30px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.16s ease;
}

.site-header-title:hover,
.site-header-title:focus-visible,
.site-header-title.is-active {
  color: #123d7a;
}

.site-header-title::after {
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  content: "";
  transition: background 0.16s ease;
}

.site-header-title:hover::after,
.site-header-title:focus-visible::after,
.site-header-title.is-active::after {
  background: var(--accent-hover);
}

body > .top-bar > h1,
.app-header .nav-title {
  font-family: "Inter", sans-serif;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: var(--text-secondary) !important;
}

.top-bar .subtitle,
.app-header .subtitle {
  color: #86a7d5 !important;
  font-size: 0.65rem !important;
  font-weight: 600;
  letter-spacing: 0.16em !important;
}

.app-header .back-btn {
  border-color: #d8e1ed !important;
  background: #f7f9fc !important;
  padding: 5px 10px !important;
}

.landing-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px - 88px);
  padding: 72px 24px 88px;
  overflow: hidden;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 88px;
  padding: 22px max(24px, calc((100vw - 1120px) / 2));
  background: #f7f9fc;
  border-top: 1px solid #dce4ef;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.footer-brand {
  color: var(--text-primary);
  font-family: "Montserrat", "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.76rem;
  text-decoration: none;
  transition: color 0.16s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent-hover);
}

.landing-shell::before {
  content: "";
  position: absolute;
  width: 560px;
  height: 560px;
  top: -250px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  filter: blur(80px);
  pointer-events: none;
}

.hero-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 720px;
}

.hero-logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 18px 36px rgba(59, 130, 246, 0.25));
}

.hero-eyebrow {
  margin-bottom: 14px;
  color: #78a8ed;
  font-family: "Montserrat", sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.hero-title {
  color: #172033;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.05;
  font-weight: 650;
  letter-spacing: 0.2em;
  text-indent: 0.2em;
}

.hero-copy {
  max-width: 580px;
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: clamp(0.88rem, 2vw, 1rem);
  line-height: 1.7;
}

.tool-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(100%, 720px);
  margin-top: 42px;
}

.menu-card {
  position: relative;
  min-height: 164px;
  padding: 24px !important;
  overflow: hidden;
  text-align: left !important;
  background: #ffffff !important;
  border: 1px solid #d8e1ed !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 38px rgba(24, 47, 78, 0.09);
}

.menu-card::after {
  content: "\2197";
  position: absolute;
  top: 23px;
  right: 23px;
  color: #6f91c3;
  font-size: 1rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.menu-card:hover {
  border-color: rgba(59, 130, 246, 0.65) !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 44px rgba(24, 47, 78, 0.14), 0 0 0 1px rgba(59, 130, 246, 0.1) !important;
}

.menu-card:hover::after { color: #72a7ff; transform: translate(2px, -2px); }

.menu-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 20px !important;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.12);
  font-size: 1.3rem !important;
}

.menu-title { margin-bottom: 8px !important; font-size: 0.92rem !important; letter-spacing: 0.01em; }
.menu-desc { color: #5e7088 !important; font-size: 0.77rem !important; line-height: 1.55 !important; }

.wizard-step,
.file-card,
.recent-item,
#chart,
.sidebar,
.modal,
.content blockquote,
.content pre {
  background: #ffffff !important;
  border-color: #d8e1ed !important;
  box-shadow: 0 12px 30px rgba(24, 47, 78, 0.08);
}

.wizard-step,
.file-card,
.recent-item,
.modal { border-radius: 12px !important; }

.wizard-step .step-num {
  background: linear-gradient(135deg, #3b82f6, #0f2e5b) !important;
  color: #fff !important;
}

.btn-go,
.btn-run,
.toolbar button.active {
  color: #fff !important;
  background: linear-gradient(135deg, #3b82f6, #2563d8) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.btn:hover,
.toolbar button:hover,
.file-card:hover,
.recent-item:hover,
.upload-area:hover {
  border-color: rgba(59, 130, 246, 0.72) !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

input[type="checkbox"] { accent-color: #3b82f6 !important; }

.tabs {
  background: #f7f9fc !important;
  border-bottom-color: #d8e1ed !important;
}

.tab.active { color: #72a7ff !important; border-bottom-color: #3b82f6 !important; }
.table-item.active { color: #72a7ff !important; border-left-color: #3b82f6 !important; }

.layout { height: calc(100vh - 57px) !important; }
.content { padding-top: 36px !important; }
.content h1 { font-size: 1.75rem !important; letter-spacing: -0.025em; }
.content h2 { color: #72a7ff !important; }

::-webkit-scrollbar-track { background: #f1f5f9 !important; }
::-webkit-scrollbar-thumb { background: #b8c5d6 !important; }

@media (max-width: 720px) {
  .app-header,
  body > .top-bar { padding: 0 12px !important; }
  .site-header { padding: 0 12px; }
  .brand-wordmark { font-size: 0.64rem; letter-spacing: 0.22em; }
  .brand-divider { display: none; }
  .primary-nav { gap: 10px; }
  .primary-nav .site-header-title { font-size: 0.72rem; }
  body > .top-bar > h1,
  .app-header .nav-title,
  .site-header h1 { display: none; }
  .top-bar .subtitle,
  .app-header .subtitle,
  .site-header .subtitle { display: none; }
  .landing-shell { min-height: calc(100vh - 56px); padding: 54px 18px 64px; }
  .hero-logo { width: 108px; height: 108px; }
  .hero-title { letter-spacing: 0.12em; text-indent: 0.12em; }
  .tool-grid { grid-template-columns: 1fr; max-width: 430px; }
  .menu-card { min-height: 150px; }
  .content { padding: 24px 16px !important; }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 24px 18px;
  }
  .footer-links { justify-content: flex-start; gap: 10px 18px; }
}

@media (max-width: 440px) {
  .site-header { gap: 10px; }
  .site-header .brand-wordmark,
  .app-header .brand-wordmark,
  body > .top-bar .brand-wordmark { display: none; }
  .site-header .brand-divider.page-divider { display: none; }
  .primary-nav { gap: 8px; }
  .primary-nav .site-header-title { font-size: 0.68rem; }
  .app-header .back-btn { display: none; }
}

/* Unified light surfaces for the explorer and visualiser shells. */
body > .top-bar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid #dce4ef !important;
}

.main,
.main-panel,
.tab-content,
.sql-editor,
.data-wrap {
  background: #ffffff;
}

.table-item:hover,
.table-item.active,
.group-menu .gm-item:hover,
.data-table tr:hover td {
  background: #eaf1fa !important;
}

.schema-table th,
.data-table th {
  color: #52657e !important;
  background: #eaf1fa !important;
  border-bottom-color: #ced9e7 !important;
}

.schema-table td,
.data-table td {
  color: #26364d !important;
  border-bottom-color: #e3e9f1 !important;
}

.btn,
.toolbar button,
select,
input,
textarea,
.sql-input {
  color: #26364d;
  background-color: #f8fafc;
  border-color: #cfd9e6;
}

.sql-error {
  color: #b42335 !important;
  background: #fff1f2 !important;
  border-color: #f3a8b2 !important;
}

.loading-overlay { background: rgba(255, 255, 255, 0.88) !important; }
