/* Open strings, with the thinnest at the top. */
.neck-caption{font-size:11px;color:#5c6470;margin:9px 0 7px;letter-spacing:.15px}.neck-caption[hidden]{display:none}
.strings.guitar-neck{position:relative;isolation:isolate;display:grid;grid-template-columns:1fr;gap:0;padding:5px 0;border-radius:12px;overflow:hidden;background:linear-gradient(90deg,#d7c9ad 0 64px,transparent 64px)}
.guitar-neck:before{content:"";position:absolute;z-index:-1;left:64px;right:0;top:0;bottom:0;border-left:10px solid #eee8d8;border-radius:0 3px 3px 0;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(25% - 3px),#939795 calc(25% - 3px),#d3d0c4 25%),linear-gradient(100deg,#253744,#142737);box-shadow:inset 0 0 12px #0004}
.guitar-neck:after{content:"";position:absolute;z-index:1;width:18px;height:18px;border-radius:50%;background:#aa9a77;left:calc(64px + (100% - 64px)*.625);top:calc(50% - 9px);box-shadow:0 1px 2px #0004}
.guitar-neck .string{position:relative;display:flex;align-items:center;gap:0;width:100%;height:44px;min-height:44px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:#26374a;text-align:left}
.guitar-neck .string-name{display:flex;align-items:baseline;justify-content:center;width:58px;flex-shrink:0;border-radius:8px;margin:0 3px;padding:5px 0}
.guitar-neck .string small{display:inline;font-size:11px;margin-right:5px;color:#66717c}.guitar-neck .string strong{font-size:20px;line-height:1}.guitar-neck .string sub{font-size:10px;margin-left:2px}
.guitar-neck .string-wire{position:relative;z-index:2;height:var(--thickness);flex:1;background:#e5dcc7;box-shadow:0 1px 2px #0008}
.guitar-neck .string-pick{width:20px;color:#ffd363;font-size:17px;text-align:center;height:100%;display:grid;place-items:center;background:#172b3a}
.guitar-neck .string[aria-pressed=true]{background:#f6c54418;box-shadow:none}.guitar-neck .string[aria-pressed=true] .string-name{background:#f6c544;color:#15283b}.guitar-neck .string[aria-pressed=true] .string-wire{background:#ffd363;box-shadow:0 0 7px #ffd36388}
.guitar-neck .string:hover .string-name{background:#f6c54466}.guitar-neck .string:focus-visible{outline:2px solid #e85d1a;outline-offset:-2px}
.string-tip.guitar-tip{display:block;font-size:12px;line-height:1.5;margin:12px 0}
@media(max-width:740px){.strings.guitar-neck{grid-template-columns:1fr}.guitar-neck .string{height:44px;min-height:44px}.neck-caption{margin:6px 0;font-size:11px}}

/* Same string guide, with instrument-specific physical details. */
.guitar-neck[data-instrument="violin"]:before{background:linear-gradient(100deg,#273744,#111f2c);border-left-width:4px}
.guitar-neck[data-instrument="violin"]:after{display:none}
.guitar-neck[data-instrument="banjo"]:before{background:repeating-linear-gradient(90deg,transparent 0,transparent calc(16.6667% - 2px),#aaa99f calc(16.6667% - 2px),#d3d0c4 16.6667%),linear-gradient(100deg,#253744,#142737)}
.guitar-neck .short-string .string-wire{margin-left:calc((100% - 84px)*.83333);position:relative}
.guitar-neck .short-string .string-wire:before{content:"";position:absolute;left:-5px;top:-4px;width:8px;height:8px;background:#ddd4bf;border:1px solid #182939;border-radius:50%}

.strings.sax-guide{display:grid;grid-template-columns:58px 1fr;grid-template-areas:"mark copy" "transpose transpose";gap:12px;padding:17px;border-radius:14px;color:white;background:radial-gradient(circle at 90% 5%,#e85d1a 0 2px,transparent 3px),linear-gradient(145deg,#152b4a,#09182f);box-shadow:inset 0 0 0 1px #ffffff18,0 8px 22px #0d1f3c20}
.sax-mark{grid-area:mark;width:58px;height:58px;display:grid;place-items:center;border-radius:50%;font-size:36px;background:#f6c544;color:#0d1f3c;box-shadow:0 0 0 5px #f6c54422}
.sax-copy{grid-area:copy;display:flex;flex-direction:column;justify-content:center}.sax-copy strong{font:600 19px var(--app-font);color:#fff}.sax-copy span{font-size:13px;color:#f6c544;font-weight:750;margin-top:2px}.sax-copy small{font-size:11px;color:#d5dce7;margin-top:4px;line-height:1.35}
.sax-transpose{grid-area:transpose;display:grid;grid-template-columns:1fr auto auto 1fr auto;align-items:center;gap:8px;border-top:1px solid #ffffff20;padding-top:12px}.sax-transpose span{font-size:9px;letter-spacing:1px;color:#aeb9c8}.sax-transpose b{font-size:23px;color:#f6c544}.sax-transpose i{font-style:normal;color:#e85d1a;font-size:21px}
.listening-mode[hidden]{display:none}
@media(max-width:740px){.strings.sax-guide{grid-template-columns:50px 1fr;padding:14px}.sax-mark{width:50px;height:50px;font-size:31px}.sax-copy strong{font-size:17px}}
.instruments{grid-template-columns:repeat(6,1fr)}
.needle{transition:left .24s cubic-bezier(.22,.75,.24,1),opacity .12s ease}
#pitch-trail{background:linear-gradient(to bottom,#d9e3d9 0%,#eaf0e7 14%,#f8faf5 30%,#f8faf5 70%,#eaf0e7 86%,#d9e3d9 100%)}
@media(max-width:740px){.instruments{grid-template-columns:repeat(3,1fr)}.instruments button{min-height:44px}}

/* Compact two-level instrument chooser. */
.instruments{display:grid;grid-template-columns:minmax(120px,.72fr) 18px minmax(190px,1.28fr);align-items:end;gap:8px;padding:10px 12px;background:#f4efe5;border-bottom:1px solid #ddd3c2}
.instruments label{display:grid;gap:4px;min-width:0}.instruments label span{font-size:10px;font-weight:800;letter-spacing:1px;text-transform:uppercase;color:#495b70}.instruments b{align-self:center;text-align:center;font:700 25px var(--app-font);color:#e85d1a}.instruments select{width:100%;min-width:0;height:40px;padding:0 30px 0 10px;border:1px solid #bfc3c5;border-radius:6px;background:#fff;color:#10243e;font:700 14px Inter,Arial,sans-serif}.instruments select:disabled{opacity:1;color:#10243e}
.more-menu{margin:16px 0;border:1px solid #142c4a;background:#fff}.more-menu>summary{cursor:pointer;padding:13px 16px;font-weight:800;color:#10243e}.more-menu-body{padding:0 14px 14px}.more-menu-body>.help{margin-top:5px}
.mic-toggle{display:flex;align-items:center;gap:10px;border:0;padding:4px 0;background:transparent;color:#0d1f3c;font-size:13px;font-weight:850;letter-spacing:0;white-space:nowrap}.mic-toggle i{position:relative;display:block;width:48px;height:27px;border-radius:999px;background:#aeb1b3;box-shadow:inset 0 0 0 1px #0000000b;transition:background .18s ease}.mic-toggle i:after{content:"";position:absolute;width:23px;height:23px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform .18s ease}.mic-toggle[aria-pressed=true] i{background:#08a955}.mic-toggle[aria-pressed=true] i:after{transform:translateX(21px)}
.more-menu>summary{list-style:none;background:#0d1f3c;color:white;border-radius:7px;text-align:center}.more-menu>summary::-webkit-details-marker{display:none}.more-menu[open]{position:fixed;z-index:1000;inset:0;margin:0;border:0;background:#f8f5ee;overflow:auto;padding:env(safe-area-inset-top) max(18px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(18px,env(safe-area-inset-left))}.more-menu[open]>summary{position:sticky;z-index:2;top:0;margin:8px 0 16px;background:#0d1f3c}.more-menu[open] .more-menu-body{max-width:760px;margin:auto}.more-menu[open] .more-menu-body>details{padding:10px 0;border-bottom:1px solid #d6d1c7;margin-bottom:4px}

@media(max-width:740px){
 html,body{min-height:100%;background:#f8f5ee}.app-shell{padding:0 8px 8px;max-width:none}header{height:43px;min-height:43px;padding:0 4px}.brand img{width:29px;height:32px}.brand{font-size:17px}.edition{display:none}.header-right #portal{font-size:11px;padding:7px 8px}.intro{display:none}
 main{display:block;padding-bottom:0}#tuner{min-height:calc(92dvh - 51px);display:flex;flex-direction:column}.instruments{grid-template-columns:minmax(96px,.72fr) 12px minmax(170px,1.28fr);gap:5px;padding:6px 5px}.instruments label{gap:2px}.instruments label span{font-size:8px}.instruments b{font-size:20px}.instruments select{height:35px;font-size:12px;padding-left:7px}
 .workspace{display:flex;flex-direction:column;gap:4px;background:transparent}.tuning-panel{order:1;padding:7px 9px 4px;border-radius:9px}aside{order:2;margin-inline:5px;padding:6px 8px 7px;border-radius:9px}.panel-top{margin-bottom:1px}.live-caption{display:none}.note-display{font-size:42px;line-height:.95;margin:0}.note-display span:last-child{font-size:18px}.target-frequency{font-size:11px;margin:1px 0}.guidance{font-size:18px;min-height:21px;margin-top:2px}.hint{font-size:11px;line-height:1.25;margin:2px auto;min-height:14px}.motion{font-size:10px;min-height:10px;margin:0}.motion:empty{display:none}.trail-heading{margin:4px 0 2px;font-size:10px}#pitch-trail{height:clamp(155px,20dvh,185px)!important;border-radius:6px}.meter{height:20px;margin-top:1px}.meter-labels{font-size:10px;margin-top:1px}.readings{margin:1px 0;font-size:11px}.readings strong{font-size:14px}.input-level{margin-top:2px}.input-level span{font-size:11px}.privacy{display:none}
 .string-heading{justify-content:center;position:relative;margin:3px 0 5px;padding-inline:8px}.string-heading h2{font-size:15px;text-align:center}.string-heading span{position:absolute;right:8px;font-size:10px}.neck-caption{display:none!important}.strings.guitar-neck{padding:3px 0;border-radius:7px;background:linear-gradient(90deg,#d7c9ad 0 56px,transparent 56px)}.guitar-neck .string{height:30px;min-height:30px}.guitar-neck .string-name{position:relative;z-index:3;width:50px;padding:2px 0}.guitar-neck .string strong{font-size:17px}.guitar-neck .string small{font-size:10px}.guitar-neck:before{left:56px;border-left-width:10px}.guitar-neck:after{width:18px;height:18px;left:calc(66px + (100% - 66px)*.625);top:calc(50% - 9px);background:#aa9a77;border:0}.string-tip.guitar-tip{display:none}.strings.sax-guide{padding:9px;gap:6px}.sax-mark{width:42px;height:42px;font-size:26px}.sax-copy small{display:none}.sax-transpose{padding-top:6px}
 .more-menu{position:fixed;z-index:50;left:0;right:0;bottom:0;height:max(44px,6dvh);margin:0;border:0;background:#0d1f3c}.more-menu>summary{display:grid;place-items:center;width:100%;height:100%;padding:0;border-radius:0;background:transparent;color:#f2eadb;text-align:center;font-size:16px;letter-spacing:.3px}.more-menu-body{padding:0 8px 28px}.more-menu[open]{height:100dvh;background:#f3eee4;padding-bottom:env(safe-area-inset-bottom)}.more-menu[open]>summary{height:48px;margin:0 0 16px;background:#0d1f3c;color:#f2eadb;border-radius:0}footer{display:none}
}
@media(max-width:740px){
 .tuning-panel[data-instrument="saxophone"] .panel-top{align-items:flex-start;gap:8px}
 .tuning-panel[data-instrument="saxophone"] #target-label{max-width:88px;text-align:left;line-height:1.15;white-space:normal}
 .tuning-panel[data-instrument="saxophone"] .mic-toggle{flex:0 0 auto}
}

/* The app footer and secondary screen are the same at every width. */
body{padding-bottom:max(44px,6dvh)}
.more-menu:not([open]){position:fixed;z-index:50;left:0;right:0;bottom:0;height:max(44px,6dvh);margin:0;border:0;background:#0d1f3c}
.more-menu:not([open])>summary{display:grid;place-items:center;width:100%;height:100%;padding:0;border-radius:0;background:transparent;color:#f2eadb;text-align:center;font-size:18px;letter-spacing:.3px}
footer{display:none}

/* Wide screens: one full-width target, then instrument and trail side by side. */
@media(min-width:741px){
 .workspace{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(420px,1.35fr);grid-template-rows:auto auto auto auto auto auto auto auto auto auto auto auto auto;background:#fff}
 .tuning-panel{display:contents;text-align:center;--signal:#182b35}
 .panel-top{grid-column:1/-1;grid-row:1;padding:20px 28px 0}
 .live-caption{grid-column:1/-1;grid-row:2;margin-top:6px}
 .note-display{grid-column:1/-1;grid-row:3;margin-top:2px}
 .target-frequency{grid-column:1/-1;grid-row:4;margin:3px 0 8px}
 .guidance{grid-column:1/-1;grid-row:5}
 .hint{grid-column:1/-1;grid-row:6;margin:6px auto 8px}
 .motion{grid-column:1/-1;grid-row:7;width:100%;min-height:15px;margin:0;padding:0 28px 14px;border-bottom:2px solid #d8dde0}
 aside{grid-column:1;grid-row:8/15;border-right:2px solid #d8dde0;border-top:0;padding:0 24px 18px}
 aside .string-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;height:auto;min-height:22px;margin:18px 0 8px;align-items:start}
 aside .string-heading h2{line-height:1.15}
 aside .string-heading span{white-space:nowrap}
 aside #neck-top{display:none}
 .trail-heading{grid-column:2;grid-row:8;align-self:end;margin:18px 28px 8px}
 #pitch-trail{grid-column:2;grid-row:9;width:calc(100% - 56px);height:264px;margin:0 28px}
 .meter{grid-column:2;grid-row:10;margin-inline:28px}
 .meter-labels{grid-column:2;grid-row:11;margin:7px 28px 0}
 .readings{grid-column:2;grid-row:12;margin:0 28px;padding:10px 0}
 .error{grid-column:2;grid-row:13;margin-inline:28px}
 .input-level{grid-column:2;grid-row:14;margin:7px 28px 0}
 .privacy{grid-column:2;grid-row:15;margin-bottom:12px}
}
@media(min-width:741px) and (max-width:900px){
 aside .string-heading h2{font-size:14px;letter-spacing:-.15px}
}

.more-copyright{margin:28px 0 10px;padding-top:18px;border-top:1px solid #d6d1c7;text-align:center;color:#53645b;font-size:12px;letter-spacing:.2px}
.more-overview{margin:4px 0 14px;padding:18px;border-left:5px solid #e85d1a;border-radius:9px;background:#0d1f3c;color:#fff}.more-overview p{margin:0;color:#ff7a3d;font-size:9px;font-weight:900;letter-spacing:1.3px}.more-overview h2{margin:4px 0 6px;font:700 25px/1.05 var(--app-font)}.more-overview span{display:block;color:#dbe2e7;font-size:13px;line-height:1.45}.more-card{margin:7px 0;border:1px solid #d6d1c7;border-radius:8px;background:#fff;overflow:hidden}.more-card>summary{padding:11px 13px;list-style:none;color:#0d1f3c;font-weight:900;cursor:pointer}.more-card>summary::-webkit-details-marker{display:none}.more-card>summary:before{content:'+';display:inline-grid;place-items:center;width:20px;height:20px;margin-right:9px;border-radius:50%;background:#0d1f3c;color:#fff}.more-card[open]>summary:before{content:'−'}.more-card>div{padding:0 14px 13px;color:#40535d;font-size:13px;line-height:1.48}.more-card>div>p{margin:8px 0}.more-card .tune-reminder{margin:4px 0 10px}.more-card .help{margin:8px 0}.more-card>div>details{margin:0;padding:9px 0;border-top:1px solid #e0d9cd}
.tune-reminder{margin:4px 0 14px;padding:13px 15px;border-left:4px solid #f6c544;background:#fff8df;color:#24364a;font-size:14px;line-height:1.45}.tune-reminder strong{display:block;color:#0d1f3c}
.pitch-expectation{margin:5px 0 2px;text-align:center;color:#53645b;font-size:11px;line-height:1.3}
.app-version{display:none}.more-menu[open] .app-version{display:block;position:fixed;z-index:3;left:0;right:0;bottom:max(8px,env(safe-area-inset-bottom));margin:0;text-align:center;color:#7a857f;font-size:10px;letter-spacing:.35px;pointer-events:none}
.status-strip{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;border-top:1px solid #e5e2d9;border-bottom:1px solid #e5e2d9}.status-strip .readings,.status-strip .input-level{grid-column:auto;grid-row:auto;margin:0;border:0;min-width:0}.status-strip .input-level{white-space:nowrap}
@media(max-width:740px){
 .status-strip{grid-template-columns:1fr;gap:2px;min-height:53px;margin:3px 0;padding:5px 4px}.status-strip .readings{justify-content:space-around;padding:0;gap:12px;font-size:11px}.status-strip .readings strong{font-size:15px}.status-strip .input-level{justify-content:center;gap:8px;font-size:11px}.status-strip .input-level meter{width:92px}
 .pitch-expectation{margin:3px auto 1px;max-width:390px;font-size:10px}
}
@media(min-width:741px){
 .status-strip{grid-column:2;grid-row:12;margin:0 28px;padding:7px 0}.status-strip .readings{padding:0;gap:16px}.status-strip .input-level{font-size:11px}
}

/* Keep the complete tuner above the fixed footer on shorter phone screens. */
@media(max-width:740px) and (max-height:850px){
 header{height:39px;min-height:39px}.brand img{width:27px;height:30px}
 .instruments{padding-block:4px}.instruments select{height:32px}
 .tuning-panel{padding-top:4px}.note-display #target-note{font-size:58px}.target-frequency{margin-block:0}.hint{margin-block:1px}
 #pitch-trail{height:140px!important}.status-strip{min-height:46px;padding-block:3px;margin-block:2px}
 aside{padding-block:4px}.string-heading{margin-block:1px 3px}.guitar-neck .string{height:27px;min-height:27px}
}

/* Three deliberate layouts: phone <=740, tablet 741-1099, desktop >=1100. */
@media(min-width:741px) and (max-width:1099px){
 aside .string-heading{grid-template-columns:minmax(0,1fr) auto;min-height:34px;align-items:center}
 aside .string-heading h2{font-size:14px;line-height:1.1;white-space:nowrap}
}

/* Wide desktop: keep the complete working surface above the fixed tool bar. */
@media(min-width:1100px) and (min-height:620px){
 html,body{height:100%;overflow:hidden}
 .app-shell{height:calc(100dvh - max(58px,7dvh));max-width:1240px;padding:0 24px;overflow:hidden}
 header{height:70px;min-height:70px}
 .brand img{width:37px;height:41px}.brand{font-size:23px}
 main{height:calc(100% - 70px);overflow:hidden}
 .intro{display:none}
 #tuner{display:flex;flex-direction:column;height:100%;min-height:0}
 .instruments{flex:0 0 57px;padding:7px 12px;border-radius:12px 12px 0 0}
 .instruments select{height:35px}
 .workspace{flex:1;min-height:0;grid-template-columns:minmax(300px,.82fr) minmax(500px,1.45fr);grid-template-rows:36px 18px 66px 19px 31px 24px 7px 31px minmax(135px,1fr) 19px 24px 43px 0 27px 18px;border-radius:0 0 14px 14px}
 .panel-top{padding:8px 22px 0}
 .live-caption{margin:1px 0 0}
 .note-display{margin:0;line-height:.9}.note-display #target-note{font-size:70px}.note-display #target-octave{font-size:20px}
 .target-frequency{margin:0;font-size:12px}.guidance{font-size:21px;min-height:25px}.hint{min-height:18px;margin:2px auto;font-size:12px}.motion{min-height:7px;padding:0 22px 5px}
 aside{padding:0 20px 8px;overflow:hidden}
 aside .string-heading{min-height:22px;margin:6px 0 3px;align-items:center}
 aside .string-heading h2{font-size:14px;line-height:1.1;white-space:nowrap}
 .guitar-neck .string{height:34px;min-height:34px}.guitar-neck .string-name{padding-block:2px}.guitar-neck .string strong{font-size:18px}
 .string-tip.guitar-tip,.neck-caption{display:none}
 .strings.sax-guide{padding:10px;gap:7px}.sax-copy small{display:none}.sax-transpose{padding-top:6px}
 .trail-heading{margin:6px 22px 3px}
 #pitch-trail{width:calc(100% - 44px);height:100%;min-height:135px;margin:0 22px}
 .meter-labels{margin:2px 22px 0}.status-strip{margin:0 22px;padding:4px 0}.privacy{margin:0 0 3px}
}

@media(max-width:380px){
 body[data-view=tuner] aside .string-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;height:auto;min-height:20px}
 body[data-view=tuner] aside .string-heading h2{font-size:13px;text-align:left;white-space:normal}
 body[data-view=tuner] aside .string-heading span{position:static;font-size:8px;text-align:right}
}
