:root {
  --bg: #101315;
  --panel: #171b1f;
  --panel-2: #1e2428;
  --line: #30383d;
  --text: #edf2f1;
  --muted: #95a19f;
  --green: #2dd48f;
  --red: #ff6363;
  --yellow: #f5bf4f;
  --blue: #74a7ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
  display: grid;
  gap: 18px;
}

.auth-logo {
  display: block;
  width: min(310px, 86%);
  height: auto;
  margin-bottom: 8px;
}

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

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

.auth-form.active {
  display: grid;
}

.auth-note {
  color: var(--muted);
  line-height: 1.45;
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 4px;
  width: fit-content;
  justify-self: center;
  font-weight: 700;
}

.auth-link:hover {
  text-decoration: underline;
}

.app {
  display: grid;
  grid-template-columns: clamp(260px, 18vw, 300px) minmax(0, 1fr);
  width: 100vw;
  min-height: 100vh;
  overflow: hidden;
}

.sidebar {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #121619;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.brand,
.topbar,
.panel-head,
.coin,
.event > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-actions {
  display: flex;
  gap: 8px;
}

.brand-logo {
  display: block;
  width: min(165px, 100%);
  height: auto;
  margin: -7px 0 -5px;
}

.brand-status {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 17px;
}

.brand p,
.eyebrow,
.event small,
.muted,
.price-card span,
.metrics span,
.coin small {
  color: var(--muted);
}

.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 5px;
}

.icon-btn,
.search-box button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 8px;
  font-size: 20px;
}

.settings-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.settings-dialog::backdrop {
  background: rgba(0, 0, 0, 0.58);
}

.settings-card {
  margin: 0;
}

.settings-body {
  padding: 16px;
  display: grid;
  gap: 13px;
}

.settings-body label,
.settings-view {
  display: grid;
  gap: 7px;
}

.settings-body label {
  color: var(--muted);
  font-size: 13px;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.settings-tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 9px 8px;
}

.settings-tab.active {
  background: var(--panel-2);
  color: var(--text);
}

.settings-view {
  display: none;
}

.settings-view.active {
  display: grid;
}

.settings-view textarea {
  min-height: 320px;
  line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

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

.key-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111518;
  padding: 12px;
  display: grid;
  gap: 5px;
}

.key-status span {
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 40px;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111518;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
}

.sidebar-block {
  display: grid;
  gap: 8px;
}

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

.main-nav {
  display: grid;
  gap: 14px;
}

.nav-group {
  display: grid;
  gap: 7px;
}

.favorite-alerts {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  display: grid;
  gap: 8px;
}

.sidebar-section-title {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.favorite-alert-list {
  display: grid;
  gap: 7px;
}

.favorite-alert,
.event-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorite-alert {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 7px;
}

.favorite-alert.dragging {
  opacity: 0.55;
}

.drag-handle {
  color: var(--muted);
  cursor: grab;
}

.favorite-main {
  flex: 1;
  display: grid;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
}

.favorite-main small,
.favorite-empty {
  color: var(--muted);
  font-size: 12px;
}

.favorite-remove {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  min-height: 36px;
  text-align: left;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 700;
}

.nav-item.active {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

.nav-item.has-unread {
  border-color: rgba(47, 211, 132, 0.75);
  background: rgba(47, 211, 132, 0.08);
  color: var(--text);
}

.nav-badge {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--green);
  color: #04110b;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 900;
}

.tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  min-height: 34px;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 700;
}

.tab.active {
  background: var(--panel-2);
  color: var(--text);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.logout-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 4px 0;
  font-weight: 800;
}

.logout-link:hover {
  color: var(--red);
}

.coin-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}

.coin {
  position: relative;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 13px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  touch-action: pan-y;
}

.coin::after {
  content: "Удалить";
  position: absolute;
  right: -112px;
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: calc(100% - 8px);
  border-radius: 8px;
  background: var(--red);
  color: #170405;
  display: grid;
  place-items: center;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
}

.coin.swiping::after {
  opacity: 1;
}

.coin.removing {
  transform: translateX(-150px) !important;
  opacity: 0;
}

.coin[draggable="true"] {
  cursor: grab;
}

.coin.dragging {
  opacity: 0.55;
}

.coin:hover,
.coin.active {
  background: var(--panel);
  border-color: var(--line);
}

.coin-status-triggered {
  border-color: rgba(255, 99, 99, 0.62);
  background: rgba(255, 99, 99, 0.08);
}

.coin-status-triggered small {
  color: var(--red);
}

.coin-countdown {
  color: var(--yellow) !important;
  font-weight: 700;
}

.coin-status-recheck-confirmed {
  border-color: rgba(45, 212, 143, 0.62);
  background: rgba(45, 212, 143, 0.09);
}

.coin-status-recheck-confirmed small {
  color: var(--green);
}

.coin-status-recheck-rejected {
  border-color: rgba(178, 121, 255, 0.66);
  background: rgba(178, 121, 255, 0.1);
}

.coin-status-recheck-rejected small {
  color: #b279ff;
}

.coin-main {
  display: grid;
  gap: 3px;
}

.coin-pin {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  flex: 0 0 auto;
}

.coin-pin.active {
  color: var(--yellow);
  border-color: rgba(245, 191, 79, 0.55);
  background: rgba(245, 191, 79, 0.08);
}

.coin-meta {
  color: var(--muted);
  font-size: 12px;
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 64px;
}

.coin-meta b {
  color: var(--text);
}

.workspace {
  min-width: 0;
  padding: 24px;
  overflow-x: hidden;
  overflow-y: auto;
}

.topbar {
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.topbar > div:first-child {
  min-width: 0;
}

.price-card {
  margin-left: auto;
  width: max-content;
  min-width: 150px;
  max-width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 13px 16px;
  display: grid;
  gap: 4px;
}

.price-card strong {
  font-size: 22px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.app-view {
  display: none;
}

.app-view.active {
  display: grid;
}

.content-grid.app-view.active,
.history.app-view.active {
  display: grid;
}

.help-panel {
  max-width: 980px;
}

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

.help-card {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111518;
  color: var(--text);
  padding: 14px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
}

.help-card:hover {
  border-color: rgba(116, 167, 255, 0.7);
  background: var(--panel);
}

.help-card span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.help-card strong {
  line-height: 1.35;
}

.analysis-panel,
.panel,
.history-column {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.analysis-panel {
  min-height: 580px;
  display: flex;
  flex-direction: column;
}

.panel-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head.compact {
  padding: 16px;
}

.primary,
.secondary,
.ghost,
.danger,
.delete-alert {
  border: 0;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

.primary {
  background: var(--green);
  color: #04110b;
}

.primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.secondary {
  width: 100%;
  background: var(--blue);
  color: #07101f;
}

.ghost {
  width: 100%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
}

.danger,
.delete-alert {
  background: var(--red);
  color: #170405;
}

.delete-alert {
  justify-self: start;
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.analysis-output {
  line-height: 1.6;
  color: #d7dedc;
  padding: 20px;
  overflow: auto;
}

.analysis-rendered,
.analysis-section,
.analysis-recommendation {
  display: grid;
  gap: 14px;
}

.analysis-rendered {
  gap: 18px;
}

.analysis-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.analysis-meta strong {
  color: var(--text);
}

.analysis-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 18px;
}

.analysis-section h3,
.analysis-recommendation h3 {
  font-size: 16px;
  letter-spacing: 0;
}

.analysis-section h4 {
  font-size: 15px;
  margin-top: 4px;
}

.analysis-section p,
.analysis-recommendation p {
  margin: 0;
}

.analysis-section code,
.analysis-recommendation code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111518;
  color: var(--yellow);
  padding: 1px 5px;
}

.analysis-bullet {
  padding-left: 10px;
}

.analysis-more {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
}

.analysis-more summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 700;
}

.analysis-more[open] summary {
  margin-bottom: 12px;
}

.analysis-conclusion {
  border-color: rgba(245, 191, 79, 0.35);
}

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

.probability-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.probability-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.probability-card span {
  font-weight: 800;
}

.probability-card strong {
  font-size: 24px;
}

.probability-card.long {
  border-color: rgba(45, 212, 143, 0.45);
  background: rgba(45, 212, 143, 0.07);
}

.probability-card.long span,
.probability-card.long strong {
  color: var(--green);
}

.probability-card.short {
  border-color: rgba(255, 99, 99, 0.45);
  background: rgba(255, 99, 99, 0.07);
}

.probability-card.short span,
.probability-card.short strong {
  color: var(--red);
}

.analysis-recommendation {
  border: 1px solid rgba(116, 167, 255, 0.42);
  border-radius: 8px;
  background: rgba(116, 167, 255, 0.07);
  padding: 16px;
}

.analysis-accept {
  width: fit-content;
  min-width: 190px;
  margin-top: 4px;
}

.analysis-action {
  width: auto;
  margin: 0 20px 18px;
  justify-self: start;
}

.tradingview-panel {
  max-width: 980px;
}

.tradingview-form {
  padding: 18px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.7fr auto;
  gap: 12px;
  align-items: end;
}

.tradingview-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.tradingview-form .secondary {
  width: auto;
  min-width: 160px;
}

.tradingview-status {
  border-top: 1px solid var(--line);
  padding: 16px 18px;
  color: var(--muted);
}

.tradingview-result {
  padding: 0 18px 18px;
}

.tradingview-result img {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #07090b;
}

.tradingview-analyze {
  width: fit-content;
  margin-top: 12px;
}

.compact-action {
  width: auto;
  min-height: 34px;
  margin: 0 12px 12px;
  padding: 0 12px;
  font-size: 12px;
}

.analysis-history {
  border-top: 1px solid var(--line);
  padding: 14px 18px 18px;
  display: grid;
  gap: 10px;
}

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

.analysis-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.analysis-item summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  color: var(--muted);
}

.analysis-item summary strong {
  color: var(--text);
}

.analysis-saved-details {
  border-top: 1px solid var(--line);
}

.analysis-saved-details summary {
  cursor: pointer;
  padding: 14px 0;
  color: var(--blue);
  font-weight: 800;
}

.analysis-rendered.compact .analysis-meta {
  margin-bottom: 0;
}

.analysis-saved-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
}

.analysis-item .analysis-saved-shots {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.analysis-saved-shots figure {
  margin: 0;
  position: relative;
}

.analysis-saved-shots img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.analysis-saved-shots figcaption {
  position: absolute;
  top: 8px;
  left: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: rgba(10, 15, 16, 0.86);
  color: var(--text);
  font-weight: 800;
}

.analysis-saved-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
}

.analysis-item .analysis-saved-empty {
  border-width: 1px 0 0;
  border-radius: 0;
}

.analysis-item pre,
.analysis-history-body {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px;
  color: #cdd4d2;
  font-family: inherit;
  line-height: 1.55;
}

.analysis-item pre {
  white-space: pre-wrap;
}

.analysis-history-body {
  display: grid;
  gap: 10px;
}

.analysis-history-body h4 {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 15px;
}

.analysis-history-body p {
  margin: 0;
}

.screenshots {
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.shot-state {
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.shot-state.error {
  color: var(--red);
}

.shot-loading {
  gap: 8px;
  text-align: center;
}

.shot-loading strong,
.shot-state.error strong {
  color: var(--text);
}

.shot-loading span,
.shot-state.error span {
  font-size: 22px;
  font-weight: 900;
  color: var(--blue);
}

.shot-loading small {
  max-width: 520px;
  line-height: 1.45;
}

.shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.shot-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shot-meta strong {
  color: var(--blue);
  font-weight: 900;
}

.shot-refresh {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
}

.shot-refresh:disabled {
  color: var(--muted);
  cursor: wait;
}

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

.coinglass-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.coinglass-link:hover {
  text-decoration: underline;
}

.shot-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0f1315;
  min-height: 220px;
}

.shot-card img {
  display: block;
  width: 100%;
  height: clamp(220px, 23vw, 380px);
  object-fit: contain;
}

.shot-card-tools {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.shot-label {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 19, 21, 0.82);
  color: var(--text);
  font-weight: 700;
  padding: 4px 8px;
  display: grid;
  gap: 2px;
}

.shot-label small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.shot-single-refresh {
  pointer-events: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 19, 21, 0.86);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
}

.shot-single-refresh:disabled {
  color: var(--muted);
  cursor: wait;
}

.shot-card.refreshing {
  outline: 1px solid var(--blue);
  outline-offset: -1px;
}

.shot-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 18px;
  text-align: center;
}

.side-panel {
  display: grid;
  gap: 18px;
}

.alert-form {
  padding: 16px;
  display: grid;
  gap: 13px;
}

.alert-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

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

.metrics {
  padding: 10px 16px 16px;
  display: grid;
  gap: 8px;
}

.metrics div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 9px 0;
}

.account-panel,
.admin-panel,
.instructions-panel,
.signals-panel,
.updates-panel,
.support-panel {
  max-width: 100%;
}

.support-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: 620px;
  border-top: 1px solid var(--line);
}

.support-intro {
  border-top: 1px solid var(--line);
  padding: 14px 16px;
  display: grid;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.support-intro strong {
  line-height: 1.45;
}

.support-intro span {
  color: var(--muted);
  line-height: 1.45;
}

.ticket-sidebar {
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

.ticket-form,
.ticket-reply-form {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.ticket-form {
  border-bottom: 1px solid var(--line);
}

.updates-form {
  display: grid;
  grid-template-columns: 160px 130px 120px minmax(240px, 1fr) auto;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.updates-list {
  display: grid;
  gap: 0;
}

.update-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.update-item time {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.update-meta {
  display: grid;
  gap: 8px;
}

.update-version {
  width: max-content;
  border: 1px solid rgba(104, 155, 255, 0.45);
  border-radius: 6px;
  padding: 4px 8px;
  color: #8bb3ff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.update-item p {
  margin: 0;
  color: #e8f0ee;
  line-height: 1.5;
}

.updates-empty {
  padding: 22px;
  color: var(--muted);
}

.ticket-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.ticket-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  padding: 12px;
  display: grid;
  gap: 8px;
  text-align: left;
}

.ticket-item.active {
  border-color: var(--blue);
  background: rgba(111, 158, 255, 0.09);
}

.ticket-item.unread {
  border-color: rgba(47, 211, 132, 0.72);
  background: rgba(47, 211, 132, 0.08);
}

.ticket-item span {
  display: grid;
  gap: 4px;
}

.ticket-item small,
.ticket-item em,
.ticket-thread-head small {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.ticket-item em.closed {
  color: var(--red);
}

.ticket-item em b {
  margin-left: 6px;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--green);
  color: #04110b;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  font-size: 12px;
  font-weight: 900;
}

.ticket-empty {
  color: var(--muted);
  padding: 14px;
}

.ticket-thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.ticket-thread-head {
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.ticket-thread-head div {
  display: grid;
  gap: 5px;
}

.ticket-thread-head strong {
  color: var(--text);
}

.ticket-messages {
  overflow: auto;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.ticket-message {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  display: grid;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.ticket-message.support {
  border-color: rgba(47, 211, 132, 0.35);
  background: rgba(47, 211, 132, 0.07);
}

.ticket-message > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ticket-message small {
  color: var(--muted);
}

.ticket-message p {
  white-space: pre-wrap;
  line-height: 1.45;
}

.ticket-reply-form {
  border-top: 1px solid var(--line);
}

.ticket-reply-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.account-grid {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.account-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  display: grid;
  gap: 5px;
}

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

.account-telegram-form {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.account-telegram-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.account-telegram-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-table-wrap {
  overflow: auto;
  padding: 16px;
}

.admin-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  color: #d7dedc;
  font-size: 14px;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
}

.admin-table input[type="number"] {
  width: 110px;
  padding: 8px 9px;
}

.admin-table input[type="checkbox"] {
  width: auto;
}

.instructions-body {
  padding: 18px;
  display: grid;
  gap: 10px;
  max-width: 980px;
}

.instructions-body p {
  color: #c8d0ce;
  line-height: 1.55;
}

.instructions-body h3 {
  margin-top: 8px;
}

.instructions-body ul {
  margin: 0 0 8px;
  padding-left: 20px;
  color: #c8d0ce;
  line-height: 1.55;
}

.instructions-body li + li {
  margin-top: 5px;
}

.instruction-note {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(45, 212, 143, 0.08);
  padding: 12px 14px;
  color: var(--text) !important;
}

.signal-list {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.signal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  display: grid;
  gap: 9px;
  cursor: pointer;
}

.signal-card > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.signal-card small {
  color: var(--muted);
}

.signal-card p {
  color: #c8d0ce;
  line-height: 1.5;
}

.signal-card a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

.signal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.signal-shots {
  display: block;
}

.signal-shots-dialog {
  width: min(1180px, calc(100vw - 32px));
}

.signal-shots-dialog-body {
  padding: 16px;
}

.signal-shot-grid .shot-card img {
  height: min(420px, 42vw);
}

.history {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.history-column h3 {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.event-list {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.event,
.empty {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  padding: 12px;
}

.event {
  display: grid;
  gap: 7px;
}

.event p {
  color: #c8d0ce;
  font-size: 14px;
}

.event span {
  color: var(--yellow);
  font-size: 12px;
}

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

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  transition: 0.2s ease;
  max-width: 360px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.alert-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid rgba(255, 99, 99, 0.65);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  box-shadow: 0 24px 80px rgba(255, 99, 99, 0.18), var(--shadow);
}

.alert-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.alert-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

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

.alert-card h3 {
  color: var(--red);
  font-size: 24px;
}

.alert-card p {
  line-height: 1.5;
}

.toast.error {
  border-color: var(--red);
}

@media (max-width: 1500px) {
  .content-grid,
  .history {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .side-panel {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-logo {
    width: 145px;
  }

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

  .coin-list {
    max-height: 320px;
  }

  .workspace {
    padding: 18px;
  }

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

  h2 {
    font-size: 24px;
  }

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

  .analysis-old-shots {
    grid-template-columns: 1fr;
  }

  .analysis-saved-shots {
    grid-template-columns: 1fr;
  }

  .analysis-probabilities {
    grid-template-columns: 1fr;
  }

  .account-grid,
  .account-telegram-actions {
    grid-template-columns: 1fr;
  }

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

  .ticket-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ticket-reply-actions {
    grid-template-columns: 1fr;
  }

  .updates-form,
  .update-item {
    grid-template-columns: 1fr;
  }

  .update-item {
    gap: 8px;
  }

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

  .tradingview-form .secondary {
    width: 100%;
  }
}
