.gas-page {
  --gas-ink: var(--text-primary, #1e293b);
  --gas-muted: #64748b;
  --gas-accent: var(--primary, #4f46e5);
  --gas-line: #e2e8f0;
  --gas-surface: oklch(97% .005 260);
  --gas-radius-sm: 8px;
  --gas-radius-md: 12px;
  max-width: 880px;
  margin: 4px auto 40px;
  color: var(--gas-ink);
  font-size: 14px;
  line-height: 1.6;
  container: gas-settings / inline-size;
  animation: gas-enter .22s cubic-bezier(.16, 1, .3, 1) both;
}
.gas-page *, .gas-page *::before, .gas-page *::after { box-sizing: border-box; }
.gas-page [hidden] { display: none !important; }
.gas-page button, .gas-page input, .gas-page textarea { font: inherit; }
.gas-page button, .gas-page summary { touch-action: manipulation; }
.gas-top { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.gas-top h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.012em; }
.gas-top p { margin: 0; color: var(--gas-muted); font-size: 14px; }
.gas-saved { flex-shrink: 0; color: var(--gas-muted); font-size: 12px; }
.gas-saved[data-dirty="true"] { color: #94621b; }
.gas-form { min-width: 0; border-radius: var(--gas-radius-md); background: #fff; box-shadow: 0 1px 3px rgb(30 41 59 / 10%); }
.gas-section { padding: 24px; }
.gas-mode-fieldset { min-width: 0; margin: 0 0 24px; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--gas-line); }
.gas-mode-fieldset legend { padding: 0; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.gas-modes { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--gas-radius-sm); background: var(--gas-surface); }
.gas-modes label { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 20px; border-radius: 6px; color: var(--gas-muted); cursor: pointer; }
.gas-modes label:has(input:checked) { color: var(--gas-ink); background: #fff; box-shadow: 0 1px 3px rgb(30 41 59 / 12%); }
.gas-modes label:has(input:focus-visible) { outline: 2px solid var(--gas-accent); outline-offset: 2px; }
.gas-modes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.gas-current-mode { margin: 12px 0 0; font-size: 13px; color: var(--gas-muted); text-wrap: pretty; }
.gas-section-head { margin-bottom: 20px; }
.gas-section h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.gas-section-head p { margin: 0; font-size: 13px; color: var(--gas-muted); }
.gas-field { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.gas-field > input, .gas-field textarea, .gas-secret { width: 100%; border: 1px solid #cbd5e1; border-radius: var(--gas-radius-sm); background: #fff; color: var(--gas-ink); font-size: 14px; font-weight: 400; outline: none; }
.gas-field > input { height: 42px; padding: 9px 12px; }
.gas-field textarea { min-height: 112px; padding: 10px 12px; resize: vertical; line-height: 1.8; }
.gas-field input::placeholder, .gas-field textarea::placeholder { color: var(--gas-muted); }
.gas-field > input:focus, .gas-field textarea:focus, .gas-secret:focus-within { border-color: var(--gas-accent); box-shadow: 0 0 0 3px rgb(79 70 229 / 8%); }
.gas-field small { font-size: 12px; line-height: 1.6; font-weight: 400; color: var(--gas-muted); }
.gas-optional { margin-left: 4px; color: var(--gas-muted); font-size: 12px; font-weight: 400; }
.gas-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gas-fields .gas-field { margin-bottom: 0; }
.gas-parameters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gas-secret { display: flex; align-items: center; height: 42px; }
.gas-secret input { width: 100%; min-width: 0; height: 100%; background: none; padding: 9px 12px; border: 0; border-radius: var(--gas-radius-sm); outline: none; }
.gas-secret button { flex-shrink: 0; min-width: 48px; height: 40px; padding: 8px; border: 0; border-radius: 0 7px 7px 0; background: none; color: var(--gas-muted); cursor: pointer; font-size: 12px; }
.gas-connection-check { margin-top: 24px; }
.gas-test-row { display: flex; align-items: center; gap: 12px; }
.gas-test-note { margin: 0; color: var(--gas-muted); font-size: 12px; }
.gas-test-result { margin-top: 16px; padding: 12px 16px; max-height: 240px; overflow-y: auto; border-radius: var(--gas-radius-sm); background: var(--gas-surface); color: var(--gas-ink); font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.gas-test-result[data-state="success"] { color: #17624e; background: #edf7f2; }
.gas-test-result[data-state="error"] { color: #a13436; background: #fff1f1; }
.gas-advanced { border-top: 1px solid var(--gas-line); }
.gas-advanced > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 16px 24px; cursor: pointer; list-style: none; }
.gas-advanced > summary::-webkit-details-marker { display: none; }
.gas-advanced summary strong { display: block; font-size: 14px; font-weight: 600; }
.gas-advanced summary small { display: block; margin-top: 3px; color: var(--gas-muted); font-size: 12px; }
.gas-advanced summary svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--gas-muted); transition: transform 180ms cubic-bezier(.16, 1, .3, 1); }
.gas-advanced[open] summary svg { transform: rotate(90deg); }
.gas-advanced-body { padding: 0 24px 24px; }
.gas-advanced[open] .gas-advanced-body { animation: gas-enter .18s ease-out both; }
.gas-actions { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--gas-line); }
.gas-actions > span { flex: 1; color: var(--gas-muted); font-size: 12px; text-align: right; }
.gas-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; flex-shrink: 0; padding: 8px 16px; border: 1px solid #cbd5e1; border-radius: var(--gas-radius-sm); background: #fff; color: var(--gas-ink); cursor: pointer; font-size: 13px !important; font-weight: 500 !important; white-space: nowrap; transition: transform 160ms cubic-bezier(.16, 1, .3, 1); }
.gas-button:active, .gas-secret button:active { transform: scale(.96); }
.gas-primary { border-color: var(--gas-accent); background: var(--gas-accent); color: white; }
.gas-reset { padding-left: 0; padding-right: 0; border-color: transparent; background: transparent; color: var(--gas-muted); }
.gas-button:disabled { opacity: .45; cursor: not-allowed; }
.gas-page button:focus-visible, .gas-page summary:focus-visible { outline: 2px solid var(--gas-accent); outline-offset: 3px; }
.gas-feedback { margin: 0; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.gas-feedback:not(:empty) { padding: 0 24px 20px; }
.gas-feedback[data-state="success"] { color: #17624e; }
.gas-feedback[data-state="error"] { color: #a13436; }
.gas-test[data-testing="true"]::before { content: ""; width: 12px; height: 12px; margin-right: 8px; border: 2px solid #cbd5e1; border-top-color: var(--gas-accent); border-radius: 50%; animation: gas-spin .8s linear infinite; }
.gas-help { margin-top: 16px; color: var(--gas-muted); font-size: 12px; }
.gas-help summary { width: fit-content; min-height: 40px; padding: 10px 0; cursor: pointer; }
.gas-help p { margin: 8px 0; max-width: 75ch; line-height: 1.8; overflow-wrap: anywhere; }
@media (hover: hover) {
  .gas-button:not(:disabled):hover { background: var(--gas-surface); }
  .gas-primary:not(:disabled):hover { background: #4338ca; }
  .gas-reset:hover, .gas-help summary:hover { color: var(--gas-ink); }
  .gas-secret button:hover { color: var(--gas-accent); background: var(--gas-surface); }
  .gas-advanced > summary:hover { background: var(--gas-surface); }
}
@container gas-settings (max-width: 620px) {
  .gas-section { padding: 20px; }
  .gas-fields { grid-template-columns: minmax(0, 1fr); }
  .gas-advanced > summary { padding: 16px 20px; }
  .gas-advanced-body { padding: 0 20px 20px; }
  .gas-test-row { align-items: flex-start; flex-direction: column; gap: 8px; }
  .gas-actions { gap: 12px; padding: 16px 20px; flex-wrap: wrap; justify-content: space-between; }
  .gas-actions > span { order: 3; flex-basis: 100%; text-align: left; }
  .gas-feedback:not(:empty) { padding: 0 20px 20px; }
  .gas-top { gap: 12px; }
}
@media (max-width: 480px) {
  .gas-field > input, .gas-field textarea, .gas-secret input { font-size: 16px; }
}
@keyframes gas-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gas-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .gas-page, .gas-page *, .gas-page *::before, .gas-page *::after { animation: none !important; transition: none !important; }
}
