:root {
  --bg: #0b0d10;
  --bg-2: #07090d;
  --panel: #10151d;
  --panel-2: #131a24;
  --border: #233045;
  --text: #f4f7fb;
  --muted: #9aa7bd;
  --accent: rgb(80, 210, 193);
  --accent-2: #1f6bff;
  --danger: #ff6b6b;
  --warn: #f5c542;
  --ok: #4ce59a;
  --glow: rgba(80, 210, 193, 0.35);
  --retro-font: "Pixelify Sans", "Silkscreen", "VT323", monospace;
  --icon: #f6fefd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 15% 20%, #142234 0%, #0b0d10 48%, #06080b 100%);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
}


.crt::before,
.crt::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.crt::before {
  background: repeating-linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.03) 1px,
      rgba(0, 0, 0, 0.05) 2px,
      rgba(0, 0, 0, 0.05) 3px
    ),
    linear-gradient(rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.1));
  mix-blend-mode: screen;
  opacity: 0.5;
}

.crt::after {
  background: radial-gradient(circle at 10% 10%, rgba(86, 237, 240, 0.2), transparent 40%),
              radial-gradient(circle at 90% 30%, rgba(31, 107, 255, 0.18), transparent 45%);
  opacity: 0.65;
}

.desktop {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px;
  position: relative;
  z-index: 3;
}

.window {
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6) inset,
              0 16px 40px rgba(0, 0, 0, 0.6);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  margin-bottom: 12px;
}

.title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), #9ff7f9);
  color: #001114;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6) inset, 0 0 18px var(--glow);
}

.logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
}

.title {
  font-size: 24px;
  font-family: var(--retro-font);
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(86, 237, 240, 0.2);
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.title-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.title-link:hover .title {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(86, 237, 240, 0.4);
}

.title-link:hover .subtitle {
  color: var(--text);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.75);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6) inset;
  color: var(--icon);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  margin: 0 auto;
  transform: translateX(1px);
}

.gear-btn svg {
  transform: translate(0, 0);
}

.icon-btn svg.icon-fill {
  fill: currentColor;
  stroke: none;
}

.icon-btn svg.icon-stroke {
  fill: none;
  stroke: currentColor;
}

.gear-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.4;
  transform: translateX(1px);
}

.gear-btn {
  width: 42px;
  height: 42px;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-btn:hover svg {
  color: var(--accent);
}

.locale-menu {
  position: relative;
}

.locale-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(6, 12, 18, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 30;
}

.locale-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.locale-title {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.locale-option {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 6px 6px;
  border-radius: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  cursor: pointer;
}

.locale-option.active,
.locale-option:hover {
  background: rgba(18, 26, 36, 0.9);
  color: var(--accent);
}

.locale-reset {
  margin-top: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(35, 48, 69, 0.6);
  background: rgba(10, 15, 20, 0.7);
  color: var(--accent);
  text-align: left;
}

.status-block {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.7);
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.status {
  margin-bottom: 6px;
  display: flex;
  justify-content: center;
}

.status-block .status:last-child {
  margin-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(80, 210, 193, 0.6);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.5px;
  background: rgba(10, 20, 24, 0.8);
  text-transform: none;
  cursor: help;
}

.feed-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(35, 48, 69, 0.8);
  background: rgba(7, 11, 16, 0.98);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 6;
}

.feed-popover.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.feed-title {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.feed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 4px;
}

.feed-row:last-child {
  margin-bottom: 0;
}

.feed-row span:last-child {
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(80, 210, 193, 0.6);
}

.status-pill.warn {
  border-color: rgba(245, 197, 66, 0.6);
  color: #f5c542;
}

.status-pill.warn .dot {
  background: #f5c542;
  box-shadow: 0 0 8px rgba(245, 197, 66, 0.6);
}

.status-pill.err {
  border-color: rgba(255, 107, 107, 0.6);
  color: #ff6b6b;
}

.status-pill.err .dot {
  background: #ff6b6b;
  box-shadow: 0 0 8px rgba(255, 107, 107, 0.6);
}

.session-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.7);
  width: 180px;
  min-width: 180px;
  max-width: 180px;
}

.session-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.telegram-manual-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0;
}

#telegramStartCmd {
  font-size: 11px;
  color: var(--muted);
  word-break: break-all;
}

.eye-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eye-btn svg {
  width: 14px;
  height: 14px;
  transform: translate(0px, -0.5px);
}

.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.session-actions .btn {
  flex: 1 1 160px;
}

.session-mini .btn {
  align-self: center;
  width: 100%;
}

.session-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
  text-align: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
}

.checkbox-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(35, 48, 69, 0.6);
  background: rgba(8, 12, 18, 0.7);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.help-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(35, 48, 69, 0.8);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  text-transform: none;
}

.checkbox-row input[type="checkbox"] {
  appearance: none;
  width: 36px;
  height: 18px;
  border-radius: 999px;
  background: rgba(17, 26, 38, 0.85);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s ease, background 0.2s ease;
}

.checkbox-row input[type="checkbox"]:checked {
  border-color: rgba(80, 210, 193, 0.6);
  background: rgba(11, 24, 26, 0.9);
}

.checkbox-row input[type="checkbox"]:checked::after {
  transform: translateX(18px);
  background: var(--accent);
}


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

.col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.panel {
  padding: 18px;
}

.panel-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: var(--retro-font);
}

.panel-title.mt {
  margin-top: 18px;
}

.panel-title.mt-lg {
  margin-top: 36px;
}

.table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(7, 11, 16, 0.7);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.35fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 0.4fr);
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
  font-size: 12px;
  border-bottom: 1px solid rgba(35, 48, 69, 0.5);
}

.row > div {
  min-width: 0;
}

.row:last-child {
  border-bottom: none;
}

.row.head {
  background: rgba(31, 107, 255, 0.1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  justify-items: start;
}

.row .mono {
  font-family: "IBM Plex Mono", monospace;
}

.triggered {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-height: 68px;
  background: rgba(7, 11, 16, 0.7);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trigger-item {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(245, 197, 66, 0.3);
  border-radius: 6px;
  background: rgba(245, 197, 66, 0.08);
  font-size: 12px;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-row .priority {
  grid-column: 1 / -1;
}

.form-row.primary .priority {
  grid-column: auto;
}

.form-submit {
  align-self: center;
  justify-self: center;
  min-width: 180px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  width: 100%;
}

label {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input,
select {
  background: rgba(7, 11, 16, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input:focus,
select:focus {
  outline: 1px solid var(--accent-2);
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-row .btn {
  min-width: 120px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.input-row .use-current-btn {
  min-width: 100px;
  width: 110px;
  padding: 8px 10px;
  font-size: 11px;
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-row input[type="range"] {
  flex: 1 1 auto;
  accent-color: var(--accent);
}

.volume-row .mono {
  min-width: 42px;
  text-align: right;
}

.wallet-status {
  min-height: 16px;
}

.input-stepper {
  display: grid;
  grid-template-columns: 1fr 26px;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(7, 11, 16, 0.85);
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
}

.input-stepper input {
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 12px;
}

.input-stepper:focus-within {
  outline: 1px solid var(--accent-2);
}

.stepper-buttons {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}

.stepper-btn {
  flex: 1 1 50%;
  border: none;
  background: rgba(10, 15, 20, 0.7);
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.stepper-btn:hover {
  background: rgba(17, 26, 38, 0.9);
  color: var(--accent);
}

.btn {
  background: linear-gradient(160deg, #141c27 0%, #0e141d 100%);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6) inset;
}

.btn.icon-btn {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn.icon-btn svg {
  margin: 0;
}

.btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  background: linear-gradient(160deg, rgba(26, 39, 54, 0.95) 0%, rgba(13, 20, 29, 0.95) 100%);
  color: #ffffff;
}

.btn.accent {
  background: linear-gradient(160deg, var(--accent) 0%, #9ff7f9 100%);
  color: #001114;
  font-weight: 700;
}

.tab-row,
.sub-tab-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 12px;
}

.tab-row::-webkit-scrollbar,
.sub-tab-row::-webkit-scrollbar {
  display: none;
}

.tab,
.sub-tab {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(15, 19, 24, 0.8);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border 0.2s ease, background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  word-break: keep-all;
  hyphens: none;
}

.tab.active,
.sub-tab.active {
  color: var(--text);
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(31, 107, 255, 0.4);
}

.tab:hover,
.sub-tab:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: rgba(31, 107, 255, 0.12);
}

.sub-tab {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 4px;
  background: rgba(10, 14, 20, 0.85);
  line-height: 1;
}

.search-row {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 11, 16, 0.85);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 10px;
  min-width: 260px;
}

.search-box input {
  border: none;
  padding: 0;
  background: transparent;
  width: 220px;
}

.search-box input:focus {
  outline: none;
}

.search-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.market-table {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(7, 11, 16, 0.7);
  width: 100%;
  --market-grid: 36px 18px minmax(110px, 1.2fr) minmax(70px, 0.95fr) minmax(70px, 0.9fr) minmax(70px, 0.9fr) minmax(78px, 1fr) minmax(60px, 0.8fr) 72px;
}

.market-head {
  grid-template-columns: var(--market-grid);
  padding: 8px 12px 8px 6px;
  gap: 4px;
  width: 100%;
  letter-spacing: 0.3px;
  font-size: 14px;
  line-height: 1.2;
}

.market-list {
  max-height: 420px;
  overflow: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 16px 4px 4px;
  width: 100%;
}

.market-row {
  display: grid;
  grid-template-columns: var(--market-grid);
  gap: 4px;
  align-items: center;
  min-height: 34px;
  padding: 4px 16px 4px 6px;
  border: 1px solid rgba(35, 48, 69, 0.4);
  border-radius: 6px;
  font-size: 12px;
  width: 100%;
  background: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.market-row:hover,
.market-row:focus-within {
  background: rgba(80, 210, 193, 0.08);
  border-color: rgba(80, 210, 193, 0.35);
  box-shadow: 0 0 12px rgba(80, 210, 193, 0.12);
}

@media (min-width: 761px) {
  .market-list {
    gap: 0;
    padding: 4px 0;
  }

  .market-row {
    border: none;
    border-bottom: 1px solid rgba(35, 48, 69, 0.4);
    border-radius: 0;
    box-shadow: none;
    padding: 4px 10px 4px 6px;
  }

  .market-row:last-child {
    border-bottom: none;
  }

  .market-row:hover,
  .market-row:focus-within {
    box-shadow: none;
  }

  .market-row .col-action {
    padding-right: 0;
  }
}

.metric-menu {
  position: fixed;
  z-index: 30;
  min-width: 150px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(35, 48, 69, 0.8);
  background: rgba(7, 11, 16, 0.96);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 4px;
  font-family: "Space Grotesk", sans-serif;
}

.metric-menu.hidden {
  display: none;
}

.metric-menu button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(12, 18, 26, 0.9);
  color: var(--text);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.metric-menu button.active,
.metric-menu button:hover {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(31, 107, 255, 0.16);
}

.market-table.spot .col-funding,
.market-table.spot .col-oi {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.market-table.spot .col-symbol {
  grid-column: auto;
}

.market-row .price {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent);
}

.price-flash-up {
  animation: priceFlashUp 5.2s ease;
}

.price-flash-down {
  animation: priceFlashDown 5.2s ease;
}

@keyframes priceFlashUp {
  0% {
    color: rgb(0, 255, 136);
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.55);
  }
  100% {
    color: var(--accent);
    text-shadow: none;
  }
}

@keyframes priceFlashDown {
  0% {
    color: rgb(255, 68, 68);
    text-shadow: 0 0 8px rgba(255, 68, 68, 0.55);
  }
  100% {
    color: var(--accent);
    text-shadow: none;
  }
}

.market-row .col-action {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 4px 0 0;
}

.market-row .alert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  height: 26px;
  padding: 0 12px;
  box-sizing: border-box;
  margin-right: 4px;
}

.action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.action-buttons .btn {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
}

.col-symbol {
  min-width: 0;
}

.col-change {
  font-family: "IBM Plex Mono", monospace;
  color: var(--muted);
}

.col-change.pos {
  color: var(--ok);
}

.col-change.neg {
  color: var(--danger);
}

.sort {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1px;
  cursor: pointer;
  padding: 0;
  text-align: left;
  white-space: nowrap;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.2s ease;
}

.market-head .sort {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  line-height: 1;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.market-head .col-price,
.market-head .col-change,
.market-head .col-volume,
.market-head .col-funding,
.market-head .col-oi {
  justify-content: flex-end;
  text-align: right;
}

.market-row .col-price,
.market-row .col-change,
.market-row .col-volume,
.market-row .col-funding,
.market-row .col-oi {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.market-row .col-action {
  justify-self: end;
}

.market-head .col-favorite {
  text-align: center;
  justify-content: center;
}

.market-head .col-favorite.sort {
  text-align: center;
  justify-content: center;
  padding: 0;
  font-size: 10px;
  line-height: 1;
  align-items: center;
}

.market-head .col-symbol {
  justify-content: flex-start;
  text-align: left;
}

.sort.active {
  color: var(--accent);
}

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

.favorite {
  font-size: 16px;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  line-height: 1;
  width: 100%;
}

.col-favorite {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  align-self: center;
}

.favorite.active {
  color: #ff9f1a;
  text-shadow: 0 0 8px rgba(255, 159, 26, 0.8);
}

.bell {
  font-size: 12px;
  color: var(--accent);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.col-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.bell.hidden {
  visibility: hidden;
}

.star {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transform: translateY(-0.5px);
}

.symbol-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  line-height: 1;
}

.symbol-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}

.symbol-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.alert-sound {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coin-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(10, 15, 20, 0.8);
  border: 1px solid rgba(35, 48, 69, 0.6);
  object-fit: contain;
}

.sound-meter {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: rgba(7, 11, 16, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.meter-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  flex: 1;
}

.meter-bar {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: rgba(80, 210, 193, 0.2);
  box-shadow: inset 0 0 0 1px rgba(80, 210, 193, 0.4);
  transition: height 0.25s ease, background 0.25s ease;
}

.sound-meter.active .meter-bar {
  background: rgba(80, 210, 193, 0.9);
  box-shadow: 0 0 12px rgba(80, 210, 193, 0.55);
  animation: meterPulse 1.2s ease-in-out infinite;
}

.sound-meter.active .meter-bar:nth-child(2) { animation-delay: 0.1s; }
.sound-meter.active .meter-bar:nth-child(3) { animation-delay: 0.2s; }
.sound-meter.active .meter-bar:nth-child(4) { animation-delay: 0.15s; }
.sound-meter.active .meter-bar:nth-child(5) { animation-delay: 0.25s; }
.sound-meter.active .meter-bar:nth-child(6) { animation-delay: 0.05s; }

.meter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  white-space: nowrap;
}

@keyframes meterPulse {
  0% { height: 8px; opacity: 0.5; }
  50% { height: 26px; opacity: 1; }
  100% { height: 12px; opacity: 0.7; }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  backdrop-filter: blur(4px);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 90vw);
  padding: 18px;
  position: relative;
}

.sound-dropdown {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: visible;
}

.sound-dropdown.hidden {
  display: none;
}

.sound-dropdown-card {
  width: min(240px, 70vw);
  max-height: 45vh;
  padding: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: fixed;
  pointer-events: auto;
}

.sound-dropdown .sound-list {
  max-height: 28vh;
  overflow-y: auto;
  flex: 1 1 auto;
  display: grid;
  gap: 6px;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(10, 15, 20, 0.7);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.modal-close:hover {
  color: #fff;
  border-color: var(--accent);
}

.modal-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.wallet-option {
  background: rgba(7, 11, 16, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
}

.wallet-option:hover {
  border-color: var(--accent);
}

.sound-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  background: rgba(7, 11, 16, 0.7);
  overflow-y: auto;
}

#soundsPanel .sound-list {
  max-height: 440px;
  height: 440px;
}

.sound-row {
  display: grid;
  gap: 4px;
  align-items: center;
  font-size: 11px;
  width: 100%;
  padding: 4px 6px;
  border-radius: 6px;
  background: transparent;
  box-shadow: inset 0 0 0 1px transparent;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.sound-row:hover,
.sound-row:focus-within {
  background: rgba(80, 210, 193, 0.08);
  box-shadow: inset 0 0 0 1px rgba(80, 210, 193, 0.35),
    0 0 12px rgba(80, 210, 193, 0.12);
}

.sound-row.repo {
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
}

.sound-row.modal {
  grid-template-columns: 1fr;
}

.sound-choice {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(12, 18, 26, 0.9);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  font-family: "Space Grotesk", sans-serif;
}

.sound-choice:hover,
.sound-choice:focus {
  border-color: var(--accent);
  color: #ffffff;
  background: rgba(31, 107, 255, 0.16);
}

.sound-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: help;
}

.sound-tag {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(35, 48, 69, 0.6);
  color: var(--muted);
}

.sound-player {
  display: grid;
  grid-template-columns: 44px minmax(120px, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  min-width: 0;
  justify-content: start;
}

.sound-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  justify-self: end;
}


.sound-wave {
  width: 100%;
  max-width: none;
  min-width: 120px;
  justify-self: stretch;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(10, 15, 20, 0.65) 0%, rgba(16, 24, 34, 0.9) 100%);
  border: 1px solid rgba(35, 48, 69, 0.6);
  padding: 2px 6px;
  cursor: pointer;
  position: relative;
  height: 32px;
  overflow: hidden;
}

.sound-wave canvas {
  width: 100% !important;
  height: 32px !important;
  display: block;
}

.sound-wave.voice::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(80, 210, 193, 0.2) 0%, rgba(80, 210, 193, 0.55) 50%, rgba(80, 210, 193, 0.2) 100%);
  opacity: 0.8;
}

.sound-duration {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
}

.sound-row .btn {
  font-size: 10px;
  padding: 6px 8px;
  min-width: 44px;
  white-space: nowrap;
}

.sound-play {
  min-width: 44px;
  padding: 6px 8px;
}

.sound-use {
  min-width: 56px;
}

.sound-actions .btn {
  min-width: 32px;
  padding: 6px 8px;
}

.sound-play {
  min-width: 28px;
  width: 28px;
}

.sound-use {
  min-width: 48px;
  padding: 6px 10px;
}

.sound-delete {
  min-width: 32px;
  padding: 6px;
}

.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.upload-row input[type="file"] {
  color: var(--muted);
  font-size: 12px;
}

.upload-row input[type="file"]::file-selector-button {
  background: linear-gradient(160deg, #141c27 0%, #0e141d 100%);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  cursor: pointer;
  margin-right: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6) inset;
}

.upload-row input[type="file"]::file-selector-button:hover {
  border-color: var(--accent);
}

.hidden {
  display: none !important;
}

.hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  margin-top: 18px;
  font-size: 12px;
  gap: 12px;
  text-align: center;
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  order: 1;
}

.footer-center {
  display: flex;
  justify-content: center;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  order: 3;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  order: 2;
  max-width: 520px;
}

.footer-note {
  max-width: 360px;
  line-height: 1.4;
}

.footer-copy {
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.footer-logo-inline {
  width: 14px;
  height: 14px;
  object-fit: contain;
  vertical-align: text-bottom;
  margin-right: 4px;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
}

.footer-link:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(86, 237, 240, 0.6);
}

.about-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0 12px;
}

.cta {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  text-align: center;
}

.cta:hover {
  color: #ffffff;
  text-shadow: 0 0 12px rgba(86, 237, 240, 0.6);
}

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

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

  #alertsTable .row {
    grid-template-columns: 1fr 1.2fr 0.8fr 0.8fr 0.8fr 0.8fr auto;
  }

  .market-table {
    --market-grid: 28px 16px minmax(100px, 1.1fr) minmax(66px, 0.9fr) minmax(66px, 0.9fr) minmax(66px, 0.9fr) minmax(70px, 1fr) minmax(56px, 0.8fr) 72px;
  }

  .sort {
    font-size: 11px;
    letter-spacing: 0.05px;
  }

  .sound-player {
    grid-template-columns: 40px minmax(110px, 1fr) auto;
  }

  .sound-actions .btn {
    padding: 5px 6px;
  }

  .sound-use {
    min-width: 44px;
    font-size: 9px;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 12px;
  }

  .desktop {
    padding: 16px;
  }

  .top-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title status"
      "controls controls";
    align-items: center;
    column-gap: 10px;
    row-gap: 8px;
    padding: 12px 14px;
  }

  .title-block {
    grid-area: title;
    flex: 1 1 auto;
    min-width: 0;
    gap: 10px;
  }

  .title-link {
    min-width: 0;
  }

  .title {
    font-size: 17px;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .subtitle {
    letter-spacing: 0.5px;
    font-size: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-right {
    grid-area: controls;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .status-block {
    grid-area: status;
    min-width: 0;
    align-items: center;
    text-align: left;
    flex-direction: row;
    gap: 4px;
    padding: 4px 6px;
    justify-self: end;
    font-size: 10px;
  }

  .status {
    margin-bottom: 0;
    justify-content: flex-start;
  }

  .status-pill {
    font-size: 10px;
    padding: 4px 8px;
    white-space: nowrap;
  }

  #clock {
    font-size: 10px;
  }

  .feed-popover {
    width: 100%;
    min-width: 0;
    left: auto;
    right: 0;
  }

  .session-mini {
    order: 1;
    width: auto;
    min-width: 0;
    max-width: none;
    flex-direction: row;
    justify-content: flex-start;
    padding: 4px 6px;
    gap: 6px;
    flex: 0 1 auto;
    margin-right: auto;
  }

  .session-badge-row {
    width: auto;
    justify-content: flex-start;
  }

  .session-mini .btn {
    font-size: 10px;
    padding: 5px 8px;
    width: auto;
    white-space: nowrap;
  }

  .session-mini .eye-btn {
    width: 28px;
    height: 26px;
    padding: 0;
  }

  .session-badge {
    width: auto;
    padding: 4px 8px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .locale-menu {
    order: 2;
    margin-left: auto;
  }

  .gear-btn {
    order: 3;
  }

  .logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
  }

  .logo img {
    width: 22px;
    height: 22px;
  }

  .panel {
    padding: 14px;
  }

  .panel-title {
    font-size: 12px;
    letter-spacing: 2px;
  }

  #alertsTable .row {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) minmax(0, 0.9fr) 52px;
    gap: 4px;
    padding: 6px 8px;
    font-size: 10px;
  }

  #alertsTable .row.head {
    display: grid;
    font-size: 9px;
    letter-spacing: 0.3px;
  }

  #alertsTable .row .col-market,
  #alertsTable .row .col-trigger,
  #alertsTable .row .col-target {
    display: none;
  }

  #alertsTable .row .col-action {
    justify-self: end;
  }

  .action-buttons .btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    font-size: 11px;
  }

  #alertsTable .col-symbol,
  #alertsTable .col-now,
  #alertsTable .col-sound {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #alertsTable .col-symbol {
    max-width: 110px;
  }

  #alertsTable .col-sound {
    max-width: 90px;
  }

  #alertsTable .col-symbol .symbol-link {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .input-stepper {
    flex: 1 1 auto;
    max-width: none;
  }

  .market-table {
    --market-grid: 22px 14px minmax(56px, 0.9fr) minmax(52px, 0.8fr) minmax(46px, 0.6fr) 76px;
  }

  .market-row {
    font-size: 9.2px;
    padding: 2px 4px;
    gap: 2px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(35, 48, 69, 0.45);
  }

  .market-row:last-child {
    border-bottom: none;
  }

  .favorite {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }

  .favorite .star {
    font-size: 12px;
    line-height: 1;
  }

  .market-list {
    padding: 2px 0;
  }

  .market-head .sort {
    font-size: 9px;
    letter-spacing: 0.1px;
  }

  .market-head .col-favorite.sort {
    font-size: 8px;
    align-items: center;
    justify-content: center;
  }

  .market-row .symbol-cell span {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .market-head .col-change::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: translateY(-2px) rotate(45deg);
    opacity: 0.9;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    width: 100%;
  }

  .market-row .alert-btn {
    min-width: 44px;
    width: 44px;
    height: 22px;
    padding: 0;
    font-size: 8.5px;
    letter-spacing: 0.1px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .market-row .col-action {
    padding: 0;
    justify-self: end;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    padding-right: 2px;
  }

  .market-row .col-change {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .market-head button:last-child {
    display: inline-flex;
  }

  .market-row .col-funding,
  .market-row .col-oi,
  .market-row .col-volume,
  .market-head .col-funding,
  .market-head .col-oi,
  .market-head .col-volume {
    display: none;
  }

  .tab-row,
  .sub-tab-row {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .tab,
  .sub-tab {
    font-size: 9px;
    padding: 4px 6px;
    letter-spacing: 0.6px;
  }

  .sound-row.repo {
    grid-template-columns: minmax(78px, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 8px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .sound-name {
    white-space: normal;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .sound-player {
    width: 100%;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    column-gap: 4px;
    justify-content: start;
    justify-self: start;
    margin-left: -2px;
  }

  .sound-actions .btn {
    padding: 2px 4px;
    font-size: 8.5px;
  }

  .sound-actions {
    gap: 4px;
  }

  .sound-play {
    min-width: 24px;
    width: 24px;
  }

  .sound-use {
    min-width: 30px;
  }

  .sound-actions {
    justify-self: start;
  }

  .sound-duration {
    min-width: 22px;
    text-align: left;
  }

  .sound-wave {
    min-width: 42px;
    height: 24px;
    padding: 2px 4px;
  }

  .sound-wave canvas {
    height: 24px !important;
  }

  .sound-dropdown-card {
    width: min(220px, 90vw);
    max-height: 40vh;
  }

  .sound-dropdown .sound-list {
    max-height: 30vh;
  }

  .upload-row {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-row input[type="file"] {
    width: 100%;
  }

  .upload-row .btn {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }

  .footer-center {
    flex-wrap: nowrap;
  }

  .footer-copy {
    font-size: 10px;
  }

  .footer-center .btn {
    padding: 6px 10px;
    font-size: 11px;
  }
}
.trigger-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  line-height: 1;
}

.trigger-main .symbol-link,
.trigger-main .symbol-cell {
  min-width: 0;
}

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

.trigger-main > * {
  display: inline-flex;
  align-items: center;
}
