
    :root {
      --bg: #ffffff;
      --surface: #ffffff;
      --surface-dark: #1f2933;
      --text: #1f2933;
      --muted: #718096;
      --line: #e5e7eb;
      --accent: #2f7f78;
      --accent-soft: #edf6f4;
      --accent-line: #a8d3cd;
      --radius: 8px;
    }
    * { box-sizing: border-box; }
    html { scroll-behavior: smooth; touch-action: manipulation; }
    body {
      margin: 0;
      color: var(--text);
      background: var(--bg);
      font-family: "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
      line-height: 1.5;
    }
    button, input, select { font: inherit; }
    /* Keep rapid taps on keys and controls from invoking mobile double-tap zoom. */
    button, input, select, [role="button"] { touch-action: manipulation; }
    button { cursor: pointer; }
    button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(47,127,120,.28); outline-offset: 3px; }
    .site-header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1240px; margin: 0 auto; padding: 0 30px; border-bottom: 1px solid var(--line); }
    .wordmark { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
    .wordmark-symbol { width: 34px; height: 34px; display: grid; place-items: center; color: var(--surface); border-radius: 9px; background: var(--accent); font-size: 18px; }
    .wordmark-name { font-size: 16px; font-weight: 700; letter-spacing: .08em; }
    .wordmark-caption { display: block; color: var(--muted); font-size: 10px; font-weight: 400; letter-spacing: .03em; }
    .main-nav { display: flex; align-items: center; gap: 4px; }
    .nav-link { border: 0; padding: 8px 12px; color: var(--muted); background: transparent; font-size: 13px; border-radius: 6px; }
    .nav-link:hover, .nav-link.is-active { color: var(--text); background: var(--accent-soft); }
    .nav-link.is-active { font-weight: 700; }
    .header-status { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
    .status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
    main { max-width: 1240px; margin: 0 auto; padding: 0 30px 90px; }
    .view { display: none; padding-top: 72px; }
    .view.is-active { display: block; }
    .eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
    h1, h2, h3, p { margin-top: 0; }
    h1 { max-width: 610px; margin-bottom: 20px; font-size: clamp(40px, 6vw, 76px); line-height: 1.06; letter-spacing: -.06em; }
    h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.045em; }
    .lead { max-width: 480px; color: var(--muted); font-size: 16px; }
    .home-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, .78fr); align-items: center; gap: 80px; min-height: 590px; }
    .hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
    .button { border: 1px solid var(--text); border-radius: 7px; padding: 10px 15px; color: var(--surface); background: var(--text); font-size: 13px; font-weight: 700; }
    .button.alt { color: var(--text); background: transparent; border-color: var(--line); }
    .button:hover { transform: translateY(-1px); }
    button:disabled { cursor: not-allowed; opacity: .46; transform: none; }
    .hero-note { display: flex; align-items: center; gap: 11px; margin-top: 34px; color: var(--muted); font-size: 12px; }
    .hero-note-line { width: 34px; height: 1px; background: var(--accent); }
    .signal-panel { position: relative; min-height: 470px; padding: 25px; overflow: hidden; color: var(--surface); background: var(--surface-dark); border-radius: var(--radius); }
    .signal-panel-label { position: relative; z-index: 1; display: flex; justify-content: space-between; color: #b8c5c3; font-size: 11px; }
    .signal-panel-title { position: relative; z-index: 1; margin: 112px 0 0; font-size: 26px; letter-spacing: -.04em; }
    .signal-panel-copy { position: relative; z-index: 1; max-width: 230px; margin: 8px 0 0; color: #d4dcda; font-size: 12px; }
    .signal-wave { position: absolute; left: 25px; right: 25px; bottom: 72px; width: calc(100% - 50px); height: 112px; }
    .signal-wave .grid { stroke: rgba(212,220,218,.16); stroke-width: 1; }
    .signal-wave .wave { fill: none; stroke: var(--accent); stroke-width: 2.2; }
    .signal-footer { position: absolute; right: 25px; bottom: 25px; left: 25px; display: flex; align-items: center; justify-content: space-between; color: #b8c5c3; font-size: 11px; }
    .signal-footer strong { color: var(--surface); font-size: 14px; }
    .entry-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 30px; }
    .entry { display: block; padding: 19px 20px 20px; color: inherit; text-decoration: none; border-top: 2px solid var(--line); }
    .entry:hover { border-top-color: var(--accent); }
    .entry-index { color: var(--muted); font-size: 11px; }
    .entry h3 { margin: 14px 0 7px; font-size: 18px; letter-spacing: -.03em; }
    .entry p { margin: 0; color: var(--muted); font-size: 12px; }
    .view-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 46px; }
    .view-heading h1 { margin: 7px 0 0; font-size: clamp(36px, 5vw, 58px); }
    .view-heading .lead { max-width: 360px; margin-bottom: 5px; font-size: 14px; }
    .lesson-position { margin-top: 10px; color: var(--muted); font-size: 12px; }
    [data-view="theory"] > .view-heading { display: none; }
    .lesson-intro { display: none; }
    .lesson-intro h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.03em; }
    .lesson-intro p { max-width: 440px; margin: 0; color: var(--muted); font-size: 13px; }
    .lesson-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
    .lesson-step { position: relative; padding-left: 28px; color: var(--muted); font-size: 12px; }
    .lesson-step::before { content: attr(data-step); position: absolute; top: 0; left: 0; color: var(--accent); font-size: 11px; font-weight: 700; }
    .lesson-step strong { display: block; margin-bottom: 2px; color: var(--text); font-size: 13px; }
    .lesson-step.is-current strong { color: var(--accent); }
    .theory-layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); gap: 38px; align-items: start; }
    .lesson-sidebar { position: sticky; top: 24px; min-width: 0; max-height: calc(100vh - 48px); overflow-y: auto; padding-right: 20px; border-right: 1px solid var(--line); }
    .lesson-sidebar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 13px; border-bottom: 2px solid var(--accent); }
    .lesson-sidebar-head strong { font-size: 17px; }
    .lesson-sidebar-head small { color: var(--muted); font-size: 11px; white-space: nowrap; }
    .topic-nav { padding-top: 2px; }
    .chapter-group { border-bottom: 1px solid var(--line); }
    .chapter-group summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 2px; cursor: pointer; list-style: none; }
    .chapter-group summary::-webkit-details-marker { display: none; }
    .chapter-group summary::after { content: "+"; color: var(--muted); font-size: 18px; font-weight: 400; }
    .chapter-group[open] summary::after { content: "−"; }
    .chapter-name { font-size: 14px; font-weight: 700; }
    .chapter-count { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 400; }
    .chapter-lessons { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 0 0 16px; }
    .topic-button { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 9px 10px; color: var(--muted); background: transparent; text-align: left; }
    .topic-button small { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
    .topic-button span { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .topic-button:hover { color: var(--text); background: var(--accent-soft); }
    .topic-button.is-active { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); font-weight: 700; }
    .topic-button.is-active small { color: var(--accent); }
    .theory-panel { min-width: 0; border-top: 2px solid var(--accent); }
    .theory-head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 18px 0 14px; border-bottom: 1px solid var(--line); }
    .theory-head h2 { margin: 0; font-size: 28px; line-height: 1.2; }
    .theory-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
    .theory-head .formula { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }
    .theory-head .formula.is-hidden { visibility: hidden; }
    .theory-visual { padding: 28px 0 20px; }
    .lesson-sequence { display: flex; gap: 18px; margin: 20px 0 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .lesson-sequence span { color: var(--muted); font-size: 11px; }
    .lesson-sequence span.is-current { color: var(--accent); font-weight: 700; }
    .lesson-brief { max-width: 620px; padding: 28px 0 14px; }
    .lesson-brief-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
    .lesson-brief p { margin: 0; font-size: 18px; line-height: 1.65; }
    .lesson-brief .button { margin-top: 20px; }
    .stage-hidden { display: none !important; }
    .lesson-sequence { display: none; }
    .lesson-visual { margin-top: 20px; padding: 12px 0 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .lesson-visual-label { margin-bottom: 7px; color: var(--muted); font-size: 11px; }
    .lesson-visual svg { display: block; width: 100%; height: 96px; overflow: visible; }
    .lesson-visual .visual-axis { stroke: #d5d9dc; stroke-width: 1; }
    .lesson-visual .visual-link { fill: none; stroke: #aeb7b5; stroke-width: 1.5; stroke-dasharray: 5 5; animation: draw-link .8s ease both; }
    .lesson-visual .visual-link-label { fill: var(--muted); font-size: 10px; text-anchor: middle; }
    .lesson-visual .visual-node { fill: #fff; stroke: #697471; stroke-width: 1.5; animation: appear-node .35s ease both; }
    .lesson-visual .visual-node.is-root { fill: #252829; stroke: #252829; }
    .lesson-visual text { fill: var(--muted); font-size: 11px; text-anchor: middle; }
    .lesson-visual text.is-root { fill: var(--text); font-weight: 700; }
    .lesson-visual .visual-staff-line, .lesson-visual .visual-beat-line, .lesson-visual .visual-section { fill: none; stroke: #cbd1d0; stroke-width: 1; }
    .lesson-visual .visual-bar-line { stroke: #697471; stroke-width: 1.5; }
    .lesson-visual .visual-note { fill: #252829; stroke: #252829; stroke-width: 1; }
    .lesson-visual .visual-note-stem { stroke: #252829; stroke-width: 1.5; }
    .lesson-visual .visual-arc, .lesson-visual .visual-contour { fill: none; stroke: #697471; stroke-width: 1.5; }
    .lesson-visual .visual-pulse { fill: #fff; stroke: #697471; stroke-width: 1.5; }
    .lesson-visual .visual-pulse.is-strong { fill: #252829; stroke: #252829; }
    .lesson-visual .visual-duration { fill: #e9f3f1; stroke: #8fbab5; stroke-width: 1; }
    .lesson-visual .visual-box { fill: #fff; stroke: #aeb7b5; stroke-width: 1; }
    .lesson-visual .visual-box.is-active { fill: #e9f3f1; stroke: #6faaa4; }
    .lesson-visual .visual-fill { fill: #252829; }
    .lesson-visual .visual-soft-fill { fill: #e9f3f1; }
    .lesson-visual .visual-dashed { fill: none; stroke: #aeb7b5; stroke-width: 1; stroke-dasharray: 4 4; }
    @keyframes draw-link { from { stroke-dashoffset: 24; opacity: .2; } to { stroke-dashoffset: 0; opacity: 1; } }
    @keyframes appear-node { from { transform: scale(.65); transform-origin: center; opacity: .15; } to { transform: scale(1); opacity: 1; } }
    @media (prefers-reduced-motion: reduce) { .lesson-visual .visual-link, .lesson-visual .visual-node { animation: none; } }
    .visual-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 24px; }
    .visual-controls .field-note { flex: 1 1 260px; }
    .visual-controls label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
    .visual-controls select { width: auto; min-width: 104px; }
    .field-note { color: var(--muted); font-size: 12px; }
    .keyboard-wrap { padding-top: 4px; }
    .keyboard-label { color: var(--muted); font-size: 11px; }
    .keyboard { position: relative; height: 173px; margin-top: 9px; }
    .white-keys { display: flex; height: 100%; }
    .key { position: relative; flex: 1; min-width: 0; border: 1px solid #d7dfdd; border-radius: 0 0 5px 5px; padding: 0; color: inherit; background: transparent; cursor: pointer; }
    .key + .key { border-left: 0; }
    .key-label { position: absolute; right: 0; bottom: 10px; left: 0; color: var(--muted); text-align: center; font-size: 11px; }
    .key.tone-root { border-color: #8b9693; background: #f0f2f1; box-shadow: inset 0 -4px 0 #4f5b59; }
    .key.tone-on { border-color: #c9d2d0; background: transparent; box-shadow: inset 0 -3px 0 #c1ccca; }
    .key.tone-root .key-label, .key.tone-on .key-label { color: var(--text); font-weight: 700; }
    .black-keys { position: absolute; top: 0; right: 0; left: 0; height: 102px; pointer-events: none; }
    .black-key { position: absolute; width: 7.5%; height: 100%; transform: translateX(-50%); border: 1px solid #d2ddda; border-radius: 0 0 4px 4px; padding: 0; color: inherit; background: #f0f4f3; cursor: pointer; pointer-events: auto; }
    .black-key.tone-root { border-color: #8b9693; background: #e4e9e7; box-shadow: inset 0 -4px 0 #4f5b59; }
    .black-key.tone-on { border-color: #c9d2d0; background: #f1f4f3; box-shadow: inset 0 -3px 0 #c1ccca; }
    .black-key .key-label { bottom: 8px; color: var(--muted); font-size: 9px; }
    .theory-annotation { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 22px; border-top: 1px solid var(--line); }
    .lesson-reading { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; border-top: 1px solid var(--line); }
    .reading-item { min-height: 112px; padding: 16px 22px 14px 0; border-bottom: 1px solid var(--line); }
    .reading-item:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); }
    .reading-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
    .reading-item p { margin: 0; font-size: 14px; line-height: 1.72; }
    .theory-panel.is-overview .theory-annotation { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 26px; }
    .theory-panel.is-overview .annotation { min-height: 88px; padding-top: 15px; }
    .theory-panel.is-overview .annotation strong { display: block; max-width: 210px; font-size: 17px; line-height: 1.45; }
    .theory-panel.is-overview .theory-visual { padding-top: 30px; }
    .theory-panel.is-overview .theory-explain { max-width: 760px; margin-top: 28px; }
    .theory-panel.is-overview .theory-explain::before { content: "乐理和实践的关系"; }
    .overview-guide { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
    .overview-guide-title { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
    .overview-route { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
    .overview-route-item { position: relative; min-height: 76px; padding: 11px 12px 8px 0; border-top: 2px solid var(--line); }
    .overview-route-item + .overview-route-item { padding-left: 12px; border-left: 1px solid var(--line); }
    .overview-route-item:first-child { border-top-color: var(--accent); }
    .overview-route-item strong { display: block; margin-bottom: 4px; font-size: 13px; }
    .overview-route-item span { color: var(--muted); font-size: 11px; line-height: 1.45; }
    .overview-uses { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
    .overview-use { min-height: 72px; padding: 12px 12px 0 0; }
    .overview-use + .overview-use { padding-left: 12px; border-left: 1px solid var(--line); }
    .overview-use strong { display: block; margin-bottom: 4px; font-size: 13px; }
    .overview-use span { color: var(--muted); font-size: 11px; line-height: 1.45; }
    .annotation { padding: 12px 15px 0 0; border-right: 1px solid var(--line); }
    .annotation + .annotation { padding-left: 15px; }
    .annotation:last-child { border-right: 0; }
    .annotation-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
    .annotation strong { font-size: 16px; }
    .half-tone-guide { display: none; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
    .half-tone-guide.is-visible { display: block; }
    .guide-details { color: var(--text); }
    .guide-details summary { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--accent); font-size: 12px; font-weight: 700; list-style: none; }
    .guide-details summary::-webkit-details-marker { display: none; }
    .guide-details summary::before { content: "+"; font-size: 16px; font-weight: 400; }
    .guide-details[open] summary::before { content: "−"; }
    .guide-details > :not(summary) { margin-top: 14px; }
    .half-tone-title { margin-bottom: 12px; color: var(--muted); font-size: 12px; }
    .count-track { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
    .count-step { padding: 9px 10px; border-top: 2px solid var(--line); }
    .count-step:first-child { border-top-color: var(--accent); }
    .count-step em { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-style: normal; }
    .count-step strong { display: block; font-size: 12px; }
    .count-total { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
    .count-total strong { color: var(--accent); font-size: 16px; }
    .count-total span { color: var(--muted); font-size: 12px; }
    .mode-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .mode-item { padding: 10px 12px; border-top: 2px solid var(--line); }
    .mode-item:first-child { border-top-color: var(--accent); }
    .mode-item strong { display: block; margin-bottom: 2px; font-size: 13px; }
    .mode-item span { color: var(--muted); font-size: 11px; }
    .chord-route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .chord-stop { min-width: 72px; padding: 8px 10px; border-top: 2px solid var(--accent); }
    .chord-stop:first-child { border-top-color: var(--accent); }
    .chord-stop em { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-style: normal; }
    .chord-stop strong { font-size: 14px; }
    .chord-jump { color: var(--muted); font-size: 11px; white-space: nowrap; }
    .theory-explain { max-width: 620px; margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); }
    .theory-explain::before { content: "先记住"; display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
    .theory-explain p { margin: 0; font-size: 15px; line-height: 1.7; }
    .lesson-next { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 25px; padding-top: 16px; border-top: 1px solid var(--line); }
    .lesson-next span { color: var(--muted); font-size: 12px; }
    .lesson-actions { display: flex; gap: 8px; }
    .ear-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(290px, .72fr); gap: 76px; align-items: start; }
    .ear-console { padding: 31px 0 0; border-top: 2px solid var(--accent); }
    .ear-console h2 { margin-bottom: 10px; font-size: 25px; }
    .ear-console p { max-width: 470px; color: var(--muted); font-size: 13px; }
    .ear-prerequisite { display: inline-block; margin-top: 5px; padding: 5px 8px; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 5px; font-size: 11px; }
    .ear-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 28px 0 26px; }
    .ear-play { width: 128px; height: 48px; border: 0; border-radius: 7px; color: var(--surface); background: var(--accent); font-size: 13px; font-weight: 700; }
    .ear-state { color: var(--muted); font-size: 12px; }
    .choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; }
    .choice { min-height: 52px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: transparent; font-size: 13px; }
    .choice:hover { border-color: var(--accent); }
    .choice.correct { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
    .choice.wrong { border-color: var(--line); color: var(--muted); background: #f8faf9; }
    .ear-feedback { min-height: 20px; margin-top: 13px; color: var(--muted); font-size: 12px; }
    .ear-visual { position: relative; min-height: 370px; padding: 26px; color: var(--surface); background: var(--surface-dark); border-radius: var(--radius); }
    .ear-visual-label { color: #b8c5c3; font-size: 11px; }
    .ear-visual h3 { margin: 78px 0 5px; font-size: 26px; }
    .ear-visual p { margin: 0; color: #d4dcda; font-size: 12px; }
    .ear-bars { position: absolute; right: 26px; bottom: 33px; left: 26px; display: flex; align-items: end; gap: 6px; height: 104px; }
    .ear-bars span { flex: 1; min-width: 2px; background: var(--accent); opacity: .86; }
    .lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 255px; gap: 44px; align-items: start; }
    .lab-plot { border-top: 2px solid var(--accent); padding-top: 22px; }
    .lab-plot h2 { margin-bottom: 8px; font-size: 25px; }
    .lab-plot p { color: var(--muted); font-size: 13px; }
    .wave-chart { width: 100%; height: 270px; margin-top: 24px; overflow: visible; }
    .wave-chart .axis { stroke: var(--line); stroke-width: 1; }
    .wave-chart .minor { stroke: #eef1f0; stroke-width: 1; }
    .wave-chart .wave { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
    .lab-controls { border-top: 1px solid var(--line); padding-top: 16px; }
    .lab-controls h3 { margin-bottom: 18px; font-size: 16px; }
    .control-row { margin-bottom: 20px; }
    .control-row label { display: flex; justify-content: space-between; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
    .control-row output { color: var(--text); font-weight: 700; }
    input[type=range] { width: 100%; accent-color: var(--accent); }
    select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); background: var(--surface); }
    .lab-play { width: 100%; }
     .hardware-device { margin-top: 72px; padding-top: 22px; border-top: 2px solid var(--accent); }
     .hardware-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
     .hardware-head h2 { margin: 0 0 5px; font-size: 24px; }
     .hardware-head p { margin: 0; color: var(--muted); font-size: 12px; }
     .hardware-transport { color: var(--muted); font-size: 12px; white-space: nowrap; }
     .hardware-transport.is-online { color: var(--accent); font-weight: 700; }
     .hardware-controls { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(130px, .7fr)); gap: 12px; align-items: end; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
     .hardware-module-panel { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(130px, .7fr)); gap: 10px; align-items: end; padding: 11px; border: 1px solid var(--accent-line); border-radius: 6px; background: var(--accent-soft); }
     .hardware-module-panel .hardware-module-status { align-self: center; color: var(--text); font-size: 12px; font-weight: 700; }
     .hardware-module-panel .hardware-actions { grid-column: 1 / -1; }
     .hardware-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
     .hardware-field output { color: var(--text); font-weight: 700; }
     .hardware-field input[type=text], .hardware-field input[type=password] { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); background: var(--surface); }
     .hardware-color-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
     .hardware-color-field input[type=color] { width: 34px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); cursor: pointer; }
     .hardware-actions { display: flex; flex-wrap: wrap; gap: 8px; }
     .hardware-actions .button { margin: 0; }
     .hardware-discovery { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(150px, 1fr) auto minmax(180px, 1.2fr); gap: 9px; align-items: end; grid-column: 1 / -1; padding: 11px 0 13px; border-bottom: 1px solid var(--line); }
     .hardware-discovery label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
     .hardware-discovery input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); background: var(--surface); }
     .hardware-discovery-status { min-height: 31px; padding: 8px 10px; color: var(--muted); font-size: 11px; }
     .hardware-legacy-field { display: none !important; }
     .hardware-controls label:has(#hardwareHost), .hardware-controls label:has(#hardwareDeviceId), .hardware-controls label:has(#hardwareRelayToken), .hardware-controls label:has(#hardwareWifiSsid), .hardware-controls label:has(#hardwareWifiPassword) { display: none !important; }
     .hardware-provision { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 10px; }
     .hardware-provision summary { cursor: pointer; color: var(--text); font-size: 12px; font-weight: 700; }
     .hardware-provision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
     .hardware-provision-grid label { display: grid !important; gap: 6px; color: var(--muted); font-size: 11px; }
     .hardware-provision-grid input { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); background: var(--surface); }
     .hardware-provision-grid .button { align-self: end; }
     .hardware-mode { display: flex; align-items: center; gap: 8px; margin-top: 18px; border-bottom: 1px solid var(--line); }
     .hardware-mode button { border: 0; border-bottom: 2px solid transparent; padding: 11px 14px 9px; color: var(--muted); background: transparent; font-size: 13px; }
     .hardware-mode button.is-active { border-bottom-color: var(--accent); color: var(--text); font-weight: 700; }
     .hardware-piano { margin-top: 18px; }
     .hardware-piano .keyboard { height: 176px; }
     .hardware-piano .black-keys { height: 101px; }
     #hardwareKeyboard .key.is-pressed, #hardwareKeyboard .black-key.is-pressed { box-shadow: inset 0 -8px 0 #2586c8; }
     #hardwareKeyboard .key.is-target, #hardwareKeyboard .black-key.is-target { box-shadow: inset 0 -8px 0 #e66d28; }
     #hardwareKeyboard .key.is-success, #hardwareKeyboard .black-key.is-success { box-shadow: inset 0 -8px 0 #22a06b; }
     #hardwareKeyboard .key.is-wrong, #hardwareKeyboard .black-key.is-wrong { box-shadow: inset 0 -8px 0 #d43d3d; }
     .hardware-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
     .hardware-map span { padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
     .hardware-map b { margin-right: 5px; color: var(--text); }
     .hardware-help { margin-top: 11px; color: var(--muted); font-size: 11px; }
     .hardware-settings-shell { border-top: 2px solid var(--accent); }
     .hardware-settings-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding: 20px 0 16px; border-bottom: 1px solid var(--line); }
     .hardware-settings-summary h2 { margin: 0 0 5px; font-size: 22px; }
     .hardware-settings-summary p { margin: 0; color: var(--muted); font-size: 12px; }
     .hardware-settings-status { display: flex; align-items: center; gap: 15px; color: var(--muted); font-size: 12px; white-space: nowrap; }
     .hardware-settings-mode { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 0; border-bottom: 1px solid var(--line); }
     .hardware-settings-shell .hardware-controls { margin-top: 0; }
     .file-transfer-shell { margin-top: 34px; }
     .file-transfer-controls { align-items: end; padding: 18px 0; border-bottom: 1px solid var(--line); }
     .file-transfer-controls .button { align-self: end; }
     .file-transfer-controls select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); background: var(--surface); }
     .file-transfer-controls input[type=file] { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px; color: var(--text); background: var(--surface); }
     .file-transfer-note { display: block; margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
     .file-transfer-shell progress { width: 100%; height: 8px; align-self: center; }
     #fileTransferStatus[data-state="ok"] { color: var(--accent); }
     #fileTransferStatus[data-state="error"] { color: #b34d34; }
     .hardware-settings-shell .hardware-binding-editor { margin-top: 26px; }
     .practice-session-switch { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
     .practice-session-switch button { border: 0; border-bottom: 2px solid transparent; padding: 11px 14px 9px; color: var(--muted); background: transparent; font-size: 13px; }
     .practice-session-switch button.is-active { border-bottom-color: var(--accent); color: var(--text); font-weight: 700; }
     .practice-session-switch span { margin-left: auto; color: var(--muted); font-size: 11px; }
     .practice-shell.session-demo .practice-hardware-device { display: none; }
     .practice-shell.session-entity .practice-keyboard { display: none; }
     .practice-shell.session-entity .practice-actions #practiceDemo { display: none; }
     .practice-shell.session-entity .practice-actions #metronomeToggle { display: none; }
     .practice-shell.session-entity .practice-actions #loopPractice { display: none; }
     .practice-shell.session-demo #hardwareStartFollow { display: none; }
     @media (max-width: 700px) { .hardware-settings-summary { display: block; } .hardware-settings-status { margin-top: 12px; } .hardware-discovery { grid-template-columns: 1fr 1fr; } .hardware-discovery .button, .hardware-discovery-status { grid-column: 1 / -1; } .practice-session-switch { overflow-x: auto; } .practice-session-switch span { min-width: 220px; margin-left: 4px; } }
     .hardware-binding-editor { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
     .hardware-binding-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
     .hardware-binding-head h3 { margin: 0; font-size: 17px; }
     .hardware-binding-head p { margin: 0; color: var(--muted); font-size: 11px; }
     .hardware-binding-focus { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, 1fr) minmax(130px, 1fr) auto; align-items: end; gap: 9px; margin: 14px 0 16px; padding: 13px; border: 1px solid var(--accent-line); border-radius: 7px; background: var(--accent-soft); }
     .hardware-binding-focus label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
     .hardware-binding-focus strong { display: block; min-height: 30px; padding: 7px 9px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; font-size: 12px; }
     .hardware-binding-focus select { width: 100%; min-height: 30px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface); font-size: 12px; }
     .hardware-binding-focus .button { min-height: 30px; padding: 7px 11px; }
     .hardware-binding-focus-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }
     .hardware-led-identify { display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 6px; margin: 10px 0 14px; }
     .hardware-led-identify-item { display: flex; align-items: center; gap: 6px; min-width: 0; border: 1px solid var(--line); border-radius: 5px; padding: 5px 6px; color: var(--muted); background: var(--surface); font-size: 10px; text-align: left; cursor: pointer; }
     .hardware-led-identify-item:hover, .hardware-led-identify-item.is-selected { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); }
     .hardware-led-identify-swatch { width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid rgba(31,41,51,.25); border-radius: 50%; background: #fff; }
     .hardware-led-identify-item b { color: var(--text); font-size: 11px; }
     .hardware-binding-table { display: grid; grid-template-columns: 64px minmax(130px, 1fr) minmax(130px, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
     .hardware-binding-table > * { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px; }
     .hardware-binding-table .binding-heading { color: var(--muted); background: #f7f8f8; font-size: 11px; font-weight: 700; }
     .hardware-binding-table strong { align-self: center; font-size: 12px; }
     .hardware-binding-table select { width: 100%; padding: 7px 8px; font-size: 12px; }
     .hardware-binding-actions { margin-top: 12px; }
     @media (max-width: 700px) { .hardware-binding-head { display: block; } .hardware-binding-head p { margin-top: 4px; } .hardware-binding-focus { grid-template-columns: 1fr 1fr; } .hardware-binding-focus .button { width: 100%; } .hardware-led-identify { grid-template-columns: repeat(3, minmax(70px, 1fr)); } .hardware-binding-table { grid-template-columns: 48px minmax(108px, 1fr) minmax(108px, 1fr); } .hardware-binding-table > * { padding: 6px; } }
     .keymap-section { margin-top: 72px; padding-top: 22px; border-top: 2px solid var(--accent); }
    .keymap-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
    .keymap-head h2 { margin: 0 0 5px; font-size: 24px; }
    .keymap-head p { margin: 0; color: var(--muted); font-size: 12px; }
    .keymap-actions { display: flex; align-items: center; gap: 10px; }
    .keymap-status { color: var(--muted); font-size: 12px; }
    .keymap-piano { margin-top: 16px; }
    .keymap-piano .keyboard { height: 158px; }
    .keymap-piano .black-keys { height: 91px; }
    .key-binding { position: absolute; top: 9px; right: 0; left: 0; color: var(--accent); text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .08em; opacity: var(--binding-opacity, .86); transition: opacity .15s ease; }
    .black-key .key-binding { top: 8px; color: var(--muted); font-size: 9px; }
    .binding-opacity { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
    .binding-opacity input { width: 100px; }
    .binding-opacity output { min-width: 34px; color: var(--text); font-variant-numeric: tabular-nums; }
    .keymap-help { display: flex; justify-content: space-between; gap: 15px; margin-top: 12px; color: var(--muted); font-size: 11px; }
    .keyboard-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 9px; }
    .keyboard-tools .keyboard-label { margin: 0; }
    .keyboard-tools .binding-opacity { margin-left: auto; }
    .instrument-switch { display: inline-flex; flex: 0 0 auto; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #f7f8f8; }
    .instrument-switch button { min-width: 58px; border: 0; border-radius: 5px; padding: 6px 10px; color: var(--muted); background: transparent; font-size: 12px; }
    .instrument-switch button.is-active { color: var(--text); background: #fff; box-shadow: 0 1px 3px rgba(31,41,51,.1); font-weight: 700; }
    .guitar-fretboard { min-width: 720px; padding: 7px 0 2px; }
    .guitar-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
    .guitar-head { display: grid; grid-template-columns: 58px repeat(13, minmax(46px, 1fr)); align-items: end; margin-bottom: 6px; color: var(--muted); font-size: 10px; text-align: center; }
    .guitar-head span:first-child { text-align: left; }
    .guitar-board { position: relative; border-top: 1px solid #dfe4e3; border-bottom: 1px solid #dfe4e3; background: #fbfcfc; }
    .guitar-string { display: grid; grid-template-columns: 58px repeat(13, minmax(46px, 1fr)); height: 34px; align-items: center; }
    .guitar-string + .guitar-string { border-top: 1px solid #edf0ef; }
    .guitar-string-name { padding-right: 10px; color: var(--muted); font-size: 10px; text-align: right; white-space: nowrap; }
    .guitar-fret { position: relative; align-self: stretch; border: 0; border-left: 1px solid #cdd4d2; padding: 0; color: var(--text); background: transparent; }
    .guitar-fret[data-fret="0"] { border-left: 2px solid #7c8784; }
    .guitar-fret::before { content: ""; position: absolute; top: 50%; right: 0; left: 0; height: var(--string-width, 1px); transform: translateY(-50%); background: #8e9896; pointer-events: none; }
    .guitar-dot { position: relative; z-index: 1; display: grid; width: 20px; height: 20px; margin: 7px auto; place-items: center; border: 1px solid #6f7977; border-radius: 50%; color: transparent; background: #fff; font-size: 8px; opacity: 0; }
    .guitar-fret.tone-on .guitar-dot, .guitar-fret.tone-root .guitar-dot, .guitar-fret.is-expected .guitar-dot { opacity: 1; }
    .guitar-fret.tone-on .guitar-dot { border-color: #8ba09c; color: #566662; background: #edf3f2; }
    .guitar-fret.tone-root .guitar-dot { border-color: #303837; color: #fff; background: #303837; }
    .guitar-fret.is-expected .guitar-dot { box-shadow: 0 0 0 3px rgba(47,127,120,.2); }
    .guitar-fret:hover .guitar-dot, .guitar-fret:focus-visible .guitar-dot { opacity: 1; }
    .guitar-markers { display: grid; grid-template-columns: 58px repeat(13, minmax(46px, 1fr)); height: 16px; color: #a3aaa8; font-size: 11px; text-align: center; }
    .guitar-marker { line-height: 16px; }
    .guitar-note { display: block; line-height: 1; }
    .instrument-help { margin-top: 7px; color: var(--muted); font-size: 11px; }
    .guitar-practice { min-width: 680px; padding: 8px 0 2px; }
    .guitar-practice-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
    .guitar-practice-head strong { font-size: 18px; }
    .guitar-practice-head span { color: var(--muted); font-size: 12px; }
    .guitar-practice-body { display: grid; grid-template-columns: 210px minmax(360px, 1fr); gap: 28px; align-items: start; }
    .chord-diagram { display: grid; grid-template-columns: 42px repeat(5, 34px); grid-template-rows: 22px repeat(6, 30px); width: max-content; color: var(--muted); background: #fbfcfc; font-size: 10px; text-align: center; }
    .chord-diagram button { border: 0; padding: 0; background: transparent; }
    .chord-diagram .chord-open { line-height: 22px; }
    .chord-string-label { display: grid; place-items: center end; padding-right: 8px; border-top: 1px solid #bdc7c4; color: var(--muted); }
    .chord-grid-line { position: relative; border-top: 1px solid #bdc7c4; border-left: 1px solid #bdc7c4; }
    .chord-grid-line:nth-child(7n + 2) { border-left: 2px solid #77827f; }
    .chord-finger { position: absolute; z-index: 1; top: 50%; left: 50%; display: grid; width: 18px; height: 18px; transform: translate(-50%, -50%); place-items: center; border-radius: 50%; color: #fff; background: #303837; font-size: 9px; }
    .chord-finger.is-muted { color: var(--muted); background: transparent; font-size: 14px; }
    .chord-position { margin-top: 9px; color: var(--muted); font-size: 11px; }
    .strum-area { min-width: 0; }
    .strum-label { margin-bottom: 9px; color: var(--muted); font-size: 11px; }
    .strum-pattern { display: flex; flex-wrap: wrap; gap: 8px; }
    .strum-button { min-width: 54px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 9px; color: var(--text); background: transparent; font-size: 13px; }
    .strum-button.is-current { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); font-weight: 700; }
    .strum-button.is-done { color: #26815f; border-color: #b9d8ca; }
    .string-picks { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
    .string-pick { border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; color: var(--muted); background: #fbfcfc; font-size: 11px; }
    .string-pick:hover { color: var(--text); border-color: var(--accent-line); }
    .chord-next { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
    .chord-next strong { margin-left: 5px; color: var(--text); font-size: 15px; }
    .guitar-score-reference { margin-top: 24px; border-top: 1px solid var(--line); }
    .guitar-score-reference summary { padding: 14px 0; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 700; list-style: none; }
    .guitar-score-reference summary::-webkit-details-marker { display: none; }
    .guitar-score-reference summary::before { content: "+"; display: inline-block; width: 20px; color: var(--accent); font-size: 18px; font-weight: 400; }
    .guitar-score-reference[open] summary::before { content: "−"; }
    .guitar-score-copy { margin: 0 0 14px 20px; color: var(--muted); font-size: 11px; }
    .guitar-score-pages { display: grid; gap: 16px; margin-left: 20px; }
    .guitar-score-pages img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
    .guitar-song-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 13px; color: var(--text); font-size: 12px; }
    .guitar-song-meta span + span { padding-left: 18px; border-left: 1px solid var(--line); }
    .guitar-source-note { margin: -4px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.7; }
    .guitar-source-note a { color: var(--text); text-underline-offset: 3px; }
    .guitar-full-score { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 6px; margin: 0 0 18px; }
    .guitar-score-measure { display: grid; grid-template-columns: 24px 34px 1fr; align-items: center; gap: 6px; min-height: 42px; border: 1px solid var(--line); padding: 6px 8px; color: var(--muted); background: #fff; text-align: left; }
    .guitar-score-measure span { font-size: 10px; }
    .guitar-score-measure strong { color: var(--text); font-size: 13px; }
    .guitar-score-measure small { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .guitar-score-measure.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
    .guitar-score-measure.is-current strong { color: var(--accent); }
    .guitar-source-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
    .guitar-source-links a { border: 1px solid var(--line); border-radius: 5px; padding: 7px 10px; color: var(--text); background: #fff; font-size: 11px; text-decoration: none; }
    .guitar-exact-score { display: grid; gap: 18px; }
    .guitar-exact-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
    .guitar-exact-head strong { font-size: 18px; }
    .guitar-exact-head span { color: var(--muted); font-size: 11px; }
    .guitar-score-preview { display: block; width: 100%; max-height: 360px; object-fit: contain; object-position: left top; border: 1px solid var(--line); background: #fff; }
    .guitar-score-document { display: block; width: 100%; height: 360px; border: 1px solid var(--line); background: #fff; }
    .guitar-notation-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px 18px; border-top: 1px solid var(--line); padding-top: 13px; }
    .guitar-notation-grid div { display: grid; gap: 3px; }
    .guitar-notation-grid strong { font-size: 11px; }
    .guitar-notation-grid span { color: var(--muted); font-size: 10px; line-height: 1.55; }
    .guitar-measure-events { display: grid; grid-template-columns: repeat(6, minmax(74px, 1fr)); gap: 6px; }
    .guitar-measure-event { min-height: 50px; border: 1px solid var(--line); padding: 7px; background: #fff; }
    .guitar-measure-event strong { display: block; color: var(--text); font-size: 11px; }
    .guitar-measure-event span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
    .guitar-exact-score .guitar-practice-body { grid-template-columns: 240px minmax(0, 1fr); }
    .exact-fingering-title { margin-bottom: 10px; color: var(--text); font-size: 15px; font-weight: 700; }
    .exact-fingering-title span { color: var(--accent); }
    .exact-event-track { margin-top: 0; }
    .exact-rhythm-cell { min-width: 72px; min-height: 48px; border: 1px solid var(--line); padding: 5px 7px; color: var(--muted); background: #fff; text-align: center; }
    .exact-rhythm-cell strong { display: block; overflow-wrap: anywhere; color: var(--text); font-size: 14px; line-height: 24px; }
    .exact-rhythm-cell small { display: block; font-size: 9px; }
    .exact-rhythm-cell.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
    .exact-rhythm-cell.is-done strong { color: #26815f; }
    .exact-action-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .exact-action-list .strum-button { min-width: 86px; font-size: 11px; }
    .exact-source-details { margin-top: 22px; border-top: 1px solid var(--line); }
    .exact-source-details summary { padding: 13px 0; color: var(--muted); font-size: 11px; cursor: pointer; }
    .exact-source-content { display: grid; gap: 16px; padding-bottom: 8px; }
    .exact-source-content .guitar-source-note { margin: 0; }
    .romance-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 16px; border-block: 1px solid var(--line); padding: 11px 0; }
    .romance-form strong { font-size: 12px; }
    .romance-form span { color: var(--muted); font-size: 11px; }
    .romance-pattern { display: grid; gap: 7px; }
    .romance-pattern-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; }
    .romance-pattern-head strong { font-size: 12px; }
    .romance-pattern-head span { color: var(--muted); font-size: 10px; }
    .romance-beat-grid, .romance-voice-row { display: grid; grid-template-columns: 72px repeat(9, minmax(32px, 1fr)); gap: 4px; }
    .romance-beat-grid span { grid-column: span 3; border-bottom: 1px solid var(--line); padding: 2px 0 5px; color: var(--muted); font-size: 10px; text-align: center; }
    .romance-beat-grid span:first-child { grid-column: 2 / span 3; }
    .romance-voice-label { display: flex; align-items: center; color: var(--muted); font-size: 10px; }
    .romance-note-cell { display: grid; min-height: 34px; place-items: center; border-bottom: 1px solid var(--line); color: var(--text); font-size: 10px; }
    .romance-note-cell.is-beat { border-bottom-color: var(--accent-line); font-weight: 600; }
    .romance-bass-cell { grid-column: span 3; display: flex; min-height: 34px; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
    .guitar-section-list { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 20px; color: var(--muted); font-size: 11px; }
    .guitar-section { display: grid; gap: 2px; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; color: var(--muted); background: transparent; text-align: left; }
    .guitar-section strong { color: var(--text); font-size: 12px; }
    .guitar-section span { font-size: 11px; }
    .guitar-section.is-active { border-bottom-color: var(--accent); }
    .guitar-section.is-active strong { color: var(--accent); }
    .guitar-rhythm-track { display: grid; grid-template-columns: repeat(var(--rhythm-slots, 8), minmax(42px, 1fr)); gap: 5px; margin: 12px 0 17px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .rhythm-beat { position: relative; min-height: 48px; border-bottom: 1px solid #b8c2bf; color: var(--muted); background: linear-gradient(to bottom, transparent 23px, #d9dfdd 24px, transparent 25px); text-align: center; }
    .rhythm-beat strong { display: block; color: var(--text); font-size: 18px; line-height: 25px; }
    .rhythm-beat small { display: block; font-size: 9px; }
    .rhythm-beat.is-current { border-bottom-color: var(--accent); background-color: var(--accent-soft); }
    .rhythm-beat.is-done strong { color: #26815f; }
    .guitar-intro-bar { margin-bottom: 16px; padding: 12px 0 10px; border-bottom: 1px solid var(--line); }
    .guitar-intro-bar-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
    .guitar-intro-bar-head strong { color: var(--text); font-size: 13px; }
    .intro-event-list { display: grid; grid-template-columns: repeat(8, minmax(42px, 1fr)); gap: 5px; }
    .intro-event { position: relative; min-height: 52px; border: 1px solid var(--line); padding: 5px 3px; color: var(--muted); background: #fbfcfc; text-align: center; }
    .intro-event:nth-child(4n)::after { content: ""; position: absolute; top: 5px; right: -4px; bottom: 5px; border-right: 1px solid #aab4b1; }
    .intro-event-list.is-eighth-grid .intro-event:nth-child(4n)::after { content: none; }
    .intro-event-list.is-eighth-grid .intro-event:nth-child(2n)::after { content: ""; position: absolute; top: 5px; right: -4px; bottom: 5px; border-right: 1px solid #aab4b1; }
    .intro-event strong { display: block; color: var(--text); font-size: 15px; line-height: 23px; }
    .intro-event small { display: block; font-size: 9px; }
    .intro-event.is-current { border-color: var(--accent-line); background: var(--accent-soft); }
    .intro-event.is-done strong { color: #26815f; }
    @media (max-width: 700px) { .guitar-practice { min-width: 650px; } .guitar-practice.guitar-exact-score { min-width: 0; } .guitar-practice-body { grid-template-columns: 190px minmax(360px, 1fr); gap: 20px; } .guitar-exact-score .guitar-practice-body { grid-template-columns: minmax(0, 1fr); } .exact-event-track { grid-template-columns: repeat(var(--rhythm-slots, 8), minmax(68px, 1fr)); overflow-x: auto; } .guitar-full-score { grid-template-columns: repeat(2, minmax(160px, 1fr)); } .guitar-notation-grid { grid-template-columns: repeat(2, minmax(160px, 1fr)); } .romance-beat-grid, .romance-voice-row { grid-template-columns: 52px repeat(9, minmax(25px, 1fr)); } }
    .voice-shell { border-top: 2px solid var(--accent); }
    .voice-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid var(--line); }
    .voice-tabs button { border: 0; border-bottom: 2px solid transparent; padding: 14px 18px 11px; color: var(--muted); background: transparent; font-size: 13px; }
    .voice-tabs button.is-active { border-bottom-color: var(--accent); color: var(--text); font-weight: 700; }
    .voice-panel { display: none; padding-top: 28px; }
    .voice-panel.is-active { display: block; }
    .voice-panel-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .7fr); gap: 42px; align-items: start; }
    .voice-copy h2 { margin: 0 0 8px; font-size: 24px; }
    .voice-copy p { max-width: 560px; color: var(--muted); font-size: 13px; }
    .voice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0 18px; }
    .voice-status { min-height: 22px; color: var(--muted); font-size: 12px; }
    .pitch-meter { position: relative; height: 112px; margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, transparent 0 27px, #f0f2f1 27px 28px); }
    .pitch-meter::before { content: "音高轨迹"; position: absolute; top: 8px; left: 0; color: var(--muted); font-size: 11px; }
    .pitch-line { position: absolute; right: 0; bottom: 18px; left: 0; height: 2px; transform-origin: left center; background: var(--accent); opacity: .25; }
    .pitch-dot { position: absolute; bottom: 11px; left: 50%; width: 12px; height: 12px; transform: translateX(-50%); border-radius: 50%; background: var(--accent); transition: left .12s ease, bottom .12s ease, background .12s ease; }
    .pitch-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-top: 15px; }
    .pitch-note { font-size: 42px; line-height: 1; }
    .pitch-cents { color: var(--muted); font-size: 12px; }
    .voice-visual { min-height: 260px; padding-top: 2px; border-top: 1px solid var(--line); }
    .voice-visual-label { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
    .voice-visual h3 { margin: 45px 0 8px; font-size: 22px; }
    .mouth-diagram { position: relative; height: 132px; margin-top: 16px; border-bottom: 1px solid var(--line); }
    .mouth-lips { position: absolute; top: 48px; left: 50%; width: 150px; height: 42px; transform: translateX(-50%); border: 1px solid #707a77; border-radius: 50% 50% 44% 44%; }
    .mouth-opening { position: absolute; top: 14px; left: 26px; width: 96px; height: 12px; border-radius: 50%; background: #edf3f2; }
    .mouth-tongue { position: absolute; bottom: 5px; left: 48px; width: 54px; height: 19px; border-top: 1px solid #8ba09c; border-radius: 50%; }
    .voice-vowels { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; margin-top: 20px; }
    .voice-vowel { border: 1px solid var(--line); padding: 12px 8px; color: var(--text); background: transparent; text-align: center; }
    .voice-vowel.is-active { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
    .vowel-symbol { display: block; margin-bottom: 4px; font-size: 22px; font-weight: 700; }
    .voice-scale { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); gap: 6px; align-items: end; height: 150px; margin-top: 22px; border-bottom: 1px solid var(--line); }
    .scale-step { display: grid; place-items: end center; height: 100%; color: var(--muted); font-size: 11px; }
    .scale-step::before { content: ""; width: 100%; max-width: 38px; height: var(--step-height); border: 1px solid #a9b4b1; border-bottom: 0; background: #f3f6f5; }
    .scale-step.is-active::before { border-color: var(--accent); background: var(--accent-soft); }
    @media (max-width: 700px) { .voice-panel-grid { grid-template-columns: 1fr; gap: 26px; } .voice-tabs button { flex: 1 1 30%; padding-inline: 8px; } .voice-vowels { grid-template-columns: repeat(5, 1fr); } .vowel-symbol { font-size: 18px; } }
    .about-layout { max-width: 760px; padding-top: 20px; border-top: 2px solid var(--accent); }
    .about-layout h2 { margin-bottom: 15px; }
    .about-layout p { max-width: 600px; color: var(--muted); font-size: 15px; }
    .about-rule { width: 100%; height: 1px; margin: 45px 0 24px; background: var(--line); }
    .about-quote { max-width: 560px; color: var(--text); font-size: 26px; line-height: 1.35; letter-spacing: -.04em; }
    .practice-shell { border-top: 2px solid var(--accent); }
    .practice-toolbar { display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(170px, 1fr) repeat(3, minmax(112px, .65fr)); gap: 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
    .local-score-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
    .local-score-bar > div { display: grid; gap: 2px; margin-right: auto; }
    .local-score-bar strong { color: var(--text); font-size: 12px; }
    .local-score-bar input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
    .local-score-bar .button { margin: 0; }
    .guitar-source-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
    .guitar-source-label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
    .guitar-bank-select { width: min(230px, 100%); padding-block: 6px; font-size: 12px; }
    .practice-field { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
    .practice-field output { color: var(--text); font-weight: 700; }
    .practice-field select { min-width: 0; }
    .mode-switch { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
    .mode-switch button { border: 0; border-bottom: 2px solid transparent; padding: 13px 18px 11px; color: var(--muted); background: transparent; font-size: 13px; }
    .mode-switch button.is-active { border-bottom-color: var(--accent); color: var(--text); font-weight: 700; }
    .practice-status { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; padding: 22px 0 16px; }
    .practice-status h2 { margin: 0 0 5px; font-size: 24px; }
    .practice-status p { margin: 0; color: var(--muted); font-size: 12px; }
    .practice-progress { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
    .practice-stage { min-height: 190px; display: grid; place-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .next-note { text-align: center; }
    .next-note-label { color: var(--muted); font-size: 11px; }
    .next-note-name { margin: 7px 0 2px; font-size: 58px; line-height: 1; }
    .next-note-key { color: var(--muted); font-size: 13px; }
    .phrase-learning { width: 100%; padding: 18px 0; }
    .phrase-focus { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .72fr); border-bottom: 1px solid var(--line); padding-bottom: 14px; }
    .phrase-focus-item { min-width: 0; padding-right: 18px; }
    .phrase-focus-item + .phrase-focus-item { border-left: 1px solid var(--line); padding-right: 0; padding-left: 18px; }
    .phrase-focus-label, .phrase-note-order { display: block; color: var(--muted); font-size: 10px; }
    .phrase-focus-note { display: block; margin: 3px 0 4px; font-size: 30px; line-height: 1.1; }
    .phrase-focus-key { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
    .phrase-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 13px 0 8px; }
    .phrase-head strong { font-size: 13px; }
    .phrase-head span { color: var(--muted); font-size: 10px; }
    .practice-compact-range { display: none; }
    .phrase-note-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 6px; }
    .phrase-note { min-width: 0; min-height: 66px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; background: var(--surface); }
    .phrase-note strong { display: block; margin: 2px 0; font-size: 18px; }
    .phrase-note small { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: 9px; }
    .phrase-note.is-current { border-color: #e66d28; color: #b94f13; background: #fff4ec; box-shadow: inset 0 -3px 0 #e66d28; }
    .phrase-note.is-next { border-color: #909997; background: #f5f7f6; }
    .phrase-note.is-correct { border-color: #b9d8ca; color: #26815f; background: #f1f8f5; }
    .phrase-note.is-wrong { border-color: #d9aaaa; color: #b84343; background: #fff4f4; }
    .phrase-next-line { margin-top: 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
    .phrase-next-line strong { margin-right: 7px; color: var(--text); }
    .phrase-memory .phrase-focus { grid-template-columns: 1fr; }
    .phrase-memory .phrase-note:not(.is-correct):not(.is-wrong) strong,
    .phrase-memory .phrase-note:not(.is-correct):not(.is-wrong) small { visibility: hidden; }
    .phrase-memory .phrase-note:not(.is-correct):not(.is-wrong) strong::after { content: "?"; visibility: visible; }
    .phrase-complete { width: 100%; padding: 28px 0; text-align: center; }
    .phrase-complete strong { display: block; margin-bottom: 7px; font-size: 24px; }
    .phrase-complete span { color: var(--muted); font-size: 12px; }
    .score-wrap { width: 100%; overflow-x: auto; padding: 20px 0 12px; }
    .score { position: relative; min-width: 700px; height: 150px; display: flex; align-items: stretch; }
    .score::before { content: ""; position: absolute; top: 35px; right: 0; left: 0; height: 60px; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 15px); pointer-events: none; }
    .score-measure { position: relative; z-index: 1; flex: 1; min-width: 150px; display: flex; align-items: stretch; border-right: 1px solid #b7bfbd; }
    .score-measure:first-child { border-left: 1px solid #b7bfbd; }
    .score-measure-number { position: absolute; top: 7px; left: 7px; color: var(--muted); font-size: 10px; }
    .score-note { position: relative; flex: 1; min-width: 30px; border: 0; padding: 0; color: var(--text); background: transparent; }
    .score-note::before { content: ""; position: absolute; top: var(--note-y); left: 50%; width: 13px; height: 10px; transform: translate(-50%, -50%) rotate(-16deg); border-radius: 50%; background: currentColor; }
    .score-note::after { content: ""; position: absolute; top: calc(var(--note-y) - 29px); left: calc(50% + 5px); width: 1px; height: 30px; background: currentColor; }
    .score-note.is-current { color: var(--accent); background: var(--accent-soft); }
    .score-note.is-correct { color: #26815f; }
    .score-note.is-wrong { color: #c65353; }
    .score-note-name { position: absolute; right: 0; bottom: 8px; left: 0; color: inherit; font-size: 10px; text-align: center; }
    .practice-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 17px 0 10px; }
    .practice-actions .range-field { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12px; }
    .practice-actions input[type=number] { width: 60px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; color: var(--text); background: var(--surface); }
    .practice-loop { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
    .practice-keyboard { margin-top: 18px; }
    .rhythm-shell { min-width: 0; border-top: 2px solid var(--accent); }
    .rhythm-toolbar { display: grid; min-width: 0; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
    .rhythm-actions { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .rhythm-actions .rhythm-hint { margin-left: auto; color: var(--muted); font-size: 11px; }
    .rhythm-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .rhythm-stat { min-height: 64px; padding: 11px 14px 10px 0; }
    .rhythm-stat + .rhythm-stat { padding-left: 14px; border-left: 1px solid var(--line); }
    .rhythm-stat span { display: block; color: var(--muted); font-size: 10px; }
    .rhythm-stat strong { display: block; margin-top: 3px; font-size: 22px; font-variant-numeric: tabular-nums; }
    .rhythm-stage { --rhythm-lanes: 12; position: relative; display: grid; min-width: 0; grid-template-columns: repeat(var(--rhythm-lanes), minmax(0, 1fr)); height: min(60vh, 480px); min-height: 320px; margin-top: 18px; overflow: hidden; border: 1px solid var(--line); background: #f7faf9; }
    .rhythm-lane { position: relative; min-width: 0; overflow: hidden; border-right: 1px solid #e0e8e5; }
    .rhythm-lane:last-child { border-right: 0; }
    .rhythm-lane:nth-child(odd) { background: rgba(255,255,255,.32); }
    .rhythm-lane.is-black { background: linear-gradient(to bottom, rgba(31,41,51,.09) 0 38%, rgba(31,41,51,.02) 38% 100%); }
    .rhythm-lane-label { position: absolute; right: 0; bottom: 8px; left: 0; z-index: 3; color: var(--muted); text-align: center; font-size: 9px; font-variant-numeric: tabular-nums; pointer-events: none; }
    .rhythm-hit-line { position: absolute; right: 0; bottom: 34px; left: 0; z-index: 4; height: 3px; background: #e66d28; box-shadow: 0 0 0 1px rgba(230,109,40,.18); pointer-events: none; }
    .rhythm-hit-line::before { content: "判定线"; position: absolute; right: 8px; bottom: 7px; color: #b94f13; font-size: 10px; }
    .rhythm-note { position: absolute; top: 0; left: 50%; z-index: 2; width: 78%; min-width: 8px; height: 23px; transform: translateX(-50%); border: 1px solid #6faaa4; border-radius: 4px; background: var(--accent); box-shadow: 0 3px 0 rgba(31,41,51,.1); transition: background .12s ease, border-color .12s ease, opacity .2s ease; }
    .rhythm-note::after { content: attr(data-label); position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; color: #fff; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
    .rhythm-note.is-good { background: #d48a27; border-color: #b87519; }
    .rhythm-note.is-perfect { background: #26815f; border-color: #1c684b; }
    .rhythm-note.is-miss { background: #c65353; border-color: #a83c3c; opacity: .7; }
    .rhythm-note.is-judged { animation: rhythm-judged .24s ease both; }
    @keyframes rhythm-judged { to { opacity: 0; transform: translate(-50%, 8px) scale(.82); } }
    .rhythm-feedback { min-height: 30px; padding: 10px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; text-align: center; }
    .rhythm-feedback.is-perfect { color: #26815f; }
    .rhythm-feedback.is-good { color: #b87519; }
    .rhythm-feedback.is-miss { color: #c65353; }
    .rhythm-feedback.is-complete, .rhythm-feedback.is-manual { color: var(--accent); }
    .rhythm-keyboard { margin-top: 18px; }
    .rhythm-keyboard-grid { display: grid; min-width: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; }
    .rhythm-key { min-width: 0; min-height: 48px; border: 1px solid var(--line); border-radius: 5px; padding: 5px 3px; color: var(--text); background: #fff; font-size: 10px; }
    .rhythm-key strong, .rhythm-key small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .rhythm-key strong { font-size: 12px; }
    .rhythm-key small { margin-top: 2px; color: var(--muted); font-size: 9px; }
    .rhythm-key.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -3px 0 var(--accent); }
    .rhythm-keyboard-grid.is-24 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
    .rhythm-keyboard-grid.is-24 .rhythm-key { min-height: 40px; }
    @media (max-width: 900px) { .rhythm-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rhythm-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .rhythm-stat:nth-child(4) { border-left: 0; padding-left: 0; } }
    .site-footer { max-width: 1240px; margin: 0 auto; padding: 18px 30px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
    .toast { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: 270px; padding: 10px 13px; border-radius: 6px; color: var(--surface); background: var(--surface-dark); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
    .toast.show { opacity: 1; transform: translateY(0); }
    .file-manager { border-top: 2px solid var(--accent); }
    .file-manager-toolbar, .file-manager-connect, .file-manager-meta, .file-upload-row { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; padding: 16px 0; border-bottom: 1px solid var(--line); }
    .file-manager-toolbar { align-items: center; justify-content: space-between; }
    .file-manager-toolbar h2 { margin: 0 0 4px; font-size: 22px; }
    .file-manager-toolbar p, .file-manager-meta span { margin: 0; color: var(--muted); font-size: 11px; }
    .file-manager-actions { display: flex; gap: 8px; }
    .file-manager-connect .hardware-field { min-width: 280px; flex: 1 1 320px; }
    .file-manager-serial-connect { align-items: center; }
    .file-manager-serial-connect .file-transfer-note { flex: 1 1 100%; margin: 0; }
    .file-manager-manual { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
    .file-manager-manual[hidden] { display: none; }
    .file-manager-manual .hardware-field { min-width: 280px; flex: 1 1 320px; }
    .file-device-list { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 0; }
    .file-device-item { min-width: 190px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; color: var(--text); background: var(--surface); text-align: left; cursor: pointer; }
    .file-device-item:hover { border-color: var(--accent); background: var(--accent-soft); }
    .file-device-item strong, .file-device-item small { display: block; }
    .file-device-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
    .file-manager-content { padding-top: 4px; }
    .file-manager-layout { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 26px; padding-top: 14px; }
    .file-directory-tree { min-width: 0; padding-right: 18px; border-right: 1px solid var(--line); }
    .file-directory-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 12px; border-bottom: 2px solid var(--accent); }
    .file-directory-heading strong { font-size: 14px; }
    .file-directory-heading span { color: var(--muted); font-size: 10px; }
    .file-directory-nav { display: grid; gap: 3px; padding-top: 8px; }
    .file-directory-nav button { display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 5px; width: 100%; border: 1px solid transparent; border-radius: 5px; padding: 8px 9px; color: var(--muted); background: transparent; text-align: left; font-size: 12px; cursor: pointer; }
    .file-directory-nav button span { color: var(--muted); font-size: 11px; text-align: center; }
    .file-directory-nav button:hover { color: var(--text); background: var(--accent-soft); }
    .file-directory-nav button.is-active { border-color: var(--accent-line); color: var(--text); background: var(--accent-soft); font-weight: 700; }
    .file-directory-nav button.is-active span { color: var(--accent); }
      .file-manager-main { min-width: 0; }
      .file-manager-meta { align-items: end; }
      .file-manager-meta > div { display: grid; gap: 4px; margin-right: auto; }
      .file-manager-meta .hardware-field { min-width: 145px; }
      .file-manager-meta .hardware-field input, .file-manager-meta .hardware-field select { min-height: 32px; }
      .file-upload-row { align-items: center; }
      .file-picker { display: inline-flex; align-items: center; gap: 8px; }
      .file-pick-button { min-height: 34px; white-space: nowrap; }
      .file-upload-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
      #fileSelectedName { min-width: 150px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      .file-table-wrap { overflow-x: auto; }
    .file-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .file-table th, .file-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
    .file-table th { color: var(--muted); font-size: 10px; font-weight: 600; }
    .file-table td:first-child { min-width: 260px; }
    .file-action { margin-right: 8px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--text); background: var(--surface); font: inherit; font-size: 10px; cursor: pointer; }
      .file-action:hover { border-color: var(--accent); color: var(--accent); }
      .file-action.danger:hover { border-color: #c65353; color: #c65353; }
      .file-action:disabled { opacity: .4; cursor: not-allowed; }
      .file-network-panel { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
      .file-network-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
      .file-network-heading h3 { margin: 0 0 4px; font-size: 16px; }
      .file-network-heading p { margin: 0; }
      .file-network-fields { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)) auto; gap: 10px; align-items: end; }
      .file-network-fields input, .file-network-fields select { width: 100%; min-height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px; color: var(--text); background: var(--surface); }
      .file-network-static[hidden] { display: none; }
      .transfer-discovery-block { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 6px 10px; min-width: 280px; flex: 1 1 360px; }
      .transfer-discovery-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; grid-column: 1 / -1; }
      .transfer-device-list { display: flex; gap: 6px; min-height: 34px; align-items: center; overflow-x: auto; }
      .transfer-device-item { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 5px; padding: 7px 9px; color: var(--text); background: var(--surface); text-align: left; cursor: pointer; }
      .transfer-device-item:hover, .transfer-device-item.is-selected { border-color: var(--accent); background: var(--accent-soft); }
      .transfer-device-item strong, .transfer-device-item small { display: block; white-space: nowrap; }
      .transfer-device-item small { margin-top: 2px; color: var(--muted); font-size: 10px; }
      .transfer-manual { min-width: 250px; flex: 1 1 300px; }
      .transfer-manual[hidden] { display: none; }
      .password-input-wrap { position: relative; display: block; }
      .password-input-wrap input { width: 100%; padding-right: 42px !important; }
      .password-toggle { position: absolute; top: 50%; right: 5px; display: grid; width: 30px; height: 28px; place-items: center; transform: translateY(-50%); border: 0; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; font-size: 14px; }
      .password-toggle:hover, .password-toggle.is-visible { color: var(--accent); background: var(--accent-soft); }
      .remember-password { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; color: var(--muted); font-size: 11px; cursor: pointer; white-space: nowrap; touch-action: manipulation; }
      .remember-password input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; pointer-events: auto; }
      @media (max-width: 900px) { .file-network-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .file-network-fields .button { width: 100%; } }
      @media (max-width: 780px) { .file-manager-layout { grid-template-columns: 1fr; gap: 18px; } .file-directory-tree { padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--line); } .file-directory-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
      @media (max-width: 700px) { .file-manager-connect .button, .file-manager-manual .button, .file-manager-meta .hardware-field { width: 100%; } .file-directory-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } .file-table td:first-child { min-width: 180px; } }
     @media (max-width: 900px) { .home-hero { grid-template-columns: 1fr; gap: 38px; min-height: auto; } .entry-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .signal-panel { min-height: 350px; } .signal-panel-title { margin-top: 75px; } .ear-layout, .lab-layout { grid-template-columns: 1fr; gap: 38px; } .ear-visual { min-height: 280px; } .lab-controls { max-width: 420px; } .practice-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hardware-controls { grid-template-columns: 1fr 1fr; } .hardware-controls .hardware-field:first-child { grid-column: 1 / -1; } }
     @media (max-width: 700px) { .hardware-module-panel { grid-template-columns: 1fr; } .hardware-module-panel .hardware-actions { grid-column: auto; } }
     @media (max-width: 700px) { .site-header { height: auto; min-height: 72px; flex-wrap: wrap; padding: 14px 18px; gap: 10px; } .main-nav { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; } .nav-link { padding: 7px 10px; white-space: nowrap; } .header-status { margin-left: auto; } main { padding: 0 18px 56px; } .view { padding-top: 48px; } .view-heading { display: block; margin-bottom: 33px; } .view-heading .lead { margin-top: 14px; } h1 { font-size: 43px; } .entry-row { grid-template-columns: 1fr; gap: 4px; } .lesson-intro { display: block; margin-top: -8px; margin-bottom: 29px; } .lesson-intro p { margin-bottom: 18px; } .lesson-steps { gap: 8px; } .lesson-step { padding-left: 23px; font-size: 11px; } .lesson-step strong { font-size: 12px; } .theory-layout { grid-template-columns: 1fr; gap: 28px; } .theory-head { display: block; } .theory-head .formula { display: block; margin-top: 10px; white-space: normal; } .theory-visual { padding-top: 25px; } .keyboard { height: 137px; } .black-keys { height: 78px; } .theory-annotation { grid-template-columns: 1fr 1fr 1fr; } .lesson-reading { grid-template-columns: 1fr; } .reading-item, .reading-item:nth-child(even) { min-height: 0; padding: 15px 0; border-left: 0; } .annotation strong { font-size: 14px; } .count-track { grid-template-columns: repeat(2, minmax(0, 1fr)); } .chord-route { gap: 4px; } .chord-stop { min-width: 52px; padding: 7px 7px; } .chord-jump { font-size: 10px; } .lesson-next { display: block; } .lesson-actions { justify-content: flex-end; margin-top: 14px; } .lesson-actions .button { white-space: nowrap; } .ear-visual { min-height: 240px; } .ear-visual h3 { margin-top: 48px; font-size: 23px; } .choice-grid { grid-template-columns: 1fr; max-width: none; } .about-quote { font-size: 23px; } .hardware-head { display: block; } .hardware-transport { display: block; margin-top: 10px; } .hardware-controls { grid-template-columns: 1fr; } .hardware-controls .hardware-field:first-child { grid-column: auto; } .hardware-map { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
    @media (max-width: 700px) { .keyboard-tools { display: flex; flex-wrap: wrap; } .keyboard-tools .keyboard-label { flex: 1 1 100%; } .keyboard-tools .binding-opacity { display: flex; flex: 1 1 180px; margin: 0; } .keyboard-tools .binding-opacity input { flex: 1; } .instrument-switch { margin-right: auto; } .guitar-fretboard { min-width: 680px; } .keymap-head { display: block; } .keymap-actions { justify-content: flex-start; flex-wrap: wrap; margin-top: 14px; } .keymap-actions .button { white-space: nowrap; } .keymap-help { display: block; } .keymap-help span { display: block; margin-top: 4px; } [data-view="theory"] .lesson-intro, [data-view="theory"] > .view-heading { display: none !important; } .lesson-sidebar { position: static; max-height: none; overflow: visible; padding: 0 0 18px; border-right: 0; border-bottom: 1px solid var(--line); } .lesson-sidebar-head { padding-bottom: 12px; } .topic-nav { max-height: 330px; overflow-y: auto; } .chapter-lessons { grid-template-columns: 1fr; } .practice-toolbar { grid-template-columns: 1fr; } .guitar-source-label { width: 100%; } .guitar-bank-select { flex: 1; width: auto; } .practice-status { display: block; } .practice-progress { display: block; margin-top: 8px; } .practice-actions .range-field { width: 100%; margin-left: 0; } .next-note-name { font-size: 48px; } .phrase-focus-note { font-size: 25px; } .phrase-note-grid { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); } .overview-route { grid-template-columns: repeat(2, minmax(0, 1fr)); } .overview-route-item:nth-child(3), .overview-route-item:nth-child(5) { border-left: 0; padding-left: 0; } .overview-route-item:nth-child(n+3) { margin-top: 8px; } .overview-uses { grid-template-columns: 1fr 1fr; } .overview-use:nth-child(3) { padding-left: 0; border-left: 0; } .overview-use:nth-child(n+3) { margin-top: 8px; } }
    /* The practice route is a fixed work surface: controls, phrase and keys stay in one viewport. */
    body:has([data-view="practice"].is-active) { overflow: hidden; background: #f8faf9; }
    body:has([data-view="practice"].is-active) .site-footer,
    body:has([data-view="practice"].is-active) [data-view="practice"] > .view-heading { display: none; }
    body:has([data-view="practice"].is-active) main { width: 100%; max-width: 1240px; height: 100dvh; margin-inline: auto; padding: 8px 20px; }
    body:has([data-view="practice"].is-active) [data-view="practice"] { height: 100%; padding: 0; }
    body:has([data-view="practice"].is-active) .practice-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px 58px minmax(0, 1fr); gap: 8px; width: 100%; height: 100%; margin: 0; border: 0; }
     .practice-app-bar { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto auto; align-items: center; gap: 10px; min-width: 0; border-top: 2px solid var(--accent); border-bottom: 1px solid var(--line); }
    .practice-app-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
    .practice-app-title strong { font-size: 15px; }
    .practice-app-title span, .practice-device-status { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    #practiceAudioStatus::before, .practice-device-status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #22a06b; vertical-align: 1px; }
    #practiceAudioStatus[data-state="waiting"]::before { background: #e66d28; }
    #practiceAudioStatus[data-state="unavailable"]::before { background: #c65353; }
    .practice-device-status { display: none; max-width: 150px; }
    .practice-shell.session-entity .practice-device-status { display: inline-block; }
    .practice-session-switch { display: inline-flex; align-items: center; gap: 2px; margin: 0; padding: 2px; border: 1px solid var(--line); border-radius: 7px; background: #eef2f0; }
    body:has([data-view="practice"].is-active) .practice-session-switch { grid-column: auto; grid-row: auto; }
    .practice-session-switch button { min-width: 72px; border: 0; border-radius: 5px; padding: 7px 10px; color: var(--muted); background: transparent; font-size: 11px; white-space: nowrap; }
     .practice-session-switch button.is-active { border: 0; color: var(--text); background: #fff; box-shadow: 0 1px 3px rgba(31,41,51,.1); }
     .practice-session-switch span { display: none; }
    .practice-controlbar { display: grid; grid-template-columns: minmax(330px, 1fr) auto; align-items: stretch; gap: 10px; min-width: 0; border-bottom: 1px solid var(--line); }
    body:has([data-view="practice"].is-active) .practice-toolbar { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(120px, 170px); grid-column: auto; grid-row: auto; align-items: center; gap: 10px; min-width: 0; padding: 0; border: 0; }
    body:has([data-view="practice"].is-active) .practice-toolbar .practice-field { min-width: 0; gap: 3px; font-size: 9px; }
    body:has([data-view="practice"].is-active) .practice-toolbar .practice-field:nth-child(n+3) { display: none; }
    body:has([data-view="practice"].is-active) .practice-toolbar select { min-height: 32px; padding: 5px 8px; font-size: 11px; }
    body:has([data-view="practice"].is-active) .practice-toolbar input[type=range] { height: 16px; }
    .practice-controlbar .mode-switch { display: grid; grid-template-columns: repeat(3, minmax(78px, 1fr)); align-self: center; border: 1px solid var(--line); border-radius: 7px; padding: 2px; background: #eef2f0; }
    .practice-controlbar .mode-switch button { min-height: 32px; border: 0; border-radius: 5px; padding: 6px 10px; font-size: 11px; white-space: nowrap; }
    .practice-controlbar .mode-switch button.is-active { border: 0; background: #fff; box-shadow: 0 1px 3px rgba(31,41,51,.1); }
    .practice-config-instrument-switch, .practice-config-actions, .hardware-config-actions { display: none; }
    body:has([data-view="practice"].is-active) .local-score-bar,
    body:has([data-view="practice"].is-active) .guitar-source-bar { display: none !important; }
    .practice-workspace { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 12px; min-width: 0; min-height: 0; }
    .practice-learning-panel, .practice-instrument-panel { min-width: 0; min-height: 0; border-top: 1px solid var(--line); background: #fff; }
    .practice-learning-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; align-self: stretch; }
    body:has([data-view="practice"].is-active) .practice-status,
    body:has([data-view="practice"].is-active) .practice-stage,
    body:has([data-view="practice"].is-active) .practice-actions,
    body:has([data-view="practice"].is-active) .practice-keyboard,
    body:has([data-view="practice"].is-active) .practice-hardware-device { grid-column: auto; grid-row: auto; }
    body:has([data-view="practice"].is-active) .practice-status { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 0; }
    body:has([data-view="practice"].is-active) .practice-status > div { min-width: 0; }
    body:has([data-view="practice"].is-active) .practice-status h2 { overflow: hidden; margin: 0; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
    body:has([data-view="practice"].is-active) .practice-status p { overflow: hidden; margin-top: 2px; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
    body:has([data-view="practice"].is-active) .practice-progress { margin-left: auto; font-size: 10px; }
    body:has([data-view="practice"].is-active) .practice-stage { display: grid; width: 100%; height: 100%; min-height: 0; max-height: none; overflow: auto; align-content: start; place-items: stretch; padding: 0; }
    body:has([data-view="practice"].is-active) .phrase-learning { width: 100%; padding: 7px 0; }
    body:has([data-view="practice"].is-active) .phrase-focus { padding-bottom: 7px; }
    body:has([data-view="practice"].is-active) .phrase-focus-note { font-size: 24px; }
    body:has([data-view="practice"].is-active) .phrase-focus-key { font-size: 9px; }
    body:has([data-view="practice"].is-active) .phrase-head { margin: 7px 0 5px; }
    body:has([data-view="practice"].is-active) .phrase-note-grid { grid-template-columns: repeat(auto-fit, minmax(48px, 1fr)); gap: 4px; }
    body:has([data-view="practice"].is-active) .phrase-note { min-height: 46px; padding: 4px 6px; }
    body:has([data-view="practice"].is-active) .phrase-note strong { margin: 1px 0; font-size: 15px; }
    body:has([data-view="practice"].is-active) .phrase-next-line { margin-top: 5px; font-size: 9px; }
    body:has([data-view="practice"].is-active) .practice-actions { display: flex; max-height: none; overflow: visible; flex-flow: row nowrap; align-self: auto; align-items: center; gap: 5px; min-width: 0; margin: 0; padding: 6px 0 0; border-top: 1px solid var(--line); }
    body:has([data-view="practice"].is-active) .practice-actions .button { min-height: 32px; padding: 6px 10px; font-size: 10px; white-space: nowrap; }
    body:has([data-view="practice"].is-active) .practice-actions .range-field { gap: 4px; min-width: 0; margin-left: auto; font-size: 9px; white-space: nowrap; }
    body:has([data-view="practice"].is-active) .practice-actions input[type=number] { width: 44px; min-height: 32px; padding: 5px 6px; font-size: 10px; }
    body:has([data-view="practice"].is-active) .practice-loop { font-size: 10px; white-space: nowrap; }
    .practice-instrument-panel { display: grid; align-content: end; align-items: end; overflow: hidden; }
    body:has([data-view="practice"].is-active) .practice-keyboard { width: 100%; margin: 0; }
    body:has([data-view="practice"].is-active) .practice-keyboard .keyboard { height: clamp(170px, 28vh, 270px); margin-top: 6px; }
    body:has([data-view="practice"].is-active) .practice-keyboard .black-keys { height: 58%; }
    body:has([data-view="practice"].is-active) .keyboard-tools { min-height: 32px; gap: 8px; }
    body:has([data-view="practice"].is-active) .keyboard-tools .keyboard-label { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
    body:has([data-view="practice"].is-active) .binding-opacity { font-size: 9px; }
    body:has([data-view="practice"].is-active) .binding-opacity input { width: 72px; }
    body:has([data-view="practice"].is-active) .practice-hardware-device { width: 100%; height: auto; margin: 0; padding: 0; border: 0; }
    body:has([data-view="practice"].is-active) .practice-hardware-device .hardware-head,
    body:has([data-view="practice"].is-active) .practice-hardware-device .hardware-map,
    body:has([data-view="practice"].is-active) .practice-hardware-device .hardware-help { display: none; }
    body:has([data-view="practice"].is-active) .practice-hardware-device .hardware-mode { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0; }
    body:has([data-view="practice"].is-active) .practice-hardware-device .hardware-mode button { min-height: 32px; padding: 6px 8px; font-size: 10px; }
    body:has([data-view="practice"].is-active) .practice-hardware-device .hardware-piano { margin-top: 6px; }
    body:has([data-view="practice"].is-active) .practice-hardware-device .keyboard { height: clamp(170px, 30vh, 270px); margin-top: 6px; }
    body:has([data-view="practice"].is-active) .practice-hardware-device .black-keys { height: 58%; }
    body:has([data-view="practice"].is-active) .score-wrap { height: auto; padding: 4px 0; overflow: hidden; }
    body:has([data-view="practice"].is-active) .score { width: 100%; min-width: 0; height: 150px; min-height: 130px; }
    body:has([data-view="practice"].is-active) .score-measure { min-width: 0; }
     @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
