:root {
  color-scheme: dark;
  --bg: #07111a;
  --panel: rgba(8, 18, 29, 0.82);
  --panel-strong: #0d1d2b;
  --line: rgba(180, 226, 255, 0.16);
  --text: #edf7ff;
  --muted: #8aa7ba;
  --accent: #78e2c7;
  --accent-strong: #14c38e;
  --danger: #ff7a76;
  --warning: #f7c873;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.35);
  --page-background:
    linear-gradient(180deg, #071018 0%, #03070c 100%);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-background);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--page-background);
  color: var(--text);
}

.page {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 28px 0 56px;
  background: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  margin-bottom: 13px;
}

.brand {
  font-size: clamp(24px, 2.94vw, 38px);
  font-weight: 780;
  letter-spacing: -0.07em;
  color: var(--text);
}

.brand::after {
  content: ".";
  color: var(--accent);
}

.refreshLine {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  min-width: 0;
  padding: 0;
}

.refreshDot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(120, 226, 199, 0.1);
}

.controls,
.card {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.controls {
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) 420px;
  gap: 14px;
  align-items: stretch;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.controlField {
  min-width: 0;
}

.controlLabel {
  display: block;
  min-height: 18px;
  padding-left: 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(237, 247, 255, 0.76);
}

.controls input,
.controls select,
.controls button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0 20px;
  min-height: 70px;
  border-radius: 22px;
  font: inherit;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.controls input,
.controls select {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.controls input:focus,
.controls select:focus {
  outline: none;
  border-color: rgba(120, 226, 199, 0.34);
  box-shadow: 0 0 0 4px rgba(120, 226, 199, 0.08);
}

.controls button {
  background: linear-gradient(135deg, #1177de 0%, #14c38e 100%);
  color: white;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.07em;
  cursor: pointer;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

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

.actionButtons {
  display: flex;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.actionButtons #reloadButton {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 78px;
  font-size: 22px;
}

.controls .resetButton {
  flex: 0 0 150px;
  background: rgba(120, 226, 199, 0.08);
  border: 1px solid rgba(120, 226, 199, 0.2);
  color: var(--accent);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}


.controls button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.actions {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  min-width: 0;
  width: 100%;
  justify-self: stretch;
  align-self: stretch;
  padding-left: 0;
}

@media (max-width: 1180px) {
  .controls {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .actions {
    grid-column: 1 / -1;
    padding-left: 0;
  }
}

.results {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.resultsToolbar {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.resultsSummary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: 0 17px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.resultsSummary::before {
  content: "";
  width: 4px;
  height: 29px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9ef0d7 0%, #2fa7d8 100%);
}

.resultsSearch {
  flex: 0 1 320px;
  min-width: min(100%, 240px);
}

.resultsSearch input {
  width: 100%;
  min-height: 55px;
  padding: 0 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.resultsSearch input::placeholder {
  color: var(--muted);
}

.resultsSearch input:focus {
  border-color: rgba(120, 226, 199, 0.34);
  box-shadow: 0 0 0 4px rgba(120, 226, 199, 0.08);
}

.resultsGrouped {
  grid-template-columns: minmax(0, 1fr);
}

.volumeGroup {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  backdrop-filter: blur(18px);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.volumeGroupSummary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
}

.volumeGroupSummary::-webkit-details-marker {
  display: none;
}

.volumeGroupHeading {
  min-width: 0;
}

.volumeGroupTitleWrap {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.volumeGroupTitleWrap::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(120, 226, 199, 0.12);
}

.volumeGroupTitle {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.05em;
  line-height: 1.04;
}

.volumeGroupCount {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.volumeGroupToggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.02);
}

.volumeGroupToggle::after {
  content: "▾";
  color: var(--accent);
  font-size: 14px;
  transition: transform 140ms ease;
}

.volumeGroup[open] .volumeGroupToggle::after {
  transform: rotate(180deg);
}

.volumeGroupDetails {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
  display: grid;
  gap: 12px;
}

.volumeMarketRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.volumeMarketInfo {
  min-width: 0;
}

.volumeMarketQuestion {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.volumeMarketQuestion .questionLink {
  color: var(--text);
}

.volumeMarketHint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.volumeHintPills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.volumeHintPill {
  display: inline-flex;
  align-items: center;
  min-height: 33px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.volumeHintPillAccent {
  color: var(--accent);
  background: rgba(120, 226, 199, 0.08);
  border-color: rgba(120, 226, 199, 0.18);
}

.volumeChoice {
  min-width: 170px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
  color: var(--text);
}

.volumeChoiceYes {
  background: rgba(87, 211, 151, 0.18);
}

.volumeChoiceNo {
  background: rgba(248, 161, 103, 0.16);
}

.volumeChoiceLabel {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.volumeChoiceValue {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: -0.05em;
}

.card {
  border-radius: 24px;
  padding: 18px 22px 23px;
  display: grid;
  grid-template-rows: auto auto 56px auto;
  row-gap: 12px;
  justify-items: center;
  align-content: start;
  align-items: start;
  transition: transform 140ms ease, border-color 140ms ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 226, 199, 0.45);
}

.cardMeta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.cardTag,
.cardAge {
  font-size: 12px;
  line-height: 1;
}

.cardTag {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(120, 226, 199, 0.12);
  border: 1px solid rgba(120, 226, 199, 0.24);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cardTagUrgent {
  background: rgba(247, 200, 115, 0.14);
  border-color: rgba(247, 200, 115, 0.35);
  color: var(--warning);
}

.cardAge {
  color: var(--muted);
}

.marketLabel {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.priceBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  padding: 13px 20px;
  min-width: 183px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: white;
  white-space: nowrap;
  border: 0;
  box-shadow: none;
}

.priceBadgeInline {
  width: fit-content;
  margin: 0;
  align-self: center;
}

.priceBadgeNo {
  background: transparent;
  color: #ff4d4f;
  border: 1px solid rgba(255, 77, 79, 0.45);
}

.priceBadgeYes {
  background: #169c6b;
}

.question {
  font-size: 22px;
  line-height: 1.15;
  margin: 0;
  text-align: center;
  max-width: 16ch;
  min-height: 52px;
  display: flex;
  align-items: flex-end;
}

.questionLink {
  color: var(--text);
  text-decoration: none;
}

.questionLink:hover {
  color: var(--accent);
}

.answerLabel {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.02em;
  min-height: 24px;
}

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

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  justify-items: center;
  align-self: start;
  margin-top: 8px;
}

.metric {
  padding: 20px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
  width: min(100%, 500px);
  min-height: 108px;
}

.metric strong {
  display: block;
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  margin-bottom: 10px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  display: block;
}

.metricHighlight {
  border: 2px solid var(--accent-strong);
  background: rgba(20, 195, 142, 0.06);
  text-align: center;
  grid-column: 1 / -1;
  justify-self: center;
  width: min(100%, 420px);
  margin-top: 4px;
}

.metricHighlight strong {
  color: var(--accent);
}

.metricHighlight span {
  white-space: normal;
}

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

.warning {
  color: var(--warning);
}

.ok {
  color: var(--accent);
}

@media (max-width: 980px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .controls input,
  .controls select,
  .controls button {
    min-height: 62px;
    border-radius: 18px;
  }

  .actionButtons {
    flex-direction: column;
  }

  .actionButtons #reloadButton,
  .controls .resetButton {
    width: 100%;
    flex-basis: auto;
  }

  .refreshLine {
    justify-content: flex-start;
    padding-right: 0;
  }

  .volumeGroupSummary,
  .volumeMarketRow {
    grid-template-columns: minmax(0, 1fr);
  }

  .volumeChoice {
    min-width: 0;
  }
}
