/* Shared rules stay in public/global.css; route-specific rules live in this page CSS. */
@media (max-width: 1040px) {

  .liq-controls,
.liq-main-grid {
    grid-template-columns: 1fr;
  }

  .liq-chart-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .liq-chart-stage,
.liq-tv-chart {
    min-height: 380px;
    height: min(58vh, 520px);
  }
}

.liquidation-page {
  display: grid;
  gap: 10px;
  padding: 12px 0 0;
}

.liq-workspace {
  display: grid;
  gap: 34px;
}

.liq-tool-title .page-h1 {
  margin: 1px 0 0;
}

.liq-tool-title {
  align-self: center;
  padding-top: 8px;
}

.liq-tool-title .page-eyebrow {
  margin: 0;
}

.liq-controls {
  --liq-control-label-size: 12px;
  --liq-control-value-size: 13px;
  --liq-control-value-weight: 900;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 254px 176px minmax(136px, max-content);
  gap: 10px 9px;
  align-items: end;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.liq-controls label,
.liq-pair-control,
.liq-range-control,
.liq-threshold-control {
  display: grid;
  gap: 5px;
  font-size: var(--liq-control-label-size);
  font-weight: 800;
}

.liq-control-label {
  color: var(--quiet);
  font-size: 12px;
  text-transform: uppercase;
}

.liq-pair-control {
  position: relative;
  min-width: 0;
}

.liq-pair-trigger {
  position: relative;
  width: 100%;
  height: 36px;
  border: 1px solid rgba(139, 158, 165, 0.44);
  border-radius: 7px;
  padding: 0 34px 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  text-align: left;
  text-transform: none;
}

.liq-pair-trigger::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(75, 90, 96, 0.72);
  border-bottom: 2px solid rgba(75, 90, 96, 0.72);
  transform: translateY(-68%) rotate(45deg);
}

.liq-pair-menu {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  z-index: 20;
  width: min(260px, 86vw);
  overflow: hidden;
  border: 1px solid rgba(133, 150, 156, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.liq-pair-menu[hidden] {
  display: none;
}

.liq-pair-menu button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  text-align: left;
}

.liq-pair-menu button:hover {
  color: var(--ink);
  background: rgb(245, 245, 245);
}

.liq-pair-menu button[aria-checked="true"] {
  color: var(--ink);
  background: rgb(229, 229, 229);
}

.liq-controls input,
.liq-controls select {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(139, 158, 165, 0.44);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
}

.liq-threshold-control {
  position: relative;
  min-width: 136px;
}

.liq-control-label [data-liq-threshold-value] {
  display: none;
}

.liq-threshold-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 24;
  display: none;
  grid-template-columns: minmax(160px, 1fr);
  gap: 0;
  align-items: center;
  width: min(220px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid rgba(133, 150, 156, 0.34);
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

html[dir="rtl"] .liq-threshold-popover {
  right: auto;
  left: 0;
}

.liq-threshold-popover [data-liq-threshold-number] {
  display: none;
}

.liq-threshold-control.is-threshold-open .liq-threshold-popover {
  display: grid;
}

.liq-controls .liq-threshold-trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-inline-size: 136px;
  min-width: 0;
  height: 36px;
  border: 1px solid rgba(139, 158, 165, 0.44);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.liq-controls .liq-threshold-trigger:hover {
  color: var(--ink);
  background: #fff;
}

.liq-controls input[type="range"] {
  height: 36px;
  padding: 0;
  accent-color: var(--button-bg);
  background: transparent;
}

.liq-controls input[type="number"] {
  text-align: center;
  font-weight: 800;
}

.liq-controls button {
  height: 36px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  color: #fff;
  background: var(--button-bg);
  font-weight: 800;
}

.liq-controls button:hover {
  background: var(--button-hover);
}

.liq-controls select,
.liq-controls .liq-pair-trigger,
.liq-controls .liq-threshold-trigger {
  font-size: var(--liq-control-value-size);
  font-weight: var(--liq-control-value-weight);
  line-height: 1;
}

.liq-controls .liq-pair-trigger {
  border: 1px solid rgba(139, 158, 165, 0.44);
  color: var(--ink);
  background: #fff;
}

.liq-controls .liq-pair-trigger:hover {
  color: var(--ink);
  background: #fff;
}

.liq-controls .liq-pair-menu button {
  height: 38px;
  border-radius: 0;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.liq-controls .liq-pair-menu button:hover {
  color: var(--ink);
  background: rgb(245, 245, 245);
}

.liq-controls .liq-pair-menu button[aria-checked="true"] {
  color: var(--ink);
  background: rgb(229, 229, 229);
}

.liq-main-grid {
  --liq-chart-stage-height: clamp(420px, calc(100vh - 260px), 560px);
  --liq-chart-shell-height: calc(var(--liq-chart-stage-height) + 84px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 314px;
  gap: 0;
  align-items: start;
}

.liq-chart-shell,
.liq-insight-panel,
.liq-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.liq-chart-shell {
  overflow: hidden;
  border-radius: 8px 0 0 8px;
  background: #060a0f;
}

.liq-chart-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(148, 185, 196, 0.16);
  background: #080d14;
}

.liq-chart-top h2 {
  margin: 0;
  color: #e7f6fa;
  font-size: 18px;
}

.liq-chart-top p {
  margin: 4px 0 0;
  color: rgba(183, 207, 215, 0.74);
}

.liq-chart-top a {
  flex: 0 0 auto;
  color: #f6e86b;
  font-size: 13px;
  font-weight: 900;
}

.liq-note h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.liq-note p {
  margin: 4px 0 0;
  color: var(--muted);
}

.liq-chart-stage {
  position: relative;
  height: var(--liq-chart-stage-height);
  min-height: 420px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(34, 74, 116, 0.18), transparent 34%),
    #05080d;
}

.liq-heatmap-layer,
.liq-tv-chart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.liq-heatmap-layer {
  z-index: 1;
  display: block;
  pointer-events: none;
}

.liq-tv-chart {
  z-index: 2;
}

.liq-tv-chart canvas {
  mix-blend-mode: normal;
}

.liq-empty {
  position: absolute;
  inset: 24px auto auto 24px;
  z-index: 4;
  color: #d5e1e4;
  font-weight: 800;
}

.liq-insight-panel {
  display: grid;
  align-content: start;
  gap: 0;
  min-width: 0;
  max-height: var(--liq-panel-height, var(--liq-chart-shell-height));
  overflow-y: auto;
  scrollbar-color: rgba(145, 174, 184, 0.42) transparent;
  scrollbar-width: thin;
  padding: 0;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: none;
}

html[dir="rtl"] .liq-chart-shell {
  border-radius: 0 8px 8px 0;
}

html[dir="rtl"] .liq-insight-panel {
  border-right: 0;
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.liq-insight-panel::-webkit-scrollbar {
  width: 7px;
}

.liq-insight-panel::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(145, 174, 184, 0.36);
}

.liq-insight-panel::-webkit-scrollbar-track {
  background: transparent;
}

.liq-panel-summary {
  box-sizing: border-box;
  display: grid;
  gap: 8px;
  min-width: 0;
  width: 100%;
  padding: 18px 20px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 250, 224, 0.7), rgba(255, 255, 255, 0));
}

.liq-panel-label,
.liq-panel-metrics dt,
.liq-zone-heading span {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.liq-panel-summary strong {
  color: var(--ink);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.08;
}

.liq-panel-summary p {
  max-width: 32ch;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 520;
  line-height: 1.45;
}

.liq-panel-metrics {
  box-sizing: border-box;
  display: grid;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
}

.liq-panel-metrics div {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(82px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  min-width: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.liq-panel-metrics dt {
  align-self: start;
  padding-top: 2px;
}

.liq-panel-metrics dd {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 0;
  text-align: right;
}

.liq-panel-metrics strong {
  color: var(--ink);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
}

.liq-panel-metrics span,
.liq-level-item em,
.liq-method-mini {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 520;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.liq-zone-section {
  display: grid;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.liq-zone-heading {
  box-sizing: border-box;
  width: 100%;
  padding: 14px 20px 0;
}

.liq-zone-list {
  box-sizing: border-box;
  display: grid;
  min-width: 0;
  width: 100%;
  padding: 0 20px 3px;
}

.liq-level-item {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(96px, 0.86fr) auto;
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.liq-level-item:last-child {
  border-bottom: 0;
}

.liq-level-item strong {
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1.2;
  min-width: 0;
}

.liq-level-item span {
  justify-self: end;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
}

.liq-level-item em {
  grid-column: 1 / -1;
  font-variant-numeric: tabular-nums;
}

.liq-level-item.short span {
  color: var(--red);
}

.liq-level-item.long span {
  color: var(--green);
}

.liq-level-empty {
  margin: 0;
  padding: 12px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.liq-method-mini {
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 13px 20px 16px;
}

.liq-note {
  padding: 12px 14px;
  box-shadow: none;
}

.liq-note h2 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.liq-note p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1040px) {
  .liquidation-page {
    padding-top: 8px;
    gap: 8px;
  }

  .liq-workspace {
    gap: 24px;
  }

  .liq-main-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .liq-controls {
    --liq-control-label-size: 11px;
    --liq-control-value-size: 12px;
    --liq-control-value-weight: 900;
    grid-template-columns: minmax(112px, 0.9fr) minmax(108px, 1fr) minmax(112px, 0.75fr);
    gap: 10px 6px;
    align-items: stretch;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
  }

  .liq-tool-title {
    grid-column: 1 / -1;
    grid-row: 1;
    padding: 10px 0 0;
  }

  .liq-tool-title .page-h1 {
    margin: 1px 0 8px;
  }

  .liq-pair-control {
    grid-column: 1;
    grid-row: 2;
  }

  .liq-range-control,
.liq-controls > label:not(.liq-threshold-control) {
    grid-column: 2;
    grid-row: 2;
  }

  .liq-threshold-control {
    grid-column: 3;
    grid-row: 2;
  }

  .liq-controls label,
.liq-range-control,
.liq-pair-control {
    gap: 5px;
  }

  .liq-controls input,
.liq-controls select,
.liq-controls .liq-pair-trigger {
    height: 40px;
  }

  .liq-controls .liq-pair-trigger {
    overflow: hidden;
    padding-right: 25px;
    padding-left: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .liq-pair-exchange {
    display: none;
  }

  .liq-pair-trigger::after {
    right: 10px;
  }

  .liq-pair-menu {
    top: calc(100% + 8px);
    width: 100%;
  }

  .liq-controls .liq-pair-menu button {
    height: 44px;
  }

  .liq-tool-title .page-eyebrow {
    display: none;
  }

  .liq-threshold-control {
    position: relative;
    gap: 6px;
    min-width: 112px;
  }

  .liq-control-label [data-liq-threshold-value] {
    display: none;
  }

  .liq-controls .liq-threshold-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    inline-size: 100%;
    min-inline-size: 0;
    max-inline-size: none;
    height: 40px;
    border: 1px solid rgba(139, 158, 165, 0.44);
    border-radius: 7px;
    padding: 0 8px;
    color: var(--ink);
    background: #fff;
  }

  .liq-controls .liq-threshold-trigger:hover {
    color: var(--ink);
    background: #fff;
  }

  .liq-threshold-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 24;
    display: none;
    grid-template-columns: minmax(160px, 1fr);
    gap: 0;
    align-items: center;
    width: min(220px, calc(100vw - 48px));
    padding: 12px;
    border: 1px solid rgba(133, 150, 156, 0.34);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
  }

  html[dir="rtl"] .liq-threshold-popover {
    right: auto;
    left: 0;
  }

  .liq-threshold-control.is-threshold-open .liq-threshold-popover {
    display: grid;
  }

  .liq-controls input[type="number"] {
    padding: 0 6px;
  }

  .liq-chart-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }

  .liq-chart-shell {
    width: 100vw;
    width: 100dvw;
    margin-inline: calc(50% - 50vw);
    margin-inline: calc(50% - 50dvw);
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .liq-chart-stage,
.liq-tv-chart {
    border-radius: 0;
    min-height: 390px;
    height: min(52vh, 460px);
  }

  .liq-insight-panel {
    display: block;
    grid-template-columns: 1fr;
    gap: 0;
    max-height: none;
    overflow: visible;
    width: 100%;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
    border-radius: 0;
  }

  html[dir="rtl"] .liq-chart-shell {
    border-radius: 0;
  }

  html[dir="rtl"] .liq-insight-panel {
    border: 0;
    border-radius: 0;
  }

  .liq-panel-summary {
    padding: 14px 16px 15px;
    background: transparent;
    text-align: start;
  }

  .liq-panel-summary strong {
    font-size: 20px;
  }

  .liq-panel-summary p {
    max-width: 62ch;
    font-size: 12px;
  }

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

  .liq-panel-metrics div {
    grid-template-columns: minmax(104px, 0.78fr) minmax(0, 1.22fr);
    gap: 14px;
    min-width: 0;
    padding: 12px 12px 13px;
    border-right: 0;
  }

  .liq-panel-metrics dd {
    text-align: right;
  }

  .liq-panel-metrics strong {
    font-size: 14px;
  }

  .liq-panel-metrics span {
    font-size: 11px;
    line-height: 1.35;
  }

  .liq-zone-section {
    border-bottom: 1px solid var(--line);
  }

  .liq-zone-section:last-of-type {
    border-bottom: 0;
  }

  .liq-zone-heading {
    padding: 13px 16px 0;
  }

  .liq-zone-list {
    padding: 0 16px 2px;
  }

  .liq-level-item {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 54px;
    padding: 10px 0;
  }

  .liq-level-item strong {
    font-size: 15px;
  }

  .liq-method-mini {
    display: none;
  }
}

@media (max-width: 620px) {
  .liq-controls {
    grid-template-columns: minmax(0, 1fr) minmax(82px, 0.78fr) minmax(82px, 0.78fr);
    column-gap: 6px;
  }

  .liq-pair-control {
    grid-column: 1;
    grid-row: 2;
  }

  .liq-range-control,
  .liq-controls > label:not(.liq-threshold-control) {
    grid-column: 2;
    grid-row: 2;
  }

  .liq-threshold-control {
    grid-column: 3;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .liq-panel-metrics div {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px 16px;
    border-right: 0;
  }

  .liq-panel-metrics dd {
    text-align: left;
  }
}
