/* Solfège Facile V10.5 — maximal polish / responsive pass */
:root{--sf-safe-t:env(safe-area-inset-top,0px);--sf-safe-r:env(safe-area-inset-right,0px);--sf-safe-b:env(safe-area-inset-bottom,0px);--sf-safe-l:env(safe-area-inset-left,0px);--sf-tap:44px;--sf-radius:14px;--sf-glass:rgba(20,14,19,.88)}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%}body{min-height:100dvh}button,a,select,input,textarea{touch-action:manipulation}button,.primary-btn,.secondary-btn,[role=button]{-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #f0c96b!important;outline-offset:3px!important}
/* Premium surfaces: preserve the existing burgundy/gold identity, remove the boxed/cheap feel. */
.card,.module,.sf81-card,.studio-panel,.studio-tool-panel,.studio-properties,.studio-score-row{box-shadow:0 14px 38px rgba(0,0,0,.16);border-color:rgba(226,190,103,.18)!important}.module:hover,.studio-score-row:hover{border-color:rgba(226,190,103,.42)!important}
.primary-btn{box-shadow:0 7px 20px rgba(122,77,26,.22);font-weight:800}.secondary-btn{backdrop-filter:blur(8px)}
/* Let the score own the screen. */
.studio-stage{isolation:isolate;box-shadow:0 22px 60px rgba(0,0,0,.25)!important}.studio-stage svg{max-width:100%;height:auto}.studio-verovio-toolbar{position:sticky;top:0;z-index:45;background:linear-gradient(180deg,rgba(20,14,18,.97),rgba(20,14,18,.90));backdrop-filter:blur(14px);border-radius:12px}
#studio-verovio-view{overscroll-behavior:contain;-webkit-overflow-scrolling:touch}.studio-toolbar button,.studio-main-tabs button,.studio-subtabs button,.studio-category-rail button{transition:transform .12s ease,border-color .12s ease,background .12s ease}.studio-toolbar button:active,.studio-main-tabs button:active,.studio-subtabs button:active{transform:scale(.97)}
/* Piano chooser */
.sfv10-piano-profile{border:1px solid rgba(226,190,103,.22)!important;border-radius:12px!important;background:rgba(255,255,255,.035)!important;padding:6px!important}.sfv10-piano-profile select{appearance:none;background:#171117!important;border:1px solid rgba(226,190,103,.2)!important;border-radius:9px!important;color:inherit!important;padding:8px 30px 8px 10px!important}
.sfv10-profile-grid button{min-height:112px;text-align:left!important;transition:transform .15s ease,border-color .15s ease,background .15s ease}.sfv10-profile-grid button:hover{transform:translateY(-2px)}.sfv10-profile-grid button.active{box-shadow:inset 0 0 0 1px rgba(240,201,107,.55),0 12px 30px rgba(0,0,0,.2)}
/* Forms and modals */
.sfv7-modal,.sf81-modal,.sfbeta-modal,.sfv10-audio-modal{overscroll-behavior:contain;scrollbar-gutter:stable}.sfv7-modal input,.sfv7-modal select,.sfv7-modal textarea,.sf81-modal input,.sf81-modal select,.sf81-modal textarea{font-size:16px}
/* Tablet: true two-pane editor where space allows. */
@media (min-width:761px) and (max-width:1180px){.studio-editor{padding-inline:clamp(10px,2vw,22px)!important}.studio-editor-head{gap:8px!important}.studio-tool-layout{grid-template-columns:minmax(0,1fr)!important}.studio-stage{min-height:58dvh}.sf81-modal,.sfv7-modal{width:min(96vw,1040px)!important}.sf81-library{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
/* Phone: content-first, thumb-friendly, no desktop squeezed into 390px. */
@media (max-width:760px){
 body{padding-left:var(--sf-safe-l);padding-right:var(--sf-safe-r);padding-bottom:max(12px,var(--sf-safe-b))!important}
 main,.container,.page-shell,.studio-editor,.sf-learning-hub{max-width:100%!important;padding-left:10px!important;padding-right:10px!important}
 h1{font-size:clamp(30px,9vw,46px)!important;line-height:1.02!important}h2{font-size:clamp(24px,7vw,34px)!important;line-height:1.08!important}
 .studio-editor-head{position:relative!important;display:grid!important;grid-template-columns:1fr auto!important;gap:7px!important;align-items:center!important}
 .studio-editor-head>h1,.studio-editor-head>h2,.studio-editor-head>.studio-title{grid-column:1/-1!important}
 .studio-editor-head>button,.studio-editor-head>.sfv10-piano-profile{min-height:var(--sf-tap)!important}
 .studio-toolbar,.studio-voice-bar,.studio-context-bar,.studio-instrument-bar,.studio-main-tabs,.studio-subtabs,.studio-properties{scroll-snap-type:x proximity;padding-bottom:4px!important}
 .studio-toolbar button,.studio-voice-bar button,.studio-context-bar button,.studio-instrument-bar button,.studio-main-tabs button,.studio-subtabs button,.studio-properties button{min-width:var(--sf-tap)!important;min-height:var(--sf-tap)!important;scroll-snap-align:start}
 .studio-stage{margin-inline:-4px!important;border-radius:10px!important;min-height:52dvh!important}
 #studio-verovio-view{min-height:52dvh!important;background:#fffdf7!important;border-radius:8px!important}
 .sfv103-touch-entry{position:relative!important;margin:8px -2px!important;padding:9px!important}.sfv103-mini-staff{height:132px!important}
 .sfv103-touch-staff-switch{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%}.sfv103-touch-staff-switch button{min-height:var(--sf-tap)!important}
 .module{border-radius:16px!important;margin-bottom:10px!important}.module-head{display:grid!important;grid-template-columns:1fr!important}.lr-meta>*{font-size:11px!important}
 .sf81-modal,.sfv7-modal,.sfbeta-modal,.sfv10-audio-modal{width:100%!important;max-width:none!important;max-height:calc(100dvh - var(--sf-safe-t) - var(--sf-safe-b) - 12px)!important;border-radius:18px!important;padding:14px!important}
 .sfv7-modal-backdrop,.sf81-bg,.sfbeta-modal-bg,.sfv10-audio-bg{padding:max(6px,var(--sf-safe-t)) 6px max(6px,var(--sf-safe-b))!important;align-items:end!important}
 .sfv10-profile-grid{grid-template-columns:1fr!important}.sfv10-profile-grid button{min-height:88px!important}
 .sfv7-toast{left:10px!important;right:10px!important;bottom:max(10px,var(--sf-safe-b))!important;max-width:none!important}
 .sf81-dock{left:10px!important;right:10px!important;bottom:max(8px,var(--sf-safe-b))!important;transform:none!important;width:auto!important;justify-content:center!important}
 .sf81-dock.sfv103-open{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}.sf81-dock.sfv103-open button{min-width:0!important}
}
@media (max-width:420px){.studio-editor-head{grid-template-columns:1fr!important}.studio-editor-head>*{width:100%!important}.sfv10-piano-profile{grid-column:1!important}.sfv10-piano-profile span{display:none}.studio-toolbar{gap:5px!important}.module{padding:14px!important}.sfv103-touch-head small{max-width:none!important}}
@media (orientation:landscape) and (max-height:520px) and (pointer:coarse){.studio-editor-head{display:none!important}.sfv103-touch-entry{display:none!important}.studio-stage,#studio-verovio-view{min-height:76dvh!important}.studio-verovio-toolbar{top:0!important}}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}}


/* V11 corrective: global navigation is a drawer on every viewport. */
.sf81-dock{
  left:12px!important;right:auto!important;bottom:max(10px,var(--sf-safe-b,env(safe-area-inset-bottom)))!important;
  transform:none!important;width:auto!important;max-width:calc(100vw - 24px)!important;
  display:flex!important;justify-content:flex-start!important;gap:4px!important;padding:4px!important;border-radius:999px!important;
  z-index:10020!important;
}
.sf81-dock:not(.sfv103-open)>button:not(.sfv103-dock-toggle){display:none!important}
.sf81-dock:not(.sfv103-open)>#lang-switcher{display:none!important}
.sf81-dock.sfv103-open>#lang-switcher{position:static!important;inset:auto!important;transform:none!important;z-index:auto!important;box-shadow:none!important;margin:3px!important;align-self:center!important}
.sf81-dock .sfv103-dock-toggle{display:block!important;min-width:46px!important;width:46px!important;height:46px!important;padding:4px!important;border-radius:999px!important;font-size:17px!important}
.sf81-dock .sfv103-dock-toggle span{display:block!important;font-size:7px!important;margin-top:1px!important}
.sf81-dock.sfv103-open{
  left:50%!important;right:auto!important;transform:translateX(-50%)!important;width:auto!important;
  border-radius:16px!important;display:flex!important;justify-content:center!important;overflow-x:auto!important;
}
.sf81-dock.sfv103-open>button{display:block!important;min-width:66px!important}
.sf81-dock.sfv103-open .sfv103-dock-toggle{display:block!important;order:-1!important;min-width:46px!important}
.sf81-dock.sfv103-context:not(.sfv103-open){opacity:.72}
body.sv2-open .sf81-dock:not(.sfv103-open){bottom:12px!important}
@media(max-width:760px){
 .sf81-dock{left:8px!important;right:auto!important;width:auto!important;display:flex!important;justify-content:flex-start!important}
 .sf81-dock.sfv103-open{left:6px!important;right:6px!important;transform:none!important;width:auto!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important}
 .sf81-dock.sfv103-open .sfv103-dock-toggle{grid-column:1/-1;width:48px!important;justify-self:start!important}
}

/* ===== V12.14n — historical windows: shared Help button, dialogs, forms ===== */
.sfl-help{position:fixed;right:max(14px,env(safe-area-inset-right,0px));bottom:max(14px,var(--sf-safe-b,0px));z-index:9980;display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.sfl-help-fab{display:inline-flex;align-items:center;gap:8px;min-height:var(--sf-tap,44px);padding:0 16px 0 10px;border:1px solid rgba(212,175,55,.55);border-radius:999px;background:rgba(22,16,24,.94);color:var(--ink);font-weight:700;box-shadow:var(--depth-2);cursor:pointer}
.sfl-help-fab>span:first-child{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--amber);color:#1a1208;font-weight:900}
.sfl-help-fab:hover{border-color:var(--amber)}
.sfl-help-menu{order:-1;display:grid;min-width:220px;padding:6px;border:1px solid var(--line-bright);border-radius:14px;background:#19131c;box-shadow:var(--depth-3)}
.sfl-help-menu[hidden]{display:none}
.sfl-help-menu button{display:flex;align-items:center;gap:10px;min-height:var(--sf-tap,44px);padding:0 12px;border:0;border-radius:10px;background:transparent;color:var(--ink);text-align:left;font:inherit;cursor:pointer}
.sfl-help-menu button:hover,.sfl-help-menu button:focus-visible{background:rgba(212,175,55,.14)}
body.sv2-open .sfl-help{display:none!important}
@media (max-width:760px){.sfl-help{right:8px;bottom:max(8px,var(--sf-safe-b,0px))}.sfl-help-fab{padding:0 12px 0 8px}.sfl-help-fab>span:last-child{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.sfl-help-fab{padding:0 8px}}
.sfl-help.sfv103-mobile-hide{display:none!important}
.sfl-form label{display:grid;gap:6px;font-weight:600}
.sfl-form input,.sfv7-form input,.sfv7-form select,.sfv7-form textarea{min-height:var(--sf-tap,44px);font-size:16px}
.sfl-hint{color:var(--ink-muted);margin-top:-6px}
.sfl-error{min-height:1.2em;margin:4px 0 0;color:#ff9a9a;font-size:14px}
.sfl-error:empty{min-height:0;margin:0}
[data-sfl-dialog]>section:focus{outline:none}
[data-sfl-dialog] :focus-visible,.sf81-dock :focus-visible,.sfv7-footer :focus-visible{outline:3px solid var(--amber);outline-offset:2px}
.sfv7-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
ol.sf81-plan{list-style:none;padding:0}
ol.sf81-plan>li{margin:0}
.sfbeta-rating{border:0;margin:0;padding:0;min-width:0}
.sfbeta-rating legend{padding:0;margin-bottom:6px;font-size:12px;font-weight:800;color:#e9dcc7}
.sfbeta-check{display:flex!important;align-items:center;gap:9px}
.sfbeta-check input{width:auto;min-height:0}
.sfbeta-stars button[aria-checked="true"]{outline:2px solid var(--amber);outline-offset:1px;border-radius:6px}
#sfv7-score-empty{padding:14px;text-align:center}
.sfv7-consent a{color:var(--amber)}
@media (prefers-reduced-motion:reduce){.sfl-help-fab{transition:none}}
.sfv7-form label,.sfl-form label{display:grid;gap:6px;font-size:13px;font-weight:700;color:#e9dcc7}
.sfv7-form select,.sfv7-form textarea,.sfv7-form input,.sfl-form input{width:100%;box-sizing:border-box;border:1px solid var(--line-bright);border-radius:9px;background:#0f0c12;color:#f8efe2;padding:10px 11px;font:inherit;font-size:16px}
.sfv7-form textarea{min-height:150px;resize:vertical}
.sfv7-form select:focus-visible,.sfv7-form textarea:focus-visible,.sfv7-form input:focus-visible,.sfbeta-form :is(select,textarea,input):focus-visible{outline:2px solid var(--amber);outline-offset:1px;border-color:var(--amber)}
.sfv7-row{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.sfv7-danger{border-color:rgba(227,103,103,.7)!important;color:#ffb3b3!important}
/* Top navigation: keep the brand on one or two lines instead of a squeezed column. */
.topnav .brand{flex:0 0 auto;min-width:max-content}
@media (min-width:761px){.topnav{flex-wrap:wrap;row-gap:10px;column-gap:18px}.topnav nav{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;min-width:0}.topnav nav>a{display:inline-flex;align-items:center;min-height:36px}}
.topnav nav>a,.topnav nav>button{white-space:nowrap}
@media (max-width:760px){.topnav{flex-wrap:wrap;row-gap:8px}.topnav .brand{min-width:0;flex:1 1 100%}.topnav nav{flex:1 1 100%;max-width:100%!important;overflow-x:auto;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent)}.topnav nav::-webkit-scrollbar{display:none}}
/* V12.14p — Studio loaded on demand */
.sf-lazy-loading{min-height:60vh;display:flex;align-items:center;justify-content:center;gap:12px;color:var(--ink-muted);font-size:16px}
.sf-lazy-spinner{width:22px;height:22px;border-radius:50%;border:3px solid rgba(212,175,55,.25);border-top-color:var(--amber);animation:sf-spin .8s linear infinite}
@keyframes sf-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.sf-lazy-spinner{animation:none}}
/* V12.14p — end of beta */
.sfbeta-after-link{background:none;border:0;padding:0;color:inherit;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer;min-height:0}
.sfbeta-banner.sfbeta-urgent{background:linear-gradient(90deg,#5a1f1f,#7a3a17)}
.sfbeta-after-list{display:grid;gap:8px;padding-left:20px;margin:12px 0 18px}
/* V12.14r — touch targets (44 px) found by browser-checks/check-a11y-browser.mjs */
@media (max-width:760px){#sfbeta-feedback-top{min-height:44px!important;min-width:44px!important;padding:0 14px!important}#sfv103-beta-close{min-width:44px!important;min-height:44px!important}.sf81-card input{min-height:44px;font-size:16px}}
