:root {
  --bg-0: #0d1325;
  --bg-1: #121b33;
  --bg-2: #1a2643;
  --bg-3: #223254;
  --line: #26385f;
  --line-soft: #314a7b;
  --text-0: #f3f7ff;
  --text-1: #9fb4db;
  --green: #41b85c;
  --red: #e25b45;
  --cyan: #4dd3ff;
  --orange: #f4a43b;
  --shadow: 0 16px 30px rgba(0, 0, 0, 0.38);
  --radius-lg: 0;
  --radius-md: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: radial-gradient(120% 120% at 25% -20%, #1b2d54 0%, #0d1325 55%);
  color: var(--text-0);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  overflow: hidden;
}

body {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.app-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.app-shell.is-locked {
  filter: blur(2px);
  opacity: 0.42;
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(90% 90% at 8% -10%, rgba(54, 89, 153, 0.62) 0%, rgba(11, 18, 37, 0.95) 55%),
    linear-gradient(180deg, rgba(9, 15, 31, 0.9) 0%, rgba(7, 12, 25, 0.92) 100%);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid #2d4779;
  border-radius: 18px;
  padding: 24px 22px;
  background:
    radial-gradient(140% 110% at 110% -10%, rgba(83, 126, 212, 0.2) 0%, rgba(16, 26, 51, 0) 60%),
    linear-gradient(180deg, #111d39 0%, #0d1730 100%);
  box-shadow: var(--shadow);
}

.auth-kicker {
  margin: 0;
  color: #85aee7;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.12em;
  font-size: 0.73rem;
}

.auth-card h1 {
  margin: 9px 0 0;
  font-size: 1.32rem;
  line-height: 1.15;
}

.auth-copy {
  margin: 10px 0 0;
  color: #b2c6ea;
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-mode {
  margin-top: 16px;
  border: 1px solid #2f4777;
  border-radius: 11px;
  padding: 3px;
  background: #0f1a34;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.auth-mode-btn {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a9c0e8;
  padding: 8px 10px;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-mode-btn.is-active {
  color: #ecf4ff;
  background: linear-gradient(180deg, #33599a 0%, #274a85 100%);
}

.auth-form {
  margin-top: 14px;
  display: grid;
  gap: 9px;
}

.auth-label {
  display: grid;
  gap: 5px;
  color: #9cb7e3;
  font-size: 0.76rem;
}

.auth-label[hidden],
[hidden] {
  display: none !important;
}

.auth-label input {
  border: 1px solid #355285;
  border-radius: 10px;
  background: #0d1831;
  color: #f0f5ff;
  padding: 10px 11px;
  outline: none;
}

.auth-label input:focus {
  border-color: #638ad1;
  box-shadow: 0 0 0 2px rgba(99, 138, 209, 0.2);
}

.auth-submit-btn {
  margin-top: 2px;
  border: 1px solid #4f79bf;
  border-radius: 10px;
  background: linear-gradient(180deg, #3f68ad 0%, #325996 100%);
  color: #f2f7ff;
  padding: 10px 12px;
  font-weight: 700;
  cursor: pointer;
}

.auth-link-btn {
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: #8bb4ff;
  padding: 0;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}

.auth-secondary-actions {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.auth-secondary-actions .auth-link-btn {
  margin-top: 0;
}

.auth-submit-btn:disabled,
.auth-link-btn:disabled,
.auth-mode-btn:disabled {
  opacity: 0.62;
  cursor: progress;
}

.auth-message {
  margin: 12px 0 0;
  min-height: 1.3em;
  color: #9eb9e3;
  font-size: 0.8rem;
}

.auth-message.is-error {
  color: #ff8f8f;
}

button,
input,
select {
  font: inherit;
}

.iq-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #1a2442 0%, #131d36 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 16px;
  box-sizing: border-box;
}

.top-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
  flex: 1;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-box {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  line-height: 1.1;
}

.brand-box strong {
  text-transform: lowercase;
  letter-spacing: 0.03em;
  font-size: 1.4rem;
}

.asset-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 1400px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex: 0 1 auto;
}

.asset-strip::-webkit-scrollbar {
  height: 4px;
}

.asset-strip::-webkit-scrollbar-track {
  background: transparent;
}

.asset-strip::-webkit-scrollbar-thumb {
  background: #324c7d;
  border-radius: 10px;
}

.asset-strip::-webkit-scrollbar-thumb:hover {
  background: #4e71b3;
}

.legend-item {
  border: 1px solid #2d4169;
  background: linear-gradient(180deg, #182343 0%, #111b33 100%);
  border-radius: 8px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 0.74rem;
  color: #c8daf8;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.legend-item:hover {
  border-color: #405c91;
  transform: translateY(-1px);
}

.remove-asset-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #8ea5cf;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all 0.2s ease;
  margin-left: 2px;
}

.remove-asset-btn:hover {
  background: #ef4444;
  color: white;
}

.legend-item span:first-child {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-chip {
  border: 0;
  background: transparent;
  border-radius: 0;
  height: auto;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c9daf8;
  font-size: 0.78rem;
}

.user-menu {
  position: relative;
}

.user-chip {
  border: 1px solid var(--line);
  background: #182342;
  border-radius: 10px;
  padding: 5px 10px;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.user-chip:hover {
  background: #1f2d55;
}

.user-chip span {
  color: #93a9d1;
  font-size: 0.66rem;
}

.user-chip strong {
  color: #d9e7ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  min-width: 170px;
  border: 1px solid #314b7f;
  border-radius: 9px;
  background: #111d38;
  box-shadow: var(--shadow);
  padding: 6px;
}

.logout-menu-btn {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #dbe9ff;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font-size: 0.76rem;
}

.logout-menu-btn:hover {
  background: #1b2d54;
}

.deposit-btn {
  border: 0;
  background: transparent;
  color: #79e295;
  height: auto;
  padding: 0;
  border-radius: 0;
  cursor: default;
  font-weight: 600;
}

.iq-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 320px;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.watch-panel,
.panel,
.right-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #121d37 0%, #101831 100%);
  box-shadow: var(--shadow);
}

.watch-panel {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 32px;
  flex-shrink: 0;
  margin-bottom: 4px;
}

.panel-head h2 {
  margin: 0;
  font-size: 0.96rem;
  letter-spacing: 0.02em;
}

.panel-head span {
  color: var(--text-1);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.74rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.77rem;
  color: var(--text-1);
}

input[type="search"],
input[type="number"],
select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1730;
  color: var(--text-0);
  padding: 8px 10px;
  outline: none;
}

input[type="search"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: #3f5d93;
}

.watchlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #5f7fb8 #0b1733;
}

.watchlist::-webkit-scrollbar {
  width: 10px;
}

.watchlist::-webkit-scrollbar-track {
  background: #0b1733;
  border-left: 1px solid #203457;
}

.watchlist::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6f8fc4 0%, #4f6fa6 100%);
  border-radius: 999px;
  border: 2px solid #0b1733;
}

.watchlist::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #83a2d4 0%, #5c7fb8 100%);
}

.watchlist::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

.watchlist-item {
  border: 1px solid #273a62;
  background: #13203c;
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  cursor: pointer;
}

.watchlist-item:hover {
  border-color: #43639f;
}

.watchlist-item.is-selected {
  border-color: #4e71b3;
  background: #18284a;
}

.color-chip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.asset-meta {
  min-width: 0;
}

.asset-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

.asset-subtitle {
  margin: 2px 0 0;
  font-size: 0.7rem;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-values {
  text-align: right;
}

.asset-price {
  margin: 0;
  font-size: 0.76rem;
  font-family: "JetBrains Mono", monospace;
}

.asset-change {
  margin: 2px 0 0;
  font-size: 0.7rem;
  font-weight: 700;
}

.asset-change.positive {
  color: var(--green);
}

.asset-change.negative {
  color: var(--red);
}

.favorite-btn {
  margin-top: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #324c7d;
  background: #102040;
  color: #7892be;
  cursor: pointer;
}

.favorite-btn.is-fav {
  color: #ffbe52;
  border-color: #976722;
}

.chart-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.center-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #121d37 0%, #101831 100%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.center-switch-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.chart-stage {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.radar-stage {
  flex: 1 1 auto;
  min-height: 0;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.chart-header h1 {
  margin: 0;
  font-size: 1.05rem;
}

.chart-header p {
  margin: 3px 0 0;
  color: var(--text-1);
  font-size: 0.78rem;
}

.mode-switch,
.timeframes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mode-switch button,
.timeframes button,
.ghost-btn,
.primary-btn {
  border: 1px solid #314b7f;
  border-radius: 8px;
  background: #182548;
  color: #d6e5ff;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 0.76rem;
}

.mode-switch button.is-active,
.timeframes button.is-active {
  border-color: #4f72b3;
  background: #243860;
}

.chart-wrap {
  position: relative;
  border: 1px solid #2a3c62;
  border-radius: 10px;
  background:
    linear-gradient(rgba(40, 61, 102, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 61, 102, 0.3) 1px, transparent 1px),
    linear-gradient(180deg, #111a33 0%, #0f1731 100%);
  background-size: 66px 66px, 66px 66px, auto;
  flex: 1 1 auto;
  min-height: 0;
}

#priceChart {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.chart-footer {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  padding-right: 4px;
}

#lastUpdatedLabel {
  color: #6d85b1;
  font-size: 0.7rem;
  font-family: "JetBrains Mono", monospace;
  opacity: 0.8;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  border: 1px solid #395282;
  border-radius: 8px;
  background: rgba(13, 21, 39, 0.97);
  color: #d9e6ff;
  padding: 8px 10px;
  font-size: 0.74rem;
  min-width: 170px;
}

.tooltip-title {
  margin: 0 0 6px;
  color: var(--text-1);
  font-family: "JetBrains Mono", monospace;
}

.tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tooltip-row + .tooltip-row {
  margin-top: 4px;
}

.tooltip-key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.bottom-toolbar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.panel {
  padding: 12px;
}

.panel-note {
  margin: 6px 0 10px;
  color: var(--text-1);
  font-size: 0.74rem;
}

.table-wrap {
  overflow: auto;
}

.table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #3a5382;
  border-radius: 10px;
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: #4e71b3;
}

.radar-stage .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 360px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #2a3b61;
  padding: 8px 6px;
  font-size: 0.76rem;
}

th {
  color: #8ea5cf;
  text-transform: uppercase;
  font-size: 0.67rem;
  letter-spacing: 0.05em;
}

/* --- LOGO STYLES --- */
.brand-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  height: 24px;
  width: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: brightness(1.2) contrast(1.1);
}

.auth-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
  margin-right: 8px;
  vertical-align: middle;
  mix-blend-mode: screen;
  filter: brightness(1.2) contrast(1.1);
}

.auth-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 12px;
  font-weight: 700;
}

.cell-positive {
  color: var(--green);
  font-weight: 700;
}

.cell-negative {
  color: var(--red);
  font-weight: 700;
}

.movers-asset {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.movers-name {
  font-weight: 700;
  color: #dbe9ff;
  font-size: 0.8rem;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movers-symbol {
  font-size: 0.68rem;
  color: #8ea5cf;
  font-family: "JetBrains Mono", monospace;
}

.corr-table td {
  text-align: center;
}

.corr-head {
  text-align: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
}

.right-panel {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  height: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.stat-card {
  border: 1px solid #2b3f68;
  border-radius: 10px;
  background: #131f3c;
  padding: 10px;
}

.stat-title {
  margin: 0;
  color: var(--text-1);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  margin: 6px 0 0;
  font-size: 1rem;
  font-family: "JetBrains Mono", monospace;
}

.stat-value.positive {
  color: var(--green);
}

.stat-value.negative {
  color: var(--red);
}

.stat-foot {
  margin: 5px 0 0;
  color: #8ea5cd;
  font-size: 0.68rem;
}

.disabled-panel h2 {
  margin: 0;
  font-size: 0.9rem;
}

.disabled-panel p {
  margin: 6px 0 10px;
  color: var(--text-1);
  font-size: 0.74rem;
}

.buy-disabled,
.sell-disabled {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 10px 8px;
  font-weight: 700;
  color: #fff;
  margin-top: 7px;
}

.buy-disabled {
  background: linear-gradient(180deg, #53be66 0%, #2b9342 100%);
}

.sell-disabled {
  background: linear-gradient(180deg, #f06d52 0%, #cf4a35 100%);
}

.alert-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.alert-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.alert-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-1);
  font-size: 0.74rem;
}

.primary-btn {
  background: #1f3a62;
  border-color: #4f72b4;
}

.alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: #5f7fb8 #0b1733;
}

.alerts-list::-webkit-scrollbar {
  width: 10px;
}

.alerts-list::-webkit-scrollbar-track {
  background: #0b1733;
  border-left: 1px solid #203457;
}

.alerts-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6f8fc4 0%, #4f6fa6 100%);
  border-radius: 999px;
  border: 2px solid #0b1733;
}

.alerts-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #83a2d4 0%, #5c7fb8 100%);
}

.alerts-list::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

.alert-item {
  border: 1px solid #2b4069;
  border-radius: 9px;
  background: #13203d;
  padding: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.alert-item[data-state="triggered"] {
  border-color: #376f47;
  background: #152a1d;
}

.alert-copy {
  margin: 0;
  font-size: 0.72rem;
}

.alert-meta {
  margin: 3px 0 0;
  color: #91a7d0;
  font-size: 0.66rem;
}

.alert-actions {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.alert-actions button {
  border: 1px solid #334c7a;
  background: #17284b;
  color: #d7e6ff;
  border-radius: 7px;
  font-size: 0.65rem;
  cursor: pointer;
  padding: 4px 6px;
}

.toast-stack {
  position: fixed;
  right: 12px;
  bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 25;
}

.toast {
  border: 1px solid #445f98;
  border-radius: 9px;
  background: #121f3c;
  color: #e6f1ff;
  padding: 8px 10px;
  font-size: 0.76rem;
  box-shadow: var(--shadow);
}

.empty-state {
  border: 1px dashed #335082;
  border-radius: 10px;
  padding: 12px;
  color: #95abd1;
  font-size: 0.74rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(var(--d) * 70ms);
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1450px) {
  .iq-layout {
    grid-template-columns: 230px minmax(0, 1fr) 290px;
  }
}

@media (max-width: 1240px) {
  .iq-layout {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .watch-panel {
    display: none;
  }
}

@media (max-width: 980px) {
  .iq-topbar {
    height: auto;
    padding: 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .top-left,
  .top-right {
    width: 100%;
    overflow-x: auto;
  }

  .iq-layout {
    grid-template-columns: 1fr;
  }

  .watch-panel {
    display: flex;
  }
}

@media (max-width: 720px) {
  .chart-header {
    flex-direction: column;
    align-items: stretch;
  }

  .bottom-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .right-panel {
    order: 3;
  }
}
/* --- PORTFOLIO & DIVIDENDS --- */
.portfolio-summary {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.summary-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 12px 16px;
  border-radius: 8px;
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.summary-card .label {
  color: #94a3b8;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  font-weight: 600;
}

.summary-card .value {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.add-btn {
  background: var(--brand);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.add-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.text-up { color: #22c55e !important; }
.text-down { color: #ef4444 !important; }

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--bg-1);
  width: 100%;
  max-width: 450px;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--text-dim);
}

.form-group input, .form-group select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
  font-size: 1rem;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-paid { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.status-pending { background: rgba(234, 179, 8, 0.2); color: #eab308; }
.status-triggered { 
  background: rgba(239, 68, 68, 0.2); 
  color: #ef4444; 
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* --- NEWS & ADS PANEL --- */
.right-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
}

.right-panel::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.news-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  min-height: 100%;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-item {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.news-item:last-of-type {
  border-bottom: none;
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.news-meta .tag {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(var(--brand-rgb, 59, 130, 246), 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.news-meta .lock {
  font-size: 0.65rem;
  color: #eab308;
}

.news-item h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  line-height: 1.4;
  color: var(--text);
}

.news-item p {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.ad-upsell-text {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 8px;
  text-align: center;
  padding: 0 10px;
  opacity: 0.8;
}

.google-ad-container {
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-placeholder-mock {
  text-align: center;
  color: var(--text-dim);
}

.ad-placeholder-mock span {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.ad-placeholder-mock p {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.google-ad-container .adsbygoogle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.upgrade-btn {
  background: var(--brand);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

/* --- ALERT ACTIONS --- */
.alert-actions-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-btn-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
  text-align: center;
}

.btn-pause {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.btn-activate {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border-color: rgba(34, 197, 94, 0.2);
}

.action-btn-pill:hover {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.action-btn-circle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
