:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #202a29;
  background: #ffffff;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #278177;
  outline-offset: 3px;
}
header {
  height: 88px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #dfdfd6;
}
.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  color: inherit;
  text-decoration: none;
}
.brand span {
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  color: #77817b;
  margin-left: 12px;
}
button {
  background: #fffef9;
  border: 1px solid #d7dcd4;
  border-radius: 9px;
  padding: 10px 13px;
  color: #30423b;
  transition: background 0.15s;
}
button:hover {
  background: #eaf0e5;
}
kbd {
  font: 11px monospace;
  margin-left: 10px;
  color: #738074;
  border: 1px solid #ccd4cb;
  padding: 2px 4px;
  border-radius: 3px;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  max-width: 1500px;
  margin: auto;
  min-height: calc(100vh - 88px);
}
.stage {
  padding: 70px 6% 40px;
  text-align: center;
  align-self: start;
  position: sticky;
  top: 0;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #69796a;
}
h1 {
  font-family: Georgia, serif;
  font-size: clamp(34px, 4vw, 58px);
  letter-spacing: -2px;
  font-weight: 400;
  line-height: 1.1;
  margin: 22px 0 18px;
}
.intro {
  color: #778076;
  font-size: 14px;
  line-height: 1.8;
}
.now {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  color: #68786c;
  font-size: 11px;
  margin-top: 28px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #559666;
}
.separator {
  color: #b2b9ad;
}
.presets {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}
.presets button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}
.presets strong {
  font-size: 13px;
  margin-left: 6px;
}
.presets i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.range {
  background: #63a46e;
}
.high {
  background: #dc9a45;
}
.low {
  background: #d26e5a;
}
#feedback {
  font-size: 11px;
  min-height: 30px;
  color: #738072;
  margin-top: 23px;
}
.disclosure {
  font-size: 8px;
  letter-spacing: 1.7px;
  color: #9ba393;
  margin-top: 35px;
}
.controller {
  border-left: 1px solid #dfdfd6;
  padding: 32px 28px;
  background: #ffffff;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.panel-heading h2 {
  font-size: 22px;
  letter-spacing: -0.7px;
  margin: 8px 0 0;
}
.panel-heading .eyebrow {
  font-size: 8px;
}
.badge {
  font-size: 9px;
  letter-spacing: 1px;
  background: #e7ecdf;
  padding: 7px;
  color: #69805e;
  border-radius: 4px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10px;
  color: #61715f;
  margin: 12px 0;
}
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid #dce0d5;
  background: #fffefb;
  color: #304139;
  border-radius: 7px;
  padding: 10px;
  font-size: 12px;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}
.check {
  flex-direction: row;
  align-items: center;
  font-size: 11px;
}
.check input {
  width: 14px;
  height: 14px;
  accent-color: #55775a;
}
.controls-section,
details {
  border-top: 1px solid #e2e5da;
  margin-top: 22px;
  padding-top: 16px;
}
h3,
summary {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 13px;
}
summary {
  cursor: pointer;
}
.hint {
  font-size: 10px;
  line-height: 1.7;
  color: #84907d;
}
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.actions button,
#greet,
#next {
  font-size: 10px;
  padding: 9px;
}
.rotation-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.rotation-options label {
  margin: 5px 0;
}
#next {
  width: 100%;
}
[hidden] {
  display: none !important;
}
virtual-sugar-clock {
  display: block;
  margin: 64px auto 0;
  max-width: 760px;
}
body.filming header,
body.filming .controller,
body.filming .stage > :not(virtual-sugar-clock) {
  display: none;
}
body.filming main {
  display: block;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}
body.filming .stage {
  width: 100%;
  position: static;
  align-self: center;
  padding: 50px;
  max-width: 1300px;
}
body.filming virtual-sugar-clock {
  margin: 0 auto;
  max-width: 1100px;
}
#exit-film {
  position: fixed;
  right: 20px;
  bottom: 20px;
  opacity: 0.25;
  font-size: 10px;
}
#exit-film:hover,
#exit-film:focus {
  opacity: 1;
}
@media (max-width: 950px) {
  main {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .controller {
    padding: 26px 20px;
  }
  .stage {
    padding: 50px 25px;
  }
  .presets {
    flex-wrap: wrap;
  }
  .presets button {
    font-size: 10px;
  }
  .wide {
    display: none;
  }
}
@media (max-width: 720px) {
  header {
    height: 70px;
    padding: 0 20px;
  }
  .brand span {
    display: none;
  }
  main {
    display: block;
  }
  .stage {
    position: static;
    padding: 42px 20px 30px;
  }
  .controller {
    border-left: 0;
    border-top: 1px solid #dfdfd6;
  }
  .intro {
    font-size: 12px;
  }
  virtual-sugar-clock {
    margin-top: 42px;
  }
  .presets {
    gap: 5px;
  }
  .presets button {
    padding: 8px;
  }
  .presets strong {
    margin: 0;
  }
  body.filming .stage {
    padding: 20px;
  }
}

#record-pixels {
  width: 100%;
  background: #e5ecdf;
}
body.filming.pixels-only {
  background: #ffffff;
}
body.filming.pixels-only #exit-film {
  display: none;
}
body.filming.pixels-only .stage {
  padding: 0;
  max-width: none;
}
body.filming.pixels-only virtual-sugar-clock {
  max-width: none;
  width: 100%;
  outline: none;
}

.controller .presets {
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.controller .presets button {
  justify-content: flex-start;
  font-size: 12px;
}
.controller .presets strong {
  margin-left: auto;
}
.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px 22px;
  margin: 40px 0 20px;
  text-align: left;
}
.comparison-grid figure {
  margin: 0;
  min-width: 0;
}
.comparison-grid figcaption {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 12px;
  color: #526257;
}
.comparison-grid virtual-sugar-clock {
  margin: 0;
  width: 100%;
  max-width: none;
}
body.comparing .stage {
  position: static;
}
body.comparing .stage h1 {
  font-size: 38px;
}
body.comparing .stage .intro {
  display: none;
}
body.filming.comparing .stage > #comparison-grid {
  display: grid;
}
body.filming.comparing {
  background: #fff;
}
body.filming.comparing .stage {
  padding: 36px;
  max-width: 1400px;
}
body.filming.comparing .comparison-grid {
  margin: 0;
  gap: 30px;
}
body.filming.comparing .comparison-grid virtual-sugar-clock {
  margin: 0;
  max-width: none;
}
@media (max-width: 720px) {
  .comparison-grid {
    gap: 22px 12px;
    margin-top: 30px;
  }
  .comparison-grid figcaption {
    font-size: 10px;
  }
  .stage:has(.comparison-grid:not([hidden])) {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.comparison-grid:focus {
  outline: none;
}

/* The presentation area contains only clocks; status copy stays in the controller. */
.stage {
  min-height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.stage > virtual-sugar-clock {
  width: 100%;
  margin: 0 auto;
}
.stage .comparison-grid {
  margin: 0;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 720px) {
  .stage {
    min-height: 320px;
  }
}

/* Keep the desktop stage independent of the active controls' content height. */
@media (min-width: 721px) {
  body:not(.filming) {
    height: 100dvh;
    overflow: hidden;
  }
  body:not(.filming) main {
    height: calc(100dvh - 88px);
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
  }
  body:not(.filming) .stage {
    height: 100%;
    min-height: 0;
    min-width: 0;
    position: relative;
    top: auto;
    align-self: stretch;
    padding-top: 40px;
    padding-bottom: 40px;
    overflow-y: auto;
    scrollbar-gutter: stable both-edges;
    overflow-anchor: none;
  }
  body:not(.filming).comparing .stage {
    justify-content: flex-start;
  }
  body:not(.filming) .controller {
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    scrollbar-gutter: stable;
    overflow-anchor: none;
    overscroll-behavior: contain;
  }
  body:not(.filming) #feedback {
    min-height: 36px;
  }
}

/* Anchor the single device independently of form height, focus scrolling, and gutters. */
@media (min-width: 721px) {
  body:not(.filming) main {
    position: fixed;
    inset: 88px 0 0;
    height: auto;
    margin: 0 auto;
  }
  body:not(.filming) .controller {
    contain: layout style;
    overflow-x: hidden;
  }
  body:not(.filming):not(.comparing) .stage {
    overflow: hidden;
    scrollbar-gutter: auto;
  }
  body:not(.filming):not(.comparing) #main-device {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(88% - 30px);
    max-width: 760px;
    margin: 0;
  }
}
