:root {
  color-scheme: light;
  --paper: #f6f5f2;
  --surface: #fff;
  --ink: #191917;
  --muted: #65635e;
  --line: #dcdad3;
  --soft: #eeede8;
  --accent: #ffb01e;
  --board: #f5f5f1;
  --grid: #d8d8d0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
:root.night {
  color-scheme: dark;
  --paper: #161617;
  --surface: #232325;
  --ink: #f7f5ee;
  --muted: #c0bbb3;
  --line: #444341;
  --soft: #323232;
  --board: #202327;
  --grid: #363b40;
}
* { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, select { font: inherit; color: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button, select { cursor: pointer; }
a { color: inherit; }
button { border: 0; }
button:focus-visible, a:focus-visible, select:focus-visible, svg:focus-visible {
  outline: 3px solid #c67c00; outline-offset: 2px;
}
[hidden] { display: none !important; }
.shell { width: min(100%, 1700px); margin: auto; padding: 10px clamp(12px, 3vw, 52px) 0; }
.mast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 4vw, 64px);
  padding: 0 clamp(16px, 2.6vw, 46px);
  border-radius: 18px;
  color: #fff; background: #0c0c0b;
}
.mast img { display: block; width: clamp(136px, 17svh, 200px); max-width: 100%; }
.mast h1 { margin: 4px 0; font-size: clamp(1.75rem, 4.2vw, 4.35rem); line-height: 1; letter-spacing: -.065em; font-weight: 650; }
.mast small, .eyebrow, .step-index { font-size: .75rem; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.mast small { color: #ffb639; }
.ui-icon { display: inline-block; width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
#theme { display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px; border: 1px solid #494741; border-radius: 100px; color: #fff4da; background: #24231f; font-size: .84rem; }
#theme .ui-icon:nth-child(2), .night #theme .ui-icon:first-child { display: none; }
.night #theme .ui-icon:nth-child(2) { display: inline-block; }
.navigation { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.project-nav, .view-switch { display: inline-flex; gap: 2px; align-items: center; background: var(--soft); padding: 3px; border-radius: 100px; }
.project-switch, .view-switch button { background: transparent; border-radius: 100px; min-height: 42px; font-size: .9rem; font-weight: 620; }
.project-switch { padding: 0 clamp(15px, 2.4vw, 32px); }
.project-switch[aria-selected=true], .view-switch button[aria-pressed=true] { background: var(--ink); color: var(--surface); }
.night .project-switch[aria-selected=true], .night .view-switch button[aria-pressed=true] { color: #211a10; background: #ffb633; }
.track-choice { display: flex; align-items: center; gap: 10px; min-width: 0; }
.track-choice label { font-size: .875rem; font-weight: 640; white-space: nowrap; }
.track-choice select {
  min-height: 44px; min-width: 0; max-width: 100%; padding: 0 33px 0 13px;
  appearance: none; border: 1px solid var(--line); border-radius: 12px;
  font-size: .94rem; background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237b7970' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.project-panel { display: none; }
.project-panel.active { display: block; }
.map-card { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); }
.map-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px clamp(8px, 1.5vw, 24px);
  border-bottom: 1px solid var(--line);
}
.view-switch button { display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 15px; }
.orbit-tools { display: flex; align-items: center; gap: 3px; }
.icon-button, .map-output button { display: inline-flex; align-items: center; justify-content: center; background: transparent; }
.icon-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; }
.stage-surface {
  background-color: var(--board);
  background-image: radial-gradient(circle, var(--grid) .85px, transparent 1px);
  background-size: 18px 18px;
  overflow: hidden;
}
#stagePlan {
  display: block; width: 100%; height: clamp(410px, calc(100svh - 305px), 900px);
  cursor: grab; touch-action: pan-y pinch-zoom; user-select: none; -webkit-user-select: none;
}
#stagePlan:focus-visible { outline-offset: -4px; }
#stagePlan [role=button] { cursor: pointer; }
#stagePlan.moving, #stagePlan.moving * { cursor: grabbing; }
#stagePlan [role=button]:focus-visible { outline: none; }
#stagePlan [role=button]:focus-visible rect { stroke: #c07900; stroke-width: 3; }
figcaption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 20px; padding: 10px clamp(12px, 1.7vw, 26px); border-top: 1px solid var(--line); }
.zone-detail { display: flex; align-items: center; gap: 11px; flex: 1 1 430px; }
.detail-number { display: grid; place-items: center; width: 34px; height: 34px; flex: none; color: #181715; background: var(--accent); border-radius: 50%; font-weight: 750; }
.zone-detail h2 { font-size: 1rem; margin: 0 0 2px; letter-spacing: -.025em; }
.zone-detail p, .map-output span { color: var(--muted); font-size: .84rem; }
.zone-detail p { margin: 0; line-height: 1.4; }
.map-output { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 12px; }
.map-output button { gap: 6px; min-height: 42px; padding: 0 3px; font-size: .84rem; }
.map-output .ui-icon { width: 16px; height: 16px; }
@media (hover: hover) {
  .icon-button:hover, .view-switch button:not([aria-pressed=true]):hover { background: var(--soft); border-color: var(--muted); }
  .project-switch:not([aria-selected=true]):hover, .map-output button:hover { text-decoration: underline; text-underline-offset: 3px; }
}
.song-sheet { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; margin: 12px 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; }
.song-sheet h2 { margin: 2px 0 4px; font-size: 1.2rem; }
.song-sheet p { margin: 0; font-size: .875rem; color: var(--muted); }
.song-sheet .eyebrow { font-size: .7rem; }
#songAudio:not(:empty) { flex: 1 1 260px; max-width: 540px; }
#songAudio audio { display: block; width: 100%; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 0; }
.section-head h2, #ensino h2 { margin: 8px 0 0; font-size: clamp(26px, 3.5vw, 40px); line-height: 1; letter-spacing: -.05em; }
.section-head p, .card-note, .source-note { max-width: 64ch; color: var(--muted); line-height: 1.55; font-size: .9rem; }
.section-head p { margin: 0; max-width: 375px; }
.eyebrow, .step-index { color: var(--muted); }
.tour-summary, .lessons, .repertoire-grid { display: grid; gap: 14px; }
.tour-summary { display: flex; flex-wrap: wrap; margin: 0 0 20px; }
.tour-summary span, .repertoire-card, .lessons article { background: var(--surface); border: 1px solid var(--line); }
.tour-summary span { padding: 10px 14px; border-radius: 12px; color: var(--muted); font-size: .85rem; }
.tour-summary strong { color: var(--ink); margin-right: 5px; }
.repertoire-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.repertoire-card { border-radius: 17px; padding: 22px 24px; }
.repertoire-card h3 { font-size: 1.35rem; letter-spacing: -.04em; margin: 12px 0 14px; }
.repertoire-card ol { padding-left: 23px; margin: 0; display: grid; gap: 8px; font-size: .94rem; line-height: 1.45; }
.repertoire-card li { padding-left: 3px; }
.repertoire-card li::marker { color: #a76800; font-weight: 700; }
.repertoire-card li span { display: block; color: var(--muted); font-size: .8rem; }
.feature-card { background: #171614; color: white; }
.feature-card .step-index, .feature-card li::marker { color: #ffb633; }
.feature-card .card-note { color: #ddd7c9; }
.closing-card { border-color: #cba655; }
.source-note { margin: 14px 0; font-size: .8rem; }
#ensino h2 { padding-top: 16px; }
.lessons { grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); margin: 20px 0 35px; }
.lessons article { padding: 20px; border-top: 3px solid var(--accent); }
.lessons h3 { margin: 0; }
.lessons p { line-height: 1.55; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; margin-top: 18px; padding: 16px 2px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.5; }
.foot strong { color: var(--ink); }
@media (max-width: 700px) {
  .mast { gap: 12px; padding: 4px 12px; }
  .mast img { width: clamp(90px, 22vw, 136px); }
  .mast small { font-size: .65rem; }
  #theme { width: 44px; padding: 0; }
  #theme span { display: none; }
  .navigation { margin: 8px 0; }
  .track-choice { flex: 1 1 100%; justify-content: space-between; gap: 8px; }
  .track-choice select { flex: 1; max-width: 265px; }
  .repertoire-grid { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
  #stagePlan { height: clamp(320px, min(114vw, 64svh), 615px); }
  .map-output { width: 100%; justify-content: end; }
  .map-output span { margin-right: auto; }
  figcaption { padding-top: 12px; }
}
@media (max-width: 420px) {
  .shell { padding: 6px 6px 0; }
  .mast { border-radius: 14px; }
  .mast h1 { font-size: 1.65rem; }
  .map-card { border-radius: 14px; }
  .map-tools { padding: 4px 7px; }
  .view-switch button { padding: 0 10px; }
}
@media (min-width: 701px) and (max-height: 600px) {
  .mast img { width: 96px; }
  .mast h1 { font-size: 2rem; }
  #stagePlan { height: max(292px, 64svh); }
}
@media print {
  @page { margin: 10mm; }
  :root, :root.night { color-scheme: light; --paper: white; --surface: white; --ink: black; --muted: #444; --line: #bbb; }
  .shell { padding: 0; }
  .mast { padding: 0; color: black; background: white; gap: 12px; }
  .mast img { width: 62px; }
  .mast small { color: #49443d; }
  .mast h1 { font-size: 24pt; }
  .navigation, .map-tools, .map-output, #theme, #songAudio, .foot a { display: none; }
  .map-card, .song-sheet { break-inside: avoid; }
  .map-card { margin-top: 5mm; }
  #stagePlan { height: 150mm; }
  .stage-surface { background: white; }
  .foot { margin-top: 3mm; }
  #stagePlan [data-ambient] { fill: #444; }
  #stagePlan, .detail-number { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.method-source { display: flex; align-items: center; flex-wrap: wrap; gap: 18px 40px; margin: 18px 0 24px; padding: clamp(16px, 2.5vw, 30px); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; }
.method-source h3 { margin: 5px 0 8px; font-size: 1.55rem; letter-spacing: -.04em; }
.method-source p { margin: 0; line-height: 1.5; }
.method-source > div:first-child { flex: 1 1 300px; max-width: 62ch; }
.method-files { flex: 1 1 250px; max-width: 400px; display: grid; gap: 5px; }
.method-files a { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-height: 46px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.method-files a:hover strong { text-decoration: underline; }
.method-files span { color: var(--muted); font-size: .82rem; }

body.expanded { overflow: hidden; }
#expandedMap { width: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; background: var(--surface); color: var(--ink); }
#expandedMap[open] .map-card { width: 100%; height: 100%; border: 0; border-radius: 0; display: flex; flex-direction: column; }
#expandedMap .stage-surface { flex: 1; min-height: 0; }
#expandedMap #stagePlan { height: 100%; }
@media(max-width: 355px) { .view-switch .ui-icon {display: none;} }
