:root {
  --quotes-card: #1c2026;
  --quotes-card-border: #2a3038;
}

html:has(body.quotes-page),
body.quotes-page {
  height: 100%;
  overflow: hidden;
}

.quotes-page {
  min-height: 100vh;
}

.quotes-page .app {
  max-width: none;
  width: 100%;
  height: 100vh;
  margin: 0;
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.quotes-page .topbar {
  flex-shrink: 0;
  margin-bottom: 10px;
}

.quotes-page .topbar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.quotes-page .main {
  flex: 1;
  min-height: 0;
  gap: 10px;
}

.quotes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  margin: 0;
}

.quotes-head h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.quotes-head .meta {
  margin: 0;
}

.quotes-page .chart-panel {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: transparent;
  border: none;
  box-shadow: none;
}

.quotes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  gap: 14px;
}

.quotes-card {
  background: var(--quotes-card);
  border: 1px solid var(--quotes-card-border);
  border-radius: 10px;
  padding: 12px 12px 8px;
  min-height: 360px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.quotes-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 8px;
}

.quotes-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.quotes-card-quote {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quotes-card-price {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.15;
}

.quotes-card-chg {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  font-weight: 650;
}

.quotes-chart-wrap {
  position: relative;
  height: 300px;
}

.quotes-tf {
  position: absolute;
  top: 4px;
  left: 8px;
  z-index: 4;
  font-size: 0.72rem;
  color: #a0a7b4;
  pointer-events: none;
}

.quotes-chart a {
  display: none !important;
}

.quotes-chart {
  width: 100%;
  height: 100%;
}

.quotes-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.quotes-page .chn-up {
  color: #f6465d;
}

.quotes-page .chn-down {
  color: #0ecb81;
}

.quotes-page .chn-flat {
  color: var(--text-muted);
}

.quotes-page .overlay {
  border-radius: var(--radius);
}

.quotes-page .error {
  flex-shrink: 0;
}

.quotes-page .hidden {
  display: none !important;
}

.quotes-card-name {
  appearance: none;
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: inherit;
  letter-spacing: 0.02em;
  text-align: left;
  cursor: pointer;
}

.quotes-card-name:hover {
  color: var(--accent);
}

.quotes-cwin {
  position: fixed;
  z-index: 80;
  width: min(720px, calc(100vw - 16px));
  height: min(520px, calc(100vh - 72px));
  min-width: 320px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  background: #1c2026;
  border: 1px solid #2a3038;
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48);
  overflow: hidden;
}

.quotes-cwin.hidden {
  display: none !important;
}

.quotes-cwin.is-max {
  inset: 56px 12px 12px !important;
  width: auto !important;
  height: auto !important;
  border-radius: 8px;
}

.quotes-cwin.is-min {
  width: 300px !important;
  height: auto !important;
  min-height: 0;
  top: auto !important;
  bottom: 10px !important;
}

.quotes-cwin.is-min .quotes-cwin-body {
  display: none;
}

.quotes-cwin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding: 0 6px 0 12px;
  background: #161a20;
  border-bottom: 1px solid #2a3038;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.quotes-cwin.is-max .quotes-cwin-bar,
.quotes-cwin.is-min .quotes-cwin-bar {
  cursor: default;
}

.quotes-cwin-bar-title {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quotes-cwin-ops {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.quotes-cwin-btn {
  width: 28px;
  height: 22px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a0a7b4;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.quotes-cwin-btn:hover {
  background: #2b3139;
  color: #eaecef;
}

.quotes-cwin-close:hover {
  background: #e81123;
  color: #fff;
}

.quotes-cwin-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.quotes-cwin-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.quotes-cwin-table-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.quotes-cwin-table-wrap::-webkit-scrollbar-thumb {
  background: #3a424d;
  border-radius: 8px;
}

.quotes-cwin-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.82rem;
}

.quotes-cwin-table th,
.quotes-cwin-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(43, 49, 57, 0.75);
  white-space: nowrap;
}

.quotes-cwin-table th:first-child,
.quotes-cwin-table td:first-child {
  padding-left: 12px;
}

.quotes-cwin-table th {
  position: sticky;
  top: 0;
  background: #161b22;
  color: var(--text-muted);
  font-weight: 500;
  z-index: 1;
}

.quotes-cwin-table th.num,
.quotes-cwin-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quotes-cwin-table tbody tr:hover {
  background: rgba(240, 185, 11, 0.06);
}

.quotes-cwin-table th:nth-child(1),
.quotes-cwin-table td:nth-child(1),
.quotes-cwin-seq {
  width: 52px;
  text-align: left;
  color: var(--text-muted);
}

.quotes-cwin-table th:nth-child(3),
.quotes-cwin-table td:nth-child(3) {
  width: 88px;
}

.quotes-cwin-table th:nth-child(4),
.quotes-cwin-table td:nth-child(4),
.quotes-cwin-table th:nth-child(5),
.quotes-cwin-table td:nth-child(5) {
  width: 96px;
}

.quotes-cwin-empty td {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 12px;
}

@media (max-width: 560px) {
  .quotes-cwin-table {
    font-size: 0.74rem;
  }

  .quotes-cwin-table th,
  .quotes-cwin-table td {
    padding: 6px 6px;
  }

  .quotes-cwin-table th:nth-child(3),
  .quotes-cwin-table td:nth-child(3) {
    width: 72px;
  }

  .quotes-cwin-table th:nth-child(4),
  .quotes-cwin-table td:nth-child(4),
  .quotes-cwin-table th:nth-child(5),
  .quotes-cwin-table td:nth-child(5) {
    width: 76px;
  }
}

@media (max-width: 520px) {
  .quotes-grid {
    grid-template-columns: 1fr;
  }
}
