:root {
  --background: #050b14;
  --background-secondary: #07111f;
  --sidebar: #050d19;
  --card: rgba(15, 23, 42, 0.78);
  --card-hover: rgba(20, 31, 52, 0.92);
  --border: rgba(148, 163, 184, 0.13);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --positive: #22c55e;
  --negative: #ef4444;
  --neutral: #94a3b8;
  --primary: #6366f1;
  --telegram: #229ed9;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  min-height: 100vh;
  background:
    radial-gradient(circle at 42% 0%, rgba(34, 158, 217, 0.13), transparent 32rem),
    linear-gradient(180deg, var(--background), #06101d 52%, #050b14);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

img,
svg,
canvas,
table,
.interactive-chart,
.volume-chart,
.indicator-chart {
  max-width: 100%;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--text-primary);
  min-height: 40px;
  padding: 0 14px;
  font-weight: 800;
}

input, select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.52);
  color: var(--text-primary);
  min-height: 40px;
  padding: 0 12px;
}

select { color: var(--text-secondary); }

main {
  width: min(1600px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding-bottom: 30px;
}

#home, #heatmap, #watchlist, #reports, #consensus, #telegram, #premium { scroll-margin-top: 24px; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 248px;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(5, 13, 25, 0.98), rgba(3, 8, 17, 0.98));
  padding: 22px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  font-size: 20px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease;
}

.side-link span {
  display: grid;
  width: 22px;
  place-items: center;
  color: #c4b5fd;
}

.side-link:hover, .side-link.active {
  background: rgba(99, 102, 241, 0.16);
  color: var(--text-primary);
}

.sidebar-bottom {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.premium-mini, .account-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.68);
}

.premium-mini {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.premium-mini span, .account-card span, .header-kicker, .eyebrow {
  color: var(--text-secondary);
}

.premium-mini a {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #4f46e5, #6d28d9);
  font-weight: 900;
}

.account-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 12px;
}

.account-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-card a, .account-card span { font-size: 12px; }
.account-card a { color: #c4b5fd; font-weight: 800; }

.avatar, .profile-pill {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.18);
  color: #dbeafe;
  font-weight: 900;
}

.avatar { width: 38px; height: 38px; }
.profile-pill { width: 42px; height: 42px; }

.mobile-topbar { display: none; }
.mobile-menu { position: relative; }
.mobile-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text-primary);
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu nav {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  display: grid;
  width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1423;
  box-shadow: var(--shadow);
  padding: 8px;
}
.mobile-menu nav a {
  min-height: 40px;
  border-radius: 8px;
  color: var(--text-secondary);
  padding: 10px 12px;
  font-weight: 800;
}
.mobile-menu nav a:hover,
.mobile-menu nav a.active {
  background: rgba(99, 102, 241, 0.16);
  color: var(--text-primary);
}

.content-shell {
  min-width: 0;
  margin-left: 248px;
  padding: 20px 20px 0;
}

.dashboard-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  margin: -20px -20px 0;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  background: rgba(5, 11, 20, 0.82);
  backdrop-filter: blur(18px);
}

.dashboard-header > *,
.hero > *,
.card > *,
.panel > * {
  min-width: 0;
}

.dashboard-header h1 {
  margin: 2px 0 0;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.2;
}

.header-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.header-search {
  position: relative;
  min-width: 0;
  width: min(420px, 42vw);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr 44px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
}

.search-box input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  min-height: 42px;
}

.search-box input:focus { outline: none; }

.search-icon {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0;
  font-size: 22px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1423;
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  grid-template-columns: 76px 1fr 64px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 13px;
  color: var(--text-primary);
  font-size: 14px;
}

.search-result:hover, .search-result.active { background: rgba(99, 102, 241, 0.15); }
.search-result mark { background: transparent; color: #93c5fd; }
.result-code, .result-market, .search-hint, .search-empty { color: var(--text-secondary); }
.result-market { text-align: right; }
.search-hint, .search-empty { border-top: 1px solid var(--border); padding: 12px 14px; font-size: 13px; }

.market-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 0;
}

.market-status strong { color: var(--text-primary); font-size: 13px; }
.market-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 14px var(--positive); }

.icon-only {
  display: grid;
  width: 42px;
  min-width: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.54));
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero h2 {
  margin: 5px 0 7px;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.08;
}

.hero p { max-width: 680px; margin: 0; color: var(--text-secondary); font-size: 15px; line-height: 1.5; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }

.hero-actions, .market-map-actions, .feature-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button, .secondary-button, .outline-button, .telegram-button, .premium-button, .icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
  white-space: nowrap;
}

.primary-button, .premium-button {
  background: #f8fafc;
  color: #111827;
}

.secondary-button, .outline-button {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.64);
  color: var(--text-primary);
}

.secondary-button.compact { min-height: 38px; }

.icon-link {
  width: 38px;
  padding: 0;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.72);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 22px;
  align-items: start;
}

.main-column, .side-column, .stack {
  display: grid;
  min-width: 0;
  gap: 22px;
}

.dashboard-grid > * {
  min-width: 0;
}

.card, .panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, background 160ms ease;
  min-width: 0;
  overflow-wrap: anywhere;
}

.card p,
.panel p,
.stock-brief-card,
.compact-card,
.watch-summary-card,
.source,
.summary-list,
.news-preview,
.issue-list,
.relative-box,
.report-preview {
  overflow-wrap: anywhere;
}

.card:hover, .panel:hover {
  border-color: rgba(129, 140, 248, 0.25);
  background: var(--card-hover);
}

.card { padding: 22px; }
.compact-card { padding: 20px; }

.key-list {
  display: grid;
  gap: 9px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  line-height: 1.45;
}

.key-list li {
  position: relative;
  padding-left: 15px;
}

.key-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.issue-list small {
  margin-left: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.news-mini-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.news-mini-list li {
  color: var(--text-secondary);
}

.news-mini-list a {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-primary);
  font-weight: 800;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-mini-list span {
  display: block;
  margin-top: 2px;
}

button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.72;
}


.compact-card h2 {
  font-size: 18px;
}

.compact-card p,
.compact-card .empty-state {
  font-size: 14px;
}

.section-head, .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2, .panel h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

.section-head p { margin: 6px 0 0; color: var(--text-secondary); line-height: 1.5; }
.section-head.small { align-items: center; margin-bottom: 12px; }
.section-head.small h2 { font-size: 18px; }
.section-head a { color: #c4b5fd; font-weight: 800; }

.status-badge, .data-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 900;
}

.data-pill {
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-secondary);
}

.price-data-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  padding: 12px 14px;
  overflow-wrap: anywhere;
}

.price-data-notice span,
.price-data-notice small {
  color: var(--text-secondary);
  line-height: 1.45;
}

.price-data-notice.waiting {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(120, 53, 15, 0.18);
}

.price-data-notice.waiting strong {
  color: #fbbf24;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1fr) minmax(220px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.score-block span, .overview-stats span, .index-list span {
  color: var(--text-secondary);
  font-size: 13px;
}

.score-block strong {
  display: block;
  margin-top: 8px;
  color: var(--positive);
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1;
}

.score-block .pending-score {
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1.25;
}

.score-block em {
  color: var(--text-secondary);
  font-size: 24px;
  font-style: normal;
}

.score-block p { margin: 12px 0 0; color: var(--text-primary); line-height: 1.65; }

.real-overview {
  grid-template-columns: minmax(240px, 0.85fr) minmax(260px, 0.85fr) minmax(280px, 1fr);
}

.breadth-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  padding: 16px;
}

.breadth-bar {
  display: flex;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.breadth-bar span {
  display: block;
  min-width: 0;
}

.breadth-bar .rise { background: var(--positive); }
.breadth-bar .fall { background: var(--negative); }

.breadth-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
}

.breadth-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rise-dot,
.fall-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.rise-dot { background: var(--positive); }
.fall-dot { background: var(--negative); }

.score-basis {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.score-basis strong { font-size: 13px; }
.score-basis span { color: var(--text-secondary); font-size: 13px; line-height: 1.45; }

.score-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 900;
  list-style: none;
  cursor: pointer;
}

.score-details summary::-webkit-details-marker { display: none; }

.score-details summary:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.75);
  outline-offset: 2px;
}

.score-details div {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.score-details p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.market-extremes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.market-extremes a {
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.2);
  padding: 12px;
}

.market-extremes span {
  color: var(--text-secondary);
  font-size: 12px;
}

.market-extremes strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-extremes em {
  font-style: normal;
  font-weight: 900;
}

.market-mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  min-height: 170px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(2, 6, 23, 0.2));
  padding: 18px;
}

.market-mini-chart span {
  flex: 1;
  min-width: 8px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, #4ade80, rgba(34, 197, 94, 0.2));
}

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

.overview-stats div {
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  padding: 14px;
}

.overview-stats strong { font-size: 24px; }

.market-map {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}
.market-map-head { margin-bottom: 14px; }

.heatmap-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.26);
}

.segmented button,
.segmented a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  padding: 0 14px;
  font-weight: 800;
}

.segmented button:last-child,
.segmented a:last-child { border-right: 0; }
.segmented button.active,
.segmented a.active { background: rgba(99, 102, 241, 0.22); color: var(--text-primary); }

.heatmap-board {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: #07101c;
}

.heatmap-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 12px;
}

.heatmap-board-title span { color: var(--text-secondary); }

.heatmap-sections {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: clamp(620px, 66vh, 720px);
  min-height: 620px;
  overflow: hidden;
  background: #fff;
  touch-action: none;
  cursor: zoom-in;
}

.heatmap-sections.is-zoomed { cursor: grab; }
.heatmap-sections.is-dragging { cursor: grabbing; }

.heatmap-canvas {
  position: absolute;
  top: var(--heatmap-pan-y, 0px);
  left: var(--heatmap-pan-x, 0px);
  width: var(--heatmap-width, 100%);
  max-width: none;
  height: var(--heatmap-height, 100%);
  transition: top 160ms ease, left 160ms ease, width 160ms ease, height 160ms ease;
  will-change: top, left, width, height;
}

.heatmap-sections.is-dragging .heatmap-canvas { transition: none; }

.heatmap-sector {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--w);
  height: var(--h);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #fff;
  background: #fff;
}

.heatmap-sector header {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 18px;
  padding: 0 5px;
  overflow: hidden;
  background: rgba(245, 247, 250, 0.98);
  color: #111827;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-grid {
  position: absolute;
  inset: 18px 0 0;
  overflow: hidden;
}

.heatmap-tile {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  width: var(--w);
  height: var(--h);
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 0;
  padding: 4px;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  transition: filter 140ms ease;
}

.heatmap-tile:hover { filter: brightness(1.12); z-index: 3; }
.heatmap-tile.up.intensity-0 { background: #7f3f4d; }
.heatmap-tile.up.intensity-1 { background: #9f3f4f; }
.heatmap-tile.up.intensity-2 { background: #c43745; }
.heatmap-tile.up.intensity-3 { background: #f21f3c; }
.heatmap-tile.down.intensity-0 { background: #3c4658; }
.heatmap-tile.down.intensity-1 { background: #4166bb; }
.heatmap-tile.down.intensity-2 { background: #3b73e5; }
.heatmap-tile.down.intensity-3 { background: #2563eb; }
.heatmap-tile.flat, .heatmap-tile.flat.intensity-0 { background: #444b58; }

.heatmap-tile strong {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  font-size: var(--name-size, 14px);
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  word-break: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.heatmap-tile.label-compact strong { -webkit-line-clamp: 1; }
.heatmap-tile.label-compact .tile-rate, .heatmap-tile.label-hidden strong, .heatmap-tile.label-hidden .tile-rate { display: none; }
.heatmap-tile.label-compact.zoom-show-rate .tile-rate, .heatmap-tile.label-hidden.zoom-show-rate .tile-rate { display: block; font-size: 11px; }
.heatmap-tile.label-hidden { padding: 0; }
.heatmap-sections.is-zoomed .heatmap-tile { padding: 4px; }
.heatmap-tile.label-hidden.zoom-show-name strong { display: -webkit-box; font-size: 12px; line-height: 1.06; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tile-rate { font-size: var(--rate-size, 14px); font-weight: 900; line-height: 1.05; }

.heatmap-legend {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  padding: 12px 14px 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.heatmap-legend span { margin-right: 10px; }
.heatmap-legend i { min-width: 48px; padding: 7px 10px; color: #fff; font-style: normal; text-align: center; }
.legend-down-3 { background: #2563eb; }
.legend-down-2 { background: #3b73e5; }
.legend-down-1 { background: #4166bb; }
.legend-flat { background: #444b58; }
.legend-up-1 { background: #9f3f4f; }
.legend-up-2 { background: #c43745; }
.legend-up-3 { background: #f21f3c; }

.telegram-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 18px;
  border-color: rgba(34, 158, 217, 0.28);
  background: linear-gradient(135deg, rgba(8, 47, 73, 0.58), rgba(15, 23, 42, 0.78));
}

.telegram-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: rgba(34, 158, 217, 0.18);
  color: #7dd3fc;
  font-size: 26px;
}

.telegram-card h2 { margin: 4px 0 8px; }
.telegram-card p { margin: 0; color: var(--text-secondary); line-height: 1.55; }
.telegram-button { background: var(--telegram); color: #fff; box-shadow: 0 12px 28px rgba(34, 158, 217, 0.24); }
.telegram-section { margin-top: 22px; }

.settings-hero { margin-top: 16px; }
.settings-card h3 { margin: 0 0 8px; font-size: 22px; }
.settings-card p { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 22px;
  align-items: start;
}
.settings-actions,
.preference-form,
.settings-button-row {
  display: grid;
  gap: 12px;
}
.connection-summary {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  padding: 16px;
}
.connection-summary span { color: var(--text-secondary); }
.connection-summary strong { overflow-wrap: anywhere; }
.toggle-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.2);
  padding: 12px;
  font-weight: 800;
}
.toggle-row input { width: 18px; height: 18px; min-height: 18px; padding: 0; accent-color: var(--primary); }
.settings-button-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}
.settings-button-row form,
.settings-button-row button { width: 100%; }
.danger-button { color: #fecaca; }

.feature-tags { margin-top: 12px; }
.feature-tags span {
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.08);
  color: #bae6fd;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.ai-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-weight: 900;
}

.ai-label span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.22);
  color: #c4b5fd;
}

.one-line { margin: 14px 0 0; font-size: 16px; line-height: 1.65; }

.index-list { display: grid; gap: 14px; }
.index-list div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
}
.index-list em { grid-column: 2; font-style: normal; font-weight: 900; }

.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.up { color: var(--positive); }
.down { color: var(--negative); }

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

.sector-columns div { display: grid; gap: 10px; }
.sector-columns strong { color: var(--text-primary); }
.sector-columns span { color: var(--text-secondary); font-size: 13px; }

.detailed-sectors {
  grid-template-columns: 1fr;
}

.sector-line {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.18);
  padding: 10px;
}

.sector-line b {
  color: var(--text-primary);
  font-size: 14px;
}

.sector-line em {
  font-style: normal;
  font-weight: 900;
}

.sector-line small {
  color: var(--text-secondary);
  line-height: 1.35;
}

.report-preview > strong { display: block; margin-bottom: 4px; font-size: 17px; }
.report-preview > span, .report-preview p { color: var(--text-secondary); }
.report-preview p { line-height: 1.6; }

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

.factor-grid div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}

.factor-grid span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.full-section, .report-grid, .ai-opinion, .premium-banner { margin-top: 22px; }

.watchlist-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  width: 100%;
  max-width: 980px;
}

.stock-brief-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  padding: 16px;
}

.stock-card-head, .price-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stock-card-head div { display: grid; gap: 3px; }
.stock-card-head div,
.price-row > * {
  min-width: 0;
}
.stock-card-head strong { font-size: 18px; }
.stock-card-head span, .price-row span { color: var(--text-secondary); font-size: 13px; }
.stock-card-head em { font-style: normal; font-weight: 900; }
.price-row strong { font-size: 22px; }

.relative-box {
  display: grid;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.48);
  padding: 12px;
}

.relative-box span {
  color: var(--text-secondary);
  font-size: 13px;
}

.relative-box strong {
  font-size: 15px;
}

.issue-list { display: grid; gap: 7px; min-height: 100px; color: var(--text-secondary); line-height: 1.45; }
.issue-list b { color: var(--text-primary); }

.collection-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
}

.news-preview {
  display: grid;
  gap: 6px;
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.16);
  padding: 12px;
}

.news-preview b {
  color: var(--text-primary);
  font-size: 14px;
}

.news-preview span {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.watch-summary-card {
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  padding: 18px;
}

.watch-summary-card h3 {
  margin: 0;
  font-size: 18px;
}

.watch-summary-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-list span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  padding-bottom: 9px;
  font-size: 13px;
}

.summary-list span:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-list b {
  color: var(--text-primary);
  font-size: 13px;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
}

.card-actions > * {
  width: 100%;
  min-width: 0;
}

.card-actions form {
  display: grid;
}

.card-actions button {
  width: 100%;
}

.card-actions .outline-button {
  position: relative;
  z-index: 1;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 22px;
}

.report-empty-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
}

.report-ready-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  margin-top: 22px;
}

.report-ready-card h2 {
  margin: 4px 0 8px;
  font-size: 22px;
}

.report-ready-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.report-table {
  display: grid;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.report-row {
  display: grid;
  grid-template-columns: 42px 120px minmax(220px, 1fr) 96px 120px 64px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  padding: 0 14px;
  color: var(--text-secondary);
  min-width: min(100%, 780px);
}

.report-row:last-child { border-bottom: 0; }
.report-row:hover { background: rgba(99, 102, 241, 0.1); }
.report-row b, .report-row strong { color: var(--text-primary); }
.report-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-row em, .report-row i { font-style: normal; }
.report-row i { color: #c4b5fd; font-weight: 900; }

.donut-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}

.donut {
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--positive) 0 78%, #64748b 78% 92%, var(--negative) 92% 100%);
  position: relative;
}

.donut::after {
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #0b1423;
  content: "";
}

.donut span {
  position: relative;
  z-index: 1;
  font-size: 34px;
  font-weight: 900;
}

.consensus-metrics { display: grid; gap: 10px; color: var(--text-secondary); }
.consensus-metrics b { color: var(--text-primary); }

.ai-opinion {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.ai-opinion h2 { margin: 5px 0 8px; }
.ai-opinion p { margin: 0; color: var(--text-secondary); line-height: 1.65; }

.opinion-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.opinion-columns div {
  display: grid;
  gap: 8px;
  min-height: 150px;
  border-left: 1px solid var(--border);
  padding-left: 18px;
}

.opinion-columns span { color: var(--text-secondary); }
.opinion-columns b { color: var(--positive); font-size: 18px; }
.opinion-columns em { color: var(--positive); font-size: 32px; font-style: normal; font-weight: 900; }

.premium-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #312e81, #4338ca);
  padding: 24px;
}

.premium-banner h2 { margin: 0 0 8px; }
.premium-banner p { margin: 0; color: #c7d2fe; }

.empty-state, .empty {
  border: 1px dashed rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.18);
  color: var(--text-secondary);
  padding: 18px;
  line-height: 1.55;
}

.empty-state.small { padding: 14px; font-size: 13px; }

.flash {
  margin: 0 0 18px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  padding: 12px 14px;
}

.flash.success {
  border-color: rgba(34, 197, 94, 0.32);
  background: rgba(20, 83, 45, 0.22);
  color: #bbf7d0;
}

.close-mode-banner {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
}

.close-mode-banner h2,
.admin-health-head h2 {
  margin: 4px 0 8px;
}

.close-mode-banner p,
.admin-health-head p {
  margin: 0;
  color: var(--text-secondary);
}

.close-mode-banner > div > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

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

.source-time-grid span {
  display: grid;
  gap: 4px;
  min-width: 0;
  border-left: 2px solid rgba(99, 102, 241, 0.5);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
  padding: 8px 12px;
}

.source-time-grid b { color: var(--text-primary); }

.admin-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 12px 0 18px;
}

.health-grid,
.job-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.job-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.health-card,
.health-section {
  min-width: 0;
  padding: 20px;
}

.health-section { margin-bottom: 18px; }

.health-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 900;
}

.status-healthy { border-color: rgba(34, 197, 94, 0.32); }
.status-healthy.health-badge { color: #86efac; }
.status-waiting { border-color: rgba(250, 204, 21, 0.34); }
.status-waiting.health-badge { color: #fde047; }
.status-degraded { border-color: rgba(251, 146, 60, 0.38); }
.status-degraded.health-badge { color: #fdba74; }
.status-error { border-color: rgba(239, 68, 68, 0.38); }
.status-error.health-badge { color: #fca5a5; }
.status-not_configured.health-badge { color: var(--text-muted); }

.health-details,
.job-card dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.health-details div,
.job-card dl div {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(0, 1.35fr);
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.health-details div:last-child,
.job-card dl div:last-child { border-bottom: 0; }
.health-details dt,
.job-card dt { color: var(--text-secondary); }
.health-details dd,
.job-card dd { margin: 0; overflow-wrap: anywhere; text-align: right; }

.job-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.22);
  padding: 14px;
}

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

.job-card dl { margin-top: 10px; font-size: 13px; }
.job-card dl div { grid-template-columns: 90px minmax(0, 1fr); }

.provider-list { display: grid; gap: 10px; }
.provider-list div {
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}
.provider-list div:last-child { border-bottom: 0; }

/* Stock detail */
.stock-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0 18px;
}

.stock-head h1 {
  margin: 8px 0 6px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
}

.stock-head p, .notice, .row span, .watch span, .report-link span, .source span, .chart-head p, .chart-attribution {
  color: var(--text-secondary);
}

.back {
  color: #c4b5fd;
  font-weight: 900;
}

.actions-wrap { display: grid; justify-items: end; gap: 8px; }
.actions { display: flex; align-items: center; gap: 10px; }
.sync-message { margin: 0; color: #a7f3d0; font-size: 13px; font-weight: 800; }

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metrics div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 18px;
}

.metrics span { display: block; margin-bottom: 8px; color: var(--text-secondary); }
.metrics strong { font-size: 26px; }

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

.wide { grid-column: 1 / -1; }
.panel { padding: 20px; }
.panel h2 { margin: 0 0 16px; }

.table, .stack { display: grid; gap: 10px; }

.row, .watch, .report-link, .source {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.2);
  padding: 12px;
}

.row a, .source { display: grid; gap: 4px; flex: 1; }
.source-meta { color: #a7f3d0 !important; font-size: 12px; font-weight: 800; }

.chart-head { align-items: flex-start; }
.timeframe-switch {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.28);
}

.timeframe-switch button {
  min-width: 46px;
  height: 38px;
  border-right: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  box-shadow: none;
}

.timeframe-switch button:last-child { border-right: 0; }
.timeframe-switch button.active { background: rgba(99, 102, 241, 0.22); color: var(--text-primary); }

.indicator-menu { position: relative; display: flex; justify-content: flex-end; }
.indicator-button { min-width: 78px; border: 1px solid var(--border); background: rgba(15, 23, 42, 0.7); }

.indicator-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: min(340px, calc(100vw - 48px));
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0b1423;
  box-shadow: var(--shadow);
}

.indicator-panel-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: #0b1423;
  padding: 14px 16px;
}

.icon-close { width: 32px; height: 32px; min-height: 32px; padding: 0; font-size: 22px; }
.indicator-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0 16px;
  cursor: pointer;
}
.indicator-item input { width: 18px; height: 18px; padding: 0; accent-color: var(--primary); }
.indicator-item.active { font-weight: 900; }
.indicator-soon { background: rgba(2, 6, 23, 0.22); color: var(--text-secondary); padding: 14px 16px; font-size: 13px; line-height: 1.45; }

.interactive-chart, .volume-chart, .indicator-chart {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #07101c;
}

.interactive-chart { height: 430px; border-bottom: 0; border-radius: 8px 8px 0 0; }
.volume-chart { height: 150px; border-top: 0; border-radius: 0 0 8px 8px; }
.indicator-chart { height: 180px; margin-top: 8px; border-radius: 8px; }
.chart-attribution { margin: 10px 0 0; font-size: 12px; }

.briefing { margin-top: 18px; }
.summary { line-height: 1.7; font-size: 17px; }
.brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.brief-grid div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.2);
  padding: 14px;
}
.brief-grid h3 { margin: 0 0 8px; font-size: 15px; }
.brief-grid ul { margin: 0; padding-left: 18px; color: var(--text-secondary); line-height: 1.55; }

@media (max-width: 1350px) {
  .dashboard-header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .header-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .header-search {
    flex: 1 1 360px;
    width: min(100%, 520px);
  }
  .market-status {
    flex: 0 1 auto;
    max-width: 100%;
  }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .overview-stats { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .real-overview { grid-template-columns: 1fr 1fr; }
  .breadth-panel { grid-column: 1 / -1; }
  .market-extremes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-preview { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .close-mode-banner,
  .health-grid,
  .job-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-time-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar { display: none; }
  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 11, 20, 0.9);
    padding: 12px 16px;
    backdrop-filter: blur(18px);
  }
  .mobile-auth {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    color: #c4b5fd;
    font-weight: 900;
  }
  .content-shell { margin-left: 0; padding: 16px; }
  .dashboard-header {
    position: static;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
  }
  .header-actions { justify-content: flex-start; flex-wrap: wrap; }
  .header-search { width: min(100%, 520px); flex: 1 1 360px; }
  .market-status { flex: 1 1 auto; white-space: normal; border-radius: 8px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .overview-grid,
  .real-overview,
  .side-column,
  .sector-columns,
  .factor-grid,
  .donut-row,
  .overview-stats,
  .market-extremes,
  .card-actions,
  .report-grid,
  .ai-opinion,
  .watchlist-layout,
  .report-ready-card,
  .watch-grid,
  .opinion-columns,
  .brief-grid {
    grid-template-columns: 1fr;
  }
  .telegram-card { grid-template-columns: 58px 1fr; }
  .telegram-button { grid-column: 1 / -1; width: 100%; }
  .detail-grid, .metrics { grid-template-columns: 1fr; }
  .settings-grid,
  .settings-button-row { grid-template-columns: 1fr; }
  .report-table { border: 0; gap: 10px; background: transparent; }
  .report-row {
    grid-template-columns: 34px 1fr;
    align-items: start;
    min-width: 0;
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
  }
  .report-row span, .report-row em, .report-row time, .report-row i { grid-column: 2; white-space: normal; }
}

@media (max-width: 640px) {
  main { padding-bottom: 18px; }
  .content-shell { padding: 12px; }
  .card, .panel, .hero, .premium-banner { padding: 16px; }
  .dashboard-header { padding: 14px; }
  .header-actions { display: grid; grid-template-columns: 1fr; }
  .header-search { grid-column: 1 / -1; width: 100%; }
  .market-status { grid-column: 1 / -1; justify-content: space-between; width: 100%; }
  .profile-pill { display: none; }
  .section-head, .stock-head, .panel-head, .premium-banner, .market-map-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .hero-actions, .hero-actions a, .hero-actions button, .market-map-actions, .market-map-actions a, .market-map-actions button { width: 100%; }
  .heatmap-toolbar { align-items: stretch; flex-direction: column; }
  .segmented { width: 100%; }
  .segmented button, .segmented a { flex: 1; min-width: 0; padding: 0 8px; }
  .heatmap-sections { height: 470px; min-height: 430px; }
  .heatmap-legend { justify-content: flex-start; overflow-x: auto; }
  .telegram-card { grid-template-columns: 1fr; }
  .actions-wrap { justify-items: stretch; }
  .actions form, .actions button { width: 100%; }
  .primary-button, .secondary-button, .outline-button, .telegram-button, .premium-button { width: 100%; white-space: normal; }
  .interactive-chart { height: 360px; }
  .volume-chart { height: 130px; }
}

.watchlist-issues { margin-bottom: 24px; }

.issue-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.issue-card,
.issue-source { overflow-wrap: anywhere; }

.issue-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

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

.issue-card h4 {
  margin: 12px 0 8px;
  font-size: 1rem;
}

.issue-card p {
  color: var(--muted);
  line-height: 1.55;
}

.issue-card-head span,
.issue-meta span {
  color: var(--muted);
  font-size: .86rem;
}

.importance-5 { border-color: #ef4444; }
.importance-4 { border-color: #f59e0b; }

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .92rem;
}

.field-label select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

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