:root {
  --page-bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --surface-warm: #fffaf0;
  --ink: #17211b;
  --muted: #5c6b62;
  --line: #dfe7e2;
  --line-strong: #cbd8d0;
  --brand: #0f8f4f;
  --brand-dark: #086a3a;
  --accent: #f1b51c;
  --info: #1f6feb;
  --danger: #d83a3a;
  --shadow: 0 10px 30px rgba(20, 35, 27, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page-bg);
  color: var(--ink);
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(15, 143, 79, 0.08), rgba(244, 247, 245, 0) 300px),
    var(--page-bg) !important;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif !important;
}

header {
  background:
    linear-gradient(135deg, rgba(241, 181, 28, 0.12), transparent 38%),
    linear-gradient(135deg, #102018, #0b3320) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 20px !important;
}

.nav-bar {
  max-width: 1180px;
  margin: 0 auto;
  min-height: 76px;
}

.brand h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.35rem, 2.5vw, 2.25rem) !important;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: 0;
}

.brand p {
  margin: 8px 0 0 !important;
  color: #c9e7d4;
  font-size: clamp(0.9rem, 1.4vw, 1rem) !important;
  line-height: 1.45;
}

.nav-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  border-radius: var(--radius);
  transition: background-color 150ms ease, border-color 150ms ease;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.38) !important;
}

nav#mainNav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(17, 34, 24, 0.06);
  backdrop-filter: blur(14px);
  gap: 8px !important;
  padding: 10px 16px !important;
  transition: box-shadow 150ms ease, background-color 150ms ease;
}

.is-scrolled nav#mainNav {
  box-shadow: 0 10px 24px rgba(17, 34, 24, 0.1);
}

nav#mainNav a {
  min-height: 38px;
  padding: 8px 14px !important;
  border-radius: var(--radius) !important;
  color: var(--ink) !important;
  font-weight: 700;
  text-decoration: none !important;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}

nav#mainNav a:hover {
  background: #e9f5ee;
  color: var(--brand-dark) !important;
  transform: translateY(-1px);
}

nav#mainNav a[aria-current="page"] {
  background: var(--brand) !important;
  color: #fff !important;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.28);
}

nav#mainNav a.telegram {
  background: #229ed9 !important;
  color: #fff !important;
}

main {
  width: min(1180px, 100%);
  max-width: 1180px !important;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) !important;
}

.section,
.table-wrapper,
main > section:not(.section) {
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow) !important;
}

.section {
  padding: clamp(16px, 2.4vw, 24px) !important;
}

.section + .section,
.table-wrapper + .section,
.section + .table-wrapper,
.table-wrapper + .table-wrapper {
  margin-top: 18px;
}

main > section:not(.section) {
  padding: clamp(18px, 2.8vw, 28px) !important;
  color: var(--ink) !important;
  font-size: 0.98rem !important;
  line-height: 1.7 !important;
}

.section h2,
.section h3,
.section h4,
main > h2,
main > h3,
main > section:not(.section) h2,
main > section:not(.section) h3 {
  color: var(--ink);
  letter-spacing: 0;
}

.section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.15rem, 2vw, 1.55rem) !important;
  font-weight: 750;
  margin-bottom: 16px;
}

.section h3,
.section h4 {
  font-weight: 750;
}

main > section:not(.section) h2 {
  text-align: left !important;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  margin-top: 0;
}

main > section:not(.section) h3 {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  margin: 22px 0 10px;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

.info-grid > div {
  min-width: 0;
  background: var(--surface-soft) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius) !important;
  box-shadow: none !important;
  transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.info-grid > div:hover {
  background: #fff !important;
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.label {
  color: var(--muted) !important;
  font-weight: 700;
}

.info-grid span:not(.label),
.details-cell,
td,
th {
  overflow-wrap: anywhere;
}

a {
  color: var(--brand-dark);
}

a:hover {
  color: var(--brand);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(31, 111, 235, 0.28);
  outline-offset: 2px;
}

button,
.controls button,
.pager button {
  border-radius: var(--radius) !important;
  font-weight: 700;
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.controls input[type="text"] {
  border-radius: var(--radius) !important;
  border-color: var(--line) !important;
  min-height: 40px;
}

.controls button,
.pager button.active,
.pager button:hover {
  background: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
  color: #fff !important;
}

.controls button:hover,
.pager button:hover {
  transform: translateY(-1px);
}

.table-wrapper {
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  border-color: var(--line) !important;
  background: var(--surface);
}

table th {
  background: #edf4ef !important;
  color: var(--ink) !important;
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: none;
}

table td,
table th {
  border-color: var(--line) !important;
  vertical-align: middle;
}

table tbody tr {
  transition: background-color 120ms ease;
}

table tbody tr:hover {
  background: #f8fbf9;
}

table code,
main code {
  display: inline-block;
  max-width: 100%;
  padding: 2px 6px;
  background: #eef5f0;
  border: 1px solid #d8e5dd;
  color: #143b25;
  white-space: nowrap;
}

.badge {
  border-radius: 999px !important;
  font-weight: 750;
}

.badge-confirmed {
  background: #1f8f4d !important;
  color: #fff;
}

.badge-unconfirmed {
  background: #f1b51c !important;
  color: #2d2306;
}

.badge-orphaned {
  background: #7b8790 !important;
  color: #fff;
}

.wallet-link {
  color: var(--brand-dark) !important;
  text-decoration: none !important;
}

.wallet-link:hover {
  color: var(--brand) !important;
  text-decoration: underline !important;
}

.progress-bar {
  height: 32px !important;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.06)),
    linear-gradient(90deg,
      rgba(23, 168, 91, 0.26) 0%,
      rgba(116, 189, 67, 0.26) 32%,
      rgba(241, 181, 28, 0.3) 46%,
      rgba(231, 120, 37, 0.3) 70%,
      rgba(216, 58, 58, 0.32) 100%) !important;
  border: 1px solid #d4e2da;
  border-radius: 999px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    inset 0 1px 2px rgba(20, 35, 27, 0.12),
    0 14px 30px rgba(20, 35, 27, 0.1);
}

.progress-bar-fill {
  position: relative;
  min-width: 0 !important;
  overflow: hidden !important;
  background:
    linear-gradient(90deg, #19a65a 0%, #8ec63f 38%, #f1b51c 56%, #e77825 78%, #d83a3a 100%) !important;
  border-radius: 999px !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -8px 18px rgba(0, 0, 0, 0.08),
    0 0 20px rgba(15, 143, 79, 0.22);
}

.progress-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.24), transparent);
  transform: translateX(-60%);
}

.effort-scale {
  right: 0 !important;
  top: 0 !important;
  height: 100% !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none;
  pointer-events: none;
}

.effort-scale::before {
  content: "";
  position: absolute;
  left: 40%;
  top: -4px;
  bottom: -4px;
  transform: translateX(-50%);
  width: 2px;
  background: rgba(17, 24, 39, 0.48);
  border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.56);
}

.effort-scale .needle {
  top: -8px !important;
  width: 2px !important;
  height: 46px !important;
  border: 0 !important;
  border-radius: 999px;
  background: #111827;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.92),
    0 10px 22px rgba(17, 24, 39, 0.24);
}

.effort-scale .needle span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  transform: translateX(-50%);
  padding: 5px 8px;
  background: linear-gradient(180deg, #1f2937, #111827);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.18);
}

.effort-scale .needle.is-start span {
  left: 0;
  transform: translateX(0);
}

.effort-scale .needle.is-end span {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.effort-scale .needle.is-over {
  background: #7f1d1d;
}

.effort-scale .needle.is-over span {
  background: linear-gradient(180deg, #991b1b, #7f1d1d);
}

.effort-scale .needle.is-over::after {
  border-color: #7f1d1d;
}

.effort-scale .needle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 11px;
  height: 11px;
  transform: translateX(-50%);
  background: #fff;
  border: 2px solid #111827;
  border-radius: 50%;
}

.effort-scale .tick {
  top: calc(100% + 9px) !important;
  bottom: auto !important;
  height: 8px !important;
  border-left: 1px solid var(--line-strong) !important;
}

.effort-scale .tick.expected {
  top: calc(100% + 5px) !important;
  height: 14px !important;
  border-left: 2px solid rgba(17, 24, 39, 0.78) !important;
}

.effort-scale .tick span {
  top: 14px !important;
  color: var(--muted) !important;
  font-size: 0.72rem !important;
  font-weight: 750;
}

.effort-scale .tick:last-child span {
  transform: translateX(calc(-50% - 6px)) !important;
}

pre,
code {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
}

.chart-container {
  background: var(--surface) !important;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.dashboard-section .metric-grid > div,
.metric-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 92px;
}

.metric-grid .label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.metric-grid span:not(.label),
.metric-grid a {
  font-size: clamp(1rem, 1.8vw, 1.22rem);
  font-weight: 760;
  line-height: 1.25;
}

.metric-grid i.uk-text-center {
  color: var(--muted) !important;
  font-style: normal;
}

.effort-section p {
  color: var(--muted);
  margin-top: 0;
}

.effort-section #etaBlock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 0;
  padding: 7px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 700;
}

.chart-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.chart-title span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.snapshot-section {
  background:
    linear-gradient(135deg, rgba(15, 143, 79, 0.08), rgba(241, 181, 28, 0.08)),
    var(--surface) !important;
}

.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-heading-row h2 {
  margin-bottom: 0 !important;
}

.refresh-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.snapshot-card {
  min-width: 0;
  min-height: 126px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(20, 35, 27, 0.06);
}

.snapshot-card .label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.snapshot-card > span:not(.label),
.snapshot-card > a {
  display: inline-block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.7vw, 2.4rem);
  font-weight: 820;
  line-height: 1.05;
  text-decoration: none;
}

.snapshot-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.snapshot-primary {
  background:
    linear-gradient(135deg, rgba(15, 143, 79, 0.12), rgba(255, 255, 255, 0.9)),
    var(--surface);
  border-color: rgba(15, 143, 79, 0.22);
}

.effort-panel {
  display: grid;
  grid-template-columns: minmax(230px, 0.52fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  margin-top: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(15, 143, 79, 0.09), rgba(255, 255, 255, 0.72) 42%),
    rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(203, 216, 208, 0.82);
  border-radius: calc(var(--radius) + 2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 16px 34px rgba(20, 35, 27, 0.08);
}

.effort-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 2px 4px;
}

.effort-card-top,
.effort-meter-top,
.effort-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.effort-card-top .label {
  margin-bottom: 0;
}

.effort-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid rgba(15, 143, 79, 0.22);
  border-radius: 999px;
  background: rgba(236, 250, 241, 0.9);
  color: var(--brand-dark);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.effort-state.is-passed {
  border-color: rgba(241, 181, 28, 0.38);
  background: rgba(255, 248, 225, 0.94);
  color: #7a5200;
}

.effort-state.is-over-scale {
  border-color: rgba(216, 58, 58, 0.28);
  background: rgba(255, 239, 239, 0.94);
  color: #7f1d1d;
}

.effort-value-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.effort-value-row span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.effort-copy p {
  max-width: 34ch;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.effort-value {
  display: block;
  color: var(--ink);
  font-size: clamp(2rem, 3.8vw, 3.15rem);
  font-weight: 850;
  line-height: 0.96;
  letter-spacing: 0;
}

.effort-meter {
  min-width: 0;
  padding: 8px 2px 2px;
}

.effort-meter-top {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
}

.effort-meter-top strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.effort-meter #etaBlock {
  margin-top: 0;
}

.effort-status-row {
  align-items: flex-start;
  margin-top: 42px;
}

.effort-hint {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
  padding-top: 8px;
  white-space: nowrap;
}

.effort-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(20, 35, 27, 0.06);
}

.effort-status.is-waiting {
  border-color: rgba(15, 143, 79, 0.24);
  background: rgba(236, 250, 241, 0.86);
  color: var(--brand-dark);
}

.effort-status.is-passed {
  border-color: rgba(241, 181, 28, 0.34);
  background: rgba(255, 248, 225, 0.9);
  color: #7a5200;
}

.effort-status.is-over-scale {
  border-color: rgba(216, 58, 58, 0.28);
  background: rgba(255, 239, 239, 0.92);
  color: #7f1d1d;
}

.pool-footer {
  margin-top: 48px !important;
  background: #102018 !important;
  border-top: 4px solid var(--brand);
}

.footer-emails {
  max-width: 1180px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  header {
    padding: 14px 14px !important;
  }

  .nav-bar {
    align-items: center;
  }

  .brand {
    text-align: left !important;
  }

  nav#mainNav {
    position: static;
    background: #102018 !important;
    box-shadow: none;
    border-bottom: 0;
  }

  nav#mainNav.open {
    padding: 10px 12px !important;
  }

  nav#mainNav a {
    width: 100% !important;
    margin: 4px 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
  }

  nav#mainNav a:hover {
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    transform: none;
  }

  nav#mainNav a[aria-current="page"] {
    background: rgba(15, 143, 79, 0.95) !important;
  }

  main {
    padding: 14px !important;
  }

  .section {
    margin-bottom: 16px !important;
  }

  .info-grid {
    grid-template-columns: 1fr !important;
  }

  .info-grid > div {
    display: block !important;
    min-width: 0 !important;
    margin: 0 !important;
  }

  .table-wrapper {
    padding: 10px;
    border-radius: var(--radius) !important;
  }

  table {
    font-size: 0.88rem !important;
  }

  table code,
  main code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .controls {
    justify-content: stretch !important;
    gap: 10px !important;
  }

  .controls label,
  .controls input[type="text"] {
    width: 100%;
    min-width: 0 !important;
  }

  .pager {
    justify-content: flex-start !important;
  }

  .chart-container {
    padding: 8px;
  }

  .section-heading-row {
    display: block;
  }

  .refresh-pill {
    margin-top: 10px;
    white-space: normal;
  }

  .snapshot-grid,
  .effort-panel {
    grid-template-columns: 1fr;
  }

  .effort-panel {
    gap: 18px;
    padding: 15px;
  }

  .effort-card-top,
  .effort-meter-top,
  .effort-status-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .effort-value {
    font-size: clamp(2.15rem, 12vw, 3rem);
  }

  .effort-copy p {
    max-width: none;
  }

  .effort-meter-top strong,
  .effort-hint {
    white-space: normal;
  }

  .snapshot-card {
    min-height: 112px;
  }

  .snapshot-card > span:not(.label),
  .snapshot-card > a {
    font-size: clamp(1.3rem, 8vw, 1.9rem);
  }

  .effort-meter #etaBlock {
    margin-top: 0;
  }

  .effort-status-row {
    margin-top: 38px;
  }
}

@media (max-width: 600px) {
  nav#mainNav:not(.open) {
    padding: 0 !important;
    border-bottom: 0;
  }

  nav#mainNav.open {
    max-height: 560px;
  }
}
