/* START ALPHA CHANGE EXPLORER-002 -- responsive transaction explorer styles */

:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #edf2f7;
  background: #101827;

  --muted: #b8c6d9;
  --accent: #70d8ce;
  --border: #2b3a50;
  --panel: #152033;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer,
main {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

/* START ALPHA CHANGE EXPLORER-046 -- align footer text at bottom */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
/* FINISH ALPHA CHANGE EXPLORER-046 -- align footer text at bottom */

/* START ALPHA CHANGE EXPLORER-034 -- two-row header */
.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px 16px;
  padding-block: 28px;
}
/* FINISH ALPHA CHANGE EXPLORER-034 -- two-row header */

.brand {
  color: #edf2f7;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.04em;
}

/* START ALPHA CHANGE EXPLORER-035 -- left-aligned gas above brand */
.site-header .brand {
  grid-column: 1;
  grid-row: 2;
  justify-self: start;
  min-width: 0;
  line-height: 1.2;
}

.site-header .chain-link {
  grid-column: 2;
  grid-row: 2;
  justify-self: end;
  text-align: right;
  line-height: 1.2;
}

.gas-price {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: start;
  max-width: 100%;
  color: var(--accent);
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
}

.gas-price[data-state="stale"],
.gas-price[data-state="error"] {
  color: var(--muted);
}
/* FINISH ALPHA CHANGE EXPLORER-035 -- left-aligned gas above brand */

main {
  min-height: 70vh;
  padding-block: 40px;
}

.search-section {
  max-width: 850px;
  margin-bottom: 36px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
}

.intro,
.hint,
.site-footer {
  color: var(--muted);
  line-height: 1.65;
}

.search-form {
  margin-top: 28px;
}

.search-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.search-controls {
  display: flex;
  gap: 10px;
}

input,
button {
  font: inherit;
  border-radius: 10px;
}

input {
  width: 100%;
  min-width: 0;
  padding: 15px;
  color: #edf2f7;
  background: #0d1523;
  border: 1px solid var(--border);
}

input::placeholder {
  color: #8d9bb0;
}

button {
  padding: 12px 20px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #10202a;
  font-weight: 650;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.08);
}

/* START ALPHA CHANGE EXPLORER-124 -- blink search text during lookup */
@keyframes search-text-blink {
  50% {
    color: transparent;
  }
}

@media (prefers-reduced-motion: no-preference) {
  #search-form[aria-busy="true"] #search-button {
    animation: search-text-blink 1s ease-in-out infinite;
  }
}
/* FINISH ALPHA CHANGE EXPLORER-124 -- blink search text during lookup */

/* START ALPHA CHANGE EXPLORER-123 -- normal cursor for disabled buttons */
button:disabled {
  cursor: default;
  opacity: 0.55;
}
/* FINISH ALPHA CHANGE EXPLORER-123 -- normal cursor for disabled buttons */

.secondary {
  padding: 9px 13px;
  color: #edf2f7;
  background: #1c2b42;
  border-color: var(--border);
  font-size: 0.85rem;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.hint {
  margin-block: 10px;
  font-size: 0.82rem;
}

/* START ALPHA CHANGE EXPLORER-049 -- block status colors and refresh animation */
.chain-status {
  margin-top: 20px;
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.chain-status .hint {
  margin: 4px 0 0;
  color: inherit;
}

.chain-status[data-state="stale"],
.chain-status[data-state="error"] {
  color: var(--muted);
}

.is-refreshing {
  animation: chain-refresh-pulse 0.7s ease-in-out infinite;
}

@keyframes chain-refresh-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-refreshing {
    animation: none;
  }
}
/* FINISH ALPHA CHANGE EXPLORER-049 -- block status colors and refresh animation */

.message {
  min-height: 1.6em;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.message[data-kind="error"] {
  color: #ffb4b4;
}

/* START ALPHA CHANGE EXPLORER-136 -- Overview verification colors */
.curated-verification[data-state="curated"],
.curated-verification[data-state="matched"] {
  color: #a4f0cf;
}

.curated-verification[data-state="mismatch"] {
  color: #ffb4b4;
}

.curated-verification[data-state="unavailable"] {
  color: var(--muted);
}
/* FINISH ALPHA CHANGE EXPLORER-136 -- Overview verification colors */

.message[data-kind="info"] {
  color: var(--muted);
}

.panel {
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.badge {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 650;
}

.badge[data-tone="success"] {
  color: #a4f0cf;
  background: #153d35;
}

.badge[data-tone="failed"] {
  color: #ffc1c1;
  background: #462a35;
}

.badge[data-tone="pending"],
.badge[data-tone="unknown"] {
  color: #ffe0a3;
  background: #423725;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.warning {
  padding: 13px 15px;
  color: #ffe0a3;
  background: #352e24;
  border-radius: 8px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.fields {
  margin: 0;
}

.field {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  padding-block: 14px;
  border-top: 1px solid var(--border);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.mono,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.86rem;
}

.value-note {
  margin-block: 22px;
}

details {
  padding-block: 15px;
  border-top: 1px solid var(--border);
}

summary {
  cursor: pointer;
  font-weight: 600;
}

pre {
  max-height: 420px;
  overflow: auto;
  padding: 16px;
  color: #d2ddec;
  background: #0d1523;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

/* START ALPHA CHANGE EXPLORER-038 -- footer social icons and attribution */
.site-footer {
  padding-block: 28px;
  font-size: 0.8rem;
}

/* START ALPHA CHANGE EXPLORER-044 -- social icons above footer credit */
.footer-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
/* FINISH ALPHA CHANGE EXPLORER-044 -- social icons above footer credit */

.social-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.social-link:hover,
.social-link:focus-visible {
  background-color: #1c2b42;
  text-decoration: none;
}

.social-link img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.social-link:hover img,
.social-link:focus-visible img {
  opacity: 1;
}

.footer-credit {
  line-height: 1.6;
}

/* START ALPHA CHANGE EXPLORER-047 -- match footer credit line height */
.footer-currency {
  white-space: nowrap;
  line-height: 1.6;
}
/* FINISH ALPHA CHANGE EXPLORER-047 -- match footer credit line height */
/* FINISH ALPHA CHANGE EXPLORER-038 -- footer social icons and attribution */

@media (max-width: 620px) {
  .site-header,
  .site-footer,
  main {
    width: calc(100% - 28px);
  }

  main {
    padding-top: 24px;
  }

  .search-controls {
    flex-direction: column;
  }

  .panel {
    padding: 18px;
  }

  .field {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

/* START ALPHA CHANGE EXPLORER-082 -- curated menus contract tabs and function forms */

.search-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(100% - 120px);
  margin-bottom: 8px;
}

.search-caption label {
  margin: 0;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
}

.governance-selector {
  position: relative;
  flex-shrink: 0;
}

.governance-button {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.governance-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(390px, calc(100vw - 40px));
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 16px 45px rgb(0 0 0 / 35%);
}

.governance-list {
  height: 256px;
  max-height: 55vh;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-width: auto;
  scrollbar-color: var(--accent) #0d1523;
}

.governance-list::-webkit-scrollbar {
  width: 10px;
}

.governance-list::-webkit-scrollbar-track {
  background: #0d1523;
  border-radius: 8px;
}

.governance-list::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 8px;
}

.governance-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px;
  color: #edf2f7;
  background: transparent;
  font-size: 0.85rem;
  text-align: left;
  overflow-wrap: anywhere;
}

.governance-option:hover,
.governance-option:focus-visible {
  background: #1c2b42;
}

.governance-option img {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.curated-navigation,
.contract-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.curated-navigation [aria-pressed="true"],
.contract-tabs [aria-selected="true"] {
  color: #10202a;
  background: var(--accent);
}

.contract-tabs {
  margin-top: 22px;
}

.contract-code-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  gap: 28px;
}

.contract-code-layout > * {
  min-width: 0;
}

.contract-related {
  padding-left: 20px;
  border-left: 1px solid var(--border);
}

.contract-related h3 {
  margin-top: 0;
  font-size: 1rem;
}

.contract-related-item {
  padding-block: 12px;
  border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.contract-related-item > a {
  font-size: 0.85rem;
  font-weight: 650;
}

.contract-related-item .hint {
  margin-block: 6px;
}

.contract-label {
  display: block;
  margin-block: 16px 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.contract-label input {
  margin-top: 8px;
}

/* START ALPHA CHANGE EXPLORER-142 -- local ABI editor */
#local-abi-input {
  display: block;
  width: 100%;
  min-height: 180px;
  padding: 12px;
  resize: vertical;
  color: #edf2f7;
  background: #0d1523;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

#local-abi-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#local-abi-message[data-kind="error"] {
  color: #ffb4b4;
}
/* FINISH ALPHA CHANGE EXPLORER-142 -- local ABI editor */

.curated-panel select {
  width: 100%;
  max-width: 100%;
  padding: 11px;
  color: #edf2f7;
  background: #0d1523;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
}

.contract-code-layout .actions {
  margin-top: 12px;
}

.contract-source {
  max-height: 620px;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 4;
}

.contract-function {
  margin-top: 10px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.contract-function summary {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.contract-function-form > button {
  margin-top: 18px;
}

.contract-wallet {
  margin-bottom: 22px;
  padding: 16px;
  background: #0d1523;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.contract-wallet .contract-label {
  margin-top: 0;
}

.contract-wallet .actions {
  margin-block: 12px 0;
}

.contract-wallet select {
  max-width: 360px;
}

/* START ALPHA CHANGE EXPLORER-116 -- red wallet error messages */
#wallet-status[data-kind="error"] {
  color: #ffb4b4;
}
/* FINISH ALPHA CHANGE EXPLORER-116 -- red wallet error messages */

.contract-result {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .contract-code-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .contract-related {
    padding-left: 0;
    padding-top: 20px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 620px) {
  .search-caption {
    max-width: 100%;
  }

  .search-controls {
    display: flex;
    flex-direction: column;
  }

  .governance-menu {
    width: min(360px, calc(100vw - 28px));
  }
}

/* FINISH ALPHA CHANGE EXPLORER-082 -- curated menus contract tabs and function forms */

/* FINISH ALPHA CHANGE EXPLORER-002 -- responsive transaction explorer styles */