/* =====================================================================
 * Setscope Market Map — styles
 * ===================================================================== */
.mm-wrap {
  --mm-bg:      #0c0f15;
  --mm-panel:   #161b24;
  --mm-border:  #232a36;
  --mm-text:    #e7ebf2;
  --mm-muted:   #8b94a6;
  font-family: 'Inter', 'Kanit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--mm-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  border: 1px solid var(--mm-border);
  color: var(--mm-text);
  user-select: none;
}

/* ---- top toolbar ---- */
.mm-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #141923 0%, #11151d 100%);
  border-bottom: 1px solid var(--mm-border);
  flex-wrap: wrap;
}
.mm-bar h2.mm-title {
  font-size: 16px;
  font-weight: 800;
  margin: 0;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.mm-bar .mm-sub {
  font-size: 11px;
  color: var(--mm-muted);
  font-weight: 500;
  margin-top: 1px;
}
.mm-spacer { flex: 1 1 auto; }

/* segmented period toggle */
.mm-seg {
  display: inline-flex;
  background: #0c1016;
  border: 1px solid var(--mm-border);
  border-radius: 9px;
  padding: 3px;
}
.mm-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--mm-muted);
  font: 700 12px/1 'Inter', sans-serif;
  padding: 7px 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.mm-seg button:hover { color: #cfd6e2; }
.mm-seg button.is-active {
  background: linear-gradient(180deg, #2a85ff, #1e6fe0);
  color: #fff;
  box-shadow: 0 2px 8px rgba(42,133,255,.35);
}

/* search */
.mm-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0c1016;
  border: 1px solid var(--mm-border);
  border-radius: 9px;
  padding: 0 10px;
  height: 34px;
}
.mm-search i { color: var(--mm-muted); font-size: 14px; }
.mm-search input {
  appearance: none;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--mm-text);
  font: 600 12px 'Inter', sans-serif;
  width: 110px;
}
.mm-search input::placeholder { color: #5c6678; }

/* legend */
.mm-legend {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 10px;
  font-weight: 700;
  color: #cfd6e2;
}
.mm-legend .mm-leg-cell {
  width: 30px;
  text-align: center;
  padding: 5px 0;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
}
.mm-legend .mm-leg-cell:first-child { border-radius: 5px 0 0 5px; }
.mm-legend .mm-leg-cell:last-child  { border-radius: 0 5px 5px 0; }

.mm-iconbtn {
  appearance: none;
  background: #0c1016;
  border: 1px solid var(--mm-border);
  color: var(--mm-muted);
  width: 34px; height: 34px;
  border-radius: 9px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: color .15s, background .15s;
}
.mm-iconbtn:hover { color: #fff; background: #161c26; }

/* ---- canvas stage ---- */
.mm-stage {
  position: relative;
  width: 100%;
  height: 76vh;
  min-height: 420px;
  background: #11151c;
}
.mm-canvas { display: block; width: 100%; height: 100%; }

/* fullscreen */
.mm-wrap.is-fullscreen {
  position: fixed; inset: 0;
  z-index: 99999;
  border-radius: 0;
  border: 0;
}
.mm-wrap.is-fullscreen .mm-stage { height: calc(100vh - 56px); }

/* ---- tooltip ---- */
.mm-tooltip {
  position: fixed;
  z-index: 100002;
  display: none;
  pointer-events: none;
  background: rgba(14,18,25,.97);
  border: 1px solid #2b3340;
  border-radius: 10px;
  padding: 9px 11px;
  min-width: 150px;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}
.mm-tip-tk { font-size: 14px; font-weight: 800; color: #fff; display:flex; align-items:center; gap:6px; }
.mm-tip-cap { font-size: 10px; font-weight: 700; color: #8b94a6; background:#1b2230; padding:2px 6px; border-radius:5px; }
.mm-tip-nm { font-size: 11px; color: #aab2c2; margin: 2px 0 6px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-tip-row { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; font-weight: 700; color:#e7ebf2; }

.mm-pos { color: #4ade80 !important; }
.mm-neg { color: #f87171 !important; }

/* ---- sector overlay ---- */
.mm-overlay {
  position: fixed;
  z-index: 100001;
  display: none;
  width: 340px;
  background: rgba(16,20,28,.98);
  border: 1px solid #2b3340;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.mm-ov-head { padding: 11px 13px 9px; border-bottom: 1px solid #232a36; }
.mm-ov-crumb { font-size: 10px; font-weight: 700; color: #6f7a8c; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 1px; }
.mm-ov-title { font-size: 15px; font-weight: 800; color: #fff; letter-spacing: -.2px; }
.mm-ov-sub { font-size: 11px; color: #8b94a6; font-weight: 600; margin-top: 2px; }
.mm-ov-canvas { display:block; width: 100%; height: 190px; background:#11151c; }
.mm-ov-list { max-height: 230px; overflow-y: auto; }
.mm-ov-list::-webkit-scrollbar { width: 8px; }
.mm-ov-list::-webkit-scrollbar-thumb { background:#2b3340; border-radius: 4px; }
.mm-ov-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  text-decoration: none;
  border-top: 1px solid #1a2029;
}
.mm-ov-row:hover { background: #1a212c; text-decoration: none; }
.mm-ov-tk { font-size: 12px; font-weight: 800; color: #e7ebf2; }
.mm-ov-nm { font-size: 11px; color: #8b94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-ov-pr { font-size: 12px; font-weight: 600; color: #aeb6c4; }
.mm-ov-pc {
  font-size: 11px; font-weight: 800; color: #fff;
  padding: 3px 7px; border-radius: 6px; min-width: 56px; text-align: right;
  text-shadow: 0 1px 1px rgba(0,0,0,.35);
}

/* mobile */
@media (max-width: 640px) {
  .mm-bar { gap: 8px; padding: 9px 10px; }
  .mm-bar h2.mm-title { font-size: 14px; }
  .mm-search { display: none; }
  .mm-legend .mm-leg-cell { width: 20px; font-size: 9px; }
  .mm-stage { height: 72vh; }
  .mm-overlay { width: 280px; }
}
