/* Matches Analysis — right-hand workspace panel.
   House-gold identity per the design system: warm surfaces with a lit top
   edge, warm hairlines only (no cold white borders), green strictly for live
   semantics, tabular numerals on every figure, no emoji. */

.ma-workspace { display: none; flex-direction: column; gap: 9px; }

.ma-card {
  background: linear-gradient(160deg, rgba(28, 22, 11, .85), rgba(13, 10, 5, .94));
  border: 1px solid rgba(226, 182, 104, .22);
  border-radius: 16px;
  padding: 14px 15px;
  box-shadow: inset 0 1px 0 rgba(255, 226, 168, .06), 0 10px 26px rgba(0, 0, 0, .34);
}

/* ── header ─────────────────────────────────────────────────────────────── */
.ma-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ma-head-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ma-logo {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #f9c750, #b8862a);
  color: #1a1204; font-size: 19px; font-weight: 900;
  box-shadow: 0 0 16px rgba(226, 166, 58, .3);
}
.ma-title { font-size: 15px; font-weight: 800; color: #ffe9b0; letter-spacing: .01em; }
.ma-sub   { font-size: 10px; color: rgba(208, 180, 136, .72); margin-top: 2px; }
.ma-state {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  background: rgba(120, 100, 65, .18); border: 1px solid rgba(140, 115, 70, .3);
  color: rgba(200, 175, 130, .72);
  font-variant-numeric: tabular-nums;
}
.ma-state.live {
  background: rgba(16, 185, 129, .16); border-color: rgba(16, 185, 129, .4);
  color: #4ade80;
}
.ma-state.scanning {
  background: rgba(226, 166, 58, .14); border-color: rgba(226, 166, 58, .38);
  color: #f0c674; animation: ma-scan-pulse 1.8s ease-in-out infinite;
}
@keyframes ma-scan-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .ma-state.scanning { animation: none; } }

/* ── best line ──────────────────────────────────────────────────────────── */
.ma-bestcard {
  font-size: 11.5px; font-weight: 700; color: #ffe9b0; text-align: center;
  border-color: rgba(249, 199, 80, .4); line-height: 1.5;
}

/* ── titles / chips / hints ─────────────────────────────────────────────── */
.ma-card-title { font-size: 12.5px; font-weight: 800; color: #f0c75e; margin-bottom: 10px; }
.ma-chip {
  margin-left: 8px; padding: 2px 8px; border-radius: 999px; font-size: 9px;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(120, 100, 65, .18); border: 1px solid rgba(140, 115, 70, .3);
  color: rgba(200, 175, 130, .72); vertical-align: middle;
}
.ma-chip.on {
  background: rgba(226, 166, 58, .16); border-color: rgba(226, 166, 58, .4);
  color: #f9c750;
}
.ma-hint { font-size: 10px; color: rgba(208, 180, 136, .62); line-height: 1.55; margin-top: 8px; }
.ma-empty { text-align: center; padding: 18px 10px; font-size: 10.5px; color: rgba(208, 180, 136, .5); }

/* ── scanner ranks ──────────────────────────────────────────────────────── */
.ma-ranks { display: flex; flex-direction: column; gap: 6px; }
.ma-rank {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px;
  border-radius: 10px; cursor: pointer;
  background: rgba(24, 19, 9, .6); border: 1px solid rgba(226, 182, 104, .14);
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
  font-variant-numeric: tabular-nums;
}
.ma-rank:hover { border-color: rgba(226, 166, 58, .45); transform: translateY(-1px); }
.ma-rank.sel {
  border-color: rgba(249, 199, 80, .65);
  background: linear-gradient(150deg, rgba(226, 166, 58, .14), rgba(150, 104, 26, .08));
}
.ma-rank-no { font-size: 10px; font-weight: 800; color: rgba(208, 180, 136, .5); width: 14px; }
.ma-rank.sel .ma-rank-no, .ma-rank:first-child .ma-rank-no { color: #f9c750; }
.ma-rank-name {
  flex: 1; min-width: 0; font-size: 11.5px; font-weight: 600; color: #fdf4e2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ma-rank-digit {
  font-size: 9px; font-weight: 800; letter-spacing: .04em; padding: 2px 7px;
  border-radius: 6px; background: rgba(226, 166, 58, .16);
  border: 1px solid rgba(226, 166, 58, .38); color: #f9c750; white-space: nowrap;
}
.ma-rank-pct { font-size: 12px; font-weight: 800; color: #ffe9b0; }
.ma-rank-n { font-size: 9.5px; color: rgba(208, 180, 136, .6); white-space: nowrap; }

/* ── heatmap ────────────────────────────────────────────────────────────── */
.ma-heatmap { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.ma-cell {
  aspect-ratio: 1 / 1; min-height: 46px; border-radius: 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-family: inherit;
  background: rgba(24, 19, 9, .65); border: 1px solid rgba(226, 182, 104, .14);
  transition: border-color .15s ease, transform .12s ease;
  font-variant-numeric: tabular-nums;
}
.ma-cell b { font-size: 15px; font-weight: 800; color: rgba(238, 226, 200, .85); }
.ma-cell i { font-style: normal; font-size: 8.5px; color: rgba(208, 180, 136, .6); }
.ma-cell:hover { border-color: rgba(226, 166, 58, .5); }
.ma-cell.warm b { color: #f0c674; }
.ma-cell.hot { border-color: rgba(249, 199, 80, .5); background: rgba(226, 166, 58, .12); }
.ma-cell.hot b { color: #f9c750; }
.ma-cell.hot i { color: rgba(249, 199, 80, .8); }
.ma-cell.cold b { color: rgba(180, 165, 140, .5); }
.ma-cell.sel {
  border-color: transparent;
  background: linear-gradient(150deg, #e0aa3c, #b8862a);
  box-shadow: 0 0 16px rgba(226, 166, 58, .34);
}
.ma-cell.sel b, .ma-cell.sel i { color: #1a1204; }

/* ── pattern + risk reads ───────────────────────────────────────────────── */
.ma-patterns { margin-top: 10px; }
.ma-pat {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-bottom: 1px solid rgba(226, 182, 104, .1);
  font-size: 11px; color: rgba(224, 205, 170, .85);
  font-variant-numeric: tabular-nums;
}
.ma-pat:last-of-type { border-bottom: 0; }
.ma-pat b { font-weight: 800; color: #fdf4e2; white-space: nowrap; }
.ma-pat b i, .ma-pat i { font-style: normal; font-size: 9.5px; color: rgba(208, 180, 136, .6); }

/* ── settings ───────────────────────────────────────────────────────────── */
.ma-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.ma-f > span {
  display: block; font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(208, 180, 136, .68); font-weight: 700; margin-bottom: 5px;
}
.ma-input {
  width: 100%; box-sizing: border-box; padding: 9px 11px; border-radius: 10px;
  background: rgba(15, 12, 6, .78); border: 1px solid rgba(226, 182, 104, .2);
  color: #fdf4e2; font-size: 13px; font-weight: 600; font-family: inherit;
  font-variant-numeric: tabular-nums;
}
.ma-input:focus { outline: none; border-color: rgba(249, 199, 80, .6); }
.ma-check {
  display: flex; align-items: flex-start; gap: 9px; font-size: 10.5px;
  color: rgba(224, 205, 170, .85); cursor: pointer; line-height: 1.5;
}
.ma-check input { accent-color: #e2a63a; width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }
.ma-check b { color: #ffe9b0; }

.ma-autocfg {
  width: 100%; padding: 11px 12px; border-radius: 10px; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 800; letter-spacing: .01em;
  color: #1a1204; border: 1px solid rgba(249, 199, 80, .55);
  background: linear-gradient(150deg, #f5cf6b, #d9a53c);
  margin-bottom: 8px;
}
.ma-autocfg:hover { filter: brightness(1.06); }
.ma-logo svg { display: block; }
.strategy-mark-ma { display: flex; align-items: center; justify-content: center; color: #1a1204; }
.strategy-mark-ma svg { width: 20px; height: 20px; }

/* ── session tiles / stats ──────────────────────────────────────────────── */
.ma-tiles, .ma-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ma-stats { grid-template-columns: repeat(4, 1fr); }
.ma-tile {
  background: rgba(24, 19, 9, .6); border: 1px solid rgba(226, 182, 104, .14);
  border-radius: 10px; padding: 8px 10px; min-width: 0;
}
.ma-tile span {
  display: block; font-size: 8.5px; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(208, 180, 136, .6); font-weight: 700; margin-bottom: 3px;
}
.ma-tile b {
  font-size: 13px; font-weight: 800; color: #fdf4e2; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ma-tile b i { font-style: normal; font-size: 9px; color: rgba(208, 180, 136, .6); }
.ma-tile b.up { color: #4ade80; }
.ma-tile b.dn { color: #f87171; }
.ma-tiles { margin-top: 4px; }
.ma-activity { font-size: 11px; color: #f0c674; margin-bottom: 8px; }
.ma-err { font-size: 10.5px; color: #fca5a5; margin-bottom: 8px; line-height: 1.45; }

/* ── finished banners ───────────────────────────────────────────────────── */
.ma-finished { display: flex; flex-direction: column; gap: 9px; }
.ma-finished:empty { display: none; }
.ma-done { display: flex; align-items: center; gap: 12px; }
.ma-done-mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 900;
}
.ma-done.ok  { border-color: rgba(74, 222, 128, .4); }
.ma-done.ok .ma-done-mark  { background: rgba(16, 185, 129, .16); color: #4ade80; }
.ma-done.bad { border-color: rgba(248, 113, 113, .4); }
.ma-done.bad .ma-done-mark { background: rgba(239, 68, 68, .14); color: #f87171; }
.ma-done-body { flex: 1; min-width: 0; }
.ma-done-head { font-size: 11px; font-weight: 800; letter-spacing: .05em; color: #fdf4e2; }
.ma-done-pl   { font-size: 14px; font-weight: 800; margin-top: 1px; font-variant-numeric: tabular-nums; }
.ma-done.ok .ma-done-pl  { color: #4ade80; }
.ma-done.bad .ma-done-pl { color: #f87171; }
.ma-done-sub  { font-size: 9px; color: rgba(208, 180, 136, .6); margin-top: 2px; }
.ma-dismiss {
  background: none; border: 1px solid rgba(226, 182, 104, .28); border-radius: 8px;
  color: rgba(224, 205, 170, .8); font-size: 10px; font-weight: 700;
  padding: 6px 10px; cursor: pointer; font-family: inherit;
}
.ma-dismiss:hover { border-color: rgba(249, 199, 80, .55); color: #f9c750; }

/* ── run bar ────────────────────────────────────────────────────────────── */
.ma-runbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ma-exec, .ma-run {
  padding: 14px 10px; border-radius: 12px; border: none; cursor: pointer;
  font-size: 13px; font-weight: 800; font-family: inherit; letter-spacing: .01em;
}
.ma-exec {
  background: rgba(24, 19, 9, .7); color: #f9c750;
  border: 1px solid rgba(226, 166, 58, .45);
}
.ma-exec:hover:not(:disabled) { border-color: rgba(249, 199, 80, .7); }
.ma-run {
  background: linear-gradient(150deg, #f5cf6b, #c8892a); color: #1a1204;
  box-shadow: 0 4px 18px rgba(226, 166, 58, .3);
}
.ma-run.stop { background: linear-gradient(150deg, #f87171, #dc2626); color: #fff; }
.ma-exec:disabled, .ma-run:disabled { opacity: .45; cursor: not-allowed; }
.ma-note { font-size: 10.5px; color: rgba(208, 180, 136, .72); line-height: 1.5; min-height: 16px; }
.ma-note.err { color: #fca5a5; font-weight: 600; }

/* ── history ────────────────────────────────────────────────────────────── */
.ma-hist-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px; font-weight: 800; color: #f0c75e; margin-bottom: 9px;
}
.ma-clear {
  background: none; border: 1px solid rgba(226, 182, 104, .28); border-radius: 8px;
  color: rgba(224, 205, 170, .8); font-size: 10px; font-weight: 700;
  padding: 5px 10px; cursor: pointer; font-family: inherit;
}
.ma-clear:hover { border-color: rgba(249, 199, 80, .55); color: #f9c750; }
.ma-hist { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; }
.ma-row {
  display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px;
  align-items: center; padding: 7px 10px; border-radius: 8px; font-size: 11px;
  background: rgba(24, 19, 9, .55); border-left: 3px solid rgba(226, 182, 104, .3);
  font-variant-numeric: tabular-nums;
}
.ma-row.win  { border-left-color: #4ade80; }
.ma-row.loss { border-left-color: #f87171; }
.ma-row.open { border-left-color: #e2a63a; }
.ma-row-l { font-weight: 800; color: #ffe9b0; white-space: nowrap; }
.ma-row-m { color: rgba(208, 180, 136, .65); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-row-s { color: rgba(224, 205, 170, .78); }
.ma-row-p { font-weight: 800; text-align: right; }
.ma-row.win  .ma-row-p { color: #4ade80; }
.ma-row.loss .ma-row-p { color: #f87171; }
.ma-row.open .ma-row-p { color: #e2a63a; }

/* ── honesty footer ─────────────────────────────────────────────────────── */
.ma-honesty {
  font-size: 9.5px; color: rgba(208, 180, 136, .55); line-height: 1.55;
  text-align: center; padding: 2px 8px 6px;
}

@media (max-width: 560px) {
  .ma-stats { grid-template-columns: repeat(2, 1fr); }
  .ma-runbar { grid-template-columns: 1fr; }
}
