:root {
  color: #1d2528;
  background: #f4f1ec;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-width: 320px;
}

button {
  min-height: 40px;
  border: 1px solid #aab4a8;
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: #1d2528;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

button:disabled {
  color: #7b8580;
  cursor: not-allowed;
  background: #ece7df;
}

button:hover:not(:disabled) {
  border-color: #2f6f5e;
  background: #f7fbf7;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #aab4a8;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #1d2528;
  font: inherit;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

button:focus-visible,
.oauth-fallback:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.text-link:focus-visible {
  outline: 3px solid #2276a7;
  outline-offset: 3px;
}

.primary-button,
.google-button {
  border-color: #256f5c;
  background: #256f5c;
  color: #ffffff;
}

.primary-button:hover:not(:disabled),
.google-button:hover:not(:disabled) {
  background: #1d584a;
}

.topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid #d9d2c7;
  background: #fffaf2;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  font-size: 16px;
}

.eyebrow {
  margin-bottom: 4px;
  color: #806233;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.status-pill {
  min-width: 116px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d1b867;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff4c7;
  color: #584615;
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.status-pill[data-state="running"] {
  border-color: #6a92c2;
  background: #eef6ff;
  color: #244969;
}

.status-pill[data-state="success"] {
  border-color: #7fb06f;
  background: #ecf8e9;
  color: #245a2d;
}

.status-pill[data-state="warn"] {
  border-color: #d1a24b;
  background: #fff7df;
  color: #654812;
}

.status-pill[data-state="error"] {
  border-color: #c47474;
  background: #fff0f0;
  color: #783232;
}

.real-google-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fffaf2 0, #f4f1ec 240px),
    #f4f1ec;
}

.real-google-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 460px);
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 88px);
}

.real-google-runner,
.real-google-inspector,
.real-google-log-panel {
  min-width: 0;
}

.real-google-runner {
  align-self: start;
}

.real-google-log-panel {
  grid-column: 1 / -1;
}

.google-oauth-button {
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-mark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #ffffff;
  color: #256f5c;
  font-size: 15px;
  font-weight: 850;
}

.oauth-action {
  margin-top: 14px;
}

.oauth-open-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 14px;
  text-decoration: none;
  font-weight: 700;
}

.flow-step-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.flow-step-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  border: 1px solid #d5cec3;
  border-radius: 8px;
  padding: 0 12px;
  background: #fffdf8;
}

.flow-step-list li[data-state="running"] {
  border-color: #6a92c2;
  background: #f1f7ff;
}

.flow-step-list li[data-state="success"] {
  border-color: #7fb06f;
  background: #eff9ec;
}

.flow-step-list li[data-state="warn"] {
  border-color: #d1a24b;
  background: #fff8e6;
}

.flow-step-list li[data-state="error"] {
  border-color: #c47474;
  background: #fff1f1;
}

.flow-step-list span,
.flow-step-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.real-google-json {
  min-height: 360px;
  max-height: 620px;
  overflow: auto;
}

.real-google-log {
  max-height: 360px;
  overflow: auto;
}

@media (max-width: 860px) {
  .real-google-shell {
    grid-template-columns: 1fr;
  }

  .google-oauth-button {
    width: 100%;
  }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, 420px);
  grid-template-rows: minmax(420px, 1fr) 300px;
  gap: 16px;
  padding: 16px;
  min-height: calc(100vh - 88px);
}

.panel {
  min-width: 0;
  border: 1px solid #d5cec3;
  border-radius: 8px;
  background: #ffffff;
}

.panel-head {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e3ddd4;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: #293533;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: #293533;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.select-control select {
  width: auto;
  min-width: 76px;
  padding: 7px 28px 7px 10px;
}

.toggle-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2e7d65;
}

.summary-list {
  display: grid;
  grid-template-columns: minmax(104px, 140px) minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
  padding: 16px;
  font-size: 14px;
}

.summary-list dt {
  color: #69746f;
  font-weight: 700;
}

.summary-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.transaction-state {
  border-top: 1px solid #e3ddd4;
  padding: 16px;
}

.transaction-state-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.transaction-state h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.transaction-message {
  margin: 12px 0 0;
  color: #44504b;
  font-size: 14px;
}

.transaction-details {
  margin-top: 14px;
  padding: 0;
}

.wallet-sdk-state {
  display: flex;
  min-height: 356px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
  padding: 18px;
  color: #44504b;
}

.wallet-sdk-state p {
  max-width: 320px;
  margin: 0;
  font-size: 14px;
}

.debug-panel {
  grid-column: 1 / -1;
  min-height: 0;
}

.debug-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: calc(100% - 64px);
  min-height: 0;
  margin: 0;
  padding: 12px 16px 16px;
  overflow: auto;
  list-style: none;
}

.debug-entry {
  border-left: 3px solid #4c8c7b;
  padding: 8px 10px;
  background: #f7faf8;
}

.debug-entry-warn {
  border-left-color: #c48728;
  background: #fff8e8;
}

.debug-entry-error {
  border-left-color: #b45050;
  background: #fff0f0;
}

.debug-entry-head {
  margin-bottom: 6px;
  color: #44504b;
  font-size: 12px;
  font-weight: 750;
}

.debug-entry pre {
  margin: 0;
  overflow: auto;
  color: #1f2a2c;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.wallet-body {
  min-height: 100vh;
  background: #eef5f0;
}

.wallet-surface {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
}

.wallet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wallet-auth-options {
  display: grid;
  gap: 8px;
}

.passkey-button,
.google-button {
  width: 100%;
}

.passkey-button {
  border-color: #65716d;
  background: #ffffff;
}

.proof-progress {
  border: 1px solid #6a92c2;
  border-radius: 8px;
  padding: 10px 12px;
  background: #eef6ff;
  color: #244969;
  font-size: 13px;
  font-weight: 700;
}

.oauth-fallback {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #6a92c2;
  border-radius: 8px;
  padding: 0 14px;
  background: #eef6ff;
  color: #244969;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.oauth-fallback:hover {
  border-color: #2276a7;
  background: #e3f1ff;
}

.wallet-summary {
  border: 1px solid #cdd9d2;
  border-radius: 8px;
  background: #ffffff;
}

.wallet-debug-log {
  height: auto;
  flex: 1;
  border: 1px solid #cdd9d2;
  border-radius: 8px;
  background: #ffffff;
}

.text-link {
  color: #245a2d;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.text-link:hover {
  color: #1d584a;
  text-decoration: underline;
}

.lab-body {
  background: #f4f1ec;
}

.lab-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.network-label { font-size: 13px; font-weight: 650; color: #465b4c; }
.lab-help { margin: 8px 0 0; color: #526159; font-size: 13px; line-height: 1.5; max-width: 72ch; }
.section-note { color: #526159; font-size: 12px; }
.amount-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.amount-presets button { min-height: 32px; padding: 0 10px; font-size: 12px; }
.advanced-actions { margin-top: 16px; }
.advanced-actions summary, .proof-details > summary { cursor: pointer; font-weight: 650; }
.proof-details[open] > summary { margin-bottom: 16px; }
.history-table-wrap { overflow-x: auto; }
.action-history { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.action-history th, .action-history td { padding: 10px 6px; text-align: left; vertical-align: top; border-bottom: 1px solid #e3ddd4; }
.action-history th { color: #526159; font-size: 12px; }
.action-history td:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.action-history .copy-hash { display: block; min-height: 28px; margin-top: 4px; padding: 0 6px; font-size: 11px; }
.lab-body input, .lab-body textarea { caret-color: #256f5c; }
.lab-body ::selection { background: #d9ebd6; color: #183526; }
.lab-body summary:focus-visible { outline: 3px solid #2276a7; outline-offset: 3px; }

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

.lab-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.08fr) minmax(360px, 0.92fr);
  grid-template-rows: auto 340px;
  align-items: start;
  gap: 16px;
  padding: 16px;
}

.lab-workbench,
.lab-inspector {
  min-width: 0;
  min-height: 0;
}

.lab-workbench .google-button {
  width: auto;
}

.flow-timeline {
  display: grid;
  gap: 0;
  padding: 14px 16px 18px;
}

.flow-step {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  position: relative;
  padding: 0 0 18px;
}

.flow-step::after {
  content: "";
  position: absolute;
  top: 36px;
  bottom: 0;
  left: 16px;
  width: 2px;
  background: #d8d1c7;
}

.flow-step:last-child {
  padding-bottom: 0;
}

.flow-step:last-child::after {
  display: none;
}

.flow-marker {
  z-index: 1;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8b0a5;
  border-radius: 50%;
  background: #ffffff;
  color: #69746f;
  font-size: 13px;
  font-weight: 800;
}

.flow-step[data-state="running"] .flow-marker {
  border-color: #6a92c2;
  background: #eef6ff;
  color: #244969;
}

.flow-step[data-state="success"] .flow-marker {
  border-color: #7fb06f;
  background: #ecf8e9;
  color: #245a2d;
}

.flow-step[data-state="warn"] .flow-marker {
  border-color: #d1a24b;
  background: #fff7df;
  color: #654812;
}

.flow-step[data-state="error"] .flow-marker {
  border-color: #c47474;
  background: #fff0f0;
  color: #783232;
}

.flow-step-body {
  min-width: 0;
  border-bottom: 1px solid #ebe5dd;
  padding-bottom: 14px;
}

.flow-step:last-child .flow-step-body {
  border-bottom: 0;
  padding-bottom: 0;
}

.flow-step-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.flow-step h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
}

.flow-step-status {
  flex: 0 0 auto;
  border: 1px solid #d8d1c7;
  border-radius: 8px;
  padding: 2px 7px;
  background: #faf8f4;
  color: #69746f;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-meta {
  margin: 6px 0 0;
  color: #56635e;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.flow-explain {
  margin-top: 8px;
  color: #44504b;
  font-size: 12px;
}

.flow-explain summary {
  cursor: pointer;
  font-weight: 750;
}

.explanation-row {
  border-left: 2px solid #d8d1c7;
  margin-top: 8px;
  padding-left: 8px;
}

.explanation-row strong {
  display: block;
  color: #1f2a2c;
  font-size: 11px;
  text-transform: uppercase;
}

.explanation-row p {
  margin: 3px 0 0;
}

.lab-section {
  border-bottom: 1px solid #e3ddd4;
  padding: 16px;
}

.lab-section:last-child {
  border-bottom: 0;
}

.lab-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lab-section h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.compact-summary {
  grid-template-columns: minmax(118px, 150px) minmax(0, 1fr);
  padding: 0;
}

.lab-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

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

.field-grid label,
.wide-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field-grid span,
.wide-field span {
  color: #56635e;
  font-size: 12px;
  font-weight: 750;
}

.wide-field {
  margin-top: 12px;
}

.lab-inspector {
  overflow: auto;
}

@media (min-width: 1041px) {
  .lab-inspector { position: sticky; top: 16px; max-height: calc(100vh - 32px); }
}

.inspector-section {
  border-bottom: 1px solid #e3ddd4;
  padding: 12px 16px;
}

.inspector-section:last-child {
  border-bottom: 0;
}

.inspector-section summary {
  cursor: pointer;
  color: #1f2a2c;
  font-size: 14px;
  font-weight: 800;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.json-output,
.proof-editor {
  width: 100%;
  max-height: 340px;
  margin: 12px 0 0;
  overflow: auto;
  border: 1px solid #d8d1c7;
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
  color: #1f2a2c;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.small-json {
  max-height: 180px;
}

.proof-editor {
  min-height: 260px;
  white-space: pre;
}

.permission-call-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.permission-call-item {
  border: 1px solid #d8d1c7;
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf7;
}

.permission-call-item h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.permission-call-note {
  margin: 0 0 8px;
  color: #44504b;
  font-size: 13px;
}

.raw-json-details {
  border-top: 1px solid #e3ddd4;
  margin-top: 12px;
  padding-top: 10px;
}

.raw-json-details summary {
  color: #56635e;
  font-size: 13px;
}

.raw-json-label {
  margin-top: 12px;
  color: #69746f;
  font-size: 12px;
  font-weight: 750;
}

.lab-debug-panel {
  grid-column: 1 / -1;
  min-height: 0;
}

.lab-decoder-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.tx-decoder-body {
  padding: 16px;
}

.tx-decoder-body textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
}

.tx-decoder-narrative {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #d8d1c7;
  border-radius: 8px;
  padding: 12px;
  background: #fbfaf7;
}

.tx-decoder-narrative h3,
.tx-decoder-narrative h4 {
  margin: 0;
  letter-spacing: 0;
}

.tx-decoder-narrative h3 {
  font-size: 15px;
}

.tx-decoder-narrative h4 {
  color: #44504b;
  font-size: 12px;
  text-transform: uppercase;
}

.tx-decoder-verdict {
  margin: 0;
  color: #1f2a2c;
  font-size: 14px;
  font-weight: 800;
}

.tx-decoder-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: #1f2a2c;
  font-size: 13px;
}

.contract-trace-list {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}

.warning-list {
  color: #783232;
}

.lab-debug-log {
  height: calc(100% - 64px);
}

.mobile-action-feedback { display: none; }

@media (max-width: 1040px) {
  .mobile-action-feedback:not([hidden]) {
    display: block;
    position: sticky;
    top: 8px;
    z-index: 3;
    margin: 12px 16px;
    padding: 12px;
    border: 1px solid #b9c9bd;
    border-radius: 8px;
    background: #fbfaf7;
    box-shadow: 0 3px 12px #1f2a2c14;
  }

  .mobile-action-feedback p {
    margin: 8px 0 0;
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 320px;
  }

  .debug-panel {
    grid-column: auto;
  }

  .lab-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 340px;
  }

  .lab-decoder-panel,
  .lab-debug-panel {
    grid-column: auto;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .actions {
    width: 100%;
    justify-content: stretch;
  }

  .actions button {
    flex: 1 1 160px;
  }

  .actions .toggle-control {
    flex: 1 1 160px;
  }

  .actions .select-control {
    flex: 1 1 160px;
  }

  .field-grid,
  .field-grid.two-column {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1041px) and (max-width: 1280px) {
  .lab-grid {
    grid-template-columns: minmax(440px, 1fr) minmax(360px, 0.9fr);
    grid-template-rows: auto 340px;
  }
}

.lab-timing-total { display: flex; align-items: baseline; gap: 12px; margin: 14px 0; }
.lab-timing-total strong { font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; color: #31563f; }
.lab-timing-total span { color: #58675e; font-size: 12px; }
.lab-timing-table .timing-duration { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.lab-timing-table th:last-child { text-align: right; }
.lab-saved-timings .wide-field { margin-top: 8px; }
#labTimingTitle { scroll-margin-top: 24px; }
