
/* MANTRA PAFUN UI 2.0 — responsive shell; reader colors are independent. */
html{background:#171412;scroll-padding-bottom:100px}html[data-pafun-theme=forest]{background:#f7f4ec}html[data-pafun-theme=midnight]{background:#121b2a}html[data-pafun-theme=sand]{background:#f6eee2}
#mantra-studio.app-shell{--paper:#171412;--panel:#251e19;--ink:#f5ebdd;--soft:#c6b6a5;--line:#554334;--sage:#35271f;--active:#e0ae78;--accent-ink:#201710;--reader:#fff;--reader-line:#ddd8d0;--reader-ink:#24221f;--reader-soft:#625c52;--reader-accent:#79512c;min-height:100dvh;border-radius:0;color-scheme:dark;font-family:'Noto Sans Thai',system-ui,sans-serif;padding-bottom:96px;overflow:clip}
#mantra-studio.app-shell[data-theme=forest]{--paper:#f7f4ec;--panel:#fffdf8;--ink:#153c34;--soft:#596b60;--line:#d7ded2;--sage:#e5ede2;--active:#24584a;--accent-ink:#fff;color-scheme:light}
#mantra-studio.app-shell[data-theme=midnight]{--paper:#121b2a;--panel:#1b2940;--ink:#edf2fa;--soft:#b3c1d5;--line:#42536c;--sage:#283b59;--active:#a3c8f6;--accent-ink:#122139}
#mantra-studio.app-shell[data-theme=sand]{--paper:#f6eee2;--panel:#fffaf3;--ink:#493526;--soft:#75614f;--line:#dbc6ac;--sage:#ebdbc5;--active:#805332;--accent-ink:#fff;color-scheme:light}
#mantra-studio.app-shell[data-paper=cream]{--reader:#fff9ec}
#mantra-studio.app-shell button,#mantra-studio.app-shell select{cursor:pointer;min-height:48px;border-radius:12px}
#mantra-studio.app-shell input:not([type=checkbox]):not([type=range]),#mantra-studio.app-shell textarea{font-size:16px;min-height:48px}
#mantra-studio.app-shell button:focus-visible,#mantra-studio.app-shell input:focus-visible,#mantra-studio.app-shell select:focus-visible,#mantra-studio.app-shell summary:focus-visible{outline:3px solid var(--active);outline-offset:3px}
#mantra-studio.app-shell button:disabled{cursor:default}
#mantra-studio.app-shell h1{font-size:clamp(28px,4vw,40px)!important}
#mantra-studio.app-shell h2{font-size:23px}#mantra-studio.app-shell p{color:var(--soft)}
#mantra-studio.app-shell svg{width:24px;height:24px;flex-shrink:0}
#mantra-studio.app-shell>header{padding:18px 22px!important;gap:12px;flex-wrap:nowrap!important;min-height:80px}
#mantra-studio.app-shell .brand{margin:0 auto 0 0;flex-basis:auto;gap:10px}
#mantra-studio.app-shell .brand strong{font-size:clamp(16px,2.8vw,24px);letter-spacing:.06em}
#mantra-studio.app-shell .brand .om{display:flex;color:var(--active)}#mantra-studio.app-shell .brand .om svg{width:32px;height:32px}
#mantra-studio.app-shell .header-tools{display:flex;gap:8px}
#mantra-studio.app-shell .quick-tuner{display:flex;align-items:center;gap:8px;color:var(--active);background:var(--sage)}
#mantra-studio.app-shell>.study-nav,#mantra-studio.app-shell>.favorites-page{display:none!important}
#mantra-studio.app-shell>.layout,#mantra-studio.app-shell>.study-page,#mantra-studio.app-shell>.songbook-page,#mantra-studio.app-shell>.reader-tools,#mantra-studio.app-shell>.reader-back,#mantra-studio.app-shell>.app-library,#mantra-studio.app-shell>.app-practice,#mantra-studio.app-shell>.app-account{display:none!important}
#mantra-studio.app-shell[data-view=mantra]>.app-library,#mantra-studio.app-shell[data-view=music]>.app-library,#mantra-studio.app-shell[data-view=practice]>.app-practice,#mantra-studio.app-shell[data-view=account]>.app-account,#mantra-studio.app-shell[data-view=mantra-reader]>.layout,#mantra-studio.app-shell[data-view=music-reader]>.songbook-page,#mantra-studio.app-shell[data-view=lesson]>.study-page{display:block!important}
#mantra-studio.app-shell[data-view=mantra-reader]>.reader-tools{display:flex!important}
#mantra-studio.app-shell[data-view$="-reader"]>.reader-back,#mantra-studio.app-shell[data-view=lesson]>.reader-back{display:flex!important}
#mantra-studio.app-shell.member-locked>.app-nav,#mantra-studio.app-shell.member-locked>.app-library,#mantra-studio.app-shell.member-locked>.app-practice,#mantra-studio.app-shell.member-locked>.app-account,#mantra-studio.app-shell.member-locked>.reader-tools,#mantra-studio.app-shell.member-locked>.reader-back,#mantra-studio.app-shell.member-locked>.layout,#mantra-studio.app-shell.member-locked>.study-page,#mantra-studio.app-shell.member-locked>.songbook-page{display:none!important}
#mantra-studio.app-shell .app-nav{position:fixed;z-index:40;bottom:0;left:0;right:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:var(--panel);border-top:1px solid var(--line);padding:7px 4px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -6px 24px #0002}
#mantra-studio.app-shell .nav-brand,#mantra-studio.app-shell .nav-foot,#mantra-studio.app-shell .nav-long{display:none}
#mantra-studio.app-shell .nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;border-radius:10px;padding:9px 2px;font-size:11px;line-height:1.25;min-width:0;min-height:60px;background:none;color:var(--soft)}
#mantra-studio.app-shell .nav-item.selected{color:var(--active);background:var(--sage)}
#mantra-studio.app-shell .nav-item[data-destination=tuner]{color:var(--active)}
#mantra-studio.app-shell .app-library,#mantra-studio.app-shell .app-practice,#mantra-studio.app-shell .app-account{padding:28px 22px;max-width:1180px;margin:auto}
#mantra-studio.app-shell .page-eyebrow{font-size:10px;letter-spacing:.18em;color:var(--active);margin-bottom:12px}
#mantra-studio.app-shell .page-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}
#mantra-studio.app-shell .page-heading p{margin:0 0 22px}
#mantra-studio.app-shell .library-total{font-size:12px;white-space:nowrap;color:var(--soft)}
#mantra-studio.app-shell .library-search{display:flex;align-items:center;gap:12px;background:var(--panel);border:1px solid var(--line);padding:2px 16px;border-radius:16px;color:var(--soft)}
#mantra-studio.app-shell .library-search input{background:none;color:var(--ink);border:0;width:100%;min-width:0;padding:10px 0}
#mantra-studio.app-shell .library-filters{display:flex;gap:8px;margin:16px 0}
#mantra-studio.app-shell .filter-pill{flex:1;max-width:180px;border-radius:24px;font-size:13px}
#mantra-studio.app-shell .filter-pill[aria-pressed=true],#mantra-studio.app-shell .paper-choice[aria-pressed=true]{background:var(--active);color:var(--accent-ink);border-color:var(--active)}
#mantra-studio.app-shell .library-categories{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}
#mantra-studio.app-shell .category-card{display:flex;flex-direction:column;align-items:flex-start;gap:7px;text-align:left;min-height:130px;padding:20px;background:linear-gradient(140deg,var(--sage),var(--panel));border-radius:18px;position:relative;overflow:hidden}
#mantra-studio.app-shell .category-card svg{color:var(--active);width:32px;height:32px}
#mantra-studio.app-shell .category-card small{font-size:12px}
#mantra-studio.app-shell .category-card[aria-pressed=true]{outline:2px solid var(--active)}
#mantra-studio.app-shell .library-list{display:grid;gap:10px}
#mantra-studio.app-shell .song-row{display:flex;gap:3px;border:1px solid var(--line);border-radius:15px;align-items:center;background:var(--panel);padding:3px 6px 3px 3px;min-width:0}
#mantra-studio.app-shell .song-open{display:flex;align-items:center;gap:14px;text-align:left;border:0;background:none;flex:1;min-width:0;padding:10px}
#mantra-studio.app-shell .song-thumb{width:48px;height:52px;display:grid;place-items:center;border-radius:11px;color:var(--active);background:var(--sage);flex-shrink:0}
#mantra-studio.app-shell .song-text{display:flex;flex-direction:column;min-width:0;gap:3px}
#mantra-studio.app-shell .song-text strong{font-weight:500;font-size:16px;overflow-wrap:anywhere}
#mantra-studio.app-shell .song-text small{font-size:12px}
#mantra-studio.app-shell .song-arrow{margin-left:auto;font-size:24px;color:var(--soft)}
#mantra-studio.app-shell .song-star{border:0;background:none;color:var(--soft);padding:10px;flex-shrink:0}
#mantra-studio.app-shell .song-star.saved{color:var(--active)}#mantra-studio.app-shell .song-star.saved svg{fill:var(--active)}
#mantra-studio.app-shell .library-empty{padding:25px;text-align:center}
#mantra-studio.app-shell .library-add{margin-top:14px;color:var(--active);border-style:dashed}
#mantra-studio.app-shell .instrument-grid{display:grid;gap:16px;margin:24px 0}
#mantra-studio.app-shell .instrument-card{min-height:142px;display:flex;text-align:left;align-items:center;justify-content:space-between;padding:18px 22px;background:linear-gradient(110deg,var(--panel),var(--sage));border:1px solid var(--line);border-radius:18px;overflow:hidden}
#mantra-studio.app-shell .instrument-card>span{display:flex;flex-direction:column;gap:6px;max-width:66%}
#mantra-studio.app-shell .instrument-card strong{font:600 27px Georgia,serif}
#mantra-studio.app-shell .instrument-card small{font-size:12px}
#mantra-studio.app-shell .instrument-card svg{width:125px;height:115px;color:var(--active);margin-right:-8px}
#mantra-studio.app-shell .card-arrow{color:var(--active);font-size:23px}
#mantra-studio.app-shell .theory-links{display:flex;gap:10px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px}
#mantra-studio.app-shell .theory-links>div{flex:1;min-width:180px}
#mantra-studio.app-shell .theory-links h2,#mantra-studio.app-shell .theory-links p{margin:5px 0}
#mantra-studio.app-shell .settings-card{padding:22px;background:var(--panel);border:1px solid var(--line);border-radius:18px;margin-top:20px}
#mantra-studio.app-shell .settings-card h2{margin:0 0 8px}
#mantra-studio.app-shell .member-account{display:flex;flex-wrap:wrap;gap:12px;margin:10px 0}
#mantra-studio.app-shell .member-account>span{flex-basis:100%;overflow-wrap:anywhere}
#mantra-studio.app-shell .theme-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#mantra-studio.app-shell .theme-choice{padding:12px;text-align:left;display:flex;flex-direction:column;gap:6px}
#mantra-studio.app-shell .theme-choice strong{font-size:13px}
#mantra-studio.app-shell .theme-choice small{font-size:12px}
#mantra-studio.app-shell .theme-choice[aria-pressed=true]{outline:2px solid var(--active);outline-offset:1px}
#mantra-studio.app-shell .theme-swatch{display:block;width:100%;height:32px;border-radius:7px;border:1px solid #8886;background:linear-gradient(110deg,#181412 50%,#95633c 50%)}
#mantra-studio.app-shell .theme-swatch.forest{background:linear-gradient(110deg,#f5f2e8 50%,#24584a 50%)}
#mantra-studio.app-shell .theme-swatch.midnight{background:linear-gradient(110deg,#121b2a 50%,#689ddf 50%)}
#mantra-studio.app-shell .theme-swatch.sand{background:linear-gradient(110deg,#f6eee2 50%,#b2875e 50%)}
#mantra-studio.app-shell .theme-swatch.system{background:linear-gradient(110deg,#eee 50%,#222 50%)}
#mantra-studio.app-shell .paper-options{display:flex;gap:10px;flex-wrap:wrap}
#mantra-studio.app-shell .version-label{font-size:12px;margin-top:24px}
#mantra-studio.app-shell .reader-back{align-items:center;gap:8px;margin:18px 22px 8px;border:0;background:none;color:var(--active)}
#mantra-studio.app-shell .reader-tools{gap:8px;align-items:center;flex-wrap:wrap;padding:8px 22px}
#mantra-studio.app-shell .reader-tools #song-select{max-width:100%;flex:1;min-width:150px}
#mantra-studio.app-shell .reader-tools #song-category{width:160px}
#mantra-studio.app-shell>.layout>aside{display:none!important}
#mantra-studio.app-shell>.layout>main,#mantra-studio.app-shell>.study-page,#mantra-studio.app-shell>.songbook-page{padding:18px 22px!important;max-width:1300px;margin:auto}
#mantra-studio.app-shell .score,#mantra-studio.app-shell .sb-sheet,#mantra-studio.app-shell #study-score,#mantra-studio.app-shell .fit-reader-paper{--paper:var(--reader);--panel:var(--reader);--ink:var(--reader-ink);--soft:var(--reader-soft);--line:var(--reader-line);--sage:#eee6d9;--active:var(--reader-accent);--vedic-low:#a52c6a;--vedic-mid:#24221f;--vedic-high:#b13a1d;background:var(--reader)!important;color:var(--reader-ink)!important;color-scheme:light;border-radius:14px!important;padding:20px!important;border:1px solid var(--reader-line)}
#mantra-studio.app-shell .score .lyric,#mantra-studio.app-shell .score .western,#mantra-studio.app-shell .sb-lyrics,#mantra-studio.app-shell .sb-sheet h2{color:var(--reader-ink)}
#mantra-studio.app-shell .score .sargam,#mantra-studio.app-shell #study-score .study-sequence button{color:#a52e28}
#mantra-studio.app-shell .sb-segment>button{color:var(--reader-accent)}
#mantra-studio.app-shell #study-score .taal-group button{color:var(--reader-ink)}
#mantra-studio.app-shell .sb-sheet .sb-sub{color:var(--reader-soft)}
#mantra-studio.app-shell .score .chord-token{color:var(--reader-accent)}
#mantra-studio.app-shell .sb-title{gap:12px}
#mantra-studio.app-shell #sb-edit{background:var(--active);color:var(--accent-ink);border-color:var(--active);font-weight:600}
#mantra-studio.app-shell .sb-editor{width:min(760px,96vw);max-height:90dvh;padding:22px}
#mantra-studio.app-shell .sb-editor textarea[name=body]{min-height:260px;font-size:17px;line-height:1.85;background:var(--reader);color:var(--reader-ink);border-radius:12px}
#mantra-studio.app-shell .chord-insert-bar{display:flex;gap:8px;flex-wrap:wrap;background:var(--sage);border:1px solid var(--line);border-radius:12px;padding:12px;margin:10px 0}
#mantra-studio.app-shell .chord-insert-bar label{flex:1;min-width:100px;display:grid;gap:4px;font-size:12px}
#mantra-studio.app-shell .chord-insert-bar button{align-self:end}
#mantra-studio.app-shell .chord-live-preview{background:var(--reader);color:var(--reader-ink);padding:16px;border-radius:12px;max-height:240px;overflow:auto;font-size:17px;white-space:pre-wrap;line-height:2.3}
#mantra-studio.app-shell .chord-live-preview b{color:var(--reader-accent);font-weight:700;background:#f3e9db;padding:1px 4px;border-radius:4px}
#mantra-studio.app-shell .quick-tuner-dialog{position:fixed;inset:16px 16px 16px auto;margin:0;width:min(480px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 32px);overflow:auto;border:1px solid var(--line);border-radius:20px;padding:0;background:var(--panel);color:var(--ink)}
#mantra-studio.app-shell .quick-tuner-dialog::backdrop{background:#0005}
#mantra-studio.app-shell .quick-tuner-bar{position:sticky;top:0;display:flex;justify-content:space-between;align-items:center;padding:12px 18px;background:var(--panel);border-bottom:1px solid var(--line);z-index:2}
#mantra-studio.app-shell .quick-tuner-bar strong{font:26px Georgia,serif}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-page{padding:18px;color:var(--ink)}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-head h1,#mantra-studio.app-shell .quick-tuner-dialog .tuner-head .tuner-sub{display:none}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-layout{display:flex!important;flex-direction:column}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-layout>div:last-child{order:0}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-meter{position:static;background:var(--sage);border-color:var(--line);padding:18px}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-page input,#mantra-studio.app-shell .quick-tuner-dialog .tuner-page select,#mantra-studio.app-shell .quick-tuner-dialog .tuner-page button{background:var(--panel);border-color:var(--line);color:var(--ink)}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-page .primary{background:var(--active);color:var(--accent-ink)}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-note,#mantra-studio.app-shell .quick-tuner-dialog .tuner-sub,#mantra-studio.app-shell .quick-tuner-dialog .string small{color:var(--soft)}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-page .string[aria-pressed=true]{background:var(--sage);border:2px solid var(--active)}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-strings{grid-template-columns:repeat(3,minmax(0,1fr))!important}
#mantra-studio.app-shell .quick-tuner-dialog .tuner-target{color:var(--ink)}
#mantra-studio.app-shell .quick-tuner-dialog a{color:var(--active)}
#pafun-install-bar{bottom:90px!important}
@media(min-width:760px){#mantra-studio.app-shell .instrument-grid{grid-template-columns:1fr 1fr}#mantra-studio.app-shell .theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}#mantra-studio.app-shell .library-list{grid-template-columns:1fr 1fr}#mantra-studio.app-shell .library-add,#mantra-studio.app-shell .library-empty{grid-column:1/-1}}
@media(min-width:1000px){
 #mantra-studio.app-shell{padding-left:236px;padding-bottom:30px}
 #mantra-studio.app-shell.member-locked{padding-left:0}
 #mantra-studio.app-shell .app-nav{top:0;bottom:0;right:auto;width:236px;display:flex;flex-direction:column;padding:32px 16px;border-top:0;border-right:1px solid var(--line);box-shadow:none}
 #mantra-studio.app-shell .nav-brand{display:flex;flex-direction:column;align-items:center;gap:12px;margin:12px 0 38px}
 #mantra-studio.app-shell .nav-brand svg{width:46px;height:46px;color:var(--active)}
 #mantra-studio.app-shell .nav-brand strong{font:22px Georgia,serif;letter-spacing:.05em}
 #mantra-studio.app-shell .nav-brand small{font-size:10px}
 #mantra-studio.app-shell .nav-item{flex-direction:row;justify-content:flex-start;text-align:left;padding:14px 12px;gap:12px;min-height:60px;font-size:14px;margin-bottom:7px}
 #mantra-studio.app-shell .nav-long{display:inline}#mantra-studio.app-shell .nav-short{display:none}
 #mantra-studio.app-shell .nav-foot{display:block;margin-top:auto;padding:14px 8px;font-size:10px}
 #mantra-studio.app-shell .app-library,#mantra-studio.app-shell .app-practice,#mantra-studio.app-shell .app-account{padding:36px}
 #mantra-studio.app-shell .theme-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:420px){#mantra-studio.app-shell>header{padding:14px!important}#mantra-studio.app-shell .quick-tuner span{display:none}#mantra-studio.app-shell .app-library,#mantra-studio.app-shell .app-practice,#mantra-studio.app-shell .app-account{padding:22px 14px}#mantra-studio.app-shell .instrument-card{padding:15px;min-height:130px}#mantra-studio.app-shell .instrument-card svg{width:100px}#mantra-studio.app-shell .song-thumb{width:38px;height:44px}#mantra-studio.app-shell .song-open{gap:9px}#mantra-studio.app-shell .song-text strong{font-size:14px}#mantra-studio.app-shell .score{padding:12px!important}#mantra-studio.app-shell .library-total{display:none}}
@media(prefers-reduced-motion:reduce){#mantra-studio.app-shell *{scroll-behavior:auto!important;transition:none!important}}

#mantra-studio.app-shell .chord-move-bar{position:sticky;top:0;z-index:2;display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:12px;background:var(--sage);border:1px solid var(--active);border-radius:12px;margin:12px 0}
#mantra-studio.app-shell .chord-move-bar[hidden]{display:none!important}
#mantra-studio.app-shell .chord-move-bar small{flex-basis:100%;font-size:12px}
#mantra-studio.app-shell .chord-live-preview .preview-chord{display:inline-block;min-height:44px;min-width:44px;vertical-align:baseline;background:#eee2d0;color:#6c431f;border:1px solid #cab79b;padding:5px 8px;margin:3px 2px;font-size:16px;font-weight:700}
#mantra-studio.app-shell .chord-live-preview .preview-chord[aria-pressed=true]{background:#6c431f;color:white;outline:2px solid #6c431f;outline-offset:2px}
#mantra-studio.app-shell .chord-live-preview .preview-chord:focus-visible{outline:3px solid #6c431f}
#mantra-studio.app-shell .chord-position-status{font-size:13px;min-height:24px}

#mantra-studio.app-shell[data-view=favorites]>.favorites-page{display:block!important;padding:22px}
#mantra-studio.app-shell[data-view=favorites]>.reader-back{display:flex!important}
#mantra-studio.app-shell.member-locked>.favorites-page{display:none!important}
#mantra-studio.app-shell[data-view=lesson]>.reader-tools{display:flex!important}