:root {
  color-scheme: dark;
  --ink: #f3f6f1;
  --muted: #909a94;
  --dim: #626c67;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --panel: rgba(17, 22, 20, 0.86);
  --panel-light: #171d1a;
  --canvas: #080b0a;
  --acid: #c6ff36;
  --acid-dark: #8dbe0e;
  --error: #ff6f61;
  --success: #8de118;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 84% 5%, rgba(198, 255, 54, 0.1), transparent 26rem),
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    var(--canvas);
  background-size: auto, 48px 48px, 48px 48px, auto;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.page-shell {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

main {
  padding-top: 24px;
}

.tool-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-strong);
}

.tool-tab {
  position: relative;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 160ms ease, background 160ms ease;
}

.tool-tab::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}

.tool-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.025);
}

.tool-tab.is-active {
  color: var(--acid);
}

.tool-tab.is-active::after {
  background: var(--acid);
}

.tool-tab:focus-visible {
  outline: 1px solid var(--acid);
  outline-offset: -3px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  align-items: end;
  gap: 3px;
  width: 18px;
  height: 18px;
}

.brand-mark span {
  display: block;
  height: 7px;
  background: var(--acid);
}

.brand-mark span:nth-child(2) {
  height: 13px;
}

.brand-mark span:nth-child(3) {
  height: 18px;
}

.environment {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 5px rgba(198, 255, 54, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 60px;
  align-items: end;
  padding: 86px 0 58px;
}

.eyebrow,
.step {
  margin: 0 0 18px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  grid-row: span 2;
  max-width: 780px;
  margin: 0;
  font-size: clamp(48px, 7.3vw, 104px);
  font-weight: 570;
  letter-spacing: -0.064em;
  line-height: 0.88;
}

.hero-copy {
  max-width: 380px;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: 1.07fr 0.93fr;
  border: 1px solid var(--line-strong);
  background: rgba(9, 12, 11, 0.78);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.3);
}

.panel {
  min-width: 0;
  padding: 34px;
}

.input-panel {
  border-right: 1px solid var(--line-strong);
}

.result-panel {
  background: rgba(255, 255, 255, 0.018);
}

.panel-heading,
.request-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.panel-heading .step,
.request-heading .step {
  margin-bottom: 8px;
}

h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 580;
  letter-spacing: -0.03em;
}

.form-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 580;
  letter-spacing: -0.045em;
  line-height: 1;
}

.form-heading-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.text-button {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid var(--dim);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover {
  border-color: var(--acid);
  color: var(--ink);
}

[hidden] {
  display: none !important;
}

.image-drop-zone {
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  background:
    linear-gradient(135deg, rgba(198, 255, 54, 0.035), transparent 45%),
    #0b0f0d;
  transition: border-color 160ms ease, background 160ms ease;
}

.image-drop-zone[data-state="dragging"] {
  border-color: var(--acid);
  background: rgba(198, 255, 54, 0.07);
}

.image-drop-zone[data-state="scanning"] {
  border-color: rgba(198, 255, 54, 0.45);
}

.image-drop-zone[data-state="success"] {
  border-style: solid;
  border-color: rgba(141, 225, 24, 0.45);
}

.image-drop-zone[data-state="error"] {
  border-color: rgba(255, 111, 97, 0.5);
}

.image-empty-state,
.image-preview-state {
  display: grid;
  align-items: center;
  gap: 18px;
  min-height: 108px;
  padding: 18px;
}

.image-empty-state {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.scan-symbol {
  position: relative;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.scan-symbol i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--acid);
  border-style: solid;
}

.scan-symbol i:nth-child(1) {
  top: 8px;
  left: 8px;
  border-width: 2px 0 0 2px;
}

.scan-symbol i:nth-child(2) {
  top: 8px;
  right: 8px;
  border-width: 2px 2px 0 0;
}

.scan-symbol i:nth-child(3) {
  right: 8px;
  bottom: 8px;
  border-width: 0 2px 2px 0;
}

.scan-symbol i:nth-child(4) {
  bottom: 8px;
  left: 8px;
  border-width: 0 0 2px 2px;
}

.scan-symbol span {
  position: absolute;
  top: 23px;
  right: 7px;
  left: 7px;
  height: 1px;
  background: var(--acid);
  box-shadow: 0 0 8px rgba(198, 255, 54, 0.7);
}

.image-prompt,
.image-file-info {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.image-prompt strong,
.image-file-info strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-prompt span,
.image-file-info span {
  overflow: hidden;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-button,
.remove-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: var(--panel-light);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
  transition: border-color 160ms ease, color 160ms ease;
}

.upload-button:hover,
.remove-image:hover {
  border-color: var(--acid);
  color: var(--acid);
}

.image-preview-state {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}

.image-preview-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.image-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-scan-line {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  opacity: 0;
  background: var(--acid);
  box-shadow: 0 0 7px var(--acid);
}

.image-drop-zone[data-state="scanning"] .image-scan-line {
  opacity: 1;
  animation: scan-image 1.2s ease-in-out infinite alternate;
}

.image-drop-zone[data-state="success"] .image-file-info span {
  color: var(--success);
}

.image-drop-zone[data-state="error"] .image-file-info span {
  color: var(--error);
}

.input-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-divider::before,
.input-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

@keyframes scan-image {
  from {
    transform: translateY(7px);
  }
  to {
    transform: translateY(63px);
  }
}

textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  color: #cdd7d1;
  background: #0b0f0d;
  padding: 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea::placeholder,
input::placeholder {
  color: #4e5752;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(198, 255, 54, 0.58);
  box-shadow: inset 3px 0 0 var(--acid);
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
}

.payload-meta {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 45px;
  padding: 0 18px;
  border: 1px solid var(--acid);
  background: var(--acid);
  color: #10140b;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.025em;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.primary-button:hover,
.secondary-button:hover {
  background: #ddff87;
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 27px;
  padding: 0 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.status-badge[data-state="success"] {
  border-color: rgba(141, 225, 24, 0.35);
  color: var(--success);
}

.status-badge[data-state="success"] span {
  background: var(--success);
}

.status-badge[data-state="error"] {
  border-color: rgba(255, 111, 97, 0.35);
  color: var(--error);
}

.status-badge[data-state="error"] span {
  background: var(--error);
}

.status-badge[data-state="running"] {
  border-color: rgba(198, 255, 54, 0.35);
  color: var(--acid);
}

.status-badge[data-state="running"] span {
  background: var(--acid);
  animation: request-pulse 800ms ease-in-out infinite alternate;
}

.field-stack {
  display: grid;
  gap: 23px;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.field-label-row label {
  color: #d7ded9;
  font-size: 12px;
  font-weight: 650;
}

.field-label-row span {
  overflow: hidden;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.copy-field input {
  min-width: 0;
  height: 50px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: #0b0f0d;
  padding: 0 15px;
  font-family: var(--mono);
  font-size: 12px;
}

.copy-field input[aria-invalid="true"] {
  border-color: var(--error);
}

.copy-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--panel-light);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  transition: color 160ms ease, border-color 160ms ease;
}

.copy-button {
  min-width: 62px;
}

.copy-button:hover,
.icon-button:hover {
  border-color: var(--acid);
  color: var(--acid);
}

.error-message {
  min-height: 18px;
  margin: 20px 0 0;
  color: var(--error);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
}

.request-section {
  padding: 42px 0 48px;
}

.request-heading {
  align-items: end;
}

.secondary-button {
  min-width: 112px;
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.secondary-button:hover {
  border-color: var(--acid);
  background: var(--acid);
  color: #10140b;
}

.request-actions {
  display: flex;
  gap: 10px;
}

.request-actions .primary-button,
.request-actions .secondary-button {
  min-width: 124px;
}

.code-window {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #050706;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.code-toolbar > span:first-child {
  display: flex;
  gap: 6px;
}

.code-toolbar i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #343b37;
}

pre {
  min-height: 116px;
  margin: 0;
  overflow-x: auto;
  padding: 28px;
}

code {
  color: #d7e1db;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.8;
  white-space: pre;
}

.endpoint-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 38px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.015);
}

.endpoint-row > span {
  padding: 0 14px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
}

.endpoint-row a {
  overflow: hidden;
  padding: 13px 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.endpoint-row a:hover {
  color: var(--ink);
}

.icon-button {
  align-self: stretch;
  border-width: 0 0 0 1px;
}

.response-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 38px 0 18px;
}

.response-heading .step {
  margin-bottom: 8px;
}

.response-window pre {
  min-height: 170px;
}

.response-code {
  display: block;
  color: #d7e1db;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.generator-tool-panel {
  padding-bottom: 48px;
}

.generator-page-heading,
.generator-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.generator-page-heading {
  padding: 34px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(198, 255, 54, 0.045), transparent 42%),
    rgba(9, 12, 11, 0.78);
}

.generator-page-heading .step,
.generator-section-heading .step {
  margin-bottom: 8px;
}

.generator-intro {
  max-width: 660px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.generator-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, 0.92fr);
  margin-top: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(9, 12, 11, 0.78);
}

.generator-form,
.generator-result {
  min-width: 0;
  padding: 30px;
}

.generator-form {
  border-right: 1px solid var(--line-strong);
}

.generator-result {
  background: rgba(255, 255, 255, 0.018);
}

.service-code-chip {
  min-height: 27px;
  padding: 7px 10px 0;
  border: 1px solid rgba(198, 255, 54, 0.35);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.service-type-fieldset {
  min-width: 0;
  margin: 26px 0 18px;
  padding: 0;
  border: 0;
}

.service-type-fieldset legend {
  margin-bottom: 9px;
  color: #d7ded9;
  font-size: 11px;
  font-weight: 650;
}

.service-type-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.service-type-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.service-type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.service-type-option span {
  display: grid;
  gap: 5px;
  min-height: 65px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  background: #0b0f0d;
  transition: border-color 160ms ease, background 160ms ease;
}

.service-type-option strong {
  color: var(--ink);
  font-size: 12px;
}

.service-type-option small {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.4;
}

.service-type-option input:checked + span {
  border-color: var(--acid);
  background: rgba(198, 255, 54, 0.065);
  box-shadow: inset 3px 0 0 var(--acid);
}

.service-type-option input:focus-visible + span {
  outline: 1px solid var(--acid);
  outline-offset: 2px;
}

.generator-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 14px;
}

.generator-field-wide {
  grid-column: span 2;
}

.generator-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.generator-field label,
.qr-content-heading label {
  color: #d7ded9;
  font-size: 11px;
  font-weight: 650;
}

.generator-field input,
.generator-field select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #0b0f0d;
  color: var(--ink);
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.generator-field select {
  padding-right: 38px;
  appearance: none;
  cursor: pointer;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--acid);
  content: "⌄";
  font-size: 14px;
  pointer-events: none;
  transform: translateY(-58%);
}

.generator-field small {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.45;
}

.payment-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.payment-fields .generator-field-grid {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(100px, 0.55fr);
}

.payment-profile-note {
  margin: 14px 0 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
}

.generator-form .error-message {
  margin-top: 14px;
}

.generator-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 12px;
}

.generator-form-actions p {
  margin: 0;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
}

.generated-qr-frame {
  display: grid;
  min-height: 330px;
  margin-top: 26px;
  place-items: center;
  border: 1px solid var(--line);
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.018) 25%, transparent 25%),
    #0b0f0d;
  background-position: 0 0, 12px 12px;
  background-size: 24px 24px;
}

.generated-qr-frame[data-state="success"] {
  border-color: rgba(141, 225, 24, 0.38);
}

.generated-qr-empty {
  display: grid;
  max-width: 260px;
  justify-items: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
}

.generated-qr-empty strong {
  font-size: 12px;
}

.generated-qr-empty small {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
}

.generated-qr-canvas {
  padding: 18px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

.generated-qr-canvas canvas,
.generated-qr-canvas img {
  display: block;
  width: 252px;
  height: 252px;
  image-rendering: pixelated;
}

.qr-content-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.qr-content-heading > div {
  display: grid;
  gap: 5px;
}

.qr-content-heading span {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
}

.qr-copy-button {
  min-width: 106px;
  min-height: 34px;
}

.qr-copy-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.qr-content-output {
  min-height: 150px;
  margin-top: 10px;
  resize: vertical;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.sql-tool-panel {
  padding-bottom: 48px;
}

.sql-page-heading,
.sql-card-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.sql-page-heading {
  padding: 34px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(198, 255, 54, 0.045), transparent 42%),
    rgba(9, 12, 11, 0.78);
}

.sql-page-heading .step,
.sql-card-heading .step {
  margin-bottom: 8px;
}

.sql-intro {
  max-width: 650px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sql-card-stack {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.sql-card {
  padding: 30px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 17, 15, 0.86);
}

.compact-button {
  min-width: 96px;
  min-height: 38px;
}

.sql-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 26px 0 18px;
}

.sql-field-wide {
  grid-column: span 2;
}

.sql-field {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.sql-field label {
  color: #d7ded9;
  font-size: 11px;
  font-weight: 650;
}

.sql-field input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  outline: 0;
  background: #0b0f0d;
  color: var(--ink);
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 11px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.sql-field input:focus {
  border-color: rgba(198, 255, 54, 0.58);
  box-shadow: inset 3px 0 0 var(--acid);
}

.sql-code-window pre {
  min-height: 0;
  padding: 22px;
}

.sql-code-window code {
  font-size: 11px;
}

@keyframes request-pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0 42px;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.04em;
}

footer p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 16px;
  opacity: 0;
  border: 1px solid rgba(198, 255, 54, 0.4);
  background: #151c11;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 10px;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.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;
}

@media (max-width: 840px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-top: 64px;
  }

  .hero h1 {
    grid-row: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .generator-workspace {
    grid-template-columns: 1fr;
  }

  .generator-form {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .input-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-strong);
  }

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

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 28px, 1240px);
  }

  .tool-tab {
    min-width: 0;
    flex: 1;
    padding: 0 8px;
  }

  .tool-tabs {
    overflow-x: auto;
  }

  .tool-tab {
    min-width: 132px;
  }

  .hero {
    padding: 52px 0 40px;
  }

  .form-heading-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 10px;
  }

  .hero h1 {
    font-size: clamp(44px, 15vw, 70px);
  }

  .panel {
    padding: 24px 18px;
  }

  .generator-page-heading,
  .generator-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .generator-page-heading,
  .generator-form,
  .generator-result {
    padding: 24px 18px;
  }

  .generator-page-heading .status-badge,
  .generator-section-heading .service-code-chip {
    align-self: flex-start;
  }

  .service-type-options,
  .generator-field-grid,
  .payment-fields .generator-field-grid {
    grid-template-columns: 1fr;
  }

  .generator-field-wide {
    grid-column: auto;
  }

  .generator-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .generated-qr-frame {
    min-height: 296px;
  }

  .generated-qr-canvas canvas,
  .generated-qr-canvas img {
    width: min(232px, calc(100vw - 100px));
    height: min(232px, calc(100vw - 100px));
  }

  .image-empty-state {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .upload-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .image-preview-state {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .image-preview-wrap {
    width: 58px;
    height: 58px;
  }

  .remove-image {
    grid-column: 1 / -1;
  }

  .input-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button {
    width: 100%;
  }

  .request-section {
    padding-top: 64px;
  }

  .request-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .request-actions {
    width: 100%;
  }

  .request-actions .primary-button,
  .request-actions .secondary-button {
    min-width: 0;
    flex: 1;
  }

  .sql-page-heading,
  .sql-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .sql-page-heading,
  .sql-card {
    padding: 24px 18px;
  }

  .sql-page-heading .primary-button,
  .sql-card-heading .secondary-button {
    width: 100%;
  }

  .sql-field-grid {
    grid-template-columns: 1fr;
  }

  .sql-field-wide {
    grid-column: auto;
  }

  .secondary-button {
    align-self: flex-start;
  }

  .field-label-row span {
    max-width: 45%;
  }

  footer {
    flex-direction: column;
  }
}

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