:root {
  color-scheme: dark;
  --background: #050816;
  --background-deep: #03050d;
  --surface: rgba(12, 18, 36, .78);
  --surface-strong: rgba(17, 24, 47, .9);
  --surface-soft: rgba(11, 17, 33, .56);
  --line: rgba(144, 159, 201, .2);
  --line-soft: rgba(144, 159, 201, .11);
  --text: #f7f8fc;
  --muted: #99a6bf;
  --muted-strong: #bec8dc;
  --green: #52e4a0;
  --amber: #ffbd68;
  --blue: #58b7ff;
  --violet: #9c6cff;
  --magenta: #f45ac6;
  --red: #ff6288;
  --shadow: 0 24px 70px rgba(0, 0, 0, .36);
}

.valki-ui-page {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(50, 79, 133, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 79, 133, .035) 1px, transparent 1px),
    linear-gradient(180deg, #050816 0%, #070b18 52%, #040711 100%);
  background-size: 72px 72px, 72px 72px, auto;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.valki-app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  width: 100%;
  height: 106px;
  padding-top: 12px;
  isolation: isolate;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 5, 13, .99), rgba(4, 7, 18, .98) 72%, rgba(5, 8, 22, .94));
}

.valki-app-header::after {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: -30px;
  left: 0;
  height: 32px;
  background: linear-gradient(180deg, rgba(5, 8, 22, .92), rgba(5, 8, 22, .18) 70%, transparent);
  pointer-events: none;
  content: "";
}

.valki-app-bar {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  pointer-events: auto;
  background: rgba(5, 8, 22, .91);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .28), inset 0 1px rgba(255, 255, 255, .025);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  backdrop-filter: blur(20px) saturate(125%);
}

.valki-brand {
  width: fit-content;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.valki-brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 0 24px rgba(156, 108, 255, .16);
  object-fit: cover;
}

.valki-brand strong,
.valki-brand small { display: block; }
.valki-brand strong { font-size: 15px; }
.valki-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.valki-nav {
  height: 68px;
  display: flex;
  align-items: stretch;
  gap: 30px;
}

.valki-nav a {
  position: relative;
  display: grid;
  place-items: center;
  color: #c8d0df;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 180ms ease;
}

.valki-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  opacity: 0;
  transform: scaleX(.5);
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  box-shadow: 0 0 14px rgba(244, 90, 198, .65);
  content: "";
  transition: opacity 180ms ease, transform 180ms ease;
}

.valki-nav a:hover,
.valki-nav a:focus-visible,
.valki-nav a.active { color: #fff; }
.valki-nav a.active::after { opacity: 1; transform: scaleX(1); }
.valki-nav a:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

.valki-live-state {
  justify-self: end;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(82, 228, 160, .1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-strong);
  background: rgba(82, 228, 160, .035);
  font-size: 12px;
  white-space: nowrap;
}

.valki-state-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 189, 104, .55);
}

.valki-state-dot.live {
  background: var(--green);
  box-shadow: 0 0 14px rgba(82, 228, 160, .82);
  animation: valki-status-breathe 2.8s ease-in-out infinite;
}

.valki-state-dot.error {
  background: var(--red);
  box-shadow: 0 0 12px rgba(255, 98, 136, .65);
}

.valki-network-pulse {
  position: relative;
  width: 28px;
  height: 28px;
  margin-left: 3px;
  border-left: 1px solid var(--line-soft);
}

.valki-network-pulse::before,
.valki-network-pulse::after {
  position: absolute;
  content: "";
}

.valki-network-pulse::before {
  top: 8px;
  right: 2px;
  width: 17px;
  height: 10px;
  border-bottom: 1px solid var(--magenta);
  transform: skewY(-35deg);
  filter: drop-shadow(0 0 5px rgba(244, 90, 198, .75));
}

.valki-network-pulse::after {
  top: 13px;
  right: 3px;
  width: 15px;
  border-top: 1px solid rgba(244, 90, 198, .5);
}

.valki-energy {
  --ve-row-height: 62px;
  width: 100%;
  color: var(--text);
}

.ve-livebar {
  min-height: 34px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ve-live-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.ve-live-copy strong {
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.ve-live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(82, 228, 160, .65);
}

.ve-live-dot.is-stale { background: var(--amber); box-shadow: 0 0 12px rgba(255, 189, 104, .55); }
.ve-live-dot.is-error { background: var(--red); box-shadow: 0 0 12px rgba(255, 98, 136, .55); }

.ve-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.ve-summary-item {
  --accent: var(--magenta);
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 158px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(17, 24, 45, .82), rgba(9, 14, 28, .76));
  box-shadow: inset 0 1px rgba(255, 255, 255, .025), 0 14px 38px rgba(0, 0, 0, .15);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ve-summary-item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); }
.ve-summary-item.is-selected {
  border-color: color-mix(in srgb, var(--accent) 72%, white 6%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .04),
    0 14px 38px rgba(0, 0, 0, .18),
    0 0 24px color-mix(in srgb, var(--accent) 12%, transparent);
}

.ve-summary-item::before {
  position: absolute;
  right: -55px;
  bottom: -80px;
  z-index: 0;
  width: 170px;
  height: 150px;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--accent) 28%, transparent), transparent 68%);
  content: "";
}
.ve-summary-item::after {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 70%, transparent);
  content: "";
  pointer-events: none;
}
.ve-summary-item.is-anchor,
.ve-summary-item.is-favorite { --accent: var(--amber); }
.ve-summary-item.is-low { --accent: var(--green); }
.ve-summary-item.is-high { --accent: var(--red); }
.ve-summary-item.is-move { --accent: var(--magenta); }

.ve-summary-label,
.ve-summary-detail,
.ve-summary-value {
  position: relative;
  z-index: 3;
  display: block;
  max-width: calc(100% - 110px);
  pointer-events: none;
}
.ve-summary-label { max-width: 100%; color: var(--muted-strong); font-size: 12px; }
.ve-summary-value {
  min-height: 31px;
  margin-top: 26px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 24px;
  line-height: 1.28;
  font-variant-numeric: tabular-nums;
}
.ve-summary-detail { margin-top: 7px; color: var(--muted); font-size: 11px; }
.ve-summary-favorite-star {
  position: absolute;
  right: 43px;
  bottom: 62px;
  z-index: 6;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--amber);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(255, 189, 104, .65);
  cursor: pointer;
}
.ve-summary-open {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: transparent;
  cursor: pointer;
}
.ve-summary-open:disabled { cursor: default; }
.ve-summary-open:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 82%, white);
  outline-offset: -3px;
}
.ve-summary-favorite-star[aria-pressed="false"] { text-shadow: none; }
.ve-summary-favorite-star:hover { color: #ffd887; text-shadow: 0 0 13px rgba(255, 189, 104, .72); }
.ve-summary-favorite-star:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 1px;
}
.ve-summary-flag {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: 122px;
  height: 70px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 25%, 12% 17%, 25% 21%, 38% 12%, 52% 18%, 66% 9%, 82% 15%, 100% 4%, 100% 100%, 0 100%);
  background: color-mix(in srgb, var(--accent) 9%, rgba(5, 8, 15, .96));
  box-shadow:
    0 12px 34px color-mix(in srgb, var(--accent) 24%, transparent),
    inset 0 0 22px rgba(255, 255, 255, .08);
  opacity: .72;
  transform: perspective(260px) rotateY(-7deg) rotateZ(-1deg) skewY(-2deg);
  transform-origin: right bottom;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .5) 22%, #000 40%, #000 100%);
  mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, .5) 22%, #000 40%, #000 100%);
}
.ve-summary-flag::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .13), transparent 35%, rgba(2, 5, 12, .24)),
    linear-gradient(90deg, rgba(255, 255, 255, .18), transparent 17%, rgba(2, 5, 12, .22) 31%, rgba(255, 255, 255, .15) 48%, rgba(2, 5, 12, .2) 66%, rgba(255, 255, 255, .12) 82%, transparent);
  content: "";
  pointer-events: none;
}
.ve-summary-flag img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(1.04) brightness(.9);
}
.ve-summary-flag .ve-flag-fallback {
  color: color-mix(in srgb, var(--accent) 78%, white);
  font-size: 13px;
  font-weight: 800;
}
.ve-summary-flag.has-image .ve-flag-fallback { visibility: hidden; }

.ve-summary-market-detail {
  min-width: 0;
  margin-top: 12px;
}
.ve-summary-market-detail[hidden] { display: none; }
.ve-summary-market-detail.is-closing .ve-detail { animation: ve-detail-out 200ms ease-in forwards; pointer-events: none; }
.ve-summary-market-detail .ve-detail {
  border: 1px solid color-mix(in srgb, var(--blue) 22%, var(--line));
  border-left: 3px solid color-mix(in srgb, var(--blue) 80%, var(--green));
  border-radius: 8px;
}
.ve-summary-market-detail + .ve-toolbar { margin-top: 12px; }
.ve-summary-market-detail[hidden] + .ve-toolbar { margin-top: 18px; }

.ve-toolbar {
  margin: 18px 0 12px;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.ve-search {
  position: relative;
  min-width: 0;
  height: 42px;
  display: block;
}

.ve-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: var(--text);
  background: rgba(10, 15, 30, .72);
  font: inherit;
  font-size: 12px;
  transition: border-color 160ms ease, background 160ms ease;
}

.ve-search input::placeholder { color: #76839d; }
.ve-search input:focus { border-color: rgba(88, 183, 255, .56); background: rgba(13, 20, 39, .88); }
.ve-search-icon {
  position: absolute;
  z-index: 1;
  top: 13px;
  left: 15px;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  pointer-events: none;
}
.ve-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  transform: rotate(45deg);
  background: var(--muted);
  content: "";
}

.ve-segments {
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  background: rgba(10, 15, 30, .72);
}

.ve-segment {
  min-width: 104px;
  padding: 0 12px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}
.ve-segment:hover { color: var(--text); }
.ve-segment[aria-pressed="true"] { color: var(--text); background: rgba(156, 108, 255, .13); }
.ve-segment:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

.ve-table-shell {
  margin-top: 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 26, .62);
  box-shadow: inset 0 1px rgba(255, 255, 255, .018);
}
.ve-mode-terminal .ve-table-shell {
  position: relative;
  isolation: isolate;
  margin-top: 0;
  border-color: rgba(145, 165, 180, .13);
  background: linear-gradient(180deg, rgba(9, 15, 24, .97) 0%, rgba(5, 9, 17, .98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .025),
    0 8px 24px rgba(0, 0, 0, .28),
    0 28px 70px rgba(0, 0, 0, .24),
    0 0 50px rgba(82, 228, 160, .022);
}

.ve-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.ve-table th,
.ve-table td {
  height: var(--ve-row-height);
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
  text-align: right;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.ve-table th {
  height: 48px;
  color: var(--muted);
  background: rgba(7, 11, 24, .78);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ve-table th:first-child,
.ve-table td:first-child,
.ve-table .ve-col-market { text-align: left; }
.ve-table tbody tr:last-child td { border-bottom: 0; }
.ve-market-row { cursor: pointer; transition: background 200ms ease, box-shadow 200ms ease, opacity 200ms ease; }
.ve-market-row:hover { background: rgba(88, 183, 255, .045); }
.ve-market-row:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--blue) 72%, transparent);
  outline-offset: -2px;
  background: rgba(88, 183, 255, .06);
}
.has-selection .ve-market-row:not(.is-selected) { opacity: .92; }
.has-selection .ve-market-row:not(.is-selected):hover,
.has-selection .ve-market-row:not(.is-selected):focus-visible { opacity: 1; }
.ve-market-row.is-selected {
  background: linear-gradient(90deg, color-mix(in srgb, var(--blue) 11%, transparent), rgba(255, 255, 255, .025) 58%, color-mix(in srgb, var(--green) 4%, transparent));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--blue) 80%, var(--green)), inset 0 1px 0 rgba(255, 255, 255, .045);
}
.ve-market-row.is-selected > td { border-bottom-color: transparent; }

@media (min-width: 701px) {
  .ve-market-row.is-ambient-up > td { animation: ve-market-pulse-expensive 1.4s ease-out; }
  .ve-market-row.is-ambient-down > td { animation: ve-market-pulse-cheap 1.4s ease-out; }
  .ve-market-row.is-refresh-up > td { animation: ve-market-refresh-expensive 1.8s ease-out; }
  .ve-market-row.is-refresh-down > td { animation: ve-market-refresh-cheap 1.8s ease-out; }
}

.ve-market-row.is-ambient-up .ve-spark path { animation: ve-spark-pulse-expensive 1.4s ease-out; }
.ve-market-row.is-ambient-down .ve-spark path { animation: ve-spark-pulse-cheap 1.4s ease-out; }
.ve-market-row.is-refresh-up .ve-spark path { animation: ve-spark-pulse-expensive 1.8s ease-out; }
.ve-market-row.is-refresh-down .ve-spark path { animation: ve-spark-pulse-cheap 1.8s ease-out; }

.ve-col-rank { width: 46px; color: #73809a; }
.ve-col-market { width: 218px; }
.ve-col-spot { width: 134px; color: #eef2f9; font-weight: 700; }
.ve-col-trend { width: 174px; }
.ve-col-signal { width: 142px; }
.ve-col-valki { width: 146px; color: #f3d7ed; font-weight: 650; }
.ve-col-next { width: 112px; color: var(--muted); font-size: 10px; }
.ve-col-next.is-stale { color: var(--amber); }
.ve-energy-only .ve-col-market { width: 248px; }
.ve-energy-only .ve-col-spot { width: 154px; }
.ve-energy-only .ve-col-trend { width: 220px; }
.ve-energy-only .ve-col-signal { width: 160px; }
.ve-energy-only .ve-col-next { width: 140px; }

.ve-next-price {
  display: block;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.ve-next-meta {
  margin-top: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
  white-space: nowrap;
}
.ve-next-separator { opacity: .38; }
.ve-next-change.is-up { color: var(--red); }
.ve-next-change.is-down { color: var(--green); }

.ve-market-link {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.ve-market-link:hover .ve-market-names strong { color: var(--green); }
.ve-market-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.ve-market-names { min-width: 0; }
.ve-market-names strong,
.ve-market-names small { display: block; }
.ve-market-names strong { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ve-market-names small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.ve-flag {
  position: relative;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .055);
}
.ve-flag.is-large { width: 42px; height: 42px; flex-basis: 42px; }
.ve-flag img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ve-flag-fallback { color: var(--muted); font-size: 8px; font-weight: 800; }
.ve-flag.has-image .ve-flag-fallback { visibility: hidden; }

.ve-trend-cell { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.ve-spark {
  width: 104px;
  height: 34px;
  flex: 0 0 104px;
  overflow: hidden;
}
.ve-spark svg { width: 100%; height: 100%; display: block; }
.ve-spark path { stroke: #8490a6; stroke-width: 1.7; }
.ve-spark.cheap path { stroke: var(--green); filter: drop-shadow(0 0 3px rgba(82, 228, 160, .26)); }
.ve-spark.expensive path { stroke: var(--red); filter: drop-shadow(0 0 3px rgba(255, 98, 136, .24)); }
.ve-spark.is-empty::after { display: block; padding-top: 10px; color: var(--muted); text-align: center; content: "--"; }
.ve-change { min-width: 48px; color: var(--muted); font-size: 9px; }
.ve-change.is-up { color: var(--red); }
.ve-change.is-down { color: var(--green); }

.ve-signal {
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, .025);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.ve-signal.is-good { color: var(--green); border-color: rgba(82, 228, 160, .22); background: rgba(82, 228, 160, .065); }
.ve-signal.is-warning { color: var(--amber); border-color: rgba(255, 189, 104, .2); background: rgba(255, 189, 104, .06); }
.ve-signal.is-bad { color: var(--red); border-color: rgba(255, 98, 136, .22); background: rgba(255, 98, 136, .065); }

.ve-sort {
  width: 100%;
  padding: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}
.ve-col-market .ve-sort { justify-content: flex-start; }
.ve-sort:hover,
.ve-sort.is-active { color: var(--text); }
.ve-sort:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.ve-sort-indicator { min-width: 8px; color: var(--magenta); }

.ve-expand {
  min-height: 38px;
  margin: 14px auto 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
  color: var(--muted-strong);
  background: rgba(17, 24, 47, .72);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 650;
}
.ve-expand:hover { color: var(--text); border-color: rgba(156, 108, 255, .42); }
.ve-expand:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.ve-disclosure {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.ve-empty {
  margin: 18px 0 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.ve-skeleton {
  width: 72%;
  height: 9px;
  margin-left: auto;
  border-radius: 4px;
  display: block;
  background: linear-gradient(90deg, rgba(144, 159, 201, .07), rgba(144, 159, 201, .16), rgba(144, 159, 201, .07));
  background-size: 200% 100%;
  animation: ve-loading 1.5s linear infinite;
}
.ve-loading-row td:nth-child(2) .ve-skeleton { width: 84%; margin-left: 0; }

.ve-detail-row > td { height: auto; padding: 0; text-align: left; background: transparent; }
.ve-detail-row.is-closing .ve-detail { animation: ve-detail-out 200ms ease-in forwards; pointer-events: none; }
.ve-detail {
  padding: 18px 22px 20px;
  border-top: 1px solid color-mix(in srgb, var(--blue) 30%, transparent);
  border-right: 1px solid color-mix(in srgb, var(--blue) 16%, transparent);
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid color-mix(in srgb, var(--blue) 80%, var(--green));
  border-radius: 0 0 8px 8px;
  background:
    radial-gradient(circle at 13% 0%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 34%),
    linear-gradient(180deg, rgba(11, 18, 34, .97), rgba(7, 12, 24, .97));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 16px 36px rgba(0, 0, 0, .22);
  animation: ve-detail-in 200ms cubic-bezier(.2, .8, .2, 1);
}
.ve-detail-toolbar { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ve-detail-toolbar > div:first-child { min-width: 0; }
.ve-detail-toolbar strong { display: block; color: var(--text); font-size: 12px; font-weight: 760; }
.ve-detail-toolbar span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.ve-detail-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.ve-favorite-toggle {
  width: 26px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.ve-favorite-toggle:hover,
.ve-favorite-toggle[aria-pressed="true"] {
  color: var(--amber);
  text-shadow: 0 0 12px rgba(255, 189, 104, .65);
}
.ve-favorite-toggle:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
.ve-detail p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.ve-detail-close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted-strong);
  background: var(--surface-soft);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
}
.ve-detail-close:hover { color: var(--text); border-color: rgba(255, 98, 136, .38); }
.ve-detail-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.ve-detail-body { margin-top: 16px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, .5fr); align-items: stretch; gap: 24px; }
.ve-detail-chart { min-width: 0; min-height: 190px; padding: 8px 0 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.ve-timeline { position: relative; min-width: 0; height: 178px; padding-bottom: 22px; touch-action: pan-y; }
.ve-timeline > svg { width: 100%; height: 150px; display: block; overflow: visible; touch-action: none; }
.ve-timeline-grid-line { stroke: rgba(148, 163, 184, .1); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.ve-timeline-grid-line.is-zero { stroke: rgba(255, 189, 104, .32); stroke-dasharray: 2 5; }
.ve-timeline-future-shade { fill: rgba(88, 183, 255, .025); pointer-events: none; }
.ve-timeline-line { stroke: #8490a6; stroke-width: 2.5; filter: drop-shadow(0 0 4px rgba(132, 144, 166, .18)); }
.ve-timeline.cheap .ve-timeline-line { stroke: var(--green); filter: drop-shadow(0 0 5px rgba(82, 228, 160, .24)); }
.ve-timeline.expensive .ve-timeline-line { stroke: var(--red); filter: drop-shadow(0 0 5px rgba(255, 98, 136, .22)); }
.ve-timeline-line.is-past { opacity: .98; }
.ve-timeline-line.is-future { opacity: .66; stroke-dasharray: 5 7; }
.ve-timeline-current-band { fill: color-mix(in srgb, var(--blue) 7%, transparent); pointer-events: none; }
.ve-timeline-now-line { stroke: color-mix(in srgb, var(--blue) 72%, white); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.ve-timeline-now-label,
.ve-timeline-future-label { position: absolute; top: 1px; z-index: 2; color: color-mix(in srgb, var(--blue) 70%, white); font-size: 8px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; pointer-events: none; }
.ve-timeline-now-label { transform: translateX(-50%); padding: 2px 5px; border: 1px solid color-mix(in srgb, var(--blue) 22%, transparent); border-radius: 4px; background: rgba(5, 9, 18, .86); box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.ve-timeline-future-label { right: 4px; color: var(--muted); opacity: .74; }
.ve-timeline-now-dot,
.ve-timeline-hover-dot { position: absolute; z-index: 2; width: 10px; height: 10px; transform: translate(-50%, -50%); border: 2px solid var(--blue); border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent), 0 0 13px color-mix(in srgb, var(--blue) 36%, transparent); pointer-events: none; }
.ve-timeline-now-dot { animation: ve-now-pulse 2.4s ease-in-out infinite; }
.ve-timeline-hover-dot { z-index: 4; width: 8px; height: 8px; border-color: var(--text); background: var(--blue); box-shadow: 0 0 9px color-mix(in srgb, var(--blue) 52%, transparent); }
.ve-timeline-hover-dot[hidden] { display: none; }
.ve-timeline-hover-line { stroke: rgba(226, 232, 240, .42); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.ve-timeline-hit-area { fill: transparent; cursor: crosshair; touch-action: none; }
.ve-timeline.is-scrubbing .ve-timeline-hit-area { cursor: grabbing; }
.ve-timeline:focus,
.ve-timeline > svg:focus,
.ve-timeline-hit-area:focus,
.ve-timeline-hit-area:focus-visible { outline: none !important; stroke: transparent; }
.ve-timeline-selection-frame {
  position: absolute;
  z-index: 1;
  top: -6px;
  right: -6px;
  left: -6px;
  height: 162px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(88, 183, 255, .1);
}
.ve-timeline.has-selection .ve-timeline-selection-frame,
.ve-timeline:focus-within .ve-timeline-selection-frame {
  opacity: 1;
}
.ve-timeline-axis { position: absolute; left: 0; right: 0; bottom: 2px; height: 16px; pointer-events: none; }
.ve-timeline-axis span { position: absolute; transform: translateX(-50%); color: var(--muted); font-size: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ve-timeline-axis span:first-child { transform: none; }
.ve-timeline-axis span:last-child { transform: translateX(-100%); }
.ve-timeline-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 108px;
  padding: 7px 8px;
  transform: translate(-50%, -108%);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 9, 18, .96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .38);
  pointer-events: none;
}
.ve-timeline-tooltip[hidden] { display: none; }
.ve-timeline-tooltip strong,
.ve-timeline-tooltip span,
.ve-timeline-tooltip em { display: block; }
.ve-timeline-tooltip strong { color: var(--text); font-size: 11px; }
.ve-timeline-tooltip span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.ve-timeline-tooltip em { margin-top: 3px; font-size: 8px; font-style: normal; font-weight: 700; }
.ve-timeline-tooltip em.past { color: var(--muted); }
.ve-timeline-tooltip em.current { color: color-mix(in srgb, var(--blue) 72%, white); }
.ve-timeline-tooltip em.upcoming { color: var(--green); }
.ve-timeline.is-empty { min-height: 156px; display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.ve-detail-metrics { margin: 0; border-top: 1px solid var(--line); }
.ve-detail-metrics > div { min-height: 43px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ve-detail-metrics dt { color: var(--muted); font-size: 10px; }
.ve-detail-metrics dd { margin: 0; color: var(--text); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ve-detail-source { margin-top: 14px !important; }

@keyframes ve-detail-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ve-detail-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-5px); } }
@keyframes ve-now-pulse { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }

@keyframes valki-status-breathe {
  0%, 100% { opacity: .72; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes ve-loading {
  to { background-position: -200% 0; }
}

@keyframes ve-market-pulse-cheap {
  0%, 100% { background-color: transparent; }
  18% { background-color: rgba(66, 221, 160, .15); }
  48% { background-color: rgba(66, 221, 160, .07); }
}

@keyframes ve-market-pulse-expensive {
  0%, 100% { background-color: transparent; }
  18% { background-color: rgba(255, 110, 133, .15); }
  48% { background-color: rgba(255, 110, 133, .07); }
}

@keyframes ve-market-refresh-cheap {
  0%, 100% { background-color: transparent; }
  16% { background-color: rgba(66, 221, 160, .22); }
  52% { background-color: rgba(66, 221, 160, .09); }
}

@keyframes ve-market-refresh-expensive {
  0%, 100% { background-color: transparent; }
  16% { background-color: rgba(255, 110, 133, .22); }
  52% { background-color: rgba(255, 110, 133, .09); }
}

@keyframes ve-spark-pulse-cheap {
  0%, 100% { filter: none; }
  18% { stroke: var(--green); stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(66, 221, 160, .72)); }
}

@keyframes ve-spark-pulse-expensive {
  0%, 100% { filter: none; }
  18% { stroke: var(--red); stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(255, 110, 133, .7)); }
}

@media (max-width: 1080px) {
  .valki-app-bar { grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr); }
  .valki-nav { gap: 20px; }
  .ve-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .valki-app-header { height: 138px; padding-top: 8px; }
  .valki-app-bar {
    width: calc(100% - 20px);
    min-height: 112px;
    padding: 8px 12px 0;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 52px 50px;
    gap: 0 16px;
  }
  .valki-brand-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .valki-nav {
    height: 50px;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    gap: 10px;
  }
  .valki-nav a { min-width: 58px; font-size: 11px; }
  .valki-live-state { max-width: 180px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; }
  .valki-network-pulse { display: none; }
  .ve-toolbar { grid-template-columns: 1fr; }
  .ve-segments { width: 100%; }
  .ve-segment { min-width: 0; flex: 1 1 0; }
  .ve-detail-body { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .ve-live-copy { align-items: flex-start; flex-wrap: wrap; }
  .ve-live-copy strong { margin-right: 6px; }
  .ve-search input { font-size: 16px; }
  .ve-summary { gap: 12px; }
  .ve-summary-item { min-height: 136px; padding: 16px; }
  .ve-summary-value { max-width: calc(100% - 88px); font-size: 20px; }
  .ve-summary-favorite-star { right: 37px; bottom: 53px; width: 30px; height: 30px; font-size: 18px; }
  .ve-summary-flag { right: 0; bottom: 0; width: 108px; height: 62px; }
  .ve-table-shell { overflow: hidden; }
  .ve-mode-terminal .ve-table-shell {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .025),
      0 8px 20px rgba(0, 0, 0, .26),
      0 22px 44px rgba(0, 0, 0, .18),
      0 0 32px rgba(82, 228, 160, .018);
  }
  .ve-table { min-width: 0; display: block; }
  .ve-table thead { display: none; }
  .ve-table tbody { display: block; }
  .ve-market-row {
    min-height: 132px;
    padding: 15px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "market spot"
      "trend signal"
      "valki next";
    align-items: center;
    gap: 10px 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  .ve-energy-only .ve-market-row {
    min-height: 118px;
    grid-template-areas:
      "market spot"
      "trend signal"
      "next next";
  }
  .ve-market-row.is-ambient-up .ve-col-spot,
  .ve-market-row.is-ambient-up .ve-col-trend { animation: ve-market-pulse-expensive 1.4s ease-out; }
  .ve-market-row.is-ambient-down .ve-col-spot,
  .ve-market-row.is-ambient-down .ve-col-trend { animation: ve-market-pulse-cheap 1.4s ease-out; }
  .ve-market-row.is-refresh-up .ve-col-spot,
  .ve-market-row.is-refresh-up .ve-col-trend { animation: ve-market-refresh-expensive 1.8s ease-out; }
  .ve-market-row.is-refresh-down .ve-col-spot,
  .ve-market-row.is-refresh-down .ve-col-trend { animation: ve-market-refresh-cheap 1.8s ease-out; }
  .ve-table td { width: auto; height: auto; padding: 0; border: 0; }
  .ve-col-rank { display: none; }
  .ve-col-market { grid-area: market; }
  .ve-col-spot { grid-area: spot; text-align: right; }
  .ve-col-trend { grid-area: trend; text-align: left; }
  .ve-col-signal { grid-area: signal; text-align: right; }
  .ve-col-valki { grid-area: valki; text-align: left; }
  .ve-col-next { grid-area: next; text-align: right; }
  .ve-energy-only .ve-col-next { width: auto; }
  .ve-trend-cell { justify-content: flex-start; }
  .ve-detail-row,
  .ve-detail-row > td { display: block; }
  .ve-detail { padding: 18px 15px; }
  .ve-detail-chart { min-height: 184px; }
  .ve-timeline { height: 172px; }
  .ve-timeline[data-ve-timeline-placement="row"] { touch-action: none; }
  .ve-loading-row {
    min-height: 92px;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    border-bottom: 1px solid var(--line-soft);
  }
  .ve-loading-row td { display: block; width: auto; height: auto; padding: 0; border: 0; }
  .ve-loading-row td:nth-child(n+5) { display: none; }
}

@media (max-width: 460px) {
  .valki-brand { gap: 9px; }
  .valki-brand small { display: none; }
  .valki-live-state { max-width: 150px; padding: 0 8px; }
  .valki-nav a { min-width: 0; }
  .ve-summary { gap: 8px; }
  .ve-summary-item { min-height: 128px; padding: 14px; }
  .ve-summary-label { font-size: 10px; }
  .ve-summary-value { max-width: 100%; margin-top: 20px; font-size: 17px; }
  .ve-summary-detail { max-width: calc(100% - 62px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ve-summary-favorite-star { right: 23px; bottom: 37px; width: 28px; height: 28px; font-size: 16px; }
  .ve-summary-flag { right: 0; bottom: 0; width: 78px; height: 48px; }
  .ve-market-row { gap: 10px 12px; }
  .ve-spark { width: 86px; flex-basis: 86px; }
  .ve-change { min-width: 40px; }
  .ve-timeline-axis .is-secondary { display: none; }
  .ve-timeline-future-label { display: none; }
  .ve-detail-metrics > div { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .valki-state-dot.live,
  .ve-skeleton { animation: none; }
  .valki-nav a,
  .ve-market-row,
  .ve-search input { transition: none; }
  .ve-detail,
  .ve-detail-row.is-closing .ve-detail,
  .ve-summary-market-detail.is-closing .ve-detail,
  .ve-timeline-now-dot { animation: none; }
  .ve-market-row[class*="is-ambient-"] > td,
  .ve-market-row[class*="is-refresh-"] > td,
  .ve-market-row[class*="is-ambient-"] .ve-spark path,
  .ve-market-row[class*="is-refresh-"] .ve-spark path { animation: none !important; }
}

@media (forced-colors: active) {
  .ve-timeline.has-selection .ve-timeline-selection-frame,
  .ve-timeline:focus-within .ve-timeline-selection-frame { border-color: Highlight; box-shadow: none; }
}
