:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #0b1220;
  --line: #1f2a3d;
  --grid: rgba(143, 155, 176, 0.08);
  --text: #d9e2f1;
  --muted: #8f9bb0;
  --green: #19c37d;
  --yellow: #f4b400;
  --red: #ef4444;
  --cyan: #22d3ee;
  --oi: #22d3ee;
  --price-scale-width: 58px;
  --price-scale-reserve: 62px;
}

@font-face {
  font-family: "ALSSchlangeslab-Bold";
  src: url("./assets/fonts/ALSSchlangeslab-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  overflow: hidden;
}

.app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.topbar {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #0b1220;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 156px;
}

.brand-mark {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  color: #f5f8fb;
  text-decoration: none;
  font-family: "ALSSchlangeslab-Bold", "ALS Schlange Slab Bold", "Arvo", "Roboto Slab", "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  font-size: 32px;
  line-height: 0.78;
  letter-spacing: -0.025em;
  font-weight: 700;
  white-space: nowrap;
}

.brand-word {
  display: inline-block;
}

.brand-triangle {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid var(--red);
  margin: 0 0 1px;
  transition: border-top-color 160ms ease, border-bottom-color 160ms ease, transform 160ms ease;
}

.brand-mark[data-trend="up"] .brand-triangle {
  border-top: 0;
  border-bottom: 10px solid var(--green);
  transform: translateY(-1px);
}

.brand-mark[data-trend="down"] .brand-triangle {
  border-bottom: 0;
  border-top: 10px solid var(--red);
  transform: translateY(1px);
}

.brand-mark[data-trend="neutral"] .brand-triangle {
  border-top: 0;
  border-bottom: 10px solid var(--green);
  transform: translateY(0);
}

.timeframe-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-left: 1px solid rgba(143, 155, 176, 0.35);
  border-right: 1px solid rgba(143, 155, 176, 0.35);
  height: 38px;
  flex: 0 0 auto;
}

.tf-btn {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #c8d1df;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 6px;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.tf-btn:hover {
  color: #f3f7ff;
}

.tf-btn.active {
  color: #ffd768;
  background: rgba(244, 180, 0, 0.13);
  border-color: rgba(244, 180, 0, 0.4);
  box-shadow: inset 0 0 0 1px rgba(244, 180, 0, 0.08);
}

.news-brief-wrap {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: stretch;
  gap: 6px;
}

.news-nav {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #0d1525;
  color: #8f9bb0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.news-nav:hover:not(:disabled) {
  color: #dff5ff;
  border-color: rgba(34, 211, 238, 0.4);
  background: rgba(34, 211, 238, 0.08);
}

.news-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.news-brief {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(34, 211, 238, 0.16);
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.08), rgba(11, 18, 32, 0.1));
  border-radius: 10px;
  padding: 8px 12px;
  text-decoration: none;
  overflow: hidden;
}

.news-headline {
  color: #dff5ff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-summary {
  display: none;
}

.dashboard-switcher {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.dashboard-switcher-inner {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.dashboard-switcher-inner::-webkit-scrollbar {
  display: none;
}

.dashboard-switcher-link {
  flex: 0 0 auto;
  border: 1px solid rgba(34, 211, 238, 0.16);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.07), rgba(11, 18, 32, 0.12));
  color: #a8b6cb;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 12px;
  text-decoration: none;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.dashboard-switcher-link:hover {
  color: #dff5ff;
  border-color: rgba(34, 211, 238, 0.36);
}

.dashboard-switcher-link.is-active {
  color: #dff5ff;
  border-color: rgba(34, 211, 238, 0.42);
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.14), rgba(11, 18, 32, 0.18));
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.dashboard-switcher-link.is-guest {
  border-color: rgba(143, 155, 176, 0.24);
  color: #c8d1df;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.settings-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #0d1525;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-btn:hover {
  border-color: rgba(34, 211, 238, 0.45);
  color: #dff5ff;
}

.settings-btn[data-state="guest"] {
  border-color: rgba(244, 180, 0, 0.35);
  color: #fde68a;
}

.settings-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.meta-pill {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0d1525;
  color: var(--muted);
  font-size: 11px;
}

#news-tone[data-tone="bullish"] {
  border-color: rgba(25, 195, 125, 0.42);
  color: #a7f3d0;
}

#news-tone[data-tone="bearish"] {
  border-color: rgba(239, 68, 68, 0.42);
  color: #fecaca;
}

#news-tone[data-tone="neutral"] {
  border-color: rgba(244, 180, 0, 0.42);
  color: #fde68a;
}

.dashboard {
  padding: 1px;
  background: var(--line);
  min-height: 0;
  overflow: hidden;
}

.grid {
  --grid-cols: 3;
  --grid-rows: 3;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--grid-rows), minmax(0, 1fr));
  gap: 1px;
}

.card {
  position: relative;
  min-height: 0;
  background: var(--panel);
  overflow: hidden;
}

.card-head {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 68px;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  pointer-events: none;
}

.symbol-block {
  min-width: 0;
  max-width: calc(100% - 112px);
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid rgba(26, 51, 86, 0.58);
  background: linear-gradient(180deg, rgba(5, 10, 20, 0.88), rgba(5, 10, 20, 0.62));
  box-shadow: 0 8px 24px rgba(3, 8, 18, 0.28);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.symbol-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.symbol {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(3, 8, 18, 0.85);
}

.symbol-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(3, 8, 18, 0.85);
}

.price-head {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
}

.price-head-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.price-head > .price-head-sub:first-child {
  margin-top: 0;
}

.price-head-sub.price-change-up {
  color: #a7f3d0;
}

.price-head-sub.price-change-down {
  color: #fecaca;
}

.price-head-sub.price-change-neutral {
  color: var(--muted);
}

.chart-wrap {
  position: absolute;
  inset: 6px var(--price-scale-reserve) 18px 6px;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    #0a1322;
  background-size: 100% 20%, 16.666% 100%;
  overflow: hidden;
}

.setup-overlay,
.price-layer,
.price-guide-layer,
.volume-layer,
.oi-layer {
  position: absolute;
  inset: 0;
}

.setup-overlay svg,
.price-layer svg,
.price-guide-layer svg,
.volume-layer svg,
.oi-layer svg {
  width: 100%;
  height: 100%;
  display: block;
}

.setup-overlay {
  z-index: 6;
  pointer-events: none;
}

.price-layer {
  z-index: 3;
}

.price-guide-layer {
  z-index: 4;
  pointer-events: none;
}

.volume-layer {
  inset: auto 0 0 0;
  height: 24%;
  opacity: 0.46;
  z-index: 2;
}

.oi-layer {
  inset: 4px 4px 14px 4px;
  opacity: 0.78;
  z-index: 5;
}

.price-scale {
  position: absolute;
  top: 6px;
  right: 4px;
  bottom: 18px;
  width: var(--price-scale-width);
  z-index: 11;
  pointer-events: none;
  border-left: 1px solid rgba(31, 42, 61, 0.85);
  background: linear-gradient(180deg, rgba(7, 14, 26, 0.92), rgba(7, 14, 26, 0.72));
}

.price-tick,
.time-tick {
  font-size: 8px;
  line-height: 1;
  color: rgba(143, 155, 176, 0.92);
}

.price-tick {
  position: absolute;
  right: 4px;
  transform: translateY(-50%);
  background: rgba(11, 18, 32, 0.56);
  border-radius: 3px;
  padding: 1px 3px;
  font-size: 9px;
}

.price-tick-extreme {
  color: rgba(188, 199, 219, 0.98);
  background: rgba(11, 18, 32, 0.8);
}

.price-tick-top {
  top: 0;
  transform: none;
}

.price-tick-bottom {
  top: auto;
  bottom: 0;
  transform: none;
}

.price-marker {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.price-marker-label {
  min-width: 48px;
  padding: 4px 8px 5px 7px;
  border-radius: 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  text-align: right;
  box-shadow: 0 0 0 1px rgba(8, 15, 29, 0.72);
}

.price-marker-price {
  display: block;
  width: 100%;
}

.price-marker-up .price-marker-label {
  color: #d1fae5;
  background: rgba(15, 118, 73, 0.94);
}

.price-marker-down .price-marker-label {
  color: #fee2e2;
  background: rgba(185, 28, 28, 0.94);
}

.time-scale {
  position: absolute;
  left: 6px;
  right: var(--price-scale-reserve);
  bottom: 18px;
  height: 14px;
  z-index: 4;
  pointer-events: none;
}

.time-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.time-tick-left {
  transform: translateX(0);
}

.time-tick-right {
  transform: translateX(-100%);
}

.time-tick-date {
  color: rgba(209, 213, 219, 0.96);
  font-weight: 700;
}

.signal-badge {
  display: inline-block;
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.card-signal-corner {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 6;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(3, 8, 18, 0.22);
  pointer-events: auto;
}

.signal-up {
  background: rgba(22, 163, 74, 0.24);
  border-color: rgba(22, 163, 74, 0.5);
  color: #bbf7d0;
}

.signal-neutral {
  background: rgba(202, 138, 4, 0.26);
  border-color: rgba(202, 138, 4, 0.5);
  color: #fef3c7;
}

.signal-down {
  background: rgba(220, 38, 38, 0.26);
  border-color: rgba(220, 38, 38, 0.5);
  color: #fecaca;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.metric-pill.price-change-up {
  color: #a7f3d0;
  background: rgba(15, 118, 73, 0.22);
  border-color: rgba(22, 163, 74, 0.38);
}

.metric-pill.price-change-down {
  color: #fecaca;
  background: rgba(185, 28, 28, 0.2);
  border-color: rgba(239, 68, 68, 0.34);
}

.metric-pill.price-change-neutral {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(82, 94, 118, 0.32);
}

.metric-pill-hint {
  position: relative;
  cursor: help;
  pointer-events: auto;
}

.metric-pill-oi {
  color: var(--oi);
}

.metric-pill-liq {
  font-variant-numeric: tabular-nums;
}

.metric-pill-hint::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(-4px);
  min-width: 180px;
  max-width: 240px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(5, 10, 20, 0.96);
  box-shadow: 0 10px 28px rgba(3, 8, 18, 0.36);
  color: #dbe7ff;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms linear, transform 120ms ease, visibility 120ms linear;
  z-index: 8;
}

.metric-pill-hint::before {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% + 2px);
  transform: translateX(-50%) translateY(-4px);
  border-width: 0 5px 6px 5px;
  border-style: solid;
  border-color: transparent transparent rgba(5, 10, 20, 0.96) transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms linear, transform 120ms ease, visibility 120ms linear;
  z-index: 8;
}

.metric-pill-hint:hover::after,
.metric-pill-hint:hover::before,
.metric-pill-hint:focus-visible::after,
.metric-pill-hint:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.signal-band {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  height: 6px;
  border-radius: 999px;
  overflow: visible;
  border: 1px solid rgba(71, 85, 105, 0.32);
  background: linear-gradient(
    90deg,
    rgba(185, 28, 28, 0.3) 0%,
    rgba(202, 138, 4, 0.18) 50%,
    rgba(15, 118, 73, 0.3) 100%
  );
  z-index: 3;
}

.signal-band[data-tooltip],
.card-signal-corner[data-tooltip] {
  cursor: help;
}

.signal-band[data-tooltip]::after,
.card-signal-corner[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  min-width: 180px;
  max-width: min(260px, calc(100vw - 24px));
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(51, 65, 85, 0.85);
  background: rgba(5, 10, 20, 0.96);
  box-shadow: 0 10px 28px rgba(3, 8, 18, 0.36);
  color: #dbe7ff;
  font-size: 11px;
  line-height: 1.35;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms linear, transform 120ms ease, visibility 120ms linear;
  z-index: 8;
}

.signal-band[data-tooltip]::before,
.card-signal-corner[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  transform: translateX(-50%) translateY(4px);
  border-width: 6px 5px 0 5px;
  border-style: solid;
  border-color: rgba(5, 10, 20, 0.96) transparent transparent transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms linear, transform 120ms ease, visibility 120ms linear;
  z-index: 8;
}

.signal-band:hover::after,
.signal-band:hover::before,
.signal-band:focus-visible::after,
.signal-band:focus-visible::before,
.card-signal-corner:hover::after,
.card-signal-corner:hover::before,
.card-signal-corner:focus-visible::after,
.card-signal-corner:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.signal-band-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  border-radius: 999px;
}

.signal-band-fill-up {
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.18), rgba(34, 197, 94, 0.9));
}

.signal-band-fill-down {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.9), rgba(239, 68, 68, 0.18));
}

.signal-band-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(226, 232, 240, 0.42);
  transform: translateX(-50%);
}

.signal-band-marker {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(8, 15, 29, 0.9);
  box-shadow: 0 0 0 1px rgba(5, 10, 20, 0.52), 0 0 12px rgba(8, 15, 29, 0.28);
}

.signal-band-marker-up {
  background: #22c55e;
}

.signal-band-marker-down {
  background: #ef4444;
}

.signal-band-marker-neutral {
  background: #f59e0b;
}

.pending {
  position: absolute;
  inset: 6px 6px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed rgba(143, 155, 176, 0.18);
  color: var(--muted);
  text-align: center;
  padding: 12px;
}

.pending-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.pending-note {
  font-size: 11px;
}

.error-box {
  position: absolute;
  inset: 6px 6px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  color: #fca5a5;
  font-size: 11px;
}

.news-ribbon {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-top: 1px solid var(--line);
  background: #0b1220;
}

.ribbon-tone {
  flex: 0 0 auto;
}

.ribbon-track {
  min-width: 0;
  overflow: hidden;
}

.ribbon {
  display: flex;
  align-items: center;
  gap: 18px;
  width: max-content;
  white-space: nowrap;
  font-size: 13px;
  will-change: transform;
  animation: ribbon-marquee 68s linear infinite;
}

.ribbon:hover {
  animation-play-state: paused;
}

.ribbon-item {
  color: var(--text);
  text-decoration: none;
  opacity: 0.92;
}

.ribbon-item:hover {
  color: #dff5ff;
}

.ribbon-separator {
  color: rgba(143, 155, 176, 0.45);
}

@keyframes ribbon-marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

body.oi-hidden .oi-layer {
  display: none;
}

body.oi-chart-hidden .oi-layer {
  display: none;
}

body.oi-hidden .pending {
  inset: 6px 6px 6px;
}

body.oi-hidden .error-box {
  inset: 6px 6px 6px;
}

.hidden {
  display: none !important;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 8, 18, 0.74);
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}

.settings-modal {
  width: min(980px, 100%);
  max-height: min(88vh, 940px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-title {
  margin: 0;
  font-size: 16px;
}

.settings-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.settings-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1525;
  color: var(--text);
  cursor: pointer;
}

.settings-body {
  min-height: 0;
  overflow: auto;
  padding: 12px 14px;
}

.settings-layout {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

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

.settings-field input {
  width: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1525;
  color: var(--text);
  padding: 7px 9px;
  font-size: 14px;
}

.settings-field.settings-field-wide {
  margin-top: 12px;
}

.settings-field.settings-field-wide input {
  width: min(520px, 100%);
  font-size: 13px;
}

.settings-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 2px;
}

.settings-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.settings-cells {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.settings-cell {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.settings-index {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1525;
  color: var(--muted);
  font-size: 12px;
}

.settings-searchbox {
  position: relative;
  display: grid;
  gap: 6px;
}

.settings-source {
  display: none;
}

.settings-symbol {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1525;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
}

.settings-cell-meta {
  min-height: 30px;
  padding: 0 4px;
}

.settings-cell-title {
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
}

.settings-cell-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.settings-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid rgba(78, 92, 115, 0.65);
  border-radius: 12px;
  background: rgba(8, 16, 30, 0.98);
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
}

.settings-suggestion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(13, 21, 37, 0.92);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.settings-suggestion:hover,
.settings-suggestion.is-active {
  border-color: rgba(34, 211, 238, 0.36);
  background: rgba(17, 29, 49, 0.98);
}

.settings-suggestion-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.settings-suggestion-symbol {
  font-size: 13px;
  font-weight: 700;
  color: #f3f8ff;
}

.settings-suggestion-title {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-suggestion-meta {
  color: #8fe8ff;
  font-size: 11px;
  white-space: nowrap;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.settings-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1525;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.settings-save {
  border-color: rgba(34, 211, 238, 0.45);
  color: #dff5ff;
}

.account-auth-panel,
.account-settings-panel {
  display: grid;
  gap: 14px;
}

.account-copy,
.account-section-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.account-auth-form {
  display: grid;
  gap: 12px;
}

.account-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.account-field input {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1525;
  color: var(--text);
  padding: 9px 10px;
  font-size: 14px;
}

.account-code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-code-email {
  color: var(--muted);
  font-size: 12px;
}

.account-link-btn {
  border: 0;
  background: transparent;
  color: #dff5ff;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
}

.account-debug,
.account-error {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}

.account-debug {
  border: 1px solid rgba(25, 195, 125, 0.35);
  background: rgba(25, 195, 125, 0.08);
  color: #a7f3d0;
}

.account-error {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.account-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d1525;
  padding: 12px;
}

.account-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.account-user-name {
  font-size: 18px;
  font-weight: 700;
}

.account-user-email {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.account-user-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-badge {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #081224;
  color: var(--muted);
  font-size: 11px;
}

.account-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.account-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.account-current-dashboard {
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.03em;
  padding: 8px 12px;
  white-space: nowrap;
}

.account-runtime-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.account-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.account-dashboard-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 10px;
}

.account-dashboard-create-field {
  margin-bottom: 0;
}

.account-dashboard-create-btn {
  min-width: 188px;
}

.account-dashboard-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-dashboard-manage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.account-dashboard-manage-field {
  margin-bottom: 0;
}

.account-dashboard-rename-btn {
  min-width: 148px;
}

.account-dashboard-delete-btn {
  min-width: 120px;
  border-color: rgba(248, 113, 113, 0.38);
  color: #fecaca;
}

.account-dashboard-delete-btn:hover {
  border-color: rgba(248, 113, 113, 0.58);
  background: rgba(248, 113, 113, 0.12);
}

.account-dashboard-move-btn[disabled],
.account-dashboard-duplicate-btn[disabled],
.account-dashboard-delete-btn[disabled],
.account-dashboard-rename-btn[disabled],
.settings-action[disabled] {
  opacity: 0.55;
  cursor: default;
}

.account-dashboard-list {
  display: grid;
  gap: 8px;
}

.account-dashboard-btn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #081224;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.account-dashboard-btn:hover {
  border-color: rgba(34, 211, 238, 0.45);
}

.account-dashboard-btn.is-active {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.account-dashboard-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.account-dashboard-path {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.account-dashboard-public-link {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  word-break: break-all;
}

.account-empty {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .brand {
    min-width: 0;
  }

  .brand-mark {
    font-size: 29px;
  }

  .brand-triangle {
    border-left-width: 5px;
    border-right-width: 5px;
  }

  .brand-mark[data-trend="up"] .brand-triangle,
  .brand-mark[data-trend="neutral"] .brand-triangle {
    border-bottom-width: 9px;
  }

  .brand-mark[data-trend="down"] .brand-triangle {
    border-top-width: 9px;
  }

  .timeframe-picker {
    padding: 0 8px;
    gap: 4px;
    height: 32px;
  }

  .tf-btn {
    font-size: 13px;
    padding: 2px 5px;
  }

  .settings-cell {
    grid-template-columns: 34px 1fr;
  }
}

@media (max-width: 700px) {
  .brand-mark {
    font-size: 24px;
  }

  .brand-triangle {
    border-left-width: 4px;
    border-right-width: 4px;
  }

  .brand-mark[data-trend="up"] .brand-triangle,
  .brand-mark[data-trend="neutral"] .brand-triangle {
    border-bottom-width: 8px;
  }

  .brand-mark[data-trend="down"] .brand-triangle {
    border-top-width: 8px;
  }

  .timeframe-picker {
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
    padding: 0;
    border-right: 0;
    border-left: 0;
    height: 28px;
  }

  .tf-btn {
    font-size: 12px;
    padding: 2px 5px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-meta {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .dashboard-switcher {
    width: 100%;
  }

  .dashboard-switcher-inner {
    width: 100%;
    gap: 4px;
  }

  .dashboard-switcher-link {
    font-size: 12px;
    padding: 7px 10px;
  }

  .news-ribbon {
    grid-template-columns: 1fr;
    gap: 6px;
    height: auto;
    padding: 6px 10px 8px;
  }

  .settings-modal {
    max-height: 92vh;
  }

  .account-summary,
  .account-section-head,
  .account-dashboard-btn {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-dashboard-create {
    grid-template-columns: 1fr;
  }

  .account-runtime-grid {
    grid-template-columns: 1fr;
  }

  .account-dashboard-manage {
    grid-template-columns: 1fr;
  }

  .account-dashboard-create-btn {
    width: 100%;
    min-width: 0;
  }

  .account-dashboard-rename-btn,
  .account-dashboard-delete-btn {
    width: 100%;
    min-width: 0;
  }

  .account-dashboard-path {
    white-space: normal;
  }

  .settings-suggestion {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .settings-suggestion-meta {
    white-space: normal;
  }
}
