/*
 * Device & Browser Info — page-specific styles.
 *
 * The design system (tokens, page chrome, buttons, badges, FAQ, toast, print)
 * lives in /tools/tools.css, which every Launch Check tool loads first. Only
 * layout unique to this page belongs here: the device summary, the field grid
 * and the capability matrix.
 */

/* --------------------------------------------------------------- summary */

.summary {
  margin-top: 28px;
  border: 1px solid var(--ink-600);
  border-radius: var(--radius-card);
  /* Flat, like every other card. The gradient here was the only one on the
     site and read as a different component. */
  background: var(--ink-800);
  overflow: hidden;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-bottom: 1px solid var(--ink-700);
  background: var(--ink-850);
}
.summary-head h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fog-500);
}

/*
 * Explicit column counts rather than auto-fit.
 *
 * There are exactly eight cells, so a fixed 1 / 2 / 4 progression divides them
 * evenly at every size and never leaves an orphan on a half-empty final row —
 * which is what auto-fit produced at 1440px, where seven columns fitted. It
 * also guarantees each cell enough width for the longest realistic values
 * ("Asia/Calcutta", "HeadlessChrome"), which were otherwise breaking mid-word.
 */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .summary-grid { grid-template-columns: repeat(4, 1fr); }
}

.summary-cell {
  min-width: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--ink-700);
  border-bottom: 1px solid var(--ink-700);
}
.summary-cell dt {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-500);
}
.summary-cell dd {
  margin: 5px 0 0;
  /* Capped against viewport width as well as an absolute maximum: at the 900px
     breakpoint four columns are narrow, and a value scaled purely by vw would
     still overflow its cell there. */
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 600;
  color: var(--fog-50);
  /* Prefer a space; break inside a word only when there is no alternative. */
  overflow-wrap: break-word;
}
.summary-cell dd .sub {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--fog-300);
}

/* ------------------------------------------------------------------ fields */

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.field {
  /* Without min-width:0 a long unbroken value forces the grid track wider than
     its share and the whole page gains a horizontal scrollbar. */
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
}

.field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fog-500);
}

.field-value {
  margin-top: 5px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--fog-50);
  /* `anywhere` rather than `break-word`: a 400-character user agent has no
     spaces to break at. */
  overflow-wrap: anywhere;
}

.field-value.is-na {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 400;
  font-style: italic;
  color: var(--fog-500);
}

.field-note {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--ink-700);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--fog-500);
}

/* ------------------------------------------------------------ capabilities */

.cap-group + .cap-group { margin-top: 22px; }

.cap-group h3 {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog-500);
}

.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 8px;
}

.cap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--ink-700);
  border-radius: 8px;
  background: var(--ink-850);
}

/* Glyph AND colour AND text. Any one of the three alone would fail somebody. */
.cap-mark {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  margin-top: 1px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.cap-yes {
  color: var(--pass-500);
  background: color-mix(in srgb, var(--pass-500) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--pass-500) 35%, transparent);
}
.cap-no {
  color: var(--fail-500);
  background: color-mix(in srgb, var(--fail-500) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--fail-500) 30%, transparent);
}

.cap-body { min-width: 0; flex: 1; }
.cap-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--fog-100);
  overflow-wrap: anywhere;
}
.cap-status {
  font-size: 11.5px;
  font-weight: 500;
}
.cap-status.yes { color: var(--pass-500); }
.cap-status.no { color: var(--fail-500); }
.cap-note {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--fog-500);
}

/* --------------------------------------------------------------- developer */

.dev-stack { display: grid; gap: 16px; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 560px) {
  .summary-cell { padding: 13px 15px; }
}
