:root {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #30292a;
  background: #f2eee7;
  font-size: 16px;
  font-synthesis: none;
  accent-color: #853744;
  --accent: #853744;
  --ink-soft: #756760;
  --line: #d9cec1;
  --paper: #fffaf2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1240px; margin: 0 auto; padding: 0 24px max(22px, env(safe-area-inset-bottom)); }
.page-header { padding: max(22px, env(safe-area-inset-top)) 0 18px; }
.page-links { display: flex; gap: 18px; float: right; padding-top: 3px; }
a { color: #742d3a; text-underline-offset: 4px; }
.page-links a { font-size: .8125rem; font-weight: 600; }
.eyebrow { margin: 0 0 6px; color: #84634d; font-size: .75rem; letter-spacing: .12em; font-weight: 700; }
h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.3rem); line-height: 1.45; letter-spacing: .05em; }
.intro { margin: 6px 0 0; font-size: .875rem; line-height: 1.75; color: #675950; }
.mobile-break { display: none; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
button { appearance: none; min-height: 44px; padding: 10px 16px; border: 1px solid #c9bbad; border-radius: 9px; background: var(--paper); color: inherit; font: inherit; font-size: .8125rem; font-weight: 650; line-height: 1.4; cursor: pointer; touch-action: manipulation; }
button:hover:not(:disabled) { background: #f7e9d9; }
button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: #fffaf4; }
button[aria-pressed="true"]:hover:not(:disabled) { background: #71303b; }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, canvas:focus-visible { outline: 3px solid #996025; outline-offset: 3px; }
.action-controls { margin-bottom: 18px; }
.action-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.action-tabs button { display: flex; gap: 10px; align-items: center; justify-content: center; min-height: 52px; font-size: .9375rem; }
.action-tabs button span { font-size: .6875rem; font-variant-numeric: tabular-nums; opacity: .65; font-weight: 500; }
.motion-stage { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); overflow: hidden; }
.stage-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.action-heading { display: flex; align-items: baseline; gap: 12px; }
h2 { margin: 0; font-size: 1rem; line-height: 1.5; }
.duration-note { color: var(--ink-soft); font-size: .75rem; white-space: nowrap; }
.display-switch { display: flex; gap: 4px; }
.display-switch button { min-height: 36px; padding: 7px 10px; font-size: .75rem; }
.display-switch button[aria-pressed="true"] { background: #5c5048; border-color: #5c5048; }
.viewports { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: #c4b397; }
.viewports[data-comparison="false"] { grid-template-columns: minmax(0, 1fr); }
.motion-pane { position: relative; min-width: 0; margin: 0; height: clamp(310px, 48vw, 500px); background: #d4c2a6; }
.motion-pane figcaption { position: absolute; z-index: 1; top: 13px; left: 13px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; max-width: calc(100% - 26px); padding: 7px 10px; border: 1px solid #ffffff80; border-radius: 7px; background: #fffaf1e8; color: #453c34; font-size: .8125rem; font-weight: 750; pointer-events: none; }
.pane-dot { display: block; width: 6px; height: 6px; background: #897869; border-radius: 50%; flex: none; }
.after-pane .pane-dot { background: var(--accent); }
.pane-caption { font-size: .6875rem; font-weight: 500; color: #817061; margin-left: 3px; }
canvas { display: block; width: 100%; height: 100%; outline-offset: -4px !important; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }
.stage-message { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; padding: 28px; text-align: center; color: #584737; background: #e9dcc7f5; font-size: .875rem; line-height: 1.7; }
.stage-message p { max-width: 340px; margin: 0; }
.loading-mark { width: 27px; height: 27px; border: 3px solid #cbb296; border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.failure { color: #742d3a; }
.failure button { margin-top: 3px; }
.action-description { min-height: 44px; margin: 0; padding: 12px 16px; font-size: .8125rem; line-height: 1.7; color: #615046; }
.marker-guide { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; margin: 0; padding: 0 16px 12px; color: #75604f; font-size: .6875rem; line-height: 1.6; }
.marker-key { display: inline-flex; align-items: center; gap: 5px; }
.marker-key i { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; }
.marker-left { background: #b13b47; }
.marker-right { background: #3973ad; }
.marker-release { background: #b58b2e; }
.playback-controls { padding: 18px 1px 0; }
.playback-row, .camera-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.playback-buttons, .speed-control, .angle-control, .zoom-control { display: flex; align-items: center; gap: 7px; }
.primary-button { min-width: 106px; color: #fffaf4; background: var(--accent); border-color: var(--accent); }
.primary-button:hover:not(:disabled) { background: #71303b; }
.control-label { margin-right: 2px; color: var(--ink-soft); font-size: .75rem; }
.speed-control button { padding-inline: 13px; }
.speed-control small { margin-left: 3px; font-weight: 500; }
.scrub { margin: 18px 0 17px; }
.scrub label { display: flex; justify-content: space-between; gap: 12px; color: #65554b; font-size: .75rem; }
output { color: #41362f; font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 32px; margin: 3px 0 0; cursor: pointer; touch-action: pan-y; }
.time-marks { display: flex; justify-content: space-between; padding: 0 4px; color: #8a796b; font-size: .625rem; font-variant-numeric: tabular-nums; }
.camera-row { padding-top: 15px; border-top: 1px solid var(--line); }
.angle-control button { min-width: 54px; }
.icon-button { min-width: 44px; padding: 7px 10px; font-size: 1.125rem; }
.page-footer { margin-top: 15px; }
.page-footer p { margin: 5px 0; color: var(--ink-soft); font-size: .75rem; line-height: 1.7; }
#playback-status { color: #785044; }
.no-script { padding: 15px; color: #742d3a; background: #fffaf2; border: 1px solid #c9bbad; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 680px) {
  main { padding-right: 14px; padding-left: 14px; }
  .page-header { padding-top: max(15px, env(safe-area-inset-top)); padding-bottom: 14px; }
  .page-links { gap: 13px; }
  .page-links a { font-size: .75rem; }
  .eyebrow { font-size: .6875rem; }
  .intro { font-size: .8125rem; }
  .action-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .action-tabs button { min-height: 44px; justify-content: flex-start; padding: 9px 12px; gap: 8px; font-size: .8125rem; }
  .action-controls { margin-bottom: 12px; }
  .stage-heading { padding: 10px; gap: 8px; }
  .action-heading { gap: 7px; }
  h2 { font-size: .8125rem; }
  .duration-note { display: none; }
  .display-switch { gap: 3px; }
  .display-switch button { min-height: 36px; padding: 7px 8px; font-size: .6875rem; }
  .motion-pane { height: clamp(285px, 66vw, 390px); }
  .motion-pane figcaption { top: 8px; left: 8px; max-width: calc(100% - 16px); padding: 6px 8px; font-size: .75rem; gap: 6px; }
  .pane-caption { display: none; }
  .action-description { padding: 10px 12px; min-height: 61px; font-size: .75rem; }
  .marker-guide { padding: 0 12px 10px; gap: 4px 9px; }
  .playback-controls { padding-top: 14px; }
  button { padding: 9px 12px; font-size: .75rem; }
  .playback-row { gap: 9px; }
  .playback-buttons, .speed-control, .angle-control, .zoom-control { gap: 5px; }
  .primary-button { min-width: 80px; }
  .speed-control .control-label { display: none; }
  .speed-control button { padding-inline: 10px; }
  .speed-control small { margin-left: 2px; }
  .scrub { margin-top: 15px; margin-bottom: 14px; }
  .camera-row { gap: 8px; }
  .angle-control { gap: 5px; }
  .angle-control .control-label { display: none; }
  .angle-control button { min-width: 44px; padding-inline: 10px; }
  .zoom-control button { padding-inline: 10px; }
  .page-footer p { font-size: .6875rem; }
}
@media (max-width: 380px) {
  main { padding-right: 10px; padding-left: 10px; }
  .mobile-break { display: initial; }
  .action-heading { width: 100%; }
  .duration-note { display: inline; }
  .stage-heading { align-items: center; }
  .display-controls { margin-left: auto; }
  .stage-heading { flex-wrap: nowrap; }
  .action-heading { width: auto; }
  .duration-note { display: none; }
  .playback-row, .camera-row { justify-content: flex-start; }
  .playback-row > *, .camera-row > * { flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-mark { animation: none; }
}
