:root {
  color-scheme: dark;
  --void: #000;
  --surface: #050805;
  --surface-strong: #071007;
  --surface-panel: rgb(0 0 0 / 86%);
  --green: #00ff00;
  --green-soft: #77ff61;
  --green-dim: #008a00;
  --red: #ff1b1b;
  --red-dim: #2a0000;
  --white: #eaffde;
  --muted: #83a983;
  --line: #00ff00;
  --line-dim: rgb(0 255 0 / 24%);
  --line-faint: rgb(0 255 0 / 12%);
  --glow: 0 0 3px rgb(0 255 0 / 72%), 0 0 14px rgb(0 255 0 / 32%);
  --red-glow: 0 0 4px rgb(255 0 0 / 72%), 0 0 14px rgb(255 0 0 / 36%);
  font-family:
    "JetBrains Mono",
    "Space Mono",
    "Cascadia Mono",
    Consolas,
    "Courier New",
    monospace;
  line-height: 1.45;
  color: var(--green);
  background: var(--void);
}

* {
  box-sizing: border-box;
  scrollbar-color: var(--green-dim) var(--void);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 0.8rem;
  height: 0.8rem;
}

::-webkit-scrollbar-track {
  background:
    repeating-linear-gradient(
      0deg,
      rgb(0 255 0 / 5%) 0,
      rgb(0 255 0 / 5%) 1px,
      transparent 1px,
      transparent 6px
    ),
    var(--void);
  border-left: 1px solid var(--line-faint);
}

::-webkit-scrollbar-thumb {
  background:
    linear-gradient(180deg, var(--green-dim), var(--green)),
    var(--green-dim);
  border: 2px solid var(--void);
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 62%),
    0 0 10px rgb(0 255 0 / 18%);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--green);
  box-shadow: 0 0 14px rgb(0 255 0 / 42%);
}

html {
  min-height: 100%;
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--green);
  background:
    radial-gradient(circle at 50% 18%, rgb(0 255 0 / 8%), transparent 34rem),
    linear-gradient(180deg, #030803 0%, #000 34%, #020502 100%);
  font-size: 16px;
  letter-spacing: 0;
}

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

[hidden] {
  display: none !important;
}

::selection {
  color: var(--void);
  background: var(--green);
}

h1,
h2,
p,
pre,
dl,
dd,
ul {
  margin: 0;
}

a {
  color: var(--green);
  text-decoration: none;
  text-shadow: var(--glow);
}

a:hover {
  color: var(--void);
  background: var(--green);
  text-shadow: none;
}

a.is-disabled {
  color: var(--muted);
  pointer-events: none;
  text-decoration: none;
  text-shadow: none;
}

button {
  min-height: 2.5rem;
  padding: 0.45rem 0.75rem;
  color: var(--green);
  background: var(--void);
  border: 2px solid var(--green);
  border-radius: 0;
  cursor: pointer;
  text-transform: uppercase;
  text-shadow: var(--glow);
  box-shadow:
    inset 0 0 8px rgb(0 255 0 / 10%),
    0 0 12px rgb(0 255 0 / 12%);
  transition:
    background-color 90ms steps(2, end),
    border-color 90ms steps(2, end),
    box-shadow 90ms steps(2, end),
    color 90ms steps(2, end),
    transform 90ms steps(2, end);
}

button::before {
  content: "[ ";
}

button::after {
  content: " ]";
}

button:hover:not(:disabled) {
  color: var(--void);
  background: var(--green);
  text-shadow: none;
}

button:active:not(:disabled) {
  transform: translate(1px, 1px);
  box-shadow:
    inset 0 0 14px rgb(0 0 0 / 48%),
    0 0 22px rgb(0 255 0 / 26%);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  background:
    repeating-linear-gradient(
      135deg,
      rgb(0 255 0 / 7%) 0,
      rgb(0 255 0 / 7%) 5px,
      transparent 5px,
      transparent 10px
    ),
    var(--void);
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible,
[role="menuitem"]:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

a:active {
  color: var(--void);
  background: var(--green-soft);
  text-shadow: none;
}

button,
label,
.crt-field,
.scanline-overlay,
.flicker-overlay,
.topbar,
.wallet-card,
.pump-logo-link,
.pump-label,
.pump-status,
.terminal-head,
.controls,
.terminal-actions,
.payment-actions,
.quote-share-row,
.site-footer,
.social-rail,
.dialog-head,
.quote-shortcut,
.terminal-context-menu {
  user-select: none;
}

textarea,
input,
select,
code,
pre,
#answer,
.pump-address,
.dialog-copy {
  user-select: text;
}

.crt-field,
.scanline-overlay,
.flicker-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.crt-field {
  z-index: 0;
  opacity: 0.56;
  background:
    repeating-linear-gradient(
      0deg,
      rgb(0 255 0 / 8%) 0,
      rgb(0 255 0 / 8%) 1px,
      transparent 1px,
      transparent 8px
    ),
    repeating-linear-gradient(
      90deg,
      rgb(0 255 0 / 5%) 0,
      rgb(0 255 0 / 5%) 1px,
      transparent 1px,
      transparent 92px
    );
  mix-blend-mode: screen;
}

.scanline-overlay {
  z-index: 4;
  height: 18px;
  opacity: 0.7;
  background: linear-gradient(
    to bottom,
    transparent,
    rgb(0 255 0 / 11%),
    transparent
  );
  animation: scanline 6s linear infinite;
}

.flicker-overlay {
  z-index: 3;
  opacity: 0.18;
  background: rgb(0 0 0 / 22%);
  mix-blend-mode: overlay;
  animation: flicker 0.16s infinite alternate;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 94rem);
  min-height: calc(100vh - 4.5rem);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(18rem, auto);
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  padding: 0.75rem 0;
  border-bottom: 2px solid var(--green);
}

.brand {
  min-width: 0;
}

.brand h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  color: var(--green);
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 0 5px var(--green),
    0 0 16px rgb(0 255 0 / 84%),
    0 0 32px rgb(0 255 0 / 44%);
}

.brand p,
.wallet-card,
.site-footer {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brand p {
  margin-top: 0.35rem;
  color: var(--muted);
}

#status,
.ready {
  color: var(--green);
  text-shadow: var(--glow);
}

.wallet-card {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.75rem;
  min-width: 0;
}

.wallet-lines {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 0.25rem;
  padding-right: 0.85rem;
  text-align: right;
  border-right: 2px dashed var(--green);
}

.wallet-line {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
}

.wallet-line dt {
  color: var(--muted);
}

.wallet-line dt::after {
  content: ":";
}

.wallet-line dd {
  overflow-wrap: anywhere;
}

.wallet-actions,
.terminal-actions,
.payment-actions,
.quote-share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.wallet-actions {
  justify-content: flex-end;
}

.pump-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0;
  padding: 0.55rem 1rem;
  background: rgb(0 0 0 / 72%);
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
  box-shadow:
    inset 0 0 10px rgb(0 255 0 / 6%),
    0 0 15px rgb(0 255 0 / 10%);
}

.pump-row[hidden] {
  display: none !important;
}

.pump-logo-link {
  display: block;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
}

.pump-logo-link:hover {
  background: transparent;
  transform: scale(1.05);
}

.pump-logo-link:active {
  transform: translate(1px, 1px) scale(1.02);
}

.pump-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 5px var(--green));
  transition: filter 120ms steps(2, end);
}

.pump-logo-link:hover .pump-logo,
.pump-logo-link:focus-visible .pump-logo {
  filter:
    drop-shadow(0 0 5px var(--green))
    drop-shadow(0 0 13px rgb(0 255 0 / 48%));
}

.pump-address-block {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.5rem;
  margin-right: auto;
  font-size: 0.82rem;
  font-weight: 700;
}

.pump-label {
  color: var(--muted);
}

.pump-address {
  max-width: min(42ch, 48vw);
  overflow: hidden;
  color: var(--green);
  font: inherit;
  font-weight: 700;
  text-overflow: ellipsis;
  text-shadow: var(--glow);
  white-space: nowrap;
  border-bottom: 1px dotted transparent;
  transition: border-color 90ms steps(2, end);
}

.pump-address-block:hover .pump-address {
  border-color: var(--line-dim);
}

.pump-copy-button {
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
}

.pump-copy-button.is-copied {
  color: var(--void);
  background: var(--green);
  border-color: var(--white);
  box-shadow:
    inset 0 0 0 2px rgb(0 0 0 / 35%),
    0 0 24px rgb(0 255 0 / 55%);
  text-shadow: none;
}

.pump-status {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: var(--glow);
}

.pump-divider {
  width: 1px;
  height: 1rem;
  background: var(--line-dim);
}

.pump-row:not([hidden]) + .terminal {
  margin-top: 4.5rem;
}

.terminal {
  position: relative;
  max-width: 72rem;
  min-height: 36rem;
  margin: 7rem auto 3rem;
  color: var(--green);
  background: var(--surface-panel);
  border: 0;
  box-shadow:
    0 0 0 2px var(--line-dim),
    0 0 42px rgb(0 255 0 / 22%);
}

.terminal::before {
  content: "";
  position: absolute;
  inset: -0.55rem;
  pointer-events: none;
  background:
    linear-gradient(var(--green), var(--green)) 0 0 / 2.4rem 2px no-repeat,
    linear-gradient(var(--green), var(--green)) 0 0 / 2px 2.4rem no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 0 / 2.4rem 2px no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 0 / 2px 2.4rem no-repeat,
    linear-gradient(var(--green), var(--green)) 0 100% / 2.4rem 2px no-repeat,
    linear-gradient(var(--green), var(--green)) 0 100% / 2px 2.4rem no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 100% / 2.4rem 2px
      no-repeat,
    linear-gradient(var(--green), var(--green)) 100% 100% / 2px 2.4rem
      no-repeat;
  opacity: 0.72;
  filter: drop-shadow(0 0 7px rgb(0 255 0 / 38%));
}

body.attention-boot .terminal {
  animation: boot-pulse 1.85s steps(4, end) both;
}

.terminal-head {
  display: grid;
  gap: 0.65rem;
  padding: 0.75rem 1.35rem 0;
  color: var(--green);
  text-shadow: var(--glow);
}

.terminal-title {
  display: flex;
  min-width: 0;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.terminal-title strong {
  margin: 0 0.5rem;
}

.terminal-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0 0.65rem;
  border-bottom: 2px dashed var(--green);
  font-size: 0.82rem;
  font-weight: 700;
}

.unstable-tag,
.text-error {
  color: var(--red);
  text-shadow: var(--red-glow);
}

.unstable-tag {
  animation: fast-flicker 2.4s infinite;
}

.terminal-body {
  padding: 1.25rem 1.35rem 1.5rem;
  border-right: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  border-left: 2px solid var(--green);
}

.console {
  display: flex;
  flex-direction: column;
  min-height: 30rem;
}

.console-log {
  flex: 1 1 auto;
  min-height: 18rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--line-dim);
  background: rgb(0 0 0 / 58%);
}

#answer {
  min-height: 18rem;
  max-height: 40vh;
  padding: 0.95rem 1rem;
  overflow: auto;
  color: var(--green);
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: 0;
  font-size: 0.95rem;
  font-weight: 700;
  text-shadow: var(--glow);
}

#answer:hover,
#answer:focus-visible {
  scrollbar-color: var(--green) var(--void);
}

#answer::-webkit-scrollbar-thumb {
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 62%),
    0 0 10px rgb(0 255 0 / 18%);
}

#answer:hover::-webkit-scrollbar-thumb,
#answer:focus-visible::-webkit-scrollbar-thumb {
  background: var(--green);
  box-shadow:
    inset 0 0 0 1px rgb(0 0 0 / 62%),
    0 0 16px rgb(0 255 0 / 48%);
}

.payment-panel {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  color: var(--red);
  background: rgb(255 0 0 / 13%);
  border-left: 4px solid var(--red);
  box-shadow: inset 0 0 0 1px rgb(255 0 0 / 24%);
  text-shadow: var(--red-glow);
}

.payment-panel > div:first-child {
  flex: 1 1 18rem;
  min-width: 0;
}

#payment-link {
  display: block;
  overflow-wrap: anywhere;
}

.ask-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.75rem;
}

.ask-row label {
  padding-top: 0.65rem;
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: var(--glow);
}

.input-shell {
  position: relative;
  min-width: 0;
  border: 2px solid var(--green);
  background: rgb(0 0 0 / 64%);
  box-shadow:
    inset 0 0 12px rgb(0 255 0 / 9%),
    0 0 18px rgb(0 255 0 / 13%);
}

.console:not(.question-activated):not(.is-running):not(.is-submit-cooldown)
  .input-shell:not(:focus-within) {
  animation: input-attention-background 1.05s steps(2, end) infinite;
}

textarea {
  display: block;
  width: 100%;
  min-height: 8rem;
  padding: 0.85rem;
  resize: vertical;
  color: var(--green);
  caret-color: var(--green);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: 0;
  font-weight: 700;
  text-shadow: var(--glow);
  transition:
    background-color 120ms steps(2, end),
    box-shadow 120ms steps(2, end);
}

textarea::placeholder {
  color: rgb(0 255 0 / 52%);
}

textarea:focus {
  background: rgb(0 255 0 / 4%);
  box-shadow: inset 0 0 0 1px var(--line-faint);
}

textarea::selection,
#answer::selection {
  color: var(--void);
  background: var(--green-soft);
  text-shadow: none;
}

.block-cursor {
  position: absolute;
  top: 0.95rem;
  left: 0.95rem;
  width: 0.85rem;
  height: 1.35rem;
  background: var(--green);
  box-shadow: 0 0 12px rgb(0 255 0 / 84%);
  pointer-events: none;
  animation: blink 1s step-end infinite;
}

.question-activated .block-cursor,
.input-shell:focus-within .block-cursor,
.input-shell:has(textarea:not(:placeholder-shown)) .block-cursor {
  display: none;
}

.is-submit-cooldown .input-shell {
  border-color: var(--red);
  box-shadow:
    inset 0 0 12px rgb(255 0 0 / 12%),
    0 0 22px rgb(255 0 0 / 18%);
}

.controls,
.terminal-actions {
  grid-column: 2;
}

.controls {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.4rem;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

#char-count {
  transition:
    color 120ms steps(2, end),
    text-shadow 120ms steps(2, end);
}

#char-count.is-warning {
  color: var(--green-soft);
  text-shadow: 0 0 12px rgb(119 255 97 / 42%);
}

#char-count.is-danger,
#char-count.is-over-limit {
  color: var(--red);
  text-shadow: var(--red-glow);
}

#char-count.is-over-limit::before {
  content: "OVERFLOW ";
}

.terminal-actions {
  justify-content: flex-end;
}

.ghost-button {
  color: var(--muted);
  border-color: var(--line-dim);
  text-shadow: none;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  min-height: 4.5rem;
  padding: 1rem 1.5rem;
  border-top: 2px dashed var(--green);
  background: rgb(0 0 0 / 82%);
}

.social-rail {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.social-rail h2 {
  font-size: inherit;
  font-weight: 700;
}

.social-rail ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.social-link::before {
  content: "[ ";
}

.social-link::after {
  content: " ]";
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: var(--void);
  background: var(--green);
  text-shadow: none;
}

.site-footer a:hover::before,
.site-footer a:hover::after,
.site-footer a:focus-visible::before,
.site-footer a:focus-visible::after {
  color: var(--void);
  background: var(--green);
}

.site-footer a:active::before,
.site-footer a:active::after {
  color: var(--void);
  background: var(--green-soft);
}

.quote-shortcut {
  position: fixed;
  z-index: 10;
}

dialog {
  width: min(42rem, calc(100vw - 2rem));
  padding: 0;
  color: var(--green);
  background: var(--void);
  border: 2px solid var(--green);
  border-radius: 0;
  box-shadow: 0 0 36px rgb(0 255 0 / 24%);
}

dialog[open] {
  animation: dialog-snap-in 140ms steps(3, end) both;
}

dialog::backdrop {
  background:
    repeating-linear-gradient(
      0deg,
      rgb(0 255 0 / 5%) 0,
      rgb(0 255 0 / 5%) 1px,
      transparent 1px,
      transparent 7px
    ),
    rgb(0 0 0 / 78%);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem;
  border-bottom: 2px dashed var(--green);
  text-transform: uppercase;
}

.dialog-head h2,
.dialog-copy h2 {
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dialog-copy,
#wallet-list,
.quote-dialog-body {
  padding: 1rem;
}

.dialog-copy {
  display: grid;
  gap: 0.75rem;
}

.dialog-copy code {
  display: inline-block;
  width: fit-content;
  padding: 0.3rem 0.45rem;
  color: var(--red);
  background: var(--red-dim);
  border-left: 4px solid var(--red);
  text-shadow: var(--red-glow);
}

#wallet-list {
  display: grid;
  gap: 0.5rem;
}

.wallet-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.wallet-features,
.muted {
  color: var(--muted);
}

#quote-preview {
  display: block;
  width: 100%;
  max-height: 70vh;
  margin-bottom: 0.75rem;
  background: var(--void);
  border: 1px solid var(--green);
}

.quote-share-row {
  margin-top: 0.75rem;
}

.has-selection {
  box-shadow: 0 0 0 2px var(--white);
}

.has-selection.is-flashing {
  animation: quote-ready-flash 1.2s steps(2, end) 3;
}

.terminal-context-menu {
  position: fixed;
  z-index: 20;
  display: grid;
  min-width: 13rem;
  padding: 0.35rem;
  color: var(--green);
  background:
    repeating-linear-gradient(
      0deg,
      rgb(0 255 0 / 6%) 0,
      rgb(0 255 0 / 6%) 1px,
      transparent 1px,
      transparent 7px
    ),
    rgb(0 0 0 / 96%);
  border: 2px solid var(--green);
  box-shadow:
    inset 0 0 14px rgb(0 255 0 / 8%),
    0 0 28px rgb(0 255 0 / 26%);
}

.terminal-context-menu[hidden] {
  display: none !important;
}

.terminal-context-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.35rem 0.55rem;
  text-align: left;
  border-width: 1px;
  box-shadow: none;
}

.terminal-context-menu button + button {
  margin-top: 0.25rem;
}

.terminal-context-menu button:hover:not(:disabled),
.terminal-context-menu button:focus-visible:not(:disabled) {
  color: var(--void);
  background: var(--green);
  text-shadow: none;
}

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

@keyframes boot-pulse {
  0% {
    opacity: 0.2;
    filter: brightness(0.8);
    transform: scaleY(0.985);
  }
  18%,
  38% {
    opacity: 1;
    filter: brightness(1.25);
    transform: scaleY(1);
  }
  28%,
  50% {
    opacity: 0.72;
    filter: brightness(0.9);
  }
  100% {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes quote-ready-flash {
  0%,
  100% {
    color: var(--void);
    background: var(--green);
    text-shadow: none;
    box-shadow:
      0 0 0 2px var(--white),
      0 0 24px rgb(0 255 0 / 44%);
  }
  50% {
    color: var(--green);
    background: var(--void);
    text-shadow: var(--glow);
  }
}

@keyframes dialog-snap-in {
  0% {
    opacity: 0;
    transform: translateY(0.5rem) scaleY(0.96);
  }
  55% {
    opacity: 1;
    transform: translateY(-0.12rem) scaleY(1.02);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes glitch {
  0%,
  100% {
    text-shadow:
      0 0 5px var(--green),
      0 0 16px rgb(0 255 0 / 84%),
      0 0 32px rgb(0 255 0 / 44%);
    transform: none;
  }
  8% {
    text-shadow:
      -2px 0 var(--red),
      2px 0 var(--green-soft),
      0 0 18px rgb(0 255 0 / 65%);
    transform: translate(1px, 0);
  }
  10% {
    transform: translate(-1px, 0);
  }
  12%,
  46% {
    transform: none;
  }
  47% {
    text-shadow:
      2px 0 var(--red),
      -2px 0 var(--green-soft),
      0 0 18px rgb(0 255 0 / 65%);
    transform: translate(-1px, 1px);
  }
  49% {
    transform: none;
  }
}

@keyframes input-attention-background {
  0%,
  48% {
    background: rgb(0 0 0 / 64%);
    box-shadow:
      inset 0 0 12px rgb(0 255 0 / 9%),
      0 0 18px rgb(0 255 0 / 13%);
  }
  49%,
  100% {
    background: var(--green);
    box-shadow:
      inset 0 0 0 2px rgb(0 0 0 / 42%),
      0 0 28px rgb(0 255 0 / 62%);
  }
}

@keyframes flicker {
  0% {
    opacity: 0.12;
  }
  100% {
    opacity: 0.22;
  }
}

@keyframes fast-flicker {
  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    opacity: 1;
  }
  20%,
  22%,
  24%,
  55% {
    opacity: 0.25;
  }
  40% {
    opacity: 0.82;
    transform: translate(1px, -1px);
  }
}

@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

@keyframes ask-throttle-shake {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  10% {
    transform: translate3d(-18px, 6px, 0) rotate(-0.8deg);
  }
  20% {
    transform: translate3d(16px, -8px, 0) rotate(0.9deg);
  }
  30% {
    transform: translate3d(-22px, 5px, 0) rotate(-1deg);
  }
  40% {
    transform: translate3d(18px, -6px, 0) rotate(0.8deg);
  }
  50% {
    transform: translate3d(-14px, 8px, 0) rotate(-0.7deg);
  }
  60% {
    transform: translate3d(12px, -4px, 0) rotate(0.6deg);
  }
  75% {
    transform: translate3d(-8px, 3px, 0) rotate(-0.35deg);
  }
}

body.ask-throttle-shake {
  overflow-x: hidden;
}

body.ask-throttle-shake .shell,
body.ask-throttle-shake .site-footer,
body.ask-throttle-shake dialog[open] {
  animation: ask-throttle-shake 0.46s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@media (prefers-reduced-motion: reduce) {
  .scanline-overlay,
  .flicker-overlay,
  .unstable-tag,
  .console:not(.question-activated):not(.is-running):not(.is-submit-cooldown)
    .input-shell:not(:focus-within),
  .block-cursor,
  .has-selection.is-flashing,
  dialog[open],
  body.attention-boot .terminal {
    animation: none;
  }

  body.ask-throttle-shake .shell,
  body.ask-throttle-shake .site-footer,
  body.ask-throttle-shake dialog[open] {
    animation-duration: 0.12s;
  }
}

@media (forced-colors: active) {
  :root {
    color-scheme: dark;
  }

  body,
  .terminal,
  .terminal-body,
  .console-log,
  dialog,
  .terminal-context-menu {
    forced-color-adjust: none;
    color: CanvasText;
    background: Canvas;
    border-color: CanvasText;
    box-shadow: none;
    text-shadow: none;
  }

  button,
  a,
  textarea,
  input,
  select {
    forced-color-adjust: auto;
  }

  .crt-field,
  .scanline-overlay,
  .flicker-overlay {
    display: none;
  }
}

@media (max-width: 920px) {
  .shell {
    padding: 1rem;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .wallet-card {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .wallet-lines {
    text-align: left;
  }

  .pump-row {
    align-items: flex-start;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.75rem;
  }

  .pump-address-block {
    flex-wrap: wrap;
  }

  .pump-address {
    max-width: 100%;
  }

  .pump-status {
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.25rem;
    white-space: normal;
  }

  .pump-row:not([hidden]) + .terminal {
    margin-top: 3.5rem;
  }

  .terminal {
    margin-top: 4rem;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  .shell {
    padding: 0.75rem 0.75rem 1.5rem;
  }

  .brand h1 {
    font-size: 2rem;
  }

  .wallet-card,
  .wallet-actions,
  .terminal-meta,
  .payment-panel,
  .site-footer,
  .social-rail {
    display: block;
  }

  .wallet-lines {
    grid-template-columns: 1fr;
    margin-bottom: 0.75rem;
    padding-right: 0;
    border-right: 0;
  }

  .wallet-actions,
  .terminal-actions,
  .payment-actions,
  .quote-share-row {
    display: grid;
    width: 100%;
    gap: 0.5rem;
    justify-content: stretch;
  }

  .terminal {
    min-height: 0;
    margin-top: 3rem;
  }

  .terminal-title span:last-child {
    display: none;
  }

  .terminal-body {
    padding: 1rem;
  }

  .console {
    min-height: 0;
  }

  .console-log,
  #answer {
    min-height: 16rem;
  }

  .ask-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .controls,
  .terminal-actions {
    grid-column: 1 / -1;
  }

  button,
  textarea {
    width: 100%;
  }

  .pump-copy-button {
    width: auto;
  }

  .social-rail h2 {
    margin-bottom: 0.5rem;
  }

  .social-rail ul {
    justify-content: center;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  html,
  body {
    height: 100%;
    min-height: 100dvh;
  }

  body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0 auto;
    padding: 0.5rem clamp(0.75rem, 3vw, 1.25rem);
    overflow: hidden;
    border-right: 1px solid var(--green);
    border-left: 1px solid var(--green);
  }

  .topbar {
    display: grid;
    flex: 0 0 auto;
    grid-template-areas:
      "brand"
      "metrics"
      "status"
      "actions";
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem 0.5rem;
    min-height: 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--green);
  }

  .brand {
    display: contents;
  }

  .brand h1 {
    grid-area: brand;
    min-width: 0;
    font-size: 1.5rem;
    line-height: 1;
    animation: glitch 3s infinite;
  }

  .brand p {
    grid-area: status;
    margin-top: 0;
    overflow: hidden;
    font-size: 0.62rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-copy {
    display: none;
  }

  .wallet-card {
    display: contents;
  }

  .wallet-lines {
    grid-area: metrics;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0;
    padding-right: 0;
    color: var(--green);
    text-align: right;
    white-space: nowrap;
    border-right: 0;
  }

  .wallet-line {
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
  }

  .wallet-line + .wallet-line {
    padding-left: 0.5rem;
    border-left: 1px solid var(--green);
  }

  .wallet-line dt {
    font-size: 0;
  }

  .wallet-line dt::before {
    content: attr(data-mobile-label) ":";
    font-size: 0.7rem;
  }

  .wallet-line dd {
    min-width: 0;
  }

  .wallet-line dd strong {
    display: inline-block;
    width: 100%;
    max-width: none;
    overflow: hidden;
    color: var(--green-soft);
    font-size: 0;
    line-height: 1;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
  }

  .wallet-line dd strong::before {
    content: attr(data-mobile-value);
    font-size: 0.7rem;
  }

  .wallet-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 0.35rem;
  }

  .wallet-actions button {
    min-height: 2.35rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
  }

  .pump-row {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.35rem 0.25rem;
    background: var(--void);
    border-top: 0;
    border-right: 0;
    border-bottom: 1px solid var(--green);
    border-left: 0;
    box-shadow: none;
  }

  .pump-row[hidden] {
    display: none !important;
  }

  .pump-logo-link {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--green);
  }

  .pump-address-block {
    flex: 1 1 auto;
    justify-content: center;
    flex-wrap: nowrap;
    margin-right: 0;
    font-size: 0.82rem;
  }

  .pump-address {
    max-width: 100%;
  }

  .pump-copy-button {
    flex: 0 0 2.1rem;
    width: 2.1rem;
    min-height: 2.1rem;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .pump-copy-button::before {
    content: "COPY";
    font-size: 0.55rem;
  }

  .pump-copy-button::after {
    content: "";
  }

  .pump-status {
    display: none;
  }

  .terminal,
  .pump-row:not([hidden]) + .terminal {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0.75rem 0 0.5rem;
    overflow: hidden;
    background: var(--void);
    border: 1px solid var(--green);
    box-shadow: 0 0 15px rgb(0 255 0 / 15%);
  }

  .terminal-head {
    flex: 0 0 auto;
    gap: 0.3rem;
    padding: 0.5rem;
  }

  .terminal-title {
    display: none;
  }

  .terminal-meta {
    display: flex;
    gap: 0.35rem;
    padding: 0;
    font-size: 0.62rem;
    line-height: 1.25;
    border-bottom: 0;
  }

  .terminal-meta p:first-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .unstable-tag {
    flex: 0 0 auto;
  }

  .terminal-body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 0.5rem;
    border: 0;
  }

  .console {
    flex: 1 1 auto;
    min-height: 0;
  }

  .console-log {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--green);
    box-shadow: 0 0 15px rgb(0 255 0 / 15%);
  }

  #answer {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0.75rem;
    overflow: auto;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .payment-panel:not([hidden]) {
    display: block;
    flex: 0 0 auto;
    max-height: 7.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    overflow: auto;
    font-size: 0.72rem;
  }

  .payment-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-top: 0.5rem;
  }

  .ask-row {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.45rem;
  }

  .ask-row label {
    padding-top: 0.35rem;
    font-size: 1.2rem;
  }

  .input-shell {
    border-width: 1px;
    box-shadow: 0 0 10px rgb(0 255 0 / 20%);
  }

  textarea {
    min-height: 5.5rem;
    max-height: 7.25rem;
    padding: 0.55rem;
    resize: none;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .block-cursor {
    top: auto;
    right: 0.65rem;
    bottom: 0.65rem;
    left: auto;
    width: 0.55rem;
    height: 1rem;
  }

  .controls {
    grid-column: 1 / -1;
    align-items: center;
    margin-top: 0;
    font-size: 0.68rem;
    line-height: 1;
  }

  #char-count::before {
    content: "CHAR_COUNT: [ ";
  }

  #char-count::after {
    content: " ]";
  }

  #ask-state {
    text-align: right;
    text-transform: uppercase;
  }

  .terminal-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    width: 100%;
    gap: 0.45rem;
  }

  .terminal-actions button {
    min-height: 2.5rem;
    padding: 0.55rem 0.4rem;
    font-size: 0.76rem;
  }

  #ask-button {
    font-size: 0.86rem;
    font-weight: 800;
  }

  .site-footer {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: none;
    min-height: 0;
    margin: 0 auto;
    padding: 0.45rem clamp(0.75rem, 3vw, 1.25rem) 0.55rem;
    font-size: 0.62rem;
    line-height: 1.2;
    background: var(--void);
    border-top: 1px dashed var(--green);
  }

  .site-footer p {
    font-size: 0.62rem;
  }

  .social-rail,
  .social-rail ul {
    display: flex;
    align-items: center;
  }

  .social-rail h2 {
    display: none;
  }

  .social-rail ul {
    gap: 0.5rem;
  }

  .social-link {
    font-size: 0;
  }

  .social-link::before {
    content: "[ " attr(data-mobile-label) " ]";
    font-size: 0.62rem;
  }

  .social-link::after {
    content: "";
  }

  dialog {
    max-height: calc(100dvh - 2rem);
    overflow: auto;
  }
}
