.mmd-panel {
  --mmd-share: #F59E0B;
  --mmd-remainder: #D3D1C7;
  --mmd-muted: #6b7280;
  --mmd-subtle: #9ca3af;
  --mmd-border: #e5e7eb;
  --mmd-cost: #94a3b8;
  --mmd-margin: #D4537E;
  --mmd-rate: #1D9E75;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  display: flex;
  gap: 24px;
  align-items: stretch;
  padding: 12px;
  border-bottom: 1px solid var(--mmd-border);
  background: rgb(249 250 251 / 50%);
  color: #374151;
  text-align: left;
  font-family: inherit;
}
.mmd-share {
  min-width: 120px;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-right: 1px solid var(--mmd-border);
}
.mmd-ring {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--mmd-share) var(--share), var(--mmd-remainder) 0);
}
.mmd-ring > div {
  width: 61px;
  height: 61px;
  border-radius: 50%;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.mmd-ring strong { font-size: 13px; line-height: 16px; font-weight: 700; }
.mmd-ring span { font-size: 9px; line-height: 11px; }
.mmd-slices { display: flex; flex-direction: column; gap: 3px; font-size: 9px; line-height: 1.4; }
.mmd-slices > span { display: flex; align-items: center; gap: 4px; }
.mmd-slices i, .mmd-chart-legend i { width: 8px; height: 8px; display: inline-block; flex: none; border-radius: 2px; }
.mmd-share small { white-space: nowrap; color: var(--mmd-subtle); font-size: 9px; line-height: 1.4; }
.mmd-main { flex: 1; min-width: 0; }
.mmd-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.mmd-stat {
  display: inline-flex;
  line-height: 1.4;
  font-size: 10px;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--mmd-border);
  background: white;
  border-radius: 8px;
  white-space: nowrap;
}
.mmd-stat > span, .mmd-chart-legend { color: var(--mmd-subtle); font-weight: 700; text-transform: uppercase; }
.mmd-stat strong { color: #374151; font-weight: 700; }
.mmd-stat .mmd-profit { color: #059669; }
.mmd-stat .mmd-loss { color: #dc2626; }
.mmd-chart-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 4px;
  font-size: 9px;
}
.mmd-chart-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.mmd-cost-key { background: var(--mmd-cost); }
.mmd-margin-key { background: var(--mmd-margin); }
.mmd-chart-legend .mmd-rate-key { width: 8px; height: 8px; border: 2px solid var(--mmd-rate); border-radius: 50%; background: #fff; }
.mmd-graph {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 33px;
  grid-template-rows: minmax(0,1fr) 16px;
  box-sizing: border-box;
  height: 120px;
  padding: 5px 4px 0;
  font-size: 9px;
  line-height: 1.2;
}
.mmd-y { position: relative; grid-row: 1; color: var(--mmd-subtle); font-variant-numeric: tabular-nums; }
.mmd-y > span { position: absolute; transform: translateY(-50%); white-space: nowrap; }
.mmd-y-money { grid-column: 1; }
.mmd-y-money > span { right: 6px; }
.mmd-y-rate { grid-column: 3; }
.mmd-y-rate > span { left: 6px; }
.mmd-plot { position: relative; grid-area: 1/2; min-width: 0; }
.mmd-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mmd-gridline { stroke: #e5e7eb; stroke-width: 1; stroke-dasharray: 3 3; }
.mmd-hits, .mmd-dates { display: grid; grid-template-columns: repeat(var(--mmd-count), minmax(0,1fr)); }
.mmd-hits { position: absolute; inset: 0; }
.mmd-hit { position: relative; outline-offset: -1px; }
.mmd-hit:is(:hover,:focus) { z-index: 4; background: rgb(156 163 175 / 18%); }
.mmd-tip {
  display: none;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 100%;
  min-width: max-content;
  padding: 7px 10px;
  border: 1px solid var(--mmd-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 12px rgb(0 0 0 / 8%);
  pointer-events: none;
  line-height: 1.6;
  text-align: left;
  font-size: 11px;
  font-weight: 500;
}
.mmd-tip b { color: #374151; }
.mmd-tip-rate { color: var(--mmd-rate); }
.mmd-tip-cost { color: #64748b; }
.mmd-tip-margin { color: var(--mmd-margin); }
.mmd-hit:is(:hover,:focus) .mmd-tip { display: flex; flex-direction: column; }
.mmd-left-tip .mmd-tip { left: auto; right: 100%; }
.mmd-dates { grid-area: 2/2; color: var(--mmd-subtle); padding-top: 4px; white-space: nowrap; text-align: center; }
.mmd-dates span { display: flex; justify-content: center; }
@media (max-width: 900px) {
  .mmd-dates > span:nth-child(4n+3):not(:last-child) { visibility: hidden; }
}
@media (max-width: 600px) {
  .mmd-panel { flex-direction: column; gap: 12px; }
  .mmd-share { flex-direction: row; flex-wrap: wrap; justify-content: flex-start; padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--mmd-border); }
  .mmd-dates > span:not(:nth-child(8n+1)):not(:last-child) { visibility: hidden; }
  .mmd-graph { grid-template-columns: 40px minmax(0,1fr) 28px; }
}
.mmd-panel-ml { --mmd-share: #378add; }
.mmd-spend { border-top: 1px solid var(--mmd-border); padding-top: 6px; width: 100%; text-align: center; }
.mmd-spend span { display: block; color: var(--mmd-subtle); font-size: 9px; line-height: 1.4; }
.mmd-spend strong { font-size: 13px; line-height: 1.4; font-weight: 700; }
.mmd-stat.mmd-ad-stat { background: #eff6ff; border-color: #dbeafe; }
.mmd-ad-stat span { color: #3b82f6; }
.mmd-ad-stat strong { color: #2563eb; }
.mmd-ring-empty { background: var(--mmd-remainder); }
.mmd-ring-empty strong, .mmd-ring-empty span { color: var(--mmd-subtle); }
