:root {
  color-scheme: light;
  --blue-950: #082f49;
  --blue-900: #0c4a6e;
  --blue-800: #075985;
  --blue-700: #0369a1;
  --blue-600: #0284c7;
  --blue-500: #0ea5e9;
  --blue-400: #38bdf8;
  --blue-300: #7dd3fc;
  --blue-200: #bae6fd;
  --blue-100: #e0f2fe;
  --blue-50: #f0f9ff;
  --white: #ffffff;

  --text: var(--blue-900);
  --text-muted: #2d5f7a;
  --focus-ring: var(--blue-500);

  --page-bg-top: #d8effc;
  --page-bg-mid: #e8f6fe;
  --page-bg-bottom: #cfe9f8;

  --group-input-bg: linear-gradient(180deg, #ffffff 0%, #f2faff 55%, #e5f4fd 100%);
  --group-input-border: #7cc4eb;
  --group-input-shadow: 0 4px 14px rgba(7, 89, 133, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.85) inset;
  --group-input-accent: #0ea5e9;

  --group-output-bg: linear-gradient(180deg, #eef8ff 0%, #dceefa 50%, #c8e4f5 100%);
  --group-output-border: #4db5e8;
  --group-output-shadow: 0 5px 18px rgba(3, 105, 161, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  --group-output-accent: #0369a1;

  --input-bg: #fbfeff;
  --input-border: #9dd5f0;
  --readonly-bg: rgba(224, 242, 254, 0.65);
  --site-logo-size: 4.5rem;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  background: linear-gradient(
    168deg,
    var(--page-bg-top) 0%,
    var(--page-bg-mid) 42%,
    var(--page-bg-bottom) 100%
  );
  background-attachment: fixed;
  color: var(--text);
}

.site-logos {
  display: flex;
  justify-content: center;
  padding: 1.25rem 1rem 0.5rem;
}

.site-logos-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 3vw, 1.5rem);
}

.site-logo {
  width: var(--site-logo-size);
  height: var(--site-logo-size);
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(7, 89, 133, 0.2));
}

.site-logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.site-logo-link {
  display: block;
  line-height: 0;
  border-radius: 10px;
}

.site-logo-link:focus {
  outline: none;
}

.site-logo-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.evrmore-brand-label {
  display: block;
  width: calc(var(--site-logo-size) * 1.5);
  text-align: center;
  color: var(--blue-950);
  font-weight: 800;
  font-size: calc(var(--site-logo-size) * 0.375);
  line-height: 1;
  letter-spacing: 0.03em;
}

.wrap {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1 {
  font-size: clamp(1.35rem, 1rem + 1.5vw, 1.65rem);
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: var(--blue-950);
  letter-spacing: -0.02em;
}

.sub {
  margin: 0 0 2rem;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field-group {
  margin: 0;
  padding: 1rem 1.2rem 1.35rem;
  border-radius: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-width: 1px;
  border-style: solid;
}

/* "Enter one of these" — cooler, lighter card */
.field-group:first-of-type {
  background: var(--group-input-bg);
  border-color: var(--group-input-border);
  box-shadow: var(--group-input-shadow);
}

.field-group:first-of-type .field-group-legend {
  color: var(--group-input-accent);
}

/* "Calculated fields" — deeper blue tint, stronger contrast */
.field-group:last-of-type {
  background: var(--group-output-bg);
  border-color: var(--group-output-border);
  box-shadow: var(--group-output-shadow);
}

.field-group:last-of-type .field-group-legend {
  color: var(--group-output-accent);
}

.field-group-legend {
  font-size: calc(0.95rem * 1.5);
  font-weight: 700;
  padding: 0;
  margin: 0;
  letter-spacing: 0.02em;
}

.fields-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.35rem;
}

.fields-actions-help {
  margin-top: 1rem;
}

.action-btn {
  position: relative;
  padding: 0.6rem 1.2rem;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.35;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.12s ease;
}

/* Secondary 3D — Clear, Help */
#reset-fields.action-btn,
#help-more-info.action-btn {
  color: var(--blue-900);
  background: linear-gradient(180deg, #ffffff 0%, #e3f2fa 45%, #cfe8f6 100%);
  border-color: #8ec8ea;
  box-shadow: 0 5px 0 #5ba3cf, 0 8px 16px rgba(7, 89, 133, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#reset-fields.action-btn:hover:not(:disabled),
#help-more-info.action-btn:hover:not(:disabled) {
  filter: brightness(1.03);
  box-shadow: 0 5px 0 #5ba3cf, 0 10px 22px rgba(7, 89, 133, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

#reset-fields.action-btn:active:not(:disabled),
#help-more-info.action-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #4a8eb8, 0 4px 10px rgba(7, 89, 133, 0.15),
    inset 0 2px 4px rgba(7, 89, 133, 0.12);
}

/* Primary 3D — Calculate */
#calculate-fields.action-btn {
  color: var(--white);
  background: linear-gradient(180deg, #4dc2fa 0%, var(--blue-500) 38%, var(--blue-600) 100%);
  border-color: #0369a1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
  box-shadow: 0 5px 0 var(--blue-800), 0 8px 20px rgba(3, 105, 161, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

#calculate-fields.action-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 5px 0 var(--blue-800), 0 10px 26px rgba(3, 105, 161, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

#calculate-fields.action-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--blue-800), 0 4px 12px rgba(3, 105, 161, 0.3),
    inset 0 2px 6px rgba(0, 0, 0, 0.15);
}

.action-btn:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.action-btn:focus:not(:focus-visible) {
  outline: none;
}

.action-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 0 rgba(7, 89, 133, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.action-btn:disabled:hover {
  filter: none;
}

.resolve-countdown {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--blue-800);
  line-height: 1.4;
}

.resolve-countdown[hidden] {
  display: none;
}

.calculate-help {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  border: 1px solid var(--blue-200);
}

.calculate-help[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--blue-900);
}

.field input {
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 1rem;
  line-height: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  box-shadow: inset 0 2px 4px rgba(7, 89, 133, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

.field input#nip05 {
  width: min(100%, 70ch);
}

.field input#npub {
  width: min(100%, 69ch);
}

.field input#hex {
  width: min(100%, 70ch);
}

.field-input-with-copy {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.field .field-input-with-copy input#btc,
.field .field-input-with-copy input#evrmore {
  flex: 1 1 0%;
  min-width: 0;
  width: auto;
  max-width: none;
}

.copy-field-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  margin: 0;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--blue-700);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--blue-700) 0%, var(--blue-800) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 2px rgba(7, 89, 133, 0.25);
  line-height: 0;
}

.copy-field-btn:hover {
  filter: brightness(1.08);
}

.copy-field-btn:focus {
  outline: none;
}

.copy-field-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.copy-field-btn img {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.field input:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--blue-400);
}

.field input:read-only {
  background: var(--readonly-bg);
  cursor: default;
  box-shadow: inset 0 1px 3px rgba(7, 89, 133, 0.08);
}

.field input:read-only:focus {
  outline: none;
}
