/* GaugePlay /report — page layer on top of the design system (DESIGN.md §12 TRACK).
   Data areas carry no decorative motion; only the journey gauges fill (DS motion rule 5). */

.rp-body { background: var(--bg); }
.rp-body::before { /* soft lime light from the top, same as the other surfaces */
  content: ""; position: fixed; inset: 0 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background: var(--light-top), var(--tex-grid);
  -webkit-mask: linear-gradient(#000 30%, transparent); mask: linear-gradient(#000 30%, transparent);
}

.rp { padding-bottom: var(--sp-16); }

/* ------------------------------------------------------------------ header */
.rp-head { padding-top: var(--sp-8); padding-bottom: var(--sp-6); display: grid; gap: var(--sp-4); }
.rp-title { font-size: var(--fs-h1); font-weight: var(--fw-heavy); letter-spacing: var(--tr-display); line-height: 1.05; }
/* rem, not ch: ch follows the "0" of whichever font is up, so the fallback font and Pretendard
   wrapped this paragraph to different line counts and the header jumped when the font arrived.
   54rem keeps both at two lines at every desktop size (measured: fallback needs >= 50rem). */
.rp-lead { max-width: 54rem; font-size: var(--fs-lead); color: var(--muted); line-height: 1.6; }

.rp-status {
  display: grid; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-4);
  font-size: var(--fs-xs); color: var(--muted);
}
.rp-status__top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); }
.rp-status__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.rp-status__stats .rp-status__item { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg); }
.rp-status__item b { font-family: var(--font-num); font-weight: 400; font-size: var(--fs-num-1); line-height: 1; color: var(--ink); margin-right: 2px; }
/* The measurement label is a claim about every number on the page, so it reads at body contrast
   (--muted passes AA on --bg-2; --faint did not) with a coral marker, not as fine print. */
.rp-status__basis { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); cursor: help; }
/* A label, not a number: undo the pixel number face that .rp-status__item b gives the counts. */
.rp-status__basis b { font-family: inherit; font-size: inherit; line-height: inherit; margin-right: 0; color: var(--ink); font-weight: var(--fw-bold); }
.rp-status__basis::before { content: ""; width: 6px; height: 6px; background: var(--secondary); flex: none; }
/* F-07: on a sample the chip reads "샘플 · 측정값 아님" with a hollow dotted marker (the sample
   label's look, DS §6), so a cropped screenshot of sample numbers never says "자체 측정". The
   static-boot rule covers the first paint, before report.js has set the mode. */
.rp-basis--sample { display: none; }
html[data-report-mode="sample"] .rp-basis--self,
html[data-report-boot="static"]:not([data-report-mode]) .rp-basis--self { display: none; }
html[data-report-mode="sample"] .rp-basis--sample,
html[data-report-boot="static"]:not([data-report-mode]) .rp-basis--sample { display: inline; }
html[data-report-mode="sample"] .rp-status__basis::before,
html[data-report-boot="static"]:not([data-report-mode]) .rp-status__basis::before { background: transparent; outline: 1px dotted var(--muted); outline-offset: -1px; }

/* 집중 의심 (SEC-R1-01): sessions the server flagged and left out of the numbers. Coral, dashed:
   an exception to the numbers next to it, told in words (DS §6: never color alone). */
.gp-badge.rp-flag { color: var(--secondary); border: 1px dashed var(--secondary); background: var(--secondary-a10); cursor: help; }
.gp-badge.rp-flag::before { background: currentColor; }
.rp-table th[scope="row"] .rp-flag { justify-self: start; margin-top: 2px; }
/* 주소 집중 (SEC-R3-01): a plain count, not a verdict — the flag tone stays for set-apart sessions. */
.rp-table th[scope="row"] .rp-addr { justify-self: start; margin-top: 2px; font-weight: var(--fw-semibold); cursor: help; }
.rp-status__actions { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.rp-status__actions:not(:has(> :not([hidden]))) { display: none; }
.rp-status .gp-btn { margin-bottom: 0; }
.rp-live { gap: 8px; }
.rp-live__dot { width: 8px; height: 8px; background: var(--faint); }
.rp-live[aria-pressed="true"] .rp-live__dot { background: var(--primary); box-shadow: 0 0 8px var(--primary); animation: gp-blink 1.2s steps(1) infinite; }

.rp-banner {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px dotted var(--muted); border-radius: var(--r-4); background: var(--surface);
  font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.6;
}
.rp-banner > .gp-icon { --icon: 20px; flex: none; margin-top: 2px; color: var(--muted); }
.rp-banner p { flex: 1 1 240px; min-width: 0; }
.rp-banner b { color: var(--ink); }
.rp-banner code { font-family: var(--font-mono); font-size: .8125rem; color: var(--primary); white-space: nowrap; }
.rp-banner .gp-btn { margin-bottom: 0; flex: none; margin-left: auto; }
/* The banner starts without [hidden] (base.css makes [hidden] !important): before report.js runs,
   runtime.js has already said whether this is static hosting, so the sample banner is laid out
   from the first paint there and nowhere else. After that report.js toggles [hidden]. */
#sample-banner { display: none; }
html[data-report-boot="static"] #sample-banner,
html[data-report-mode="sample"] #sample-banner { display: flex; }
/* The banner is the head's one sample label; the status row's data badge would repeat it.
   Hidden from the first paint on static hosting so the row does not shift when report.js runs. */
html[data-report-boot="static"]:not([data-report-mode]) #data-badge,
html[data-report-mode="sample"] #data-badge { display: none; }

.rp-auth { display: grid; gap: var(--sp-2); max-width: 420px; }
.rp-auth__row { display: flex; gap: var(--sp-2); }
.rp-auth__row .gp-input { flex: 1; }
.rp-auth__row .gp-btn { margin-bottom: 0; }

/* ------------------------------------------------------------------ layout */
/* One grid. Small screens read top to bottom in DOM order (journey, rates, table, stores,
   stream); from 1100px the stream moves up beside the journey (see the last media query). */
.rp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.rp-grid > * { min-width: 0; }
.rp-aside { display: grid; gap: var(--sp-4); min-width: 0; }

.rp-card {
  display: grid; gap: var(--sp-4); min-width: 0;
  padding: var(--sp-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-5);
  box-shadow: var(--sh-1);
}
.rp-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.rp-card__head > div { display: grid; gap: var(--sp-2); }
.rp-card__title { font-size: var(--fs-h3); font-weight: var(--fw-heavy); letter-spacing: var(--tr-head); line-height: 1.25; }
.rp-sub { font-size: var(--fs-sm); color: var(--muted); line-height: 1.65; }
.rp-sub code, .rp-note code { font-family: var(--font-mono); font-size: .8125rem; color: var(--ink-2); }
.rp-note { font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.rp-note b { color: var(--ink-2); font-weight: var(--fw-bold); }

/* ------------------------------------------------------------------ journey */
.rp-srcs .gp-tab { padding-inline: 6px; font-size: var(--fs-sm); }
.rp-srcs .gp-tab[aria-disabled="true"] { opacity: .45; }

.rp-hero {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--sp-3) var(--sp-4);
  padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-4); background: var(--bg);
}
.rp-hero__num { display: grid; gap: var(--sp-2); min-width: 0; }
.rp-hero__label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--muted); }
.rp-hero__value { font-size: var(--fs-num-3); line-height: 1; color: var(--ink); white-space: nowrap; }
.rp-hero__value.is-long { font-size: var(--fs-num-2); } /* 5+ glyphs would overrun half of a 390 card */
.rp-hero__num--store .rp-hero__value { color: var(--secondary); }
.rp-hero__arrow { --icon: 22px; color: var(--faint); margin-bottom: 10px; }
.rp-hero__rate {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding-top: var(--sp-3); border-top: 1px dashed var(--line-2);
}
.rp-hero__ratevalue { display: inline-flex; align-items: center; gap: var(--sp-2); font-family: var(--font-num); font-size: var(--fs-num-2); line-height: 1; color: var(--ink); }
.rp-hero__ratevalue small { font-size: var(--fs-num-1); color: var(--muted); }
.rp-unmeasured { font-family: var(--font-sans); font-size: 1.125rem; font-weight: var(--fw-heavy); color: var(--muted); letter-spacing: -.01em; }

.rp-ladder { display: grid; gap: 6px; }
.rp-step {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name count" "bar bar";
  align-items: center; gap: 6px var(--sp-3);
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg);
}
.rp-step__name { grid-area: name; display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.rp-step__name code { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-step__count { grid-area: count; display: inline-flex; align-items: baseline; justify-content: flex-end; gap: 4px; font-family: var(--font-num); font-size: var(--fs-num-2); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-step__jump { font-family: var(--font-sans); font-size: 13px; font-weight: var(--fw-heavy); line-height: 1; color: var(--warn, #ffc94a); cursor: help; }
.rp-step.is-jump { border-style: dashed; }
.rp-step .gp-gauge { grid-area: bar; }
.rp-step[data-tone="pre"] .gp-gauge { --gp-color: var(--ink-2); }
.rp-step[data-tone="pre"] .rp-step__count { color: var(--ink-2); }
.rp-step[data-tone="store"] { border-color: var(--secondary-a24); }
.rp-step[data-tone="store"] .gp-gauge { --gp-color: var(--secondary); }
.rp-step[data-tone="store"] .rp-step__count { color: var(--secondary); }
.rp-step.is-zero .rp-step__count { color: var(--faint); }

/* Side notes under the ladder: the load count (feed iframe only) and what ↑ means. */
.rp-legend { display: grid; gap: var(--sp-2); }
.rp-legend li { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: var(--sp-2) 10px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.rp-legend b { color: var(--ink-2); font-weight: 400; font-size: var(--fs-num-1); }
.rp-legend__key {
  display: inline-grid; place-items: center; min-width: 34px; padding: 3px 6px;
  border: 1px solid var(--line-2); border-radius: var(--r-2, 4px); background: var(--bg);
  font-family: var(--font-pixel); font-size: var(--fs-px-1); line-height: 1; color: var(--ink-2);
}
.rp-legend__key--up { font-family: var(--font-sans); font-weight: var(--fw-heavy); font-size: 13px; color: var(--warn, #ffc94a); }
.rp-legend:not(.has-jump) .rp-legend__key--up { color: var(--faint-text); } /* 13px glyph: small text, AA (DESIGN.md §5.1) */

.rp-empty {
  display: grid; justify-items: center; text-align: center; gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-4); border: 1px dashed var(--line-2); border-radius: var(--r-4); background: var(--bg);
}
.rp-empty__actions { justify-content: center; flex-wrap: wrap; }

/* ------------------------------------------------------------------ rate tiles */
.rp-rates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
/* One label row for all six tiles: the section badge ("측정됨" / "샘플") sits here once, and a
   tile shows a badge only for its exception (미측정). Same height in every mode so nothing moves. */
.rp-rates__head { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 24px; }
.rp-rates__title { margin: 0; display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--ink-2); }
.rp-rate .gp-stat__label { display: grid; gap: 2px; }
.rp-rate .gp-stat__label small { font-weight: 400; color: var(--muted); font-size: var(--fs-2xs); line-height: 1.4; min-height: 2.8em; } /* two lines reserved so values line up across tiles */
.rp-rate .gp-stat__value small { font-size: var(--fs-num-1); }
.rp-rate.is-unmeasured .gp-stat__value { font-family: var(--font-sans); font-size: 1.25rem; font-weight: var(--fw-heavy); color: var(--muted); letter-spacing: -.01em; }
.rp-frac { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

/* ------------------------------------------------------------------ breakdown table */
.rp-tabs .gp-tab { font-size: var(--fs-sm); }
.rp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.rp-table caption { text-align: left; }
.rp-table th, .rp-table td { text-align: left; vertical-align: middle; }
.rp-table thead { display: none; }
.rp-table tbody { display: grid; gap: var(--sp-2); }
.rp-table tr {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px var(--sp-3);
  padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--bg);
}
.rp-table th[scope="row"] { grid-column: 1 / -1; display: grid; gap: 2px; font-weight: var(--fw-bold); }
/* Name, then the id line, then a flag, each on its own line at every width (on 390 the label used
   to run straight into its id: "게임 AS4ab9Kx2"). */
.rp-table th[scope="row"] > span { display: grid; gap: 2px; justify-items: start; }
.rp-table th[scope="row"] small { font-family: var(--font-mono); font-size: 11px; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.rp-table td { display: grid; gap: 2px; }
.rp-table td::before { content: attr(data-label); font-size: var(--fs-2xs); color: var(--muted); font-weight: var(--fw-semibold); }
.rp-table td.rp-num { font-family: var(--font-num); font-size: var(--fs-num-1); font-variant-numeric: tabular-nums; }
.rp-table td.rp-rate-cell { grid-column: 1 / -1; }
.rp-table .gp-gauge { max-width: 280px; }
.rp-table-empty { padding: var(--sp-6) var(--sp-3); text-align: center; font-size: var(--fs-sm); color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--r-3); }
.rp-cell-unmeasured { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); color: var(--muted); }

/* ------------------------------------------------------------------ stores */
/* D2-06: head, URL and meta sit on rows shared by every card in a grid row, so the URL boxes end
   on one line and the meta (label + link count, then the console) starts on one line, however
   long each URL is. Subgrid where supported; otherwise a column whose URL box fills the card. */
.rp-stores { display: grid; gap: var(--sp-3); }
.rp-store {
  display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0;
  padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-4); background: var(--bg);
}
.rp-store > .rp-store__url { flex: 1 1 auto; }
@supports (grid-template-rows: subgrid) {
  .rp-store { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--sp-3); }
  .rp-store > .rp-store__url { align-self: stretch; }
}
.rp-store__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.rp-store__name { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-heavy); font-size: 1.0625rem; }
.rp-store__name .gp-icon { --icon: 20px; color: var(--primary); }
.rp-store__count { display: grid; justify-items: end; gap: 2px; }
.rp-store__count b { font-family: var(--font-num); font-weight: 400; font-size: var(--fs-num-2); line-height: 1; color: var(--secondary); }
.rp-store__count span { font-size: var(--fs-2xs); color: var(--muted); }
.rp-store__url {
  margin: 0; padding: 10px 12px; border-radius: var(--r-3); background: var(--bg-2); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--muted);
  overflow-wrap: anywhere; word-break: break-all; white-space: pre-wrap;
}
.rp-store__url mark { background: none; color: var(--primary); }
.rp-store__meta { display: grid; gap: 6px; align-content: start; font-size: var(--fs-xs); color: var(--muted); }
.rp-store__metarow { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); min-width: 0; }
.rp-store__links { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }
/* Console granularity (D-A). Plain label: it states what a store can show, not a measured number. */
.rp-store__unit .gp-badge { color: var(--ink-2); }
.rp-store__unit .gp-badge.is-pending { color: var(--secondary); border-style: dashed; border-color: var(--secondary-a24); }
.rp-store__console { display: flex; align-items: flex-start; gap: 6px; margin: 0; line-height: 1.5; }
.rp-store__console .gp-icon { --icon: 14px; flex: none; margin-top: 2px; }

/* ------------------------------------------------------------------ stream + rules */
/* A fixed box: the list filling up must not push the rules (or anything) around. */
.rp-log { --log-h: 420px; }
.rp-log .gp-log__list { height: var(--log-h); }
.rp-log .gp-log__head #stream-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0; }
/* A flagged session's events: still listed, struck through in tone (they are not in the numbers). */
.rp-log .gp-log__item.is-suspect .gp-log__event { text-decoration: line-through; text-decoration-color: var(--secondary); }
.rp-log .gp-log__item.is-suspect .gp-log__detail { color: var(--secondary); }
.rp-rules { display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r-4); background: var(--bg-2); }
.rp-rules li { display: grid; grid-template-columns: 18px 1fr; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }
.rp-rules .gp-icon { --icon: 16px; margin-top: 2px; color: var(--primary); }

/* ------------------------------------------------------------------ wider screens */
@media (min-width: 600px) {
  .rp-hero { grid-template-columns: auto auto auto 1fr; align-items: end; }
  .rp-hero__rate { grid-column: auto; display: grid; justify-content: end; justify-items: end; text-align: right; padding-top: 0; border-top: 0; }
  .rp-hero__value, .rp-hero__value.is-long { font-size: var(--fs-num-4); }
  .rp-step { grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) 84px; grid-template-areas: "name bar count"; padding: 10px 14px; }
  .rp-step__name { flex-direction: column; gap: 2px; }
  .rp-step__count { text-align: right; }
  .rp-rates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rp-stores { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .rp-table thead { display: table-header-group; }
  .rp-table tbody { display: table-row-group; }
  .rp-table tr { display: table-row; padding: 0; border: 0; border-radius: 0; background: none; }
  .rp-table th, .rp-table td { display: table-cell; padding: 12px 10px; border-bottom: 1px solid var(--line); }
  .rp-table thead th { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--muted); padding-top: 4px; }
  .rp-table td::before { content: none; }
  .rp-table th[scope="row"] { display: table-cell; }
  .rp-table th[scope="row"] > span { display: grid; gap: 2px; }
  .rp-table td.rp-num, .rp-table thead th.rp-num { text-align: right; }
  .rp-table td.rp-rate-cell { width: 34%; }
  .rp-table tbody tr:last-child > * { border-bottom: 0; }
}

@media (min-width: 900px) {
  /* Two fixed lines: one long line sat at the wrap edge, so the late web font changed its height. */
  .rp-banner__how { display: block; }
  .rp-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); }
  .rp-status__stats { display: flex; gap: var(--sp-4); }
  .rp-status__stats .rp-status__item { display: block; padding: 0; border: 0; background: none; }
  /* The live/refresh buttons appear once the server answers. Their row height is reserved
     from the first paint so the status bar (and everything under it) does not move. */
  .rp-status__actions,
  .rp-status__actions:not(:has(> :not([hidden]))) { display: flex; min-height: 40px; margin-left: auto; justify-content: flex-end; }
}

@media (min-width: 1100px) {
  .rp-head { padding-top: var(--sp-12); }
  /* Row 1: journey | live stream. Then the rates, the table and the stores use the full width,
     so no column runs out while the other keeps going. */
  .rp-grid {
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas:
      "journey aside"
      "rates   rates"
      "table   table"
      "stores  stores";
    gap: var(--sp-8);
  }
  .rp-journey { grid-area: journey; }
  .rp-rates { grid-area: rates; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .rp-breakdown { grid-area: table; }
  .rp-storecard { grid-area: stores; }
  .rp-stores { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* The stream is as tall as the journey card beside it: the log takes what the rules leave. */
  .rp-aside { grid-area: aside; align-self: stretch; display: flex; flex-direction: column; }
  .rp-log { flex: 1 1 auto; min-height: 280px; contain: size; }
  .rp-log .gp-log__list { height: auto; max-height: none; flex: 1 1 0; min-height: 0; }
  .rp-rules { flex: none; }
  .rp-card { padding: var(--sp-6); }
}
