:root {
  --black: #c0c1c3;
  /* ANSI 0 */
  --red: #c94234;
  /* ANSI 1 */
  --green: #85c54c;
  /* ANSI 2 */
  --yellow: #f5ae2e;
  /* ANSI 3 */
  --blue: #1398b9;
  /* ANSI 4 */
  --magenta: #d0633d;
  /* ANSI 5 */
  --cyan: #509552;
  /* ANSI 6 */
  --white: #e5c6aa;
  /* ANSI 7 */

  --bright-black: #675f54;
  /* ANSI 8 */
  --bright-red: #ff645a;
  /* ANSI 9 */
  --bright-green: #98e036;
  /* ANSI 10 */
  --bright-yellow: #e0d561;
  /* ANSI 11 */
  --bright-blue: #5fdaff;
  /* ANSI 12 */
  --bright-magenta: #ff9269;
  /* ANSI 13 */
  --bright-cyan: #84f088;
  /* ANSI 14 */
  --bright-white: #f6f7ec;
  /* ANSI 15 */

  /* Aligned with the mdBook ayu docs theme so /docs and the app match. */
  --background: hsl(210, 25%, 8%);
  --foreground: #c5c5c5;
  --cursor-color: #f6f7ec;
  --selection-background: #3b4b5e;
  --selection-foreground: #c5c5c5;
}

html {
  background-color: var(--background);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 0px 20px 20px 20px;
  line-height: 1.2;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

pre {
  white-space: pre-wrap;
  word-wrap: break-word;
}

::selection {
  background: var(--selection-background);
  color: var(--selection-foreground);
}

.ansi-output {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: monospace;
  font-size: 18px;
  line-height: 1.5;
  background-color: var(--background);
  color: var(--foreground);
  padding: 15px;
}

.ansi-black {
  color: var(--black);
}

.ansi-red {
  color: var(--red);
}

.ansi-green {
  color: var(--green);
}

.ansi-yellow {
  color: var(--yellow);
}

.ansi-blue {
  color: var(--blue);
}

.ansi-magenta {
  color: var(--magenta);
}

.ansi-cyan {
  color: var(--cyan);
}

.ansi-white {
  color: var(--white);
}

.ansi-bright-black {
  color: var(--bright-black);
}

.ansi-bright-red {
  color: var(--bright-red);
}

.ansi-bright-green {
  color: var(--bright-green);
}

.ansi-bright-yellow {
  color: var(--bright-yellow);
}

.ansi-bright-blue {
  color: var(--bright-blue);
}

.ansi-bright-magenta {
  color: var(--bright-magenta);
}

.ansi-bright-cyan {
  color: var(--bright-cyan);
}

.ansi-bright-white {
  color: var(--bright-white);
}

a {
  all: unset;
  text-decoration: underline;
  cursor: pointer;
}

a:hover,
a:focus {
  all: unset;
  cursor: pointer;
  text-decoration: underline;
}

.form-container {
  display: grid;
  grid-template-columns: auto auto auto auto;
  gap: 15px 10px;
  max-width: 95%;
  margin: 20px;
  align-items: start;
  justify-items: start;
  padding: 10px;
}

.form-container li {
  display: flex;
  flex-direction: column;
  align-items: start;
}

.form-container label {
  font-weight: bold;
  margin-bottom: 5px;
  text-align: left;
}

.form-container input {
  width: 100%;
  max-width: 400px;
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  text-align: left;
}

form {
  input.long {
    width: 60%;
  }

  input.short {
    width: 60px !important;
  }
}

form.inspect-form {
  input {
    margin-bottom: 5px;
    margin-top: 5px;
  }
}

:root {
  --block-background-color: hsl(210, 25%, 8%) !important;
  --background-color: hsl(210, 25%, 8%) !important;
  --font-color: #c5c5c5 !important;
  /* Sans body font to match the ayu docs theme; code/data keep --mono-font-stack */
  --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

body {
  pre {
    color: --font-color !important;
  }
}


/* Popup Box Container */
.popup-box {
  position: relative;
  background-color: var(--background);
  color: var(--foreground);
  text-align: center;
}

.popup-content {
  visibility: hidden;
  width: 100%;
  background-color: var(--background);
  color: var(--foreground);
  text-align: center;
  padding: 15px;
  border: 1px solid var(--foreground);

  /* Fixed positioning to center it */
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);

  /* Smooth transition */
  opacity: 0;
}

/* Show the Popup on Hover */
.popup-box:hover .popup-content {
  visibility: visible;
  opacity: 1;
}

li::before,
li::after {
  content: "" !important;
  display: none !important;
}

.popup-content {
  text-align: left;

  p {
    margin: 0;
    padding: 0;
  }
}

.help-header {
  display: inline-block;
  width: 120px !important;
}

button.btn-search {
  padding-top: 11px;
  padding-bottom: 11px;
}

.error {
  color: var(--error-color);
}

.cyan {
  color: var(--cyan);
}

a.cyan:hover {
  color: var(--bright-cyan);
  /* background: var(--cyan); */
}

.magenta {
  color: var(--magenta);
}

a.magenta:hover {
  color: var(--bright-magenta) !important;
  /* background: var(--magenta); */
}

.yellow {
  color: var(--yellow);
}

a.yellow:hover {
  color: var(--bright-yellow);
  /* background: var(--yellow); */
}

.green {
  color: var(--green);
}

a.green:hover {
  color: var(--bright-green);
  /* background: var(--green); */
}

pre.output {
  min-height: 350px;
}

.btn.active,
.btn-ghost.active,
.btn-default.active {
  color: var(--secondary-color) !important;
  border-color: var(--secondary-color) !important;
}

.command-box {
  display: block;
  padding-top: 20px;
  font-size: 16px;
  font-weight: bold;
}

/* Sticky navigation for primary CTA buttons */
.sticky-nav {
  position: sticky;
  top: 0;
  background-color: var(--background);
  z-index: 1000;
  padding: 10px 0;
  border-bottom: 1px solid var(--bright-black);
  margin-bottom: 20px;
}

.nav-left {
  display: flex;
  align-items: center !important;
}

.sticky-nav-logo {
  height: 60px;
  width: auto;
  transition: opacity 0.2s ease;
  margin-right: 15px;
  transform: translateY(4px);
}

.sticky-nav-logo:hover {
  opacity: 0.8;
}

.sticky-nav a[href*="openclaw-mev-mcp"] button {
  border-color: var(--bright-magenta) !important;
  color: var(--bright-magenta) !important;
  font-weight: bold;
}

.sticky-nav a[href*="openclaw-mev-mcp"] button:hover {
  background-color: var(--bright-magenta) !important;
  color: var(--background) !important;
}

a[href="/explore"] button {
  --nav-button-accent: var(--bright-cyan);
}

a[href="/search"] button,
a[href="/auth/github/login"] button {
  --nav-button-accent: var(--yellow);
}

a[href="/tui"] button {
  --nav-button-accent: var(--bright-red);
}

a[href="/explore"] button,
a[href="/search"] button,
a[href="/auth/github/login"] button,
a[href="/tui"] button {
  border-color: var(--nav-button-accent) !important;
  color: var(--nav-button-accent) !important;
}

a[href="/explore"] button:hover,
a[href="/search"] button:hover,
a[href="/auth/github/login"] button:hover,
a[href="/tui"] button:hover,
a[href="/explore"] button.active,
a[href="/search"] button.active,
a[href="/tui"] button.active {
  background-color: var(--nav-button-accent) !important;
  color: var(--background) !important;
  border-color: var(--nav-button-accent) !important;
}

.sticky-nav a[href="/explore"] button,
.sticky-nav a[href="/search"] button,
.sticky-nav a[href="/tui"] button {
  font-weight: bold;
}

.video-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spinner-container {
  text-align: center;
  padding: 20px;
}

/* React component styles */
.react-output {
  color: var(--foreground);
  font-family: monospace;
}

.block-container {
  margin-bottom: 20px;
  border: 1px solid var(--bright-black);
  border-radius: 4px;
  padding: 15px;
}

.block-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
  font-weight: bold;
}

.block-number {
  color: var(--blue);
}

.native-price {
  color: var(--green);
}

.tx-count {
  color: var(--yellow);
}

.transaction {
  margin: 10px 0;
  padding: 10px;
  border-left: 3px solid var(--cyan);
  background-color: rgba(0, 0, 0, 0.2);
}

.tx-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.tx-hash {
  color: var(--bright-blue);
  font-weight: bold;
}

.method {
  color: var(--magenta);
}

.status.success {
  color: var(--green);
}

.status.failed {
  color: var(--red);
}

.tx-details {
  margin: 8px 0;
  font-size: 0.9em;
}

.address {
  color: var(--cyan);
}

.gas,
.value {
  color: var(--yellow);
}

.log-group {
  margin: 10px 0;
  padding: 8px;
  border-left: 2px solid var(--bright-black);
}

.log-group-header {
  margin-bottom: 5px;
}

.source {
  color: var(--bright-cyan);
  font-weight: bold;
}

.log-entry {
  margin: 5px 0;
  padding: 5px;
  background-color: rgba(0, 0, 0, 0.1);
}

.log-signature {
  color: var(--bright-green);
  font-weight: bold;
  margin-bottom: 3px;
}

.topic {
  display: block;
  color: var(--bright-yellow);
  font-size: 0.8em;
  margin: 2px 0;
}

.log-data {
  color: var(--bright-white);
  font-size: 0.8em;
  word-break: break-all;
}

/* Hero section and features styling */
.hero-section {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.main-logo {
  max-width: 400px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.main-header {
  color: var(--bright-yellow) !important;
  margin: 20px auto 10px auto;
  font-weight: bold !important;
  text-align: center !important;
  line-height: 1.2 !important;
  display: block !important;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-stack) !important;
}

/* Desktop styles */
@media (min-width: 769px) {
  .main-header {
    font-size: 3.2em !important;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .main-header {
    font-size: 1.6em !important;
  }
}


/* Override terminal.css restrictions specifically for our main header */
.terminal .main-header,
.terminal h1.main-header {
  font-size: 3em;
  color: var(--yellow) !important;
  font-weight: bold !important;
}

.hero-subheader {
  color: var(--foreground);
  max-width: 760px;
  margin: 0 auto 10px auto;
  font-size: 1.2em;
  line-height: 1.6;
  text-align: center;
}

/* "Sample queries" label above the hero query tabs. */
.hero-tabs-label {
  margin: 26px auto 0 auto;
  text-align: center;
  font-family: monospace;
  font-size: 1.1em;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #85c54c;
}

/* Hero query tabs: switch the example query shown in the terminal card. */
.hero-tabs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: center;
  justify-items: center;
  gap: 10px 12px;
  max-width: 720px;
  margin: 12px auto 0 auto;
}

@media (max-width: 560px) {
  .hero-tabs {
    grid-template-columns: repeat(2, auto);
  }
}

@media (max-width: 360px) {
  .hero-tabs {
    grid-template-columns: 1fr;
  }
}

/* One-sentence description of the selected hero query, shown above the terminal. */
.hero-desc {
  color: #cdc8bd;
  max-width: 620px;
  margin: 16px auto 0 auto;
  font-size: 0.95em;
  line-height: 1.5;
  text-align: center;
}

body.terminal .hero-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: monospace !important;
  font-size: 0.95em;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 18px;
  border-radius: 999px !important;
  border: 1px solid rgba(133, 197, 76, 0.5);
  background-color: rgba(133, 197, 76, 0.08);
  color: var(--foreground);
  opacity: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background-color 0.15s ease,
    border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* Leading run-marker, signalling each chip runs a query when clicked. */
body.terminal .hero-tab::before {
  content: "▸";
  font-size: 0.95em;
  line-height: 1;
  color: var(--green);
  transition: color 0.15s ease, transform 0.12s ease;
}

body.terminal .hero-tab:hover {
  color: var(--yellow);
  border-color: var(--yellow);
  background-color: rgba(245, 174, 46, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

body.terminal .hero-tab:hover::before {
  color: var(--yellow);
  transform: translateX(2px);
}

body.terminal .hero-tab:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

body.terminal .hero-tab:active {
  transform: translateY(0);
}

body.terminal .hero-tab.active {
  color: var(--yellow);
  border-color: var(--yellow);
  background-color: rgba(245, 174, 46, 0.18);
  box-shadow: 0 4px 16px rgba(245, 174, 46, 0.22);
}

body.terminal .hero-tab.active::before {
  color: var(--yellow);
}

@media (prefers-reduced-motion: reduce) {
  body.terminal .hero-tab,
  body.terminal .hero-tab::before {
    transition: color 0.15s ease, background-color 0.15s ease,
      border-color 0.15s ease;
  }
  body.terminal .hero-tab:hover {
    transform: none;
  }
  body.terminal .hero-tab:hover::before {
    transform: none;
  }
}

/* Hero signature: a real mevlog SQL query, rendered as a terminal card. */
.hero-terminal {
  max-width: 720px;
  margin: 14px auto 0 auto;
  text-align: left;
  border: 1px solid rgba(80, 149, 82, 0.45);
  border-radius: 10px;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.35);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.hero-terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(80, 149, 82, 0.3);
  font-family: monospace;
  font-size: 0.82em;
}

.hero-terminal-cmd {
  color: var(--yellow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-terminal-net {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--foreground);
  opacity: 0.7;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cyan);
  box-shadow: 0 0 7px var(--cyan);
  animation: hero-pulse 2s ease-in-out infinite;
}

@keyframes hero-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.hero-terminal-body {
  margin: 0;
  padding: 16px 18px;
  background: transparent;
  border: none;
  font-family: monospace;
  font-size: 0.95em;
  line-height: 1.55;
  min-height: 8.5em;
  overflow-x: auto;
}

.hero-terminal-body code {
  background: transparent;
  padding: 0;
  color: var(--foreground);
  white-space: pre;
  text-decoration: none;
}

.hero-terminal-body code span {
  text-decoration: none;
}

/* One story: yellow = the mevlog vocabulary (custom fns + macros).
   Standard SQL stays dim; the result value is the single green pop. */
.hero-terminal-body .t-kw { color: var(--foreground); opacity: 0.45; }
.hero-terminal-body .t-fn { color: var(--yellow); }
.hero-terminal-body .t-macro { color: var(--yellow); font-weight: bold; }
.hero-terminal-body .t-str { color: var(--foreground); opacity: 0.8; font-weight: normal; }

.hero-caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background-color: var(--yellow);
  animation: hero-blink 1.1s step-end infinite;
}

@keyframes hero-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

.hero-terminal-out {
  padding: 10px 18px;
  border-top: 1px solid rgba(80, 149, 82, 0.3);
  font-family: monospace;
  font-size: 0.95em;
  background-color: rgba(80, 149, 82, 0.07);
}

.hero-out-key { color: var(--foreground); opacity: 0.6; }
.hero-out-val { color: var(--cyan); font-weight: bold; margin-left: 10px; }

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 26px 0 8px 0;
}

/* High specificity + !important throughout: terminal.css has aggressive
   a:hover and .btn rules that otherwise swap font, color, and radius on hover. */
body.terminal .hero-cta,
body.terminal .hero-cta:hover,
body.terminal .hero-cta:focus {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px !important;
  border: 1px solid transparent;
  font-family: monospace !important;
  font-size: 1em;
  font-weight: bold;
  text-decoration: none !important;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body.terminal .hero-cta-primary,
body.terminal .hero-cta-primary:focus {
  background-color: var(--yellow) !important;
  border-color: var(--yellow) !important;
  color: var(--background) !important;
}

body.terminal .hero-cta-primary:hover {
  background-color: var(--bright-yellow) !important;
  border-color: var(--bright-yellow) !important;
  color: var(--background) !important;
}

body.terminal .hero-cta-ghost,
body.terminal .hero-cta-ghost:focus {
  background-color: transparent !important;
  border-color: rgba(245, 174, 46, 0.5) !important;
  color: var(--yellow) !important;
}

body.terminal .hero-cta-ghost:hover {
  background-color: rgba(245, 174, 46, 0.1) !important;
  border-color: var(--yellow) !important;
  color: var(--yellow) !important;
}

@media (max-width: 768px) {
  .hero-terminal-body { font-size: 0.8em; }
  .hero-cta { width: 100%; text-align: center; box-sizing: border-box; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dot, .hero-caret { animation: none; }
}

.features-list {
  margin: 40px 0;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
  padding: 20px;
}

.feature-row .feature-text {
  grid-column: 1;
}

.feature-row .feature-image-container {
  grid-column: 2;
}

.feature-row.reverse .feature-text {
  grid-column: 2;
}

.feature-row.reverse .feature-image-container {
  grid-column: 1;
}

.feature-text {
  text-align: left;
}

.feature-text h2 {
  color: var(--foreground) !important;
  margin-bottom: 16px;
  font-weight: bold !important;
  text-shadow: none;
}

@media (max-width: 768px) {
  .feature-text h2 {
    font-size: 1.4em !important;
  }
}

@media (min-width: 769px) {
  .feature-text h2 {
    font-size: 1.8em !important;
  }
}

.feature-text p {
  color: var(--foreground);
  font-size: 1.2em;
  line-height: 1.6;
  margin: 0;
}

/* Docs-style inline code chip. Override terminal.css backtick pseudo-elements
   and its gray .terminal code color. */
body.terminal .feature-text code,
body.terminal .project-description code {
  font-family: monospace;
  font-size: 0.92em;
  color: var(--yellow);
  background-color: rgba(255, 255, 255, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

body.terminal .feature-text code::before,
body.terminal .feature-text code::after,
body.terminal .project-description code::before,
body.terminal .project-description code::after {
  content: none;
}

.feature-image-container {
  text-align: center;
}

.feature-image {
  max-width: 100%;
  width: 400px;
  height: auto;
  border: 3px solid var(--cyan);
  border-radius: 12px;
  padding: 15px;
  background-color: rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.feature-image:hover {
  border-color: var(--bright-cyan);
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.project-description {
  margin-top: 30px;
  font-size: 1.1em;
  line-height: 1.6;
  text-align: left;
  padding: 0 20px;
}

.install-command {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  background-color: transparent;
}

.install-command::before,
.install-command::after {
  content: none;
}

.section-header {
  text-align: left;
  padding-left: 20px;
  margin-top: 30px;
  font-size: 1.8rem;
}

.tui-page .section-header {
  color: var(--bright-magenta);
  position: relative;
  padding-left: 0;
  margin-top: 40px;
  margin-bottom: 16px;
}

.tui-page .section-header::before {
  content: ">";
  color: var(--bright-green);
  margin-right: 12px;
  font-weight: bold;
}


/* Responsive design */
@media (max-width: 768px) {
  .sticky-nav {
    padding: 8px 0;
  }

  .sticky-nav-logo {
    height: 40px;
    margin-right: 10px;
    transform: translateY(2px);
  }

  .nav-left {
    flex-wrap: wrap;
    gap: 5px;
  }

  .nav-left button {
    font-size: 0.9em;
    padding: 8px 12px;
  }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 40px 0;
  }

  .feature-row .feature-text,
  .feature-row.reverse .feature-text {
    grid-column: 1;
    grid-row: 1;
    text-align: center;
  }

  .feature-row .feature-text h2,
  .feature-row.reverse .feature-text h2,
  .feature-row .feature-text p,
  .feature-row.reverse .feature-text p {
    text-align: center;
  }

  .feature-row .feature-image-container,
  .feature-row.reverse .feature-image-container {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    justify-content: center;
  }

  .feature-image {
    width: 300px;
  }
}

/* TUI Page Styles */
.tui-page .fade-in {
  animation: fadeInUp 0.5s ease-out forwards;
  opacity: 0;
}

/* Respect reduced motion preferences - show content immediately */
@media (prefers-reduced-motion: reduce) {
  .tui-page .fade-in {
    animation: none;
    opacity: 1;
  }
}

.tui-page .fade-in:nth-child(1) { animation-delay: 0s; }
.tui-page .fade-in:nth-child(2) { animation-delay: 0.05s; }
.tui-page .fade-in:nth-child(3) { animation-delay: 0.1s; }
.tui-page .fade-in:nth-child(4) { animation-delay: 0.15s; }
.tui-page .fade-in:nth-child(5) { animation-delay: 0.2s; }
.tui-page .fade-in:nth-child(6) { animation-delay: 0.25s; }
.tui-page .fade-in:nth-child(7) { animation-delay: 0.3s; }
.tui-page .fade-in:nth-child(8) { animation-delay: 0.35s; }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Install command box */
.install-box {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--bright-black);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 100%);
  transition: all 0.3s ease;
}

.install-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.install-box:hover {
  border-color: var(--yellow);
  box-shadow: 0 0 20px rgba(245, 174, 46, 0.15);
}

.install-box .prompt {
  color: var(--bright-green);
  font-weight: bold;
  font-size: 1.1em;
}

.install-box .install-command {
  border: none;
  padding: 0;
  background: transparent;
  text-align: left;
}

/* TUI demo video */
.demo-video {
  margin: 30px auto;
  max-width: 800px;
}

.demo-video video {
  width: 100%;
  border: 2px solid var(--bright-black);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.demo-video video:hover {
  border-color: var(--bright-red);
}

/* TUI features list */
.tui-features {
  list-style: none !important;
  padding-left: 20px !important;
}

.tui-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(103, 95, 84, 0.3);
}

.tui-features li:last-child {
  border-bottom: none;
}

.feature-icon {
  flex-shrink: 0;
  width: 28px;
  min-width: 28px;
  text-align: center;
  display: inline-block;
}

.tui-features .feature-text {
  flex: 1;
}

.tui-features strong {
  color: var(--bright-cyan);
  margin-right: 4px;
}

@media (max-width: 768px) {
  .tui-features li {
    font-size: 0.95em;
  }
}

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

.indexed-blocks {
  color: var(--foreground);
  font-family: monospace;
  font-size: 13px;
  margin-bottom: 12px;
}

.indexed-blocks-range {
  color: var(--bright-white);
}

.search-field {
  margin-bottom: 12px;
}

.search-field-tight {
  margin-bottom: 4px;
}

.search-label {
  display: block;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.query-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.query-submit {
  background-color: #ffd700;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #000;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  padding: 10px 24px;
}

.query-submit:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.query-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #333;
  border-top: 2px solid #ffd700;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

.query-error {
  margin-top: 16px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 12px;
  font-family: monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.query-result-meta {
  color: #888;
  font-size: 13px;
  margin: 16px 0 8px;
  font-family: monospace;
}

.query-no-data {
  color: #888;
  padding: 12px;
}

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

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

.query-cell {
  border: 1px solid #333;
  padding: 4px 8px;
  font-family: monospace;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.query-cell-header {
  background-color: #2a2a2a;
  font-weight: bold;
}

/* Search view: preset query cards */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.preset-card {
  display: block;
  width: 100%;
  text-align: left;
  background: hsl(210, 25%, 11%);
  border: 1px solid #2b3640;
  border-left: 3px solid #2b3640;
  border-radius: 4px;
  padding: 12px 14px;
  cursor: pointer;
  font-family: monospace;
  color: var(--foreground);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.preset-card:hover {
  border-color: var(--yellow);
  background: hsl(210, 25%, 13%);
}

.preset-card:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.preset-card.active {
  border-left-color: var(--yellow);
  border-color: var(--yellow);
  background: hsl(210, 25%, 13%);
}

.preset-card .preset-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 14px;
  font-weight: bold;
}

.preset-card .preset-marker {
  color: var(--bright-black);
}

.preset-card:hover .preset-marker,
.preset-card.active .preset-marker {
  color: var(--yellow);
}

@media (prefers-reduced-motion: reduce) {
  .preset-card {
    transition: none;
  }
}

/* One-sentence description of the selected preset, shown above the SQL editor. */
.preset-description {
  margin: 0 0 8px 0;
  color: var(--bright-black);
  font-size: 13px;
  line-height: 1.5;
}

/* Search view: schema reference */
.schema-reference {
  margin-bottom: 16px;
}

.schema-toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  font-family: monospace;
  font-size: 13px;
  color: var(--foreground);
}

.schema-toggle:hover {
  color: var(--bright-white);
}

.schema-toggle:hover .schema-marker {
  color: var(--yellow);
}

.schema-toggle:focus-visible {
  outline: 2px solid var(--yellow);
  outline-offset: 2px;
}

.schema-marker {
  color: var(--bright-black);
}

.schema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.schema-table {
  background: hsl(210, 25%, 11%);
  border: 1px solid #2b3640;
  border-radius: 4px;
  padding: 12px 14px;
  font-family: monospace;
}

.schema-table-name {
  color: var(--yellow);
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
}

.schema-columns {
  border: none !important;
  border-collapse: collapse;
  width: 100%;
}

.schema-columns td {
  border: none !important;
  padding: 1px 0;
  font-size: 13px;
  vertical-align: baseline;
}

.schema-col-name {
  color: var(--bright-white);
  padding-right: 12px !important;
}

.schema-nullable {
  color: var(--black);
}

.schema-pk {
  color: var(--yellow);
  font-size: 11px;
}

.schema-col-type {
  color: var(--black);
  padding-right: 12px !important;
}

.schema-col-hint {
  color: var(--bright-cyan);
  font-size: 12px;
}

.schema-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #2b3640;
  color: var(--black);
  font-size: 12px;
}

/* terminal.css borders all tables; schema cards are borderless aligned rows */
/* Search view: SQL functions & macros reference */
/* a / a:hover use `all: unset`, which strips class styles on hover and makes
   the link change font mid-hover; re-assert every state explicitly. */
a.schema-source-link,
a.schema-source-link:hover,
a.schema-source-link:focus {
  margin-left: 12px;
  font-family: monospace;
  font-size: 13px;
  color: var(--blue);
  cursor: pointer;
  text-decoration: underline;
}

a.schema-source-link:hover,
a.schema-source-link:focus {
  color: var(--bright-blue);
}

.helper-entry {
  margin-bottom: 8px;
}

.helper-sig {
  color: var(--bright-white);
  font-size: 14px;
  font-weight: bold;
}

.helper-desc {
  color: var(--black);
  font-size: 13px;
  line-height: 1.4;
}

/* ---- SQL editor (react-simple-code-editor + Prism) syntax highlighting ---- */
.sql-editor {
  background-color: #1a1a1a;
  border: 1px solid #333;
  border-radius: 4px;
  box-sizing: border-box;
  color: #fff;
  cursor: text;
  font-family: monospace;
  font-size: 14px;
  min-height: 260px;
  overflow: auto;
  width: 100%;
}
.sql-editor textarea {
  outline: none;
}
.sql-editor textarea::placeholder {
  color: #666;
}
/* Prism token colors (ayu-ish dark palette) */
.sql-editor .token.keyword {
  color: #59c2ff;
}
.sql-editor .token.function,
.sql-editor .token.mevlog-function {
  color: #ffb454;
}
.sql-editor .token.string,
.sql-editor .token.char {
  color: #aad94c;
}
.sql-editor .token.hex-blob {
  color: #aad94c;
}
.sql-editor .token.number,
.sql-editor .token.boolean,
.sql-editor .token.constant {
  color: #d2a6ff;
}
.sql-editor .token.operator,
.sql-editor .token.punctuation {
  color: #bfbdb6;
}
.sql-editor .token.comment {
  color: #5c6773;
  font-style: italic;
}
.sql-editor .token.variable {
  color: #bfbdb6;
}
.sql-editor .token.mevlog-macro {
  color: #ffd700;
  font-weight: bold;
}
