  :root{
    --bg:#f6f8fb; --card:#ffffff; --muted:#5b6a7a; --accent:#0ea5e9; --accent2:#22c55e; --warn:#ef4444; --string:#263341;
  }
  html,body{height:100%;margin:0;background:var(--bg);color:#0b1522;font-family:ui-sans-serif,system-ui,Segoe UI,Roboto,Helvetica,Arial}
  .wrap{max-width:1260px;margin:24px auto;padding:16px}
  .layout{display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:16px; align-items:start}
  .layout.hide-rightbar{grid-template-columns:1fr}
  .layout.hide-rightbar .rightbar{display:none}
  .main-column{min-width:0}
  @media(max-width:900px){
    .layout{grid-template-columns:1fr}
    .rightbar{position:relative; top:0}
  }
  .title{display:flex;align-items:center;gap:12px;margin-bottom:16px}
  .title h1{font-size:20px;margin:0}
  .panel{background:var(--card);border:1px solid #e6edf5;border-radius:14px;padding:12px 14px;display:flex;flex-wrap:wrap;gap:12px;align-items:center;box-shadow:0 4px 14px rgba(10,30,60,.05)}
  select,button,input[type="number"],.toggle{background:#f2f6fb;border:1px solid #d7e1ec;color:#0b1522;border-radius:10px;padding:10px 12px;font-size:14px}
  button{cursor:pointer}
  .btn-primary{background:#e6f6ff;border-color:#bfe7ff}
  .btn-primary:hover{filter:brightness(0.98)}
  .hint{color:var(--muted);font-size:13px}

  .neck{position:relative; margin-top:16px; background:#d7ab6b; border:1px solid #c39454; border-radius:14px; padding:16px; overflow:hidden; box-shadow:inset 0 0 0 1px rgba(0,0,0,.08), inset 0 10px 40px rgba(0,0,0,.12)}
  .neck::before{
    content:"";
    position:absolute;
    left:-90px; top:-8px; bottom:-8px;
    width:105px;
    background:linear-gradient(90deg,#bf914f 0%, #c99756 35%, #d7ab6b 100%);
    clip-path:polygon(0 8%, 100% 16%, 100% 84%, 0 92%);
    border-right:1px solid rgba(0,0,0,.15);
  }
  .neck::after{
    content:"";
    position:absolute;
    left:6px; top:14px; bottom:14px;
    width:2px;
    background:#121212;
    box-shadow:3px 0 0 #121212;
  }
  .fret-scale{display:flex; width:calc(100% - 32px); margin:8px 16px 0 16px; border-top:3px solid #ef4444; padding-top:8px; position:relative}
  .fret-scale::before,.fret-scale::after{
    content:""; position:absolute; top:-14px; width:2px; height:12px; background:#ef4444;
  }
  .fret-scale::before{left:0}
  .fret-scale::after{right:0}
  .fret-segment{flex:1; text-align:center; font-weight:500; letter-spacing:.5px; color:#424549; position:relative; font-size:0.5em; top:-21px}
  .fret-segment::after{
    content:""; position:absolute; right:0; top:2px; width:2px; height:12px; background:#ce2525;
  }
  .fret-segment:last-child::after{display:none}
  .frets{position:absolute; inset:16px 16px 16px 16px; pointer-events:none}
  .fret{position:absolute; top:0; bottom:0; width:2px; background:rgba(0,0,0,.18)}
  .inlay{position:absolute; width:10px; height:10px; border-radius:50%; background:rgba(0,0,0,.25)}

  .strings{position:relative; z-index:2}
  .string{position:relative; height:44px; display:flex; align-items:center}
  .wire{height:2px; width:100%; background:linear-gradient(90deg,#50647a,#2f3f52,#50647a); border-radius:2px; box-shadow:0 0 0 1px rgba(0,0,0,.06)}
  .wire.thick{height:3px}
  .string .label{position:absolute; left:-48px; width:16px; text-align:right; font-size:12px; color:#112034}
  .hot{position:absolute; inset:0}
  .string.active .wire{filter:brightness(1.6); box-shadow:0 0 12px 2px rgba(14,165,233,.35)}
  .muted .wire{opacity:.35; filter:grayscale(1)}

  /* Fingering markers on neck */
  .marker{position:absolute; width:22px; height:22px; border-radius:50%; background:var(--accent); border:2px solid #fff; box-shadow:0 4px 10px rgba(0,0,0,.2); transform:translate(-50%,-50%); z-index:3; display:flex; align-items:center; justify-content:center; color:#fff; font-size:11px; font-weight:700}
  .marker.open{background:var(--accent2); border-color:#e8ffe8; color:#0f2d12}
  .marker.mute{background:#fff; border-color:#333; box-shadow:none}
  .x-sign{position:absolute; transform:translate(-50%,-50%); font-weight:700; color:#111}

  .legend{color:#425468; font-size:13px; line-height:1.5}
  .note-buttons{display:flex; gap:8px; flex-wrap:wrap}
  .note-buttons button.active{background:#0ea5e9; color:#fff; border-color:#0ea5e9}
  .controls-row{display:flex; flex-wrap:wrap; gap:10px; align-items:center}
  .icon-btn{width:40px; height:40px; border-radius:12px; display:flex; align-items:center; justify-content:center; padding:0; font-size:18px}
  .icon-btn .sr-only{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0}
  .pill{background:#eef4ff; border:1px solid #d7e6ff; padding:8px 10px; border-radius:10px; font-size:13px}
  .tags{display:flex; gap:6px; flex-wrap:wrap; font-size:12px}
  .tag{background:#e8f2ff; color:#0f1c2d; padding:4px 8px; border-radius:8px; border:1px solid #d1e3ff}
  .step-badge{
    position:absolute; bottom:15px; right:-12px; background:#fff; color:#111;
    border-radius:50%; border:1px solid #0f172a; width:15px; height:15px;
    display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700;
    box-shadow:0 3px 8px rgba(0,0,0,.18); pointer-events:none;
  }
  .marker.scale{box-shadow:0 4px 14px rgba(0,0,0,.2)}
  .marker.scale.active{filter:brightness(1.3); box-shadow:0 0 0 3px rgba(14,165,233,.35), 0 10px 24px rgba(14,165,233,.35)}
  .marker.detected{box-shadow:0 0 0 4px rgba(34,197,94,.35), 0 10px 24px rgba(34,197,94,.25); filter:brightness(1.2)}
  .fingering{display:none; margin-top:8px; background:#f7faff; border:1px solid #d9e6ff; border-radius:10px; padding:8px 10px; color:#0f1c2d; font-size:12px; line-height:1.5}
  .fingering.show{display:block}
  .status-row{display:flex; align-items:center; gap:12px; margin-top:8px}
  .status-bar{flex:1; padding:10px 12px; border-radius:10px; border:1px solid #d7e6ff; background:#f7faff; color:#0f1c2d; font-size:12px; display:flex; flex-direction:column; gap:4px; box-shadow:0 2px 10px rgba(10,30,60,.06)}
  .tips-panel{display:none; margin-top:10px; background:#f7faff; border:1px solid #d9e6ff; border-radius:10px; padding:10px 12px; color:#0f1c2d; font-size:13px; line-height:1.5; position:relative}
  .tips-panel.show{display:block}
  .tips-close{position:absolute; top:8px; right:8px; border:none; background:#e2e8f0; border-radius:50%; width:24px; height:24px; cursor:pointer}
  .tips-btn{background:#fff3d9; border:1px solid #facc15; color:#7c5900; border-radius:50%; margin-top:8px; width:26px; height:26px; display:flex; align-items:center; justify-content:center; font-weight:800; cursor:pointer}
  .tips-row{display:flex; gap:8px; align-items:center; margin-top:8px}
  .legend-icon{width:18px; height:18px; vertical-align:-4px; margin-right:6px}
  .finger-badge{position:absolute; left:-10px; bottom:-10px; background:#dbeafe; color:#0b1f44; border:1px solid #94b6ff; border-radius:50%; width:18px; height:18px; display:flex; align-items:center; justify-content:center; font-size:11px; font-weight:700; box-shadow:0 2px 6px rgba(0,0,0,.15); pointer-events:none}

  .footer{margin-top:16px; color:#425468; font-size:12px}
  .footer-controls{display:flex; justify-content:flex-end; align-items:center; gap:10px}
  .footer-right{display:flex; align-items:center; gap:10px}
  .mic-block{display:flex; align-items:center; gap:10px; min-width:220px}
  .mic-meter{width:180px; height:14px; background:#e2e8f0; border-radius:999px; overflow:hidden; border:1px solid #cbd5e1; box-shadow:inset 0 1px 2px rgba(0,0,0,.08)}
  .mic-meter-fill{height:100%; width:0%; background:linear-gradient(90deg,#22c55e,#0ea5e9); transition:width .12s ease}
  .rightbar{background:var(--card); border:1px solid #e6edf5; border-radius:16px; padding:14px; position:sticky; top:12px; box-shadow:0 12px 36px rgba(10,30,60,.08); min-height:320px}
  .rightbar-header{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px}
  .eyebrow{text-transform:uppercase; letter-spacing:1px; font-size:11px; color:#6b7280}
  .rightbar-title{font-size:18px; font-weight:700; color:#0b1522}
  .mic-chip{padding:6px 10px; border-radius:999px; background:#f1f5f9; border:1px solid #e2e8f0; font-weight:600; font-size:12px}
  .mic-chip.on{background:#ecfeff; color:#0ea5e9; border-color:#bae6fd}
  .card-section{margin-top:10px; padding:10px; border-radius:12px; background:#f8fbff; border:1px solid #e5edf7}
  .section-label{font-size:12px; color:#6b7280; text-transform:uppercase; letter-spacing:.5px; margin-bottom:6px}
  .live-note{font-size:22px; font-weight:800; color:#0ea5e9}
  .live-note-sub{font-size:12px; color:#6b7280}
  .history-list{list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:6px}
  .history-list li{background:#fff; border:1px solid #e5edf7; border-radius:10px; padding:8px 10px; display:flex; justify-content:space-between; align-items:center; gap:8px; box-shadow:0 6px 16px rgba(10,30,60,.04)}
  .history-meta{font-size:11px; color:#6b7280}
  .pill-note{padding:4px 8px; border-radius:10px; background:#e0f2fe; color:#0f172a; font-weight:700; font-size:12px}
  .pill-chord{padding:4px 8px; border-radius:10px; background:#ecfeff; color:#0f172a; font-weight:700; font-size:12px; border:1px solid #bae6fd}
  .chord-shape{font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size:12px; color:#0f172a}

  /* Focus Mode (fallback when fullscreen is blocked) */
  body.focus .wrap{position:fixed; inset:0; background:var(--bg); padding:10px; overflow:auto; z-index:9999}
  .focus-banner{position:fixed; right:10px; bottom:10px; background:#ffffffcc; border:1px solid #e6edf5; border-radius:8px; padding:6px 10px; color:#425468; font-size:12px}
  .toast{position:fixed; top:12px; left:50%; transform:translateX(-50%); padding:8px 12px; background:#0ea5e9; color:#fff; border-radius:8px; box-shadow:0 6px 18px rgba(10,30,60,.2); opacity:0; transition:opacity .25s ease}
  .toast.show{opacity:1}


  /* Inline SVG icons (embedded) */
  .svg-icon{display:inline-flex;align-items:center;justify-content:center;line-height:0}
  .svg-icon svg{width:24px;height:24px;display:block}
  .tips-btn .svg-icon svg{width:18px;height:18px}
  .legend-icon.svg-icon svg{width:18px;height:18px}
