:root {
  --bg: #05070b;
  --panel: rgba(10, 14, 18, 0.96);
  --panel-soft: rgba(9, 12, 16, 0.9);
  --line: rgba(90, 112, 134, 0.26);
  --line-strong: rgba(112, 147, 179, 0.42);
  --text: #e9eef2;
  --muted: #8b97a4;
  --green: #21c47b;
  --red: #f15b5b;
  --amber: #eab84f;
  --cyan: #56b6d6;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --sidebar-width: 286px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  height: 100dvh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at top left, rgba(86, 182, 214, 0.1), transparent 26rem),
    radial-gradient(circle at bottom right, rgba(234, 184, 79, 0.09), transparent 30rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  transition: grid-template-columns 220ms ease;
}

body.sidebar-collapsed .app-shell {
  grid-template-columns: minmax(0, 1fr) 0;
}

.chart-panel,
.market-sidebar {
  min-width: 0;
}

.chart-panel {
  position: relative;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  display: block;
}

.market-sidebar {
  border: 1px solid rgba(90, 112, 134, 0.18);
  background: rgba(10, 14, 18, 0.42);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow);
}

.floating-actions {
  position: absolute;
  top: 8px;
  right: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.62);
  border: 1px solid rgba(90, 112, 134, 0.22);
  backdrop-filter: blur(6px);
}

.tools-rail {
  position: absolute;
  top: 50%;
  left: 8px;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-height: calc(100% - 72px);
  overflow-y: auto;
  padding: 4px;
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.62);
  border: 1px solid rgba(90, 112, 134, 0.22);
  backdrop-filter: blur(6px);
  scrollbar-width: none;
}

.tools-rail::-webkit-scrollbar {
  display: none;
}

.tool-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b7c3cc;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, color 140ms ease;
}

.tool-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-btn:hover {
  background: rgba(86, 182, 214, 0.14);
  color: var(--text);
}

.tool-btn.active {
  background: rgba(234, 184, 79, 0.18);
  color: #f5db92;
}

.tool-sep {
  width: 16px;
  height: 1px;
  background: rgba(90, 112, 134, 0.32);
  margin: 2px 0;
}

.float-btn {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b7c3cc;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.float-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.float-btn:hover {
  background: rgba(86, 182, 214, 0.14);
  color: var(--text);
}

.float-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.split-counter {
  min-width: 26px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.floating-status {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 18;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(7, 10, 14, 0.78);
  border: 1px solid rgba(90, 112, 134, 0.2);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.floating-status.live {
  color: var(--cyan);
  border-color: rgba(86, 182, 214, 0.32);
}

.floating-status.error {
  color: var(--red);
  border-color: rgba(241, 91, 91, 0.32);
}

.pane-chips {
  display: none;
}

.pane-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  min-height: 30px;
  min-width: 56px;
  border-radius: 5px;
  background: rgba(7, 10, 14, 0.58);
  border: 1px solid rgba(90, 112, 134, 0.18);
  backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
}

.pane-chip-tf {
  color: var(--cyan);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.pane-chip-price {
  flex-direction: column;
  gap: 1px;
  align-items: flex-start;
}

.pane-chip-price-value {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.05;
}

.pane-chip-price-change {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}

.pane-chip-price-change.positive { color: var(--green); }
.pane-chip-price-change.negative { color: var(--red); }

.pane-chip-symbol[hidden] { display: none; }

.pane-tf-pills {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 4px;
  background: rgba(7, 10, 14, 0.58);
  border: 1px solid rgba(90, 112, 134, 0.18);
  backdrop-filter: blur(4px);
}

.drawing-menu {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.86);
  border: 1px solid rgba(90, 112, 134, 0.28);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
}

.drawing-menu[hidden] { display: none; }

.dm-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.dm-sep {
  width: 1px;
  height: 18px;
  background: rgba(90, 112, 134, 0.35);
  margin: 0 2px;
}

.dm-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.dm-color:hover { transform: scale(1.15); }
.dm-color.active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.dm-width,
.dm-dash,
.dm-delete {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b7c3cc;
  cursor: pointer;
  padding: 0;
  transition: background 120ms ease, color 120ms ease;
}

.dm-width:hover,
.dm-dash:hover,
.dm-delete:hover {
  background: rgba(86, 182, 214, 0.16);
  color: var(--text);
}

.dm-width.active,
.dm-dash.active {
  background: rgba(234, 184, 79, 0.2);
  color: #f5db92;
}

.dm-bar {
  display: block;
  width: 14px;
  background: currentColor;
  border-radius: 1px;
}

.dm-line {
  display: block;
  width: 14px;
  height: 2px;
  border-top: 2px solid currentColor;
}

.dm-line-solid { border-top-style: solid; }
.dm-line-dashed { border-top-style: dashed; }
.dm-line-long {
  border-top: 0;
  background:
    repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px);
  height: 2px;
}
.dm-line-dotted { border-top-style: dotted; }

.dm-delete svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dm-delete:hover { color: var(--red); }

.dm-fill {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.dm-fill:hover { transform: scale(1.15); }
.dm-fill.active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.dm-fill-only[hidden] { display: none !important; }

.tf-pill {
  min-width: 26px;
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.tf-pill:hover {
  background: rgba(86, 182, 214, 0.12);
  color: var(--text);
}

.tf-pill.active {
  background: rgba(234, 184, 79, 0.18);
  color: #f5db92;
}

.float-btn:focus-visible,
.tf-pill:focus-visible,
.market-item:focus-visible,
.sidebar-close:focus-visible,
.search-wrap input:focus-visible,
.chart-canvas:focus-visible {
  outline: 2px solid rgba(86, 182, 214, 0.6);
  outline-offset: 1px;
}

.chart-canvas:focus-visible {
  outline: none;
}

.chart-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%),
    linear-gradient(180deg, rgba(10, 14, 18, 0.98), rgba(5, 7, 11, 0.99));
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.chart-grid {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-auto-flow: row;
  grid-auto-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.chart-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.chart-grid[data-count="2"],
.chart-grid[data-count="3"],
.chart-grid[data-count="4"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-grid[data-count="5"],
.chart-grid[data-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.chart-grid[data-count="7"],
.chart-grid[data-count="8"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chart-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: rgba(7, 10, 14, 0.78);
  box-shadow: none;
}

.chart-tile + .chart-tile {
  border-left: 1px solid rgba(90, 112, 134, 0.18);
}

.chart-tile.active {
  border-color: rgba(90, 112, 134, 0.26);
}

.chart-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: contain;
}

.chart-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 12;
}

.chart-loading[hidden] {
  display: none;
}

.chart-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(86, 182, 214, 0.18);
  border-top-color: rgba(86, 182, 214, 0.95);
  animation: chart-spin 720ms linear infinite;
}

@keyframes chart-spin {
  to { transform: rotate(360deg); }
}

.market-sidebar {
  height: 100dvh;
  position: sticky;
  top: 0;
  width: var(--sidebar-width);
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  transition: transform 220ms ease, opacity 160ms ease;
}

body.sidebar-collapsed .market-sidebar {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

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

.sidebar-header h2 {
  margin: 0;
  font-size: 13px;
}

.sidebar-close {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.sidebar-close:hover {
  color: var(--text);
  background: transparent;
  border: 0;
}

.search-wrap {
  display: grid;
  gap: 6px;
}

.search-wrap input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.86);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
  font-size: 12px;
  line-height: 1.25;
}

.search-wrap input::placeholder {
  color: rgba(139, 151, 164, 0.78);
}

.market-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 5px;
  padding-right: 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  position: relative;
}

.market-list::-webkit-scrollbar {
  width: 6px;
}

.market-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(96, 124, 148, 0.28);
}

.market-row {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 0;
  border-radius: 6px;
  border: 1px solid rgba(90, 112, 134, 0.22);
  background: #0d1217;
  position: relative;
  overflow: hidden;
  transition: background 120ms ease, border-color 120ms ease;
  box-sizing: border-box;
}

.market-row:hover {
  background: #131922;
}

.market-row.active {
  background: #1a2230;
  border-color: rgba(86, 182, 214, 0.45);
}

.market-row.is-loading {
  border-color: rgba(234, 184, 79, 0.48);
  background: linear-gradient(90deg, rgba(234, 184, 79, 0.08), #131922 44%, rgba(234, 184, 79, 0.06));
}

.market-row.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  transform: translateX(-100%);
  animation: market-card-loading 980ms ease-in-out infinite;
  pointer-events: none;
}

.market-fav {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(139, 151, 164, 0.55);
  transition: color 120ms ease;
}

.market-fav:hover {
  color: #eab84f;
}

.market-fav.is-fav {
  color: #eab84f;
}

.market-item,
.market-empty {
  border-radius: 6px;
  border: 0;
  background: transparent;
}

.market-item {
  width: 100%;
  padding: 7px 8px 7px 4px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
  min-width: 0;
}

.market-empty {
  border: 1px solid rgba(90, 112, 134, 0.22);
  background: #0d1217;
}

.market-sort-bar {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.market-sort-btn {
  flex: 1;
  height: 26px;
  border: 1px solid rgba(90, 112, 134, 0.22);
  background: #0d1217;
  color: rgba(139, 151, 164, 0.78);
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.market-sort-btn:hover {
  background: #131922;
  color: var(--text);
}

.market-sort-btn.is-active {
  background: rgba(234, 184, 79, 0.16);
  border-color: rgba(234, 184, 79, 0.45);
  color: #eab84f;
}

.market-sort-btn[data-sort="gainers"].is-active {
  background: rgba(33, 196, 123, 0.16);
  border-color: rgba(33, 196, 123, 0.45);
  color: var(--green);
}

.market-sort-btn[data-sort="losers"].is-active {
  background: rgba(241, 91, 91, 0.16);
  border-color: rgba(241, 91, 91, 0.45);
  color: var(--red);
}

.market-sort-btn[data-sort="alerts"].is-active {
  background: rgba(234, 184, 79, 0.18);
  border-color: rgba(234, 184, 79, 0.5);
  color: #f5db92;
}

.alert-card {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(90, 112, 134, 0.24);
  border-radius: 6px;
  background: #0d1217;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.alert-card:hover {
  border-color: rgba(139, 151, 164, 0.42);
  background: #111821;
}

.alert-card-open {
  border-color: rgba(234, 184, 79, 0.36);
  background: linear-gradient(180deg, rgba(234, 184, 79, 0.06), rgba(13, 18, 23, 0.98));
}

.alert-card-executed {
  border-color: rgba(86, 182, 214, 0.28);
}

.alert-card-expired {
  opacity: 0.72;
}

.alert-card-head,
.alert-card-condition,
.alert-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert-card-symbol {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.alert-card-symbol:hover {
  color: #f5db92;
}

.alert-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.alert-card-delete {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(241, 91, 91, 0.24);
  border-radius: 4px;
  background: rgba(241, 91, 91, 0.08);
  color: #d98282;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}

.alert-card-delete:hover {
  border-color: rgba(241, 91, 91, 0.46);
  background: rgba(241, 91, 91, 0.16);
  color: #ffb0b0;
}

.alert-status {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.alert-status-open {
  background: rgba(234, 184, 79, 0.18);
  color: #f5db92;
}

.alert-status-executed {
  background: rgba(86, 182, 214, 0.16);
  color: #d2ecf6;
}

.alert-status-expired {
  background: rgba(139, 151, 164, 0.14);
  color: var(--muted);
}

.alert-card-condition {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.alert-card-condition strong {
  color: #cdd6dd;
  font-size: 10px;
}

.alert-card-message {
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.alert-card-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.2;
}

.alert-empty {
  display: grid;
  gap: 10px;
}

.alert-empty strong {
  color: var(--text);
  font-size: 12px;
}

.alert-empty-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}

.alert-empty-center > * {
  pointer-events: auto;
}

.alert-empty-text {
  font-size: 11px;
  color: var(--muted);
}

.alert-empty-action {
  justify-self: center;
  height: 22px;
  padding: 0 10px;
  border: 1px solid rgba(234, 184, 79, 0.42);
  border-radius: 4px;
  background: rgba(234, 184, 79, 0.16);
  color: #f5db92;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}

.alert-empty-action:hover {
  background: rgba(234, 184, 79, 0.24);
}

.market-main,
.market-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-symbol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.market-symbol strong {
  display: block;
  font-size: 11px;
  line-height: 1.1;
}

.market-symbol span,
.market-meta span,
.market-price span {
  color: var(--muted);
  font-size: 10px;
}

.market-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 72px;
  position: relative;
}

.market-price strong {
  display: block;
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.market-price span {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.market-loading-dot {
  display: none;
}

@keyframes market-card-spin {
  to { transform: rotate(360deg); }
}

@keyframes market-card-loading {
  to { transform: translateX(100%); }
}

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

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

.market-volume {
  color: var(--muted);
  font-size: 10px;
}

.market-meta {
  display: none;
}

.market-empty {
  padding: 16px 12px;
  color: var(--muted);
  font-size: 11px;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    radial-gradient(ellipse at top, rgba(86, 182, 214, 0.08), transparent 60%),
    rgba(3, 5, 8, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(6px);
}

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

body.auth-locked {
  overflow: hidden;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: #0d1218;
  border: 1px solid rgba(90, 112, 134, 0.32);
  border-radius: 10px;
  padding: 22px 22px 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
}

.auth-brand-mark {
  color: #eab84f;
  font-size: 18px;
  line-height: 1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  background: rgba(7, 10, 14, 0.7);
  border-radius: 6px;
  border: 1px solid rgba(90, 112, 134, 0.22);
}

.auth-tab {
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 4px;
  transition: background 120ms ease, color 120ms ease;
}

.auth-tab:hover {
  color: var(--text);
}

.auth-tab.is-active {
  background: rgba(86, 182, 214, 0.18);
  color: #d2ecf6;
}

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

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

.auth-field {
  display: grid;
  gap: 4px;
}

.auth-field > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.auth-field input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(90, 112, 134, 0.32);
  background: #0a0e13;
  color: var(--text);
  border-radius: 5px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.auth-field input:focus {
  border-color: rgba(86, 182, 214, 0.6);
  background: #0c1218;
}

.auth-error {
  font-size: 11px;
  color: var(--red);
  background: rgba(241, 91, 91, 0.12);
  border: 1px solid rgba(241, 91, 91, 0.32);
  border-radius: 5px;
  padding: 6px 8px;
}

.auth-submit {
  height: 36px;
  margin-top: 4px;
  border: 0;
  border-radius: 5px;
  background: rgba(86, 182, 214, 0.85);
  color: #04141c;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 120ms ease, transform 80ms ease;
}

.auth-submit:hover {
  background: rgba(86, 182, 214, 1);
}

.auth-submit:active {
  transform: scale(0.98);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.user-menu-host {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 4px;
}

.user-avatar-btn {
  height: 20px;
  min-width: 20px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #cdd6dd;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.04em;
  transition: color 120ms ease;
}

.user-avatar-btn:hover {
  color: #fff;
}

.user-avatar-btn-anon {
  color: #b7c3cc;
}

.user-avatar-btn-anon svg {
  display: block;
}

.user-avatar-text {
  font-family: inherit;
}

.user-menu {
  position: absolute;
  top: 28px;
  right: 0;
  min-width: 200px;
  background: #0d1218;
  border: 1px solid rgba(90, 112, 134, 0.32);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-menu[hidden] {
  display: none;
}

.user-menu-header {
  padding: 8px 10px 6px;
}

.user-menu-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-menu-email {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.user-menu-sep {
  height: 1px;
  background: rgba(90, 112, 134, 0.22);
  margin: 4px 0;
}

.user-menu-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 5px;
  transition: background 100ms ease, color 100ms ease;
}

.user-menu-item:hover {
  background: rgba(86, 182, 214, 0.16);
}

.user-menu-item-danger {
  color: var(--red);
}

.user-menu-item-danger:hover {
  background: rgba(241, 91, 91, 0.16);
}

.user-menu-item svg {
  flex: 0 0 auto;
  opacity: 0.85;
}

.tf-pill-sep {
  width: 1px;
  height: 12px;
  background: rgba(90, 112, 134, 0.32);
  margin: 0 3px;
  display: inline-block;
}

.tf-pill-indicators {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 7px;
  color: #d6e0e8;
  background: rgba(86, 182, 214, 0.14);
}

.tf-pill-ind-icon {
  display: block;
}

.tf-pill-ind-plus {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.tf-pill-indicators:hover {
  background: rgba(86, 182, 214, 0.28);
  color: #fff;
}

.tf-pill-alerts {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  color: #f5db92;
  background: rgba(234, 184, 79, 0.14);
}

.tf-pill-alerts:hover,
.tf-pill-alerts.has-alerts {
  background: rgba(234, 184, 79, 0.26);
  color: #fff1bd;
}

.tf-pill-alert-icon {
  display: block;
}

.tf-pill-alert-count {
  min-width: 12px;
  height: 12px;
  padding: 0 3px;
  border-radius: 999px;
  background: rgba(234, 184, 79, 0.95);
  color: #151004;
  font-size: 8px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tf-pill-alert-count[hidden] {
  display: none;
}

.pane-indicators {
  position: absolute;
  top: 32px;
  left: 12px;
  z-index: 14;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 24px);
}

.pane-indicators[hidden] {
  display: none;
}

.ind-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 18px;
  padding: 0 4px 0 6px;
  border-radius: 3px;
  background: rgba(7, 10, 14, 0.7);
  border: 1px solid rgba(90, 112, 134, 0.22);
  font-size: 10px;
  color: #cdd6dd;
  backdrop-filter: blur(4px);
}

.ind-chip.is-hidden {
  opacity: 0.45;
}

.ind-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.ind-chip-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 4px;
  border-left: 1px solid rgba(90, 112, 134, 0.28);
  margin-left: 2px;
}

.ind-chip-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.ind-chip-leg-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  flex: 0 0 auto;
}

.ind-chip-leg-label {
  font-weight: 600;
}

.ind-chip-label {
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0 2px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ind-chip-src {
  font-weight: 500;
  color: var(--muted);
  font-size: 9px;
}

.ind-chip-label:hover {
  color: #fff;
}

.ind-chip-x {
  width: 14px;
  height: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ind-chip-x:hover {
  background: rgba(241, 91, 91, 0.18);
  color: var(--red);
}

.ind-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ind-modal-backdrop[hidden] {
  display: none;
}

.ind-modal {
  width: 100%;
  max-width: min(360px, calc(100vw - 28px));
  max-height: min(72vh, 560px);
  background: #0d1218;
  border: 1px solid rgba(90, 112, 134, 0.32);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ind-modal.ind-modal-expanded {
  max-width: min(1180px, calc(100vw - 28px));
  max-height: min(90vh, 860px);
}

.ind-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(90, 112, 134, 0.18);
}

.ind-modal-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ind-modal-close {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
}

.ind-modal-close:hover {
  background: rgba(86, 182, 214, 0.14);
  color: var(--text);
}

.ind-modal-body {
  padding: 14px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 133, 147, 0.28) transparent;
}

.ind-modal-body::-webkit-scrollbar,
.ind-expanded-canvas-wrap::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.ind-modal-body::-webkit-scrollbar-track,
.ind-expanded-canvas-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.ind-modal-body::-webkit-scrollbar-thumb,
.ind-expanded-canvas-wrap::-webkit-scrollbar-thumb {
  background: rgba(122, 133, 147, 0.24);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}

.ind-modal-body::-webkit-scrollbar-thumb:hover,
.ind-expanded-canvas-wrap::-webkit-scrollbar-thumb:hover {
  background: rgba(122, 133, 147, 0.38);
  border: 2px solid transparent;
  background-clip: content-box;
}

.ind-modal-expanded .ind-modal-body {
  padding: 0;
  background: #080c11;
}

.ind-picker-list {
  display: grid;
  gap: 12px;
}

.ind-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ind-picker-search {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  border-radius: 5px;
  border: 1px solid rgba(90, 112, 134, 0.3);
  background: #0a0f15;
  color: var(--text);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}

.ind-picker-search::placeholder {
  color: rgba(139, 151, 164, 0.6);
}

.ind-picker-search:focus {
  border-color: rgba(86, 182, 214, 0.55);
}

.ind-picker-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ind-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  border-radius: 4px;
  background: transparent;
  transition: background 100ms ease;
}

.ind-picker-row[hidden] {
  display: none;
}

.ind-picker-row:hover {
  background: rgba(86, 182, 214, 0.06);
}

.ind-picker-name {
  font-size: 12px;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ind-picker-add {
  flex: 0 0 auto;
  height: 22px;
  padding: 0 9px;
  border: 1px solid rgba(86, 182, 214, 0.35);
  background: rgba(86, 182, 214, 0.1);
  color: #b9dbea;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}

.ind-picker-add:hover {
  background: rgba(86, 182, 214, 0.2);
  color: #fff;
}

.ind-picker-add.is-added {
  background: rgba(96, 184, 130, 0.22);
  border-color: rgba(96, 184, 130, 0.5);
  color: #d6f1e2;
}


.ind-expanded {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.ind-expanded-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.ind-expanded-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ind-expanded-meta strong {
  color: var(--text);
  font-size: 12px;
}

.ind-expanded-meta span {
  color: #7a8593;
}

.ind-expanded-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ind-icon-btn {
  height: 28px;
  min-width: 30px;
  padding: 0 9px;
  border: 1px solid rgba(90, 112, 134, 0.3);
  border-radius: 4px;
  background: #101720;
  color: var(--text);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.ind-icon-btn:hover {
  background: #182230;
  border-color: rgba(86, 182, 214, 0.45);
}

.ind-expanded-canvas-wrap {
  min-width: 0;
  height: min(68vh, 620px);
  min-height: 320px;
  border: 1px solid rgba(90, 112, 134, 0.28);
  border-radius: 6px;
  background: #080c11;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 133, 147, 0.26) transparent;
}

.ind-expanded-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  cursor: grab;
  touch-action: none;
}

.ind-expanded-canvas:active {
  cursor: grabbing;
}

.ind-picker-group {
  display: grid;
  gap: 6px;
}

.ind-picker-group-title {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ind-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
}

.ind-picker-item {
  min-width: 0;
  border: 1px solid rgba(90, 112, 134, 0.22);
  border-radius: 6px;
  background: #131922;
  color: var(--text);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transition: background 120ms ease, border-color 120ms ease;
}

.ind-picker-item:hover {
  background: #1a2230;
  border-color: rgba(86, 182, 214, 0.45);
}

.ind-pick-main {
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 10px 10px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ind-picker-item strong {
  font-size: 12px;
}

.ind-picker-item span {
  font-size: 10px;
  color: var(--muted);
}

.ind-info-btn,
.ind-chip-info {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: rgba(86, 182, 214, 0.12);
  color: #b9dbea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.ind-info-btn {
  margin: 6px 6px 0 0;
}

.ind-info-btn:hover,
.ind-chip-info:hover {
  background: rgba(86, 182, 214, 0.22);
  color: #fff;
}

.ind-chip-info {
  width: 14px;
  height: 14px;
  padding: 0;
  font-size: 9px;
}

.ind-editor-headline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(90, 112, 134, 0.2);
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.45);
}

.ind-editor-headline strong,
.ind-info-panel h4 {
  color: var(--text);
  font-size: 13px;
}

.ind-editor-headline span,
.ind-info-panel p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.ind-info-panel {
  display: grid;
  gap: 10px;
}

.ind-info-kicker {
  color: #f5db92;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ind-info-panel h4,
.ind-info-panel p {
  margin: 0;
}

.ind-info-block {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(90, 112, 134, 0.2);
  border-radius: 6px;
  background: rgba(7, 10, 14, 0.45);
}

.ind-info-block strong {
  color: var(--text);
  font-size: 12px;
}

.ind-info-note {
  color: #c9a760;
  font-size: 10px;
  line-height: 1.4;
}

.ind-presets {
  margin-top: 14px;
  border-top: 1px solid rgba(90, 112, 134, 0.18);
  padding-top: 10px;
}

.ind-presets-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.ind-presets-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.ind-preset {
  min-width: 36px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(90, 112, 134, 0.22);
  background: #131922;
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.ind-preset:hover {
  border-color: rgba(86, 182, 214, 0.45);
  background: #1a2230;
}

.ind-form {
  display: grid;
  gap: 10px;
}

.ind-field {
  display: grid;
  gap: 4px;
}

.ind-field > span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.ind-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ind-field-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ind-field-row > span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  color: var(--text);
}

.ind-field input[type="number"],
.ind-field select {
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(90, 112, 134, 0.28);
  background: #0a0e13;
  color: var(--text);
  border-radius: 4px;
  font-size: 12px;
  outline: none;
}

.ind-field input[type="number"]:focus,
.ind-field select:focus {
  border-color: rgba(86, 182, 214, 0.55);
}

.ind-color-row {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ind-color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  padding: 0;
}

.ind-color-swatch.is-active {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.ind-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  gap: 8px;
}

.ind-actions-right {
  display: inline-flex;
  gap: 6px;
}

.ind-btn {
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(90, 112, 134, 0.28);
  background: #131922;
  color: var(--text);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.ind-btn:hover {
  background: #1a2230;
}

.ind-btn-primary {
  background: rgba(86, 182, 214, 0.22);
  border-color: rgba(86, 182, 214, 0.55);
  color: #d2ecf6;
}

.ind-btn-primary:hover {
  background: rgba(86, 182, 214, 0.32);
}

.ind-btn-danger {
  color: var(--red);
  border-color: rgba(241, 91, 91, 0.4);
  background: transparent;
}

.ind-btn-danger:hover {
  background: rgba(241, 91, 91, 0.14);
}

.alert-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
}

.alert-modal-backdrop[hidden] {
  display: none;
}

.alert-modal {
  width: min(440px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #0d1218;
  border: 1px solid rgba(234, 184, 79, 0.34);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

.alert-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(90, 112, 134, 0.2);
}

.alert-modal-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.alert-modal-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.alert-modal-close:hover {
  background: rgba(234, 184, 79, 0.14);
  color: var(--text);
}

.alert-form {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.alert-form-body {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.alert-section {
  display: grid;
  gap: 8px;
}

.alert-section + .alert-section {
  padding-top: 10px;
  border-top: 1px solid rgba(90, 112, 134, 0.16);
}

.alert-section-title {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.alert-field {
  display: grid;
  gap: 4px;
}

.alert-field > span {
  font-size: 10px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.alert-field input,
.alert-field select,
.alert-field textarea {
  width: 100%;
  border: 1px solid rgba(90, 112, 134, 0.28);
  border-radius: 4px;
  background: #0a0e13;
  color: var(--text);
  font-size: 12px;
  outline: none;
  font-family: inherit;
}

.alert-field input,
.alert-field select {
  height: 32px;
  padding: 0 8px;
}

.alert-field textarea {
  min-height: 54px;
  resize: vertical;
  padding: 8px;
  line-height: 1.35;
}

.alert-field input:focus,
.alert-field select:focus,
.alert-field textarea:focus {
  border-color: rgba(234, 184, 79, 0.62);
}

.alert-field select:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.alert-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-check-row label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(90, 112, 134, 0.22);
  border-radius: 4px;
  background: #111820;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.alert-check-row input {
  accent-color: #eab84f;
}

.alert-error {
  margin: 0 14px 12px;
  padding: 7px 9px;
  border: 1px solid rgba(241, 91, 91, 0.34);
  border-radius: 5px;
  background: rgba(241, 91, 91, 0.12);
  color: var(--red);
  font-size: 11px;
}

.alert-error[hidden] {
  display: none;
}

.alert-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(90, 112, 134, 0.18);
}

.alert-btn {
  height: 31px;
  padding: 0 13px;
  border: 1px solid rgba(90, 112, 134, 0.3);
  border-radius: 4px;
  background: #131922;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.alert-btn:hover {
  background: #1a2230;
}

.alert-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.alert-btn-primary {
  border-color: rgba(234, 184, 79, 0.58);
  background: rgba(234, 184, 79, 0.23);
  color: #fff1bd;
}

.alert-btn-primary:hover {
  background: rgba(234, 184, 79, 0.32);
}

.alert-toast-host {
  position: fixed;
  top: 44px;
  right: 14px;
  z-index: 520;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 28px));
  pointer-events: none;
}

.alert-toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(234, 184, 79, 0.42);
  border-radius: 7px;
  background: rgba(13, 18, 24, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), 0 0 22px rgba(234, 184, 79, 0.08);
  cursor: pointer;
  animation: alert-toast-in 180ms ease-out;
}

.alert-toast-created {
  border-color: rgba(86, 182, 214, 0.36);
}

.alert-toast.is-leaving {
  animation: alert-toast-out 180ms ease-in forwards;
}

.alert-toast-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(234, 184, 79, 0.16);
  color: #f5db92;
}

.alert-toast-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.alert-toast-main strong {
  font-size: 12px;
  color: var(--text);
}

.alert-toast-main span,
.alert-toast-main small {
  font-size: 11px;
  line-height: 1.3;
  color: #cdd6dd;
}

.alert-toast-main small {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.alert-toast-close {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.alert-toast-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

@keyframes alert-toast-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes alert-toast-out {
  to { opacity: 0; transform: translateY(-4px); }
}

@media (max-width: 560px) {
  .ind-modal-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .ind-modal,
  .ind-modal.ind-modal-expanded {
    max-height: calc(100dvh - 24px);
  }

  .ind-expanded-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .ind-expanded-canvas-wrap,
  .ind-expanded-canvas {
    min-height: 280px;
    height: 58vh;
  }

  .alert-modal-backdrop {
    align-items: flex-end;
    padding: 12px;
  }

  .alert-modal {
    max-height: calc(100dvh - 24px);
  }

  .alert-grid {
    grid-template-columns: 1fr;
  }

  .alert-actions {
    justify-content: stretch;
  }

  .alert-btn {
    flex: 1;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sidebar-collapsed .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .market-sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(var(--sidebar-width), calc(100vw - 16px));
    height: 100dvh;
    min-height: 0;
    border-left: 1px solid var(--line);
    border-top: 0;
    overflow: hidden;
    grid-template-rows: auto auto minmax(0, 1fr);
    z-index: 70;
  }

  body.sidebar-collapsed .market-sidebar {
    display: grid;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
  }

  .sidebar-tab {
    right: 12px;
  }

  .chart-grid[data-count] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .chart-panel,
  .market-sidebar {
    padding: 12px;
  }

  .market-sidebar {
    height: 100dvh;
    min-height: 0;
  }

  .chart-toolbar {
    border-radius: 12px;
    padding: 10px;
    grid-template-columns: 1fr;
  }

  .chart-grid[data-count] {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(360px, 62dvh);
  }

  .chart-tile {
    min-height: 360px;
  }

  .toolbar-controls {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .timeframe-group {
    flex-wrap: wrap;
  }

  .pane-strip {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .pane-timeframes {
    width: 100%;
    flex-wrap: wrap;
  }

  .split-group {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    flex-wrap: wrap;
  }

  .toolbar-btn,
  .timeframe-pill {
    min-height: 44px;
  }

  .pane-timeframes .timeframe-pill {
    min-height: 30px;
  }

  .chart-action {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
    scroll-behavior: auto !important;
  }
}
