/* /compare -- the 2x2 grid page. Chrome (topbar, run-menu styling, controls,
   ribbon, dialogs) comes from app.css; only the grid and its panels live
   here. Colours are tokens.css vars only. */

.cwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }

#pageMsg {
  margin: 6px 10px 0;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.cgrid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  padding: 8px 10px;
}

.cpanel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cpanel-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.cbtn {
  border: 1px solid transparent;
  background: none;
  border-radius: 7px;
  padding: 2px 7px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  cursor: pointer;
  /* 100% of the wrap, never a bare percentage of a shrink-wrapped parent:
     40% here resolved against .cmenu-wrap, whose own width comes from this
     very button -- the cycle collapsed every label to a couple of
     characters. The wrap is the flex item that shrinks; the button just
     clips to it. */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cbtn:hover { border-color: var(--line); }
.cbtn.mono { font-size: 12px; color: var(--muted); }

.cmenu-wrap { position: relative; min-width: 0; }
/* The product name is the long label; when a row does get tight, it yields
   before the run and hour labels do. */
.cpanel-head .cmenu-wrap:first-child { flex-shrink: 3; }
.cmenu {
  left: 0;
  right: auto;
  top: calc(100% + 4px);
  max-height: 55dvh;
  overflow: auto;
  min-width: 220px;
  z-index: 20;
}
.cmenu-search { margin: 4px 6px 6px; width: calc(100% - 12px); }

.cchip { margin-left: auto; font-size: 12px; color: var(--muted); flex: none; }

.cstage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--map-bg);
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
.cstage img { max-width: 100%; max-height: 100%; display: block; }
.cstage img.dim { opacity: 0.25; }

.ccover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  text-align: center;
}
.ccover[hidden] { display: none; }
.cmsg { font-size: 13.5px; color: var(--muted); }

/* The compact in-panel paywall: app.css's .paywall look, shrunk to fit a
   quarter-screen stage. */
.cpaywall { position: static; max-width: 300px; padding: 16px 18px; }
.cpaywall h3 { font-size: 15px; }
.cpaywall p { font-size: 13px; margin-bottom: 10px; }

@media (max-width: 820px) {
  .cgrid { grid-template-columns: 1fr; grid-template-rows: none; overflow: auto; }
  .cpanel { min-height: 45dvh; }
  /* Sheet-look for the dropdowns on phones (spec: mobile menus behave like
     /models' bottom sheet). */
  .cmenu {
    position: fixed;
    left: 8px; right: 8px; bottom: 8px; top: auto;
    max-height: 60dvh;
    z-index: 30;
  }
}
