/* The fitting room's shell (goose#1714). Its own stylesheet, in a file: the shell's policy allows no inline style. */
:root {
  color-scheme: light dark;
  --bg: #f4f2ee;
  --panel: #ffffff;
  --ink: #1b1a17;
  --muted: #5b5851;
  --line: #d6d1c7;
  --accent: #134e48;
  --accent-ink: #ffffff;
  --bad: #9b1c1c;
  --good: #17603a;
  --focus: #1a5fd0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131311;
    --panel: #1c1b18;
    --ink: #f0ece4;
    --muted: #aaa49b;
    --line: #38362f;
    --accent: #78c2b7;
    --accent-ink: #0c1a18;
    --bad: #ff9d9d;
    --good: #82dca6;
    --focus: #8ab4f8;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
#app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h1, h2, h3, p { margin: 0; }
code, pre { font: 0.85em/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
pre { margin: 0.35rem 0 0; padding: 0.4rem 0.55rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
button, select, input[type="search"] { font: inherit; color: inherit; }
button { min-height: 44px; padding: 0 0.85rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 600; }
select, input[type="search"] { min-height: 44px; padding: 0 0.6rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; max-width: 100%; }

.top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 1.25rem; padding: 0.65rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 1.05rem; }
.top p { color: var(--muted); font-size: 0.9rem; }
.top .build { margin-left: auto; font-variant-numeric: tabular-nums; }

.layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr) 23rem; min-height: 0; }
.side { overflow: auto; padding: 0.75rem; background: var(--panel); border-right: 1px solid var(--line); }
.report-side { border-right: 0; border-left: 1px solid var(--line); }
.main { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); min-width: 0; min-height: 0; }

.picker .group { margin-top: 0.9rem; }
.picker h2 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.25rem; }
.picker ul, .report ul { list-style: none; margin: 0; padding: 0; }
.picker button.page { width: 100%; text-align: left; border-color: transparent; background: transparent; padding: 0.25rem 0.5rem; }
.picker button.page:hover { background: var(--bg); }
.picker button.page.current { background: var(--bg); border-color: var(--accent); font-weight: 600; }
.picker small { color: var(--muted); font-weight: 400; }
#search { width: 100%; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.status { color: var(--muted); font-size: 0.9rem; }
.note { color: var(--muted); font-size: 0.9rem; flex-basis: 100%; }
.note:empty { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 0.5rem 1rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--line); }
.field { display: grid; gap: 0.1rem; }
.field label { font-size: 0.75rem; color: var(--muted); }
.widths { display: flex; gap: 0.25rem; }
.check { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; }
.notice { padding: 0.35rem 1rem; color: var(--muted); font-size: 0.9rem; }
.notice:empty { display: none; }

/* Placed by row: the notice is display: none when it is empty, and a grid places what is left by order, so without
   this the stage falls into an auto row and the frame stops filling it. */
.stage { grid-row: 4; overflow: auto; padding: 1rem; min-height: 0; }
.frame-box { margin: 0 auto; position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 4px; }
.frame { display: block; border: 0; background: #fff; transform-origin: 0 0; }

.report h2 { font-size: 1rem; margin-bottom: 0.4rem; }
.report h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1rem 0 0.35rem; }
.report li { padding: 0.45rem 0; border-top: 1px solid var(--line); font-size: 0.9rem; }
.report p { font-size: 0.9rem; margin-bottom: 0.35rem; }
.rule { display: inline-block; padding: 0 0.4rem; border: 1px solid var(--line); border-radius: 4px; font: 0.8em ui-monospace, Menlo, monospace; }
.line { color: var(--muted); }
.verdict { font-weight: 600; color: var(--bad); }
.verdict.clear { color: var(--good); }
.meter.over { color: var(--bad); font-weight: 600; }
.contrast { margin-top: 1.25rem; padding-top: 0.25rem; border-top: 2px solid var(--line); }
.contrast:empty { display: none; }
.contrast h2 { font-size: 1rem; margin-bottom: 0.4rem; }
.contrast h3 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 1rem 0 0.35rem; }
.contrast ul { list-style: none; margin: 0; padding: 0; }
.contrast li { border-top: 1px solid var(--line); }
.contrast p { font-size: 0.9rem; margin-bottom: 0.35rem; }
.contrast .caveat { color: var(--muted); }
button.point { display: block; width: 100%; min-height: 44px; padding: 0.45rem 0.25rem; text-align: left; background: transparent; border: 0; border-radius: 0; font-size: 0.9rem; }
button.point:hover:not(:disabled) { background: var(--bg); }
button.point .detail { display: block; color: var(--muted); }
button.point .words { overflow-wrap: anywhere; }
button.point .count { color: var(--muted); }
details { margin-top: 0.75rem; }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.fail { padding: 1rem; color: var(--bad); }
.loading { padding: 1rem; color: var(--muted); }

@media (max-width: 1100px) {
  #app { height: auto; }
  .layout { display: flex; flex-direction: column; }
  .side, .report-side { max-height: 16rem; border: 0; border-bottom: 1px solid var(--line); }
  .main { display: block; }
  .stage { min-height: 70vh; }
}
@media (prefers-reduced-motion: no-preference) { button { transition: border-color 0.12s; } }
