.cd-demo {
  --cd-ink: #2d2f2a;
  --cd-muted: #545650;
  --cd-line: #c5c5bd;
  --cd-forward: #454741;
  --cd-face: #52544e;
  --cd-audio: #383a34;
  --cd-tone: var(--cd-forward);
  display: grid;
  grid-template-columns: minmax(0, 1.54fr) minmax(0, 1fr);
  border: 1px solid var(--cd-line);
  background: #f7f6f2;
  color: var(--cd-ink);
  border-radius: 3px;
  overflow: hidden;
  isolation: isolate;
}

.cd-stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  position: relative;
  border-right: 1px solid var(--cd-line);
  padding: clamp(1rem, 2.2vw, 2rem) clamp(.35rem, 1vw, 1rem);
  background-color: #eeede8;
  background-image: radial-gradient(ellipse at 48% 45%, #fafaf8aa, transparent 72%),
                    radial-gradient(circle, #85857c55 .75px, transparent .85px);
  background-size: auto, 14px 14px;
}
.cd-bar, .cd-legend {
  display: flex;
  position: relative;
  z-index: 1;
  margin-inline: clamp(.65rem, 1.75vw, 1.75rem);
  align-items: center;
  font: 540 .81rem/1.4 var(--nr-mono, ui-monospace, monospace);
  color: #4a4c46;
}
.cd-bar { justify-content: space-between; }
.cd-front { display:inline-flex; gap:.45rem; align-items:center; }
.cd-front i { width:.65rem; height:.7rem; background:#676a62; clip-path:polygon(0 50%,100% 0,75% 50%,100% 100%); }
.cd-legend {
  align-items: center;
  gap: .35rem 1.3rem;
  flex-wrap: wrap;
  color: #51534c;
  margin-top: auto;
  padding-top: .4rem;
  font-weight: 400;
}
.cd-key { display: inline-flex; align-items: center; gap: .47rem; }
.cd-key i { width: 1.25rem; flex: none; color: var(--cd-tone); }
.cd-key-sight { border-top: 2px dashed currentColor; }
.cd-key-screen { height: .32rem; border-radius: 2px; background: currentColor; }
.cd-key-zone { height: .72rem; border: 2px dotted currentColor; border-radius: 50%; }
.cd-key-sound {
  height: .76rem;
  background: repeating-radial-gradient(circle at 4% 50%, transparent 0 3px, currentColor 3.7px 5px, transparent 5.6px 7px);
  clip-path: polygon(0 50%, 79% 0, 100% 0, 100% 100%, 79% 100%);
}
.cd-key-acoustic { display: none; }
.cd-demo:has(input[value="audio"]:checked) .cd-key-visual { display: none; }
.cd-demo:has(input[value="audio"]:checked) .cd-key-acoustic { display: inline-flex; }
.cd-plot { width: 100%; height: auto; display: block; margin-block:auto; filter: grayscale(1); }
.cd-vehicle { --cd-forward:#f6f6f1; --cd-face:#e6e6df; --cd-audio:#f9f9ed; filter: drop-shadow(0 6px 5px #40413b30); }
.cd-mode-layer { opacity:0; transition:opacity .48s ease; }
.cd-forward-only { color:var(--cd-forward); }
.cd-face-only { color:var(--cd-face); }
.cd-audio-only { color:var(--cd-audio); }
.cd-annotation { fill: currentColor; font: 550 15px var(--nr-font,sans-serif); }
.cd-pivot { transform:rotate(0deg); transform-origin:0 0; transition:transform .68s cubic-bezier(.22,.82,.26,1); }
.cd-screen-front,.cd-screen-side { color:#788995; transition:color .45s; }
.cd-seat-marker { stroke: var(--cd-tone); }
.cd-panel { display:flex; flex-direction:column; gap:clamp(1rem,1.75vw,1.65rem); padding:clamp(1.05rem,2vw,2rem); background:linear-gradient(145deg,#fafaf6,#f2f1eb 85%); }
.cd-selector { margin:0; padding:0; border:0; min-width:0; }
.cd-selector legend { margin:0 0 .5rem; padding:0; font-size:.875rem; line-height:1.4; color:var(--cd-muted); }
.cd-selector > div { display:flex; gap:.35rem; flex-wrap:wrap; }
.cd-choice { position:relative; cursor:pointer; }
.cd-choice input { position:absolute; width:1px; height:1px; margin:0; overflow:hidden; clip-path:inset(50%); }
.cd-choice span {
  display:flex; align-items:center; justify-content:center;
  min-height:28px; padding:.18rem .47rem;
  font-size:clamp(.86rem,1.05vw,1rem); line-height:1.35; font-weight:560;
  border:1px solid #b5b6ad; color:#42443f; background:#f7f7f2;
  gap:.35rem; border-radius:2px; transition:background .16s,color .16s,border-color .16s;
}
/* A horizontal tick extends as a working mode is selected. */
.cd-choice span::before { content:""; width:6px; height:1px; background:currentColor; transform:scaleX(.35); transform-origin:left; }
.cd-choice:has(input:focus-visible) span::before,
.cd-choice:has(input:checked) span::before,
.cd-choice:hover span::before { transform:scaleX(1); }
@media (prefers-reduced-motion:no-preference) { .cd-choice span::before { transition:transform .17s ease-out; } }
.cd-choice:hover span { border-color:#64655e; color:#22241e; }
.cd-choice input:checked + span { background:var(--cd-tone); border-color:var(--cd-tone); color:#fff; }
.cd-choice input:focus-visible + span { outline:2px solid #33352e; outline-offset:3px; }
.cd-readout { flex:1; }
.cd-pane { display:none; }
.cd-demo .cd-pane h3 { margin:0; color:var(--cd-ink); font-size:clamp(1.55rem,2.5vw,2.8rem); line-height:1.11; font-weight:550; letter-spacing:-.054em; }
.cd-demo .cd-pane p { margin:.6rem 0 0; color:var(--cd-muted); font-size:1rem; line-height:1.6; }
.cd-pane dl { margin:1rem 0 0; padding-top:.64rem; border-top:1px solid var(--cd-line); }
.cd-pane dt { color:#55574f; font:500 .8rem/1.5 var(--nr-mono,ui-monospace,monospace); }
.cd-pane dd { margin:.24rem 0 0; color:var(--cd-tone); font-weight:600; font-size:1rem; }
:lang(ko) .cd-pane h3 { line-height:1.28; word-break:keep-all; }
:lang(ko) :is(.cd-bar,.cd-legend,.cd-pane dt) { font-family:var(--nr-font,sans-serif); }
.cd-demo:has(input[value="forward"]:checked) .cd-forward-only,
.cd-demo:has(input[value="face"]:checked) .cd-face-only,
.cd-demo:has(input[value="audio"]:checked) .cd-audio-only { opacity:1; }
.cd-demo:has(input[value="forward"]:checked) .cd-screen-front { color:var(--cd-forward); }
.cd-demo:has(input[value="face"]:checked) { --cd-tone:var(--cd-face); }
.cd-demo:has(input[value="face"]:checked) .cd-screen-side { color:var(--cd-face); }
.cd-demo:has(input[value="face"]:checked) .cd-pivot { transform:rotate(180deg); }
.cd-demo:has(input[value="audio"]:checked) { --cd-tone:var(--cd-audio); }
.cd-demo:has(input[value="audio"]:checked) .cd-seat-marker { stroke:#9daeb8; }
.cd-demo:has(input[value="forward"]:checked) .cd-pane-forward,
.cd-demo:has(input[value="face"]:checked) .cd-pane-face,
.cd-demo:has(input[value="audio"]:checked) .cd-pane-audio { display:block; }
@supports not selector(:has(*)) {
  .cd-demo[data-cabin-view="forward"] .cd-forward-only,
  .cd-demo[data-cabin-view="face"] .cd-face-only,
  .cd-demo[data-cabin-view="audio"] .cd-audio-only {opacity:1;}
  .cd-demo[data-cabin-view="forward"] .cd-pane-forward,
  .cd-demo[data-cabin-view="face"] .cd-pane-face,
  .cd-demo[data-cabin-view="audio"] .cd-pane-audio {display:block;}
  .cd-demo[data-cabin-view="forward"] .cd-screen-front {color:var(--cd-forward);}
  .cd-demo[data-cabin-view="face"] {--cd-tone:var(--cd-face);}
  .cd-demo[data-cabin-view="face"] .cd-screen-side {color:var(--cd-face);}
  .cd-demo[data-cabin-view="face"] .cd-pivot {transform:rotate(180deg);}
  .cd-demo[data-cabin-view="audio"] {--cd-tone:var(--cd-audio);}
  .cd-demo[data-cabin-view="audio"] .cd-key-visual {display:none;}
  .cd-demo[data-cabin-view="audio"] .cd-key-acoustic {display:inline-flex;}
}
@media (min-width:900px) and (max-width:1150px) {
  .cd-demo {grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);}
}
@media (max-width:899px) {
  .cd-demo {grid-template-columns:minmax(0,1fr);}
  .cd-stage {border-right:0; border-bottom:1px solid var(--cd-line); padding-block:.85rem;}
  .cd-plot {width:min(100%,45rem); align-self:center;}
  .cd-panel {gap:1rem;}
  .cd-selector > div {gap:.36rem;}
  .cd-choice span {padding-inline:.5rem;}
}
@media (max-width:780px), (pointer:coarse) {
  .cd-choice { display:inline-flex; align-items:center; min-height:44px; }
  .cd-choice span { min-height:29px; }
}
@media (max-width:520px) {
  .cd-stage {padding-inline:0;}
  .cd-bar,.cd-legend {margin-inline:.9rem;}
  .cd-annotation {font-size:22px; font-weight:600;}
  .cd-bar,.cd-legend {font-size:.77rem;}
}
@media (prefers-reduced-motion:reduce) {
  .cd-demo *, .cd-demo *::after {transition:none !important; animation:none !important;}
}
