:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --border: #2d3a4f;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --buy: #22c55e;
  --sell: #ef4444;
  --neutral: #94a3b8;
  --accent: #3b82f6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  white-space: nowrap;
}

.nav-link:hover {
  border-color: var(--accent);
  color: var(--text);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.main {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1rem;
  padding: 1rem 2rem 2rem;
  min-height: calc(100vh - 90px);
}

.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.chart-channel-filter {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.chart-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chart-filter-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.chart-filter-select {
  flex: 1;
  min-width: 10rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.chart-filter-select--full {
  width: 100%;
}

.chart-filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.chart-filter-extra.hidden {
  display: none;
}

.chart-filter-hint {
  margin: 0;
  min-height: 1rem;
}

.channel-filter-pick {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 9rem;
  overflow-y: auto;
  padding: 0.45rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.channel-filter-pick label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.15rem 0;
}

.channel-filter-pick input[type="checkbox"] {
  accent-color: var(--accent);
  flex-shrink: 0;
}

.channel-filter-pick-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

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

#chart {
  flex: 1;
  min-height: 420px;
}

.legend {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.legend-item.buy { color: var(--buy); }
.legend-item.sell { color: var(--sell); }
.legend-item.neutral { color: var(--neutral); }

.sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-section + .sidebar-section {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.sidebar h2 {
  font-size: 1rem;
  font-weight: 600;
}

.hint {
  font-size: 0.75rem;
  color: var(--muted);
}

.signal-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.signal-filter-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.signal-filter {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.signal-filter:focus {
  outline: none;
  border-color: var(--accent);
}

.signal-filter-count {
  margin: 0 0 0.5rem;
  min-height: 1rem;
}

.signal-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
}

.sentiment-label {
  font-size: 0.85rem;
  font-weight: 600;
}

.sentiment-neutral {
  font-size: 0.78rem;
  color: var(--muted);
}

.sentiment-neutral.hidden {
  display: none;
}

.sentiment-bar {
  display: flex;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--border);
}

.sentiment-bar.empty {
  background: var(--border);
}

.sentiment-buy {
  height: 100%;
  background: var(--buy);
  transition: width 0.4s ease;
  flex-shrink: 0;
}

.sentiment-sell {
  height: 100%;
  background: var(--sell);
  transition: width 0.4s ease;
  flex-shrink: 0;
}

.channel-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
}

.channel-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
}

.channel-item .name {
  font-size: 0.8rem;
  line-height: 1.3;
  flex: 1;
  word-break: break-word;
}

.btn-remove {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: var(--sell);
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
}

.add-channel-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.add-channel-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
}

.add-channel-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.signal-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.signal-card:hover {
  border-color: var(--accent);
}

.signal-card .signal-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.signal-badge.buy { background: rgba(34, 197, 94, 0.2); color: var(--buy); }
.signal-badge.sell { background: rgba(239, 68, 68, 0.2); color: var(--sell); }
.signal-badge.neutral { background: rgba(148, 163, 184, 0.2); color: var(--neutral); }

.signal-card .title {
  font-size: 0.85rem;
  line-height: 1.3;
}

.signal-card .channel {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.signal-card .signal-date {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.35rem;
  opacity: 0.85;
}

.btn {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.admin-section h2 {
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-subheading {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.mode-switch-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.5rem 0 0.35rem;
}

.mode-label {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 4.5rem;
  text-align: center;
}

.mode-label.active {
  color: var(--text);
  font-weight: 600;
}

.mode-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.mode-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.mode-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(59, 130, 246, 0.35);
  border: 1px solid var(--border);
  border-radius: 28px;
  transition: background 0.2s;
}

.mode-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.mode-switch input:checked + .mode-slider {
  background: rgba(245, 158, 11, 0.45);
}

.mode-switch input:checked + .mode-slider::before {
  transform: translateX(22px);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}

.checkbox-row input {
  accent-color: var(--muted);
}

.checkbox-row.hidden {
  display: none;
}

.video-age-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.video-age-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.video-age-select {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.55rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.video-age-select:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
}

.admin-form input:focus {
  outline: none;
  border-color: var(--muted);
}

.btn-admin {
  width: 100%;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  max-width: 520px;
  width: 90%;
  position: relative;
}

.signal-modal-content {
  max-width: 920px;
  width: 94%;
  padding: 1.25rem 1.35rem 1.35rem;
}

.signal-modal {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.signal-modal-media {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.signal-modal-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.signal-modal-chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.signal-modal-chart-caption {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0;
}

.signal-modal-chart {
  width: 100%;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.signal-modal-chart-empty {
  margin: 0;
  padding: 0.75rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

.signal-modal-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.signal-modal-title {
  font-size: 1.05rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  padding-right: 1.5rem;
}

.signal-modal-channel {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.signal-facts {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.signal-fact {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.signal-fact-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  margin-top: 0.45rem;
}

.signal-fact-dot--buy {
  background: #22c55e;
}

.signal-fact-dot--sell {
  background: #ef4444;
}

.signal-fact-dot--neutral {
  background: #94a3b8;
}

.signal-fact-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.signal-fact-headline {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.signal-fact-text {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.signal-fact-subtext {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0.45rem 0 0;
}

.signal-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.signal-modal-link {
  font-size: 0.8rem;
  color: var(--accent);
}

.signal-modal-reanalyze {
  margin-left: auto;
  font-size: 0.8rem;
  padding: 0.45rem 0.9rem;
}

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

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal h3 {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.modal .field {
  margin-bottom: 0.75rem;
}

.modal .label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.modal .value {
  font-size: 0.9rem;
  line-height: 1.5;
}

.modal a {
  color: var(--accent);
}

.picker-content h3 {
  margin-bottom: 0.35rem;
  padding-right: 1.5rem;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

.picker-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s;
}

.picker-item:hover {
  border-color: var(--accent);
}

.picker-title {
  font-size: 0.85rem;
  line-height: 1.3;
}

.picker-channel {
  font-size: 0.75rem;
  color: var(--muted);
}

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 20, 25, 0.97);
  border-top: 1px solid var(--border);
  padding: 0.55rem 1.25rem 0.65rem;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.status-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.status-top {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.status-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  margin-top: 0.1rem;
}

.status-badge--idle {
  background: rgba(100, 116, 139, 0.25);
  color: #94a3b8;
}

.status-badge--scanning {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.status-badge--processing {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.status-badge--pausing {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.status-badge--error {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.status-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.status-line-primary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}

.status-step {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-line-detail {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-progress-pct {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 2.5rem;
  text-align: right;
  margin-top: 0.1rem;
}

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #60a5fa);
  border-radius: 3px;
  transition: width 0.4s ease;
}

body {
  padding-bottom: 72px;
}

@media (max-width: 600px) {
  .status-line-primary {
    flex-direction: column;
    gap: 0.1rem;
  }

  .status-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .status-line-detail {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

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

.accuracy-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.accuracy-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.accuracy-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.accuracy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.accuracy-card h3 {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.accuracy-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.35rem;
}

.accuracy-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.accuracy-card-window {
  margin-top: 0.25rem;
  font-size: 0.68rem;
}

.period-cell {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.accuracy-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.accuracy-section h2 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.accuracy-filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
}

.accuracy-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.accuracy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.accuracy-table th,
.accuracy-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.accuracy-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.accuracy-table .channel-name {
  font-weight: 500;
  max-width: 14rem;
}

.accuracy-table .video-title-cell a {
  color: var(--text);
  text-decoration: none;
}

.accuracy-table .video-title-cell a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.accuracy-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.accuracy-good {
  color: var(--buy);
  font-weight: 700;
}

.accuracy-mid {
  color: #eab308;
  font-weight: 700;
}

.accuracy-bad {
  color: var(--sell);
  font-weight: 700;
}

.result-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.result-correct {
  color: var(--buy);
  background: rgba(34, 197, 94, 0.15);
}

.result-wrong {
  color: var(--sell);
  background: rgba(239, 68, 68, 0.15);
}

.result-flat {
  color: var(--neutral);
  background: rgba(148, 163, 184, 0.12);
}

.result-pending {
  color: var(--muted);
  background: rgba(139, 156, 179, 0.1);
}

.accuracy-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.accuracy-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
  flex-wrap: wrap;
}

.podium-card {
  flex: 1;
  min-width: 9rem;
  max-width: 14rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  text-align: center;
}

.podium-first {
  order: 2;
  border-color: #eab308;
  box-shadow: 0 0 0 1px rgba(234, 179, 8, 0.25);
  transform: translateY(-0.35rem);
}

.podium-second {
  order: 1;
}

.podium-third {
  order: 3;
}

.podium-rank {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.podium-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 2.4rem;
}

.podium-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--buy);
  margin-top: 0.35rem;
}

.podium-meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.accuracy-ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

.ranking-item {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.ranking-place {
  grid-row: 1 / span 2;
  font-weight: 700;
  font-size: 0.9rem;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  font-weight: 700;
  font-size: 0.82rem;
}

.rank-badge.rank-1,
.rank-badge.rank-2,
.rank-badge.rank-3 {
  font-size: 1rem;
}

.ranking-name {
  font-weight: 500;
  font-size: 0.85rem;
}

.ranking-pct {
  font-weight: 700;
  font-size: 0.9rem;
  text-align: right;
}

.ranking-pct.accuracy-good {
  color: var(--buy);
}

.ranking-pct.accuracy-mid {
  color: #eab308;
}

.ranking-pct.accuracy-bad {
  color: var(--sell);
}

.ranking-meta {
  grid-column: 2 / span 2;
  font-size: 0.72rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.header-actions-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.header-center {
  flex: 1;
  min-width: 12rem;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  white-space: nowrap;
  cursor: pointer;
}

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

.btn-header--ghost {
  font-family: inherit;
}

.header-user {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-mini-heading {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.35rem;
}

.admin-user-block {
  margin-bottom: 0.5rem;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-remove-user {
  flex-shrink: 0;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 24rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.login-form label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.login-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.55rem 0.65rem;
}

.login-error {
  color: var(--sell);
  font-size: 0.85rem;
}

.login-hint {
  margin-top: 1rem;
  text-align: center;
}

.admin-form textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.55rem 0.65rem;
  font-family: inherit;
  resize: vertical;
  min-height: 4.5rem;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 4.5rem;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.cookie-banner-text {
  flex: 1;
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 12rem;
}

.ad-popup-content {
  max-width: 28rem;
}

.ad-popup-image {
  display: block;
  width: 100%;
  max-height: 12rem;
  object-fit: cover;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.ad-popup-message {
  margin: 0.75rem 0;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ad-popup-link {
  display: inline-flex;
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .cookie-banner {
    left: 0.65rem;
    right: 0.65rem;
    bottom: 5rem;
  }
}

.settings-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 2rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-main--mobile {
  max-width: none;
  padding: 0.75rem 1rem 2rem;
}

.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.settings-card h2 {
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.settings-card .admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-card .btn-admin {
  margin-top: 0.5rem;
  width: 100%;
}
