@import url("./tokens.css");
@import url("./base.css");

:root {
  --bar-height: 36px; --control: 26px; --field: 24px;
  --text-xs: 0.8rem; --text-sm: 13px; --text-md: 13px; --text-lg: 1rem; --text-xl: 1.2rem; --text-2xl: 1.44rem; --text-3xl: 1.728rem;
  --space-sm: 8px; --space-lg: 16px; --space-xl: 32px;
  --color-error-soft: color-mix(in oklab, #d20f39 14%, #eff1f5);
  --color-head: #ccd0da; --color-head-ink: #3c3f56; --color-head-muted: #4c4f69;
  --color-code-kw: #1e66f5; --color-code-type: #fe640b;
  --radius: 0;
  --fill: var(--color-paper-2); --fill-hover: var(--color-paper-3);
  --color-ink: #3c3f56; --color-ink-2: #3c3f56; --color-muted: #4c4f69; --color-error: #b00c2f;
  --color-green: #1c5e12; --color-code-type: #8f3c00; --color-code-kw: #174bc0; --color-edge: #6c6f85;
  --tint-focus: color-mix(in oklab, var(--color-accent) 9%, var(--color-paper-2));
  --tint-stripe: color-mix(in oklab, var(--color-paper-3) 35%, var(--color-paper-2));
  --tint-redos: color-mix(in oklab, var(--color-accent) 9%, var(--color-paper-2)); --tint-redos-2: color-mix(in oklab, var(--color-accent) 15%, var(--color-paper-2));
}

:root[data-mode="dark"] {
  color-scheme: dark;
  --color-paper: #11111b; --color-paper-2: #1e1e2e; --color-paper-3: #313244; --color-sheet: #1e1e2e;
  --color-edge: #7f849c; --color-ink: #cdd6f4; --color-ink-2: #bac2de; --color-muted: #a6adc8; --color-rule: #313244;
  --color-accent: #cba6f7; --color-accent-ink: #11111b; --color-accent-soft: color-mix(in oklab, #cba6f7 26%, #1e1e2e); --color-focus: #cba6f7;
  --color-green: #a6e3a1; --color-green-soft: color-mix(in oklab, #a6e3a1 18%, #1e1e2e); --color-water: #74c7ec;
  --color-error: #f38ba8; --color-error-soft: color-mix(in oklab, #f38ba8 22%, #1e1e2e);
  --color-head: #313244; --color-head-ink: #cdd6f4; --color-head-muted: #a6adc8;
  --color-code-kw: #89b4fa; --color-code-type: #fab387;
  --tint-redos: color-mix(in oklab, var(--color-accent) 14%, var(--color-paper-2)); --tint-redos-2: color-mix(in oklab, var(--color-accent) 21%, var(--color-paper-2));
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    color-scheme: dark;
    --color-paper: #11111b; --color-paper-2: #1e1e2e; --color-paper-3: #313244; --color-sheet: #1e1e2e;
    --color-edge: #7f849c; --color-ink: #cdd6f4; --color-ink-2: #bac2de; --color-muted: #a6adc8; --color-rule: #313244;
    --color-accent: #cba6f7; --color-accent-ink: #11111b; --color-accent-soft: color-mix(in oklab, #cba6f7 26%, #1e1e2e); --color-focus: #cba6f7;
    --color-green: #a6e3a1; --color-green-soft: color-mix(in oklab, #a6e3a1 18%, #1e1e2e); --color-water: #74c7ec;
    --color-error: #f38ba8; --color-error-soft: color-mix(in oklab, #f38ba8 22%, #1e1e2e);
    --color-head: #313244; --color-head-ink: #cdd6f4; --color-head-muted: #a6adc8;
    --color-code-kw: #89b4fa; --color-code-type: #fab387;
    --tint-redos: color-mix(in oklab, var(--color-accent) 14%, var(--color-paper-2)); --tint-redos-2: color-mix(in oklab, var(--color-accent) 21%, var(--color-paper-2));
  }
}

body { line-height: 1.2; }

.bar { background: var(--color-paper-2); }
.bar__inner { display: flex; align-items: center; gap: var(--space-lg); min-height: var(--bar-height); }
.wordmark { display: inline-flex; align-items: center; font-family: var(--font-outlier); font-weight: 500; font-size: var(--text-lg); color: var(--color-ink); text-decoration: none; white-space: nowrap; border-radius: var(--radius); }
.wordmark__slash { color: var(--color-muted); }
.wordmark__escape { color: var(--color-green); }
.mode { position: relative; margin-left: auto; display: none; align-items: center; justify-content: center; width: var(--control); height: var(--control); padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--color-ink-2); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.js .mode { display: inline-flex; }
.mode::before { content: ""; position: absolute; inset: -4px; }
.mode svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.mode__sun, .mode[aria-pressed="true"] .mode__moon { display: none; }
.mode[aria-pressed="true"] .mode__sun { display: block; }
@media (hover: hover) { .mode:hover { background: var(--color-paper-3); color: var(--color-ink); } }
.mode:active { transform: translateY(1px); }
.mode:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.mode:disabled { opacity: 0.55; cursor: not-allowed; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); padding-block: var(--space-sm) var(--space-xl); }
.tester { display: contents; }
.results { display: grid; grid-auto-rows: max-content; gap: var(--space-sm); align-content: start; min-width: 0; }
.side { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-md); align-content: start; min-width: 0; }
@media (min-width: 60rem) {
  :root { --gutter: 24px; }
  .workspace { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--space-lg); align-items: start; }
  .toolbar { grid-column: 1 / span 7; }
  .code, .tester__actions { grid-column: 1 / span 7; }
  .side { grid-column: 8 / -1; grid-row: 1 / span 3; position: sticky; top: var(--space-sm); }
  .params .params__panel { top: auto; bottom: calc(100% + var(--space-sm) + var(--space-2xs)); }
}
@media (min-width: 90rem) {
  .workspace { height: calc(100dvh - var(--bar-height)); grid-template-rows: auto minmax(0, 1fr); row-gap: var(--space-sm); padding-block: var(--space-sm) 0; }
  .toolbar { grid-row: 1; }
  .tester__actions { grid-row: 1; justify-self: end; }
  .code { grid-row: 2; align-self: stretch; overflow-y: auto; margin: 0 calc(-1 * var(--space-sm)) 0 calc(-1 * var(--space-2xs)); padding: var(--space-2xs) var(--space-sm) var(--space-lg) var(--space-2xs); }
  .side { grid-row: 1 / span 2; position: static; align-self: stretch; grid-template-rows: minmax(0, 1fr) auto; gap: 0; }
  .results { overflow-y: auto; margin: calc(-1 * var(--space-2xs)) calc(-1 * var(--space-2xs)) 0; padding: var(--space-2xs) var(--space-2xs) var(--space-lg); }
  .side { row-gap: var(--space-sm); }
  .redos-block { margin-bottom: var(--space-sm); }
  .table-wrap { max-height: none; }
}

.field { position: relative; min-width: 0; }
.mono { font-family: var(--font-outlier); }
.literal, .sheet { width: 100%; border-radius: var(--radius); background: var(--color-paper-2); color: var(--color-ink); box-shadow: inset 0 -1px 0 var(--color-edge); transition: background-color var(--dur-short) var(--ease-out); }
.sheet:focus-within, .literal:has(#pattern:focus-visible) { background: var(--tint-focus); box-shadow: inset 0 -2px 0 var(--color-focus); }
.literal:has(#pattern[aria-invalid="true"]) { background: var(--color-error-soft); box-shadow: inset 0 -2px 0 var(--color-error); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-sm); }
.lang { position: relative; }
.lang select { min-height: var(--control); padding: 0 20px 0 var(--space-2xs); border: 0; border-radius: var(--radius); background: var(--color-paper-2); color: var(--color-ink); font: 500 var(--text-sm)/1 var(--font-body); cursor: pointer; appearance: none; outline: 2px solid transparent; outline-offset: 2px; transition: background-color var(--dur-short) var(--ease-out); }
.lang::after { content: ""; position: absolute; right: 7px; top: 50%; width: 6px; height: 6px; border-right: 1.5px solid var(--color-ink-2); border-bottom: 1.5px solid var(--color-ink-2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
@media (hover: hover) { .lang select:hover { background: var(--color-paper-3); } }
.lang select:focus-visible { outline-color: var(--color-focus); }
.lang select:disabled { opacity: 0.55; cursor: not-allowed; }
.toolbar__lang { display: flex; align-items: center; gap: var(--space-sm); }
.where { font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; }
.tester[data-lang="js"] .lang-where .where--cloud, .tester:not([data-lang="js"]) .lang-where .where--local { display: none; }
.tester[data-engine="switch"] .lang-where { display: none; }
.engine { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.engine__mode { display: inline-flex; gap: var(--space-3xs); }
.engine__mode .btn[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-ink); }
#engine-download[aria-busy="true"] { font-variant-numeric: tabular-nums; }
.toolbar__actions { display: none; flex-wrap: wrap; align-items: center; gap: var(--space-md); }
.js .toolbar__actions { display: flex; }
.copy { display: inline-flex; align-items: center; gap: var(--space-3xs); }
.copy__label { margin-right: var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); }
.check { position: relative; display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-sm); color: var(--color-ink-2); white-space: nowrap; cursor: pointer; }
.check::before { content: ""; position: absolute; inset: -12px -4px; }
.check input { position: relative; flex-shrink: 0; width: 16px; height: 16px; margin: 0; border: 0; border-radius: var(--radius); background: var(--color-edge); cursor: pointer; appearance: none; transition: background-color var(--dur-micro) var(--ease-out); }
.check input:checked { background: var(--color-accent); }
.check input:checked::before { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 9px; border: solid var(--color-accent-ink); border-width: 0 2px 2px 0; transform: translate(-50%, calc(-50% - 1px)) rotate(45deg); }
.check input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.check input:active { transform: translateY(1px); }
.check input:disabled { opacity: 0.55; cursor: not-allowed; }

.code { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: var(--space-2xs); min-width: 0; }
.code__chunk { margin: 0; overflow: auto hidden; overscroll-behavior: none; scrollbar-width: none; font: var(--text-sm)/1.2 var(--font-outlier); color: var(--color-ink-2); white-space: pre; tab-size: 4; }
.code__chunk:empty, [data-code="hidden"] .code__chunk { display: none; }
.js:not([data-code="hidden"]) .code > .literal, .js:not([data-code="hidden"]) .test > .field, .js:not([data-code="hidden"]) .test-add { margin-left: var(--space-lg); }
.js:not([data-code="hidden"]) .code > .literal { width: auto; }
.tests { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
.test { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
.test__remove, .test-add { display: none; }
.js .test__remove { position: absolute; top: var(--space-2xs); right: var(--space-2xs); z-index: var(--z-raised); display: inline-flex; min-width: 20px; min-height: 20px; padding: 0; font-family: var(--font-outlier); }
.js .test:only-child .test__remove { display: none; }
.js .test-add { display: inline-flex; justify-self: start; min-width: var(--control); min-height: var(--control); padding: 0; font-family: var(--font-outlier); }
.tok-kw { color: var(--color-code-kw); }
.tok-type { color: var(--color-code-type); }
.tok-str { color: var(--color-green); }
.tok-fn { color: var(--color-ink); }

.literal { display: flex; align-items: center; gap: var(--space-2xs); min-height: var(--field); padding: 0 var(--space-3xs) 0 var(--space-2xs); font-family: var(--font-outlier); font-size: var(--text-md); }
.literal__slash { flex-shrink: 0; color: var(--color-muted); }
.pattern-field { display: grid; flex: 1; min-width: 0; align-items: center; }
.pattern-field > * { grid-area: 1 / 1; min-width: 0; }
#pattern { height: var(--field); padding: 0; border: 0; background: transparent; color: var(--color-ink); font: inherit; letter-spacing: 0; outline: none; }
.pattern-field__mirror { display: none; overflow: hidden; white-space: pre; color: var(--color-ink); letter-spacing: 0; pointer-events: none; }
.js .pattern-field__mirror { display: block; }
.js #pattern { color: transparent; caret-color: var(--color-ink); }
#pattern::placeholder, .sheet__input::placeholder { color: var(--color-muted); opacity: 1; }
.js #pattern::selection { background: color-mix(in oklab, var(--color-water) 30%, transparent); }
.rx-esc { color: var(--color-green); }
.rx-class { color: var(--color-green); background: var(--color-green-soft); border-radius: var(--radius); }
.rx-group { color: var(--color-code-kw); }
.rx-quant { color: var(--color-code-type); }
.rx-anchor { color: var(--color-code-type); }
#pattern:disabled { opacity: 0.55; cursor: not-allowed; }

.flags { display: flex; flex-shrink: 0; gap: var(--space-3xs); margin: 0; padding: 0; border: 0; }
.flags input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.flags input:has(+ label[hidden]) { display: none; }
.flags label { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 18px; min-height: 20px; border-radius: var(--radius); color: var(--color-muted); cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.flags label::before { content: ""; position: absolute; inset: -4px -1px; }
@media (hover: hover) { .flags label:hover { background: var(--color-paper-3); color: var(--color-ink); } }
.flags label:active { transform: translateY(1px); }
.flags input:focus-visible + label { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.flags input:checked + label { background: var(--color-accent); color: var(--color-accent-ink); }
.flags input:disabled + label { opacity: 0.55; cursor: not-allowed; }

.redos { min-width: 0; }
.redos__inner { display: grid; gap: var(--space-xs); transition: opacity var(--dur-short) var(--ease-out); }
.redos[aria-busy="true"] .redos__inner { opacity: 0.55; }
.redos__line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); }
.redos h2 { font-size: var(--text-md); letter-spacing: -0.01em; }
.redos__summary { font-size: var(--text-sm); color: var(--color-ink-2); }
.chip { display: inline-flex; align-items: center; min-height: 18px; padding: 0 var(--space-2xs); border-radius: var(--radius); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; background: var(--color-paper-3); color: var(--color-ink-2); }
label.chip { cursor: pointer; transition: background-color var(--dur-short) var(--ease-out); }
label.chip:active { transform: translateY(1px); }
.redos-block:has(#redos-off:focus-visible) label.chip { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.chip--safe { background: var(--color-green-soft); color: var(--color-green); }
.chip--vulnerable { background: var(--color-error); color: var(--color-paper-2); }
.redos__facts { display: grid; gap: var(--space-2xs); margin: 0; }
.redos__facts > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--space-sm); align-items: baseline; }
.redos__facts dt { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.redos__facts dd { margin: 0; min-width: 0; font-size: var(--text-sm); }
.redos__source { font-family: var(--font-outlier); white-space: pre-wrap; overflow-wrap: break-word; }
.hot { border-radius: var(--radius); background: var(--color-accent-soft); color: var(--color-ink); }
.hot--heat { background: var(--color-error-soft); box-shadow: inset 0 -2px 0 var(--color-error); }
.redos__message { margin: 0; padding: var(--space-xs) var(--space-sm); border-radius: var(--radius); background: var(--color-paper-3); font: var(--text-sm)/1.2 var(--font-outlier); color: var(--color-ink-2); white-space: pre-wrap; overflow-wrap: break-word; }

.redos-block { --fill: var(--color-paper-3); --fill-hover: color-mix(in oklab, var(--color-paper-3) 86%, var(--color-ink)); position: relative; padding: var(--space-sm); background: var(--color-paper-2); color: var(--color-ink); display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-sm); align-items: start; }
.redos-block__tools { display: flex; align-items: center; gap: var(--space-sm); }
.redos-block:has([data-state="linear"]) .redos-block__tools { display: none; }
@media (min-width: 40.01rem) {
  .redos-block { grid-template-rows: auto auto; }
  .redos, .redos__inner { grid-column: 1 / -1; grid-row: 1 / span 2; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; }
  .redos__inner > * { grid-column: 1 / -1; }
  .redos__inner > .redos__line { grid-column: 1; }
  .redos-block__tools { grid-column: 2; grid-row: 1; }
}
.source { font-size: var(--text-sm); color: var(--color-muted); white-space: nowrap; text-decoration-color: var(--color-rule); border-radius: var(--radius); transition: color var(--dur-short) var(--ease-out); }
@media (hover: hover) { .source:hover { color: var(--color-ink); text-decoration-color: var(--color-accent); } }
.params { position: relative; }
.params > summary { list-style: none; }
.params > summary::-webkit-details-marker { display: none; }
.params[open] > summary { background: var(--fill-hover); }
.params__panel { --fill: var(--color-paper-2); --fill-hover: var(--color-paper); position: absolute; right: 0; top: calc(100% + var(--space-2xs)); z-index: var(--z-dropdown); display: grid; gap: var(--space-sm); justify-items: start; width: 26rem; max-height: min(70dvh, 36rem); overflow-y: auto; padding: var(--space-sm); border-radius: var(--radius); background: var(--color-paper-3); color: var(--color-ink); box-shadow: var(--shadow-lift); }
.params__grid { display: grid; grid-template-columns: minmax(0, 1fr) 9rem; gap: var(--space-2xs) var(--space-sm); align-items: center; width: 100%; }
.params__grid label { font-size: var(--text-sm); color: var(--color-ink-2); }
.params__unit { color: var(--color-muted); }
.params__grid :is(input, select) { width: 100%; min-height: var(--control); padding: 0 var(--space-2xs); border: 0; border-radius: var(--radius); background: var(--color-paper-2); color: var(--color-ink); box-shadow: inset 0 -1px 0 var(--color-edge); font: var(--text-sm)/1 var(--font-outlier); outline: none; transition: background-color var(--dur-short) var(--ease-out); }
.params__grid select { font-family: var(--font-body); }
.params__grid :is(input, select)::placeholder { color: var(--color-muted); }
@media (hover: hover) { .params__grid :is(input, select):hover { background: var(--tint-focus); } }
.params__grid input:focus-visible { background: var(--tint-focus); box-shadow: inset 0 -2px 0 var(--color-focus); }
.params__grid select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.params__grid :is(input, select):invalid { background: var(--color-error-soft); box-shadow: inset 0 -2px 0 var(--color-error); }
.params__grid :is(input, select):disabled { opacity: 0.55; cursor: not-allowed; }
.params__advanced { width: 100%; }
.params__advanced > summary { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); cursor: pointer; border-radius: var(--radius); }
.params__advanced > summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.params__group { margin: var(--space-sm) 0 0; padding: 0; border: 0; min-width: 0; }
.params__group legend { padding: 0; margin-bottom: var(--space-xs); font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
#params-reset { display: none; }
.js #params-reset { display: inline-flex; }

.sheet { --fill: var(--color-paper-3); --fill-hover: color-mix(in oklab, var(--color-paper-3) 86%, var(--color-ink)); display: grid; grid-template-columns: minmax(0, 1fr); }
.sheet__mirror, .sheet__input { grid-area: 1 / 1; margin: 0; padding: var(--space-2xs) var(--space-xl) var(--space-2xs) var(--space-2xs); font-family: var(--font-outlier); font-size: var(--text-sm); line-height: 1.2; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; letter-spacing: 0; }
.sheet__input { min-height: calc(2lh + 2 * var(--space-2xs)); border: 0; background: transparent; color: var(--color-ink); resize: vertical; outline: none; field-sizing: content; overflow: hidden; }
.sheet__mirror { display: none; color: var(--color-ink); pointer-events: none; }
.sheet__mirror.is-pending { color: var(--color-muted); }
.js .sheet__mirror { display: block; }
.js .sheet__input { color: transparent; caret-color: var(--color-ink); }
.js .sheet__input::selection { background: color-mix(in oklab, var(--color-water) 30%, transparent); }
.hl { border-radius: var(--radius); background: var(--color-accent-soft); color: var(--color-ink); box-shadow: inset 0 -2px 0 var(--color-accent); }
.hl--alt { background: var(--color-paper-3); }
.hl.is-lit { background: var(--color-accent); color: var(--color-accent-ink); }
.hl-empty { position: relative; display: inline-block; width: 0; height: 1lh; vertical-align: top; }
.hl-empty::after { content: ""; position: absolute; inset: auto -1px var(--space-2xs); height: 0.6em; border-radius: var(--radius); background: var(--color-accent); }

.tester__actions { display: flex; }
.js .tester__actions { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control); padding: 0 var(--space-xs); border: 0; border-radius: var(--radius); background: var(--fill); color: var(--color-ink); font: 500 var(--text-sm)/1 var(--font-body); white-space: nowrap; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.btn--primary { background: var(--color-accent); color: var(--color-accent-ink); }
@media (hover: hover) { .btn:hover { background: var(--fill-hover); } .btn--primary:hover { background: color-mix(in oklab, var(--color-accent) 88%, var(--color-ink)); } }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--small { position: relative; min-height: var(--control); padding: 0 var(--space-2xs); font-size: var(--text-sm); }
.btn--small::before { content: ""; position: absolute; inset: -6px 0; }

.entry { overflow: hidden; border-radius: var(--radius); background: var(--color-paper-2); }
.entry__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); padding: var(--space-xs) var(--space-sm); background: var(--color-head); color: var(--color-head-ink); }
.entry__head h2 { font-size: var(--text-md); letter-spacing: -0.01em; color: var(--color-head-ink); }
.entry__figure { display: flex; align-items: baseline; gap: var(--space-sm); }
.entry__count { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-xl); line-height: 1; letter-spacing: var(--tracking-display); }
.entry__time { font-family: var(--font-outlier); font-size: var(--text-sm); color: var(--color-head-muted); }
.entry__body { padding: var(--space-2xs) var(--space-sm) var(--space-sm); }
.entry__aside { font-size: var(--text-sm); color: var(--color-muted); }
.js .entry[data-state="client"] .entry__body { display: none; }
.entry__error { margin: 0; padding: var(--space-sm); overflow-x: auto; background: var(--color-error-soft); font: var(--text-sm)/1.2 var(--font-outlier); color: var(--color-ink); white-space: pre-wrap; overflow-wrap: break-word; }
.muted { color: var(--color-muted); }

.table-wrap { overflow-x: auto; max-height: min(70dvh, 44rem); overflow-y: auto; }
.matches { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.matches th { padding: var(--space-2xs) var(--space-xs) var(--space-2xs) 0; font-weight: 500; text-align: left; color: var(--color-muted); white-space: nowrap; }
.matches td { padding: var(--space-3xs) var(--space-xs) var(--space-3xs) 0; vertical-align: baseline; line-height: 1.2; }
.matches tbody:nth-of-type(even) td { background: var(--tint-stripe); }
.matches td.num { font-family: var(--font-outlier); white-space: nowrap; color: var(--color-ink-2); }
.matches__match td { padding-top: var(--space-2xs); }
.matches__match td:first-child { font-weight: 500; }
.matches__group td { padding-top: 0; color: var(--color-muted); }
.matches__group td:first-child { font-family: var(--font-outlier); }
.value { font-family: var(--font-outlier); color: var(--color-ink); background: var(--color-accent-soft); border-radius: var(--radius); padding: 0 var(--space-2xs); white-space: pre-wrap; overflow-wrap: break-word; }
.matches__group .value { background: var(--color-paper-3); }
.group-name { margin-right: var(--space-xs); font-weight: 500; color: var(--color-ink-2); }
.matches :is(th, td):first-child { padding-left: var(--space-xs); }
.matches tbody[data-select] { cursor: pointer; }
.matches tbody[data-select] td { transition: background-color var(--dur-short) var(--ease-out); }
.matches tbody.is-lit td { background: var(--color-paper-3); }
.matches tbody[data-select]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.matches tbody[data-select]:active td { background: var(--color-accent-soft); }

.entry__skeleton { display: none; }
.results[aria-busy="true"] .entry:is([data-state="full"], [data-state="none"]) .entry__body { display: none; }
.results[aria-busy="true"] .entry:is([data-state="full"], [data-state="none"]) .entry__skeleton { display: grid; gap: var(--space-xs); padding: var(--space-sm); }
.entry__skeleton span { height: var(--space-xs); border-radius: var(--radius); background: var(--color-paper-3); transform-origin: left; animation: skeleton 1.2s var(--ease-in-out) infinite alternate; }
.entry__skeleton span:nth-child(2n) { transform: scaleX(0.7); }
@keyframes skeleton { from { opacity: 0.5; } to { opacity: 1; } }

.results__offline { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-error); }

@media (prefers-reduced-motion: reduce) {
  .entry__skeleton span { animation: none; }
  .btn, .flags label { transition: background-color var(--dur-short) linear; }
}
@media (max-width: 40rem) {
  .redos-block { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-sm); }
  .params { position: static; }
  .params__panel { left: 0; right: 0; width: auto; }
  .redos__facts > div { grid-template-columns: minmax(0, 1fr); gap: var(--space-2xs); }
  .literal { padding-left: var(--space-xs); }
  .flags label { min-width: 22px; }
  .wordmark { font-size: var(--text-md); }
  .js:not([data-code="hidden"]) .code > .literal, .js:not([data-code="hidden"]) .test > .field, .js:not([data-code="hidden"]) .test-add { margin-left: var(--space-sm); }
}
.bar__link { margin-left: auto; }
.bar__link + .mode { margin-left: 0; }
.plain { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); padding-block: var(--space-sm) var(--space-xl); }
.log__head, .log__pages { display: flex; align-items: center; gap: var(--space-sm); }
.log__head { justify-content: space-between; }
.log__head h1 { font-size: var(--text-lg); }
.log__pages { justify-content: center; }
.log__count { font-size: var(--text-sm); color: var(--color-muted); }
.log { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; background: var(--color-paper-2); }
.log > li:nth-child(even) { background: var(--tint-stripe); }
.log > .log__item--redos { background: var(--tint-redos); }
.log > .log__item--redos:nth-child(even) { background: var(--tint-redos-2); }
.log__line { min-height: 24px; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: var(--space-2xs) var(--space-sm); align-items: baseline; padding: var(--space-2xs) var(--space-sm); font-size: var(--text-sm); list-style: none; cursor: pointer; }
.log__line::-webkit-details-marker { display: none; }
.log__line::before { content: "\25B8"; color: var(--color-muted); }
.log__row[open] > .log__line::before { content: "\25BE"; }
.log__time, .log__run { color: var(--color-muted); white-space: nowrap; }
.log__literal { overflow: hidden; font-family: var(--font-outlier); color: var(--color-ink); white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 40rem) {
  .log__line { grid-template-columns: auto minmax(0, 1fr) auto; }
  .log__literal { grid-row: 2; grid-column: 2 / -1; }
}
.log__facts { display: grid; gap: var(--space-2xs); margin: 0; padding: var(--space-2xs) var(--space-sm) var(--space-sm); }
.log__facts > div { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: var(--space-sm); align-items: baseline; }
.log__facts dt { font-size: var(--text-sm); font-weight: 500; color: var(--color-muted); }
.log__facts dd { margin: 0; min-width: 0; font-size: var(--text-sm); }
.log__text { margin: 0; padding: var(--space-2xs); background: var(--color-paper-3); font: var(--text-sm)/1.2 var(--font-outlier); color: var(--color-ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.prose { display: grid; gap: var(--space-sm); max-width: 70ch; font-size: var(--text-md); line-height: 1.4; }
.prose h1 { font-size: var(--text-xl); }
.prose h2 { margin-top: var(--space-sm); font-size: var(--text-lg); }
.prose p, .prose ul { margin: 0; }
.prose ul { padding-left: var(--space-lg); }
.prose a { color: var(--color-ink); }
