:root {
  --paper: #f4f3ef;
  --ink: #252521;
  --muted: #777970;
  --rule: #dedfd7;
  --accent: #167c68;
  --accent-soft: #dcebe5;
  background: var(--paper);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-synthesis: none;
}
body.handoff { display: block; cursor: default; background: var(--paper); }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.eyebrow, .section-heading > span, .timeline, .small-note, .background-key { font-family: "SFMono-Regular", "Menlo", "PingFang SC", monospace; }
.workspace { display: grid; grid-template-columns: minmax(300px, 430px) minmax(0, 680px); justify-content: center; gap: clamp(40px, 6vw, 100px); max-width: 1320px; margin: 0 auto; padding: 38px 40px 80px; align-items: start; }
.preview-panel { position: sticky; top: 26px; text-align: center; }
.device { width: min(375px, max(250px, calc((100svh - 265px) * 375 / 812))); margin: auto; overflow: hidden; border-radius: 18px; box-shadow: 0 0 0 1px #d5d7ce, 0 16px 42px -20px #393e3540; background: white; }
.handoff .screen { width: 100%; cursor: pointer; }
.preview-controls { display: flex; gap: 8px; justify-content: center; margin: 20px 0 15px; }
button { border: 1px solid #d3d6cc; padding: 9px 13px; color: var(--ink); background: transparent; border-radius: 6px; font-size: 12px; cursor: pointer; }
button:hover { background: #e8e9e1; }
#replay { color: white; background: var(--accent); border-color: var(--accent); }
#replay:hover { background: #116452; }
.content-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #5c6056; cursor: pointer; }
.content-toggle input { accent-color: var(--accent); margin: 0; }
.preview-note { font-size: 11px; color: #92958a; margin: 10px 0 0; }
.eyebrow { color: var(--accent); font-size: 11px; letter-spacing: 1px; margin: 0 0 10px; }
h1 { font-size: clamp(28px, 3vw, 36px); line-height: 1.25; font-weight: 600; letter-spacing: -1px; margin: 0 0 12px; }
.intro > p:last-of-type { font-size: 14px; color: #63675c; margin: 0; line-height: 1.8; }
.inventory { display: flex; align-items: center; gap: 24px; padding: 20px 0 22px; margin-top: 20px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.inventory strong { font-family: "Menlo", monospace; font-size: 32px; line-height: 1; font-weight: 500; white-space: nowrap; }
.inventory strong span { font-family: "PingFang SC", sans-serif; font-size: 12px; color: #666c60; }
.inventory p { margin: 0; font-size: 12px; line-height: 1.9; color: #666c60; }
.motion-section { margin-top: 32px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
h2 span { font-family: "Menlo", monospace; font-weight: 400; color: var(--accent); font-size: 12px; margin-right: 12px; }
.section-heading > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.section-description, .motion-copy { font-size: 13px; line-height: 1.9; color: #60665a; }
.section-description { margin: 12px 0 18px; }
.timeline { --label: 62px; font-size: 10px; }
.timeline-scale, .timeline-row { display: grid; grid-template-columns: var(--label) minmax(0, 1fr); gap: 8px; }
.timeline-scale { margin-bottom: 8px; color: #91958a; }
.timeline-scale > div { display: flex; justify-content: space-between; font-size: 9px; }
.timeline-row { min-height: 36px; align-items: center; }
.row-label { color: #5f6558; white-space: nowrap; font-size: 11px; }
.track { position: relative; height: 29px; background: repeating-linear-gradient(to right, #d9ddd3 0, #d9ddd3 1px, transparent 1px, transparent 25%); }
.bar { position: absolute; left: var(--start); width: var(--length); top: 2px; height: 24px; display: flex; align-items: center; padding: 0 9px; border-radius: 3px; background: var(--accent-soft); color: #216c56; font-size: 10px; white-space: nowrap; }
.entrance-timeline { padding-right: 66px; }
.track small { position: absolute; right: -66px; top: 8px; width: 58px; text-align: right; color: #606a57; font-size: 10px; white-space: nowrap; }
.playhead-area { position: relative; }
.playhead { position: absolute; z-index: 2; pointer-events: none; left: calc(var(--label) + 8px); top: 0; bottom: 0; width: 1px; background: #167c6860; }
.playhead::before { content: ""; position: absolute; top: -2px; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.motion-copy { margin-top: 16px; }
.motion-copy p { margin: 7px 0; }
.motion-copy b { color: #353e2f; font-weight: 500; margin-right: 3px; }
.motion-details { margin-top: 12px; border-bottom: 1px solid var(--rule); padding-bottom: 16px; font-size: 11px; color: #747c6a; }
summary { cursor: pointer; color: #55715f; width: fit-content; }
dl { display: grid; grid-template-columns: 100px 1fr; gap: 8px; line-height: 1.7; margin: 14px 0 0; }
dd { margin: 0; }
.background-key { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; color: #717a65; font-size: 10px; flex-wrap: wrap; }
.background-key > span { display: flex; align-items: center; gap: 5px; }
.background-key i { width: 8px; height: 8px; display: inline-block; border-radius: 2px; }
.key-up { background: #d6e8df; }
.key-down { background: #e5e6d4; }
.loop-leg { position: absolute; top: 3px; left: var(--start); width: var(--length); height: 23px; display: flex; align-items: center; justify-content: center; font-size: 10px; border-radius: 3px; }
.loop-leg.up { background: #d6e8df; color: #276b50; }
.loop-leg.down { background: #e5e6d4; color: #737548; }
.loop-track { background-size: 100%; background: repeating-linear-gradient(to right, #d9ddd3 0, #d9ddd3 1px, transparent 1px, transparent 33.333333%); }
.loop-repeat { position: absolute; top: 7px; margin-left: 5px; color: #80936c; font-size: 13px; }
.loop-dot { position: absolute; z-index: 1; top: 12px; width: 5px; height: 5px; margin-left: -2px; background: #2c5945; border-radius: 50%; pointer-events: none; }
.small-note { font-size: 10px; color: #89917e; line-height: 1.9; margin: 10px 0 0; }
.exit-bar { left: 0; width: 100%; background: #e5e7df; color: #68715d; }
@media (max-width: 940px) {
  .workspace { grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 30px; padding: 28px 24px 60px; }
  .inventory { align-items: flex-start; gap: 12px; flex-direction: column; }
}
@media (max-width: 690px) {
  .workspace { grid-template-columns: 1fr; gap: 42px; padding: 24px 20px 60px; }
  .preview-panel { position: static; }
  .device { width: min(320px, 100%); }
  .notes-panel { max-width: 600px; width: 100%; margin: auto; }
  .inventory { flex-direction: row; align-items: center; gap: 20px; }
  .timeline { --label: 50px; }
  .bar { padding: 0 5px; font-size: 9px; }
}
