:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #15291f;
  background: #f4f7f2;
  line-height: 1.6;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: #18523c; }
a:focus-visible, button:focus-visible { outline: 3px solid #2465b7; outline-offset: 4px; }

.shell {
  width: min(52rem, calc(100% - 2rem));
  margin-inline: auto;
}

header { padding-block: 1.75rem; }
.wordmark { color: inherit; font-weight: 800; font-size: 1.35rem; text-decoration: none; }
.wordmark span { color: #286b4d; }
main { padding-block: clamp(2rem, 7vw, 4.5rem) 2rem; }
h1 { max-width: 18ch; font-size: clamp(2.1rem, 6vw, 4rem); line-height: 1.1; letter-spacing: -.045em; margin: .35rem 0 1rem; }
.lede { max-width: 42rem; font-size: 1.15rem; }
.eyebrow { color: #38564a; font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; }

.cards, .measurements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); gap: 1rem; }
.card { padding: 1.25rem; border: 1px solid #cbd9cd; border-radius: 1rem; background: #fff; }
a.card { display: grid; gap: .35rem; color: inherit; text-decoration: none; }
a.card:hover { border-color: #286b4d; }
a.card strong { color: #18523c; font-size: 1.25rem; text-decoration: underline; }
.measurements dt { font-weight: 650; }
.measurements dd { margin: .2rem 0 0; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
meter { display: block; width: 100%; height: 1.4rem; }
label + select { display: block; width: 100%; max-width: 24rem; padding: .4rem .5rem; margin-block: .2rem .6rem; font: inherit; }
.volume { display: block; width: 100%; height: 6rem; margin-block: .6rem 0; border: 1px solid #cbd9cd; border-radius: .5rem; background: #fff; }
.volume[hidden] { display: none; }
.actions + .actions { margin-block-start: .75rem; }
.feedback { min-height: 1.6em; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

button {
  border: 1px solid #18523c;
  border-radius: .55rem;
  background: #18523c;
  color: white;
  padding: .55rem .9rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { color: #415349; background: #e1e8e0; border-color: #cbd9cd; cursor: default; }
footer { color: #38564a; border-top: 1px solid #cbd9cd; padding-block: 1rem 2rem; }

.test-area {
  min-height: 12rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  border: 2px dashed #46725f;
  border-radius: .65rem;
  text-align: center;
}
.test-area:focus-visible { outline: 3px solid #2465b7; outline-offset: 4px; }
.preview { width: min(100%, 38rem); aspect-ratio: 4 / 3; object-fit: contain; background: #15291f; }
.pixel-panel {
  display: flex;
  align-items: end;
  min-height: 22rem;
  padding: .75rem;
  background: #000;
}
.pixel-panel[data-color="white"] { background: #fff; }
.pixel-panel[data-color="red"] { background: #f00; }
.pixel-panel[data-color="green"] { background: #0f0; }
.pixel-panel[data-color="blue"] { background: #00f; }
.pixel-panel[data-pattern="grayscale"] {
  background: linear-gradient(to right, #000 20%, #404040 20% 40%, #808080 40% 60%, #bfbfbf 60% 80%, #fff 80%);
}
.pixel-panel[data-pattern="gradient"] { background: linear-gradient(to right, #000, #fff); }
.pixel-panel[data-pattern="contrast"] {
  background: conic-gradient(#111 25%, #eee 0 50%, #111 0 75%, #eee 0) 0 0 / 5rem 5rem;
}
.pixel-panel:fullscreen { width: 100%; height: 100%; }
.pixel-controls { display: grid; gap: .35rem; padding: .5rem; border-radius: .55rem; background: #fff; }
.pixel-controls p { margin: 0; }
.checklist { padding-inline-start: 1.5rem; }
.checklist li { margin-block: .75rem; }

#touch-area {
  display: block;
  width: 100%;
  background: #edf5ee;
  outline: 2px dashed #46725f;
  border-radius: .5rem;
  touch-action: none;
}

main > .card + .card { margin-block-start: 1rem; }
fieldset { min-width: 0; }
fieldset > .actions + .actions { margin-block-start: 1rem; }
input, textarea { font: inherit; }
input:focus-visible, textarea:focus-visible { outline: 3px solid #2465b7; outline-offset: 2px; }
.rule-dimensions { display: flex; flex-wrap: wrap; gap: .75rem; }
.rule-dimensions input { display: block; width: 8rem; max-width: 100%; }
.share-fields { display: grid; gap: .55rem; }
.share-fields textarea { width: 100%; min-width: 0; padding: .4rem; resize: vertical; }
.share-fields button { justify-self: start; }
.share-fields p { margin-block: 0; }

.call-nav { margin-block-start: 1rem; }

.quick-check h1 { max-width: 23ch; }
.primary-reading {
  margin: 0;
  font-size: clamp(1.7rem, 7vw, 3.2rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.quick-check details { margin-block: 1rem; }
.quick-check summary { cursor: pointer; }
.quick-report { width: 100%; }

.quick-check #stop:disabled { display: none; }

/* Viewport page: compact reading-first card, scoped to avoid other tools. */
.viewport-result {
  max-width: 26rem;
  margin-inline: auto;
  text-align: center;
}
.viewport-result .reading-label { max-width: none; margin: 0 0 .3rem; font-size: 1.05rem; }
.viewport-result .primary-reading { margin: 0; }
.viewport-result .reading-unit {
  display: inline-block;
  margin-inline-start: .3em;
  font-size: max(.85rem, .42em);
  font-weight: 650;
  color: #38564a;
  white-space: nowrap;
}
.viewport-result .reading-unit[hidden] { display: none; }
.viewport-result .secondary { background: #fff; color: #18523c; }
.viewport-page details .measurements, .screen-page details .measurements { grid-template-columns: 1fr; }
.viewport-page details p, .screen-page details p { max-width: 42rem; }

/* Screen checks share one display area; frame estimates stay above it. */
.site-header.compact, .home-site .site-header { padding-block: .55rem; }
.home-site .wordmark, .screen-site .wordmark { font-size: 1.15rem; }
.screen-page { padding-block: .4rem .6rem; }
.screen-page .viewport-result { max-width: none; padding-block: 1rem; }
.screen-page .facts-line { margin: .25rem 0 0; font-size: .9rem; color: #38564a; font-variant-numeric: tabular-nums; }
.screen-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-block: .5rem 0; }
.screen-actions button { padding-inline: .65rem; font-size: .9rem; min-height: 44px; }
.screen-page section[hidden] { display: none; }
.screen-page #refresh-rate:not([hidden]) { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: .2rem .6rem; text-align: center; margin: 0 0 .4rem; }
.screen-page #refresh-rate h2 { display: inline; font-size: .85rem; margin: 0; color: #38564a; }
.screen-page #refresh-rate .feedback { margin: 0; font-size: 1rem; font-weight: 650; min-height: 0; }
.screen-page .pixel-panel { margin: 0; height: clamp(8rem, calc(100svh - 24rem), 22rem); min-height: 0; padding: .5rem; }
.screen-page .pixel-panel:fullscreen { height: 100%; }
.screen-page .pixel-controls { width: 100%; font-size: .8rem; }
.screen-page .pixel-controls .actions { gap: .35rem; }
.screen-page .pixel-controls button { min-height: 44px; padding: .4rem .5rem; }
.screen-page #copy-status { text-align: center; margin: .2rem 0; min-height: 0; }
.screen-page #copy-status:empty { display: none; }
.screen-page details { margin-block: .5rem 0; font-size: .85rem; }
.home-site .site-footer, .screen-site .site-footer { padding-block: .5rem; gap: .2rem; font-size: .8rem; }
.home-site .site-footer p, .screen-site .site-footer p { font-size: .75rem; }

.filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: 0 1.25rem; }
.filters button { background: #fff; color: #18523c; }
.filters button[aria-pressed="true"] { background: #18523c; color: #fff; }
.cards [hidden] { display: none; }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a { font-weight: 650; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { text-decoration: underline; }

/* Four complete, concise entries fit together on compact screens. */
.home { padding-block: .5rem .75rem; }
.home .hero h1 { max-width: none; font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 0 0 .6rem; letter-spacing: -.02em; }
.home .site-search { max-width: none; margin-block-end: .75rem; }
.home .site-search .feedback:empty { display: none; }
.cards.main-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.cards.main-tools .card { padding: .75rem; gap: .4rem; align-content: start; overflow-wrap: anywhere; border-radius: .7rem; }
.cards.main-tools a.card strong { font-size: 1rem; line-height: 1.35; text-decoration: none; }
.cards.main-tools .card-desc { font-size: .85rem; line-height: 1.4; color: #38564a; }

.jump-nav { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; margin-block: 0 1.25rem; }
.jump-nav a { font-weight: 650; }

#call-check { display: grid; gap: 1rem; }
main.shell > section + section { margin-block-start: 1rem; }
.section-heading { font-size: 1.3rem; margin: 1.5rem 0 .5rem; }
.pixel-section .pixel-panel { margin-block-start: 0; }

.site-search { position: relative; max-width: 34rem; }
.site-search input { display: block; width: 100%; padding: .7rem .9rem; border: 1px solid #46725f; border-radius: .65rem; }
.search-results { position: absolute; inset-inline: 0; top: calc(100% + .35rem); z-index: 10; margin: 0; padding: .35rem; list-style: none; background: #fff; border: 1px solid #cbd9cd; border-radius: .65rem; box-shadow: 0 .35rem 1rem rgb(21 41 31 / 12%); }
.search-results li { display: grid; gap: .1rem; padding: .5rem .65rem; border-radius: .5rem; cursor: pointer; }
.search-results li[aria-selected="true"] { background: #e9f2ec; }
.search-results .result-category { color: #38564a; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.search-results .result-desc { color: #38564a; font-size: .85rem; }

.card-meta { color: #38564a; font-size: .85rem; }

.site-footer { display: grid; gap: .35rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.site-footer p { margin: 0; font-size: .9rem; }

.prose { max-width: 42rem; }
.prose p { margin-block: .9rem; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .45rem; margin-block: 0 .2rem; font-size: .8rem; color: #38564a; }
.breadcrumb a { color: #18523c; }
.breadcrumb [aria-current="page"] { color: inherit; font-weight: 700; }
.related { margin-block-start: 1.5rem; }
.related h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.related ul { display: flex; flex-wrap: wrap; gap: .35rem 1.1rem; padding: 0; margin: 0; list-style: none; }
.local-note { color: #38564a; }
